From 8f0d8d6655ab3acc09a0c8cab867a802662c2aaf Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 20 Jan 2024 14:18:41 +0100 Subject: [PATCH] Menu: make player list in the Server Info dialog more readable --- qcsrc/menu/xonotic/playerlist.qc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qcsrc/menu/xonotic/playerlist.qc b/qcsrc/menu/xonotic/playerlist.qc index 65373f1b1..f9f3edd67 100644 --- a/qcsrc/menu/xonotic/playerlist.qc +++ b/qcsrc/menu/xonotic/playerlist.qc @@ -68,8 +68,8 @@ void XonoticPlayerList_resizeNotify(entity me, vector relOrigin, vector relSize, me.columnScoreSize = 5 * me.realFontSize.x; me.columnNameSize = 1 - 3 * me.realFontSize.x - me.columnScoreSize; - me.columnNameOrigin = me.realFontSize.x; - me.columnScoreOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize.x; + me.columnScoreOrigin = me.realFontSize.x; + me.columnNameOrigin = me.columnScoreOrigin + me.columnScoreSize + me.realFontSize.x; } void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused) @@ -89,9 +89,10 @@ void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool is string name = me.getPlayerList(me, i, PLAYERPARM_NAME); string score = me.getPlayerList(me, i, PLAYERPARM_SCORE); + bool is_spectator = false; if(substring(score, strlen(score) - 10, 10) == ":spectator") { - score = _("spectator"); + is_spectator = true; } else { @@ -101,7 +102,13 @@ void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool is score = substring(score, 0, t); if(stof(score) == FRAGS_SPECTATOR) - score = _("spectator"); + is_spectator = true; + } + + if (is_spectator) + { + score = _("spectator"); + rgb = '0.3 0.3 0.3'; } name = draw_TextShortenToWidth(name, me.columnNameSize, 1, me.realFontSize); -- 2.39.2