]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Draw the text instead of the image path
authorMario <mario@smbclan.net>
Sat, 10 Feb 2018 02:47:01 +0000 (12:47 +1000)
committerMario <mario@smbclan.net>
Sat, 10 Feb 2018 02:47:01 +0000 (12:47 +1000)
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
qcsrc/common/turrets/cl_turrets.qc

index 1cb06abedf3c2d857c5570cebc2c4a0471618344..325bc05c9e1ec855637c43ff7dcf0077566f3d3e 100644 (file)
@@ -384,7 +384,7 @@ vector drawspritearrow(vector o, float ang, vector rgb, float a, float t)
 }
 
 // returns location of sprite healthbar
-vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str)
+vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str, string pic)
 {
     float algnx, algny;
     float sw, w, h;
@@ -437,7 +437,7 @@ vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth,
     if (is_text)
         drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL);
     else
-        drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL);
+        drawpic(o, pic, sz, rgb, a, DRAWFLAG_NORMAL);
 
     o.x += 0.5 * sw;
     o.y += 0.5 * h;
@@ -721,7 +721,7 @@ void Draw_WaypointSprite(entity this)
             marg = SPRITE_HEALTHBAR_MARGIN * t + 0.5 * sz.y;
 
         float minwidth = (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t;
-        o = drawsprite_TextOrIcon(is_text, o, ang, minwidth, iconcolor, a, sz, pic);
+        o = drawsprite_TextOrIcon(is_text, o, ang, minwidth, iconcolor, a, sz, txt, pic);
         drawhealthbar(
                 o,
                 0,
@@ -742,7 +742,7 @@ void Draw_WaypointSprite(entity this)
     }
     else
     {
-        drawsprite_TextOrIcon(is_text, o, ang, 0, iconcolor, a, sz, pic);
+        drawsprite_TextOrIcon(is_text, o, ang, 0, iconcolor, a, sz, txt, pic);
     }
 
     draw_endBoldFont();
index 95b8890ccce07b10765c5dae8218d9d265b223bc..c9e19ccade5e9850df3786e87de4c859a6eba215 100644 (file)
@@ -101,7 +101,7 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl
 vector drawspritearrow(vector o, float ang, vector rgb, float a, float t);
 
 // returns location of sprite healthbar
-vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str);
+vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str, string pic);
 
 float spritelookupblinkvalue(entity this, string s);
 vector spritelookupcolor(entity this, string s, vector def);
index 850dd0ceb124835b050d0e2dd0cf303b79ab4985..d3ee5cb652c58a9f4f48f3bfb88d6a62ac3559c1 100644 (file)
@@ -180,7 +180,7 @@ void turret_draw2d(entity this)
        }
 
        o = drawspritearrow(o, M_PI, rgb, a, SPRITE_ARROW_SCALE * t);
-       o = drawsprite_TextOrIcon(true, o, M_PI, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt);
+       o = drawsprite_TextOrIcon(true, o, M_PI, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt, "");
        drawhealthbar(
                        o,
                        0,