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;
|
var showWindow = this.Visible || addon?.Visible == true;
|
||||||
|
|
||||||
if (!showWindow || !ImGui.Begin(this.Plugin.Name, ref this._visible)) {
|
if (!showWindow || !ImGui.Begin(this.Plugin.Name, ref this._visible)) {
|
||||||
if (ImGui.IsWindowCollapsed()) {
|
if (ImGui.IsWindowCollapsed() && addon != null && addon.Visible) {
|
||||||
if (addon != null && addon.Visible) {
|
// wait until addon is initialised to show
|
||||||
ImGui.SetWindowPos(new Vector2(addon.X, addon.Y - ImGui.GetFrameHeight()));
|
try {
|
||||||
|
_ = addon.Width;
|
||||||
|
} catch (NullReferenceException) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
ImGui.SetWindowPos(new Vector2(addon.X, addon.Y - ImGui.GetFrameHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue