Compare commits

...

3 Commits

4 changed files with 12 additions and 17 deletions

View File

@ -1,6 +1,5 @@
using System;
using System.Runtime.InteropServices;
using Dalamud.Game;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Hooking;
using Framework = FFXIVClientStructs.FFXIV.Client.System.Framework.Framework;
@ -10,11 +9,6 @@ namespace XivCommon.Functions {
/// The class containing BattleTalk functionality
/// </summary>
public class BattleTalk : IDisposable {
private static class Signatures {
// FIXME
internal const string AddBattleTalk = "48 89 5C 24 ?? 57 48 83 EC 50 48 8B 01 49 8B D8 0F 29 74 24 ?? 48 8B FA 0F 28 F3 FF 50 40 C7 44 24 ?? ?? ?? ?? ?? 0F 28 DE 48 8B C8 C7 44 24 ?? ?? ?? ?? ?? 8B 84 24 ?? ?? ?? ?? 4C 8B C3 C6 44 24 ?? ?? 48 8B D7 89 44 24 20 E8 ?? ?? ?? ?? 48 8B 5C 24 ?? 0F 28 74 24 ?? 48 83 C4 50 5F C3 CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 ?? 57 48 83 EC 50 48 8B 01 49 8B D8 0F 29 74 24 ?? 48 8B FA 0F 28 F3 FF 50 40 C7 44 24";
}
private bool HookEnabled { get; }
/// <summary>
@ -37,10 +31,11 @@ namespace XivCommon.Functions {
private AddBattleTalkDelegate? AddBattleTalk { get; }
private Hook<AddBattleTalkDelegate>? AddBattleTalkHook { get; }
internal BattleTalk(SigScanner scanner,bool hook) {
internal unsafe BattleTalk(bool hook) {
this.HookEnabled = hook;
if (scanner.TryScanText(Signatures.AddBattleTalk, out var addBattleTalkPtr, "battle talk")) {
var addBattleTalkPtr = (IntPtr) Framework.Instance()->GetUiModule()->VTable->ShowBattleTalk;
if (addBattleTalkPtr != IntPtr.Zero) {
this.AddBattleTalk = Marshal.GetDelegateForFunctionPointer<AddBattleTalkDelegate>(addBattleTalkPtr);
if (this.HookEnabled) {

View File

@ -17,18 +17,18 @@ namespace XivCommon.Functions.FriendList {
[FieldOffset(0x00)]
public readonly ulong ContentId;
/// <summary>
/// The home world of the friend.
/// </summary>
[FieldOffset(0x16)]
public readonly ushort HomeWorld;
/// <summary>
/// The current world of the friend.
/// </summary>
[FieldOffset(0x18)]
[FieldOffset(0x16)]
public readonly ushort CurrentWorld;
/// <summary>
/// The home world of the friend.
/// </summary>
[FieldOffset(0x18)]
public readonly ushort HomeWorld;
/// <summary>
/// The job the friend is currently on.
/// </summary>

View File

@ -102,7 +102,7 @@ namespace XivCommon {
this.UiAlloc = new UiAlloc(scanner);
this.Chat = new Chat(scanner);
this.PartyFinder = new PartyFinder(scanner, partyFinderGui, hooks);
this.BattleTalk = new BattleTalk(scanner, hooks.HasFlag(Hooks.BattleTalk));
this.BattleTalk = new BattleTalk(hooks.HasFlag(Hooks.BattleTalk));
this.Examine = new Examine(scanner);
this.Talk = new Talk(scanner, hooks.HasFlag(Hooks.Talk));
this.ChatBubbles = new ChatBubbles(objectTable, scanner, hooks.HasFlag(Hooks.ChatBubbles));

View File

@ -5,7 +5,7 @@
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<Version>4.0.0-alpha.2</Version>
<Version>4.0.0</Version>
<DebugType>full</DebugType>
</PropertyGroup>