diff --git a/Dalamud/Game/ClientState/ClientState.cs b/Dalamud/Game/ClientState/ClientState.cs index 88b8e885c..0d50c2002 100644 --- a/Dalamud/Game/ClientState/ClientState.cs +++ b/Dalamud/Game/ClientState/ClientState.cs @@ -11,6 +11,7 @@ using Dalamud.Game.ClientState.Keys; using Dalamud.Game.ClientState.Objects; using Dalamud.Game.ClientState.Objects.SubKinds; using Dalamud.Game.ClientState.Party; +using Dalamud.Game.Gui; using Dalamud.Game.Network.Internal; using Dalamud.Hooking; using Dalamud.IoC; @@ -164,12 +165,14 @@ namespace Dalamud.Game.ClientState private void FrameworkOnOnUpdateEvent(Framework framework) { var condition = Service.Get(); + var gameGui = Service.Get(); if (condition.Any() && this.lastConditionNone == true) { Log.Debug("Is login"); this.lastConditionNone = false; this.IsLoggedIn = true; this.Login?.Invoke(this, null); + gameGui.ResetUiHideState(); } if (!condition.Any() && this.lastConditionNone == false) @@ -178,6 +181,7 @@ namespace Dalamud.Game.ClientState this.lastConditionNone = true; this.IsLoggedIn = false; this.Logout?.Invoke(this, null); + gameGui.ResetUiHideState(); } } } diff --git a/Dalamud/Game/Gui/GameGui.cs b/Dalamud/Game/Gui/GameGui.cs index d3282df07..fce32155c 100644 --- a/Dalamud/Game/Gui/GameGui.cs +++ b/Dalamud/Game/Gui/GameGui.cs @@ -459,6 +459,14 @@ namespace Dalamud.Game.Gui this.handleActionOutHook.Dispose(); } + /// + /// Reset the stored "UI hide" state. + /// + internal void ResetUiHideState() + { + this.GameUiHidden = false; + } + private IntPtr HandleSetGlobalBgmDetour(ushort bgmKey, byte a2, uint a3, uint a4, uint a5, byte a6) { var retVal = this.setGlobalBgmHook.Original(bgmKey, a2, a3, a4, a5, a6); @@ -570,6 +578,7 @@ namespace Dalamud.Game.Gui private IntPtr ToggleUiHideDetour(IntPtr thisPtr, byte unknownByte) { + // TODO(goat): We should read this from memory directly, instead of relying on catching every toggle. this.GameUiHidden = !this.GameUiHidden; try