feat: add option to hide when game ui is hidden
This commit is contained in:
parent
a5597f1c84
commit
252498515a
|
@ -15,6 +15,7 @@ internal class Configuration : IPluginConfiguration {
|
|||
public bool HideChat = true;
|
||||
public bool HideDuringCutscenes = true;
|
||||
public bool HideWhenNotLoggedIn = true;
|
||||
public bool HideWhenUiHidden = true;
|
||||
public bool NativeItemTooltips = true;
|
||||
public bool PrettierTimestamps = true;
|
||||
public bool MoreCompactPretty;
|
||||
|
@ -39,6 +40,7 @@ internal class Configuration : IPluginConfiguration {
|
|||
this.HideChat = other.HideChat;
|
||||
this.HideDuringCutscenes = other.HideDuringCutscenes;
|
||||
this.HideWhenNotLoggedIn = other.HideWhenNotLoggedIn;
|
||||
this.HideWhenUiHidden = other.HideWhenUiHidden;
|
||||
this.NativeItemTooltips = other.NativeItemTooltips;
|
||||
this.PrettierTimestamps = other.PrettierTimestamps;
|
||||
this.MoreCompactPretty = other.MoreCompactPretty;
|
||||
|
|
|
@ -88,10 +88,8 @@ internal sealed class PluginUi : IDisposable {
|
|||
);
|
||||
|
||||
var uiBuilder = this.Plugin.Interface.UiBuilder;
|
||||
uiBuilder.DisableAutomaticUiHide = true;
|
||||
uiBuilder.DisableCutsceneUiHide = true;
|
||||
uiBuilder.DisableGposeUiHide = true;
|
||||
uiBuilder.DisableUserUiHide = true;
|
||||
|
||||
uiBuilder.BuildFonts += this.BuildFonts;
|
||||
uiBuilder.Draw += this.Draw;
|
||||
|
@ -117,6 +115,7 @@ internal sealed class PluginUi : IDisposable {
|
|||
}
|
||||
|
||||
private void Draw() {
|
||||
this.Plugin.Interface.UiBuilder.DisableUserUiHide = !this.Plugin.Config.HideWhenUiHidden;
|
||||
this.DefaultText = ImGui.GetStyle().Colors[(int) ImGuiCol.Text];
|
||||
|
||||
var font = this.RegularFont.HasValue;
|
||||
|
|
|
@ -465,6 +465,24 @@ namespace ChatTwo.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hide {0} when the game UI is hidden..
|
||||
/// </summary>
|
||||
internal static string Options_HideWhenUiHidden_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_HideWhenUiHidden_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hide when game UI is hidden.
|
||||
/// </summary>
|
||||
internal static string Options_HideWhenUiHidden_Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_HideWhenUiHidden_Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The font {0} will use to display Japanese text..
|
||||
/// </summary>
|
||||
|
|
|
@ -401,4 +401,10 @@
|
|||
<data name="Options_CommandHelpSide_Description" xml:space="preserve">
|
||||
<value>The side of {0} to display help for commands on.</value>
|
||||
</data>
|
||||
<data name="Options_HideWhenUiHidden_Name" xml:space="preserve">
|
||||
<value>Hide when game UI is hidden</value>
|
||||
</data>
|
||||
<data name="Options_HideWhenUiHidden_Description" xml:space="preserve">
|
||||
<value>Hide {0} when the game UI is hidden.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -33,6 +33,13 @@ internal sealed class Display : ISettingsTab {
|
|||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref this.Mutable.HideWhenUiHidden,
|
||||
Language.Options_HideWhenUiHidden_Name,
|
||||
string.Format(Language.Options_HideWhenUiHidden_Description, Plugin.PluginName)
|
||||
);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(
|
||||
ref this.Mutable.NativeItemTooltips,
|
||||
Language.Options_NativeItemTooltips_Name,
|
||||
|
|
Loading…
Reference in New Issue