feat: add shared date and time formatting

This commit is contained in:
MaxTomahawk
2026-08-11 11:17:32 +02:00
parent 79ed37699e
commit 2c8c800584
8 changed files with 265 additions and 1 deletions
+11
View File
@@ -5,6 +5,7 @@ local Data = require("src.core.Data")
local Version = require("src.core.Version")
local Assets = require("src.render.Assets")
local ModUI = require("src.ui.ModUI")
local DateTime = require("src.core.DateTime")
local AssetTransform = require("src.mods.AssetTransform")
local Manifest = require("src.mods.Manifest")
local Merge = require("src.mods.Merge")
@@ -643,6 +644,16 @@ function Loader:_api(mod)
-- the widget toolkit facade (12 4.5) is one shared surface, not
-- per-mod state; each widget inside it loads on first touch
ui = ModUI,
-- Read-only shared timestamp presentation using current options.lua
-- preferences. The live game supplies only the current option context;
-- checkpoint/save data never changes as a side effect.
datetime = {
date = function(_, game, timestamp) return DateTime.date(game, timestamp) end,
time = function(_, game, timestamp) return DateTime.time(game, timestamp) end,
dateTime = function(_, game, timestamp)
return DateTime.dateTime(game, timestamp)
end,
},
-- namespaced per mod; M11 backs these with save.modData /
-- options.modOptions, the shape mods compile against is already final
save = {