Procházet zdrojové kódy

Fix window classes not checking if conditions changed to update flags.

SheepGoMeh před 2 roky
rodič
revize
93872f1cab

+ 4 - 1
HuntBuddy/Windows/ConfigurationWindow.cs

@@ -16,7 +16,10 @@ public class ConfigurationWindow : Window
     {
         this.Size = Vector2.Zero;
         this.SizeCondition = ImGuiCond.Always;
-        
+    }
+
+    public override void PreOpenCheck()
+    {
         if (Plugin.Instance.Configuration.LockWindowPositions)
         {
             this.Flags |= ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove;

+ 5 - 2
HuntBuddy/Windows/LocalHuntsWindow.cs

@@ -20,6 +20,11 @@ public class LocalHuntsWindow : Window
         this.Size = Vector2.Zero;
         this.SizeCondition = ImGuiCond.Always;
 
+        this.IsOpen = true;
+    }
+
+    public override void PreOpenCheck()
+    {
         if (Plugin.Instance.Configuration.HideLocalHuntBackground)
         {
             this.Flags |= ImGuiWindowFlags.NoBackground;
@@ -29,8 +34,6 @@ public class LocalHuntsWindow : Window
         {
             this.Flags |= ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove;
         }
-
-        this.IsOpen = true;
     }
 
     public override unsafe bool DrawConditions() =>

+ 3 - 0
HuntBuddy/Windows/MainWindow.cs

@@ -20,7 +20,10 @@ public class MainWindow : Window
     {
         this.Size = new Vector2(400 * ImGui.GetIO().FontGlobalScale, 500);
         this.SizeCondition = ImGuiCond.Once;
+    }
 
+    public override void PreOpenCheck()
+    {
         if (Plugin.Instance.Configuration.LockWindowPositions)
         {
             this.Flags |= ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove;