From: z411 Date: Sun, 30 Oct 2022 20:17:52 +0000 (-0300) Subject: Let announcer queue guess announcer length X-Git-Tag: xonotic-v0.8.6~237^2~7 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=21b5bc2e99e973f9e35bdba88aaf927a9b51c10c;p=xonotic%2Fxonotic-data.pk3dir.git Let announcer queue guess announcer length --- diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index bd46f35d7..5a73a17e4 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -98,7 +98,11 @@ #define N_GNTLOFF 1 #define N__ALWAYS 2 -#define ANNCE_DEFTIME 2 +// defaault time for announcer queue (time to wait before the next announcer is played) +// -1 = bypass queue and play the announcer immediately +// 0 = use the announcer sound length +// >0 = use the specified time to wait +#define ANNCE_DEFTIME 0 #define MULTITEAM_ANNCE(prefix, defaultvalue, sound, channel, volume, position) \ NOTIF_ADD_AUTOCVAR(ANNCE_##prefix, defaultvalue) \ diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index 685febf0f..c8bcb6a68 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1200,7 +1200,8 @@ void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time) if(queue_time == -1 || time > notif_queue_next_time) { // Run immediately Local_Notification_Queue_Run(net_type, notif); - notif_queue_next_time = time + queue_time; + if(queue_time >= 0) + notif_queue_next_time = time + (queue_time == 0 ? soundlength(AnnouncerFilename(notif.nent_snd)) : queue_time); } else { // Put in queue if(notif_queue_length >= NOTIF_QUEUE_MAX) return;