Focus
Menu focus navigation for the cards of GREASEPAINT. A controller has no pointer, so every menu carries an ordered ring of focusable ids and exactly one of them is lit; this module walks that ring.
Focus
Menu focus navigation for the cards of GREASEPAINT. A controller has no pointer, so every menu carries an ordered ring of focusable ids and exactly one of them is lit; this module walks that ring.
Focus.open(list, prefer)— open a menu: the ids in stick order, and which starts lit.Focus.axis(v, dt)— feed thenavigateaxis; one flick is one step, a held stick repeats.Focus.point(id)— a mouse crossing a row or a finger tapping it moves the focus there.Focus.id()/Focus.isFocused(id)— read it.Focus.close()— nothing is focused until the nextopen.Focus.release()— let go of a held direction, so a stick held through a transition does not keep walking.
The ring is whatever the card offers, so an interval with three faces and a
fourth row is a ring of four and needs nothing said about it here: open takes
the list screens.itemIds returns for the phase.
A held stick repeats on a delay measured in seconds AND in frames. On a machine
running long frames a single flick can be one frame carrying half a second of
dt, and a delay measured only in time turns that flick into two steps.
Fed by game/input/console.inputMap; consumed by game.ui.Screens, which asks
it which row to draw lit.
Scoped to this part · feeds back into the world's score.