Code clean up
authorLiza Carvelli <liza@carvel.li>
Wed, 14 May 2025 00:12:53 +0000 (02:12 +0200)
committerLiza Carvelli <liza@carvel.li>
Wed, 14 May 2025 00:12:53 +0000 (02:12 +0200)
Questionable/Controller/Steps/Shared/ExtraConditionUtils.cs
Questionable/External/QuestionableIpc.cs
Questionable/Windows/JournalComponents/QuestJournalUtils.cs
Questionable/Windows/QuestComponents/ActiveQuestComponent.cs
Questionable/Windows/QuestSelectionWindow.cs

index 1572f4e..2f9e039 100644 (file)
@@ -10,18 +10,11 @@ namespace Questionable.Controller.Steps.Shared;
 
 internal sealed class ExtraConditionUtils
 {
-    private readonly Configuration _configuration;
     private readonly IClientState _clientState;
-    private readonly ILogger<ExtraConditionUtils> _logger;
 
-    public ExtraConditionUtils(
-        Configuration configuration,
-        IClientState clientState,
-        ILogger<ExtraConditionUtils> logger)
+    public ExtraConditionUtils(IClientState clientState)
     {
-        _configuration = configuration;
         _clientState = clientState;
-        _logger = logger;
     }
 
     public bool MatchesExtraCondition(EExtraSkipCondition skipCondition)
index b1aed89..b59ae3f 100644 (file)
@@ -121,8 +121,8 @@ internal sealed class QuestionableIpc : IDisposable
         if (progress == null)
             return null;
 
-        string? questId = progress.Quest.Id.ToString();
-        if (questId == null)
+        string questId = progress.Quest.Id.ToString();
+        if (string.IsNullOrEmpty(questId))
             return null;
 
         QuestStep? step = progress.Quest.FindSequence(progress.Sequence)?.FindStep(progress.Step);
index 906dd9d..bb921e5 100644 (file)
@@ -40,11 +40,10 @@ internal sealed class QuestJournalUtils
             _questController.Start(label);
         }
 
-        bool openInQuestMap = _commandManager.Commands.TryGetValue("/questinfo", out var commandInfo);
+        bool openInQuestMap = _commandManager.Commands.ContainsKey("/questinfo");
         if (ImGui.MenuItem("View in Quest Map", questInfo.QuestId is QuestId && openInQuestMap))
         {
-            _commandManager.DispatchCommand("/questinfo", questInfo.QuestId.ToString() ?? string.Empty,
-                commandInfo!);
+            _commandManager.ProcessCommand($"/questinfo {questInfo.QuestId}");
         }
     }
 
index 520fd10..7da6ae5 100644 (file)
@@ -335,12 +335,11 @@ internal sealed partial class ActiveQuestComponent
             if (ImGuiComponents.IconButton(FontAwesomeIcon.SortAmountDown))
                 _priorityWindow.ToggleOrUncollapse();
 
-            if (_commandManager.Commands.TryGetValue("/questinfo", out var commandInfo))
+            if (_commandManager.Commands.ContainsKey("/questinfo"))
             {
                 ImGui.SameLine();
                 if (ImGuiComponents.IconButton(FontAwesomeIcon.Atlas))
-                    _commandManager.DispatchCommand("/questinfo",
-                        currentQuest.Quest.Id.ToString() ?? string.Empty, commandInfo);
+                    _commandManager.ProcessCommand($"/questinfo {currentQuest.Quest.Id}");
             }
         }
     }
index c93c7f3..fa5b56d 100644 (file)
@@ -170,7 +170,7 @@ internal sealed class QuestSelectionWindow : LWindow
         {
             ImGui.TableNextRow();
 
-            string questId = quest.QuestId.ToString() ?? string.Empty;
+            string questId = quest.QuestId.ToString();
             bool isKnownQuest = _questRegistry.TryGetQuest(quest.QuestId, out var knownQuest);
 
             if (ImGui.TableNextColumn())