]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Funny new cvar
authorRudolf Polzer <divverent@xonotic.org>
Thu, 4 Aug 2011 20:08:53 +0000 (22:08 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 4 Aug 2011 20:08:53 +0000 (22:08 +0200)
set g_waypointsprite_spam 0 "Debugging feature. Set to 10 and load courtfun in race mode to test."

defaultXonotic.cfg
qcsrc/client/autocvars.qh
qcsrc/client/waypointsprites.qc

index 58d54e41d092d5ec4660397f76863d513f1b33b1..e7dca2c6d475d87786fcafa88bf11b453f79647c 100644 (file)
@@ -1256,6 +1256,7 @@ seta g_waypointsprite_crosshairfadedistance 150 "distance in virtual pixels from
 seta g_waypointsprite_distancefadealpha 1 "alpha multiplier near distance"
 seta g_waypointsprite_distancefadescale 0.7 "scale multiplier near the distance"
 seta g_waypointsprite_distancefadedistancemultiplier 0.5 "distance in map sizes from distance where to stop fading"
+set g_waypointsprite_spam 0 "Debugging feature. Set to 10 and load courtfun in race mode to test."
 alias "g_waypointsprite_personal"      "impulse 30"
 alias "g_waypointsprite_personal_p"    "impulse 31"
 alias "g_waypointsprite_personal_d"    "impulse 32"
index 8e60d8212fef8f1c6bd8996694c4f54518057320..0dc5b184980199a00517856f160b89492f01c217 100644 (file)
@@ -138,11 +138,12 @@ var float autocvar_g_waypointsprite_edgeoffset_bottom = 0;
 var float autocvar_g_waypointsprite_edgeoffset_left = 0;
 var float autocvar_g_waypointsprite_edgeoffset_right = 0;
 var float autocvar_g_waypointsprite_edgeoffset_top = 0;
+var float autocvar_g_waypointsprite_fontsize = 12;
 float autocvar_g_waypointsprite_minalpha;
 float autocvar_g_waypointsprite_minscale;
 float autocvar_g_waypointsprite_normdistance;
 var float autocvar_g_waypointsprite_scale = 1;
-var float autocvar_g_waypointsprite_fontsize = 12;
+float autocvar_g_waypointsprite_spam;
 float autocvar_g_waypointsprite_timealphaexponent;
 var float autocvar_hud_colorflash_alpha = 0.5;
 float autocvar_hud_configure_bg_minalpha;
index cc29c5022087044cd24bc6d98d78c59e68c344de..0b11602c1ed914e7dec3af108ad015d6aa688ace 100644 (file)
@@ -380,6 +380,7 @@ vector fixrgbexcess(vector rgb)
        return rgb;
 }
 
+float waypointsprite_count, waypointsprite_newcount;
 void Draw_WaypointSprite()
 {
        string spriteimage;
@@ -435,6 +436,8 @@ void Draw_WaypointSprite()
 
        if(spriteimage == "")
                return;
+
+       ++waypointsprite_newcount;
        
        float dist;
        dist = vlen(self.origin - view_origin);
@@ -583,7 +586,10 @@ void Draw_WaypointSprite()
        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)
@@ -792,4 +798,7 @@ void WaypointSprite_Load()
                WaypointSprite_Load_Frames(".jpg");
                waypointsprite_initialized = true;
        }
+
+       waypointsprite_count = waypointsprite_newcount;
+       waypointsprite_newcount = 0;
 }