diff --git a/Brio/Capabilities/Debug/DebugCapability.cs b/Brio/Capabilities/Debug/DebugCapability.cs index 5fa12fce..c4feee3c 100644 --- a/Brio/Capabilities/Debug/DebugCapability.cs +++ b/Brio/Capabilities/Debug/DebugCapability.cs @@ -21,11 +21,11 @@ public unsafe class DebugCapability : Capability public bool IsPosing => _ktisisIPC.IsPosing; - public DebugCapability(IClientState clientState, Entity parent, GPoseService gPoseService, KtisisService ktisisIPC) : base(parent) + public DebugCapability(IClientState clientState, IObjectTable objectTable, Entity parent, GPoseService gPoseService, KtisisService ktisisIPC) : base(parent) { _gPoseService = gPoseService; _ktisisIPC = ktisisIPC; - Widget = new DebugWidget(this, clientState); + Widget = new DebugWidget(this, clientState, objectTable); } public void EnterGPose() diff --git a/Brio/Core/MultiValueDictionary.cs b/Brio/Core/MultiValueDictionary.cs index e4c2c15c..eb5f87f6 100644 --- a/Brio/Core/MultiValueDictionary.cs +++ b/Brio/Core/MultiValueDictionary.cs @@ -3,7 +3,7 @@ namespace Brio.Core; -public class MultiValueDictionary where TKey : notnull +public class MultiValueDictionary where TKey : notnull { private readonly Dictionary> _underlyingDictionary = []; diff --git a/Brio/Game/Actor/ActorSpawnService.cs b/Brio/Game/Actor/ActorSpawnService.cs index 6a598cd4..5d2bd99a 100644 --- a/Brio/Game/Actor/ActorSpawnService.cs +++ b/Brio/Game/Actor/ActorSpawnService.cs @@ -75,7 +75,7 @@ public bool CreateCharacter([MaybeNullWhen(false)] out ICharacter outCharacter, { outCharacter = null; - var localPlayer = _clientState.LocalPlayer; + var localPlayer = _objectTable.LocalPlayer; if(localPlayer != null) { if(CloneCharacter(localPlayer, out outCharacter, flags, disableSpawnCompanion: disableSpawnCompanion)) diff --git a/Brio/Game/Core/DalamudService.cs b/Brio/Game/Core/DalamudService.cs index ea194213..3452856f 100644 --- a/Brio/Game/Core/DalamudService.cs +++ b/Brio/Game/Core/DalamudService.cs @@ -55,7 +55,7 @@ private void FrameworkOnUpdate(IFramework framework) IsInCutscene = false; } - var localPlayer = _clientState.LocalPlayer; + var localPlayer = _objectTable.LocalPlayer; if(localPlayer != null) { _classJobId = localPlayer.ClassJob.RowId; @@ -75,12 +75,12 @@ public async Task GetHomeWorldIdAsync() public uint GetHomeWorldId() { - return _clientState.LocalPlayer?.HomeWorld.RowId ?? 0; + return _objectTable.LocalPlayer?.HomeWorld.RowId ?? 0; } public bool GetIsPlayerPresent() { - return _clientState.LocalPlayer != null && _clientState.LocalPlayer.IsValid(); + return _objectTable.LocalPlayer != null && _objectTable.LocalPlayer.IsValid(); } public async Task GetIsPlayerPresentAsync() @@ -90,7 +90,7 @@ public async Task GetIsPlayerPresentAsync() public string GetPlayerName() { - return _clientState.LocalPlayer?.Name.ToString() ?? "--"; + return _objectTable.LocalPlayer?.Name.ToString() ?? "--"; } public bool IsObjectPresent(IGameObject? obj) @@ -114,7 +114,7 @@ public async Task GetPlayerCharacterAsync() } public IPlayerCharacter GetPlayerCharacter() { - return _clientState.LocalPlayer!; + return _objectTable.LocalPlayer!; } public ICharacter? GetGposeCharacterFromObjectTableByName(string name, bool onlyGposeCharacters = false) diff --git a/Brio/UI/Widgets/Debug/DebugWidget.cs b/Brio/UI/Widgets/Debug/DebugWidget.cs index 894cd397..f2fa0f2a 100644 --- a/Brio/UI/Widgets/Debug/DebugWidget.cs +++ b/Brio/UI/Widgets/Debug/DebugWidget.cs @@ -9,7 +9,7 @@ namespace Brio.UI.Widgets.Debug; -public class DebugWidget(DebugCapability capability, IClientState _clientState) : Widget(capability) +public class DebugWidget(DebugCapability capability, IClientState _clientState, IObjectTable _objectTable) : Widget(capability) { public override string HeaderName => "Debug"; @@ -86,8 +86,8 @@ private void DrawMisc() ImGui.Text($"MapId - {_clientState.MapId}"); ImGui.Text($"TerritoryType - {_clientState.TerritoryType}"); - ImGui.Text($"CurrentWorld - {_clientState.LocalPlayer?.CurrentWorld.Value.Name}"); - ImGui.Text($"HomeWorld - {_clientState.LocalPlayer?.HomeWorld.Value.Name}"); + ImGui.Text($"CurrentWorld - {_objectTable.LocalPlayer?.CurrentWorld.Value.Name}"); + ImGui.Text($"HomeWorld - {_objectTable.LocalPlayer?.HomeWorld.Value.Name}"); ImGui.Text(io.Framerate.ToString("F2") + " FPS"); }