X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fwaypointsprites.qc;h=aa5ec5fae0aed7a8c0dada8264ab6a305a1ff207;hb=5d0e03ed840a2aa0a5fabb161a781d985a4bc502;hp=4efe6259a97172c917cfade7ee1cc372a02241dc;hpb=9eb82dd6fc682e3ddecd471835f9047816236342;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index 4efe6259a..aa5ec5fae 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -8,7 +8,7 @@ #include "../common/constants.qh" #include "../common/teams.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/interpolate.qh" @@ -54,7 +54,7 @@ void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, f R_EndPolygon(); } -void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float height, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f) +void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float theheight, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f) { vector o, ri, up; float owidth; // outer width @@ -72,13 +72,13 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl up = rotate(up, rot); owidth = width + 2 * border; - o = o - up * (margin + border + height) + ri * (sz.x - owidth) * 0.5; + o = o - up * (margin + border + theheight) + ri * (sz.x - owidth) * 0.5; drawquad(o - up * border, ri * owidth, up * border, "", rgb, a, f); - drawquad(o + up * height, ri * owidth, up * border, "", rgb, a, f); - drawquad(o, ri * border, up * height, "", rgb, a, f); - drawquad(o + ri * (owidth - border), ri * border, up * height, "", rgb, a, f); - drawquad(o + ri * (border + align * ((1 - h) * width)), ri * width * h, up * height, "", hrgb, ha, f); + drawquad(o + up * theheight, ri * owidth, up * border, "", rgb, a, f); + drawquad(o, ri * border, up * theheight, "", rgb, a, f); + drawquad(o + ri * (owidth - border), ri * border, up * theheight, "", rgb, a, f); + drawquad(o + ri * (border + align * ((1 - h) * width)), ri * width * h, up * theheight, "", hrgb, ha, f); } // returns location of sprite text @@ -166,25 +166,21 @@ vector drawspritetext(vector o, float ang, float minwidth, vector rgb, float a, float spritelookupblinkvalue(string s) { + if(substring(s, 0, 4) == "wpn-") + if(get_weaponinfo(stof(substring(s, 4, strlen(s)))).spawnflags & WEP_FLAG_SUPERWEAPON) + return 2; + + FOREACH(ITEMS, it.m_waypoint == s, LAMBDA( + return it.m_waypointblink; + )); + switch(s) { - case "ons-cp-atck-neut": return 2; - case "ons-cp-atck-red": return 2; - case "ons-cp-atck-blue": return 2; - case "ons-cp-dfnd-red": return 0.5; - case "ons-cp-dfnd-blue": return 0.5; - case "item_health_mega": return 2; - case "item_armor_large": return 2; + case "ons-cp-atck": return 2; + case "ons-cp-dfnd": return 0.5; case "item-invis": return 2; case "item-extralife": return 2; case "item-speed": return 2; - case "item-strength": return 2; - case "item-shield": return 2; - case "item-fuelregen": return 2; - case "item-jetpack": return 2; - case "wpn-fireball": return 2; // superweapon - case "wpn-minstanex": return 2; // superweapon - case "wpn-porto": return 2; // superweapon case "tagged-target": return 2; default: return 1; } @@ -203,7 +199,15 @@ vector spritelookupcolor(string s, vector def) string spritelookuptext(string s) { if(substring(s, 0, 4) == "wpn-") { return (get_weaponinfo(stof(substring(s, 4, strlen(s)))).message); } - if(substring(s, 0, 5) == "buff-") { return Buff_PrettyName(Buff_Type_FromSprite(s)); } + if (substring(s, 0, 5) == "buff-") + { + entity buff = BUFF_NULL; + FOREACH(BUFFS, it.m_sprite == s, LAMBDA( + buff = it; + break; + )); + return buff.m_prettyName; + } switch(s) { @@ -225,18 +229,15 @@ string spritelookuptext(string s) case "keycarrier-red": return _("Key carrier"); case "keycarrier-yellow": return _("Key carrier"); case "redbase": return _("Red base"); + case "yellowbase": return _("Yellow base"); + case "neutralbase": return _("White base"); + case "pinkbase": return _("Pink base"); case "waypoint": return _("Waypoint"); - case "ons-gen-red": return _("Generator"); - case "ons-gen-blue": return _("Generator"); + case "ons-gen": return _("Generator"); case "ons-gen-shielded": return _("Generator"); - case "ons-cp-neut": return _("Control point"); - case "ons-cp-red": return _("Control point"); - case "ons-cp-blue": return _("Control point"); - case "ons-cp-atck-neut": return _("Control point"); - case "ons-cp-atck-red": return _("Control point"); - case "ons-cp-atck-blue": return _("Control point"); - case "ons-cp-dfnd-red": return _("Control point"); - case "ons-cp-dfnd-blue": return _("Control point"); + case "ons-cp": return _("Control point"); + case "ons-cp-atck": return _("Control point"); + case "ons-cp-dfnd": return _("Control point"); case "race-checkpoint": return _("Checkpoint"); case "race-finish": return _("Finish"); case "race-start": return _("Start"); @@ -250,18 +251,13 @@ string spritelookuptext(string s) case "dom-blue": return _("Control point"); case "dom-yellow": return _("Control point"); case "dom-pink": return _("Control point"); - case "item_health_mega": return _("Mega health"); - case "item_armor_large": return _("Large armor"); case "item-invis": return _("Invisibility"); case "item-extralife": return _("Extra life"); case "item-speed": return _("Speed"); - case "item-strength": return _("Strength"); - case "item-shield": return _("Shield"); - case "item-fuelregen": return _("Fuel regen"); - case "item-jetpack": return _("Jet Pack"); case "frozen": return _("Frozen!"); case "tagged-target": return _("Tagged"); case "vehicle": return _("Vehicle"); + case "intruder": return _("Intruder!"); default: return s; } } @@ -414,7 +410,7 @@ void Draw_WaypointSprite() { if(self.helpme && time < self.helpme) a *= SPRITE_HELPME_BLINK; - else + else if(!self.lifetime) // fading out waypoints don't blink a *= spritelookupblinkvalue(spriteimage); } @@ -424,7 +420,7 @@ void Draw_WaypointSprite() a = 1; } - if(a <= 0) + if(a <= 0.003) return; rgb = fixrgbexcess(rgb); @@ -595,6 +591,7 @@ void Ent_RemoveWaypointSprite() strunzone(self.netname3); } +/** flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] */ void Ent_WaypointSprite() { int sendflags, f, t;