From: FruitieX Date: Thu, 6 May 2010 17:46:59 +0000 (+0300) Subject: big sbar rename to hud for consistency X-Git-Tag: xonotic-v0.1.0preview~541^2~209 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=92f380c831a67868ddde14db32e0d73700ed7d09;p=xonotic%2Fxonotic-data.pk3dir.git big sbar rename to hud for consistency --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index af4514783..6348745d3 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -895,7 +895,7 @@ alias +zoom +button4 alias -zoom -button4 alias +crouch +button5 alias -crouch -button5 -alias weapnext "_weapnext_${_supports_weaponpriority}${sbar_hudselector}${cl_weaponpriority_useforcycling}" +alias weapnext "_weapnext_${_supports_weaponpriority}${hud_hudselector}${cl_weaponpriority_useforcycling}" alias _weapnext_000 "impulse 10" alias _weapnext_001 "impulse 10" alias _weapnext_010 "impulse 10" @@ -909,7 +909,7 @@ alias _weapnext_111 "impulse 15" alias _weapnext_120 "impulse 18" alias _weapnext_121 "impulse 15" alias weaplast "impulse 11" -alias weapprev "_weapprev_${_supports_weaponpriority}${sbar_hudselector}${cl_weaponpriority_useforcycling}" +alias weapprev "_weapprev_${_supports_weaponpriority}${hud_hudselector}${cl_weaponpriority_useforcycling}" alias _weapprev_000 "impulse 12" alias _weapprev_001 "impulse 12" alias _weapprev_010 "impulse 12" @@ -1322,6 +1322,11 @@ seta hud_alpha_bg 0.8 "alpha of the background" seta hud_alpha_fg 1 "alpha of the foreground" seta hud_progressbar_alpha "0.5" "alpha of progressbars" +seta sbar_info_pos 50 + +seta hud_hudselector 1 "0 = health/armor positions flipped, 1 = default hud layout, 2 = combined health and armor display" +seta hud_showcurrentammo 0 "0 = show all ammo types, 1 = show only the ammo type of the current weapon" + seta hud_weaponicons 1 "enable/disable this panel" seta hud_weaponicons_pos "207.5 -74.5" "position of this panel" seta hud_weaponicons_size "230 30" "size of this panel" @@ -1396,6 +1401,7 @@ seta hud_vote_size "200 37.5" "size of this panel" seta hud_vote_bg 0 "enable/disable the background of this panel" seta hud_vote_marigin 30 "size of marigin from the background edges" seta hud_vote_color "" "optional R G B vector of the panel background color, otherwise use hud default" +seta hud_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted" seta hud_pressedkeys 0 "enable/disable this panel" seta hud_pressedkeys_pos "-300 -37.5" "position of this base of the panel" @@ -1404,33 +1410,24 @@ seta hud_pressedkeys_bg 0 "enable/disable the background of this panel" seta hud_pressedkeys_marigin 30 "size of marigin from the background edges" seta hud_pressedkeys_color "" "optional R G B vector of the panel background color, otherwise use hud default" -// these should now be deprecated. -sbar_info_pos 50 -seta sbar_alpha_bg 0.8 "alpha value of the HUD background" -seta sbar_alpha_fg 1 "alpha value of the HUD foreground items" -seta sbar_border_thickness 1 "scoreboard border thickness" -seta sbar_accuracy_border_thickness 1 "accuracy stats border thickness" -seta sbar_accuracy_doublerows 0 "use two rows instead of one" -seta sbar_accuracy 1 "0 = no weapon accuracy stats panel on scoreboard" -seta sbar_accuracy_hud 1 "0 = no weapon accuracy bar on the weapon icons" -seta sbar_color_bg_r 0 "red color component of the HUD background" -seta sbar_color_bg_g 0.25 "green color component of the HUD background" -seta sbar_color_bg_b 0.17 "blue color component of the HUD background" -seta sbar_color_bg_team 0.5 "team color multiplier of the HUD background" -seta sbar_scoreboard_alpha_bg 0.6 "scoreboard background alpha" -seta sbar_scoreboard_alpha_fg 1 "scoreboard foreground alpha" -seta sbar_scoreboard_alpha_name 0.9 "alpha of player text in scoreboard list other than self" -seta sbar_scoreboard_alpha_name_self 1 "alpha of player text in scoreboard list of self" -seta sbar_scoreboard_fadeinspeed 10 "speed at which scoreboard fades in, higher is faster (0 = instant)" -seta sbar_scoreboard_fadeoutspeed 5 "speed at which scoreboard fades out, higher is faster (0 = instant)" -seta sbar_scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard" -seta sbar_scoreboard_highlight_alpha 0.10 "highlight alpha value (depends on sbar_scoreboard_highlight 1)" -seta sbar_scoreboard_highlight_alpha_self 0.25 "self highlight alpha value" -seta sbar_hudselector 1 "0 = health/armor positions flipped, 1 = default hud layout, 2 = combined health and armor display" -seta sbar_showcurrentammo 0 "0 = show all ammo types, 1 = show only the ammo type of the current weapon" -seta sbar_showweaponicons 1 "1 = show icons of weapons that you have" -seta sbar_timer_scale 1 "scale multiplier of the timer" -seta sbar_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted" +// scoreboard +seta scoreboard_border_thickness 1 "scoreboard border thickness" +seta scoreboard_accuracy_border_thickness 1 "accuracy stats border thickness" +seta scoreboard_accuracy_doublerows 0 "use two rows instead of one" +seta scoreboard_accuracy 1 "0 = no weapon accuracy stats panel on scoreboard" +seta scoreboard_color_bg_r 0 "red color component of the HUD background" +seta scoreboard_color_bg_g 0.25 "green color component of the HUD background" +seta scoreboard_color_bg_b 0.17 "blue color component of the HUD background" +seta scoreboard_color_bg_team 0.5 "team color multiplier of the HUD background" +seta scoreboard_alpha_bg 0.6 "scoreboard background alpha" +seta scoreboard_alpha_fg 1 "scoreboard foreground alpha" +seta scoreboard_alpha_name 0.9 "alpha of player text in scoreboard list other than self" +seta scoreboard_alpha_name_self 1 "alpha of player text in scoreboard list of self" +seta scoreboard_fadeinspeed 10 "speed at which scoreboard fades in, higher is faster (0 = instant)" +seta scoreboard_fadeoutspeed 5 "speed at which scoreboard fades out, higher is faster (0 = instant)" +seta scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard" +seta scoreboard_highlight_alpha 0.10 "highlight alpha value (depends on hud_scoreboard_highlight 1)" +seta scoreboard_highlight_alpha_self 0.25 "self highlight alpha value" // for menu server list (eventually make them have engine support?) seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join" @@ -1531,17 +1528,17 @@ set sv_maxidle_spectatorsareidle 0 // CTF capture limit placeholder cvar set capturelimit 0 -// sbar: font size -seta sbar_fontsize 11 -seta sbar_fontsize_spec 16 +// hud: font size +seta hud_fontsize 11 +seta hud_fontsize_spec 16 seta scr_centersize 11 -seta sbar_width 560 -// alias sbar_font "loadfont user1 ${1},gfx/fallback ${2-}; loadfont user2 ${1}-big ${2-}; sbar_columns_set" +seta hud_width 560 +// alias hud_font "loadfont user1 ${1},gfx/fallback ${2-}; loadfont user2 ${1}-big ${2-}; hud_columns_set" alias sbar_font "set _requested_sbar_font \"${*}\"" -seta sbar_columns default +seta hud_columns default sbar_font gfx/vera-sans 8 12 16 24 32 -seta sbar_showbinds 1 "display actions / bound keys in the strings shown during the game. 0 displays only actions, 1 displays only bound keys, 2 displays both" -seta sbar_showbinds_limit 2 "maximum number of bound keys to show for an action. 0 for unlimited" +seta hud_showbinds 1 "display actions / bound keys in the strings shown during the game. 0 displays only actions, 1 displays only bound keys, 2 displays both" +seta hud_showbinds_limit 2 "maximum number of bound keys to show for an action. 0 for unlimited" // these entities are not referenced by anything directly, they just represent // teams and are found by find() when needed @@ -1589,8 +1586,8 @@ seta g_start_delay 0 "delay before the game starts, so everyone can join; recomm alias ons_map "cl_cmd radar" // legacy alias alias radar "cl_cmd radar" -alias sbar_columns_set "cl_cmd sbar_columns_set $*" -alias sbar_columns_help "cl_cmd sbar_columns_help $*" +alias hud_columns_set "cl_cmd hud_columns_set $*" +alias hud_columns_help "cl_cmd hud_columns_help $*" alias _gl_flashblend_update_00 "gl_flashblend 1" alias _gl_flashblend_update_10 "gl_flashblend 0" diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 8020d1a96..14f9301b0 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -151,7 +151,7 @@ void end_sys_fields; // flag for structure dumping float intermission; float sb_showscores; float sb_showaccuracy; -float sbar_currentammo; +float hud_currentammo; .string message; .float renderflags; // float coop; diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 8a230c343..662d33e0f 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -105,14 +105,14 @@ void CSQC_Init(void) #ifndef CAMERATEST } #endif - registercvar("sbar_usecsqc", "1"); - registercvar("sbar_columns", "default", CVAR_SAVE); + registercvar("hud_usecsqc", "1"); + registercvar("hud_columns", "default", CVAR_SAVE); gametype = 0; - // sbar_fields uses strunzone on the titles! - for(i = 0; i < MAX_SBAR_FIELDS; ++i) - sbar_title[i] = strzone("(null)"); + // hud_fields uses strunzone on the titles! + for(i = 0; i < MAX_HUD_FIELDS; ++i) + hud_title[i] = strzone("(null)"); postinit = false; @@ -335,7 +335,7 @@ void TrueAim_Init(); void PostInit(void) { print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n")); - localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n")); + localcmd(strcat("\nhud_columns_set ", cvar_string("hud_columns"), ";\n")); entity playerchecker; playerchecker = spawn(); @@ -506,8 +506,8 @@ void GameCommand(string msg) print("Usage: cl_cmd COMMAND..., where possible commands are:\n"); print(" settemp cvar value\n"); print(" radar\n"); - print(" sbar_columns_set ...\n"); - print(" sbar_columns_help\n"); + print(" hud_columns_set ...\n"); + print(" hud_columns_help\n"); GameCommand_Generic("help"); return; } @@ -526,10 +526,10 @@ void GameCommand(string msg) else if(cmd == "radar") { ons_showmap = !ons_showmap; } - else if(cmd == "sbar_columns_set") { + else if(cmd == "hud_columns_set") { Cmd_HUD_SetFields(argc); } - else if(cmd == "sbar_columns_help") { + else if(cmd == "hud_columns_help") { Cmd_HUD_Help(argc); } #ifdef BLURTEST @@ -675,7 +675,7 @@ void Ent_ReadPlayerScore() float isNew; entity o; - // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN + // damnit -.- don't want to go change every single .sv_entnum in hud.qc AGAIN // (no I've never heard of M-x replace-string, sed, or anything like that) isNew = !self.owner; // workaround for DP bug n = ReadByte()-1; @@ -1298,7 +1298,7 @@ string getcommandkey(string text, string command) string keys; float n, j, k, l; - if (!sbar_showbinds) + if (!hud_showbinds) return text; keys = db_get(binddb, command); @@ -1316,7 +1316,7 @@ string getcommandkey(string text, string command) keys = strcat(keys, ", ", keynumtostring(k)); ++l; - if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break; + if (hud_showbinds_limit > 0 && hud_showbinds_limit >= l) break; } } @@ -1324,12 +1324,12 @@ string getcommandkey(string text, string command) } if ("" == keys) { - if (sbar_showbinds > 1) + if (hud_showbinds > 1) return strcat(text, " (not bound)"); else return text; } - else if (sbar_showbinds > 1) + else if (hud_showbinds > 1) return strcat(text, " (", keys, ")"); else return keys; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index e9354c00a..0384fb236 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -448,7 +448,7 @@ void CSQC_UpdateView(float w, float h) } hud_alpha_fg = cvar_or("hud_alpha_fg", 1) * (1 - cvar("_menu_alpha")); - sbar_currentammo = cvar("hud_showcurrentammo"); + hud_currentammo = cvar("hud_showcurrentammo"); hud_hudselector = cvar("hud_hudselector"); hud_accuracy_hud = cvar_or("hud_accuracy_hud", 1); ColorTranslateMode = cvar("cl_stripcolorcodes"); @@ -511,11 +511,11 @@ void CSQC_UpdateView(float w, float h) R_SetView(VF_DRAWCROSSHAIR, 0); //Make sure engine crosshairs are always hidden // Draw the Engine Status Bar (the default Quake HUD) - R_SetView(VF_DRAWENGINESBAR, 0); + R_SetView(VF_DRAWENGINEHUD, 0); // fetch this one only once per frame - sbar_showbinds = cvar("sbar_showbinds"); - sbar_showbinds_limit = cvar("sbar_showbinds_limit"); + hud_showbinds = cvar("hud_showbinds"); + hud_showbinds_limit = cvar("hud_showbinds_limit"); // Update the mouse position /* @@ -561,7 +561,7 @@ void CSQC_UpdateView(float w, float h) self.draw2d(); self = e; - // draw sbar + // draw hud if(cvar("r_letterbox") == 0) { HUD_DrawCenterPrint(); // draw centerprint messages even if viewsize >= 120 } diff --git a/qcsrc/client/csqc_constants.qc b/qcsrc/client/csqc_constants.qc index a3511b149..2b2e674c6 100644 --- a/qcsrc/client/csqc_constants.qc +++ b/qcsrc/client/csqc_constants.qc @@ -32,7 +32,7 @@ const float VF_ANGLES_X = 16; //(float) const float VF_ANGLES_Y = 17; //(float) const float VF_ANGLES_Z = 18; //(float) const float VF_DRAWWORLD = 19; //(float) -const float VF_DRAWENGINESBAR = 20; //(float) +const float VF_DRAWENGINEHUD = 20; //(float) const float VF_DRAWCROSSHAIR = 21; //(float) const float VF_PERSPECTIVE = 200; //(float) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 3b8b7169c..4a118d4b7 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -631,7 +631,7 @@ float HUD_Panel_GetBgActive(float id) vector HUD_Panel_GetProgressBarColor(string item) { - return stov(cvar_string(strcat("hud_progressbar_", item, "_color"))); + return stov(cvar_string(strcat("hud_progreshud_", item, "_color"))); } float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright @@ -1401,7 +1401,7 @@ void HUD_HealthArmor(void) if (x > 0) { - drawpic(pos, "gfx/hud/statusbar", eX * 0.5 * mySize_x * min(1, x/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL); + drawpic(pos, "gfx/hud/statuhud", eX * 0.5 * mySize_x * min(1, x/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL); if (x > 45) drawpic(pos, "gfx/hud/sb_armor", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); else @@ -1411,7 +1411,7 @@ void HUD_HealthArmor(void) // health x = health; - drawpic(pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, x/200), "gfx/hud/statusbar", eX * 0.5 * mySize_x * min(1, x/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL); + drawpic(pos + eX * mySize_x - eX * 0.5 * mySize_x * min(1, x/200), "gfx/hud/statuhud", eX * 0.5 * mySize_x * min(1, x/200) + eY * mySize_y, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL); drawpic(pos + eX * mySize_x - eX * mySize_y, "gfx/hud/sb_health", '1 1 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * 2.5 * mySize_y + eY * 0.25 * mySize_y, x, 3, 0.5 * mySize_y, hud_alpha_fg); } @@ -1423,7 +1423,7 @@ void HUD_HealthArmor(void) if (x > 0) { - drawpic(pos + eY * mySize_y - eY * mySize_y * min(1, x/200), "gfx/hud/statusbar", eX * 0.5 * mySize_x + eY * mySize_y * min(1, x/200), HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL); + drawpic(pos + eY * mySize_y - eY * mySize_y * min(1, x/200), "gfx/hud/statuhud", eX * 0.5 * mySize_x + eY * mySize_y * min(1, x/200), HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL); if (x > 45) drawpic(pos + eX * 0.4 * mySize_y, "gfx/hud/sb_armor", '0.7 0.7 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); else @@ -1435,7 +1435,7 @@ void HUD_HealthArmor(void) x = health; numbers = strlen(ftos(x)); - drawpic(pos + eX * 0.5 * mySize_x + eY * mySize_y - eY * mySize_y * min(1, x/200), "gfx/hud/statusbar", eX * 0.5 * mySize_x + eY * mySize_y * min(1, x/200), HUD_Panel_GetProgressBarColor("health"), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL); + drawpic(pos + eX * 0.5 * mySize_x + eY * mySize_y - eY * mySize_y * min(1, x/200), "gfx/hud/statuhud", eX * 0.5 * mySize_x + eY * mySize_y * min(1, x/200), HUD_Panel_GetProgressBarColor("health"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL); drawpic(pos + eX * mySize_x - eX * 1.1 * mySize_y, "gfx/hud/sb_health", '0.7 0.7 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * numbers * 0.5 * mySize_y + eY * 0.55 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg); } @@ -1447,7 +1447,7 @@ void HUD_HealthArmor(void) if (x > 0) { - drawpic(pos, "gfx/hud/statusbar", eX * mySize_x * min(1, x/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL); + drawpic(pos, "gfx/hud/statuhud", eX * mySize_x * min(1, x/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL); if (x > 45) drawpic(pos, "gfx/hud/sb_armor", '0.5 0.5 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); else @@ -1459,7 +1459,7 @@ void HUD_HealthArmor(void) x = health; numbers = strlen(ftos(x)); - drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/statusbar", eX * mySize_x * min(1, x/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progressbar_alpha"), DRAWFLAG_NORMAL); + drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/statuhud", eX * mySize_x * min(1, x/200) + eY * 0.5 * mySize_y, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progreshud_alpha"), DRAWFLAG_NORMAL); drawpic(pos + eY * 0.5 * mySize_y, "gfx/hud/sb_health", '0.5 0.5 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); HUD_DrawXNum_Colored(pos + eX * 0.5 * mySize_y + eY * 0.5 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg); } @@ -1553,7 +1553,7 @@ void HUD_RaceTimer (void) { if(HUD_Panel_GetBgActive(8)) draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER)); - drawfont = sbar_bigfont; + drawfont = hud_bigfont; float a, t; string s, forcetime; @@ -1657,7 +1657,7 @@ void HUD_RaceTimer (void) { } } - drawfont = sbar_font; + drawfont = hud_font; } // Notification area (#4) @@ -1678,17 +1678,17 @@ void HUD_Notify (void) entity tm; if(spectatee_status && !intermission) { - drawfont = sbar_bigfont; + drawfont = hud_bigfont; if(spectatee_status == -1) s = "^1Observing"; else s = GetPlayerName(spectatee_status - 1); // spectated player name between HUD and chat area, aligned to the left pos_x = 0; - pos_y = - 50 - sbar_fontsize_spec_y; - s = textShortenToWidth(s, vid_conwidth/2.5, sbar_fontsize_spec, stringwidth_colors); - drawcolorcodedstring(pos, s, sbar_fontsize_spec, hud_alpha_fg, DRAWFLAG_NORMAL); - drawfont = sbar_font; + pos_y = - 50 - hud_fontsize_spec_y; + s = textShortenToWidth(s, vid_conwidth/2.5, hud_fontsize_spec, stringwidth_colors); + drawcolorcodedstring(pos, s, hud_fontsize_spec, hud_alpha_fg, DRAWFLAG_NORMAL); + drawfont = hud_font; // spectator text in the upper right corner if(spectatee_status == -1) @@ -2289,7 +2289,7 @@ void CSQC_race_hud(void) if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD return; // no records in the actual race - drawfont = sbar_bigfont; + drawfont = hud_bigfont; vector pos; pos_x = 2; pos_y = vid_conheight - 48; @@ -2339,7 +2339,7 @@ void CSQC_race_hud(void) drawstring_expanding(pos, "Server best ", '10 10 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f); drawstring_expanding(pos + '0 10 0', TIME_ENCODED_TOSTRING(t),'14 14 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL, f); } - drawfont = sbar_font; + drawfont = hud_font; } // Timer (#5) @@ -2434,7 +2434,7 @@ void HUD_Radar(void) if(HUD_Panel_GetBgActive(6)) draw_BorderPicture(pos - '1 1 0' * marigin, "gfx/hud/border", mySize + '1 1 0' * 2 * marigin, color, hud_alpha_bg, '1 1 0' * (marigin/MARIGIN_MULTIPLIER)); - local float color1, color2; // color already declared as a global in sbar.qc + local float color1, color2; // color already declared as a global in hud.qc local vector rgb; local entity tm; float scale2d, normalsize, bigsize; @@ -2649,7 +2649,7 @@ void HUD_ShowSpeed(void) numsize_x = numsize_y = cvar("cl_showspeed_size"); pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position"); - drawfont = sbar_bigfont; + drawfont = hud_bigfont; drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); if (cvar("cl_showspeed_z") == 1) { @@ -2657,7 +2657,7 @@ void HUD_ShowSpeed(void) drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); } - drawfont = sbar_font; + drawfont = hud_font; } vector acc_prevspeed; @@ -2700,9 +2700,9 @@ void HUD_ShowAcceleration(void) } if (acceleration > 0) - drawpic(pos, "gfx/hud/statusbar", acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, "gfx/hud/statuhud", acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL); else if (acceleration < 0) - drawpic(pos + acceleration * scale * '40 0 0', "gfx/hud/statusbar", -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos + acceleration * scale * '40 0 0', "gfx/hud/statuhud", -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_alpha_fg, DRAWFLAG_NORMAL); } void HUD_Reset (void) @@ -2721,8 +2721,8 @@ void HUD_Main (void) hud_accuracy_border_thickness = bound(0, cvar_or("hud_accuracy_border_thickness", 1), 5); hud_color_bg_team = cvar("hud_color_bg_team"); - sbar_fontsize = HUD_GetFontsize("sbar_fontsize"); - sbar_fontsize_spec = HUD_GetFontsize("sbar_fontsize_spec"); + hud_fontsize = HUD_GetFontsize("hud_fontsize"); + hud_fontsize_spec = HUD_GetFontsize("hud_fontsize_spec"); if(HUD_Panel_CheckActive(0)) HUD_WeaponIcons(); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 83da2d2c8..edb0ce194 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -63,7 +63,7 @@ const float COLOR_SPECTATOR = 1337; // -------------------------------------------------------------------------- // Scoreboard stuff -#define MAX_SBAR_FIELDS 16 +#define MAX_HUD_FIELDS 16 #define SP_END -1 @@ -76,13 +76,13 @@ const float COLOR_SPECTATOR = 1337; #define SP_SEPARATOR -100 -float sbar_field[MAX_SBAR_FIELDS + 1]; -float sbar_size[MAX_SBAR_FIELDS + 1]; -string sbar_title[MAX_SBAR_FIELDS + 1]; -float sbar_num_fields; +float hud_field[MAX_HUD_FIELDS + 1]; +float hud_size[MAX_HUD_FIELDS + 1]; +string hud_title[MAX_HUD_FIELDS + 1]; +float hud_num_fields; -float sbar_font; -float sbar_bigfont; +float hud_font; +float hud_bigfont; string scores_label[MAX_SCORE]; float scores_flags[MAX_SCORE]; @@ -95,8 +95,8 @@ float teamscores_flags[MAX_SCORE]; #define IS_DECREASING(x) ( !((x)&SFL_LOWER_IS_BETTER) ) -vector sbar_fontsize; -vector sbar_fontsize_spec; +vector hud_fontsize; +vector hud_fontsize_spec; float RANKINGS_RECEIVED_CNT; string grecordholder[RANKINGS_CNT]; @@ -126,8 +126,8 @@ float ignore_minus_zoom; float warmup_stage; string getcommandkey(string text, string command); -float sbar_showbinds; -float sbar_showbinds_limit; +float hud_showbinds; +float hud_showbinds_limit; string vote_called_vote; float ready_waiting; diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index e7d318fb6..b4fb97603 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -51,22 +51,22 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin string label; float text_size; - isize -= sbar_fontsize_y; // respect the text when calculating the image size + isize -= hud_fontsize_y; // respect the text when calculating the image size rgb = MapVote_RGB(id); img_size_y = isize; img_size_x = isize / 0.75; // 4:3 x can be stretched easily, height is defined in isize - drawfont = sbar_font; + drawfont = hud_font; pos_y = pos_y + img_size_y; - label = MapVote_FormatMapItem(id, map, count, tsize, sbar_fontsize); + label = MapVote_FormatMapItem(id, map, count, tsize, hud_fontsize); - text_size = stringwidth(label, false, sbar_fontsize); + text_size = stringwidth(label, false, hud_fontsize); pos_x -= text_size*0.5; - drawstring(pos, label, sbar_fontsize, rgb, 1, DRAWFLAG_NORMAL); + drawstring(pos, label, hud_fontsize, rgb, 1, DRAWFLAG_NORMAL); pos_x = pos_x + text_size*0.5 - img_size_x*0.5; pos_y = pos_y - img_size_y; @@ -104,15 +104,15 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa rgb = MapVote_RGB(id); - drawfont = sbar_font; - pos_y = pos_y + sbar_fontsize_y; + drawfont = hud_font; + pos_y = pos_y + hud_fontsize_y; - label = MapVote_FormatMapItem(id, "Don't care", count, tsize, sbar_fontsize); + label = MapVote_FormatMapItem(id, "Don't care", count, tsize, hud_fontsize); - text_size = stringwidth(label, false, sbar_fontsize); + text_size = stringwidth(label, false, hud_fontsize); pos_x -= text_size*0.5; - drawstring(pos, label, sbar_fontsize, rgb, 1, DRAWFLAG_NORMAL); + drawstring(pos, label, hud_fontsize, rgb, 1, DRAWFLAG_NORMAL); } vector MapVote_GridVec(vector gridspec, float i, float m) @@ -183,8 +183,8 @@ void MapVote_Draw() if(i >= 0 || ymax < (vid_conheight*0.5)) ymax = vid_conheight - ymin; - drawfont = sbar_bigfont; - sbar_fontsize = HUD_GetFontsize("sbar_fontsize"); + drawfont = hud_bigfont; + hud_fontsize = HUD_GetFontsize("hud_fontsize"); pos_y = ymin; pos_z = 0; @@ -201,7 +201,7 @@ void MapVote_Draw() pos_y += 22; pos_x = xmin; - drawfont = sbar_font; + drawfont = hud_font; // base for multi-column stuff... ymin = pos_y; @@ -244,7 +244,7 @@ void MapVote_Draw() if(mv_abstain && i < mv_num_maps) { tmp = mv_votes[i]; - pos_y = ymax + isize - sbar_fontsize_y; + pos_y = ymax + isize - hud_fontsize_y; pos_x = (xmax+xmin)*0.5; MapVote_DrawAbstain(pos, isize, xmax - xmin, tmp, i); } diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index e97b3fd75..73419b901 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -304,8 +304,8 @@ entity GetTeam(float Team, float add) void CSQC_CheckEngine() { - sbar_font = FONT_USER+1; - sbar_bigfont = FONT_USER+2; + hud_font = FONT_USER+1; + hud_bigfont = FONT_USER+2; } vector HUD_GetFontsize(string cvarname) @@ -323,7 +323,7 @@ vector HUD_GetFontsize(string cvarname) float HUD_GetWidth(float teamcolumnwidth) { float f; - f = cvar("sbar_width"); + f = cvar("hud_width"); if(f == 0) f = 640; if(f < 320) diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index cf35a23ba..81d67b037 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -21,7 +21,7 @@ void HUD_FinaleOverlay() //drawpic(pos, "gfx/finale", '0 0 0', '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - //drawstring(pos, "END", sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL); + //drawstring(pos, "END", hud_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL); MapVote_Draw(); } @@ -195,11 +195,11 @@ void HUD_UpdateTeamPos(entity Team) void Cmd_HUD_Help(float argc) { - print("You can modify the scoreboard using the ^2sbar_columns_set command.\n"); + print("You can modify the scoreboard using the ^2hud_columns_set command.\n"); print("^3|---------------------------------------------------------------|\n"); print("Usage:\n"); - print("^2sbar_columns_set default\n"); - print("^2sbar_columns_set ^7filed1 field2 ...\n"); + print("^2hud_columns_set default\n"); + print("^2hud_columns_set ^7filed1 field2 ...\n"); print("The following field names are recognized (case insensitive):\n"); print("You can use a ^3|^7 to start the right-aligned fields.\n\n"); @@ -237,7 +237,7 @@ void Cmd_HUD_Help(float argc) print("The special game type names 'teams' and 'noteams' can be used to\n"); print("include/exclude ALL teams/noteams game modes.\n\n"); - print("Example: sbar_columns_set name ping pl | +ctf/field3 -dm/field4\n"); + print("Example: hud_columns_set name ping pl | +ctf/field3 -dm/field4\n"); print("will display name, ping and pl aligned to the left, and the fields\n"); print("right of the vertical bar aligned to the right.\n"); print("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"); @@ -266,7 +266,7 @@ void Cmd_HUD_SetFields(float argc) // TODO: re enable with gametype dependant cvars? if(argc < 2) // no arguments provided - argc = tokenizebyseparator(strcat("x ", cvar_string("sbar_columns")), " "); + argc = tokenizebyseparator(strcat("x ", cvar_string("hud_columns")), " "); if(argc < 2) argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " "); @@ -294,9 +294,9 @@ void Cmd_HUD_SetFields(float argc) } - sbar_num_fields = 0; + hud_num_fields = 0; - drawfont = sbar_font; + drawfont = hud_font; for(i = 0; i < argc - 1; ++i) { @@ -320,22 +320,22 @@ void Cmd_HUD_SetFields(float argc) continue; } - strunzone(sbar_title[sbar_num_fields]); - sbar_title[sbar_num_fields] = strzone(str); - sbar_size[sbar_num_fields] = stringwidth(str, FALSE, sbar_fontsize); + strunzone(hud_title[hud_num_fields]); + hud_title[hud_num_fields] = strzone(str); + hud_size[hud_num_fields] = stringwidth(str, FALSE, hud_fontsize); str = strtolower(str); if(str == "ping") { - sbar_field[sbar_num_fields] = SP_PING; + hud_field[hud_num_fields] = SP_PING; } else if(str == "pl") { - sbar_field[sbar_num_fields] = SP_PL; + hud_field[hud_num_fields] = SP_PL; } else if(str == "kd" || str == "kdr" || str == "kdratio" || str == "k/d") { - sbar_field[sbar_num_fields] = SP_KDRATIO; + hud_field[hud_num_fields] = SP_KDRATIO; } else if(str == "name" || str == "nick") { - sbar_field[sbar_num_fields] = SP_NAME; + hud_field[hud_num_fields] = SP_NAME; have_name = 1; } else if(str == "|") { - sbar_field[sbar_num_fields] = SP_SEPARATOR; + hud_field[hud_num_fields] = SP_SEPARATOR; have_separator = 1; } else { for(j = 0; j < MAX_SCORE; ++j) @@ -353,14 +353,14 @@ void Cmd_HUD_SetFields(float argc) continue; } :found - sbar_field[sbar_num_fields] = j; + hud_field[hud_num_fields] = j; if(j == ps_primary) have_primary = 1; if(j == ps_secondary) have_secondary = 1; } - ++sbar_num_fields; - if(sbar_num_fields >= MAX_SBAR_FIELDS) + ++hud_num_fields; + if(hud_num_fields >= MAX_HUD_FIELDS) break; } @@ -372,95 +372,95 @@ void Cmd_HUD_SetFields(float argc) have_secondary = 1; missing = (!have_primary) + (!have_secondary) + (!have_separator) + (!have_name); - if(sbar_num_fields+missing < MAX_SBAR_FIELDS) + if(hud_num_fields+missing < MAX_HUD_FIELDS) { if(!have_name) { - strunzone(sbar_title[sbar_num_fields]); - for(i = sbar_num_fields; i > 0; --i) + strunzone(hud_title[hud_num_fields]); + for(i = hud_num_fields; i > 0; --i) { - sbar_title[i] = sbar_title[i-1]; - sbar_size[i] = sbar_size[i-1]; - sbar_field[i] = sbar_field[i-1]; + hud_title[i] = hud_title[i-1]; + hud_size[i] = hud_size[i-1]; + hud_field[i] = hud_field[i-1]; } - sbar_title[0] = strzone("name"); - sbar_field[0] = SP_NAME; - ++sbar_num_fields; + hud_title[0] = strzone("name"); + hud_field[0] = SP_NAME; + ++hud_num_fields; print("fixed missing field 'name'\n"); if(!have_separator) { - strunzone(sbar_title[sbar_num_fields]); - for(i = sbar_num_fields; i > 1; --i) + strunzone(hud_title[hud_num_fields]); + for(i = hud_num_fields; i > 1; --i) { - sbar_title[i] = sbar_title[i-1]; - sbar_size[i] = sbar_size[i-1]; - sbar_field[i] = sbar_field[i-1]; + hud_title[i] = hud_title[i-1]; + hud_size[i] = hud_size[i-1]; + hud_field[i] = hud_field[i-1]; } - sbar_title[1] = strzone("|"); - sbar_field[1] = SP_SEPARATOR; - sbar_size[1] = stringwidth("|", FALSE, sbar_fontsize); - ++sbar_num_fields; + hud_title[1] = strzone("|"); + hud_field[1] = SP_SEPARATOR; + hud_size[1] = stringwidth("|", FALSE, hud_fontsize); + ++hud_num_fields; print("fixed missing field '|'\n"); } } else if(!have_separator) { - strunzone(sbar_title[sbar_num_fields]); - sbar_title[sbar_num_fields] = strzone("|"); - sbar_size[sbar_num_fields] = stringwidth("|", FALSE, sbar_fontsize); - sbar_field[sbar_num_fields] = SP_SEPARATOR; - ++sbar_num_fields; + strunzone(hud_title[hud_num_fields]); + hud_title[hud_num_fields] = strzone("|"); + hud_size[hud_num_fields] = stringwidth("|", FALSE, hud_fontsize); + hud_field[hud_num_fields] = SP_SEPARATOR; + ++hud_num_fields; print("fixed missing field '|'\n"); } if(!have_secondary) { - strunzone(sbar_title[sbar_num_fields]); - sbar_title[sbar_num_fields] = strzone(scores_label[ps_secondary]); - sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE, sbar_fontsize); - sbar_field[sbar_num_fields] = ps_secondary; - ++sbar_num_fields; + strunzone(hud_title[hud_num_fields]); + hud_title[hud_num_fields] = strzone(scores_label[ps_secondary]); + hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize); + hud_field[hud_num_fields] = ps_secondary; + ++hud_num_fields; print("fixed missing field '", scores_label[ps_secondary], "'\n"); } if(!have_primary) { - strunzone(sbar_title[sbar_num_fields]); - sbar_title[sbar_num_fields] = strzone(scores_label[ps_primary]); - sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE, sbar_fontsize); - sbar_field[sbar_num_fields] = ps_primary; - ++sbar_num_fields; + strunzone(hud_title[hud_num_fields]); + hud_title[hud_num_fields] = strzone(scores_label[ps_primary]); + hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize); + hud_field[hud_num_fields] = ps_primary; + ++hud_num_fields; print("fixed missing field '", scores_label[ps_primary], "'\n"); } } - sbar_field[sbar_num_fields] = SP_END; + hud_field[hud_num_fields] = SP_END; } // MOVEUP:: -vector sbar_field_rgb; -string sbar_field_icon0; -string sbar_field_icon1; -string sbar_field_icon2; -vector sbar_field_icon0_rgb; -vector sbar_field_icon1_rgb; -vector sbar_field_icon2_rgb; -float sbar_field_icon0_alpha; -float sbar_field_icon1_alpha; -float sbar_field_icon2_alpha; +vector hud_field_rgb; +string hud_field_icon0; +string hud_field_icon1; +string hud_field_icon2; +vector hud_field_icon0_rgb; +vector hud_field_icon1_rgb; +vector hud_field_icon2_rgb; +float hud_field_icon0_alpha; +float hud_field_icon1_alpha; +float hud_field_icon2_alpha; string HUD_GetField(entity pl, float field) { float tmp, num, denom, f; string str; - sbar_field_rgb = '1 1 1'; - sbar_field_icon0 = ""; - sbar_field_icon1 = ""; - sbar_field_icon2 = ""; - sbar_field_icon0_rgb = '1 1 1'; - sbar_field_icon1_rgb = '1 1 1'; - sbar_field_icon2_rgb = '1 1 1'; - sbar_field_icon0_alpha = 1; - sbar_field_icon1_alpha = 1; - sbar_field_icon2_alpha = 1; + hud_field_rgb = '1 1 1'; + hud_field_icon0 = ""; + hud_field_icon1 = ""; + hud_field_icon2 = ""; + hud_field_icon0_rgb = '1 1 1'; + hud_field_icon1_rgb = '1 1 1'; + hud_field_icon2_rgb = '1 1 1'; + hud_field_icon0_alpha = 1; + hud_field_icon1_alpha = 1; + hud_field_icon2_alpha = 1; switch(field) { case SP_PING: @@ -471,7 +471,7 @@ string HUD_GetField(entity pl, float field) if(f == 0) return "N/A"; tmp = max(0, min(220, f-80)) / 220; - sbar_field_rgb = '1 1 1' - '0 1 1'*tmp; + hud_field_rgb = '1 1 1' - '0 1 1'*tmp; return ftos(f); case SP_PL: @@ -485,23 +485,23 @@ string HUD_GetField(entity pl, float field) if(tmp != 0) str = strcat(str, "~", ftos(ceil(tmp * 100))); tmp = bound(0, f / 0.2 + tmp / 0.04, 1); // 20% is REALLY BAD pl - sbar_field_rgb = '1 0.5 0.5' - '0 0.5 0.5'*tmp; + hud_field_rgb = '1 0.5 0.5' - '0 0.5 0.5'*tmp; return str; case SP_NAME: if(ready_waiting && pl.ready) { - sbar_field_icon0 = "gfx/sb_player_ready"; + hud_field_icon0 = "gfx/sb_player_ready"; } else if(!teamplay) { f = stof(getplayerkey(pl.sv_entnum, "colors")); { - sbar_field_icon0 = "gfx/sb_playercolor_base"; - sbar_field_icon1 = "gfx/sb_playercolor_shirt"; - sbar_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0); - sbar_field_icon2 = "gfx/sb_playercolor_pants"; - sbar_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1); + hud_field_icon0 = "gfx/sb_playercolor_base"; + hud_field_icon1 = "gfx/sb_playercolor_shirt"; + hud_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0); + hud_field_icon2 = "gfx/sb_playercolor_pants"; + hud_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1); } } return GetPlayerName(pl.sv_entnum); @@ -516,10 +516,10 @@ string HUD_GetField(entity pl, float field) denom = pl.(scores[SP_DEATHS]); if(denom == 0) { - sbar_field_rgb = '0 1 0'; + hud_field_rgb = '0 1 0'; str = ftos(num); } else if(num <= 0) { - sbar_field_rgb = '1 0 0'; + hud_field_rgb = '1 0 0'; str = ftos(num/denom); } else str = ftos(num/denom); @@ -533,82 +533,82 @@ string HUD_GetField(entity pl, float field) tmp = pl.(scores[field]); f = scores_flags[field]; if(field == ps_primary) - sbar_field_rgb = '1 1 0'; + hud_field_rgb = '1 1 0'; else if(field == ps_secondary) - sbar_field_rgb = '0 1 1'; + hud_field_rgb = '0 1 1'; else - sbar_field_rgb = '1 1 1'; + hud_field_rgb = '1 1 1'; return ScoreString(f, tmp); } //return "error"; } float xmin, xmax, ymin, ymax, sbwidth; -float sbar_fixscoreboardcolumnwidth_len; -float sbar_fixscoreboardcolumnwidth_iconlen; -float sbar_fixscoreboardcolumnwidth_marginlen; +float hud_fixscoreboardcolumnwidth_len; +float hud_fixscoreboardcolumnwidth_iconlen; +float hud_fixscoreboardcolumnwidth_marginlen; string HUD_FixScoreboardColumnWidth(float i, string str) { float field, f; vector sz; - field = sbar_field[i]; + field = hud_field[i]; - sbar_fixscoreboardcolumnwidth_iconlen = 0; + hud_fixscoreboardcolumnwidth_iconlen = 0; - if(sbar_field_icon0 != "") + if(hud_field_icon0 != "") { - sz = drawgetimagesize(sbar_field_icon0); + sz = drawgetimagesize(hud_field_icon0); f = sz_x / sz_y; - if(sbar_fixscoreboardcolumnwidth_iconlen < f) - sbar_fixscoreboardcolumnwidth_iconlen = f; + if(hud_fixscoreboardcolumnwidth_iconlen < f) + hud_fixscoreboardcolumnwidth_iconlen = f; } - if(sbar_field_icon1 != "") + if(hud_field_icon1 != "") { - sz = drawgetimagesize(sbar_field_icon1); + sz = drawgetimagesize(hud_field_icon1); f = sz_x / sz_y; - if(sbar_fixscoreboardcolumnwidth_iconlen < f) - sbar_fixscoreboardcolumnwidth_iconlen = f; + if(hud_fixscoreboardcolumnwidth_iconlen < f) + hud_fixscoreboardcolumnwidth_iconlen = f; } - if(sbar_field_icon2 != "") + if(hud_field_icon2 != "") { - sz = drawgetimagesize(sbar_field_icon2); + sz = drawgetimagesize(hud_field_icon2); f = sz_x / sz_y; - if(sbar_fixscoreboardcolumnwidth_iconlen < f) - sbar_fixscoreboardcolumnwidth_iconlen = f; + if(hud_fixscoreboardcolumnwidth_iconlen < f) + hud_fixscoreboardcolumnwidth_iconlen = f; } - sbar_fixscoreboardcolumnwidth_iconlen *= sbar_fontsize_y / sbar_fontsize_x; // fix icon aspect + hud_fixscoreboardcolumnwidth_iconlen *= hud_fontsize_y / hud_fontsize_x; // fix icon aspect - if(sbar_fixscoreboardcolumnwidth_iconlen != 0) - sbar_fixscoreboardcolumnwidth_marginlen = stringwidth(" ", FALSE, sbar_fontsize); + if(hud_fixscoreboardcolumnwidth_iconlen != 0) + hud_fixscoreboardcolumnwidth_marginlen = stringwidth(" ", FALSE, hud_fontsize); else - sbar_fixscoreboardcolumnwidth_marginlen = 0; + hud_fixscoreboardcolumnwidth_marginlen = 0; if(field == SP_NAME) // name gets all remaining space { float namesize, j; - namesize = sbwidth;// / sbar_fontsize_x; - for(j = 0; j < sbar_num_fields; ++j) + namesize = sbwidth;// / hud_fontsize_x; + for(j = 0; j < hud_num_fields; ++j) if(j != i) - if (sbar_field[i] != SP_SEPARATOR) - namesize -= sbar_size[j] + 1; + if (hud_field[i] != SP_SEPARATOR) + namesize -= hud_size[j] + 1; namesize += 1; - sbar_size[i] = namesize; + hud_size[i] = namesize; - if (sbar_fixscoreboardcolumnwidth_iconlen != 0) - namesize -= sbar_fixscoreboardcolumnwidth_marginlen + sbar_fixscoreboardcolumnwidth_iconlen; - str = textShortenToWidth(str, namesize, sbar_fontsize, stringwidth_colors); - sbar_fixscoreboardcolumnwidth_len = stringwidth(str, TRUE, sbar_fontsize); + if (hud_fixscoreboardcolumnwidth_iconlen != 0) + namesize -= hud_fixscoreboardcolumnwidth_marginlen + hud_fixscoreboardcolumnwidth_iconlen; + str = textShortenToWidth(str, namesize, hud_fontsize, stringwidth_colors); + hud_fixscoreboardcolumnwidth_len = stringwidth(str, TRUE, hud_fontsize); } else - sbar_fixscoreboardcolumnwidth_len = stringwidth(str, FALSE, sbar_fontsize); + hud_fixscoreboardcolumnwidth_len = stringwidth(str, FALSE, hud_fontsize); - f = sbar_fixscoreboardcolumnwidth_len + sbar_fixscoreboardcolumnwidth_marginlen + sbar_fixscoreboardcolumnwidth_iconlen; - if(sbar_size[i] < f) - sbar_size[i] = f; + f = hud_fixscoreboardcolumnwidth_len + hud_fixscoreboardcolumnwidth_marginlen + hud_fixscoreboardcolumnwidth_iconlen; + if(hud_size[i] < f) + hud_size[i] = f; return str; } @@ -623,13 +623,13 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR); if((rgb == '1 1 1') && (!is_spec)) { - rgb_x = cvar("sbar_color_bg_r") + 0.5; - rgb_y = cvar("sbar_color_bg_g") + 0.5; - rgb_z = cvar("sbar_color_bg_b") + 0.5; } + rgb_x = cvar("hud_color_bg_r") + 0.5; + rgb_y = cvar("hud_color_bg_g") + 0.5; + rgb_z = cvar("hud_color_bg_b") + 0.5; } // Layout: tmp_x = sbwidth; - tmp_y = sbar_fontsize_y * 1.25; + tmp_y = hud_fontsize_y * 1.25; tmp_z = 0; // alternated rows highlighting @@ -640,64 +640,64 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb tmp_y = 0; - for(i = 0; i < sbar_num_fields; ++i) + for(i = 0; i < hud_num_fields; ++i) { - field = sbar_field[i]; + field = hud_field[i]; if(field == SP_SEPARATOR) break; if(is_spec && field != SP_NAME && field != SP_PING) { - pos_x += sbar_size[i] + sbar_fontsize_x; + pos_x += hud_size[i] + hud_fontsize_x; continue; } str = HUD_GetField(pl, field); str = HUD_FixScoreboardColumnWidth(i, str); - pos_x += sbar_size[i] + sbar_fontsize_x; + pos_x += hud_size[i] + hud_fontsize_x; if(field == SP_NAME) { - tmp_x = sbar_size[i] - sbar_fontsize_x*sbar_fixscoreboardcolumnwidth_iconlen - sbar_fixscoreboardcolumnwidth_marginlen + sbar_fontsize_x; + tmp_x = hud_size[i] - hud_fontsize_x*hud_fixscoreboardcolumnwidth_iconlen - hud_fixscoreboardcolumnwidth_marginlen + hud_fontsize_x; if (is_self) - drawcolorcodedstring(pos - tmp, str, sbar_fontsize, sb_alpha_name_self, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawcolorcodedstring(pos - tmp, str, sbar_fontsize, sb_alpha_name, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name, DRAWFLAG_NORMAL); } else { - tmp_x = sbar_fixscoreboardcolumnwidth_len + sbar_fontsize_x; + tmp_x = hud_fixscoreboardcolumnwidth_len + hud_fontsize_x; if (is_self) - drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, sb_alpha_name_self, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, sb_alpha_name, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name, DRAWFLAG_NORMAL); } - tmp_x = sbar_size[i] + sbar_fontsize_x; - if(sbar_field_icon0 != "") + tmp_x = hud_size[i] + hud_fontsize_x; + if(hud_field_icon0 != "") if (is_self) - drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha * sb_alpha_name, DRAWFLAG_NORMAL); - if(sbar_field_icon1 != "") + drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name, DRAWFLAG_NORMAL); + if(hud_field_icon1 != "") if (is_self) - drawpic(pos - tmp, sbar_field_icon1, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon1_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, sbar_field_icon1, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon1_alpha * sb_alpha_name, DRAWFLAG_NORMAL); - if(sbar_field_icon2 != "") + drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name, DRAWFLAG_NORMAL); + if(hud_field_icon2 != "") if (is_self) - drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha * sb_alpha_name, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name, DRAWFLAG_NORMAL); } - if(sbar_field[i] == SP_SEPARATOR) + if(hud_field[i] == SP_SEPARATOR) { pos_x = xmax; - for(i = sbar_num_fields-1; i > 0; --i) + for(i = hud_num_fields-1; i > 0; --i) { - field = sbar_field[i]; + field = hud_field[i]; if(field == SP_SEPARATOR) break; if(is_spec && field != SP_NAME && field != SP_PING) { - pos_x -= sbar_size[i] + sbar_fontsize_x; + pos_x -= hud_size[i] + hud_fontsize_x; continue; } @@ -705,36 +705,36 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb str = HUD_FixScoreboardColumnWidth(i, str); if(field == SP_NAME) { - tmp_x = sbar_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right... + tmp_x = hud_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right... if(is_self) - drawcolorcodedstring(pos - tmp, str, sbar_fontsize, sb_alpha_name_self, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawcolorcodedstring(pos - tmp, str, sbar_fontsize, sb_alpha_name, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos - tmp, str, hud_fontsize, sb_alpha_name, DRAWFLAG_NORMAL); } else { - tmp_x = sbar_fixscoreboardcolumnwidth_len; + tmp_x = hud_fixscoreboardcolumnwidth_len; if(is_self) - drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, sb_alpha_name_self, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, sb_alpha_name, DRAWFLAG_NORMAL); + drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, sb_alpha_name, DRAWFLAG_NORMAL); } - tmp_x = sbar_size[i]; - if(sbar_field_icon0 != "") + tmp_x = hud_size[i]; + if(hud_field_icon0 != "") if (is_self) - drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha * sb_alpha_name, DRAWFLAG_NORMAL); - if(sbar_field_icon1 != "") + drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * sb_alpha_name, DRAWFLAG_NORMAL); + if(hud_field_icon1 != "") if (is_self) - drawpic(pos - tmp, sbar_field_icon1, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon1_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, sbar_field_icon1, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon1_alpha * sb_alpha_name, DRAWFLAG_NORMAL); - if(sbar_field_icon2 != "") + drawpic(pos - tmp, hud_field_icon1, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon1_alpha * sb_alpha_name, DRAWFLAG_NORMAL); + if(hud_field_icon2 != "") if (is_self) - drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); + drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name_self, DRAWFLAG_NORMAL); else - drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha * sb_alpha_name, DRAWFLAG_NORMAL); - pos_x -= sbar_size[i] + sbar_fontsize_x; + drawpic(pos - tmp, hud_field_icon2, '0 1 0' * hud_fontsize_y + '1 0 0' * hud_fontsize_x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon2_rgb, hud_field_icon2_alpha * sb_alpha_name, DRAWFLAG_NORMAL); + pos_x -= hud_size[i] + hud_fontsize_x; } } } @@ -751,12 +751,12 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz vector tmp, column_dim; entity pl; - body_table_height = 1.25 * sbar_fontsize_y * max(1, tm.team_size); // no player? show 1 empty line + body_table_height = 1.25 * hud_fontsize_y * max(1, tm.team_size); // no player? show 1 empty line pos -= '1 1 0'; tmp_x = sbwidth + 2; - tmp_y = 1.25 * sbar_fontsize_y; + tmp_y = 1.25 * hud_fontsize_y; // rounded header drawpic(pos, "gfx/hud/sb_scoreboard_tableheader", tmp, (rgb * hud_color_bg_team) + '0.5 0.5 0.5', sb_alpha_bg, DRAWFLAG_NORMAL); @@ -767,7 +767,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', sb_alpha_bg, DRAWFLAG_NORMAL); // more transparency for the scoreboard // separator header/table - pos_y += 1.25 * sbar_fontsize_y; + pos_y += 1.25 * hud_fontsize_y; tmp_y = hud_border_thickness; drawfill(pos, tmp, '0 0 0', sb_alpha_bg, DRAWFLAG_NORMAL); @@ -781,64 +781,64 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz //drawfill(pos, tmp + '2 0 0', rgb, 0.1, DRAWFLAG_NORMAL); // go back to the top to make alternated columns highlighting and to print the strings - pos_y -= 1.25 * sbar_fontsize_y; + pos_y -= 1.25 * hud_fontsize_y; pos_y -= hud_border_thickness; pos += '1 1 0'; if (sb_highlight) { - column_dim_y = 1.25 * sbar_fontsize_y; // header + column_dim_y = 1.25 * hud_fontsize_y; // header column_dim_y += hud_border_thickness; column_dim_y += body_table_height; } // print the strings of the columns headers and draw the columns - for(i = 0; i < sbar_num_fields; ++i) + for(i = 0; i < hud_num_fields; ++i) { - if(sbar_field[i] == SP_SEPARATOR) + if(hud_field[i] == SP_SEPARATOR) break; - column_dim_x = sbar_size[i] + sbar_fontsize_x; + column_dim_x = hud_size[i] + hud_fontsize_x; if (sb_highlight) { if (mod(i,2)) - drawfill(pos - '0 1 0' - sbar_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL); + drawfill(pos - '0 1 0' - hud_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL); } - drawstring(pos, sbar_title[i], sbar_fontsize, rgb * 1.5, sb_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos, hud_title[i], hud_fontsize, rgb * 1.5, sb_alpha_fg, DRAWFLAG_NORMAL); pos_x += column_dim_x; } - if(sbar_field[i] == SP_SEPARATOR) + if(hud_field[i] == SP_SEPARATOR) { pos_x = xmax; tmp_y = 0; - for(i = sbar_num_fields-1; i > 0; --i) + for(i = hud_num_fields-1; i > 0; --i) { - if(sbar_field[i] == SP_SEPARATOR) + if(hud_field[i] == SP_SEPARATOR) break; - pos_x -= sbar_size[i]; + pos_x -= hud_size[i]; if (sb_highlight) { if (!mod(i,2)) { - if (i == sbar_num_fields-1) - column_dim_x = sbar_size[i] + sbar_fontsize_x / 2 + 1; + if (i == hud_num_fields-1) + column_dim_x = hud_size[i] + hud_fontsize_x / 2 + 1; else - column_dim_x = sbar_size[i] + sbar_fontsize_x; - drawfill(pos - '0 1 0' - sbar_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL); + column_dim_x = hud_size[i] + hud_fontsize_x; + drawfill(pos - '0 1 0' - hud_fontsize_x / 2 * '1 0 0', column_dim, '0 0 0', sb_alpha_bg * 0.2, DRAWFLAG_NORMAL); } } - tmp_x = stringwidth(sbar_title[i], FALSE, sbar_fontsize); - tmp_x = (sbar_size[i] - tmp_x) * sbar_fontsize_x; - drawstring(pos + tmp, sbar_title[i], sbar_fontsize, rgb * 1.5, sb_alpha_fg, DRAWFLAG_NORMAL); - pos_x -= sbar_fontsize_x; + tmp_x = stringwidth(hud_title[i], FALSE, hud_fontsize); + tmp_x = (hud_size[i] - tmp_x) * hud_fontsize_x; + drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, sb_alpha_fg, DRAWFLAG_NORMAL); + pos_x -= hud_fontsize_x; } } pos_x = xmin; - pos_y += 1.25 * sbar_fontsize_y; // skip the header + pos_y += 1.25 * hud_fontsize_y; // skip the header pos_y += hud_border_thickness; // fill the table and draw the rows @@ -849,7 +849,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz if(pl.team != tm.team) continue; HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1), i); - pos_y += 1.25 * sbar_fontsize_y; + pos_y += 1.25 * hud_fontsize_y; ++i; } else @@ -858,13 +858,13 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz if(pl.team == COLOR_SPECTATOR) continue; HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1), i); - pos_y += 1.25 * sbar_fontsize_y; + pos_y += 1.25 * hud_fontsize_y; ++i; } if (i == 0) - pos_y += 1.25 * sbar_fontsize_y; // move to the end of the table - pos_y += 1.25 * sbar_fontsize_y; // move empty row (out of the table) + pos_y += 1.25 * hud_fontsize_y; // move to the end of the table + pos_y += 1.25 * hud_fontsize_y; // move empty row (out of the table) return pos; } @@ -892,7 +892,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) float fontsize = 40 * 1/3; float weapon_cnt = 12; float rows; - if(cvar("sbar_accuracy_doublerows")) + if(cvar("hud_accuracy_doublerows")) rows = 2; else rows = 1; @@ -903,7 +903,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) return pos; } - drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), sbar_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos, strcat("Accuracy stats (average ", ftos(average_accuracy), "%)"), hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); pos_y += 18; vector tmp; tmp_x = sbwidth; @@ -925,7 +925,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) drawfill(pos + '0 1 0' * height * (2/3) + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', sb_highlight_alpha, DRAWFLAG_NORMAL); } - drawfont = sbar_bigfont; + drawfont = hud_bigfont; average_accuracy = 0; float weapons_with_stats; weapons_with_stats = 0; @@ -975,7 +975,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) pos_y += height; } } - drawfont = sbar_font; + drawfont = hud_font; if(weapons_with_stats) average_accuracy = floor(average_accuracy / weapons_with_stats); @@ -1001,16 +1001,16 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_ float is_spec; is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR); vector hl_rgb; - hl_rgb_x = cvar("sbar_color_bg_r") + 0.5; - hl_rgb_y = cvar("sbar_color_bg_g") + 0.5; - hl_rgb_z = cvar("sbar_color_bg_b") + 0.5; + hl_rgb_x = cvar("hud_color_bg_r") + 0.5; + hl_rgb_y = cvar("hud_color_bg_g") + 0.5; + hl_rgb_z = cvar("hud_color_bg_b") + 0.5; - pos_y += sbar_fontsize_y; - drawstring(pos, strcat("Rankings"), sbar_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); - pos_y += sbar_fontsize_y; + pos_y += hud_fontsize_y; + drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); + pos_y += hud_fontsize_y; vector tmp; tmp_x = sbwidth; - tmp_y = sbar_fontsize_y * RANKINGS_RECEIVED_CNT; + tmp_y = hud_fontsize_y * RANKINGS_RECEIVED_CNT; drawpic_tiled(pos, "gfx/hud/sb_scoreboard_bg", bg_size, tmp, rgb * hud_color_bg_team, sb_alpha_bg, DRAWFLAG_NORMAL); drawborderlines(hud_border_thickness, pos, tmp, '0 0 0', sb_alpha_bg * 0.75, DRAWFLAG_NORMAL); @@ -1026,41 +1026,41 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_ n = grecordholder[i]; p = race_PlaceName(i+1); if(grecordholder[i] == GetPlayerName(player_localentnum - 1)) - drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * sbar_fontsize_y, hl_rgb, sb_highlight_alpha_self, DRAWFLAG_NORMAL); + drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, sb_highlight_alpha_self, DRAWFLAG_NORMAL); else if(!mod(i, 2) && sb_highlight) - drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * sbar_fontsize_y, hl_rgb, sb_highlight_alpha, DRAWFLAG_NORMAL); - drawstring(pos, p, sbar_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); - drawstring(pos + '3 0 0' * sbar_fontsize_x, TIME_ENCODED_TOSTRING(t), sbar_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + '8 0 0' * sbar_fontsize_x, n, sbar_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); - pos += '0 1 0' * sbar_fontsize_y; + drawfill(pos, '1 0 0' * sbwidth + '0 1 0' * hud_fontsize_y, hl_rgb, sb_highlight_alpha, DRAWFLAG_NORMAL); + drawstring(pos, p, hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); + drawstring(pos + '3 0 0' * hud_fontsize_x, TIME_ENCODED_TOSTRING(t), hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + '8 0 0' * hud_fontsize_x, n, hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); + pos += '0 1 0' * hud_fontsize_y; } return pos; } float sb_fade_alpha; -float sbar_woulddrawscoreboard_prev; -float sbar_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed +float hud_woulddrawscoreboard_prev; +float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed void HUD_DrawScoreboard() { - float sbar_woulddrawscoreboard; - sbar_woulddrawscoreboard = HUD_WouldDrawScoreboard(); - if(sbar_woulddrawscoreboard != sbar_woulddrawscoreboard_prev) { - sbar_woulddrawscoreboard_change = time; - sbar_woulddrawscoreboard_prev = sbar_woulddrawscoreboard; + float hud_woulddrawscoreboard; + hud_woulddrawscoreboard = HUD_WouldDrawScoreboard(); + if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) { + hud_woulddrawscoreboard_change = time; + hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard; } float scoreboard_fadeinspeed = cvar_or("sb_fadeinspeed", 10); float scoreboard_fadeoutspeed = cvar_or("sb_fadeoutspeed", 5); - if(sbar_woulddrawscoreboard) { + if(hud_woulddrawscoreboard) { if (scoreboard_fadeinspeed) - sb_fade_alpha = bound (0, (time - sbar_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1); + sb_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1); else sb_fade_alpha = 1; } else if (scoreboard_fadeoutspeed) - sb_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - sbar_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1); + sb_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1); else sb_fade_alpha = 0; @@ -1078,7 +1078,7 @@ void HUD_DrawScoreboard() vector rgb, pos, tmp; entity pl, tm; - sbwidth = HUD_GetWidth(6.5 * sbar_fontsize_y); + sbwidth = HUD_GetWidth(6.5 * hud_fontsize_y); xmin = 0.5 * (vid_conwidth - sbwidth); ymin = SCOREBOARD_OFFSET; @@ -1092,13 +1092,13 @@ void HUD_DrawScoreboard() pos_z = 0; // Heading - drawfont = sbar_bigfont; + drawfont = hud_bigfont; drawstringcenter('0 1 0' * ymin, "Scoreboard", '24 24 0', '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); pos_y += 24 + 4; - pos_y += sbar_fontsize_y; + pos_y += hud_fontsize_y; - drawfont = sbar_font; + drawfont = hud_font; // Draw the scoreboard vector bg_size; @@ -1112,19 +1112,19 @@ void HUD_DrawScoreboard() continue; rgb = GetTeamRGB(tm.team); - HUD_DrawXNum(pos - '9.5 0 0' * sbar_fontsize_y + '0 1 0' * sbar_fontsize_y, tm.(teamscores[ts_primary]), 6, 0, sbar_fontsize_y * 1.5, rgb, 0, 1, sb_alpha_fg, DRAWFLAG_NORMAL); + HUD_DrawXNum(pos - '9.5 0 0' * hud_fontsize_y + '0 1 0' * hud_fontsize_y, tm.(teamscores[ts_primary]), 6, 0, hud_fontsize_y * 1.5, rgb, 0, 1, sb_alpha_fg, DRAWFLAG_NORMAL); if(ts_primary != ts_secondary) - HUD_DrawXNum(pos - '7.5 0 0' * sbar_fontsize_y + '0 2.5 0' * sbar_fontsize_y, tm.(teamscores[ts_secondary]), 6, 0, sbar_fontsize_y * 1, rgb, 0, 1, sb_alpha_fg, DRAWFLAG_NORMAL); + HUD_DrawXNum(pos - '7.5 0 0' * hud_fontsize_y + '0 2.5 0' * hud_fontsize_y, tm.(teamscores[ts_secondary]), 6, 0, hud_fontsize_y * 1, rgb, 0, 1, sb_alpha_fg, DRAWFLAG_NORMAL); pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size); } } else { - rgb_x = cvar("sbar_color_bg_r"); - rgb_y = cvar("sbar_color_bg_g"); - rgb_z = cvar("sbar_color_bg_b"); + rgb_x = cvar("hud_color_bg_r"); + rgb_y = cvar("hud_color_bg_g"); + rgb_z = cvar("hud_color_bg_b"); for(tm = teams.sort_next; tm; tm = tm.sort_next) { @@ -1137,24 +1137,24 @@ void HUD_DrawScoreboard() if(gametype == GAME_CTS || gametype == GAME_RACE) { if(race_speedaward) { - drawcolorcodedstring(pos, strcat("Speed award: ", ftos(race_speedaward), " (", race_speedaward_holder, ")"), sbar_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); - pos_y += 1.25 * sbar_fontsize_y; + drawcolorcodedstring(pos, strcat("Speed award: ", ftos(race_speedaward), " (", race_speedaward_holder, ")"), hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); + pos_y += 1.25 * hud_fontsize_y; } if(race_speedaward_alltimebest) { - drawcolorcodedstring(pos, strcat("All-time fastest: ", ftos(race_speedaward_alltimebest), " (", race_speedaward_alltimebest_holder, ")"), sbar_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); - pos_y += 1.25 * sbar_fontsize_y; + drawcolorcodedstring(pos, strcat("All-time fastest: ", ftos(race_speedaward_alltimebest), " (", race_speedaward_alltimebest_holder, ")"), hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); + pos_y += 1.25 * hud_fontsize_y; } pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size); } - else if(cvar("sbar_accuracy") && spectatee_status != -1) { + else if(cvar("hud_accuracy") && spectatee_status != -1) { if(teamplay) pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size); else pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size); } - tmp = pos + '0 1.5 0' * sbar_fontsize_y; - pos_y += 3 * sbar_fontsize_y; + tmp = pos + '0 1.5 0' * hud_fontsize_y; + pos_y += 3 * hud_fontsize_y; // List spectators float specs; @@ -1164,12 +1164,12 @@ void HUD_DrawScoreboard() if(pl.team != COLOR_SPECTATOR) continue; HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1), specs); - pos_y += 1.25 * sbar_fontsize_y; + pos_y += 1.25 * hud_fontsize_y; ++specs; } if(specs) - drawstring(tmp, "Spectators", sbar_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); + drawstring(tmp, "Spectators", hud_fontsize, '1 1 1', sb_alpha_fg, DRAWFLAG_NORMAL); // Print info string string str; @@ -1240,26 +1240,26 @@ void HUD_DrawScoreboard() } - pos_y += 1.2 * sbar_fontsize_y; - drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); + pos_y += 1.2 * hud_fontsize_y; + drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, sb_alpha_fg, DRAWFLAG_NORMAL); - scoreboard_bottom = pos_y + 2 * sbar_fontsize_y; + scoreboard_bottom = pos_y + 2 * hud_fontsize_y; } void HUD_DrawAccuracyStats_Description_Hitscan(vector position) { - drawstring(position + '0 3 0' * sbar_fontsize_y, "Shots fired:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - drawstring(position + '0 5 0' * sbar_fontsize_y, "Shots hit:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - drawstring(position + '0 9 0' * sbar_fontsize_y, "Shots missed:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 3 0' * hud_fontsize_y, "Shots fired:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 5 0' * hud_fontsize_y, "Shots hit:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 9 0' * hud_fontsize_y, "Shots missed:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); } void HUD_DrawAccuracyStats_Description_Splash(vector position) { - drawstring(position + '0 3 0' * sbar_fontsize_y, "Maximum damage:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - drawstring(position + '0 5 0' * sbar_fontsize_y, "Actual damage:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - drawstring(position + '0 9 0' * sbar_fontsize_y, "Damage wasted:", sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 3 0' * hud_fontsize_y, "Maximum damage:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 5 0' * hud_fontsize_y, "Actual damage:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 7 0' * hud_fontsize_y, "Accuracy:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstring(position + '0 9 0' * hud_fontsize_y, "Damage wasted:", hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); } void HUD_DrawAccuracyStats() @@ -1274,24 +1274,24 @@ void HUD_DrawAccuracyStats() float col_margin = 20; // pixels between the columns float row_margin = 20; // pixels between the rows - fill_size_x = 5 * sbar_fontsize_x; // width of the background - fill_size_y = 10 * sbar_fontsize_y; // height of the background + fill_size_x = 5 * hud_fontsize_x; // width of the background + fill_size_y = 10 * hud_fontsize_y; // height of the background - drawfont = sbar_bigfont; + drawfont = hud_bigfont; pos_x = 0; pos_y = SCOREBOARD_OFFSET; pos_z = 0; - drawstringcenter(pos, "Weapon Accuracy", 2 * sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringcenter(pos, "Weapon Accuracy", 2 * hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); - left_border = col_margin + 11 * sbar_fontsize_x; + left_border = col_margin + 11 * hud_fontsize_x; - drawfont = sbar_font; + drawfont = hud_font; if(warmup_stage) { pos_y += 40; if(mod(time, 1) >= 0.4) - drawstringcenter(pos, "Stats are not tracked during warmup stage", sbar_fontsize, '1 1 0', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringcenter(pos, "Stats are not tracked during warmup stage", hud_fontsize, '1 1 0', hud_alpha_fg, DRAWFLAG_NORMAL); return; } @@ -1300,7 +1300,7 @@ void HUD_DrawAccuracyStats() { pos_y += 40; if(mod(time, 1) >= 0.4) - drawstringcenter(pos, "Stats are not tracked in Race/CTS", sbar_fontsize, '1 1 0', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringcenter(pos, "Stats are not tracked in Race/CTS", hud_fontsize, '1 1 0', hud_alpha_fg, DRAWFLAG_NORMAL); return; } @@ -1359,16 +1359,16 @@ void HUD_DrawAccuracyStats() drawpic(pos, strcat("gfx/hud/inv_weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the amount of shots fired or max damage - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 3 0' * sbar_fontsize_y, ftos(weapon_damage), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the amount of hits or actual damage - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 5 0' * sbar_fontsize_y, ftos(weapon_hit), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the accuracy - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 7 0' * sbar_fontsize_y, strcat(ftos(weapon_stats),"%"), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the amount of shots missed or damage wasted - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 9 0' * sbar_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); ++count_splash; } else if (self.spawnflags & WEP_TYPE_HITSCAN) { @@ -1409,16 +1409,16 @@ void HUD_DrawAccuracyStats() drawpic(pos, strcat("gfx/hud/inv_weapon", self.netname), '1 0.5 0' * fill_size_x , '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the amount of shots fired or max damage - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 3 0' * sbar_fontsize_y, ftos(weapon_damage), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 3 0' * hud_fontsize_y, ftos(weapon_damage), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the amount of hits or actual damage - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 5 0' * sbar_fontsize_y, ftos(weapon_hit), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 5 0' * hud_fontsize_y, ftos(weapon_hit), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the accuracy - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 7 0' * sbar_fontsize_y, strcat(ftos(weapon_stats),"%"), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 7 0' * hud_fontsize_y, strcat(ftos(weapon_stats),"%"), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); // the amount of shots missed or damage wasted - drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 9 0' * sbar_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), sbar_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); + drawstringright(pos + '4.5 0 0' * hud_fontsize_x + '0 9 0' * hud_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), hud_fontsize, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL); ++count_hitscan; }