From: Mario Date: Sat, 10 Feb 2018 02:47:01 +0000 (+1000) Subject: Draw the text instead of the image path X-Git-Tag: xonotic-v0.8.5~2328^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9bce1b76574731019d36203e7704870957c4273b;p=xonotic%2Fxonotic-data.pk3dir.git Draw the text instead of the image path --- diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 1cb06abed..325bc05c9 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -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(); diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh index 95b8890cc..c9e19ccad 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh @@ -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); diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 850dd0ceb..d3ee5cb65 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -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,