]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
Merge remote branch 'origin/master' into samual/verbose_warnings
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 30a925a4f8d815560f4ba87127ea6ed14e1d5244..6a5536bcda95e0035ef23dbdb72d4c50d59b2512 100644 (file)
@@ -89,11 +89,12 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the
 
 vector HUD_Get_Num_Color (float x, float maxvalue)
 {
+       float blinkingamt;
        vector color;
-       if(x > maxvalue) {
-               color_x = 0;
+       if(x >= maxvalue) {
+               color_x = sin(2*M_PI*time);
                color_y = 1;
-               color_z = 0;
+               color_z = sin(2*M_PI*time);
        }
        else if(x > maxvalue * 0.75) {
                color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0
@@ -120,6 +121,14 @@ vector HUD_Get_Num_Color (float x, float maxvalue)
                color_y = 0;
                color_z = 0;
        }
+
+       blinkingamt = (1 - x/maxvalue/0.25);
+       if(blinkingamt > 0)
+       {
+               color_x = color_x - color_x * blinkingamt * sin(2*M_PI*time);
+               color_y = color_y - color_y * blinkingamt * sin(2*M_PI*time);
+               color_z = color_z - color_z * blinkingamt * sin(2*M_PI*time);
+       }
        return color;
 }
 
@@ -508,6 +517,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_progressbar");
                                        HUD_Write_PanelCvar_q("_progressbar_strength");
                                        HUD_Write_PanelCvar_q("_progressbar_shield");
+                                       HUD_Write_PanelCvar_q("_text");
                                        break;
                                case HUD_PANEL_HEALTHARMOR:
                                        HUD_Write_PanelCvar_q("_flip");
@@ -520,6 +530,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        break;
                                case HUD_PANEL_NOTIFY:
                                        HUD_Write_PanelCvar_q("_flip");
+                                       HUD_Write_PanelCvar_q("_fontsize");
                                        HUD_Write_PanelCvar_q("_print");
                                        break;
                                case HUD_PANEL_RADAR:
@@ -1619,7 +1630,7 @@ void HUD_Weapons(void)
        }
 
        // TODO make this configurable
-       if(weaponorder_bypriority != autocvar_cl_weaponpriority)
+       if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
        {
                if(weaponorder_bypriority)
                        strunzone(weaponorder_bypriority);
@@ -2888,7 +2899,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
                                print (sprintf(_("%s^7 is a ^1BERSERKER!\n"), s1));
                } else if(type == KILL_SPREE_25) {
                        if(gentle)
-                               print (sprintf(_("%s^7 made ^1TWENTY FIFE SCORES IN A ROW!\n"), s1));
+                               print (sprintf(_("%s^7 made ^1TWENTY FIVE SCORES IN A ROW!\n"), s1));
                        else
                                print (sprintf(_("%s^7 inflicts ^1CARNAGE!\n"), s1));
                } else if(type == KILL_SPREE_30) {
@@ -3001,7 +3012,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
                        print(sprintf(_("%s^7 returned the %s\n"), s1, s2));
                } else if(type == INFO_CAPTUREFLAG) {
                        HUD_KillNotify_Push(s1, s2, 0, INFO_CAPTUREFLAG);
-                       print(sprintf(_("%1^7 captured the %s%s\n"), s1, s2, s3));
+                       print(sprintf(_("%s^7 captured the %s%s\n"), s1, s2, s3));
                }
        } else if(msg == MSG_RACE) {
                if(type == RACE_SERVER_RECORD) {
@@ -3981,9 +3992,9 @@ void HUD_VoteWindow(void)
        drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize_y, s, eX * mySize_x + eY * (1.75/8) * mySize_y, a, DRAWFLAG_NORMAL);
 
        // print the yes/no counts
-    s = sprintf(_("Yes (%s): %d"), getcommandkey("vyes", "vyes"), ftos(vote_yescount));
+    s = sprintf(_("Yes (%s): %d"), getcommandkey("vyes", "vyes"), vote_yescount);
        drawstring_aspect(pos + eY * (4/8) * mySize_y, s, eX * 0.5 * mySize_x + eY * (1.5/8) * mySize_y, '0 1 0', a, DRAWFLAG_NORMAL);
-    s = sprintf(_("No (%s): %d"), getcommandkey("vno", "vno"), ftos(vote_nocount));
+    s = sprintf(_("No (%s): %d"), getcommandkey("vno", "vno"), vote_nocount);
        drawstring_aspect(pos + eX * 0.5 * mySize_x + eY * (4/8) * mySize_y, s, eX * 0.5 * mySize_x + eY * (1.5/8) * mySize_y, '1 0 0', a, DRAWFLAG_NORMAL);
 
        // draw the progress bar backgrounds
@@ -4958,7 +4969,7 @@ void HUD_InfoMessages(void)
                }
                else if(warmup_stage && !intermission && !spectatee_status)
                {
-                       s = strcat("^2Press ^3%s^2 to end warmup", getcommandkey("ready", "ready"));
+                       s = sprintf(_("^2Press ^3%s^2 to end warmup"), getcommandkey("ready", "ready"));
                        drawInfoMessage(s)
                }
 
@@ -5097,9 +5108,9 @@ void HUD_ShowAcceleration(void)
        }
 
        if (acceleration > 0)
-        HUD_Panel_DrawProgressBar(pos, eX * (vid_conwidth - pos_x) + eY * sz, "statusbar", 0, 0, acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+        HUD_Panel_DrawProgressBar(pos, eX * (vid_conwidth - pos_x) + eY * sz, "accelbar", 0, 0, acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
        else
-        HUD_Panel_DrawProgressBar(eY * pos_y, eX * pos_x + eY * sz, "statusbar", 0, 1, -acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+        HUD_Panel_DrawProgressBar(eY * pos_y, eX * pos_x + eY * sz, "accelbar", 0, 1, -acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
 void HUD_Reset (void)