Skip to content

[small-fix 20 lines] Add FFA collusion warning#4107

Open
a-happy-goose wants to merge 1 commit into
openfrontio:mainfrom
a-happy-goose:ffa-spawn-collusion-warning
Open

[small-fix 20 lines] Add FFA collusion warning#4107
a-happy-goose wants to merge 1 commit into
openfrontio:mainfrom
a-happy-goose:ffa-spawn-collusion-warning

Conversation

@a-happy-goose
Copy link
Copy Markdown
Contributor

Resolves #3900

Description:

During the spawn phase in FFA games, display a collusion warning to clearly communicate to new users that pre-game agreement is not allowed.
2026-06-01_20-31

  • 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

@a-happy-goose a-happy-goose requested a review from a team as a code owner June 1, 2026 23:40
@github-actions github-actions Bot added the small-fix Small fix (≤ 50 lines) — auto-applied by PR gate label Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Walkthrough

This PR adds a heads-up warning message to inform new players that pre-game collusion is not permitted in FFA mode. The warning displays during spawn phase and includes a new English translation string defining the message content.

Changes

FFA Collusion Warning Feature

Layer / File(s) Summary
FFA Collusion Warning in HUD
src/client/hud/layers/HeadsUpMessage.ts, resources/lang/en.json
Import GameMode to check game mode, add conditional rendering in spawn phase for FFA mode that displays the translated message heads_up_message.ffa_collusion, and define the English translation string.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🎮 A warning on the spawning ground,
"No deals before the fight!" we've found.
Fair-for-all means truly fair,
No secret teams in this shared air.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an FFA collusion warning during spawn phase.
Description check ✅ Passed The description is related to the changeset, explaining the purpose and referencing issue #3900 with supporting UI screenshot.
Linked Issues check ✅ Passed The pull request fully addresses issue #3900 by adding a visible collusion warning message during FFA spawn phase to inform new users.
Out of Scope Changes check ✅ Passed All changes are scoped to the FFA collusion warning: translation string addition and conditional HUD message rendering during spawn.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/client/hud/layers/HeadsUpMessage.ts`:
- Around line 185-186: In HeadsUpMessage.render (class HeadsUpMessage) guard
access to this.game before calling its methods: change the FFA warning condition
to first verify this.game exists (e.g. this.game && this.game.inSpawnPhase()) or
otherwise short-circuit when this.game is undefined; update any related checks
in render that reference this.game (including the spawn-phase/FFA expression and
any places that set isVisible via getMessage()) so initial Lit renders before
the controller injects game do not dereference this.game.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 69673d03-3983-445e-9d40-84f37d8e0ed4

📥 Commits

Reviewing files that changed from the base of the PR and between 5802c19 and 9799831.

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

Comment thread src/client/hud/layers/HeadsUpMessage.ts
@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management Jun 1, 2026
</div>
`
: null}
${this.game.inSpawnPhase() &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should add a close button and only show this to a player once.

@Celant
Copy link
Copy Markdown
Member

Celant commented Jun 2, 2026

Also might be worth slightly softening the wording, so it sounds like a tip rather than a warning? Even just a "Remember: " at the start

@Celant Celant added this to the Backlog milestone Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small-fix Small fix (≤ 50 lines) — auto-applied by PR gate

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

Clearly communicate that teaming is not allowed in ffa

3 participants