Make april fool maps have the same name as normal maps#3555
Make april fool maps have the same name as normal maps#3555evanpelle merged 4 commits intoopenfrontio:mainfrom
Conversation
WalkthroughThe changes update display names for five game map types in the GameMapType enum and adjust map playlist frequency weights by adding new entries and modifying existing ones. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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/core/game/Game.ts (1)
146-150: Use explicit display names instead of trailing spaces for clarity.Lines 147–150 use trailing spaces as a pattern to customize display labels (e.g.,
"Amazon River "vs. the key"AmazonRiverWide"). While the spaces are normalized away bynormaliseMapKey()and don't affect behavior, this pattern is confusing to read and maintain.Prefer an explicit map-name alias table (keyed by
GameMapName) that maps each key to its display label, keeping enum values stable and intent clear.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/game/Game.ts` around lines 146 - 150, The enum entries (MilkyWay, AmazonRiverWide, ReglaciatedAntarctica, TheBoxPlus, WorldRotated) currently carry trailing spaces to signal display labels; remove those trailing spaces from the enum values and instead add an explicit alias/label lookup (e.g., a constant map keyed by the GameMapName enum) that maps each enum key to its desired display string, update any usage that relied on trailing-space behavior (including normaliseMapKey()) to use the new label map, and keep the enum values stable for logic while using the new label map for UI/display.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/core/game/Game.ts`:
- Around line 146-150: The enum entries (MilkyWay, AmazonRiverWide,
ReglaciatedAntarctica, TheBoxPlus, WorldRotated) currently carry trailing spaces
to signal display labels; remove those trailing spaces from the enum values and
instead add an explicit alias/label lookup (e.g., a constant map keyed by the
GameMapName enum) that maps each enum key to its desired display string, update
any usage that relied on trailing-space behavior (including normaliseMapKey())
to use the new label map, and keep the enum values stable for logic while using
the new label map for UI/display.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d63bd909-fdeb-4d76-940a-4119318d31a5
📒 Files selected for processing (6)
resources/lang/en.jsonresources/maps/amazonriverwide/thumbnail.webpresources/maps/reglaciatedantarctica/thumbnail.webpresources/maps/worldrotated/thumbnail.webpsrc/core/game/Game.tssrc/server/MapPlaylist.ts
update the map rotation numbers of normal maps to be lower
The merge-base changed after approval.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/core/game/Game.ts (1)
148-151: Avoid hidden trailing spaces in enum values.Lines 148-151 rely on invisible whitespace to create “same-looking” names. This is fragile for filtering, comparisons, analytics, and any trim/normalize step. Prefer keeping canonical enum values and applying April Fools aliases in the display layer only.
Proposed direction
export enum GameMapType { - AmazonRiverWide = "Amazon River ", - ReglaciatedAntarctica = "Deglaciated Antarctica ", - TheBoxPlus = "The Box ", - WorldRotated = "World ", + AmazonRiverWide = "Amazon River Wide", + ReglaciatedAntarctica = "Reglaciated Antarctica", + TheBoxPlus = "The Box Plus", + WorldRotated = "World Rotated", } + +// Use this only where the prank should apply (e.g., public playlist UI). +export const APRIL_FOOLS_PUBLIC_NAME_OVERRIDES: Partial<Record<GameMapType, string>> = { + [GameMapType.AmazonRiverWide]: "Amazon River", + [GameMapType.ReglaciatedAntarctica]: "Deglaciated Antarctica", + [GameMapType.TheBoxPlus]: "The Box", + [GameMapType.WorldRotated]: "World", +};🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/game/Game.ts` around lines 148 - 151, The enum entries AmazonRiverWide, ReglaciatedAntarctica, TheBoxPlus, and WorldRotated contain hidden trailing spaces in their string values; remove those trailing spaces so the canonical enum values are exact (e.g., "Amazon River" not "Amazon River "), and move any April Fools or display-only aliases into the presentation layer (create or use a displayName map or a getDisplayName/getAlias function for UI/analytics) rather than embedding invisible whitespace in the enum constants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/core/game/Game.ts`:
- Around line 148-151: The enum entries AmazonRiverWide, ReglaciatedAntarctica,
TheBoxPlus, and WorldRotated contain hidden trailing spaces in their string
values; remove those trailing spaces so the canonical enum values are exact
(e.g., "Amazon River" not "Amazon River "), and move any April Fools or
display-only aliases into the presentation layer (create or use a displayName
map or a getDisplayName/getAlias function for UI/analytics) rather than
embedding invisible whitespace in the enum constants.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b4c3238a-f509-46f0-ad9c-d7856a928990
📒 Files selected for processing (2)
src/core/game/Game.tssrc/server/MapPlaylist.ts
Description:
Make the april fool maps have the same name as the normal maps, in order to make the prank better.
NOTE: In order for this to work, it re-adds the normal maps into rotation. These normal maps have been given a lower rotation however.
In custom matches the maps will appear with the april fools names.
This change will be reverted after April Fools.
Check this for proof of it working:
https://canary.discord.com/channels/1359946986937258015/1450487807242932336/1488682300924231882
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
DISCORD_USERNAME