Files
alchemist-accessibility/accessibility/states/main_menu.lua
T

26 lines
695 B
Lua
Raw Normal View History

2026-08-01 20:53:29 +02:00
-- states/main_menu.lua
--
-- Options are static (Continue / New game / Load game / Options / Manual /
-- Credits / Exit game); `isEnabled` is recomputed in open(), so "Continue" and
-- "Load game" are unavailable on a fresh install. Announcing that matters --
-- otherwise pressing enter appears to do nothing.
return {
probe = {
fn = "keypressed",
focus = "selectedOption",
list = "optionsList",
focusMayBeNil = true, -- nil until open() picks the first enabled option
},
render = function(entry, index, total)
local text = entry.title or "?"
if entry.isEnabled == false then
text = text .. ", unavailable"
end
return text .. ", " .. index .. " of " .. total
end,
}