refactor: rename InfoModule-related stuff

This commit is contained in:
Anna
2022-01-30 22:11:03 -05:00
parent aa10bf3ceb
commit 9372ad35bc
4 changed files with 29 additions and 13 deletions
+13
View File
@@ -45,6 +45,9 @@ internal sealed unsafe class Chat : IDisposable {
[Signature("E8 ?? ?? ?? ?? F6 43 0A 40")]
private readonly delegate* unmanaged<Framework*, IntPtr> _getNetworkModule = null!;
[Signature("E8 ?? ?? ?? ?? 48 8B C8 E8 ?? ?? ?? ?? 45 8D 46 FB")]
private readonly delegate* unmanaged<IntPtr, uint, Utf8String*> _getLinkshellName = null!;
// Hooks
private delegate byte ChatLogRefreshDelegate(IntPtr log, ushort eventId, AtkValue* value);
@@ -126,6 +129,16 @@ internal sealed unsafe class Chat : IDisposable {
this.Activated = null;
}
internal string? GetLinkshellName(uint idx) {
var infoProxy = this.Plugin.Functions.GetInfoProxyByIndex(26);
if (infoProxy == IntPtr.Zero) {
return null;
}
var utf = this._getLinkshellName(infoProxy, idx);
return utf == null ? null : utf->ToString();
}
private readonly Dictionary<string, Keybind> _keybinds = new();
internal IReadOnlyDictionary<string, Keybind> Keybinds => this._keybinds;