diff --git a/docs/screenshots/bestiary.png b/docs/screenshots/bestiary.png index 7e33d4f..fa9ab01 100644 Binary files a/docs/screenshots/bestiary.png and b/docs/screenshots/bestiary.png differ diff --git a/src/main.rs b/src/main.rs index 9691058..813d746 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2188,7 +2188,7 @@ app.pending_briefing = briefing_of(&campaign, i); } } -// ---- self test and screenshots (desktop): DC_SHOT=demo, title or a savegame file starts it right +// ---- self test and screenshots (desktop): DC_SHOT=demo, title, bestiary or a savegame file starts it right // away, DC_SHOT_STYLE=hd|pixel picks the graphics style (not saved), DC_SHOT_AFTER seconds later // (default 10) the screen goes to DC_SHOT_OUT (default /tmp/dc-shot.png) and the game ends; // DC_SHOT_ZOOM sets the camera zoom, DC_SHOT_YAW its turn, DC_SHOT_AT=x,z where it looks; @@ -2247,6 +2247,11 @@ impl ShotPlan { self.started = Some(now); return None; } + if self.load == "bestiary" { + menu.open_bestiary(true); + self.started = Some(now); + return None; + } if self.load == "demo" { app.seed = next_seed(app.seed); (app.game, app.cam) = Game::new_demo_map(app.seed); diff --git a/src/menu/bestiary.rs b/src/menu/bestiary.rs index 1596872..535162f 100644 --- a/src/menu/bestiary.rs +++ b/src/menu/bestiary.rs @@ -67,7 +67,7 @@ fn max_level(e: Entry) -> u32 { } impl Menu { - pub(super) fn open_bestiary(&mut self, from_title: bool) { + pub(crate) fn open_bestiary(&mut self, from_title: bool) { self.page = Some(Page::Bestiary { tab: 0, sel: 1, level: 1, from_title }); self.scroll = 0; } diff --git a/tools/shots_desktop.py b/tools/shots_desktop.py index ecc00cf..3354c9c 100644 --- a/tools/shots_desktop.py +++ b/tools/shots_desktop.py @@ -5,7 +5,8 @@ 2. `cargo build --profile desktop` 3. `python3 tools/shots_desktop.py [--style hd|pixel] [names...]` runs the game once per scene with DC_SHOT (see the self test in src/main.rs), makes its window float at 1280x800 (Hyprland), and - writes docs/screenshots/.png scaled to 1280x800. `title` is the title screen. + writes docs/screenshots/.png scaled to 1280x800. `title` is the title screen, + `bestiary` the bestiary. Needs Pillow (for the scaling) and Hyprland's hyprctl. """ import json, os, subprocess, sys, time @@ -29,7 +30,7 @@ def window_to_1280x800(): def shot(name, style, after=8): out = f"/tmp/shot-{name}.png" - env = dict(os.environ, DC_SHOT="title" if name == "title" else f"/tmp/scenes/{name}.json", + env = dict(os.environ, DC_SHOT=name if name in ("title", "bestiary") else f"/tmp/scenes/{name}.json", DC_SHOT_STYLE=style, DC_SHOT_AFTER=str(after), DC_SHOT_OUT=out) p = subprocess.Popen([GAME], env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) window_to_1280x800()