fix: check if docked on last frame
This commit is contained in:
parent
9f1fea0d2f
commit
5d0e1298c8
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue