Initial release: HSUI v1.0.0.0 - HUD replacement with configurable hotbars
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using FFXIVClientStructs.FFXIV.Client.LayoutEngine;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.String;
|
||||
using FFXIVClientStructs.Interop;
|
||||
using FFXIVClientStructs.STD;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace HSUI.Helpers
|
||||
{
|
||||
public static class EncryptedStringsHelper
|
||||
{
|
||||
public static unsafe string GetString(string original)
|
||||
{
|
||||
if (!original.StartsWith("_rsv_"))
|
||||
{
|
||||
return original;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
TempLayoutWorld* layoutWorld = (TempLayoutWorld*)LayoutWorld.Instance();
|
||||
StdMap<Utf8String, Pointer<byte>> map = layoutWorld->RsvMap[0];
|
||||
Pointer<byte> demangled = map[new Utf8String(original)];
|
||||
if (demangled.Value != null && Marshal.PtrToStringUTF8((IntPtr)demangled.Value) is { } result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Plugin.Logger.Error("Error reading rsv map:\n" + e.StackTrace);
|
||||
}
|
||||
|
||||
return original;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 0x230)]
|
||||
public unsafe struct TempLayoutWorld
|
||||
{
|
||||
[FieldOffset(0x220)] public StdMap<Utf8String, Pointer<byte>>* RsvMap;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user