fix: don't show window until PF is initialised
This commit is contained in:
parent
c2a136d95c
commit
b5c2e7d08b
|
@ -123,10 +123,14 @@ namespace BetterPartyFinder {
|
|||
var showWindow = this.Visible || addon?.Visible == true;
|
||||
|
||||
if (!showWindow || !ImGui.Begin(this.Plugin.Name, ref this._visible)) {
|
||||
if (ImGui.IsWindowCollapsed()) {
|
||||
if (addon != null && addon.Visible) {
|
||||
ImGui.SetWindowPos(new Vector2(addon.X, addon.Y - ImGui.GetFrameHeight()));
|
||||
if (ImGui.IsWindowCollapsed() && addon != null && addon.Visible) {
|
||||
// wait until addon is initialised to show
|
||||
try {
|
||||
_ = addon.Width;
|
||||
} catch (NullReferenceException) {
|
||||
return;
|
||||
}
|
||||
ImGui.SetWindowPos(new Vector2(addon.X, addon.Y - ImGui.GetFrameHeight()));
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue