Expand description
Typing a name: a player profile’s, a hero’s, a farm’s.
On a keyboard the player types it (NameBox). While the box is
open the game’s keys do nothing (its letters are letters then); the
text box’s own fixed keys finish, delete and cancel (text_key).
With a controller, or on a device with no keyboard, it is spelled on a
letter grid instead (NameEntry) with the cursor and Confirm, like
a console’s naming screen.
Name rules for both (NameRules): letters (A-Z, a-z), -, ',
digits where the rules allow them, and single spaces between words, at
most so many characters, not blank.
Neither decides what Cancel means: they report it (NameEvent::Cancel)
and the screen closes the box, or asks first. The name is the screen’s
to take only on NameEvent::Done.
The look is a skin: TypingView and GridView say what a box
shows, and glyph paints them.
Modules§
- glyph
- The glyph look of the name boxes: the typing box and the letter grid,
each a double-bordered box with its title in the top border and the
name so far with a cursor. Everything about the look lives here;
nothing here decides what a box shows. Another look is another
paint_*of the same views.
Structs§
- Grid
View - The letter grid.
- NameBox
- The name being typed on the keyboard.
- Name
Entry - The name grid (a controller, or a device with no keyboard).
- Name
Rules - What a name may hold.
- Typing
View - The typing box.
Enums§
Constants§
- DELETE
- The text key of the cell that deletes the last letter.
- DONE
- The text key of the cell that closes the name grid.
- HELP_
GRID - The text key of the help line while the name grid is open.
- SPACE
- The text key of the name grid’s cell that types a space.
- TYPE_
HINT - The text key of the typing box’s hint.