fix: don't show window until PF is initialised

This commit is contained in:
Anna 2021-02-16 19:45:41 -05:00
parent c2a136d95c
commit b5c2e7d08b
1 changed files with 7 additions and 3 deletions

View File

@ -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;