float waypointsprite_edgefadealpha;
float waypointsprite_edgefadescale;
float waypointsprite_edgefadedistance;
+float waypointsprite_edgeoffset_bottom;
+float waypointsprite_edgeoffset_left;
+float waypointsprite_edgeoffset_right;
+float waypointsprite_edgeoffset_top;
float waypointsprite_crosshairfadealpha;
float waypointsprite_crosshairfadescale;
float waypointsprite_crosshairfadedistance;
float waypointsprite_distancefadedistance;
float waypointsprite_alpha;
+.float helpme;
.float rule;
.string netname; // primary picture
.string netname2; // secondary picture
float SPRITE_HEALTHBAR_BORDERALPHA = 1;
float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
float SPRITE_ARROW_SCALE = 1.0;
+float SPRITE_HELPME_BLINK = 2;
void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
{
case "item-shueld": return 2;
case "item-fuelregen": return 2;
case "item-jetpack": return 2;
+ case "tagged-target": return 2;
default: return 1;
}
}
switch(s)
{
case "keycarrier-friend": return '0 1 0';
+ case "wpn-laser": return '1 0.5 0.5';
+ case "wpn-shotgun": return '0.5 0.25 0';
+ case "wpn-uzi": return '1 1 0';
+ case "wpn-gl": return '1 0 0';
+ case "wpn-electro": return '0 0.5 1';
+ case "wpn-crylink": return '1 0.5 1';
+ case "wpn-nex": return '0.5 1 1';
+ case "wpn-hagar": return '1 1 0.5';
+ case "wpn-rl": return '1 1 0';
+ case "wpn-porto": return '0.5 0.5 0.5';
+ case "wpn-minstanex": return '0.5 1 1';
+ case "wpn-hookgun": return '0 0.5 0';
+ case "wpn-fireball": return '1 0.5 0';
+ case "wpn-hlac": return '0 1 0';
+ case "wpn-campingrifle": return '0.5 1 0';
+ case "wpn-minelayer": return '0.75 1 0';
default: return def;
}
}
case "race-checkpoint": return _("Checkpoint");
case "race-finish": return _("Finish");
case "race-start": return _("Start");
+ case "race-start-finish": return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
case "nb-ball": return _("Ball");
case "ka-ball": return _("Ball");
case "ka-ballcarrier": return _("Ball carrier");
return rgb;
}
+float waypointsprite_count, waypointsprite_newcount;
void Draw_WaypointSprite()
{
string spriteimage;
if(spriteimage == "")
return;
+
+ ++waypointsprite_newcount;
float dist;
dist = vlen(self.origin - view_origin);
if(rgb == '0 0 0')
{
self.teamradar_color = '1 0 1';
- print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n"));
+ print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
}
if(time - floor(time) > 0.5)
- a *= spritelookupblinkvalue(spriteimage);
+ {
+ if(self.helpme && time < self.helpme)
+ a *= SPRITE_HELPME_BLINK;
+ else
+ a *= spritelookupblinkvalue(spriteimage);
+ }
if(a > 1)
{
float ang;
o = project_3d_to_2d(self.origin);
- if(o_z < 0 || o_x < 0 || o_y < 0 || o_x > vid_conwidth || o_y > vid_conheight)
+ if(o_z < 0
+ || o_x < (vid_conwidth * waypointsprite_edgeoffset_left)
+ || o_y < (vid_conheight * waypointsprite_edgeoffset_top)
+ || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right))
+ || o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)))
{
// scale it to be just in view
vector d;
if(d_z * f1 > 0)
{
// RIGHT edge
- d = d * (0.5 / f1);
+ d = d * ((0.5 - waypointsprite_edgeoffset_right) / f1);
}
else
{
// LEFT edge
- d = d * (-0.5 / f1);
+ d = d * (-(0.5 - waypointsprite_edgeoffset_left) / f1);
}
}
else
if(d_z * f2 > 0)
{
// BOTTOM edge
- d = d * (0.5 / f2);
+ d = d * ((0.5 - waypointsprite_edgeoffset_bottom) / f2);
}
else
{
// TOP edge
- d = d * (-0.5 / f2);
+ d = d * (-(0.5 - waypointsprite_edgeoffset_top) / f2);
}
}
o_z = 0;
float edgedistance_min, crosshairdistance;
- edgedistance_min = min4(o_y, o_x,vid_conwidth - o_x, vid_conheight - o_y);
+ edgedistance_min = min4((o_y - (vid_conheight * waypointsprite_edgeoffset_top)),
+ (o_x - (vid_conwidth * waypointsprite_edgeoffset_left)),
+ (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
+ (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
float vidscale;
vidscale = max(vid_conwidth / vid_width, vid_conheight / vid_height);
o = drawspritearrow(o, ang, rgb, a, SPRITE_ARROW_SCALE * t);
string txt;
- txt = spritelookuptext(spriteimage);
+ if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam)
+ txt = _("Spam");
+ else
+ txt = spritelookuptext(spriteimage);
+ if(self.helpme && time < self.helpme)
+ txt = sprintf(_("%s needing help!"), txt);
if(autocvar_g_waypointsprite_uppercase)
txt = strtoupper(txt);
self.teamradar_color_x = ReadByte() / 255.0;
self.teamradar_color_y = ReadByte() / 255.0;
self.teamradar_color_z = ReadByte() / 255.0;
+ self.helpme = ReadByte() * 0.1;
+ if(self.helpme > 0)
+ self.helpme += servertime;
}
InterpolateOrigin_Note();
waypointsprite_edgefadealpha = autocvar_g_waypointsprite_edgefadealpha;
waypointsprite_edgefadescale = autocvar_g_waypointsprite_edgefadescale;
waypointsprite_edgefadedistance = autocvar_g_waypointsprite_edgefadedistance;
+ waypointsprite_edgeoffset_bottom = autocvar_g_waypointsprite_edgeoffset_bottom;
+ waypointsprite_edgeoffset_left = autocvar_g_waypointsprite_edgeoffset_left;
+ waypointsprite_edgeoffset_right = autocvar_g_waypointsprite_edgeoffset_right;
+ waypointsprite_edgeoffset_top = autocvar_g_waypointsprite_edgeoffset_top;
waypointsprite_crosshairfadealpha = autocvar_g_waypointsprite_crosshairfadealpha;
waypointsprite_crosshairfadescale = autocvar_g_waypointsprite_crosshairfadescale;
waypointsprite_crosshairfadedistance = autocvar_g_waypointsprite_crosshairfadedistance;
WaypointSprite_Load_Frames(".jpg");
waypointsprite_initialized = true;
}
+
+ waypointsprite_count = waypointsprite_newcount;
+ waypointsprite_newcount = 0;
}