Don't show Max Player slider if Min players == Max players#9929
Don't show Max Player slider if Min players == Max players#9929nixxquality wants to merge 1 commit intoFacepunch:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Create Game modal so that the “Max Players” slider is only shown when the configured minimum and maximum player counts differ.
Changes:
- Wraps the “Max Players” slider in a conditional so it is only rendered when
MinPlayers != MaxPlayers. - Leaves all backing logic (
Players,MaxPlayers,MinPlayers, cookie handling, andOnSave) unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @if ( MinPlayers != MaxPlayers ) | ||
| { | ||
| <div class="entry"> | ||
| <div class="is-label">Max Players</div> | ||
| <div class="control"> | ||
| <SliderControl class="glass with-grow" Value:bind=@Players Min=@MinPlayers Max=@MaxPlayers Step=@(1) ShowTextEntry=@true /> |
There was a problem hiding this comment.
Conditionally hiding the Max Players slider when MinPlayers == MaxPlayers solves the UI issue, but it doesn’t actually enforce that fixed player count in the data that gets saved and passed to CreateGameResults. If a user has an existing cookie from when MinPlayers and MaxPlayers differed, Output.MaxPlayers (and thus Players) can still hold an out-of-range value even though the slider is now hidden, which contradicts the intent of always using the fixed player count for these games. Consider explicitly forcing Players to MinPlayers when MinPlayers == MaxPlayers (e.g. on initialization and/or in OnSave) so that stale cookie values cannot override the package’s fixed player count.
There was a problem hiding this comment.
This would be a separate change, since this can happen with regular use as well.
Summary
This PR modifies the Create Game modal to only show the Max players slider if it's meaningful.
Motivation & Context
One of my games, Quality Riichi Mahjong has a minimum players of 4 and a maximum players of 4.
When you get the Create Game popup for this game, you get a Max players slider where both the min and max is 4, and so it does not move.
I feel it's appropriate that if you've set up your project settings so that min and max players are the same, then you should always use that number as the player count.
Screenshots / Videos (if applicable)
Before:
s.box.-.2026-01-29.4-01-29.PM.mp4
After:

Other games remain unaffected:

Checklist