36 lines
989 B
C#
36 lines
989 B
C#
using Roboto.Memory;
|
|
|
|
namespace Roboto.Memory.Objects;
|
|
|
|
/// <summary>
|
|
/// Reads AreaLoading state (slot 0). Individual field reads — the full struct is 3672B, wasteful to bulk-read.
|
|
/// </summary>
|
|
public sealed class AreaLoading : 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 AreaLoading(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;
|
|
}
|
|
}
|