feat(alliances): custom alliance duration lobby control (#4522)

Replaces the "Disable alliances" toggle in the host and single-player
lobbies with a "Custom alliances" control: a toggle plus a minutes input
(0 to 15, step 1).

- 0 minutes disables alliances, same behavior as the old toggle.
- 1 to 15 sets the alliance duration in minutes.

How it works:

- Adds one game-config field, `customAllianceDuration` (minutes).
- `Config.allianceDuration()` uses it when set (and falls back to the
existing 5 minute default), and `Config.disableAlliances()` returns true
when it is 0.
- The legacy `disableAlliances` boolean is still read, so older/archived
configs keep working.
- Validation reuses the existing `parseBoundedIntegerFromInput` and
`toggle-input-card` helpers, so it behaves like the other numeric lobby
options (spawn immunity, max timer).
- The join-lobby screen shows "Alliances: {x}m", or "Alliances:
Disabled" at 0.

<img width="279" height="145" alt="image"
src="https://github.com/user-attachments/assets/5a608e18-3811-4eef-a3a6-9344aaf667fe"
/>
<img width="270" height="152" alt="image"
src="https://github.com/user-attachments/assets/9d8a4d30-51e7-4e82-8ce0-121b12af1c61"
/>
<img width="270" height="144" alt="image"
src="https://github.com/user-attachments/assets/a65b20fb-0db5-4657-a964-880fad7c864e"
/>

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory

regression is found:

zixer._
This commit is contained in:
Zixer1
2026-07-09 09:30:26 -07:00
committed by evanpelle
parent 54e84dbe95
commit b3a74dc118
9 changed files with 172 additions and 27 deletions
+3 -2
View File
@@ -715,7 +715,7 @@
"bots_disabled": "Disabled",
"compact_map": "Compact Map",
"crowded": "Crowded modifier",
"disable_alliances": "Disable alliances",
"custom_alliances": "Alliance Duration",
"donate_gold": "Donate gold",
"donate_troops": "Donate troops",
"doomsday_clock": "Doomsday Clock",
@@ -1213,7 +1213,7 @@
"bots": "Tribes: ",
"bots_disabled": "Disabled",
"compact_map": "Compact Map",
"disable_alliances": "Disable alliances",
"custom_alliances": "Alliance Duration",
"doomsday_clock": "Doomsday Clock",
"enables_title": "Disable Units",
"gold_multiplier": "Gold multiplier",
@@ -1224,6 +1224,7 @@
"max_timer": "Game length (minutes)",
"max_timer_invalid": "Please enter a valid max timer value (1-120 minutes)",
"max_timer_placeholder": "Mins",
"mins_placeholder": "Mins",
"nations": "Nations: ",
"nations_disabled": "Disabled",
"options_changed_no_achievements": "Custom settings achievements disabled",