qstbak/LLib/LLib.GameUI/LAtkValue.cs
2026-08-17 20:29:32 +10:00

22 lines
572 B
C#

using System;
using Dalamud.Memory;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace LLib.GameUI;
public static class LAtkValue
{
public unsafe static string? ReadAtkString(this AtkValue atkValue)
{
AtkValueType atkValueType = atkValue.Type & AtkValueType.TypeMask;
if (atkValueType != AtkValueType.String && atkValueType != AtkValueType.ConstString)
{
return null;
}
if (atkValue.String.HasValue)
{
return MemoryHelper.ReadSeStringNullTerminated(new IntPtr((byte*)atkValue.String)).WithCertainMacroCodeReplacements();
}
return null;
}
}