From: terencehill Date: Sun, 11 Feb 2018 11:39:46 +0000 (+0100) Subject: Remove "Spam" from translatable strings for real by sharing g_waypointsprite_spam... X-Git-Tag: xonotic-v0.8.5~2327 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=573a45ee4af6014b2465242cbf884453d371b5da Remove "Spam" from translatable strings for real by sharing g_waypointsprite_spam code (damn duplicated code!) --- diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 0c336c0abd..7b3d2abb61 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -249,6 +249,8 @@ vector spritelookupcolor(entity this, string s, vector def) string spritelookuptext(entity this, string s) { + if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) + return "Spam"; // no need to translate this debug string if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start"); if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).m_name; if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint; @@ -699,10 +701,7 @@ void Draw_WaypointSprite(entity this) string txt = string_null; if (is_text) { - if (autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) - txt = "Spam"; // no need to translate this debug string - else - txt = spritelookuptext(this, spriteimage); + txt = spritelookuptext(this, spriteimage); if (this.helpme && time < this.helpme) txt = sprintf(_("%s needing help!"), txt); if (autocvar_g_waypointsprite_uppercase) diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 850dd0ceb1..a57719b82c 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -115,11 +115,7 @@ void turret_draw2d(entity this) LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage); } - txt = this.netname; - if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) - txt = _("Spam"); - else - txt = spritelookuptext(this, spriteimage); + txt = spritelookuptext(this, spriteimage); if(time - floor(time) > 0.5 && t == this.team) {