Add a message that is to be displayed after saving the state data when performing actions.

This commit is contained in:
zontreck 2025-06-13 19:07:41 -07:00
parent 09a52d2865
commit ced927c306
4 changed files with 36 additions and 4 deletions

View file

@ -38,6 +38,8 @@ class SessionData {
static Callbacks Calls = Callbacks();
static String LastSessionID = "";
static String DisplayError = "";
static String DisplayMessage = "";
static bool DirtyState = false;
static double? TotalPay;
static bool ContainsTripTimes = true;
static bool IsSavedData = false;
@ -84,10 +86,10 @@ class SessionData {
seconds: diff.inSeconds,
);
stamp.add(diffTime);
print("Add timestamp; ${diff}; ${diffTime}");
print("Add timestamp; $diff; $diffTime");
}
print("Final time: ${stamp}");
print("Final time: $stamp");
return stamp.toDuration();
}
@ -356,6 +358,11 @@ class SessionData {
static Future<void> SaveCacheState() async {
CompoundTag ct = IsOnTheClock ? await _serializeToNBT() : CompoundTag();
await NBTHelper.CommitNBT(data: ct, name: "appstate");
if (DirtyState) {
DirtyState = false;
DisplayMessage = "Saved cache state";
}
}
static Future<void> _deserialize(CompoundTag ct) async {