From d05eefcfcd74908799bcea5ec3662a887556eaef Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 23 Aug 2015 14:29:50 +1000 Subject: [PATCH] Allow custom string format --- qcsrc/common/mutators/mutator/damagetext.qc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/mutators/mutator/damagetext.qc b/qcsrc/common/mutators/mutator/damagetext.qc index 884b74ed0..24bc60505 100644 --- a/qcsrc/common/mutators/mutator/damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext.qc @@ -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); } } -- 2.39.2