]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'remotes/origin/terencehill/newpanelhud-dom_points' into terenceh...
authorterencehill <piuntn@gmail.com>
Wed, 3 Nov 2010 19:20:56 +0000 (20:20 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 3 Nov 2010 19:20:56 +0000 (20:20 +0100)
qcsrc/client/hud.qc

index f7ff56060b00bdccdd40908737ab9933e0a23258..a210070b701bcd1f55b8e7114ffafef05757007d 100644 (file)
@@ -4377,7 +4377,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
        drawfont = hud_font;
 }
 
-void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float i)
+void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float layout, float i)
 {
        float stat, pps_ratio;
        string pic;
@@ -4419,16 +4419,14 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float i)
                mySize_y = i;
        }
 
-       if (cvar("hud_panel_modicons_dom_layout")) // show text too
+       if (layout) // show text too
        {
                //draw the text
-               drawfont = hud_bigfont;
                color *= 0.5 + pps_ratio * (1 - 0.5); // half saturated color at min, full saturated at max
-               if (cvar("hud_panel_modicons_dom_layout") == 2) // average pps
+               if (layout == 2) // average pps
                        drawstring_aspect(myPos + eX * mySize_y, ftos_decimals(stat, 2), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
                else // percentage of average pps
                        drawstring_aspect(myPos + eX * mySize_y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawfont = hud_font;
        }
 
        //draw the icon
@@ -4450,9 +4448,10 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
                if(tm.team != COLOR_SPECTATOR)
                        ++teams_count;
 
+       float layout = cvar("hud_panel_modicons_dom_layout");
        float rows, columns, aspect_ratio;
        rows = mySize_y/mySize_x;
-       aspect_ratio = (cvar("hud_panel_modicons_dom_layout")) ? 3 : 1;
+       aspect_ratio = (layout) ? 3 : 1;
        rows = bound(1, floor((sqrt((4 * aspect_ratio * teams_count + rows) * rows) + rows + 0.5) / 2), teams_count);
        columns = ceil(teams_count/rows);
 
@@ -4465,7 +4464,7 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
                pos = myPos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows);
                size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
 
-               DrawDomItem(pos, size, aspect_ratio, i);
+               DrawDomItem(pos, size, aspect_ratio, layout, i);
 
                ++row;
                if(row >= rows)