Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed with nameplate hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 28, 2023
1 parent 7af119a commit da5bf90
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions FakeName/Hooker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class Hooker
private Hook<AtkTextNodeSetTextDelegate> AtkTextNodeSetTextHook { get; init; }

private delegate void SetNamePlateDelegate(IntPtr addon, bool isPrefixTitle,
bool displayTitle, IntPtr titlePtr, IntPtr namePtr, IntPtr fcNamePtr, int iconId);
bool displayTitle, IntPtr titlePtr, IntPtr namePtr, IntPtr fcNamePtr, IntPtr prefix, int iconId);

///// <summary>
///// https://github.com/Haplo064/JobIcons/blob/master/PluginAddressResolver.cs#L34
///// </summary>
//[Signature("48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 54 41 56 41 57 48 83 EC 40 44 0F B6 E2", DetourName = nameof(SetNamePlateDetour))]
//private Hook<SetNamePlateDelegate> SetNamePlateHook { get; init; }
/// <summary>
/// https://github.com/shdwp/xivPartyIcons/blob/main/PartyIcons/Api/PluginAddressResolver.cs#L40
/// </summary>
[Signature("E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 48 8B 5C 24 ?? 45 38 BE", DetourName = nameof(SetNamePlateDetour))]
private Hook<SetNamePlateDelegate> SetNamePlateHook { get; init; }

public static Dictionary<string[], string> Replacement { get; } = new Dictionary<string[], string>();

Expand All @@ -38,7 +38,7 @@ internal unsafe Hooker()
SignatureHelper.Initialise(this);

AtkTextNodeSetTextHook.Enable();
//SetNamePlateHook.Enable();
SetNamePlateHook.Enable();

Service.Framework.Update += Framework_Update;
Service.ClientState.Login += ClientState_Login;
Expand All @@ -47,7 +47,7 @@ internal unsafe Hooker()
public unsafe void Dispose()
{
AtkTextNodeSetTextHook.Dispose();
//SetNamePlateHook.Dispose();
SetNamePlateHook.Dispose();
Service.Framework.Update -= Framework_Update;
Service.ClientState.Login -= ClientState_Login;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ private void AtkTextNodeSetTextDetour(IntPtr node, IntPtr text)
}

private unsafe void SetNamePlateDetour(IntPtr namePlateObjectPtr, bool isPrefixTitle,
bool displayTitle, IntPtr titlePtr, IntPtr namePtr, IntPtr fcNamePtr, int iconId)
bool displayTitle, IntPtr titlePtr, IntPtr namePtr, IntPtr fcNamePtr, IntPtr prefix, int iconId)
{
try
{
Expand All @@ -152,8 +152,8 @@ private unsafe void SetNamePlateDetour(IntPtr namePlateObjectPtr, bool isPrefixT
PluginLog.Error(ex, "Failed to change name plate");
}

//SetNamePlateHook.Original(namePlateObjectPtr, isPrefixTitle, displayTitle,
// titlePtr, namePtr, fcNamePtr, iconId);
SetNamePlateHook.Original(namePlateObjectPtr, isPrefixTitle, displayTitle,
titlePtr, namePtr, fcNamePtr, prefix, iconId);
}


Expand Down

0 comments on commit da5bf90

Please sign in to comment.