]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow custom string format
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 23 Aug 2015 04:29:50 +0000 (14:29 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 23 Aug 2015 04:29:50 +0000 (14:29 +1000)
qcsrc/common/mutators/mutator/damagetext.qc

index 884b74ed06bd5f75988c234771793648db7e8f95..24bc60505ddfcaef72a384be0c83d2486dc451c2 100644 (file)
@@ -1,6 +1,7 @@
 REGISTER_MUTATOR(damagetext, true);
 
 #ifdef CSQC
+string autocvar_cl_damagetext_format = "-%3$d";
 vector autocvar_cl_damagetext_color = '1 1 0';
 float autocvar_cl_damagetext_size = 8;
 float autocvar_cl_damagetext_alpha_start = 1;
@@ -30,7 +31,7 @@ CLASS(DamageText, Object)
         vector pos = project_3d_to_2d(this.origin) + autocvar_cl_damagetext_offset;
         if (pos.z >= 0 && this.m_size > 0) {
             pos.z = 0;
-            string s = sprintf("-%d", this.m_damage + this.m_armordamage);
+            string s = sprintf(autocvar_cl_damagetext_format, this.m_damage, this.m_armordamage, this.m_damage + this.m_armordamage);
             drawstring(pos, s, this.m_size * '1 1 0', this.m_color, this.alpha, DRAWFLAG_NORMAL);
         }
     }