Hide steps from debug overlay that aren't in the same territory

This commit is contained in:
Liza 2024-06-19 09:45:43 +02:00
parent 2003906bb2
commit 0ac2757a57
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

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