Wire the seed input into GameState.run_seed #5
No reviewers
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "2-wire-seed-input"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The seed field collected a value nothing read, and New Game did nothing. Both are now wired through a single
_start_new_game(), reached fromNewGameBtn.pressedandSeedInput.text_submitted, so the two entry paths cannot drift.Resolution rule:
randi()— a fresh random each timehash(text), so word seeds likeeuropaworkThe resolved seed is echoed back into the field so the player can see and share what they are playing.
text_submittedcarries aStringthe receiver does not need. Rather thanunbind(1), it goes to a named_on_seed_submitted()that ignores the text and calls the shared function — keeping_on_new_game_pressedhonest about what it handles.max_lengthdrops 20 → 19:is_valid_int()accepts 20 digits, but int64 tops out at 19 andto_int()would overflow.Ordering matters
The echo must happen after resolution. Writing the previous seed into the field first overwrote the player's input before it was read — a typed seed was silently discarded on the button path while the Enter path honoured it. There is a comment on that line; it looks like a harmless reorder and is not.
Verification
Driving both paths headless:
The last block is the echo working as designed, not a regression: the first press fills the field, so repeat presses reuse that seed. If a blank field should reroll every time, that is a deliberate follow-up (drop the echo, or add a reroll control).
Note
print()in_start_new_game()is retained deliberately — there is no game scene yet, so the console is the only way to observe the resolved seed. It goes when the scene change lands.Closes #2
Closes #3