fix: check if docked on last frame
This commit is contained in:
@@ -270,6 +270,7 @@ internal sealed class ChatLog : IUiComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private unsafe ImGuiViewport* _lastViewport;
|
private unsafe ImGuiViewport* _lastViewport;
|
||||||
|
private bool _wasDocked;
|
||||||
|
|
||||||
private void HandleKeybinds(bool modifiersOnly = false) {
|
private void HandleKeybinds(bool modifiersOnly = false) {
|
||||||
var modifierState = (ModifierFlag) 0;
|
var modifierState = (ModifierFlag) 0;
|
||||||
@@ -404,7 +405,7 @@ internal sealed class ChatLog : IUiComponent {
|
|||||||
flags |= ImGuiWindowFlags.NoTitleBar;
|
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);
|
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)) {
|
if (!ImGui.Begin($"{this.Ui.Plugin.Name}###chat2", flags)) {
|
||||||
this._lastViewport = ImGui.GetWindowViewport().NativePtr;
|
this._lastViewport = ImGui.GetWindowViewport().NativePtr;
|
||||||
|
this._wasDocked = ImGui.IsWindowDocked();
|
||||||
ImGui.End();
|
ImGui.End();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -425,6 +427,7 @@ internal sealed class ChatLog : IUiComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._lastViewport = ImGui.GetWindowViewport().NativePtr;
|
this._lastViewport = ImGui.GetWindowViewport().NativePtr;
|
||||||
|
this._wasDocked = ImGui.IsWindowDocked();
|
||||||
|
|
||||||
var currentTab = this.Ui.Plugin.Config.SidebarTabView
|
var currentTab = this.Ui.Plugin.Config.SidebarTabView
|
||||||
? this.DrawTabSidebar()
|
? this.DrawTabSidebar()
|
||||||
|
|||||||
Reference in New Issue
Block a user