From 5d0e1298c8ec054def4e7617c5caa953997cc2f0 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 12 Jun 2022 10:39:29 -0400 Subject: [PATCH] fix: check if docked on last frame --- ChatTwo/Ui/ChatLog.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ChatTwo/Ui/ChatLog.cs b/ChatTwo/Ui/ChatLog.cs index a3a4e00..f405ff3 100755 --- a/ChatTwo/Ui/ChatLog.cs +++ b/ChatTwo/Ui/ChatLog.cs @@ -270,6 +270,7 @@ internal sealed class ChatLog : IUiComponent { } private unsafe ImGuiViewport* _lastViewport; + private bool _wasDocked; private void HandleKeybinds(bool modifiersOnly = false) { var modifierState = (ModifierFlag) 0; @@ -404,7 +405,7 @@ internal sealed class ChatLog : IUiComponent { flags |= ImGuiWindowFlags.NoTitleBar; } - if (this._lastViewport == ImGuiHelpers.MainViewport.NativePtr && !ImGui.IsWindowDocked()) { + if (this._lastViewport == ImGuiHelpers.MainViewport.NativePtr && !this._wasDocked) { ImGui.SetNextWindowBgAlpha(this.Ui.Plugin.Config.WindowAlpha / 100f); } @@ -412,6 +413,7 @@ internal sealed class ChatLog : IUiComponent { if (!ImGui.Begin($"{this.Ui.Plugin.Name}###chat2", flags)) { this._lastViewport = ImGui.GetWindowViewport().NativePtr; + this._wasDocked = ImGui.IsWindowDocked(); ImGui.End(); return false; } @@ -425,6 +427,7 @@ internal sealed class ChatLog : IUiComponent { } this._lastViewport = ImGui.GetWindowViewport().NativePtr; + this._wasDocked = ImGui.IsWindowDocked(); var currentTab = this.Ui.Plugin.Config.SidebarTabView ? this.DrawTabSidebar()