MSG_INFO_NOTIF(DEATH_MURDER_VH_WAKI_GUN, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_death", _("^BG%s%s^K1 was bolted down by ^BG%s^K1's Racer%s%s"), "")
MSG_INFO_NOTIF(DEATH_MURDER_VH_WAKI_ROCKET, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_death", _("^BG%s%s^K1 couldn't find shelter from ^BG%s^K1's Racer%s%s"), "")
MSG_INFO_NOTIF(DEATH_MURDER_VOID, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_void", _("^BG%s%s^K1 was thrown into a world of hurt by ^BG%s^K1%s%s"), "")
- MSG_INFO_NOTIF(DEATH_MURDER_VOID_ENT, N_CONSOLE, 4, 2, "spree_inf s1 s3 s2 s4loc spree_end", "s2 s1", "notify_void", "^BG%s%s^K1 %s ^BG%s^K1%s%s", "")
+ MSG_INFO_NOTIF(DEATH_MURDER_VOID_ENT, N_CONSOLE, 4, 2, "spree_inf s1 s3#s2 #s2 s4loc spree_end", "s2 s1", "notify_void", "^BG%s%s^K1 %s%s%s%s", "")
MSG_INFO_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, N_CONSOLE, 2, 1, "s1 death_team s2loc", "", "", _("^BG%s^K1 was moved into the %s%s"), "")
MSG_INFO_NOTIF(DEATH_SELF_BETRAYAL, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_teamkill_red", _("^BG%s^K1 became enemies with the Lord of Teamplay%s%s"), "")
int notif_queue_length;
void Local_Notification_Queue_Process();
+
+// replaces # with attacker_name in ent_msg (if not found attacker_name is appended)
+string hash_replace(string full_msg, int ent_msg_num, string ent_msg, string attacker_name)
+{
+ int s_ofs = 0;
+ while (--ent_msg_num >= 0)
+ s_ofs += strstrofs(full_msg, "%s", s_ofs);
+ string col = find_last_color_code(substring(full_msg, 0, s_ofs));
+
+ int hash_ofs = strstrofs(ent_msg, "#", 0);
+ if (hash_ofs < 0)
+ ent_msg = strcat(ent_msg, " ", CCR("^BG"), attacker_name, col);
+ else
+ ent_msg = strreplace("#", strcat(CCR("^BG"), attacker_name, col), ent_msg);
+ return ent_msg;
+}
+
+#define HASH_REPLACE(full_msg, num, attacker_name) hash_replace(input, num, s##num, attacker_name)
#endif
string arg_slot[NOTIF_MAX_ARGS];
ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \
ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \
ARG_CASE(ARG_CS, "death_team", Team_ColoredFullName(f1 - 1)) \
+ ARG_CASE(ARG_SV, "s3#s2", s3) \
+ ARG_CASE(ARG_SV, "#s2", s2) \
+ ARG_CASE(ARG_CS, "s3#s2", HASH_REPLACE(input, 3, s2)) \
+ ARG_CASE(ARG_CS, "#s2", "") \
ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(NULL,netname,s1).descriptor.message) \
ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(NULL,netname,s1).descriptor.netname)
float blink_synced(float base, float range, float freq, float start_time, int start_blink);
float blink(float base, float range, float freq);
+
+string find_last_color_code(string s);
{
if (DEATH_ENT(deathtype) == DEATH_HURTTRIGGER)
{
- // FIXME if # is present inside .message2 then it is should be replaced with attacker's name
bool msg_from_ent = (inflictor && inflictor.message2 != "");
Obituary_SpecialDeath(targ, true, msg_from_ent, deathtype,
targ.netname,