}
HUD_Notify_Push(icon, arg_slot[0], arg_slot[1]);
}
+
+void Local_Notification_centerprint_generic(string input, string durcnt, float cpid, float f1, float f2)
+{
+ string olddurcnt = durcnt;
+ string selected;
+ float sel_num;
+ arg_slot[0] = ""; arg_slot[1] = "";
+
+ for(sel_num = 0;(durcnt != "");)
+ {
+ selected = car(durcnt); durcnt = cdr(durcnt);
+ NOTIF_HIT_MAX(NOTIF_MAX_HUDARGS, "Local_Notification_centerprint_generic")
+ switch(strtolower(selected))
+ {
+ case "f1": { arg_slot[sel_num] = ftos(f1); ++sel_num; break; }
+ case "0": { arg_slot[sel_num] = "0"; ++sel_num; break; }
+ case "1": { arg_slot[sel_num] = "1"; ++sel_num; break; }
+ NOTIF_HIT_UNKNOWN(NOTIF_MAX_HUDARGS, "Local_Notification_centerprint_generic")
+ }
+ }
+
+ #ifdef NOTIFICATIONS_DEBUG
+ dprint(
+ sprintf("Local_Notification_centerprint_generic(%d, '%s^7', '%s', '%s', '%s');\n",
+ cpid,
+ strreplace("\n", "\\n", input),
+ olddurcnt,
+ arg_slot[0], arg_slot[1]
+ )
+ );
+ #endif
+ centerprint_generic(cpid, input, stof(arg_slot[0]), stof(arg_slot[1]));
+}
#endif
void Local_Notification(float net_type, float net_name, ...count)
#ifdef CSQC
case MSG_CENTER:
{
- centerprint_generic(
- notif.nent_cpid,
+ Local_Notification_centerprint_generic(
Local_Notification_sprintf(
notif.nent_string,
notif.nent_args,
s1, s2, s3, s4,
f1, f2, f3, f4),
- 0, 0);
+ notif.nent_durcnt,
+ notif.nent_cpid,
+ f1, f2);
break;
}
#endif
MSG_CENTER_NOTIF(1, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE, 1, 4, "spree_cen s1 frag_stats", NO_CPID, "0 0", _("^K1%sYou were typefragged by ^BG%s^BG%s"), _("^K1%sYou were scored against by ^BG%s^K1 while typing^BG%s")) \
MSG_CENTER_NOTIF(1, CENTER_DEATH_TEAMKILL_FRAG, 1, 0, "s1", NO_CPID, "0 0", _("^K1Moron! You fragged ^BG%s^K1, a team mate!"), _("^K1Moron! You went against ^BG%s^K1, a team mate!")) \
MSG_CENTER_NOTIF(1, CENTER_DEATH_TEAMKILL_FRAGGED, 1, 0, "s1", NO_CPID, "0 0", _("^K1You were fragged by ^BG%s^K1, a team mate"), _("^K1You were scored against by ^BG%s^K1, a team mate")) \
- MSG_CENTER_NOTIF(1, CENTER_DISCONNECT_IDLING, 0, 1, "f1secs", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGDisconnecting in %s..."), "") \
+ MSG_CENTER_NOTIF(1, CENTER_DISCONNECT_IDLING, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGDisconnecting in ^COUNT..."), "") \
MULTITEAM_CENTER(1, CENTER_FREEZETAG_ROUND_WIN_, 4, 0, 0, "", NO_CPID, "0 0", _("^TC^TT^BG team wins the round, all other teams were frozen"), "") \
MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_SPAWN_LATE, 0, 0, "", NO_CPID, "0 0", _("^K1You spawned after the round started, you'll spawn as frozen"), "") \
MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_REVIVE, 1, 0, "s1", NO_CPID, "0 0", _("^K3You revived ^BG%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_SUPERWEAPON_BROKEN, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Superweapons have broken down"), "") \
MSG_CENTER_NOTIF(1, CENTER_SUPERWEAPON_PICKUP, 0, 0, "", CPID_POWERUP, "0 0", _("^F2You now have a superweapon"), "") \
MSG_CENTER_NOTIF(1, CENTER_SUPERWEAPON_LOST, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Superweapons have been lost"), "") \
- MULTITEAM_CENTER(1, CENTER_TEAMCHANGE_, 4, 0, 1, "f1secs", CPID_TEAMCHANGE, "1 f1", _("^BGChanging to ^TC^TT^BG in %s"), "") \
- MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SPECTATE, 0, 1, "f1secs", CPID_TEAMCHANGE, "1 f1", _("^BGSpectating in %s"), "") \
- MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_AUTO, 0, 1, "f1secs", CPID_TEAMCHANGE, "1 f1", _("^BGChanging team in %s"), "") \
- MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE, 0, 1, "f1secs", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in %s"), "")
+ MULTITEAM_CENTER(1, CENTER_TEAMCHANGE_, 4, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGChanging to ^TC^TT^BG in ^COUNT"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SPECTATE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGSpectating in ^COUNT"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_AUTO, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGChanging team in ^COUNT"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "")
#define MSG_WEAPON_NOTIFICATIONS \
/*MSG_WEAPON_NOTIF(1, WEAPON_EMPTY, NO_MSG, NO_MSG)*/ \
ARG_CASE(ARG_DOUBLE, "f4", ftos(f4)) \
ARG_CASE(ARG_DOUBLE, "f1p2dec", ftos_decimals(f1/100, 2)) \
ARG_CASE(ARG_DOUBLE, "f2p2dec", ftos_decimals(f2/100, 2)) \
+ ARG_CASE(ARG_CSQC, "f1secs", count_seconds(f1)) \
ARG_CASE(ARG_CSQC, "pass_key", ((((tmp_s = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(tmp_s, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), tmp_s) : "")) \
ARG_CASE(ARG_CSQC, "frag_ping", ((f2 != NO_MSG) ? sprintf(CCR(_("\n(Ping ^2%d^BG)")), f2) : "")) \
ARG_CASE(ARG_CSQC, "frag_stats", sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), f2, f3, ((f4 != NO_MSG) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f4) : ""))) \
if(args != "") { notif.nent_args = strzone(Process_Notif_Args(FALSE, args, strtoupper(#type), #name)); } \
if(hudargs != "") { notif.nent_hudargs = strzone(Process_Notif_Args(TRUE, hudargs, strtoupper(#type), #name)); } \
if(icon != "") { notif.nent_icon = strzone(icon); } \
+ if(cpid != NO_MSG) { notif.nent_cpid = cpid; } \
+ if(durcnt != "") { notif.nent_durcnt = strzone(durcnt); } \
if(GENTLE) \
{ \
if(gentle != "") { notif.nent_string = strzone(CCR(Process_Notif_Line(check_newline, nent_chat, gentle, strtoupper(#type), #name, "GENTLE"))); } \
hudargs, /* hudargs */ \
icon, /* icon */ \
NO_MSG, /* cpid */ \
- NO_MSG, /* durcnt */ \
+ "", /* durcnt */ \
normal, /* normal */ \
gentle, /* gentle */ \
1, /* check_newline */ \
"", /* hudargs */ \
"", /* icon */ \
NO_MSG, /* cpid */ \
- NO_MSG, /* durcnt */ \
+ "", /* durcnt */ \
"", /* normal */ \
"", /* gentle */ \
0, /* check_newline */ \
"", /* hudargs */ \
"", /* icon */ \
NO_MSG, /* cpid */ \
- NO_MSG, /* durcnt */ \
+ "", /* durcnt */ \
"", /* normal */ \
"", /* gentle */ \
0, /* check_newline */ \
}
#endif
-string count_append(float time, string zeroth, string first, string second, string third, string multi)
+string count_append(float interval, string zeroth, string first, string second, string third, string multi)
{
// This function is designed primarily for the English language, it's impossible
// to accomodate all languages unless we do a specific function for each one...
// and since that's not technically feasible/practical, this is all we've got folks.
- string timestring = sprintf("%d", time);
+ string timestring = sprintf("%d", interval);
float lastnum = stof(substring(timestring, (strlen(timestring) - 1), 1));
switch(lastnum)
{
- case 0: return sprintf(zeroth, time);
+ case 0: return sprintf(zeroth, interval);
case 1:
{
- if(time == 1) // EXACTLY value of 1
- return sprintf(first, time);
+ if(interval == 1) // EXACTLY value of 1
+ return sprintf(first, interval);
else
- return sprintf(multi, time);
+ return sprintf(multi, interval);
}
- case 2: return sprintf(second, time);
- case 3: return sprintf(third, time);
- default: return sprintf(multi, time);
+ case 2: return sprintf(second, interval);
+ case 3: return sprintf(third, interval);
+ default: return sprintf(multi, interval);
}
return "";
}
}
return "";
}
-
-
-
-
-