Expand description
The screens of the game: every message the player sees, as lines of text.
Each function builds one screen from plain data and a Term and returns it as Vec<String>
(one entry per output line, trailing blank lines included, exactly as the Python Display
printed them). Nothing is written here: the session prints the lines with
print_lines, and tests compare them with Term::plain.
The Czech texts are exact ports of display.py, session.py and commands.py, minus the Rich
markup. Hints, answers’ feedback, success messages, user names and paths are printed
verbatim: they are wrapped as plain text, never interpreted as Markdown or markup, so
[ab]*.txt and `ls` come out exactly as written. Only the level assignment itself
(Level::text) goes through the Markdown renderer.
The palette follows the Python UI: cyan level panels, yellow hints, green success, red failures, dim notes with violet commands.
Constants§
- INSTALL_
COMMAND - The command that reinstalls ShellGame, for when
updatecannot do it itself.
Functions§
- already_
initialized initon a game that exists already.- bonus_
note - The note under the panel of a bonus level.
- cd_
block - The red panel for a
cdthe level forbids, printed on stderr by thecdhook: titledShellGame (<level id>), with the recovery tip below it. - current_
directory - The directory the player starts in.
- exiting
shellgame exit.- failure
- The red panel for a wrong answer or an unmet requirement, and the pointer to
hint. - format_
duration 37s,2m 5s,1h 2m 3s: a duration the way the Python UI wrote it.- format_
stats - The statistics line of the success panel:
Čas: 12s | Nápovědy: 1 | Chybné pokusy: 2. Failed attempts are mentioned only when there were any. - game_
complete - The player finished the last level.
- hint
- A newly revealed hint: its panel, the tip about
--repeat, the pointer to the next hint (when there is one) and a blank line.indexcounts from 0. - init_
success - A new game was created.
- intro_
page - One page of a section intro: a cyan panel titled with the intro’s title, and
(strana i/N)when the intro has several pages.numbercounts from 1. - invalid_
level_ format - The saved level id is not of the form
S.N, so its section cannot be found. - launch_
failed - The game shell could not be started.
- level_
missing - The saved level no longer exists in this version of the game.
- level_
not_ found - The catalog has no level with this id.
- level_
panel - The assignment of a regular level: a cyan panel titled
<id>: <title>holding the rendered Markdown, followed (for a bonus level) by the note that it may be skipped. - level_
reloaded dev reloadfinished.- level_
setup_ error - The next level could not be prepared; the player’s progress is kept.
- no_
hints_ available - The level has no hints at all.
- no_
hints_ revealed hint --repeatbefore any hint was shown.- no_
levels_ available - The game has no levels at all.
- no_
levels_ registered dev starton a game without levels.- no_
more_ hints - All hints have been shown already.
- no_
next_ level dev nexton the last level.- no_
previous_ level dev prevon the first level.- not_
initialized - There is no saved game.
- not_
skippable skipon a required level.- plain_
line - An ordinary line in
style, for the few messages that have no screen of their own (the progress and the result ofupdate). - removal_
declined - The player declined the confirmation of
remove. - removal_
refused removerefuses to delete a workspace outside the temporary directories.- removed
- The state and the workspace were deleted.
- repeated_
hints - Every hint revealed so far (
hint --repeat): the firstrevealedofhints, then the tips. Nothing revealed yet has its own message. - reset_
failed resetcould not rebuild the level.- reset_
notice - The level was rebuilt by
reset. - show_
usage showwithout exactly one of--leveland--section.- skipped
- A bonus level was skipped.
- state_
error - The red panel for a failure of the game itself (unreadable state, a filesystem error).
- status
- The progress screen: the current level, when the game started, a table of finished levels
(numerically sorted, so
1.10follows1.2) and totals. - success
- The green panel shown when a level is completed: the level’s own message and, with a completion record, the line of statistics.
- teleport_
notice - The player was moved to the start directory of the level.
- unknown_
level dev jumpto an id that does not exist.- update_
current updatefound nothing newer than the running version.- update_
done updatesucceeded: the version before and after.- update_
failed updatefailed. Withreinstall, the installer command is shown on a line of its own (so it can be copied), as the way to update by hand.- workspace_
restored - The workspace was gone (a cleared
/tmp) and has been rebuilt.