Expand description
A player profiles screen: the profiles, the one in use marked, then a
row that adds one. It lets the people who share a computer each keep
their own settings and saves under a name, on the Ctx profile
functions (Ctx::add_profile and the rest).
Confirm on a profile opens what can be done to it (ProfileAction):
use it, rename it, delete it (asking first, focus on No; never the only
profile). Adding asks for a name and uses the new profile; it starts
from the default options. Then the screen closes, or opens what the
game gives (ProfilesScreen::opening_after_add: its first-launch
setup, say). A name is typed on the keyboard or spelled on the letter
grid with a controller (crate::widgets::name_entry), up to
MAX_NAME_CHARS, not another profile’s. Cancel in a name box with a
name typed and not kept asks whether to keep it, throw it away or go
back, focus on going back.
The look is a skin. This module says what the screen shows as a
ProfilesView (ProfilesScreen::view); glyph::paint draws it,
unless the game gives another painter (ProfilesScreen::painted_by).
Tests of what happened read the view or the profiles.
Re-exports§
pub use view::ActionsView;pub use view::ProfilesView;pub use view::RowView;
Modules§
- glyph
- The glyph look of the profiles screen: a panel with the profiles, the
one in use marked, then the row that adds one (in the style of the
options screen); the menu of what can be done to a profile, the name
boxes and the questions in double-bordered boxes over it. Everything
about the look lives here; nothing here decides what the screen shows.
Another look is another
paintof the same view (ProfilesScreen::painted_by). - view
- What the profiles screen shows, as plain data: no cells, glyphs,
colours or positions. The screen builds a
ProfilesVieweach frame (ProfilesScreen::view) and a skin paints it (super::glyph::painttoday).
Structs§
- Profiles
Screen - The profiles, the one in use marked, and a row to add one. Cancel closes it.
Enums§
- Delete
Choice - An answer to the question asked before deleting.
- Name
Purpose - What a name box is for.
- Profile
Action - What can be done to a profile.
- RowKind
- One row of the screen.
Constants§
- ADD
- Text key of the row that adds a profile.
- CURRENT
- Text key of the words marking the profile in use.
- DELETE_
QUESTION - Text key of the question asked before deleting, with
{name}. - HELP_
ACTIONS - Text key of the help line while a profile’s actions are open.
- HELP_
ADD - Text key of the help line on the row that adds one.
- HELP_
LIST - Text key of the help line on a profile.
- HELP_
NONE - Text key of the help line on the row that adds one, with the most profiles already.
- HELP_
QUESTION - Text key of the help line while a question is open.
- KEEP_
QUESTION - Text key of the question asked on backing out of a name box.
- NAME_
BOX - Text key of the name box’s title.
- NAME_
RULES - What a profile’s name may hold: letters and digits (the engine names a
profile
Player 2), up toMAX_NAME_CHARS. - NAME_
TAKEN_ MESSAGE - Text key of the message when the name is another profile’s.
- NOT_
SAVED_ MESSAGE - Text key of the message if the profiles couldn’t be saved.
- TITLE
- Text key (
Ctx::text) of the screen title. - TOO_
MANY_ MESSAGE - Text key of the message when there are the most profiles already, with
{n}.
Type Aliases§
- After
Add - What opens once a profile is added and in use, in the screen’s place
(
ProfilesScreen::opening_after_add). - Paint
- What paints the screen’s view:
glyph::paint, or the game’s own (ProfilesScreen::painted_by).