#!/usr/bin/env bash
# The pictures of the site (site/images) and of the directory (assets/thumbnail.png), made from WinZik itself:
# headless shots of the player at chosen moments, the frames of the game tests (menu, compact, Lock, A propos...),
# then tools/site/make.py crops and arranges them. Run from the root of the JumPHP project: apps/winzik/tools/site/shots.sh
set -euo pipefail
cd "$(dirname "$0")/../../../.."
APP=apps/winzik
OUT=$APP/var/screenshots/site-src
mkdir -p "$OUT"
shot() { # name params
  JUMPHP_SCENE='App\Form\MainForm' JUMPHP_SCENE_PARAMS="$2" bin/jumphp shot winzik 150 "var/screenshots/site-src/$1.png" >/dev/null
}
shot player   '{"demo":true,"fresh":true,"seek":25}'
shot theskin  '{"demo":true,"fresh":true,"seek":41,"skin":"the-skin","expanded":true}'
JUMPHP_SCENE='App\Scene\SplashScene' bin/jumphp shot winzik 70 var/screenshots/site-src/splash.png >/dev/null
bin/jumphp test winzik >/dev/null      # the game tests leave their frames in var/screenshots/tests
python3 -I "$APP/tools/site/make.py" "$APP"
