feat: add option to hide when not logged in

This commit is contained in:
Anna 2022-02-06 03:45:16 -05:00
parent b2546c439e
commit b82cb7b462
5 changed files with 33 additions and 0 deletions

View File

@ -14,6 +14,7 @@ internal class Configuration : IPluginConfiguration {
public bool HideChat = true;
public bool HideDuringCutscenes = true;
public bool HideWhenNotLoggedIn = true;
public bool NativeItemTooltips = true;
public bool PrettierTimestamps = true;
public bool MoreCompactPretty;
@ -36,6 +37,7 @@ internal class Configuration : IPluginConfiguration {
internal void UpdateFrom(Configuration other) {
this.HideChat = other.HideChat;
this.HideDuringCutscenes = other.HideDuringCutscenes;
this.HideWhenNotLoggedIn = other.HideWhenNotLoggedIn;
this.NativeItemTooltips = other.NativeItemTooltips;
this.PrettierTimestamps = other.PrettierTimestamps;
this.MoreCompactPretty = other.MoreCompactPretty;

View File

@ -357,6 +357,24 @@ namespace ChatTwo.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Hide the chat when you are not logged in to a character..
/// </summary>
internal static string Options_HideWhenNotLoggedIn_Description {
get {
return ResourceManager.GetString("Options_HideWhenNotLoggedIn_Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hide when not logged in.
/// </summary>
internal static string Options_HideWhenNotLoggedIn_Name {
get {
return ResourceManager.GetString("Options_HideWhenNotLoggedIn_Name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The font Chat 2 will use to display Japanese text..
/// </summary>

View File

@ -353,4 +353,10 @@
<data name="ChatLog_Tabs_Delete" xml:space="preserve">
<value>Delete tab</value>
</data>
<data name="Options_HideWhenNotLoggedIn_Name" xml:space="preserve">
<value>Hide when not logged in</value>
</data>
<data name="Options_HideWhenNotLoggedIn_Description" xml:space="preserve">
<value>Hide the chat when you are not logged in to a character.</value>
</data>
</root>

View File

@ -296,6 +296,10 @@ internal sealed class ChatLog : IUiComponent {
return;
}
if (this.Ui.Plugin.Config.HideWhenNotLoggedIn && !this.Ui.Plugin.ClientState.IsLoggedIn) {
return;
}
var flags = ImGuiWindowFlags.None;
if (!this.Ui.Plugin.Config.CanMove) {
flags |= ImGuiWindowFlags.NoMove;

View File

@ -22,6 +22,9 @@ internal sealed class Display : ISettingsTab {
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideDuringCutscenes, Language.Options_HideDuringCutscenes_Name, Language.Options_HideDuringCutscenes_Description);
ImGui.Spacing();
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideWhenNotLoggedIn, Language.Options_HideWhenNotLoggedIn_Name, Language.Options_HideWhenNotLoggedIn_Description);
ImGui.Spacing();
ImGuiUtil.OptionCheckbox(ref this.Mutable.NativeItemTooltips, Language.Options_NativeItemTooltips_Name, Language.Options_NativeItemTooltips_Description);
ImGui.Spacing();