diff --git a/SomethingNeedDoing/IPC/Deliveroo.cs b/SomethingNeedDoing/IPC/Deliveroo.cs index 49c660d5b..4f9aa47f7 100644 --- a/SomethingNeedDoing/IPC/Deliveroo.cs +++ b/SomethingNeedDoing/IPC/Deliveroo.cs @@ -8,9 +8,9 @@ internal static class DeliverooIPC private const string TurnInStartedStr = "Deliveroo.TurnInStarted"; private const string TurnInStoppedStr = "Deliveroo.TurnInStopped"; - internal static ICallGateSubscriber IsTurnInRunning; - internal static ICallGateSubscriber TurnInStarted; - internal static ICallGateSubscriber TurnInStopped; + internal static ICallGateSubscriber? IsTurnInRunning; + internal static ICallGateSubscriber? TurnInStarted; + internal static ICallGateSubscriber? TurnInStopped; internal static void Init() { diff --git a/SomethingNeedDoing/Interface/HelpWindow.cs b/SomethingNeedDoing/Interface/HelpWindow.cs index 69abc64d1..10c887f1e 100644 --- a/SomethingNeedDoing/Interface/HelpWindow.cs +++ b/SomethingNeedDoing/Interface/HelpWindow.cs @@ -12,7 +12,11 @@ using Dalamud.Interface.Colors; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; +using ECommons; +using ECommons.DalamudServices; using ImGuiNET; +using Lumina.Excel; +using Lumina.Excel.GeneratedSheets; namespace SomethingNeedDoing.Interface; @@ -268,7 +272,7 @@ public override void Draw() { if (ImGui.BeginTabBar("HelpTab")) { - var tabs = new (string Title, Action Dele)[] + var tabs = new (string Title, System.Action Dele)[] { ("Changelog", this.DrawChangelog), ("Options", this.DrawOptions), @@ -279,6 +283,7 @@ public override void Draw() ("Clicks", this.DrawClicks), ("Sends", this.DrawVirtualKeys), ("Conditions", this.DrawAllConditions), + ("Game Data", this.DrawGameData), }; foreach (var (title, dele) in tabs) @@ -315,6 +320,12 @@ static void DisplayChangelog(string date, string changes, bool separator = true) } ImGui.PushFont(UiBuilder.MonoFont); + + DisplayChangelog( + "2023-11-23", + "- Added GetLevel()\n" + + "- Added \"Game Data\" tab to the help menu."); + DisplayChangelog( "2023-11-23", "- Added GetPlayerRawXPos()\n" + @@ -932,6 +943,8 @@ float GetPlayerRawXPos() float GetPlayerRawYPos() float GetPlayerRawZPos() float GetDistanceToPoint(float x, float y, float z)) + +int GetLevel(uint ExpArrayIndex = -1) ".Trim(); ImGui.TextWrapped(text); @@ -1007,4 +1020,21 @@ private void DrawAllConditions() ImGui.PopStyleColor(); } } + + private readonly IEnumerable classJobSheet = Svc.Data.GetExcelSheet(Svc.ClientState.ClientLanguage)!.Where(x => !x.Name.RawString.IsNullOrEmpty()); + private void DrawGameData() + { + using var font = ImRaii.PushFont(UiBuilder.MonoFont); + + ImGui.TextWrapped("Misc Game Data Information"); + ImGui.Separator(); + + ImGui.TextWrapped("ClassJob"); + ImGui.PushStyleColor(ImGuiCol.Text, ShadedColor); + foreach (var cj in classJobSheet) + { + ImGui.Text($"{cj.Name}: Key={cj.RowId}; ExpArrayIndex={cj.ExpArrayIndex}"); + } + ImGui.PopStyleColor(); + } } diff --git a/SomethingNeedDoing/Misc/CommandInterface.cs b/SomethingNeedDoing/Misc/CommandInterface.cs index a9b5cc945..7a82ddb65 100644 --- a/SomethingNeedDoing/Misc/CommandInterface.cs +++ b/SomethingNeedDoing/Misc/CommandInterface.cs @@ -464,7 +464,7 @@ public unsafe int GetItemCount(int itemID, bool includeHQ = true) => public unsafe bool DeliverooIsTurnInRunning() { DeliverooIPC.Init(); - return DeliverooIPC.IsTurnInRunning.InvokeFunc(); + return DeliverooIPC.IsTurnInRunning!.InvokeFunc(); } /// @@ -533,6 +533,12 @@ private unsafe (uint Progress, uint Quality) GetActionResult(uint id) public float GetDistanceToPoint(float x, float y, float z) => Vector3.Distance(Svc.ClientState.LocalPlayer!.Position, new Vector3(x, y, z)); + public unsafe int GetLevel(int expArrayIndex = -1) + { + if (expArrayIndex == -1) expArrayIndex = Svc.ClientState.LocalPlayer!.ClassJob.GameData!.ExpArrayIndex; + return UIState.Instance()->PlayerState.ClassJobLevelArray[expArrayIndex]; + } + private unsafe int GetNodeTextAsInt(AtkTextNode* node, string error) { try