X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fclient%2Fwaypointsprites.qc;h=9e5b199882e4e1662fc123529d40f64a8403f9c8;hb=0ad5cb1be1dd10185fcb5581b0645d34aa9b294d;hp=8ea4ec8d82b51cddfb398e1870b60d33d0f71422;hpb=4f920aea0bcef26f3e026827db1f3172606651bf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index 8ea4ec8d8..9e5b19988 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -10,6 +10,10 @@ float waypointsprite_fontsize; 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; @@ -18,6 +22,7 @@ float waypointsprite_distancefadescale; float waypointsprite_distancefadedistance; float waypointsprite_alpha; +.float helpme; .float rule; .string netname; // primary picture .string netname2; // secondary picture @@ -40,6 +45,7 @@ float SPRITE_HEALTHBAR_BORDER = 2; 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) { @@ -213,6 +219,7 @@ float spritelookupblinkvalue(string s) case "item-shueld": return 2; case "item-fuelregen": return 2; case "item-jetpack": return 2; + case "tagged-target": return 2; default: return 1; } } @@ -429,11 +436,16 @@ void Draw_WaypointSprite() 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) { @@ -450,7 +462,11 @@ void Draw_WaypointSprite() 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; @@ -469,12 +485,12 @@ void Draw_WaypointSprite() 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 @@ -482,12 +498,12 @@ void Draw_WaypointSprite() 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); } } @@ -506,7 +522,10 @@ void Draw_WaypointSprite() 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); @@ -548,6 +567,8 @@ void Draw_WaypointSprite() string txt; txt = spritelookuptext(spriteimage); + if(self.helpme && time < self.helpme) + txt = sprintf(_("%s needing help!"), txt); if(autocvar_g_waypointsprite_uppercase) txt = strtoupper(txt); @@ -690,6 +711,9 @@ void Ent_WaypointSprite() 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(); @@ -733,6 +757,10 @@ void WaypointSprite_Load() 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;