Minor cleanup

master v0.6
Liza 2024-06-09 16:37:26 +02:00
parent 81e849abc3
commit 375a289659
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 25 additions and 11 deletions

View File

@ -12,6 +12,7 @@ using Lumina.Excel.GeneratedSheets;
using Microsoft.Extensions.Logging;
using Questionable.Model.V1;
using Quest = Questionable.Model.Quest;
using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.ValueType;
namespace Questionable.Controller;
@ -84,7 +85,10 @@ internal sealed class GameUiController : IDisposable
List<string?> answers = new();
for (ushort i = 7; i < addonSelectString->AtkUnitBase.AtkValuesCount; ++i)
answers.Add(addonSelectString->AtkUnitBase.AtkValues[i].ReadAtkString());
{
if (addonSelectString->AtkUnitBase.AtkValues[i].Type == ValueType.String)
answers.Add(addonSelectString->AtkUnitBase.AtkValues[i].ReadAtkString());
}
int? answer = HandleListChoice(actualPrompt, answers, checkAllSteps);
if (answer != null)

View File

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using Dalamud.Game.ClientState.Objects;
@ -75,14 +76,19 @@ internal sealed class DebugWindow : LWindow, IPersistableWindowConfig, IDisposab
return currentQuest == null || !currentQuest.Quest.Data.TerritoryBlacklist.Contains(_clientState.TerritoryType);
}
public override unsafe void Draw()
public override void Draw()
{
if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null)
{
ImGui.Text("Not logged in.");
return;
}
DrawQuest();
ImGui.Separator();
DrawCreationUtils();
ImGui.Separator();
DrawQuickAccessButtons();
}
private unsafe void DrawQuest()
{
var currentQuest = _questController.CurrentQuest;
if (currentQuest != null)
{
@ -146,8 +152,11 @@ internal sealed class DebugWindow : LWindow, IPersistableWindowConfig, IDisposab
}
else
ImGui.Text("No active quest");
}
ImGui.Separator();
private unsafe void DrawCreationUtils()
{
Debug.Assert(_clientState.LocalPlayer != null, "_clientState.LocalPlayer != null");
ImGui.Text(
$"Current TerritoryId: {_clientState.TerritoryType}, Flying: {(_gameFunctions.IsFlyingUnlockedInCurrentZone() ? "Yes" : "No")}");
@ -209,7 +218,7 @@ internal sealed class DebugWindow : LWindow, IPersistableWindowConfig, IDisposab
if (ImGui.Button("Interact"))
{
ulong result = TargetSystem.Instance()->InteractWithObject(
(FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_targetManager.Target.Address, false);
(GameObject*)_targetManager.Target.Address, false);
_logger.LogInformation("XXXXX Interaction Result: {Result}", result);
}
@ -251,9 +260,10 @@ internal sealed class DebugWindow : LWindow, IPersistableWindowConfig, IDisposab
""");
}
}
}
ImGui.Separator();
private unsafe void DrawQuickAccessButtons()
{
var map = AgentMap.Instance();
ImGui.BeginDisabled(map == null || map->IsFlagMarkerSet == 0 ||
map->FlagMapMarker.TerritoryId != _clientState.TerritoryType);