feat: add PF links

This commit is contained in:
Anna
2022-01-16 01:29:44 -05:00
parent 56159148b7
commit 1013c0af8c
4 changed files with 51 additions and 1 deletions
+14
View File
@@ -26,6 +26,9 @@ internal unsafe class GameFunctions : IDisposable {
[Signature("E8 ?? ?? ?? ?? 84 C0 74 0D B0 02", Fallibility = Fallibility.Fallible)]
private readonly delegate* unmanaged<IntPtr, byte> _isMentor = null!;
[Signature("48 89 5C 24 ?? 57 48 83 EC 20 48 8B FA 48 8B D9 E8 ?? ?? ?? ?? 48 8B 8B ?? ?? ?? ?? 48 85 C9", Fallibility = Fallibility.Fallible)]
private readonly delegate* unmanaged<AgentInterface*, ulong, byte> _openPartyFinder = null!;
#endregion
#region Hooks
@@ -217,6 +220,17 @@ internal unsafe class GameFunctions : IDisposable {
return this._isMentor(this._isMentorA1.Value) > 0;
}
internal void OpenPartyFinder(uint id) {
if (this._openPartyFinder == null) {
return;
}
var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.LookingForGroup);
if (agent != null) {
this._openPartyFinder(agent, id);
}
}
private readonly IntPtr _placeholderNamePtr = Marshal.AllocHGlobal(128);
private readonly string _placeholder = $"<{Guid.NewGuid():N}>";
private string? _replacementName;