Skip to content

Scoreboard: limit width of field titles and show too long titles compressed

Scoreboard: limit width of field titles and show too long titles compressed.

Title width is immediately updated as soon as you change hud_fontsize or hud_panel_scoreboard_table_fieldtitle_maxwidth or apply a column layout with scoreboard_columns_set

Max width can be configured via hud_panel_scoreboard_table_fieldtitle_maxwidth.

Note that a field title can still be wider than maxwidth if data inside its column is wider than maxwidth and it's expanded to fill all the available column width. The name column is an exception as it normally takes all the remaining space up to player name limit (hud_panel_scoreboard_namesize).

If all fields can't fit in the scoreboard try to make them smaller by compressing field title. It allows more columns to be fully shown without them overlapping.

It's implemented by reducing title max width every frame by a small fraction until columns no longer overlap. This isn't a nice approach but I think it will do since it's designed for extreme layouts with lots of fields and finding a good value in one step isn't exactly a trivial task, perhaps not possible at all.

It can be tested by setting a big fontsize (hud_fontsize) or executing scoreboard_columns_set ALL in a CTF game.

Use correct titles for a couple scoreboard fields (now scoreboard can better handle longer titles); use proper field and score names for destroyed generators (Onslaught)

  • "damage" -> "damage dealt"
  • "dmg taken" -> "damage taken"
  • "destroyed" -> "destructions" for keys destroyed by pushing them into void: consistent with other keyhunt field names "losses", "pickups", "caps", "pushes", all of them referring to keys
  • "caps" -> "generators" for generators destroyed (this field is never shown though): no need to specify "destroyed" as it's implicit
  • "objectives" can stay as is for objectives destroyed: no need to specify "destroyed" as it's implicit

This change is also good for better localizations that in many languages require longer words.


This MR replaces !1223 (closed)

Edited by terencehill

Merge request reports