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:
Andrew Quenehen
2026-08-05 02:08:20 -03:00
parent 4dd4c5c463
commit ae5276b2d1
2 changed files with 42 additions and 0 deletions
@@ -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")