Potential fix for Honorific throwing away data. Still testing efficacy.
All checks were successful
Build and Update Repo / build-and-update-repo (push) Successful in 1m13s
All checks were successful
Build and Update Repo / build-and-update-repo (push) Successful in 1m13s
This commit is contained in:
@@ -14,6 +14,7 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
||||
private readonly ICallGateSubscriber<int, object> _honorificClearCharacterTitle;
|
||||
private readonly ICallGateSubscriber<object> _honorificDisposing;
|
||||
private readonly ICallGateSubscriber<string> _honorificGetLocalCharacterTitle;
|
||||
private readonly ICallGateSubscriber<int, string> _honorificGetCharacterTitle;
|
||||
private readonly ICallGateSubscriber<string, object> _honorificLocalCharacterTitleChanged;
|
||||
private readonly ICallGateSubscriber<object> _honorificReady;
|
||||
private readonly ICallGateSubscriber<int, string, object> _honorificSetCharacterTitle;
|
||||
@@ -29,6 +30,7 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_honorificApiVersion = pi.GetIpcSubscriber<(uint, uint)>("Honorific.ApiVersion");
|
||||
_honorificGetLocalCharacterTitle = pi.GetIpcSubscriber<string>("Honorific.GetLocalCharacterTitle");
|
||||
_honorificGetCharacterTitle = pi.GetIpcSubscriber<int, string>("Honorific.GetCharacterTitle");
|
||||
_honorificClearCharacterTitle = pi.GetIpcSubscriber<int, object>("Honorific.ClearCharacterTitle");
|
||||
_honorificSetCharacterTitle = pi.GetIpcSubscriber<int, string, object>("Honorific.SetCharacterTitle");
|
||||
_honorificLocalCharacterTitleChanged = pi.GetIpcSubscriber<string, object>("Honorific.LocalCharacterTitleChanged");
|
||||
@@ -84,6 +86,23 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
||||
return string.IsNullOrEmpty(title) ? string.Empty : Convert.ToBase64String(Encoding.UTF8.GetBytes(title));
|
||||
}
|
||||
|
||||
public async Task<string> GetTitleForPlayer(IntPtr character)
|
||||
{
|
||||
if (!APIAvailable) return string.Empty;
|
||||
|
||||
string title = await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||
{
|
||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||
if (gameObj is IPlayerCharacter pc)
|
||||
{
|
||||
return _honorificGetCharacterTitle.InvokeFunc(pc.ObjectIndex);
|
||||
}
|
||||
return string.Empty;
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
return string.IsNullOrEmpty(title) ? string.Empty : Convert.ToBase64String(Encoding.UTF8.GetBytes(title));
|
||||
}
|
||||
|
||||
public async Task SetTitleAsync(IntPtr character, string honorificDataB64)
|
||||
{
|
||||
if (!APIAvailable) return;
|
||||
|
||||
Reference in New Issue
Block a user