Hud — the in-mission interface of Verdigris Cloister.
Four screens, stacked down a 1080x1440 portrait frame: the initiative
queue at the top, a transparent overlay across the board, the inspector
under it and the ability bar at the foot. `game.ui.hud.hud` draws them;
this component decides WHAT they draw and keeps them fed.
Where the board comes from, in order:
1. the Director component's snapshot(), when the rules slice answers;
2. otherwise a worked demonstration board, so the interface is always
provable on its own and never renders an empty frame.
The other slices reach it through its public methods and through the
signals on `game.core`; it assumes no listener and no caller exists.
entity.find("HudRoot").component.get("Hud"):hoverTile(4, 6)
entity.find("HudRoot").component.get("Hud"):designate("m_anselm", "b_shard1")
entity.find("HudRoot").component.get("Hud"):floatDamage("b_shard1", 6, false)
orderedView(s: any) → void
The queue reads ahead into next round: everything from the active unit
onward is this round, and the wrap-around is marked with a divider.
tileOf(s: any, x: number, y: number) → any
| arg | type | description |
|---|
| s | any | |
| x | number | |
| y | number | |
refreshTilePix(s: any) → void
The cam slice owns picking and calls hoverTile(). Until it does, the
HUD finds the tile itself by projecting every tile centre and taking
the nearest one to the pointer — so the inspector is never mute.
probeHover(s: any) → void
screenOfTile(x: number, y: number, s: any) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
| s | any | |
signature(view: any) → string
A cheap signature over everything the three static bands draw, so they
are rebuilt when the board changes and left alone when it does not.
| arg | type | description |
|---|
| view | any | |
pushBands(view: any) → void
| arg | type | description |
|---|
| view | any | |
announce(title: string, sub: string?, tone: string?) → void
| arg | type | description |
|---|
| title | string | |
| sub | string? | |
| tone | string? | |
tick(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
editorUpdate(dt: ?) → void
onCallback(callbackId: ?, data: ?) → void
| arg | type | description |
|---|
| callbackId | ? | |
| data | ? | |
hoverTile(x: number, y: number) → void
═══════════════════════════════════════════════════════════════════════
The surface the other slices call
═══════════════════════════════════════════════════════════════════════
--!desc Name the tile the pointer is over, so the inspector reads it.
--! Call this from the picking slice; while it keeps calling, the HUD
--! stops looking for the tile itself.
--!arg x Tile column, 1..8.
--!arg y Tile row, 1..10.
--!example entity.find("HudRoot").component.get("Hud"):hoverTile(4, 6)
| arg | type | description |
|---|
| x | number | |
| y | number | |
clearHover( ) → void
--!desc Clear the hovered tile — the pointer left the board.
--!example entity.find("HudRoot").component.get("Hud"):clearHover()
pinTile(x: number, y: number) → void
--!desc Hold the inspector on one tile until it is unpinned — the pointer
--! probe stops overriding it. For staged shots and for stepping through
--! the board from a script.
--!arg x Tile column, 1..8.
--!arg y Tile row, 1..10.
--!example hud:pinTile(3, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
unpinTile( ) → void
--!desc Release a pinned tile; the pointer decides again.
--!example hud:unpinTile()
previewDestination(x: number, y: number, apCost: number, cover: number, warn: string?) → void
--!desc Show the destination chip over a tile the player is about to enter:
--! what the path costs and what cover waits there.
--!arg x Destination tile column.
--!arg y Destination tile row.
--!arg apCost Action points the previewed path costs.
--!arg cover Cover the destination gives: 0 none, 1 half, 2 full.
--!arg warn Optional plain-words warning, e.g. "thornbed - it will bleed you".
--!example hud:previewDestination(5, 7, 1, 1, nil)
| arg | type | description |
|---|
| x | number | |
| y | number | |
| apCost | number | |
| cover | number | |
| warn | string? | |
clearDestination( ) → void
--!desc Take the destination chip off the board.
--!example hud:clearDestination()
designate(attackerId: string, targetId: string, fallback: any?) → void
--!desc Aim a shot: opens the itemised hit-chance stack in the inspector.
--! The numbers come from the Director when it answers hitChance(), and
--! from `fallback` when it does not.
--!arg attackerId The attacking unit's id.
--!arg targetId The target unit's id.
--!arg fallback Optional { chance, modifiers, damage, crit } to show when
--! the rules slice has nothing to say yet.
--!example hud:designate("m_anselm", "b_shard1")
| arg | type | description |
|---|
| attackerId | string | |
| targetId | string | |
| fallback | any? | |
clearTarget( ) → void
--!desc Close the hit-chance stack; the inspector goes back to the ground.
--!example hud:clearTarget()
floatAt(unitId: string, text: string, kind: string, sub: string?) → void
--!desc Throw a floating number off a unit — a hit, a critical, a mend, a miss.
--!arg unitId Whose tile it rises from.
--!arg text What it reads, e.g. "7".
--!arg kind One of "damage", "crit", "heal", "miss", "death".
--!arg sub Optional small line under it, e.g. "CRITICAL".
--!example hud:floatAt("b_shard1", "7", "damage")
| arg | type | description |
|---|
| unitId | string | |
| text | string | |
| kind | string | |
| sub | string? | |
floatAtTile(x: number, y: number, text: string, kind: string) → void
--!desc Throw a floating number at a tile rather than at a unit.
--!arg x Tile column.
--!arg y Tile row.
--!arg text What it reads.
--!arg kind One of "damage", "crit", "heal", "miss", "death".
--!example hud:floatAtTile(4, 8, "3", "damage")
| arg | type | description |
|---|
| x | number | |
| y | number | |
| text | string | |
| kind | string | |
announce(title: string, sub: string?, tone: string?) → void
--!desc Put a short banner over the board for a couple of seconds.
--!arg title The line, set in the display face.
--!arg sub Optional second line.
--!arg tone Optional CSS colour for the title.
--!example hud:announce("The Garden Takes Its Turn")
| arg | type | description |
|---|
| title | string | |
| sub | string? | |
| tone | string? | |
selectAction(actionId: string, hint: string?) → void
--!desc Highlight one action in the ability bar and print its note.
--!arg actionId move / attack / overwatch / sow / burn / flood / hold, or a signature id.
--!arg hint Optional line to print beside the active monk instead of the action's own note.
--!example hud:selectAction("overwatch")
| arg | type | description |
|---|
| actionId | string | |
| hint | string? | |
setActionStates(states: any) → void
--!desc Grey out actions the rules refuse, each with the reason in plain words.
--!arg states A map of action id -> { usable = boolean, reason = string? }.
--!example hud:setActionStates({ burn = { usable = false, reason = "no action points" } })
| arg | type | description |
|---|
| states | any | |
show( ) → void
--!desc Put the whole interface on the glass. Call it when a modal screen
--! that covered the mission closes.
--!example hud:show()
hide( ) → void
--!desc Take the whole interface off the glass, leaving the screens
--! registered — for a title card, a briefing, a cutscene or an end card.
--!example hud:hide()
report( ) → any
--!desc Read what the HUD is currently drawing — the proof surface for
--! a test that cannot see pixels.
--!return A table naming the mounted screens, the hovered tile, the
--! designated target, the live floater count and the snapshot source.
--!example print(hud:report().source)
rehearse( ) → void
--!desc Run the interface through its states once, for a look at it: a
--! hovered tile, an aimed shot, a struck number and a banner.
--!example hud:rehearse()