GPR: Fix editor window preventing ESC menu opening because of dalamud's terrible...
authorLiza Carvelli <liza@carvel.li>
Mon, 12 Aug 2024 16:14:47 +0000 (18:14 +0200)
committerLiza Carvelli <liza@carvel.li>
Mon, 12 Aug 2024 16:14:47 +0000 (18:14 +0200)
GatheringPathRenderer/RendererPlugin.cs
GatheringPathRenderer/Windows/EditorWindow.cs

index e90e67b439658022db9de9e2252fd0d3365056bb..50f9e4a749a5d6b171582fa2d423451c35f7c753 100644 (file)
@@ -35,6 +35,7 @@ public sealed class RendererPlugin : IDalamudPlugin
     private readonly EditorWindow _editorWindow;
 
     private readonly List<GatheringLocationContext> _gatheringLocations = [];
+    private EClassJob _currentClassJob;
 
     public RendererPlugin(IDalamudPluginInterface pluginInterface, IClientState clientState,
         ICommandManager commandManager, IDataManager dataManager, ITargetManager targetManager, IChatGui chatGui,
@@ -56,6 +57,7 @@ public sealed class RendererPlugin : IDalamudPlugin
         _editorWindow = new EditorWindow(this, _editorCommands, dataManager, targetManager, clientState, objectTable)
             { IsOpen = true };
         _windowSystem.AddWindow(_editorWindow);
+        _currentClassJob = (EClassJob?)_clientState.LocalPlayer?.ClassJob.Id ?? EClassJob.Adventurer;
 
         _pluginInterface.GetIpcSubscriber<object>("Questionable.ReloadData")
             .Subscribe(Reload);
@@ -176,9 +178,13 @@ public sealed class RendererPlugin : IDalamudPlugin
 
     private void TerritoryChanged(ushort territoryId) => Redraw();
 
-    private void ClassJobChanged(uint classJobId) => Redraw((EClassJob)classJobId);
+    private void ClassJobChanged(uint classJobId)
+    {
+        _currentClassJob = (EClassJob)classJobId;
+        Redraw(_currentClassJob);
+    }
 
-    internal void Redraw() => Redraw((EClassJob)_clientState.LocalPlayer!.ClassJob.Id);
+    internal void Redraw() => Redraw(_currentClassJob);
 
     private void Redraw(EClassJob classJob)
     {
index 7541001f339fe7a98123cd0e815a7e5b90a5cf88..e081c96710c8f5b2cea035e1b90e9b9ece713cf6 100644 (file)
@@ -34,7 +34,8 @@ internal sealed class EditorWindow : Window
 
     public EditorWindow(RendererPlugin plugin, EditorCommands editorCommands, IDataManager dataManager,
         ITargetManager targetManager, IClientState clientState, IObjectTable objectTable)
-        : base("Gathering Path Editor###QuestionableGatheringPathEditor")
+        : base("Gathering Path Editor###QuestionableGatheringPathEditor",
+            ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.NoNavFocus)
     {
         _plugin = plugin;
         _editorCommands = editorCommands;
@@ -47,7 +48,11 @@ internal sealed class EditorWindow : Window
         {
             MinimumSize = new Vector2(300, 300),
         };
+
+        RespectCloseHotkey = false;
         ShowCloseButton = false;
+        AllowPinning = false;
+        AllowClickthrough = false;
     }
 
     public override void Update()