From: Samual Lenks Date: Sat, 23 Feb 2013 22:35:44 +0000 (-0500) Subject: Cleanup, plus fix frag stats argument X-Git-Tag: xonotic-v0.7.0~62^2~23^2~151 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3855f17440af239b72963a4fc84b3d1ee193e6e6;p=xonotic%2Fxonotic-data.pk3dir.git Cleanup, plus fix frag stats argument --- diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 3ae73940b..3314807e6 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -534,7 +534,7 @@ var float autocvar_notification_errors_are_fatal = TRUE; .float FRAG_VERBOSE; void Notification_GetCvars(void); #else -var float autocvar_notification_allow_chatboxprint = TRUE; +var float autocvar_notification_allow_chatboxprint = 1; // 0 = no, 1 = yes, 2 = forced on for all MSG_INFO notifs var float autocvar_notification_show_sprees_center = TRUE; var float autocvar_notification_show_sprees_center_specialonly = TRUE; var float autocvar_notification_frag_verbose = TRUE; @@ -647,18 +647,21 @@ string notif_arg_spree_cen(float spree) string notif_arg_spree_inf(float type, string input, string player, float spree) { - // 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker - // this conditional (& 2) is true for 2 and 3 switch(type) { case 1: // attacker kill spree { + // 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker + // this conditional (& 2) is true for 2 and 3 if(autocvar_notification_show_sprees_info & 2) { #ifdef CSQC - string spree_newline = (autocvar_notification_show_sprees_info_newline ? ((substring(input, 0, 1) == "\{3}") ? "\n\{3}" : "\n") : ""); + string spree_newline = + ( autocvar_notification_show_sprees_info_newline ? + ((substring(input, 0, 1) == "\{3}") ? "\n\{3}" : "\n") : "" ); #else - string spree_newline = (autocvar_notification_show_sprees_info_newline ? "\n" : ""); + string spree_newline = + (autocvar_notification_show_sprees_info_newline ? "\n" : ""); #endif if(spree > 1) @@ -752,7 +755,7 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) ARG_CASE(ARG_DOUBLE, "f2p2dec", ftos_decimals(f2/100, 2)) \ 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")), f1, f2, ((f3 != NO_MSG) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f3) : ""))) \ + 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) : ""))) \ /*ARG_CASE(ARG_CSQC, "frag_pos", ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : ""))*/ \ ARG_CASE(ARG_CSQC, "spree_cen", (autocvar_notification_show_sprees ? notif_arg_spree_cen(f1) : "")) \ ARG_CASE(ARG_CSQC, "spree_inf", (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \ @@ -829,8 +832,6 @@ string Process_Notif_Line(float check_newline, float chat, string input, string // pass 2: add STX char at end of each new line (so that messages with multiple lines are put through chatbox too) input = strreplace("\n", "\n\{3}", input); - //print(sprintf("foobar: '%s', '%s'... '%s'\n", strreplace("\n", "\\n", substring(input, (strlen(input) - 1), 1)), strreplace("\n", "\\n", input), strreplace("\n", "\\n", substring(input, 0, (strlen(input) - 1))))); - // pass 3: strip trailing STX char if(substring(input, (strlen(input) - 1), 1) == "\{3}") { input = substring(input, 0, (strlen(input) - 1)); }