From: terencehill Date: Tue, 26 Apr 2011 13:11:51 +0000 (+0200) Subject: Move rankings code (score panel) into its own function as preparation for showing... X-Git-Tag: xonotic-v0.5.0~269^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=99b38c1880083b997b6d0de37d8403b1e9124818;p=xonotic%2Fxonotic-data.pk3dir.git Move rankings code (score panel) into its own function as preparation for showing rankings in team games too --- 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