diff --git a/ChatTwo/Configuration.cs b/ChatTwo/Configuration.cs
index 51e0804..de6e017 100755
--- a/ChatTwo/Configuration.cs
+++ b/ChatTwo/Configuration.cs
@@ -18,6 +18,7 @@ internal class Configuration : IPluginConfiguration
public bool HideWhenNotLoggedIn = true;
public bool HideWhenUiHidden = true;
public bool HideInLoadingScreens;
+ public bool HideInBattle;
public bool NativeItemTooltips = true;
public bool PrettierTimestamps = true;
public bool MoreCompactPretty;
@@ -70,6 +71,7 @@ internal class Configuration : IPluginConfiguration
HideWhenNotLoggedIn = other.HideWhenNotLoggedIn;
HideWhenUiHidden = other.HideWhenUiHidden;
HideInLoadingScreens = other.HideInLoadingScreens;
+ HideInBattle = other.HideInBattle;
NativeItemTooltips = other.NativeItemTooltips;
PrettierTimestamps = other.PrettierTimestamps;
MoreCompactPretty = other.MoreCompactPretty;
diff --git a/ChatTwo/Resources/Language.Designer.cs b/ChatTwo/Resources/Language.Designer.cs
index d81ed9e..0bbee95 100755
--- a/ChatTwo/Resources/Language.Designer.cs
+++ b/ChatTwo/Resources/Language.Designer.cs
@@ -2021,6 +2021,24 @@ namespace ChatTwo.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Hide the chat during battles..
+ ///
+ internal static string Options_HideInBattle_Description {
+ get {
+ return ResourceManager.GetString("Options_HideInBattle_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Hide during battle.
+ ///
+ internal static string Options_HideInBattle_Name {
+ get {
+ return ResourceManager.GetString("Options_HideInBattle_Name", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Hide {0} during loading screens..
///
diff --git a/ChatTwo/Resources/Language.resx b/ChatTwo/Resources/Language.resx
index f9547bf..1ea4d60 100644
--- a/ChatTwo/Resources/Language.resx
+++ b/ChatTwo/Resources/Language.resx
@@ -1033,4 +1033,10 @@
Emote
+
+ Hide during battle
+
+
+ Hide the chat during battles.
+
diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs
index 545cf96..a81ffc7 100644
--- a/ChatTwo/Ui/ChatLogWindow.cs
+++ b/ChatTwo/Ui/ChatLogWindow.cs
@@ -397,6 +397,7 @@ public sealed class ChatLogWindow : Window
SetChannel(tab.Channel ?? tab.PreviousChannel);
}
+ private static bool InBattle => Plugin.Condition[ConditionFlag.InCombat];
private static bool GposeActive => Plugin.Condition[ConditionFlag.WatchingCutscene];
private static bool CutsceneActive => Plugin.Condition[ConditionFlag.OccupiedInCutSceneEvent] || Plugin.Condition[ConditionFlag.WatchingCutscene78];
@@ -406,6 +407,7 @@ public sealed class ChatLogWindow : Window
Cutscene,
CutsceneOverride,
User,
+ Battle
}
private HideState CurrentHideState = HideState.None;
@@ -413,6 +415,14 @@ public sealed class ChatLogWindow : Window
public bool IsHidden;
public void HideStateCheck()
{
+ // if the chat has no hide state set, and the player has entered battle, we hide chat if they have configured it
+ if (Plugin.Config.HideInBattle && CurrentHideState == HideState.None && InBattle)
+ CurrentHideState = HideState.Battle;
+
+ // If the chat is hidden because of battle, we reset it here
+ if (CurrentHideState is HideState.Battle && !InBattle)
+ CurrentHideState = HideState.None;
+
// if the chat has no hide state and in a cutscene, set the hide state to cutscene
if (Plugin.Config.HideDuringCutscenes && CurrentHideState == HideState.None && (CutsceneActive || GposeActive))
CurrentHideState = HideState.Cutscene;
@@ -429,7 +439,7 @@ public sealed class ChatLogWindow : Window
if (CurrentHideState == HideState.User && Activate)
CurrentHideState = HideState.None;
- if (CurrentHideState is HideState.Cutscene or HideState.User || (Plugin.Config.HideWhenNotLoggedIn && !Plugin.ClientState.IsLoggedIn))
+ if (CurrentHideState is HideState.Cutscene or HideState.User or HideState.Battle || (Plugin.Config.HideWhenNotLoggedIn && !Plugin.ClientState.IsLoggedIn))
{
IsHidden = true;
return;
diff --git a/ChatTwo/Ui/SettingsTabs/Display.cs b/ChatTwo/Ui/SettingsTabs/Display.cs
index 1e42e57..2a1529f 100755
--- a/ChatTwo/Ui/SettingsTabs/Display.cs
+++ b/ChatTwo/Ui/SettingsTabs/Display.cs
@@ -36,6 +36,9 @@ internal sealed class Display : ISettingsTab
ImGuiUtil.OptionCheckbox(ref Mutable.HideInLoadingScreens, Language.Options_HideInLoadingScreens_Name, string.Format(Language.Options_HideInLoadingScreens_Description, Plugin.PluginName));
ImGui.Spacing();
+ ImGuiUtil.OptionCheckbox(ref Mutable.HideInBattle, Language.Options_HideInBattle_Name, Language.Options_HideInBattle_Description);
+ ImGui.Spacing();
+
ImGuiUtil.OptionCheckbox(ref Mutable.PrettierTimestamps, Language.Options_PrettierTimestamps_Name, Language.Options_PrettierTimestamps_Description);
if (Mutable.PrettierTimestamps)