fix: check if docked on last frame

This commit is contained in:
Anna 2022-06-12 10:39:29 -04:00
parent 9f1fea0d2f
commit 5d0e1298c8
1 changed files with 4 additions and 1 deletions

View File

@ -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()