muffin v7.38.8

This commit is contained in:
alydev 2025-11-30 10:36:46 +10:00
parent 5e2d8f648b
commit 3e10cbbbf2
51 changed files with 2585 additions and 1972 deletions

View file

@ -0,0 +1,20 @@
using Questionable.Functions;
namespace Questionable.Controller.DebugCommands;
internal sealed class AbandonDutyCommandHandler : IDebugCommandHandler
{
private readonly GameFunctions _gameFunctions;
public string CommandName => "abandon-duty";
public AbandonDutyCommandHandler(GameFunctions gameFunctions)
{
_gameFunctions = gameFunctions;
}
public void Execute(string[] arguments)
{
_gameFunctions.AbandonDuty();
}
}

View file

@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Plugin.Services;
using Questionable.Data;
using Questionable.Functions;
using Questionable.Model.Common;
using Questionable.Model.Questing.Converter;
namespace Questionable.Controller.DebugCommands;
internal sealed class AethernetCommandHandler : IDebugCommandHandler
{
private readonly IDataManager _dataManager;
private readonly IClientState _clientState;
private readonly AetheryteFunctions _aetheryteFunctions;
private readonly IChatGui _chatGui;
public string CommandName => "aethernet";
public AethernetCommandHandler(IDataManager dataManager, IClientState clientState, AetheryteFunctions aetheryteFunctions, IChatGui chatGui)
{
_dataManager = dataManager;
_clientState = clientState;
_aetheryteFunctions = aetheryteFunctions;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
ushort territoryType = _clientState.TerritoryType;
Dictionary<EAetheryteLocation, string> values = AethernetShardConverter.Values;
AetheryteData aetheryteData = new AetheryteData(_dataManager);
HashSet<string> hashSet = new HashSet<string>();
Dictionary<string, List<(EAetheryteLocation, string, bool)>> dictionary = new Dictionary<string, List<(EAetheryteLocation, string, bool)>>();
EAetheryteLocation key;
string value;
foreach (KeyValuePair<EAetheryteLocation, string> item3 in values)
{
item3.Deconstruct(out key, out value);
EAetheryteLocation key2 = key;
string text = value;
if (aetheryteData.TerritoryIds.TryGetValue(key2, out var value2) && value2 == territoryType)
{
int num = text.IndexOf(']', StringComparison.Ordinal);
if (num > 0)
{
string item = text.Substring(1, num - 1);
hashSet.Add(item);
}
}
}
if (hashSet.Count == 0)
{
_chatGui.Print("No aethernet shards found in current zone.", "Questionable", 576);
return;
}
foreach (KeyValuePair<EAetheryteLocation, string> item4 in values)
{
item4.Deconstruct(out key, out value);
EAetheryteLocation eAetheryteLocation = key;
string text2 = value;
int num2 = text2.IndexOf(']', StringComparison.Ordinal);
if (num2 <= 0)
{
continue;
}
string text3 = text2.Substring(1, num2 - 1);
if (hashSet.Contains(text3))
{
if (!dictionary.ContainsKey(text3))
{
dictionary[text3] = new List<(EAetheryteLocation, string, bool)>();
}
bool item2 = _aetheryteFunctions.IsAetheryteUnlocked(eAetheryteLocation);
dictionary[text3].Add((eAetheryteLocation, text2, item2));
}
}
foreach (KeyValuePair<string, List<(EAetheryteLocation, string, bool)>> item5 in dictionary.OrderBy<KeyValuePair<string, List<(EAetheryteLocation, string, bool)>>, string>((KeyValuePair<string, List<(EAetheryteLocation Location, string Name, bool Unlocked)>> x) => x.Key))
{
item5.Deconstruct(out value, out var value3);
string value4 = value;
List<(EAetheryteLocation, string, bool)> list = value3;
List<(EAetheryteLocation, string, bool)> list2 = list.Where<(EAetheryteLocation, string, bool)>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Unlocked).ToList();
List<(EAetheryteLocation, string, bool)> list3 = list.Where<(EAetheryteLocation, string, bool)>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => !x.Unlocked).ToList();
_chatGui.Print($"Aethernet Shards in {value4} ({list.Count} total):", "Questionable", 576);
_chatGui.Print($" Unlocked: {list2.Count}", "Questionable", 576);
_chatGui.Print($" Missing: {list3.Count}", "Questionable", 576);
_chatGui.Print("", "Questionable", 576);
if (list3.Count > 0)
{
_chatGui.Print("Missing/Unattuned Aethernet Shards:", "Questionable", 576);
foreach (var item6 in list3.OrderBy<(EAetheryteLocation, string, bool), string>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Name))
{
_chatGui.Print(" " + item6.Item2, "Questionable", 576);
}
_chatGui.Print("", "Questionable", 576);
}
if (list2.Count > 0)
{
_chatGui.Print("Unlocked Aethernet Shards:", "Questionable", 576);
foreach (var item7 in list2.OrderBy<(EAetheryteLocation, string, bool), string>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Name))
{
_chatGui.Print(" " + item7.Item2, "Questionable", 576);
}
}
if (dictionary.Count > 1)
{
_chatGui.Print("", "Questionable", 576);
}
}
}
}

View file

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Questionable.Controller.DebugCommands;
internal sealed class DebugCommandExecutor
{
private readonly Dictionary<string, IDebugCommandHandler> _handlers;
public DebugCommandExecutor(IEnumerable<IDebugCommandHandler> handlers)
{
_handlers = handlers.ToDictionary<IDebugCommandHandler, string>((IDebugCommandHandler h) => h.CommandName, StringComparer.OrdinalIgnoreCase);
}
public bool TryExecute(string command, string[] arguments)
{
if (_handlers.TryGetValue(command, out IDebugCommandHandler value))
{
value.Execute(arguments);
return true;
}
return false;
}
}

View file

@ -0,0 +1,50 @@
using Dalamud.Plugin.Services;
using Questionable.Model;
using Questionable.Model.Questing;
using Questionable.Windows;
namespace Questionable.Controller.DebugCommands;
internal sealed class DebugOverlayCommandHandler : IDebugCommandHandler
{
private readonly DebugOverlay _debugOverlay;
private readonly QuestRegistry _questRegistry;
private readonly IChatGui _chatGui;
public string CommandName => "do";
public DebugOverlayCommandHandler(DebugOverlay debugOverlay, QuestRegistry questRegistry, IChatGui chatGui)
{
_debugOverlay = debugOverlay;
_questRegistry = questRegistry;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
ElementId elementId;
if (!_debugOverlay.DrawConditions())
{
_chatGui.PrintError("You don't have the debug overlay enabled.", "Questionable", 576);
}
else if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out elementId) && elementId != null)
{
if (_questRegistry.TryGetQuest(elementId, out Quest quest))
{
_debugOverlay.HighlightedQuest = quest.Id;
_chatGui.Print($"Set highlighted quest to {elementId} ({quest.Info.Name}).", "Questionable", 576);
}
else
{
_chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576);
}
}
else
{
_debugOverlay.HighlightedQuest = null;
_chatGui.Print("Cleared highlighted quest.", "Questionable", 576);
}
}
}

View file

@ -0,0 +1,39 @@
using System.Collections.Generic;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game;
namespace Questionable.Controller.DebugCommands;
internal sealed class FestivalsCommandHandler : IDebugCommandHandler
{
private readonly IChatGui _chatGui;
public string CommandName => "festivals";
public FestivalsCommandHandler(IChatGui chatGui)
{
_chatGui = chatGui;
}
public unsafe void Execute(string[] arguments)
{
List<string> list = new List<string>();
for (byte b = 0; b < 4; b++)
{
GameMain.Festival festival = GameMain.Instance()->ActiveFestivals[b];
if (festival.Id == 0)
{
list.Add($"Slot {b}: None");
}
else
{
list.Add($"Slot {b}: {festival.Id}({festival.Phase})");
}
}
_chatGui.Print("Festival slots:", "Questionable", 576);
foreach (string item in list)
{
_chatGui.Print(" " + item, "Questionable", 576);
}
}
}

View file

@ -0,0 +1,8 @@
namespace Questionable.Controller.DebugCommands;
internal interface IDebugCommandHandler
{
string CommandName { get; }
void Execute(string[] arguments);
}

View file

@ -0,0 +1,37 @@
using Dalamud.Plugin.Services;
using Lumina.Excel.Sheets;
using Questionable.Functions;
namespace Questionable.Controller.DebugCommands;
internal sealed class MountIdCommandHandler : IDebugCommandHandler
{
private readonly GameFunctions _gameFunctions;
private readonly IDataManager _dataManager;
private readonly IChatGui _chatGui;
public string CommandName => "mountid";
public MountIdCommandHandler(GameFunctions gameFunctions, IDataManager dataManager, IChatGui chatGui)
{
_gameFunctions = gameFunctions;
_dataManager = dataManager;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
ushort? mountId = _gameFunctions.GetMountId();
if (mountId.HasValue)
{
Mount? rowOrDefault = _dataManager.GetExcelSheet<Mount>().GetRowOrDefault(mountId.Value);
_chatGui.Print($"Mount ID: {mountId}, Name: {rowOrDefault?.Singular}, Obtainable: {((rowOrDefault?.Order == -1) ? "No" : "Yes")}", "Questionable", 576);
}
else
{
_chatGui.Print("You are not mounted.", "Questionable", 576);
}
}
}

View file

@ -0,0 +1,53 @@
using Dalamud.Plugin.Services;
using Questionable.Functions;
using Questionable.Model;
using Questionable.Model.Questing;
namespace Questionable.Controller.DebugCommands;
internal sealed class NextQuestCommandHandler : IDebugCommandHandler
{
private readonly QuestController _questController;
private readonly QuestRegistry _questRegistry;
private readonly QuestFunctions _questFunctions;
private readonly IChatGui _chatGui;
public string CommandName => "next";
public NextQuestCommandHandler(QuestController questController, QuestRegistry questRegistry, QuestFunctions questFunctions, IChatGui chatGui)
{
_questController = questController;
_questRegistry = questRegistry;
_questFunctions = questFunctions;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null)
{
Quest quest;
if (_questFunctions.IsQuestLocked(elementId))
{
_chatGui.PrintError($"Quest {elementId} is locked.", "Questionable", 576);
}
else if (_questRegistry.TryGetQuest(elementId, out quest))
{
_questController.SetNextQuest(quest);
_chatGui.Print($"Set next quest to {elementId} ({quest.Info.Name}).", "Questionable", 576);
}
else
{
_chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576);
}
}
else
{
_questController.SetNextQuest(null);
_chatGui.Print("Cleared next quest.", "Questionable", 576);
}
}
}

View file

@ -0,0 +1,220 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services;
using Lumina.Excel;
using Lumina.Excel.Sheets;
using Questionable.Functions;
using Questionable.Model;
using Questionable.Model.Questing;
namespace Questionable.Controller.DebugCommands;
internal sealed class QuestKillsCommandHandler : IDebugCommandHandler
{
private readonly QuestController _questController;
private readonly QuestFunctions _questFunctions;
private readonly IDataManager _dataManager;
private readonly IObjectTable _objectTable;
private readonly IChatGui _chatGui;
public string CommandName => "quest-kills";
public QuestKillsCommandHandler(QuestController questController, QuestFunctions questFunctions, IDataManager dataManager, IObjectTable objectTable, IChatGui chatGui)
{
_questController = questController;
_questFunctions = questFunctions;
_dataManager = dataManager;
_objectTable = objectTable;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
(QuestController.QuestProgress, QuestController.ECurrentQuestType)? currentQuestDetails = _questController.CurrentQuestDetails;
if (!currentQuestDetails.HasValue)
{
_chatGui.PrintError("No active quest.", "Questionable", 576);
return;
}
QuestController.QuestProgress item = currentQuestDetails.Value.Item1;
Questionable.Model.Quest quest = item.Quest;
QuestProgressInfo questProgressInfo = null;
if (quest.Id is QuestId elementId)
{
questProgressInfo = _questFunctions.GetQuestProgressInfo(elementId);
}
if (questProgressInfo == null)
{
_chatGui.PrintError("Unable to retrieve quest progress information.", "Questionable", 576);
return;
}
QuestSequence questSequence = quest.FindSequence(item.Sequence);
if (questSequence == null)
{
_chatGui.PrintError($"Sequence {item.Sequence} not found for quest {quest.Id}.", "Questionable", 576);
return;
}
QuestStep questStep = ((item.Step < questSequence.Steps.Count) ? questSequence.Steps[item.Step] : null);
if (questStep == null)
{
_chatGui.PrintError($"Step {item.Step} not found in sequence {item.Sequence}.", "Questionable", 576);
return;
}
_chatGui.Print($"Quest: {quest.Info.Name} ({quest.Id})", "Questionable", 576);
_chatGui.Print($"Sequence: {item.Sequence}, Step: {item.Step}", "Questionable", 576);
_chatGui.Print("", "Questionable", 576);
_chatGui.Print("Quest Variables: " + string.Join(", ", questProgressInfo.Variables.Select((byte v, int i) => $"[{i}]={v}")), "Questionable", 576);
_chatGui.Print("", "Questionable", 576);
ExcelSheet<BNpcName> bnpcNameSheet = _dataManager.GetExcelSheet<BNpcName>();
HashSet<uint> hashSet = new HashSet<uint>(questStep.KillEnemyDataIds);
foreach (ComplexCombatData complexCombatDatum in questStep.ComplexCombatData)
{
hashSet.Add(complexCombatDatum.DataId);
}
if (hashSet.Count > 0)
{
_chatGui.Print($"All Enemy DataIds Found: {hashSet.Count}", "Questionable", 576);
foreach (uint item3 in hashSet.OrderBy((uint x) => x))
{
(string Name, bool Found) tuple = GetEnemyName(item3);
var (value, _) = tuple;
if (tuple.Found)
{
_chatGui.Print($" - {value} (DataId: {item3})", "Questionable", 576);
}
else
{
_chatGui.Print($" - DataId: {item3}", "Questionable", 576);
}
}
_chatGui.Print("", "Questionable", 576);
}
if (questStep.ComplexCombatData.Count > 0)
{
_chatGui.Print($"Complex Combat Data Entries: {questStep.ComplexCombatData.Count}", "Questionable", 576);
_chatGui.Print("Kill Progress:", "Questionable", 576);
if (questStep.ComplexCombatData.Count == 1 && hashSet.Count > 1)
{
ComplexCombatData complexCombatData = questStep.ComplexCombatData[0];
int num = -1;
byte? b = null;
for (int num2 = 0; num2 < complexCombatData.CompletionQuestVariablesFlags.Count; num2++)
{
QuestWorkValue questWorkValue = complexCombatData.CompletionQuestVariablesFlags[num2];
if (questWorkValue != null && questWorkValue.Low.HasValue)
{
num = num2;
b = questWorkValue.Low;
break;
}
}
byte b2 = (byte)(((num >= 0 && num < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num] : 0) & 0xF);
string value2 = (b.HasValue ? $" {b2}/{b}" : "");
string value3 = ((b.HasValue && b2 >= b) ? "✓" : "○");
foreach (uint item4 in hashSet.OrderBy((uint x) => x))
{
(string Name, bool Found) tuple3 = GetEnemyName(item4);
var (value4, _) = tuple3;
if (tuple3.Found)
{
_chatGui.Print($" {value3} Slay {value4}.{value2} (DataId: {item4})", "Questionable", 576);
}
else
{
_chatGui.Print($" {value3} Slay enemy.{value2} (DataId: {item4})", "Questionable", 576);
}
}
}
else
{
for (int num3 = 0; num3 < questStep.ComplexCombatData.Count; num3++)
{
ComplexCombatData complexCombatData2 = questStep.ComplexCombatData[num3];
int num4 = -1;
byte? b3 = null;
bool flag = false;
for (int num5 = 0; num5 < complexCombatData2.CompletionQuestVariablesFlags.Count; num5++)
{
QuestWorkValue questWorkValue2 = complexCombatData2.CompletionQuestVariablesFlags[num5];
if (questWorkValue2 != null)
{
if (questWorkValue2.Low.HasValue)
{
num4 = num5;
b3 = questWorkValue2.Low;
flag = false;
break;
}
if (questWorkValue2.High.HasValue)
{
num4 = num5;
b3 = questWorkValue2.High;
flag = true;
break;
}
}
}
byte b4 = (byte)((num4 >= 0 && num4 < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num4] : 0);
byte b5 = (flag ? ((byte)(b4 >> 4)) : ((byte)(b4 & 0xF)));
string value5;
if (complexCombatData2.NameId.HasValue)
{
BNpcName? bNpcName = bnpcNameSheet?.GetRowOrDefault(complexCombatData2.NameId.Value);
value5 = ((!bNpcName.HasValue || string.IsNullOrEmpty(bNpcName.Value.Singular.ToString())) ? "enemy" : bNpcName.Value.Singular.ToString());
}
else
{
(string Name, bool Found) tuple5 = GetEnemyName(complexCombatData2.DataId);
string item2 = tuple5.Name;
value5 = (tuple5.Found ? item2 : "enemy");
}
string value6 = (b3.HasValue ? $" {b5}/{b3}" : "");
string value7 = ((b3.HasValue && b5 >= b3) ? "✓" : "○");
string value8 = (complexCombatData2.NameId.HasValue ? $" (DataId: {complexCombatData2.DataId}, NameId: {complexCombatData2.NameId})" : $" (DataId: {complexCombatData2.DataId})");
_chatGui.Print($" {value7} Slay {value5}.{value6}{value8}", "Questionable", 576);
}
}
_chatGui.Print("", "Questionable", 576);
}
else if (questStep.KillEnemyDataIds.Count == 0)
{
_chatGui.Print("No kill enemy data for this step.", "Questionable", 576);
_chatGui.Print("", "Questionable", 576);
}
if (questStep.CompletionQuestVariablesFlags.Count <= 0 || !questStep.CompletionQuestVariablesFlags.Any((QuestWorkValue x) => x != null))
{
return;
}
_chatGui.Print("Completion Flags (Debug):", "Questionable", 576);
for (int num6 = 0; num6 < questStep.CompletionQuestVariablesFlags.Count; num6++)
{
QuestWorkValue questWorkValue3 = questStep.CompletionQuestVariablesFlags[num6];
if (questWorkValue3 != null)
{
int num7 = ((num6 < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num6] : 0);
byte b6 = (byte)(num7 >> 4);
byte b7 = (byte)(num7 & 0xF);
string value9 = (((!questWorkValue3.High.HasValue || questWorkValue3.High == b6) && (!questWorkValue3.Low.HasValue || questWorkValue3.Low == b7)) ? " ✓" : " ✗");
_chatGui.Print($" [{num6}] Expected: H={questWorkValue3.High?.ToString(CultureInfo.InvariantCulture) ?? "any"} L={questWorkValue3.Low?.ToString(CultureInfo.InvariantCulture) ?? "any"} | Actual: H={b6.ToString(CultureInfo.InvariantCulture)} L={b7.ToString(CultureInfo.InvariantCulture)}{value9}", "Questionable", 576);
}
}
(string Name, bool Found) GetEnemyName(uint dataId)
{
if (_objectTable.FirstOrDefault((IGameObject x) => x is IBattleNpc battleNpc2 && battleNpc2.BaseId == dataId) is IBattleNpc { NameId: not 0u } battleNpc)
{
BNpcName? bNpcName2 = bnpcNameSheet?.GetRowOrDefault(battleNpc.NameId);
if (bNpcName2.HasValue && !string.IsNullOrEmpty(bNpcName2.Value.Singular.ToString()))
{
return (Name: bNpcName2.Value.Singular.ToString(), Found: true);
}
}
return (Name: string.Empty, Found: false);
}
}
}

View file

@ -0,0 +1,20 @@
using Questionable.Windows;
namespace Questionable.Controller.DebugCommands;
internal sealed class SequencesCommandHandler : IDebugCommandHandler
{
private readonly QuestSequenceWindow _questSequenceWindow;
public string CommandName => "seq";
public SequencesCommandHandler(QuestSequenceWindow questSequenceWindow)
{
_questSequenceWindow = questSequenceWindow;
}
public void Execute(string[] arguments)
{
_questSequenceWindow.ToggleOrUncollapse();
}
}

View file

@ -0,0 +1,20 @@
using Questionable.Windows;
namespace Questionable.Controller.DebugCommands;
internal sealed class SetupCommandHandler : IDebugCommandHandler
{
private readonly OneTimeSetupWindow _oneTimeSetupWindow;
public string CommandName => "setup";
public SetupCommandHandler(OneTimeSetupWindow oneTimeSetupWindow)
{
_oneTimeSetupWindow = oneTimeSetupWindow;
}
public void Execute(string[] arguments)
{
_oneTimeSetupWindow.IsOpenAndUncollapsed = true;
}
}

View file

@ -0,0 +1,58 @@
using Dalamud.Plugin.Services;
using Questionable.Model;
using Questionable.Model.Questing;
namespace Questionable.Controller.DebugCommands;
internal sealed class SimulateQuestCommandHandler : IDebugCommandHandler
{
private readonly QuestController _questController;
private readonly QuestRegistry _questRegistry;
private readonly IChatGui _chatGui;
public string CommandName => "sim";
public SimulateQuestCommandHandler(QuestController questController, QuestRegistry questRegistry, IChatGui chatGui)
{
_questController = questController;
_questRegistry = questRegistry;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null)
{
if (_questRegistry.TryGetQuest(elementId, out Quest quest))
{
byte sequence = 0;
int step = 0;
if (arguments.Length >= 2 && byte.TryParse(arguments[1], out var result))
{
QuestSequence questSequence = quest.FindSequence(result);
if (questSequence != null)
{
sequence = questSequence.Sequence;
if (arguments.Length >= 3 && int.TryParse(arguments[2], out var result2) && questSequence.FindStep(result2) != null)
{
step = result2;
}
}
}
_questController.SimulateQuest(quest, sequence, step);
_chatGui.Print($"Simulating quest {elementId} ({quest.Info.Name}).", "Questionable", 576);
}
else
{
_chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576);
}
}
else
{
_questController.SimulateQuest(null, 0, 0);
_chatGui.Print("Cleared simulated quest.", "Questionable", 576);
}
}
}

View file

@ -0,0 +1,66 @@
using System.Collections.Generic;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using Lumina.Excel;
using Lumina.Excel.Sheets;
namespace Questionable.Controller.DebugCommands;
internal sealed class TaxiCommandHandler : IDebugCommandHandler
{
private readonly IDataManager _dataManager;
private readonly IClientState _clientState;
private readonly IChatGui _chatGui;
public string CommandName => "taxi";
public TaxiCommandHandler(IDataManager dataManager, IClientState clientState, IChatGui chatGui)
{
_dataManager = dataManager;
_clientState = clientState;
_chatGui = chatGui;
}
public unsafe void Execute(string[] arguments)
{
List<string> list = new List<string>();
ExcelSheet<ChocoboTaxiStand> excelSheet = _dataManager.GetExcelSheet<ChocoboTaxiStand>();
UIState* ptr = UIState.Instance();
if (ptr == null)
{
_chatGui.PrintError("UIState is null", "Questionable", 576);
return;
}
for (int i = 0; i < 192; i++)
{
uint num = (uint)(i + 1179648);
try
{
if (excelSheet.HasRow(num) && ptr->IsChocoboTaxiStandUnlocked(num))
{
string value = excelSheet.GetRow(num).PlaceName.ToString();
if (string.IsNullOrEmpty(value))
{
value = "Unknown";
}
list.Add($"{value} (ID: {i}, Row: 0x{num:X})");
}
}
catch
{
}
}
_chatGui.Print($"Unlocked taxi stands ({list.Count}):", "Questionable", 576);
if (list.Count == 0)
{
_chatGui.Print(" (No unlocked taxi stands found)", "Questionable", 576);
return;
}
foreach (string item in list)
{
_chatGui.Print(" - " + item, "Questionable", 576);
}
}
}

View file

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Plugin.Services;
using Questionable.Functions;
namespace Questionable.Controller.DebugCommands;
internal sealed class UnlockLinksCommandHandler : IDebugCommandHandler
{
private readonly GameFunctions _gameFunctions;
private readonly IChatGui _chatGui;
private IReadOnlyList<uint> _previouslyUnlockedUnlockLinks = Array.Empty<uint>();
public string CommandName => "unlock-links";
public UnlockLinksCommandHandler(GameFunctions gameFunctions, IChatGui chatGui)
{
_gameFunctions = gameFunctions;
_chatGui = chatGui;
}
public void Execute(string[] arguments)
{
IReadOnlyList<uint> unlockLinks = _gameFunctions.GetUnlockLinks();
if (unlockLinks.Count >= 0)
{
_chatGui.Print($"Saved {unlockLinks.Count} unlock links to log.", "Questionable", 576);
List<uint> list = unlockLinks.Except(_previouslyUnlockedUnlockLinks).ToList();
if (_previouslyUnlockedUnlockLinks.Count > 0 && list.Count > 0)
{
_chatGui.Print("New unlock links: " + string.Join(", ", list), "Questionable", 576);
}
}
else
{
_chatGui.PrintError("Could not query unlock links.", "Questionable", 576);
}
_previouslyUnlockedUnlockLinks = unlockLinks;
}
public void Reset()
{
_previouslyUnlockedUnlockLinks = Array.Empty<uint>();
}
}