-
Notifications
You must be signed in to change notification settings - Fork 706
Team leaderboard: own team bold + fix headers allignment #2336
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
Conversation
|
|
WalkthroughAdds an Changes
Sequence Diagram(s)sequenceDiagram
participant UI as TeamStats UI
participant Model as Game Model
participant Renderer as DOM Renderer
Note over UI,Model: Update cycle
UI->>Model: request current player & teams
Model-->>UI: return player, teams
UI->>UI: set _myTeam if null (lazy init)
UI->>UI: map teams -> TeamEntry including isMyTeam = team === _myTeam
UI->>Renderer: render rows (apply font-bold if isMyTeam)
Renderer-->>UI: render complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
Poem
Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
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 |
| const grouped: Record<Team, PlayerView[]> = {}; | ||
|
|
||
| if (this._myTeam === null) { | ||
| const myPlayer = this.game.myPlayer(); |
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.
I don't think we need to check the team for each ticks, maybe move it in the init method
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.
In the init is too early sadly, team is still null at that point.
I did put it in updateTeamStats(), which is called every 10 ticks from tick(). And it has a null check so the fetch and assignment happens only once. But the null check every 10 ticks seems unavoidable
evanpelle
left a comment
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.
thanks!
Description:
Closes #2185. Made own team name bold in Team Stats. In Show Unit and Show Control. This follows #2221 which made team mate names bold in the Leaderboard.
Also fixed column names allignment. They sat in different vertical positions before.
BEFORE
AFTER
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
tryout33