Entry 621
Real fullscreen in the game, and the launcher's Settings page on one typed settings table
Documented in piney-apples, the player's launcher.
Files19 in 8 directories
Cargo.lockREADME.mdcrates/piney-game/src/console.rsfullscreen.rslib.rssession.rscrates/piney-game/src/settings/cli.rsmod.rstable.rstests.rsvalues.rscrates/piney-launcher/Cargo.tomlcrates/piney-launcher/src/app.rsfound.rsoptions.rscrates/piney-launcher/src/app/settings_page.rsdocs/images/launcher/settings.pngsettings-more.pngdocs/port/launcher.mdAfter 619 and v0.1.0, the launcher is how players start the game, and
two things confused them. The game had no fullscreen at all: its window was
winit's, 960 x 720 and resizable, and nothing else. And the launcher's
Settings page was a debug list of < value > rows (options.rs's
ROWS) repeating the metadata of the game's own settings.rs
(FIELDS), with the port's display options left as command-line flags
only. This piece ships as v0.1.1 (piney-launcher's version bumped).
One table
piney_game::settings::table::TABLE declares every setting once, as a
Setting: its key in settings.toml, a Kind (Switch, Choice of
Picks, Int and Float ranges with a step and a Show, Volume),
its default (and deck_default, the Steam Deck Game Mode's), its
Section (Display, Sound, Controls, Gameplay), its label and one line
for players, its Flags, a SaveField when the save's option block
holds it too, whether the console changes it live, and whether the page
shows it. Key names the 22 rows in order (a test holds the order).
Settings keeps the values given, [Option<Value>; Key::COUNT]; the rest
take their defaults. Display is the typed view the game sets its window
and picture up from (fullscreen, the window's size, render scale, vsync,
the frame rate cap, HUD size, deflicker). values.rs gives each kind its
reading, range, writing, wording and stepping; cli.rs the flags;
Kind::control picks the page's control. The launcher's options.rs is
now a thin wrapper that loads, steps and writes through the same code.
New settings, before only flags or console commands: fullscreen,
render_scale, hud_scale, vsync, fps_cap, deflicker, and
window_width / window_height, which are remembered but not shown.
Adding the Modern renderer's --renderer and --sound later is a row
each, and a Section variant if they want their own heading.
Compatibility. The thirteen save options are still written as the
numbers the save holds, so 0.1.0 reads a new file, and a 0.1.0 file loads
the same: a test loads the exact text 0.1.0 wrote, puts it into a save and
checks every byte the old reader set, the disc's speed, and that a note on
a hand-written disc_speed line survives a store. A save's value outside
its menu's list stays as written. The one exception is an on/off option
(vibration, the movies' text, the Data Drain movie), where any number but
0 reads as on and is written back as 1; the game's menus only ever write
1 or 0. A line that cannot be read gives nothing, as before, and the last
readable line of a name counts, as the old reader did. Writing now changes
only the names asked for. The file is rewritten grouped by section, every
other line kept as it was (notes too), and unknown names kept at the end;
a reset takes a line out. The table's defaults for the save's options are
what SaveState::fresh() holds, and a test checks that.
Flags. --fullscreen, --windowed, --render-scale N,
--hud-scale N, --no-vsync, --fps-cap N, --deflicker, --dvd [SPEED] / --cdrom and --voice en|jp come from the table. run()
asks settings::cli::flag first for each argument. The run's settings
are the file's with the flags' over them (Settings::with); nothing a
flag gives is written back. --voice still goes through
mode::set_voice_override, which also overrides a loaded save; a test
holds that the voices are the only save option with a flag. --help's
usage and lines come from the table. A bad flag value is now an error
(exit 2) rather than silently 1. A headless run still reads no file.
The console. fullscreen, render_scale, hud_scale, vsync,
fps_cap and deflicker are the table's live rows, parsed by
console_value (out of range refused, as the old hand-written commands
did) and applied by App::set_live. Their help lines come from the table.
settings lists every setting as the run has it. As before, the console's
changes last for the run.
Fullscreen
F11 or Alt+Enter (fullscreen::is_switch) switches
Fullscreen::Borderless(None), the monitor the window is on, and writes
fullscreen to the file. The key is taken before the console and the
pad, so Alt+Enter never presses Start. The pointer is hidden while
fullscreen, except while the console (it has a scroll bar) is open. Escape
still opens the quit prompt (holding the picture and, since 620, the
sound), and the close button still asks; neither leaves fullscreen. The window opens at the remembered size, and its size
out of fullscreen (not maximised) is written as the game closes if the
player changed it. Game Mode (settings::game_mode, moved from the
launcher's found.rs) starts fullscreen unless the file says otherwise.
The 4:3 letterbox is piney-gs's presenter's, unchanged.
The Settings page
app/settings_page.rs: Display, Sound, Controls and Gameplay from the
table, then Saves (the save folder, now a row like the others with quiet
buttons) and Updates (the update check). Each row is the label, its line
in muted text, and the control its kind asks for:
- a switch (a pill and knob, with On / Off beside it);
- two to four choices side by side;
- a slider with its value (a press or a drag on the track sets the step under it);
- a stepper for a longer list (the frame rate cap, the loading time).
With the pad or the keys, up and down move row to row, left and right change the value, and A flips a switch or takes the next choice round. The column says "Left / Right change" while the pad is the last input. Each section's heading has Reset to defaults, greyed while there is nothing to reset, which asks "Reset Sound to its defaults?" with Reset and Cancel; B cancels. While a game runs, the game's rows are dimmed and do not change; Saves and Updates do. The look is the theme's: flat tiles, 1px lines, the focus a solid rim, Fira Sans, no shadows or glows.
Testing without the desktop
Nothing ran on the maintainer's session. Every window ran in a nested
kwin_wayland --virtual started under env -i and dbus-run-session,
with its own XDG_RUNTIME_DIR, HOME and PINEY_HOME in a scratch
folder. It had no DISPLAY, WAYLAND_DISPLAY or bus of the user's, and
the driving script refused to run on any display but the nested one. Spectacle took the pictures inside
it (KWIN_SCREENSHOT_NO_PERMISSION_- Crate tests (cargo test --workspace --exclude piney-game): 829 passed, 0 failed, 1 ignored. The launcher has 29 of them; its three options.rstests became one,writes_the_games_file`, on the new
table.
-
The piney-game suite (
cargo test -p piney-game --release): 364 / 0 / 153. That is 353, plus the 12 settings tests (the table's order, every row's control matching its type, the save options' defaults, a round trip of the file, an old file loading unchanged, odd values, the flags overriding the file for the run, fullscreen on the Deck, steps and shows, the console, a section's reset, a save's options through the file), plus the 2 fullscreen key tests, less the 3 oldsettings.rstests they replace.session::tests::options_kept_across_the_partspasses unchanged. The console's two Tab tests now read the window's help with the table's lines (window_help). -
Clippy (workspace, all targets and features,
-D warnings), fmt andcargo deny check: clean.tools/docs.py checkpasses, aftertools/docs.py index. -
The golden shots (
shots.sh settings-621againstbase): 4,550 files, 0 differ. -
Harnesses:
test_fieldui_option_rs(the Option pages and the save's option bytes against the game's ownccThMenu) on all four volumes, 12 tests each, OK.test_sound_rson Infection: 4 tests, OK.=1). Keys went in with xdotool's XTEST to the nested Xwayland only. KWin first answered XTEST with a "Remote Control" question inside the nested session;XwaylandEisNoPromptin the scratch home'skwinrc` lets it through there. -
The game (
--mode test-card --mute, X11): F11 filled the 1280 x 800 output with the picture 4:3 between bars, and wrotefullscreen = true. Escape opened the quit prompt over it, still fullscreen. F1 opened the console fullscreen. Alt+Enter went back to 960 x 720 and wrotefalse. The pad log recorded 0 frames with Start held after Alt+Enter, and 31 after a plain Enter. Resized to 1100 x 700, the picture stayed 4:3 between bars. The second close quit, andwindow_width = 1100,window_height = 700were written. -
On Wayland,
--fullscreenstarted fullscreen. A replayed consolefullscreen offcame back to the remembered 1100 x 700. Neither was written to the file. -
SteamGamepadUI=1started fullscreen; without it the game started windowed at the remembered size. -
The launcher (X11, keys): Down then Right moved the rim to Render scale and wrote
render_scale = 3. Seven Downs reached Sound's Reset; Enter asked, and Enter reset it, taking outmain_volume = 224 # quieterandvoice. Right on Output wrotesound_output = 0.
The README's settings.png (the top of the page) and settings-more.png
(Gameplay, Saves, Updates, from a tall window that a KWin rule in the
scratch home sized) came from the same nested session. Their paths read
~/Games/piney-apples/....
Checks
- Crate tests (
cargo test --workspace --exclude piney-game): 829 passed, 0 failed, 1 ignored. The launcher has 29 of them; its threeoptions.rstests became one,writes_the_games_file, on the new table. - The piney-game suite (
cargo test -p piney-game --release): 364 / 0 / 153. That is 353, plus the 12 settings tests (the table's order, every row's control matching its type, the save options' defaults, a round trip of the file, an old file loading unchanged, odd values, the flags overriding the file for the run, fullscreen on the Deck, steps and shows, the console, a section's reset, a save's options through the file), plus the 2 fullscreen key tests, less the 3 oldsettings.rstests they replace.session::tests::options_kept_across_the_partspasses unchanged. The console's two Tab tests now read the window's help with the table's lines (window_help). - Clippy (workspace, all targets and features,
-D warnings), fmt andcargo deny check: clean.tools/docs.py checkpasses, aftertools/docs.py index. - The golden shots (
shots.sh settings-621againstbase): 4,550 files, 0 differ. - Harnesses:
test_fieldui_option_rs(the Option pages and the save's option bytes against the game's ownccThMenu) on all four volumes, 12 tests each, OK.test_sound_rson Infection: 4 tests, OK.
F11 and Alt+Enter were pressed only in an X11 window
(the nested KWin's Xwayland). On Wayland the switch ran from
--fullscreen, from Game Mode and from a replayed console fullscreen off, but not from a key; the key's route is the same code
(fullscreen::is_switch on winit's physical key). Spectacle does not
capture the pointer, so its hiding was not seen in a picture. Fullscreen
under gamescope on a real Deck, on Windows and on macOS has not been run
here.