Files
mranderson/inc/system/system.main.lua
T
mr.zeroandClaude Opus 5 d45143d69d
ci/woodpecker/push/tic80 Pipeline was successful
ci/woodpecker/manual/tic80 Pipeline was successful
Make the source pass the CI lint
The central pipeline lints where the old inline one did not, and it
aborts on any warning. Nothing here was actually wrong: 166 of the 243
warnings were the TIC-80 API and the game's own globals being undeclared,
which is what .luacheckrc is for — the same shape impostor already uses.

The rest was trailing whitespace on 14 lines, now stripped. INPUT_KEY_X
is unused but kept: it belongs to the LEFT/RIGHT/A/B/X/Y set and removing
it would leave a gap in the mapping, so luacheck is told to allow the
family.

Verified locally by merging the sources the way the pipeline does and
running luacheck over the result: 0 warnings, 0 errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 22:49:06 +02:00

56 lines
1.1 KiB
Lua

local STATE_HANDLERS = {
[WINDOW_SPLASH] = function()
SplashWindow.update()
SplashWindow.draw()
end,
[WINDOW_INTRO] = function()
IntroWindow.update()
IntroWindow.draw()
end,
[WINDOW_MENU] = function()
MenuWindow.update()
MenuWindow.draw()
end,
[WINDOW_GAME] = function()
GameWindow.update()
GameWindow.draw()
end,
[WINDOW_POPUP] = function()
GameWindow.draw()
PopupWindow.update()
PopupWindow.draw()
end,
[WINDOW_INVENTORY] = function()
InventoryWindow.update()
InventoryWindow.draw()
end,
[WINDOW_INVENTORY_ACTION] = function()
InventoryWindow.draw()
PopupWindow.draw()
PopupWindow.update()
end,
[WINDOW_CONFIGURATION] = function()
ConfigurationWindow.update()
ConfigurationWindow.draw()
end,
}
local initialized_game = false
function init_game()
if initialized_game then return end
MenuWindow.refresh_menu_items()
initialized_game = true
end
function TIC()
init_game()
cls(Config.colors.black)
local handler = STATE_HANDLERS[Context.active_window]
if handler then
handler()
end
end