From 99b38c1880083b997b6d0de37d8403b1e9124818 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 26 Apr 2011 15:11:51 +0200 Subject: [PATCH] Move rankings code (score panel) into its own function as preparation for showing rankings in team games too --- qcsrc/client/hud.qc | 161 +++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 77 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 749a23a4a..19b2a2489 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2579,6 +2579,89 @@ void HUD_Radar(void) // Score (#7) // void HUD_UpdatePlayerTeams(); +void HUD_Score_Rankings(vector pos, vector mySize, entity me) +{ + float score; + entity tm, pl; +#define SCOREPANEL_MAX_ENTRIES 6 +#define SCOREPANEL_ASPECTRATIO 2 + const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES); + const float height = mySize_y/entries; + const vector fontsize = '0.9 0.9 0' * height; + pos_y += height * (1 - 0.9) / 2; + + vector rgb; + rgb = '1 1 1'; + + const float name_size = mySize_x*0.75; + const float highlight_alpha = 0.2; + float i, me_printed; + string s; + if (autocvar__hud_configure) + { + score = 10 + SCOREPANEL_MAX_ENTRIES * 3; + for (i=0; i