Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 3a9e3328-0…

Screens

<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->

by◐lauramarka·posted 1mo ago
What it does

Screens

<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->

TODO: describe this component.

Interface

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

conforms to

zero/source-extract/v2

game.screens.Screens — everything Hidden Love puts on the glass. The title card, the in-play HUD (chapter label, the three relationship bars, the dialogue band, the phone with its unread dot), the phone panel, and the closing card. It DRAWS, AND IT DRIVES. Every word it shows comes off `game.Game.bus`, and every control it draws routes back into `game.story.Story` by calling a method on it. It never reaches into the story's fields and the story never reaches into its tree. TWO THINGS THIS ENGINE REQUIRES, both of which fail SILENTLY: 1. A style value is a NUMBER in logical points. `fontSize = 31` is honoured; `fontSize = "31px"` is dropped on the floor. Colours are strings. A screen that renders as unstyled default text is almost always this. 2. `ui.registerScreen` does NOT replace a screen that already answers to the name — the old tree keeps drawing and the new one is discarded, which looks exactly like "my styles are ignored". Remove first. The layout is the `in-play.png` contract: chapter label top-left, the three bars top-right, the dialogue band across the bottom, the phone bottom-right, and all of it quiet enough that the room is the picture.

story( ) → void

The story we drive

hasSave( ) → boolean

label(id: ?, text: ?, style: ?) → void

Building blocks

argtypedescription
id?
text?
style?

screenSize( ) → void

A root that covers the viewport. An absolutely-positioned box with NO size only wraps its own content, so a scrim built that way covers the panel and nothing else — the world shows through underneath, which reads as "the background is missing" rather than as a sizing mistake. Everything absolute inside is then measured against a root that is actually the screen. The box the HUD is actually drawn into. `ui.screenSize()` reports the WINDOW, and in the editor that is taller than the viewport the game paints into — so anything positioned from its height (a bottom-anchored band, a corner button) lands below the bottom edge and is silently unclickable: `gui.clickElement` answers "offViewport" and the control simply never fires. The viewport's own size is the space a camera-space screen is laid out in.

button(id: ?, text: ?, style: ?) → void

argtypedescription
id?
text?
style?

meterBar(key: ?, value: ?) → void

argtypedescription
key?
value?

cornerBox(id: ?, left: ?, top: ?, children: ?) → void

argtypedescription
id?
left?
top?
children?

titleTree( ) → void

The four screens

hudTree( ) → void

phoneTree( ) → void

endTree( ) → void

show(name: ?, tree: ?, layer: ?) → void

argtypedescription
name?
tree?
layer?

hide(name: ?) → void

argtypedescription
name?

draw( ) → void

readStory( ) → void

Reading the story

snapshot( ) → void

sync( ) → void

awake( ) → void

Lifecycle

start( ) → void

onDestroy( ) → void

update(dt: ?) → void

Phase is not on the bus (the story sets it internally), so it is polled. The comparison is a handful of field reads and `draw()` only runs on a change — this is not a per-frame rebuild.

argtypedescription
dt?

editorUpdate(dt: ?) → void

argtypedescription
dt?

onCallback(callbackId: ?, data: ?) → void

The controls

argtypedescription
callbackId?
data?

Sub-parts

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

Showing up to 3 levels deep. Open a part to see what it holds further down.

11+items
◇
component · born here
❒asset
# game.story.Story The twelve chapters of **Hidden Love**, playable. The game itself. This component owns the phase machine, walks the chapter scripts in `game.story.Chapters`, moves the three relationship meters on what the player says, runs the phone, and saves and loads. Everything else in the game reads what it publishes on `game.Game.bus`. Mounted by the scene entrypoint onto the `Story` entity. It drives nothing on screen and spawns nothing in the world — `game.screens.Screens` draws it and `game.cast.Cast` poses for it — so calling a method is the whole interface, which is why it can be driven from a UI callback, from a key, or from `execute` while testing. ## Driving it ```lua local s = entity.find("Story").component.get("game.story.Story") s:begin() -- New Game s:advance() -- read the next line, taking the next chapter when this runs out s:choose(1) -- take the first choice on a line that offers one s:phoneOpen() -- read the phone; clears the unread dot s:phoneReply(1) -- reply to it s:save() / s:load() / s:hasSave() s:report() -- the meters, warmth 0..1, the tier, how many choices were taken ``` From a screen, the same things are reachable by callback id, so the UI never reaches for the component directly: `story_new`, `story_continue`, `story_advance`, `story_choice` (data = index), `story_phone`, `phone_reply` (data = index), `story_save`, `story_subtitles`. ## What it publishes `"chapter"` (n, chapter) · `"place"` (key) · `"meter"` (key, value) · `"say"` (speakerKey, **bn**, **en**) · `"choice"` (index, en) · `"phone"` (who, en) · `"weather"` ("dry" | "rain") · `"beat"` (key) `say` carries both languages and they are not the same string twice: **bn is spoken** (it goes to the sound slice, which makes a voice clip from it) and **en is shown**. No font the engine ships has a Bengali glyph, so Bangla reaches the player through the voice — never through the text on screen. ## The rules it enforces - **The story is `Game.CHAPTERS`, in order.** Twelve chapters, always all twelve. `advance()` runs off the end of a chapter into the next one. - **It cannot be lost.** Whatever the meters read, the last chapter closes and `ending` is set from `Game.tier(...)`. There is no fail state. - **The meters move on what was said**, never on repetition — the only writers are choice `effects` and phone `replies`, and every one of them is attached to a decision the player actually made. - **Progress saves itself** at every chapter boundary (`nextChapter` calls `save()`), with manual save and load beside it. ## The save `Game.SAVE_PATH` — `/zero/source/local/hidden_love_save.json`, nine `key=value` lines. Hand-written rather than JSON so it has no dependency that could go missing, and a save that fails to parse can never stop the game from loading. ## Where it goes wrong Three bugs were found here by testing rather than by reading, and each is worth knowing about because each was silent: - **`string.gmatch(payload, "([%a]+)=(.-)\n?")` restores nothing.** `.-` is non-greedy and `\n?` is optional, so the capture matches the empty string every time and every key parses as no value at all — with `hasSave()` still reporting true. The value must be `([^\n]*)`. - **Replies read off `thread[#thread]` do nothing** in a thread whose closing line is hers and unanswered. It has to be the last message that *offers* replies. - **A second `local M = {}`** in the chapters module silently shadows the first, so `return M` hands back the phone threads and the twelve chapters are gone.
▲ 0↑ born
▣
module · born here
❒asset
# game.Game The spine of **Hidden Love — A Bangladeshi Romance Story**. One shared module holding the constants and the rules, so no two slices have to agree by convention. ```lua local Game = require("game.Game") Game.bus.on("chapter", function(n) print(n) end) ``` Nothing here touches the engine at require time — it is data and pure functions, safe to require from a scene entrypoint, a component, a module or an `execute` chunk. ## What it holds | Field | What it is | |---|---| | `ART` | The art-direction sentence, verbatim from the reference pass. Every generated prompt reuses it word for word. | | `TITLE` / `SUBTITLE` / `ENDING_TITLE` | The title card and the closing card. | | `CAST` | The seven named people: who they are, what they wear, and the reference image for the two leads. | | `CHAPTERS` | The twelve chapters in order — `place`, `who`, `beat`, `objective`. The storyline is this table. | | `PLACES` | The seven sets the world slice builds, each with the reference image it answers to. | | `METERS` / `TIERS` | friendship, trust, closeness — and the three ways the same ending can land. | | `MOUNTS` | The names of the scene's mount entities a slice attaches to. | | `SLICES` | The five slice modules the entrypoint requires and mounts. | | `bus` | `on` / `off` / `emit`. How slices talk without requiring each other. | ## The rule the whole game runs on Every chapter reaches the end. The meters decide how *warm* the telling is, not whether it finishes — `warmth(state)` is the mean of the three meters as 0..1, and `tier(state)` names what that earns at the finale. ## State and saving `Game.newState()` is the whole save: chapter, the three meters, the choices taken, flags, the phone log, and time in chapter. `Game.SAVE_PATH` is where it is written, under `/zero/source/local/`. `Game.addMeter(state, key, amount)` clamps and announces on the bus; move the relationship through it and never by assignment, so everything watching stays in step. ## Mounting The scene lays down one entity per key in `Game.MOUNTS` and the entrypoint hands them to each slice's `mount(refs)`. A slice that is not present yet is not an error — the scene loads without it.
▲ 0↑ born
backing path · game/screens/Screens.component

Problems

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

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬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.