Skip to content

M13: seed display + copy + roll in the HUD - #6

Open
TheAmericanMaker wants to merge 1 commit into
mainfrom
qwen-dev
Open

M13: seed display + copy + roll in the HUD#6
TheAmericanMaker wants to merge 1 commit into
mainfrom
qwen-dev

Conversation

@TheAmericanMaker

Copy link
Copy Markdown
Owner

Wave 1 final item: shareable, replayable runs.

What

  • HUD row gains a seed number input (0..2^32-1) that always shows the
    running world's seed, plus Copy seed and New seed buttons.
  • Type a seed + Enter (or blur) → the world restarts under that seed
    (all-time records carry over, fx/shake/tornado/inspect clear).
    An empty entry reverts to the running seed without resetting.
  • New seed rolls a uniform 32-bit seed (crypto.getRandomValues) and
    restarts.
  • Reset world now restarts the current seed (was hard-coded 1).
  • Copy uses navigator.clipboard with an execCommand fallback and flashes
    "Copied!" / "Copy failed".
  • Splash legend gains a Seed line; number input gets dark styling.

Sim randomness is untouched — everything still flows through world.rng;
the roll lives in the UI layer only, so the M12 determinism guard is
unaffected (74/74 green locally).

Verified

  • node --test "tests/*.test.js" → 74 pass / 0 fail
  • /tmp/ui-smoke.mjs → 22/22 (new M13 block: display, typed seeds 7 /
    max uint32 / 0, empty-entry revert, reset-keeps-seed, roll, copy feedback)
  • Headless Chromium (Playwright): seed row visible at boot (paused), typed
    seed 424242 restarts at tick 0 and runs under it after Resume, New seed
    rolls a different uint32, Reset keeps it, copy feedback + clipboard
    write, empty entry reverts — zero console errors.

Created by the Qwen3.8-27B (local) agent running in opencode, on behalf of TheAmericanMaker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant