Add custom text truncation support, and improve scoreboard legibility#7169
Add custom text truncation support, and improve scoreboard legibility#7169Lightningbulb2 wants to merge 14 commits into
Conversation
|
Warning Review limit reached
Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Sorry, had to remake pull request to move it to a feature branch instead of my develop branch.
Original PR:
#7105
Description of the proposed changes
I wanted to improve scoreboard legibility.
I started by separating game speed, and game quality into their own controls to make modding and future changes easier. I added dropshadows, tooltips, and right aligned the ratings while making sure to crop player names if necessary. This led to the-
Implementation of SetTruncateText() which defaults to "..." but can have custom trailing strings like "/", "-", or even "ITDOESNTFIT" (for larger amounts of text where cropping bugs could be missed).
This is executed through SetClipToWidth() and only activates if SetTruncationEnabled(true) is set.
To do this cleanly, and in a reusable way, I split SetText() into SetText() and its implicitly called SetDisplayText().
SetText() - controls the source text and behaves practically the same as before
SetDisplayText() - sends text changes to the engine without changing the Text object's internal string. This allows for better mod and source code capabilities for fancier text. The first example being custom text truncation.
Testing done on the proposed changes
I loaded up private AI matches and replays to check for console and visual errors. I got screenshots:
Original for reference (plus rank cropping issue)

Game start with lots of players

Full scoreboard

Replay scoreboard

Show full player names after hovering for a moment (in-case of cropped names)

Tooltips added for new players

Checklist