Fix popout not being hidden
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Version>1.21.2</Version>
|
||||
<Version>1.21.3</Version>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user