X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fnotifications.qh;h=6619e7d7304aa89d1a5b2f446ce0ae998d027a91;hb=af5bcb8e69e8bb70e0e08b92f68c39e4481ed1da;hp=18cb7ee7f02c65944904cd9969f382a98afa01fa;hpb=a014f99742b4ce9131bb4571e52be59a073d1871;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 18cb7ee7f..6619e7d73 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -284,6 +284,8 @@ const float ARG_DC = 6; // unique result to durcnt/centerprint // todo possible idea.... declare how many floats/strings each arg needs, and then dynamically increment the input // this way, we don't need to have duplicates like i.e. s2loc and s3loc? +string BUFF_NAME(int i); + #define NOTIF_ARGUMENT_LIST \ ARG_CASE(ARG_CS_SV_HA, "s1", s1) \ ARG_CASE(ARG_CS_SV_HA, "s2", s2) \ @@ -316,9 +318,9 @@ const float ARG_DC = 6; // unique result to durcnt/centerprint ARG_CASE(ARG_CS_SV, "spree_inf", (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \ ARG_CASE(ARG_CS_SV, "spree_end", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \ ARG_CASE(ARG_CS_SV, "spree_lost", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \ - ARG_CASE(ARG_CS_SV, "item_wepname", WEP_NAME(f1)) \ - ARG_CASE(ARG_CS_SV, "item_buffname", sprintf("%s%s", rgb_to_hexcolor(Buffs_from(f1).m_color), Buffs_from(f1).m_prettyName)) \ - ARG_CASE(ARG_CS_SV, "f3buffname", sprintf("%s%s", rgb_to_hexcolor(Buffs_from(f3).m_color), Buffs_from(f3).m_prettyName)) \ + ARG_CASE(ARG_CS_SV, "item_wepname", Weapons_from(f1).m_name) \ + ARG_CASE(ARG_CS_SV, "item_buffname", BUFF_NAME(f1)) \ + ARG_CASE(ARG_CS_SV, "f3buffname", BUFF_NAME(f3)) \ ARG_CASE(ARG_CS_SV, "item_wepammo", (s1 != "" ? sprintf(_(" with %s"), s1) : "")) \ ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \ ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \ @@ -326,9 +328,9 @@ const float ARG_DC = 6; // unique result to durcnt/centerprint ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(world,netname,s1).descriptor.message) \ ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(world,netname,s1).descriptor.netname) -#define NOTIF_HIT_MAX(count,funcname) do { \ +#define NOTIF_HIT_MAX(count,funcname) MACRO_BEGIN { \ if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } \ -} while(0) +} MACRO_END #define NOTIF_HIT_UNKNOWN(token,funcname) { backtrace(sprintf("%s: Hit unknown token in selected string! '%s'\n", funcname, selected)); break; } #define KILL_SPREE_LIST \ @@ -895,29 +897,6 @@ float notif_global_error; void RegisterNotifications_First() { notif_global_error = false; - - #ifdef SVQC - #define dedi (server_is_dedicated ? "a dedicated " : "") - #else - #define dedi "" - #endif - - LOG_INFOF("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME); - #undef dedi - - // maybe do another implementation of this with checksums? for now, we don't need versioning - /*if(autocvar_notification_version != NOTIF_VERSION) - { - #ifdef CSQC - if(autocvar_notification_version_mismatch_client_error) - #else - if(autocvar_notification_version_mismatch_server_error) - #endif - notif_global_error = true; - - printf("^1NOTIFICATION VERSION MISMATCH: ^7program = %s, config = %d, code = %d.\n", - PROGNAME, autocvar_notification_version, NOTIF_VERSION); - }*/ } void RegisterNotifications_Done() @@ -926,11 +905,10 @@ void RegisterNotifications_Done() { // shit happened... stop the loading of the program now if this is unacceptable if(autocvar_notification_errors_are_fatal) - error("Notification initialization failed! Read above and fix the errors!\n"); + LOG_FATAL("Notification initialization failed! Read above and fix the errors!\n"); else - LOG_INFO("Notification initialization failed! Read above and fix the errors!\n"); + LOG_SEVERE("Notification initialization failed! Read above and fix the errors!\n"); } - else { LOG_INFO("Notification initialization successful!\n"); } } // NOW we actually activate the declarations