Fix popout not being hidden

This commit is contained in:
Infi
2024-04-17 22:25:06 +02:00
parent 7d1ab8b98e
commit 91a8dd942d
4 changed files with 27 additions and 9 deletions
+14 -8
View File
@@ -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;
+10
View File
@@ -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 })