From: terencehill Date: Thu, 8 Aug 2024 21:01:31 +0000 (+0200) Subject: Replace notification color codes only in custom string arguments. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2bc3a4b5a6ef2226f48b182621bd0c6dabe3c8cc;p=xonotic%2Fxonotic-data.pk3dir.git Replace notification color codes only in custom string arguments. No message uses them in basic string arguments, except for player names where they shouldn't be replaced. Also remove a pointless CCR (color code replace) call for the race_diff argument --- diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index dd200973b..5c7212a07 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1262,10 +1262,10 @@ void Local_Notification(MSG net_type, Notification net_name, ...count) return; } - string s1 = CCR((notif.nent_stringcount > 0) ? ...(0, string) : ""); - string s2 = CCR((notif.nent_stringcount > 1) ? ...(1, string) : ""); - string s3 = CCR((notif.nent_stringcount > 2) ? ...(2, string) : ""); - string s4 = CCR((notif.nent_stringcount > 3) ? ...(3, string) : ""); + string s1 = (notif.nent_stringcount > 0) ? ...(0, string) : ""; + string s2 = (notif.nent_stringcount > 1) ? ...(1, string) : ""; + string s3 = (notif.nent_stringcount > 2) ? ...(2, string) : ""; + string s4 = (notif.nent_stringcount > 3) ? ...(3, string) : ""; float f1 = ((notif.nent_floatcount > 0) ? ...((notif.nent_stringcount + 0), float) : 0); float f2 = ((notif.nent_floatcount > 1) ? ...((notif.nent_stringcount + 1), float) : 0); float f3 = ((notif.nent_floatcount > 2) ? ...((notif.nent_stringcount + 2), float) : 0); diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index 461253fa6..7c7a6e93a 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -435,8 +435,8 @@ string BUFF_NAME(int i); ARG_CASE(ARG_CS_SV_HA, "f1race_time", TIME_ENCODED_TOSTRING(f1, true)) \ ARG_CASE(ARG_CS_SV_HA, "f2race_time", TIME_ENCODED_TOSTRING(f2, true)) \ ARG_CASE(ARG_CS_SV_HA, "f3race_time", TIME_ENCODED_TOSTRING(f3, true)) \ - ARG_CASE(ARG_CS_SV, "race_col", CCR(((f1 == 1) ? "^F1" : "^F2"))) \ - ARG_CASE(ARG_CS_SV, "race_diff", ((f2 > f3) ? sprintf(CCR("^1[+%s]"), TIME_ENCODED_TOSTRING(f2 - f3, true)) : sprintf(CCR("^2[-%s]"), TIME_ENCODED_TOSTRING(f3 - f2, true)))) \ + ARG_CASE(ARG_CS_SV, "race_col", CCR((f1 == 1) ? "^F1" : "^F2")) \ + ARG_CASE(ARG_CS_SV, "race_diff", ((f2 > f3) ? sprintf("^1[+%s]", TIME_ENCODED_TOSTRING(f2 - f3, true)) : sprintf("^2[-%s]", TIME_ENCODED_TOSTRING(f3 - f2, true)))) \ ARG_CASE(ARG_CS, "missing_teams", notif_arg_missing_teams(f1)) \ ARG_CASE(ARG_CS, "pass_key", getcommandkey(_("drop flag"), "+use")) \ ARG_CASE(ARG_CS, "nade_key", getcommandkey(_("throw nade"), "dropweapon")) \