]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
use already existing, proved to work functions instead of creating own ones and watch...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 4e8e3440e0d11a08294dea9509592c43dbf4ed34..96d5a3362bf2607fdb886e7d8cf54ad032f0f731 100644 (file)
@@ -467,6 +467,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                                case HUD_PANEL_WEAPONICONS:
                                        fputs(fh, strcat("seta hud_", panel_name, "_complainbubble \"", cvar_string(strcat("hud_", panel_name, "_complainbubble")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_padding \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_padding")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_color_outofammo \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_color_outofammo")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_color_donthave \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_color_donthave")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_color_unavailable \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_color_unavailable")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_ammo_color \"", cvar_string(strcat("hud_", panel_name, "_ammo_color")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_ammo_alpha \"", cvar_string(strcat("hud_", panel_name, "_ammo_alpha")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_aspect \"", cvar_string(strcat("hud_", panel_name, "_ammo_alpha")), "\"", "\n"));
@@ -1236,7 +1239,7 @@ void HUD_Panel_Mouse()
        if(highlightedPanel != -1)
                highlightedPanel_prev = highlightedPanel;
 
-       mousepos = mousepos + getmousepos();
+       mousepos = mousepos + getmousepos() * cvar("menu_mouse_speed");
 
        mousepos_x = bound(0, mousepos_x, vid_conwidth);
        mousepos_y = bound(0, mousepos_y, vid_conheight);
@@ -1582,18 +1585,18 @@ void HUD_WeaponIcons(void)
                        string s;
                        if(complain_weapon_type == 0) {
                                s = "Out of ammo";
-                               color = '1 0 0';
+                               color = autocvar_hud_weaponicons_complainbubble_color_outofammo;
                        }
                        else if(complain_weapon_type == 1) {
                                s = "Don't have";
-                               color = '1 1 0';
+                               color = autocvar_hud_weaponicons_complainbubble_color_donthave;
                        }
                        else {
                                s = "Unavailable";
-                               color = '1 1 1';
+                               color = autocvar_hud_weaponicons_complainbubble_color_unavailable;
                        }
-                       drawpic_aspect_skin(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows) + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, "weapon_complainbubble", eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows) - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows) + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, s, eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows) - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(wpnpos + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, "weapon_complainbubble", wpnsize - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(wpnpos + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, s, wpnsize - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
 
                ++row;
@@ -2182,10 +2185,10 @@ void HUD_HealthArmor(void)
                        {
                                if(autocvar_hud_healtharmor_baralign == 1 || autocvar_hud_healtharmor_baralign == 3) { // right align
                                        barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/200);
-                                       barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                                       barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
                                } else { // left align
                                        barpos = pos;
-                                       barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
+                                       barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
                                }
 
                                HUD_Panel_GetProgressBarColor(leftname)
@@ -3224,15 +3227,13 @@ void HUD_Score(void)
                                pl = world;
 
                score = me.(scores[ps_primary]);
-               timer = seconds_tostring(score/TIME_FACTOR);
-               timer = strcat(timer, ":", ftos_decimals(mod(score, TIME_FACTOR), log(TIME_FACTOR)));
+               timer = TIME_ENCODED_TOSTRING(score);
 
                if (pl && ((!(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)) || score)) {
                        // distribution display
                        distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
 
-                       distrtimer = seconds_tostring(distribution/TIME_FACTOR);
-                       distrtimer = strcat(timer, ":", ftos_decimals(mod(distribution, TIME_FACTOR), log(TIME_FACTOR)));
+                       distrtimer = ftos(distribution/pow(10, TIME_DECIMALS));
 
                        if (distribution <= 0) {
                                distribution_color = '0 1 0';
@@ -4661,10 +4662,13 @@ void HUD_Main (void)
 
        float f;
        vector color;
-       if(teamplay && autocvar_hud_dock_color_team) {
+       if((teamplay) && autocvar_hud_dock_color_team) {
                f = stof(getplayerkey(player_localentnum - 1, "colors"));
                color = colormapPaletteColor(mod(f, 16), 1) * autocvar_hud_dock_color_team;
        }
+       else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && autocvar_hud_dock_color_team) {
+               color = '1 0 0' * autocvar_hud_dock_color_team;
+       }
        else if(autocvar_hud_dock_color == "shirt") {
                f = stof(getplayerkey(player_localentnum - 1, "colors"));
                color = colormapPaletteColor(floor(f / 16), 0);