Fix wrong menu type for right-clicking quests in journal
authorLiza Carvelli <liza@carvel.li>
Sun, 10 Aug 2025 18:22:58 +0000 (20:22 +0200)
committerLiza Carvelli <liza@carvel.li>
Sun, 10 Aug 2025 18:22:58 +0000 (20:22 +0200)
Questionable/Windows/JournalComponents/QuestJournalUtils.cs

index 37c5186..dc29a50 100644 (file)
@@ -32,16 +32,22 @@ internal sealed class QuestJournalUtils
         if (!popup)
             return;
 
-        if (ImGui.MenuItem("Start as next quest", _questFunctions.IsReadyToAcceptQuest(questInfo.QuestId)))
+        using (ImRaii.Disabled(!_questFunctions.IsReadyToAcceptQuest(questInfo.QuestId)))
         {
-            _questController.SetNextQuest(quest);
-            _questController.Start(label);
+            if (ImGui.MenuItem("Start as next quest"))
+            {
+                _questController.SetNextQuest(quest);
+                _questController.Start(label);
+            }
         }
 
         bool openInQuestMap = _commandManager.Commands.ContainsKey("/questinfo");
-        if (ImGui.MenuItem("View in Quest Map", questInfo.QuestId is QuestId && openInQuestMap))
+        using (ImRaii.Disabled(!(questInfo.QuestId is QuestId) || !openInQuestMap))
         {
-            _commandManager.ProcessCommand($"/questinfo {questInfo.QuestId}");
+            if (ImGui.MenuItem("View in Quest Map"))
+            {
+                _commandManager.ProcessCommand($"/questinfo {questInfo.QuestId}");
+            }
         }
     }