Add reaction list get/set

pls gib ui soon :)

need to translate these values (byte) -> reaction names (enum)
This commit is contained in:
Kurt 2020-05-07 19:37:48 -07:00
parent 230257d4d1
commit f9d9103039
6 changed files with 37 additions and 0 deletions

View File

@ -20,6 +20,7 @@ public abstract class PersonalOffsets
public abstract int ItemChest { get; }
public abstract int ItemCollectBit { get; }
public abstract int ItemRemakeCollectBit { get; }
public abstract int Manpu { get; } // reactions
public abstract int Bank { get; }
public abstract int Recipes { get; }

View File

@ -29,6 +29,7 @@ public sealed class PersonalOffsets10 : PersonalOffsets
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA04C;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7A0;
public override int Manpu => PlayerOther + 0xAF70;
public override int Bank => PlayerOther + 0x33014;
public override int Recipes => Bank + 0x10;

View File

@ -29,6 +29,7 @@ public sealed class PersonalOffsets11 : PersonalOffsets
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;
public override int Manpu => PlayerOther + 0xAF7C;
public override int Bank => PlayerOther + 0x33024;
public override int Recipes => Bank + 0x10;

View File

@ -29,6 +29,7 @@ public sealed class PersonalOffsets12 : PersonalOffsets
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;
public override int Manpu => PlayerOther + 0xAF7C;
public override int Bank => PlayerOther + 0x345E4;
public override int Recipes => Bank + 0x10;

View File

@ -0,0 +1,31 @@
using System.Runtime.InteropServices;
#pragma warning disable CS8618, CA1815, CA1819, IDE1006
namespace NHSE.Core
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct GSavePlayerManpu
{
public const int SIZE = 0x88;
private const int MaxCount = 64;
private const int WheelCount = 8;
/// <summary>
/// List of known Reaction IDs
/// </summary>
[field: MarshalAs(UnmanagedType.ByValArray, SizeConst = MaxCount)]
public byte[] ManpuBit { get; set; }
/// <summary>
/// Emotions that are currently bound to the Reaction Wheel.
/// </summary>
[field: MarshalAs(UnmanagedType.ByValArray, SizeConst = WheelCount)]
public byte[] UIList { get; set; }
/// <summary>
/// Flags indicating if an Reaction (at the same index?) is newly learned or not.
/// </summary>
[field: MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.I1, SizeConst = MaxCount)]
public bool[] NewFlag { get; set; }
}
}

View File

@ -17,6 +17,8 @@ public class FancyMarshalTests
[Fact] public void MarshalGSaveRoomFloorWall() => MarshalBytesTestS<GSaveRoomFloorWall>(GSaveRoomFloorWall.SIZE);
[Fact] public void MarshalGSaveManpu() => MarshalBytesTestS<GSavePlayerManpu>(GSavePlayerManpu.SIZE);
private static void MarshalBytesTestS<T>(int size) where T : struct
{
var bytes = new byte[size];