mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 19:24:01 +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:
@@ -33,6 +33,7 @@ local Theme = require("src.ui.kit.Theme")
|
||||
local Layout = require("src.ui.kit.Layout")
|
||||
local Loader = require("src.ui.kit.Loader")
|
||||
local GameVersion = require("src.core.GameVersion")
|
||||
local Version = require("src.core.Version")
|
||||
local Strings = require("src.core.Strings")
|
||||
|
||||
local PAL = Theme.PAL
|
||||
@@ -340,6 +341,21 @@ local function buildHeader(imp, m)
|
||||
local rx = m.x + m.w - m.pad
|
||||
local by = y + (rowH - gear) / 2
|
||||
|
||||
-- Switch-only: show the running app version opposite the settings gear so
|
||||
-- players can confirm which build is on the microSD (OTA / zip updates).
|
||||
if imp.isNX then
|
||||
local label = "v" .. tostring(Version.engine or "?")
|
||||
local tw = Kit.textWidth("small", label)
|
||||
local padX = math.floor(12 * m.s)
|
||||
local chipW = math.max(tw + 2 * padX, gear)
|
||||
local lx = m.x + m.pad
|
||||
Theme.fill(lx, by, chipW, gear, PAL.bg, 1)
|
||||
Theme.stroke(lx, by, chipW, gear, PAL.yellow, Theme.A.hover, 1)
|
||||
local th = Kit.textHeight("small")
|
||||
Kit.text("small", label, lx + math.floor((chipW - tw) / 2),
|
||||
by + math.floor((gear - th) / 2), PAL.yellow)
|
||||
end
|
||||
|
||||
-- Settings gear, top-right corner.
|
||||
imp._gearIcon = imp._gearIcon
|
||||
or love.graphics.newImage("assets/launcher/gear.png")
|
||||
|
||||
Reference in New Issue
Block a user