Fix Adventurer Plates.

This commit is contained in:
Ottermandias 2022-09-02 18:37:35 +02:00
parent df249618ab
commit 37ad1f68b0

View file

@ -5,6 +5,7 @@ using Dalamud.Utility.Signatures;
using FFXIVClientStructs.FFXIV.Client.Game.Character; using FFXIVClientStructs.FFXIV.Client.Game.Character;
using FFXIVClientStructs.FFXIV.Client.Game.Object; using FFXIVClientStructs.FFXIV.Client.Game.Object;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.GeneratedSheets;
using Penumbra.Collections; using Penumbra.Collections;
@ -40,34 +41,27 @@ public unsafe partial class PathResolver
} }
var ui = ( AtkUnitBase* )addon; var ui = ( AtkUnitBase* )addon;
if( ui->UldManager.NodeListCount <= 60 ) var nodeId = Dalamud.GameData.GetExcelSheet< Title >()?.GetRow( *_inspectTitleId )?.IsPrefix == true ? 2u : 6u;
{
return null;
}
var nodeId = Dalamud.GameData.GetExcelSheet< Title >()?.GetRow( *_inspectTitleId )?.IsPrefix == true ? 59 : 60; var text = ( AtkTextNode* )ui->UldManager.SearchNodeById( nodeId );
var text = ( AtkTextNode* )ui->UldManager.NodeList[ nodeId ];
return text != null ? text->NodeText.ToString() : null; return text != null ? text->NodeText.ToString() : null;
} }
// Obtain the name displayed in the Character Card from the agent. // Obtain the name displayed in the Character Card from the agent.
private static string? GetCardName() private static string? GetCardName()
{ {
// TODO: Update to ClientStructs when merged.
if( !Penumbra.Config.UseCharacterCollectionsInCards ) if( !Penumbra.Config.UseCharacterCollectionsInCards )
{ {
return null; return null;
} }
var uiModule = ( UIModule* )Dalamud.GameGui.GetUIModule(); var agent = AgentCharaCard.Instance();
var agentModule = uiModule->GetAgentModule();
var agent = ( byte* )agentModule->GetAgentByInternalID( 393 );
if( agent == null ) if( agent == null )
{ {
return null; return null;
} }
var data = *( byte** )( (byte*) agent + 0x28 );
var data = *( byte** )( agent + 0x28 );
if( data == null ) if( data == null )
{ {
return null; return null;