Add ROM upload, local table library, engine bump, and UX/responsiveness fixes

- Bump @valknar/vpinball-wasm to 0.3.2 (PinMAME ROM support, MsgBox fix)
- Add optional PinMAME ROM .zip upload alongside .vpx tables
- Persist uploaded tables/ROMs in IndexedDB so users don't have to
  re-upload on later visits, with a library list on the landing page
- Fix Insert Coin key mismatch with the engine's real coin-door gating
  (now bound to 4, matching the shared table scripts) and surface it
  in the controls legend and "Tap to Start" hint
- Make the landing page, staging panel, and in-game HUD responsive for
  portrait phone widths; drop the landscape hint since portrait plays fine
- Replace the separate STATS HUD toggle with an FPS row in the info panel

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9JmzRBZenapVkFWjw9jmG
This commit is contained in:
2026-08-23 20:15:41 +02:00
co-authored by Claude Sonnet 5
parent 5b30442c4a
commit 35fb68c916
21 changed files with 472 additions and 99 deletions
+13 -3
View File
@@ -1,22 +1,24 @@
"use client";
import { useRef } from "react";
import { usePinballInstance } from "@/lib/pinball/usePinballInstance";
import { usePinballInstance, type RomSelection } from "@/lib/pinball/usePinballInstance";
import { useTouchControls } from "@/lib/pinball/useTouchControls";
import CoinDoorHud from "@/components/hud/CoinDoorHud";
import type { TableInfo } from "@/lib/pinball/types";
export interface PinballCanvasImplProps {
tableData?: ArrayBuffer;
rom?: RomSelection;
tableInfo: TableInfo;
}
export default function PinballCanvasImpl({ tableData, tableInfo }: PinballCanvasImplProps) {
export default function PinballCanvasImpl({ tableData, rom, tableInfo }: PinballCanvasImplProps) {
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const containerRef = useRef<HTMLDivElement | null>(null);
const { status, progress, error, loadTimeMs, instanceRef, start } = usePinballInstance(
canvasRef,
tableData,
rom,
);
useTouchControls(containerRef, status === "running");
@@ -54,7 +56,7 @@ export default function PinballCanvasImpl({ tableData, tableInfo }: PinballCanva
)}
{status === "ready" && (
<div className="absolute inset-0 flex items-center justify-center bg-ink/80">
<div className="absolute inset-0 flex flex-col items-center justify-center gap-3 bg-ink/80">
<button
type="button"
onClick={start}
@@ -62,6 +64,14 @@ export default function PinballCanvasImpl({ tableData, tableInfo }: PinballCanva
>
TAP TO START
</button>
{/* Most tables gate Start Game behind having a credit, same as a
real coin-op cabinet — pressing 1 alone does nothing until a
credit is added. Surfaced here since it's the first thing
anyone hits and easy to mistake for the app not responding. */}
<p className="font-mono text-xs text-chrome">
If Start doesn&apos;t respond: press <span className="text-arc">4</span> to insert a coin, then{" "}
<span className="text-arc">1</span> to start.
</p>
</div>
)}
</div>