Log inGet started
World

Escapement

Branchmain
Branchesmain
Commit7683e73a7f

README.md

ui

Every widget tree the commander sees, and the palette they are drawn in.

local Ui = require("game.ui")
ui.registerScreen("escapement.hud", Ui.hud(view), 10)

The module is pure. It registers nothing, reads no game state and touches no entity: each function takes one plain view table and returns a widget tree. That is what makes the interface checkable — hand Ui.hud a table and read the tree back, with no engine in the way.

The trees

FunctionWhat it draws
Ui.hud(view)the whole screen: top bar, roster column, bottom bar
Ui.topBar(view)the tooth dial, the phase, and Advance the machine
Ui.roster(view)one card per automaton — winding as a wound spring — and the blight still climbing
Ui.windStrip(view)the allies the referee says can be wound from here
Ui.prompt(view)the action under the cursor and what it costs, before it is spent
Ui.legend()what a green, violet or red ring on the metal means
Ui.help()how to play, as a first-run card
Ui.endCard(view)the hour struck, or the escapement stopped

The view

tick, ticksToHour, phase, outcome, reason
roster       { id, kind, name, winding, max, frozen, acted, selected, onMainspring, ring, sector }
blight       { id, name, rust, ring, sector }
windTargets  { id, name, winding }
prompt       { verb, target, cost, gain, legal, why }   -- verb: move|strike|wind|hold|select
selectedName, showHelp

Palette

Ui.P is the colour set — warm brass on blackened iron. Ui.MARKER holds the same three accents as {r, g, b} triples, so the swatches in the on-screen legend and the rings drawn on the metal are provably the same hue.

Callback ids the owning component must answer in onCallback: endturn, help, helpclose, dismiss, sel:<unitId>, wind:<unitId>.