Let the glamour plate actor use the players character collection.

This commit is contained in:
Ottermandias 2022-05-31 22:08:35 +02:00
parent 630469fc0e
commit 1ad7787e4c

View file

@ -34,6 +34,7 @@ public unsafe partial class PathResolver
{ {
DrawObjectToObject[ ret ] = ( _lastCreatedCollection!, LastGameObject->ObjectIndex ); DrawObjectToObject[ ret ] = ( _lastCreatedCollection!, LastGameObject->ObjectIndex );
} }
return ret; return ret;
} }
@ -153,12 +154,21 @@ public unsafe partial class PathResolver
var data = *( byte** )( agent + 0x28 ); var data = *( byte** )( agent + 0x28 );
if( data == null ) if( data == null )
{
return null; return null;
}
var block = data + 0x7A; var block = data + 0x7A;
return new Utf8String( block ).ToString(); return new Utf8String( block ).ToString();
} }
// Obtain the name of the player character if the glamour plate edit window is open.
private static string? GetGlamourName()
{
var addon = Dalamud.GameGui.GetAddonByName( "MiragePrismMiragePlate", 1 );
return addon == IntPtr.Zero ? null : GetPlayerName();
}
// Guesstimate whether an unnamed cutscene actor corresponds to the player or not, // Guesstimate whether an unnamed cutscene actor corresponds to the player or not,
// and if so, return the player name. // and if so, return the player name.
private static string? GetCutsceneName( GameObject* gameObject ) private static string? GetCutsceneName( GameObject* gameObject )
@ -189,7 +199,7 @@ public unsafe partial class PathResolver
var name = gameObject->ObjectIndex switch var name = gameObject->ObjectIndex switch
{ {
240 => GetPlayerName(), // character window 240 => GetPlayerName(), // character window
241 => GetInspectName() ?? GetCardName(), // inspect, character card 241 => GetInspectName() ?? GetCardName() ?? GetGlamourName(), // inspect, character card, glamour plate editor.
242 => GetPlayerName(), // try-on 242 => GetPlayerName(), // try-on
>= 200 => GetCutsceneName( gameObject ), >= 200 => GetCutsceneName( gameObject ),
_ => null, _ => null,