Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 8c90d7c4-9…

HorseRaceUI

The three ターフヴィクトリー screens — **start**, **in-play HUD**, **result** — as plain `ui.registerScreen`-ready widget trees. `RaceDirector` is the only caller: it registers `HorseRaceUI.SCREEN` once and calls `ui.updateScreen(SCREEN, tree)` whenever its state changes.

by◐Doomin·posted 5d ago
What it does

HorseRaceUI

The three ターフヴィクトリー screens — start, in-play HUD, result — as plain ui.registerScreen-ready widget trees. RaceDirector is the only caller: it registers HorseRaceUI.SCREEN once and calls ui.updateScreen(SCREEN, tree) whenever its state changes.

The module holds no engine state and no scene code. Each builder is a pure state -> widget tree function, so a tree can also be built from a test with a hand-written state.

local HorseRaceUI = require("HorseRaceUI")

ui.registerScreen(HorseRaceUI.SCREEN, HorseRaceUI.buildStart(state), HorseRaceUI.LAYER)
ui.showScreen(HorseRaceUI.SCREEN)
ui.updateScreen(HorseRaceUI.SCREEN, HorseRaceUI.buildHud(state))   -- on state change

API

MemberWhat it is
HorseRaceUI.SCREEN"horserace" — the screen name the director registers under
HorseRaceUI.LAYER40 — the layer the director registers it on
HorseRaceUI.buildStart(state)title lockup, horse-data card, the four 作戦 cards, START RACE
HorseRaceUI.buildHud(state)rank strip, race clock, camera buttons, stamina, commentary, PLAYER tag
HorseRaceUI.buildResult(state)gold heading, winning time, eight ranked rows, prize, career, run-again

Each returns { type, style, props, children } sized to fill the viewport, with position = "absolute" where the reference places a block. Everything lays out from percentages and flex, so it follows the canvas (ui.canvas()) without relayout code.

Callback ids

The ids are strings on a node's props, delivered to RaceDirector:onCallback(id, data):

idwho emits it
plan:nige plan:senko plan:sashi plan:oikomithe four 作戦 cards on the start screen
startthe crimson START RACE / レースを開始する button
cam:broadcast cam:chase cam:overheadthe 固定 / 追従 / 俯瞰 buttons on the HUD
againthe もう一度レースする button on the result screen

State it reads

buildStart reads plan (which card is lit) and result.career (the career line, when a previous race left one). buildHud reads rows, clock, camera, commentary, stamina, marker, and phase / countdown for the gates-hold numeral. buildResult reads result and tolerates it being nil (the panel then draws its empty state with the run-again button live).

result: { rows, winTime, prize, career = { runs, wins, earnings, best }, won }. rows: eight { place, number, name, colour, gap, time, isPlayer }, leader first. marker: { x, y, on } in screen pixels — the PLAYER tag is placed at it and disappears when on is false.

Look

Deep-navy translucent panels (#0d1b2e family) over the live scene, thin gold rules (#c9a227), cream text (#f4ead7), crimson (#b31528) as the single accent: the selected 作戦, the active camera mode, the winner's row and every primary button. Gold headings and the START RACE lockup are serif (tinos); numerals — the clock, placings and times — are condensed (anton); body text and Japanese are arimo. Japanese glyphs fall back to the engine's CJK face.

The galloping-horse silhouettes, the crown, the camera triangles and the PLAYER tag's triangle are inline svg nodes painted in currentColor.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

HorseRaceUI — the ターフヴィクトリー screens as plain widget trees. `RaceDirector` registers `HorseRaceUI.SCREEN` once with the tree one of the builders below returns, and calls `ui.updateScreen(SCREEN, tree)` whenever its state changes. Every function here is a pure `state -> widget tree` function: it touches no engine surface, so a tree can also be built from a test with a hand-written state. Callback ids the trees emit (they arrive at `RaceDirector:onCallback`): plan:nige | plan:senko | plan:sashi | plan:oikomi start | cam:broadcast | cam:chase | cam:overhead | again

col(style: { [string]: any }?, children: { Node }?) → Node

A vertical flex box.

argtypedescription
style{ [string]: any }?
children{ Node }?

row(style: { [string]: any }?, children: { Node }?) → Node

A horizontal flex box.

argtypedescription
style{ [string]: any }?
children{ Node }?

lbl(text: string, style: { [string]: any }?) → Node

A text label.

argtypedescription
textstring
style{ [string]: any }?

svg(markup: string, style: { [string]: any }?) → Node

An inline SVG glyph, painted in the node's `color`.

argtypedescription
markupstring
style{ [string]: any }?

rule(width: (number | string) → void

A painted rule: a thin gold line, a diamond, a divider bar.

argtypedescription
width(number | string

diamond(size: number, colour: string) → Node

A rotated square, the small diamond the gold rules carry.

argtypedescription
sizenumber
colourstring

ornament(width: (number | string) → void

A hairline with a diamond at its centre, both sides given a width.

argtypedescription
width(number | string

clockText(t: number?) → string

Seconds as a race clock, m:ss.cc.

argtypedescription
tnumber?

comma(n: number?) → string

A whole number grouped in threes.

argtypedescription
nnumber?

gapText(gap: (number | string) → void

The gap behind the leader, in 馬身 and its quarters, as the race-day board writes it.

argtypedescription
gap(number | string

pct(v: number?) → string

A value as an integer percent string, for a filled bar's width.

argtypedescription
vnumber?

saddleBox(number: number, colour: string, size: number) → Node

The player's saddle-cloth number in its bordered box.

argtypedescription
numbernumber
colourstring
sizenumber

dataRow(k: string, v: string) → Node

One `label …… value` line of the horse-data card.

argtypedescription
kstring
vstring

planCard(plan: { id: string, name: string, colour: string, d1: string, d2: string }, selected: boolean) → Node

One 作戦 card: coloured silhouette, name, one-line description, and a gold rule under the selected one.

argtypedescription
plan{ id: string, name: string, colour: string, d1: string, d2: string }
selectedboolean

buildStart(state: { [string]: any }?) → Node

The start screen: title lockup, the player's horse-data card, the 作戦 row and the START RACE button.

argtypedescription
state{ [string]: any }?RaceDirector state; only `plan` and `result.career` are read here.

rankCell(r: { [string]: any }, index: number) → Node

One cell of the rank strip: saddle-cloth number, name and gap back.

argtypedescription
r{ [string]: any }
indexnumber

camButton(cam: { id: string, label: string }, active: boolean) → Node

One camera button: a triangle glyph and its 固定/追従/俯瞰 label, lit crimson while it is the active mode.

argtypedescription
cam{ id: string, label: string }
activeboolean

buildHud(state: { [string]: any }?) → Node

The in-play HUD: rank strip, race clock, camera buttons, stamina, commentary bar and the PLAYER tag over horse #1. marker, phase, countdown).

argtypedescription
state{ [string]: any }?RaceDirector state (rows, clock, camera, commentary, stamina,

resultRow(r: { [string]: any }, index: number, playerNumber: number?) → Node

One ranked row: place, saddle-cloth swatch, name and time. The winner's row is crimson and gold; the player's carries a crimson left rule.

argtypedescription
r{ [string]: any }
indexnumber
playerNumbernumber?

buildResult(state: { [string]: any }?) → Node

The result screen: gold heading, winning time, eight ranked rows, the prize and career lines, and the run-it-again button.

argtypedescription
state{ [string]: any }?RaceDirector state; `result` may be nil, which draws an empty panel.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · HorseRaceUI.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.