[PR #2507] [MERGED] Create New World: edit the game rules before creating the world #4376

Closed
opened 2026-11-03 04:16:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2507
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: feat/create-world-rules


📝 Commits (1)

  • 1596b84 Create New World: the Game Rules button opens the rules screen and the choices are saved with the world

📊 Changes

9 files changed (+140 additions, -42 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+2 -2)
📝 crates/horizon-client/src/game/lan_screen.rs (+2 -6)
📝 crates/horizon-client/src/game/startup_menu.rs (+5 -0)
📝 crates/horizon-client/src/game/world_loading.rs (+2 -0)
📝 crates/horizon-client/src/game_rules_screen.rs (+38 -30)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/title.rs (+79 -0)
📝 crates/horizon-client/src/title/create_world.rs (+6 -2)
📝 crates/horizon-client/src/title/tests.rs (+5 -2)

📄 Description

What and why

The Game Rules button on the More tab of Create New World was greyed out. It now opens the game rules screen. Done keeps the edited rules, Cancel or Escape drops them without asking, and the kept rules are written into the new world's saved game rules. Re-Create starts from the old world's rules.

The rules screen used to live in the binary and was only reachable from the in-world options. It moved into the library (game_rules_screen) so the title screen, which both the startup menu and the in-game title use, can open it without any host wiring beyond one extra click call. The in-world screen behaves as before; the creation variant uses the menu background and leaves without a confirmation.

Vanilla reference

  • CreateWorldScreen.MoreTab.openGameRulesScreen and WorldCreationUiState.getGameRules / setGameRules
  • WorldCreationGameRulesScreen (onDone applies, onClose discards) next to InWorldGameRulesScreen
  • CreateWorldScreen.createNewWorld (the rules go with the new level)
  • WorldOpenFlows.recreateWorldData (Re-Create keeps the existing rules)

Self-check

cargo check -p horizon-client passes. Clippy with -D warnings is clean and the existing title and rules screen tests pass (one assertion about the disabled More tab buttons was updated). In game on the title screen: opened the rules from the More tab, turned one rule off, Done, reopened (kept), turned another off and pressed Cancel, reopened (not kept), created the world and /gamerule showed the changed rule off and the others at their defaults. Re-Create was not run in game.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2507 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/create-world-rules` --- ### 📝 Commits (1) - [`1596b84`](https://github.com/horizon-rust/horizon/commit/1596b8429921fc07f98620908b61c6d21c90ab45) Create New World: the Game Rules button opens the rules screen and the choices are saved with the world ### 📊 Changes **9 files changed** (+140 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+2 -2) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+2 -6) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+5 -0) 📝 `crates/horizon-client/src/game/world_loading.rs` (+2 -0) 📝 `crates/horizon-client/src/game_rules_screen.rs` (+38 -30) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/title.rs` (+79 -0) 📝 `crates/horizon-client/src/title/create_world.rs` (+6 -2) 📝 `crates/horizon-client/src/title/tests.rs` (+5 -2) </details> ### 📄 Description ## What and why The Game Rules button on the More tab of Create New World was greyed out. It now opens the game rules screen. Done keeps the edited rules, Cancel or Escape drops them without asking, and the kept rules are written into the new world's saved game rules. Re-Create starts from the old world's rules. The rules screen used to live in the binary and was only reachable from the in-world options. It moved into the library (`game_rules_screen`) so the title screen, which both the startup menu and the in-game title use, can open it without any host wiring beyond one extra click call. The in-world screen behaves as before; the creation variant uses the menu background and leaves without a confirmation. ## Vanilla reference - `CreateWorldScreen.MoreTab.openGameRulesScreen` and `WorldCreationUiState.getGameRules` / `setGameRules` - `WorldCreationGameRulesScreen` (`onDone` applies, `onClose` discards) next to `InWorldGameRulesScreen` - `CreateWorldScreen.createNewWorld` (the rules go with the new level) - `WorldOpenFlows.recreateWorldData` (Re-Create keeps the existing rules) ## Self-check `cargo check -p horizon-client` passes. Clippy with `-D warnings` is clean and the existing title and rules screen tests pass (one assertion about the disabled More tab buttons was updated). In game on the title screen: opened the rules from the More tab, turned one rule off, Done, reopened (kept), turned another off and pressed Cancel, reopened (not kept), created the world and `/gamerule` showed the changed rule off and the others at their defaults. Re-Create was not run in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:43 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4376
No description provided.