diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index 5609092..c956277 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,6 +1,6 @@ - 1.21.2 + 1.21.3 net8.0-windows enable enable diff --git a/ChatTwo/Plugin.cs b/ChatTwo/Plugin.cs index b9b4c8d..b049493 100755 --- a/ChatTwo/Plugin.cs +++ b/ChatTwo/Plugin.cs @@ -141,6 +141,8 @@ public sealed class Plugin : IDalamudPlugin if (Config.HideInLoadingScreens && Condition[ConditionFlag.BetweenAreas]) return; + ChatLogWindow.HideStateCheck(); + Interface.UiBuilder.DisableUserUiHide = !Config.HideWhenUiHidden; ChatLogWindow.DefaultText = ImGui.GetStyle().Colors[(int) ImGuiCol.Text]; diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs index 825604a..6e4c7d9 100644 --- a/ChatTwo/Ui/ChatLogWindow.cs +++ b/ChatTwo/Ui/ChatLogWindow.cs @@ -400,7 +400,8 @@ public sealed class ChatLogWindow : Window, IUiComponent private HideState _hideState = HideState.None; - public override unsafe void PreOpenCheck() + public bool IsHidden; + public void HideStateCheck() { // if the chat has no hide state and in a cutscene, set the hide state to cutscene if (Plugin.Config.HideDuringCutscenes && _hideState == HideState.None && (CutsceneActive || GposeActive)) @@ -418,17 +419,22 @@ public sealed class ChatLogWindow : Window, IUiComponent if (_hideState == HideState.User && Activate) _hideState = HideState.None; - if (_hideState is HideState.Cutscene or HideState.User) + if (_hideState is HideState.Cutscene or HideState.User || (Plugin.Config.HideWhenNotLoggedIn && !Plugin.ClientState.IsLoggedIn)) + { + IsHidden = true; + return; + } + + IsHidden = false; + } + + public override unsafe void PreOpenCheck() + { + if (IsHidden) { IsOpen = false; return; } - - if (Plugin.Config.HideWhenNotLoggedIn && !Plugin.ClientState.IsLoggedIn) { - IsOpen = false; - return; - } - IsOpen = true; Flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse; diff --git a/ChatTwo/Ui/Popout.cs b/ChatTwo/Ui/Popout.cs index a040861..e873b75 100644 --- a/ChatTwo/Ui/Popout.cs +++ b/ChatTwo/Ui/Popout.cs @@ -24,6 +24,16 @@ internal class Popout : Window DisableWindowSounds = true; } + public override void PreOpenCheck() + { + if (ChatLogWindow.IsHidden) + { + IsOpen = false; + return; + } + IsOpen = true; + } + public override void PreDraw() { if (ChatLogWindow.Plugin.Config is { OverrideStyle: true, ChosenStyle: not null })