Expand description
Filling in a text’s placeholders: {name} by a value the caller gives
(fill_values), or by what the caller looks up for it, such as the
key the player has for an action (fill,
Ctx::text_with).
Enums§
- Label
- Text a view holds before it is shown: a text key with the values of
its placeholders, put in the player’s language by the skin when it
paints (
Ctx::label), or text as it is. Logic that doesn’t know the player’s language builds views of keys, and they need no rebuilding when the language changes.
Constants§
- CURSOR
- The placeholder for the keys that move the cursor (
{Cursor}).
Functions§
- check_
key_ placeholders - Checks that every placeholder of screen text
text, read frompathinbundle, can be filled: a capitalized{Name}names a key, so it must be{Cursor}or an action ofA, askey_textfills them. A lowercase{name}is a value a screen passes (Ctx::text_with’sargs), which no file can know, and passes. Each error names the file, the key’s line and the known actions, with codeSH2008(unknown-name). - fill
textwith each{name}replaced by its value inargs, else by whatlookupgives for it, else left as written. What is filled in is not looked at again, so a value may hold braces. An unclosed{and what follows it are plain text.- fill_
values textwith each{name}thatargsnames replaced by its value, and nothing else: for text built where there are no keys to name (a line of a list, a label). Anything else in braces is left alone.- key_
text - What a
{name}placeholder that names a key says:{Cursor}the cursor keys,{Confirm}(an action’s name) the keykeyshas for that action.Nonefor any other name. What a game’s text fills in by default (GameData::key_text).