Skip to main content

Module tip

Module tip 

Source
Expand description

One-time contextual tips: what triggers each and what it says. The game’s own type names its triggers; its screens decide when one has happened and remember which tips were seen. A tip’s text names keys with placeholders ({Confirm}), filled in with the player’s keys when shown. A tip may keep its instructions apart from its text (how): a game whose tips are spoken by a recorded voice keeps the keys there, since a clip made ahead of time can’t say a key the player rebound.

Structs§

Tip
One tip; T is the game’s triggers.
TipLimits
How much text a tip’s box holds, in cells.
TipRules
What from_source checks tips against besides their box: which placeholders exist, and what is wrong with a tip’s face.
TipTable
Every tip, in file order.

Functions§

from_source
Parses and validates tips source, attributing errors to file: ids are lowercase and used once, a trigger has one tip, the title and text fit rules’ box, every placeholder is one of the game’s and every face is fine by the game. Reports every problem found.
placeholders
The names between braces in text, in order ({Confirm} gives Confirm). An unclosed { is ignored.