This commit is contained in:
Boki 2026-03-04 16:49:23 -05:00
parent 8a0e4bb481
commit 0df70abad7
24 changed files with 0 additions and 1225 deletions

View file

@ -0,0 +1,36 @@
using Roboto.GameOffsets.States;
namespace Roboto.Memory.States;
/// <summary>
/// Reads AreaLoading state (slot 0). Individual field reads — the full struct is 3672B, wasteful to bulk-read.
/// </summary>
public sealed class AreaLoadingState : RemoteObject
{
// AreaLoading struct field offsets
private const int IsLoadingOffset = 0x660;
private const int TotalLoadingScreenTimeMsOffset = 0xDB8;
public bool IsLoading { get; private set; }
public long TotalLoadingScreenTimeMs { get; private set; }
public AreaLoadingState(MemoryContext ctx) : base(ctx) { }
protected override bool ReadData()
{
var mem = Ctx.Memory;
var loadingFlag = mem.Read<int>(Address + IsLoadingOffset);
IsLoading = loadingFlag != 0;
TotalLoadingScreenTimeMs = mem.Read<long>(Address + TotalLoadingScreenTimeMsOffset);
return true;
}
protected override void Clear()
{
IsLoading = false;
TotalLoadingScreenTimeMs = 0;
}
}