siege_ui
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2siege_ui — every screen Trebuchet Castle Siege draws, as pure data. Each builder takes a plain `view` table the game component fills in and returns a zui widget tree. Nothing here reads engine state or mutates anything, so the whole interface can be rendered and checked without a siege running. local UI = require("siege_ui") ui.registerScreen("siege_menu", UI.menu(view)) ui.registerScreen("siege_hud", UI.hud(view)) Callback ids are namespaced by screen (`mm_*` main menu, `set_*` settings, `pa_*` pause, ...) and every one of them is handled in SiegeGame's `onCallback`.
pal(view: View) → void
| arg | type | description |
|---|---|---|
| view | View |
label(text: string, size: number, color: string, bold: boolean?) → any
| arg | type | description |
|---|---|---|
| text | string | |
| size | number | |
| color | string | |
| bold | boolean? |
paragraph(text: string, size: number, color: string, width: number) → any
| arg | type | description |
|---|---|---|
| text | string | |
| size | number | |
| color | string | |
| width | number |
spacer(px: number) → any
| arg | type | description |
|---|---|---|
| px | number |
row(children: { any }, gap: number, align: string?) → any
| arg | type | description |
|---|---|---|
| children | { any } | |
| gap | number | |
| align | string? |
col(children: { any }, gap: number, align: string?) → any
| arg | type | description |
|---|---|---|
| children | { any } | |
| gap | number | |
| align | string? |
button(p: { [string]: string }, text: string, id: string, opts: { [string]: any }?) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| text | string | |
| id | string | |
| opts | { [string]: any }? |
frame(p: { [string]: string }, children: { any }, opts: { [string]: any }?) → any
A framed slab of parchment-dark stone, the base of every menu block.
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| children | { any } | |
| opts | { [string]: any }? |
meter(p: { [string]: string }, frac: number, fill: string, w: number, h: number) → any
A horizontal meter: a sunk track with a coloured fill and a caption.
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| frac | number | |
| fill | string | |
| w | number | |
| h | number |
stars(p: { [string]: string }, n: number, size: number) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| n | number | |
| size | number |
titleBlock(p: { [string]: string }, sub: string) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| sub | string |
mainMenu(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
levelSelect(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
armory(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
settingsRow(p: { [string]: string }, text: string, control: any) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| text | string | |
| control | any |
slider(p: { [string]: string }, id: string, value: number, lo: number, hi: number) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| id | string | |
| value | number | |
| lo | number | |
| hi | number |
toggle(p: { [string]: string }, id: string, on: boolean, text: string) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| id | string | |
| on | boolean | |
| text | string |
settings(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
customSiege(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
resultScreen(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
pauseMenu(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
loadingScreen(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
menu(view: View) → any
Build the full-screen menu tree for the current menu screen.
| arg | type | description |
|---|---|---|
| view | View | The view table: `screen`, `settings`, `progress`, `custom`, `result`. |
examples
ui.registerScreen("siege_menu", require("siege_ui").menu(view))ammoBelt(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
objectiveBlock(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
tick(done: boolean, text: string) → any
| arg | type | description |
|---|---|---|
| done | boolean | |
| text | string |
windVane(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
readout(p: { [string]: string }, name: string, value: string, hint: string?) → any
| arg | type | description |
|---|---|---|
| p | { [string]: string } | |
| name | string | |
| value | string | |
| hint | string? |
layingPanel(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
hpPanel(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
chargeMeter(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
toasts(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
subtitle(view: View, p: { [string]: string }) → any
| arg | type | description |
|---|---|---|
| view | View | |
| p | { [string]: string } |
hud(view: View) → any
Build the in-siege heads-up display.
| arg | type | description |
|---|---|---|
| view | View | The view table the game component fills each frame. |
examples
ui.registerScreen("siege_hud", require("siege_ui").hud(view))pin(inset: { [string]: any }, child: any) → any
The HUD is one screen: a full-viewport flex root with each cluster lifted out of flow and pinned to its own edge. (`anchor` is a root-only widget, so it cannot be used to place several clusters inside one tree.)
| arg | type | description |
|---|---|---|
| inset | { [string]: any } | |
| child | any |
View = { [string]: any }Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
Inside
1 problem across 1 itemagent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.