mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-08-14 06:47:28 +00:00
feat(arcade,ui): 80s arcade classics + shared menu theme
Arcade games (PRD §5.1), generalizing the sandboxed-PTY DOOM path into an external-game registry: Space Invaders (nInvaders), Pac-Man (pacman4console), Tetris (tint/vitetris), Moon Patrol (moon-buggy). Binaries resolve from assets/bin, PATH, then /usr/games, so a distro install or a hand-built binary lights each game up; missing games are skipped with a discovery hint. Installed on the host via `scripts/fetch-assets.sh --arcade` (apt), wired into setup.sh behind FETCH_ARCADE (default on). UI: new shared ui.Theme.MenuItem widget (accent cursor + badge, description shown only for the focused row) adopted by the hub and arcade menus; the hub groups rows under Features/Sessions headers and the arcade under DOOM/ARCADE/BUILT-IN. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
a8cb7e3182
commit
d810356faf
11 changed files with 471 additions and 135 deletions
|
|
@ -3,10 +3,13 @@
|
|||
# ./assets — Freedoom by default (PRD §9.1). Run on the host before enabling
|
||||
# the arcade's DOOM entries.
|
||||
#
|
||||
# scripts/fetch-assets.sh [--shareware]
|
||||
# scripts/fetch-assets.sh [--shareware] [--arcade]
|
||||
#
|
||||
# --shareware additionally fetches the freely redistributable doom1.wad
|
||||
# shareware episode.
|
||||
# shareware episode.
|
||||
# --arcade installs the 80s arcade classics (Space Invaders, Pac-Man, Tetris,
|
||||
# Moon Patrol) the arcade plugin launches via the same sandboxed-PTY path as
|
||||
# DOOM. Needs apt + sudo (Debian/Ubuntu); the menu lists whatever installs.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
|
@ -14,6 +17,16 @@ ASSETS="$ROOT/assets"
|
|||
BUILD="$ROOT/.build"
|
||||
FREEDOOM_VERSION="${FREEDOOM_VERSION:-0.13.0}"
|
||||
|
||||
want_shareware=0
|
||||
want_arcade=0
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--shareware) want_shareware=1 ;;
|
||||
--arcade) want_arcade=1 ;;
|
||||
*) echo "!! unknown flag: $arg (use --shareware and/or --arcade)" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
mkdir -p "$ASSETS/bin" "$ASSETS/wads" "$BUILD"
|
||||
|
||||
# --- doom-ascii -------------------------------------------------------------
|
||||
|
|
@ -47,12 +60,39 @@ else
|
|||
fi
|
||||
|
||||
# --- Doom shareware (optional) ----------------------------------------------
|
||||
if [ "${1:-}" = "--shareware" ] && [ ! -f "$ASSETS/wads/doom1.wad" ]; then
|
||||
if [ "$want_shareware" = 1 ] && [ ! -f "$ASSETS/wads/doom1.wad" ]; then
|
||||
echo ">> fetching Doom shareware episode"
|
||||
curl -fsSL -o "$ASSETS/wads/doom1.wad" \
|
||||
"https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad"
|
||||
echo ">> installed doom1.wad (shareware)"
|
||||
fi
|
||||
|
||||
# --- Arcade classics (optional) ---------------------------------------------
|
||||
# Tiny, well-packaged ncurses C programs from the distro (Debian/Ubuntu
|
||||
# universe). They land in /usr/games, which the arcade plugin probes alongside
|
||||
# assets/bin and PATH. The arcade menu lists whichever of these is present.
|
||||
ARCADE_PKGS="ninvaders pacman4console moon-buggy tint"
|
||||
if [ "$want_arcade" = 1 ]; then
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
SUDO=""
|
||||
[ "$(id -u)" -ne 0 ] && SUDO="sudo"
|
||||
echo ">> installing arcade classics: $ARCADE_PKGS"
|
||||
$SUDO apt-get update -y
|
||||
# Install individually so one missing package doesn't abort the rest.
|
||||
for pkg in $ARCADE_PKGS; do
|
||||
$SUDO apt-get install -y "$pkg" || echo "!! $pkg not available; skipping"
|
||||
done
|
||||
else
|
||||
echo "!! --arcade needs apt-get (Debian/Ubuntu)." >&2
|
||||
echo " On other distros, install equivalents of: $ARCADE_PKGS" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ">> done. WADs:"
|
||||
ls -l "$ASSETS/wads"
|
||||
echo ">> arcade classics on host:"
|
||||
for bin in ninvaders pacman4console moon-buggy tint vitetris; do
|
||||
p="$(command -v "$bin" 2>/dev/null || true)"
|
||||
[ -z "$p" ] && [ -x "/usr/games/$bin" ] && p="/usr/games/$bin"
|
||||
[ -n "$p" ] && echo " $bin -> $p"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue