Hide steps from debug overlay that aren't in the same territory
authorLiza Carvelli <liza@carvel.li>
Wed, 19 Jun 2024 07:45:43 +0000 (09:45 +0200)
committerLiza Carvelli <liza@carvel.li>
Wed, 19 Jun 2024 07:45:43 +0000 (09:45 +0200)
Questionable/Windows/DebugOverlay.cs

index 02f301397cadc90b0b3538991ff6d921675e739b..aba0e8a1bcae8dce8ec67b859a201a370ff7bf9e 100644 (file)
@@ -15,15 +15,18 @@ internal sealed class DebugOverlay : Window
 {
     private readonly QuestController _questController;
     private readonly IGameGui _gameGui;
+    private readonly IClientState _clientState;
     private readonly Configuration _configuration;
 
-    public DebugOverlay(QuestController questController, IGameGui gameGui, Configuration configuration)
+    public DebugOverlay(QuestController questController, IGameGui gameGui, IClientState clientState,
+        Configuration configuration)
         : base("Questionable Debug Overlay###QuestionableDebugOverlay",
             ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoBackground |
             ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoSavedSettings, true)
     {
         _questController = questController;
         _gameGui = gameGui;
+        _clientState = clientState;
         _configuration = configuration;
 
         Position = Vector2.Zero;
@@ -53,7 +56,10 @@ internal sealed class DebugOverlay : Window
         for (int i = currentQuest.Step; i <= sequence.Steps.Count; ++i)
         {
             QuestStep? step = sequence.FindStep(i);
-            if (step == null || step.Position == null || step.Disabled)
+            if (step == null ||
+                step.Position == null ||
+                step.Disabled ||
+                step.TerritoryId != _clientState.TerritoryType)
                 continue;
 
             bool visible = _gameGui.WorldToScreen(step.Position.Value, out Vector2 screenPos);