From: Rudolf Polzer Date: Thu, 4 Aug 2011 20:08:53 +0000 (+0200) Subject: Funny new cvar X-Git-Tag: xonotic-v0.5.0~148^2~30 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=56c6acf84460dd1c78598385d9ada410a1e826db;p=xonotic%2Fxonotic-data.pk3dir.git Funny new cvar set g_waypointsprite_spam 0 "Debugging feature. Set to 10 and load courtfun in race mode to test." --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 58d54e41d..e7dca2c6d 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 8e60d8212..0dc5b1849 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index cc29c5022..0b11602c1 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -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; }