mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-19 04:06:10 +02:00
Show the running app version on the Switch launcher header.
Add an NX-only yellow version chip so players can confirm which build is on the microSD after OTA or zip updates.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- Switch launcher shows the running engine version in the header (NX only).
|
||||
-- Desktop/Android/iOS must not paint that chip.
|
||||
|
||||
local function read(path)
|
||||
local f = assert(io.open(path, "r"))
|
||||
local s = f:read("*a")
|
||||
f:close()
|
||||
return s
|
||||
end
|
||||
|
||||
local src = read("src/import/LauncherView.lua")
|
||||
|
||||
assert(src:find('local Version = require%("src%.core%.Version"%)')
|
||||
or src:find('require%("src%.core%.Version"%)'),
|
||||
"LauncherView must require Version")
|
||||
|
||||
assert(src:find("imp%.isNX", 1, false), "version chip must gate on isNX")
|
||||
|
||||
-- The chip is inside an isNX block and prints Version.engine
|
||||
local nxBlock = src:match("if imp%.isNX then(.-)end\n\n %-%- Settings gear")
|
||||
assert(nxBlock, "expected Switch-only version chip before the settings gear")
|
||||
assert(nxBlock:find("Version%.engine", 1, false), "chip must show Version.engine")
|
||||
assert(nxBlock:find('"v"', 1, true) or nxBlock:find('"v" %.%.', 1, false),
|
||||
"chip label should be a v-prefixed version")
|
||||
|
||||
print("ok — Switch launcher version chip is NX-gated and uses Version.engine")
|
||||
Reference in New Issue
Block a user