Skip to content

[small fix] Add "TEAMING PROHIBITED" label to FFA games#4076

Closed
a-happy-goose wants to merge 1 commit into
openfrontio:mainfrom
a-happy-goose:communicate-teaming-not-allowed-ffa
Closed

[small fix] Add "TEAMING PROHIBITED" label to FFA games#4076
a-happy-goose wants to merge 1 commit into
openfrontio:mainfrom
a-happy-goose:communicate-teaming-not-allowed-ffa

Conversation

@a-happy-goose
Copy link
Copy Markdown
Contributor

Resolves #3900

Description:

Add "TEAMING PROHIBITED" label to FFA games, clearly communicating to new users that teaming is not allowed.

2026-05-30_11-42

Please complete the following:

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

Please put your Discord username so you can be contacted if a bug or regression is found:

goose126

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

Review Change Stack

Walkthrough

This PR adds a "Teaming Prohibited" modifier label to FFA game lobbies. A new English localization string is added, and the GameModeSelector component prepends this label to the displayed modifiers list for FFA games, making the teaming restriction visible to players before they join.

Changes

FFA Teaming Prohibition Display

Layer / File(s) Summary
FFA teaming prohibition label
resources/lang/en.json, src/client/GameModeSelector.ts
Translation key public_game_modifier.teaming_prohibited added. GameModeSelector prepends this label to the modifiers list when rendering FFA lobby cards, ensuring the restriction is visible during mode selection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🎮 In FFA's realm where no teaming shall stand,
A label now signals the rule of the land.
One string, one unshift, clear as day—
"Teaming prohibited"—no cheating this way! ⚔️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the label and including screenshots, checklist confirmations, and contact information.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #3900 by adding a visible 'TEAMING PROHIBITED' label to FFA games to inform users that teaming is not allowed.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective of adding a teaming prohibition label to FFA games; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main change: adding a 'TEAMING PROHIBITED' label to FFA games, which directly matches the changeset modifications in GameModeSelector.ts and the localization file.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/client/GameModeSelector.ts (1)

305-310: 💤 Low value

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between f366f76 and da5b0af.

📒 Files selected for processing (2)
  • resources/lang/en.json
  • src/client/GameModeSelector.ts

@a-happy-goose a-happy-goose changed the title Add "TEAMING PROHIBITED" label to FFA games [small fix] Add "TEAMING PROHIBITED" label to FFA games May 30, 2026
Copy link
Copy Markdown
Collaborator

@evanpelle evanpelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@a-happy-goose a-happy-goose deleted the communicate-teaming-not-allowed-ffa branch June 1, 2026 19:04
@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Jun 1, 2026
@a-happy-goose
Copy link
Copy Markdown
Contributor Author

I made another PR: #4107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Clearly communicate that teaming is not allowed in ffa

2 participants