From 37ad1f68b09160eb3da690b47eafa3518778ca0f Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 2 Sep 2022 18:37:35 +0200 Subject: [PATCH] Fix Adventurer Plates. --- .../Resolver/PathResolver.Identification.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Penumbra/Interop/Resolver/PathResolver.Identification.cs b/Penumbra/Interop/Resolver/PathResolver.Identification.cs index abd40704..9ffb6e94 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Identification.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Identification.cs @@ -5,6 +5,7 @@ using Dalamud.Utility.Signatures; using FFXIVClientStructs.FFXIV.Client.Game.Character; using FFXIVClientStructs.FFXIV.Client.Game.Object; using FFXIVClientStructs.FFXIV.Client.UI; +using FFXIVClientStructs.FFXIV.Client.UI.Agent; using FFXIVClientStructs.FFXIV.Component.GUI; using Lumina.Excel.GeneratedSheets; using Penumbra.Collections; @@ -40,34 +41,27 @@ public unsafe partial class PathResolver } var ui = ( AtkUnitBase* )addon; - if( ui->UldManager.NodeListCount <= 60 ) - { - return null; - } + var nodeId = Dalamud.GameData.GetExcelSheet< Title >()?.GetRow( *_inspectTitleId )?.IsPrefix == true ? 2u : 6u; - var nodeId = Dalamud.GameData.GetExcelSheet< Title >()?.GetRow( *_inspectTitleId )?.IsPrefix == true ? 59 : 60; - - var text = ( AtkTextNode* )ui->UldManager.NodeList[ nodeId ]; + var text = ( AtkTextNode* )ui->UldManager.SearchNodeById( nodeId ); return text != null ? text->NodeText.ToString() : null; } // Obtain the name displayed in the Character Card from the agent. private static string? GetCardName() { + // TODO: Update to ClientStructs when merged. if( !Penumbra.Config.UseCharacterCollectionsInCards ) { return null; } - var uiModule = ( UIModule* )Dalamud.GameGui.GetUIModule(); - var agentModule = uiModule->GetAgentModule(); - var agent = ( byte* )agentModule->GetAgentByInternalID( 393 ); + var agent = AgentCharaCard.Instance(); if( agent == null ) { return null; } - - var data = *( byte** )( agent + 0x28 ); + var data = *( byte** )( (byte*) agent + 0x28 ); if( data == null ) { return null;