X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fwaypointsprites.qc;h=d3d57aba9e8cbcd52ad7606466f912dc394032a9;hb=25ce29546c1ade2675975d8f406c4972f7979319;hp=fbf18160f595f0ad4f640d345788e0a87b07855e;hpb=24b8182bcc5b54d5789b80cf814c0e88b9bc9cfb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index fbf18160f..5f36cb6b0 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -38,14 +38,14 @@ float waypointsprite_alpha; .float build_starthealth; .float build_finished; -float SPRITE_HEALTHBAR_WIDTH = 144; -float SPRITE_HEALTHBAR_HEIGHT = 9; -float SPRITE_HEALTHBAR_MARGIN = 6; -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; +const float SPRITE_HEALTHBAR_WIDTH = 144; +const float SPRITE_HEALTHBAR_HEIGHT = 9; +const float SPRITE_HEALTHBAR_MARGIN = 6; +const float SPRITE_HEALTHBAR_BORDER = 2; +const float SPRITE_HEALTHBAR_BORDERALPHA = 1; +const float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5; +const float SPRITE_ARROW_SCALE = 1.0; +const float SPRITE_HELPME_BLINK = 2; void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f) { @@ -96,7 +96,7 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl o = hotspot; ri = '1 0 0'; up = '0 1 0'; - + rot = -rot; // rotate by the opposite angle, as our coordinate system is reversed o = rotate(o, rot) + org; ri = rotate(ri, rot); @@ -269,6 +269,8 @@ 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 "pinkbase": return _("Pink base"); case "waypoint": return _("Waypoint"); case "ons-gen-red": return _("Generator"); case "ons-gen-blue": return _("Generator"); @@ -423,7 +425,7 @@ void Draw_WaypointSprite() spriteimage = self.netname; break; case SPRITERULE_TEAMPLAY: - if(t == COLOR_SPECTATOR + 1) + if(t == NUM_SPECTATOR + 1) spriteimage = self.netname3; else if(self.team == t) spriteimage = self.netname2; @@ -439,10 +441,10 @@ void Draw_WaypointSprite() return; ++waypointsprite_newcount; - + float dist; dist = vlen(self.origin - view_origin); - + float a; a = self.alpha * autocvar_hud_panel_fg_alpha; @@ -457,7 +459,7 @@ 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", spriteimage)); + print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage)); } if(time - floor(time) > 0.5) @@ -483,10 +485,10 @@ void Draw_WaypointSprite() float ang; o = project_3d_to_2d(self.origin); - 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)) + 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 @@ -543,9 +545,9 @@ void Draw_WaypointSprite() o_z = 0; float edgedistance_min, crosshairdistance; - edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), + edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), (o_x - (vid_conwidth * waypointsprite_edgeoffset_left)), - (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, + (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y); float vidscale; @@ -585,7 +587,7 @@ void Draw_WaypointSprite() } o = drawspritearrow(o, ang, rgb, a, SPRITE_ARROW_SCALE * t); - + string txt; if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) txt = _("Spam"); @@ -596,6 +598,7 @@ void Draw_WaypointSprite() if(autocvar_g_waypointsprite_uppercase) txt = strtoupper(txt); + draw_beginBoldFont(); if(self.health >= 0) { o = drawspritetext(o, ang, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt); @@ -631,6 +634,7 @@ void Draw_WaypointSprite() { o = drawspritetext(o, ang, 0, rgb, a, waypointsprite_fontsize * '1 1 0', txt); } + draw_endBoldFont(); } void Ent_RemoveWaypointSprite() @@ -654,6 +658,7 @@ void Ent_WaypointSprite() self.draw2d = Draw_WaypointSprite; InterpolateOrigin_Undo(); + self.iflags |= IFLAG_ORIGIN; if(sendflags & 0x80) { @@ -686,6 +691,7 @@ void Ent_WaypointSprite() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); } if(sendflags & 1)