-
Notifications
You must be signed in to change notification settings - Fork 834
Fix/3211 map spoiler #3218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ProDCG
wants to merge
4
commits into
openfrontio:main
Choose a base branch
from
ProDCG:fix/3211-map-spoiler
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix/3211 map spoiler #3218
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
307984c
Fixed random map icon display in embed and spoiler images
ProDCG 32b48c7
Updated display modal to handle the randomized map nation counts
ProDCG b168592
Fixed prettier formatting issues
ProDCG 59145b5
Merge branch 'main' into fix/3211-map-spoiler
ryanbarlow97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ export class LobbyTeamView extends LitElement { | |
| @property({ type: Number }) nationCount: number = 0; | ||
| @property({ type: Boolean }) disableNations: boolean = false; | ||
| @property({ type: Boolean }) isCompactMap: boolean = false; | ||
| @property({ type: Boolean }) isRandomMap: boolean = false; | ||
|
|
||
| private theme: PastelTheme = new PastelTheme(); | ||
| @state() private showTeamColors: boolean = false; | ||
|
|
@@ -52,7 +53,8 @@ export class LobbyTeamView extends LitElement { | |
| changedProperties.has("teamCount") || | ||
| changedProperties.has("nationCount") || | ||
| changedProperties.has("disableNations") || | ||
| changedProperties.has("isCompactMap") | ||
| changedProperties.has("isCompactMap") || | ||
| changedProperties.has("isRandomMap") | ||
| ) { | ||
| const teamsList = this.getTeamList(); | ||
| this.computeTeamPreview(teamsList); | ||
|
|
@@ -72,10 +74,10 @@ export class LobbyTeamView extends LitElement { | |
| ? translateText("host_modal.player") | ||
| : translateText("host_modal.players")} | ||
| <span style="margin: 0 8px;">•</span> | ||
| ${this.getEffectiveNationCount()} | ||
| ${this.getEffectiveNationCount() === 1 | ||
| ? translateText("host_modal.nation_player") | ||
| : translateText("host_modal.nation_players")} | ||
| ${this.isRandomMap ? "?" : this.getEffectiveNationCount()} | ||
| ${this.isRandomMap || this.getEffectiveNationCount() !== 1 | ||
| ? translateText("host_modal.nation_players") | ||
| : translateText("host_modal.nation_player")} | ||
| </div> | ||
| </div> | ||
| <div | ||
|
|
@@ -183,15 +185,19 @@ export class LobbyTeamView extends LitElement { | |
|
|
||
| private renderTeamCard(preview: TeamPreviewData, isEmpty: boolean = false) { | ||
| const effectiveNationCount = this.getEffectiveNationCount(); | ||
| const displayCount = | ||
| preview.team === ColoredTeams.Nations | ||
| ? effectiveNationCount | ||
| : preview.players.length; | ||
| const isNationsTeam = preview.team === ColoredTeams.Nations; | ||
|
|
||
| const maxTeamSize = | ||
| preview.team === ColoredTeams.Nations | ||
| ? effectiveNationCount | ||
| : this.teamMaxSize; | ||
| const displayCount = isNationsTeam | ||
| ? this.isRandomMap | ||
| ? "?" | ||
| : effectiveNationCount | ||
| : preview.players.length; | ||
|
|
||
| const maxTeamSize = isNationsTeam | ||
| ? this.isRandomMap | ||
| ? "?" | ||
| : effectiveNationCount | ||
| : this.teamMaxSize; | ||
|
Comment on lines
+190
to
+200
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you turn this into regular if statements, nested ternary are hard to reason about |
||
|
|
||
| return html` | ||
| <div class="bg-gray-800 border border-gray-700 rounded-xl flex flex-col"> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openfrontio/OpenFrontIO
Length of output: 953
🏁 Script executed:
Repository: openfrontio/OpenFrontIO
Length of output: 7854
🏁 Script executed:
Repository: openfrontio/OpenFrontIO
Length of output: 7018
🏁 Script executed:
Repository: openfrontio/OpenFrontIO
Length of output: 17152
Pass
isRandomMapto lobby-player-view in join lobby modal.The
<lobby-player-view>component inJoinLobbyModal.ts(line 130-142) is missing the.isRandomMapproperty. When a random map is selected, the nation count display shows a number instead of "?" like in the host modal.Add:
.isRandomMap=${this.gameConfig?.useRandomMap ?? false}This matches the pattern already used in
HostLobbyModal.ts(line 324).🤖 Prompt for AI Agents