[small fix] Add "TEAMING PROHIBITED" label to FFA games#4076
[small fix] Add "TEAMING PROHIBITED" label to FFA games#4076a-happy-goose wants to merge 1 commit into
Conversation
WalkthroughThis PR adds a "Teaming Prohibited" modifier label to FFA game lobbies. A new English localization string is added, and the ChangesFFA Teaming Prohibition Display
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/client/GameModeSelector.ts (1)
305-310: 💤 Low valueConsider clarifying the label ordering intent.
The "TEAMING PROHIBITED" label is prepended after the existing modifiers are sorted by length (line 301-303). This means it will always appear first, even if it's longer than other labels, which differs from the "visual consistency (shorter labels first)" approach described in the comment on line 300.
If the intent is for the prohibition warning to always be the first label (for prominence), consider adding a brief comment explaining this exception to the length-based sorting.
Alternatively, if all labels should be sorted consistently by length, move the FFA label insertion before the sorting step.
📝 Proposed clarification
modifierLabels.sort((a, b) => a.length - b.length); } - // Add "TEAMING PROHIBITED" label to FFA games + // Prepend "TEAMING PROHIBITED" label to FFA games (always first for prominence) if (lobby.gameConfig?.gameMode === GameMode.FFA) { modifierLabels.unshift( translateText("public_game_modifier.teaming_prohibited"),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/client/GameModeSelector.ts` around lines 305 - 310, The "TEAMING PROHIBITED" label is being prepended after modifiers have been sorted by length, which breaks the shorter-first ordering; either move the FFA insertion so it happens before the existing length-based sort (i.e., add the translateText("public_game_modifier.teaming_prohibited") into modifierLabels prior to the sort call) to keep consistent ordering, or keep it as a deliberate exception but add a short comment above the if (lobby.gameConfig?.gameMode === GameMode.FFA) block explaining that this label must be forced to the front for prominence and that it intentionally overrides the length-based sort; modify the code around modifierLabels and the sort to reflect the chosen approach.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/client/GameModeSelector.ts`:
- Around line 305-310: The "TEAMING PROHIBITED" label is being prepended after
modifiers have been sorted by length, which breaks the shorter-first ordering;
either move the FFA insertion so it happens before the existing length-based
sort (i.e., add the translateText("public_game_modifier.teaming_prohibited")
into modifierLabels prior to the sort call) to keep consistent ordering, or keep
it as a deliberate exception but add a short comment above the if
(lobby.gameConfig?.gameMode === GameMode.FFA) block explaining that this label
must be forced to the front for prominence and that it intentionally overrides
the length-based sort; modify the code around modifierLabels and the sort to
reflect the chosen approach.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ea3fa865-dbac-4fc1-a70e-a60cf74c27b5
📒 Files selected for processing (2)
resources/lang/en.jsonsrc/client/GameModeSelector.ts
evanpelle
left a comment
There was a problem hiding this comment.
I was thinking maybe instead on the loading screen or as a heads up message in the spawn phase. Also "teaming" is a bit vague people may think all alliances are not allowed, we need to make it clear that teaming up before the game starts is not allowed.
|
I made another PR: #4107 |
Resolves #3900
Description:
Add "TEAMING PROHIBITED" label to FFA games, clearly communicating to new users that teaming is not allowed.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
goose126