alpha *= 1 - (time - HitIndicator_time[i]) / HitIndicator_fade_time;
float size = autocvar_cl_hit_indicator_size;
size = map_bound_ranges(HitIndicator_damage[i], 30, 90, size, size * 2);
- drawspritearrow(org, ang, '1 0 0', alpha, size, true);
+ org = drawspritearrow(org, ang, autocvar_cl_hit_indicator_color, alpha, size, true);
+
+ if (autocvar_cl_hit_indicator_text)
+ {
+ string text = ftos(HitIndicator_damage[i]);
+ vector t_size = autocvar_cl_hit_indicator_text_size * '1 1 0';
+ org.x += map_ranges(ofs.x, -radius, radius, 0, -1) * stringwidth(text, false, t_size);
+ org.y -= t_size.y * 0.5;
+ drawstring_builtin(org, text, t_size, autocvar_cl_hit_indicator_text_color, alpha, DRAWFLAG_NORMAL);
+ }
}
}
vector autocvar_cl_gunoffset;
bool autocvar_cl_hit_indicator = 1;
+vector autocvar_cl_hit_indicator_color = '1 0 0';
float autocvar_cl_hit_indicator_fade_alpha = 0.8;
float autocvar_cl_hit_indicator_fade_time = 1.5;
float autocvar_cl_hit_indicator_radius = 0.15;
float autocvar_cl_hit_indicator_size = 1.1;
+bool autocvar_cl_hit_indicator_text;
+vector autocvar_cl_hit_indicator_text_color = '1 0.5 0.5';
+float autocvar_cl_hit_indicator_text_size = 11;
const int HITINDICATOR_MAX_COUNT = 10;
entity HitIndicator_attacker[HITINDICATOR_MAX_COUNT];
float HitIndicator_damage[HITINDICATOR_MAX_COUNT];
seta cl_voice_directional_taunt_attenuation 0.5 "this defines the distance from which taunts can be heard"
seta cl_hit_indicator 1 "show a 2d directional indicator around the screen center when a player hits you"
+seta cl_hit_indicator_color "1 0 0" "hit indicator color"
seta cl_hit_indicator_fade_time 1.5 "how long hit indicator takes to fade away in seconds (max 2 seconds)"
seta cl_hit_indicator_fade_alpha 0.8 "initial hit indicator alpha"
seta cl_hit_indicator_radius 0.15 "show the directional indicator at this percentage of the screen from the center"
seta cl_hit_indicator_size 1.1 "hit indicator size"
+seta cl_hit_indicator_text 0 "show damage text together with the hit indicator"
+seta cl_hit_indicator_text_color "1 0.5 0.5" "hit indicator text color"
+seta cl_hit_indicator_text_size 11 "hit indicator text size"
seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy, 1: same pitch 2: decrease pitch with more damage 3: increase pitch with more damage"
set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"