mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 16:21:30 +02:00
feat: add shared date and time formatting
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user