#if defined(CSQC) || defined(MENUQC)
// no translatable cvar description please
AUTOCVAR_SAVE(cl_damagetext, bool, false, "Draw damage dealt where you hit the enemy");
-AUTOCVAR_SAVE(cl_damagetext_format, string, "-%3$$d", "How to format the damage text. 1$ is health, 2$ is armor, 3$ is both");
+AUTOCVAR_SAVE(cl_damagetext_format, string, "-{total}", "How to format the damage text. {health}, {armor}, {total}");
AUTOCVAR_SAVE(cl_damagetext_color, vector, '1 1 0', "Damage text color");
AUTOCVAR_SAVE(cl_damagetext_color_per_weapon, bool, false, "Damage text uses weapon color");
AUTOCVAR_SAVE(cl_damagetext_size, float, 8, "Damage text font size");
Weapon w = DEATH_WEAPONOF(this.m_deathtype);
if (w != WEP_Null) rgb = w.wpcolor;
}
- string s = sprintf(autocvar_cl_damagetext_format, this.m_damage, this.m_armordamage, this.m_damage + this.m_armordamage);
+ string s = autocvar_cl_damagetext_format;
+ s = strreplace("{health}", sprintf("%d", this.m_damage), s);
+ s = strreplace("{armor}", sprintf("%d", this.m_armordamage), s);
+ s = strreplace("{total}", sprintf("%d", this.m_damage + this.m_armordamage), s);
drawcolorcodedstring2(pos, s, this.m_size * '1 1 0', rgb, this.alpha, DRAWFLAG_NORMAL);
}
}