Launcher: legible notes, a shorter empty state for Statistics, and a script for the settings screenshots

This commit is contained in:
alex committed 2026-11-26 04:44:54 +00:00
1 parent a7eb0e2fb9
commit 88a65b95d6
3 files changed
+64 -4

No files matched your search

+4 -3
View File
@@ -438,9 +438,10 @@ impl App {
fields: ModelRc::new(VecModel::from(s.fields.iter().map(|(k, v)| SessField { name: k.as_str().into(), value: short(v).into() }).collect::<Vec<_>>())),
}
}).collect();
let places = dirs.iter().map(|d| tilde(d)).collect::<Vec<_>>();
lib.set_sess_empty(format!("The engine writes a summary when a session with Enhance ends; an engine that does not write them yet leaves this empty. {} for other games. Looked in: {}",
match all.len() - mine.len() { 0 => "None found".to_string(), 1 => "1 summary found".to_string(), n => format!("{n} summaries found") }, places.join(", ")).into());
// (the first folder by name; the rest are the same two names under the other data, state, cache and config folders)
let first = dirs.iter().find(|d| d.to_string_lossy().contains("smoovplay")).or(dirs.first()).map(|d| tilde(d)).unwrap_or_default();
lib.set_sess_empty(format!("The engine writes a summary when a session with Enhance ends; an engine that does not write them yet leaves this empty. {} for other games. Looked in {first} and {} more folders (\"sessions\" and \"stats\" under the engine's and Summit's data, state, cache and config folders; SUMMIT_SESSIONS_DIR adds one).",
match all.len() - mine.len() { 0 => "None found".to_string(), 1 => "1 summary found".to_string(), n => format!("{n} summaries found") }, dirs.len().saturating_sub(1)).into());
lib.set_stats_note(if rows.is_empty() { "Time played, as Summit and the game's launcher count it.".into() } else { format!("Time played, and {} session summar{} the engine wrote, shown as the files have them.", rows.len(), if rows.len() == 1 { "y" } else { "ies" }).into() });
lib.set_sess(ModelRc::new(VecModel::from(rows)));
lib.set_sess_sel(0);
+1 -1
View File
@@ -143,7 +143,7 @@ component SettingRow inherits Rectangle {
x: 4px; y: parent.height - 20px; width: parent.width - 8px; text: root.r.label; color: Theme.p.accent; font-size: Theme.t-xs; font-weight: 800; letter-spacing: 2px; overflow: elide;
}
if root.r.kind == 5: Text {
x: 4px; y: 4px; width: parent.width - 8px; height: parent.height - 4px; text: root.r.help; color: Theme.p.faint; font-size: Theme.t-sm; wrap: word-wrap; overflow: elide;
x: 4px; y: 4px; width: parent.width - 8px; height: parent.height - 4px; text: root.r.help; color: Theme.p.dim; font-size: Theme.t-sm; wrap: word-wrap; overflow: elide;
}
Rectangle {
visible: root.r.kind != 2 && root.r.kind != 5;
+59
View File
@@ -0,0 +1,59 @@
#!/bin/sh
# Regenerate docs/media/launcher-ui/: headless renders (software renderer, no display needed) of the settings page,
# presets, a game's profile, its Statistics view and the Compare dialog, each in two themes. Static frames: no
# animation is shown or checked by these.
# docs/demo/launcher-ui-shots.sh [path/to/summit-gui] (default: the debug build in $CARGO_TARGET_DIR or target/)
# The demo library is invented (make_demo_home.py). The two session files under "sessions" are SAMPLE input written
# here so the Statistics view has something to list: the engine's own summaries may look different, and the view
# shows whatever fields a file has.
set -e
cd "$(dirname "$0")/../.."
ROOT=$PWD
BIN=${1:-${CARGO_TARGET_DIR:-$ROOT/target}/debug/summit-gui}
DEMO=${SUMMIT_DEMO_HOME:-/tmp/summit-launcher-ui-demo}
OUT=$ROOT/docs/media/launcher-ui
PY=${PYTHON:-python3}
$PY docs/demo/make_demo_home.py "$DEMO" >/dev/null
mkdir -p "$OUT" "$DEMO/.local/share/smoovplay/sessions"
cat > "$DEMO/.local/share/smoovplay/sessions/sample-1.json" <<'JSON'
{"game": "Voidrunner", "ended": 1795100000, "duration_s": 1843.2, "fps": {"avg": 118.4, "low_1": 97.2, "low_01": 74.0}, "game_fps": 59.8, "delay_ms": 21.5,
"settings": {"interp": true, "hz": 120, "scaler": "fsr", "model": "4.22.lite"}}
JSON
cat > "$DEMO/.local/share/smoovplay/sessions/sample-2.json" <<'JSON'
{"game": "Voidrunner", "ended": 1795013600, "duration_s": 412, "fps": {"avg": 59.9, "low_1": 55.1}, "settings": {"interp": false, "scaler": "bilinear"}}
JSON
run() { # run <name> VAR=value...
n=$1; shift
env HOME="$DEMO" XDG_CONFIG_HOME="$DEMO/.config" XDG_DATA_HOME="$DEMO/.local/share" XDG_CACHE_HOME="$DEMO/.cache" XDG_STATE_HOME="$DEMO/.local/state" \
SUMMIT_ENGINE="$ROOT/engine" SUMMIT_SHOT="$OUT" SUMMIT_NAME="$n" "$@" "$BIN" "$DEMO/Games" >/dev/null
}
both() { # both <name> <theme2> VAR=value...: midnight and one more theme
name=$1; t2=$2; shift 2
run "$name-midnight" SUMMIT_THEME=midnight "$@"
run "$name-$t2" SUMMIT_THEME=$t2 "$@"
}
G=custom:voidrunner
# a few real changes first, made through the UI itself (keys), so the renders show dots, "Custom" and a game's own:
run _setup SUMMIT_VIEW=settings SUMMIT_SECTION=overlay SUMMIT_ZONE=3 SUMMIT_KEYS="Down Right Right" # Stats overlay style: Graphs
run _setup SUMMIT_VIEW=settings SUMMIT_SECTION=upscaling SUMMIT_ZONE=3 SUMMIT_KEYS="Right" # Upscaler: NVIDIA RTX VSR
run _setup SUMMIT_DETAIL=$G SUMMIT_EDITOR=1 SUMMIT_SECTION="frame generation" SUMMIT_ZONE=3 SUMMIT_KEYS="Down Left" # this game: its own Frame multiplier, one step down (3x)
rm -f "$OUT/_setup.png"
both settings-launcher daylight SUMMIT_VIEW=settings
both settings-engine steam SUMMIT_VIEW=settings SUMMIT_SECTION="frame generation" SUMMIT_ZONE=3 SUMMIT_KEYS="Down Down Down Down"
both settings-greyed violet SUMMIT_VIEW=settings SUMMIT_SECTION=upscaling SUMMIT_ZONE=3 SUMMIT_KEYS="Down"
both settings-search daylight SUMMIT_VIEW=settings SUMMIT_SEARCH="overlay" SUMMIT_ZONE=3 SUMMIT_KEYS="Down Down"
both settings-search-none oled SUMMIT_VIEW=settings SUMMIT_SEARCH="ray tracing"
both settings-presets contrast SUMMIT_VIEW=settings SUMMIT_ZONE=0 SUMMIT_PRESET=2
both settings-quick daylight SUMMIT_VIEW=settings SUMMIT_ZONE=1 SUMMIT_QUICK=4
both settings-defaults steam SUMMIT_VIEW=settings SUMMIT_SECTION="game defaults" SUMMIT_ZONE=3 SUMMIT_KEYS="Down Down Down"
both profile-engine daylight SUMMIT_DETAIL=$G SUMMIT_EDITOR=1 SUMMIT_SECTION="frame generation" SUMMIT_ZONE=3 SUMMIT_KEYS="Down"
both profile-launch violet SUMMIT_DETAIL=$G SUMMIT_EDITOR=1 SUMMIT_ZONE=3 SUMMIT_KEYS="Down Down Down"
both profile-presets steam SUMMIT_DETAIL=$G SUMMIT_EDITOR=1 SUMMIT_ZONE=0 SUMMIT_PRESET=3
both stats daylight SUMMIT_DETAIL=$G SUMMIT_STATS=1
both stats-empty steam SUMMIT_DETAIL="hollow tide" SUMMIT_STATS=1
both compare daylight SUMMIT_DETAIL=$G SUMMIT_COMPARE=1 XDG_SESSION_TYPE=x11 DISPLAY=:99
both game-page oled SUMMIT_DETAIL=$G SUMMIT_KEYS="Right Right" XDG_SESSION_TYPE=x11 DISPLAY=:99
run settings-small-contrast SUMMIT_THEME=contrast SUMMIT_LAYOUT=list SUMMIT_SIZE=1024x640 SUMMIT_VIEW=settings SUMMIT_SECTION=display SUMMIT_ZONE=3 SUMMIT_KEYS="Down Down"
run settings-deck-midnight SUMMIT_THEME=midnight SUMMIT_SIZE=1280x800 SUMMIT_VIEW=settings SUMMIT_SECTION=clips SUMMIT_ZONE=3
ls "$OUT"