mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-16 04:47:45 +01:00
feat: Fate Table
This commit is contained in:
parent
a18bcc385c
commit
4e24c8fa3a
8 changed files with 465 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ using System.Text;
|
|||
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Memory.Exceptions;
|
||||
|
||||
using FFXIVClientStructs.FFXIV.Client.System.String;
|
||||
using static Dalamud.NativeFunctions;
|
||||
|
||||
// Heavily inspired from Reloaded (https://github.com/Reloaded-Project/Reloaded.Memory)
|
||||
|
|
@ -237,6 +237,25 @@ namespace Dalamud.Memory
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read an SeString from a specified Utf8String structure.
|
||||
/// </summary>
|
||||
/// <param name="utf8String">The memory address to read from.</param>
|
||||
/// <returns>The read in string.</returns>
|
||||
public static unsafe SeString ReadSeString(Utf8String* utf8String)
|
||||
{
|
||||
if (utf8String == null)
|
||||
return string.Empty;
|
||||
|
||||
var ptr = utf8String->StringPtr;
|
||||
if (ptr == null)
|
||||
return string.Empty;
|
||||
|
||||
var len = Math.Max(utf8String->BufUsed, utf8String->StringLength);
|
||||
|
||||
return ReadSeString((IntPtr)ptr, (int)len);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ReadString(out)
|
||||
|
|
@ -306,6 +325,14 @@ namespace Dalamud.Memory
|
|||
public static void ReadSeString(IntPtr memoryAddress, int maxLength, out SeString value)
|
||||
=> value = ReadSeString(memoryAddress, maxLength);
|
||||
|
||||
/// <summary>
|
||||
/// Read an SeString from a specified Utf8String structure.
|
||||
/// </summary>
|
||||
/// <param name="utf8String">The memory address to read from.</param>
|
||||
/// <param name="value">The read in string.</param>
|
||||
public static unsafe void ReadSeString(Utf8String* utf8String, out SeString value)
|
||||
=> value = ReadSeString(utf8String);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue