]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/notifications.qc
More integration
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / notifications.qc
index 0feda9ba90138afc04136667ba8ab42247716e5f..bc06af1b98adeb9e847d804e32bdae1124e9bc7e 100644 (file)
@@ -349,7 +349,7 @@ void Create_Notification_Entity(
        float centername,
        float channel,
        string snd,
-       float volume,
+       float vol,
        float position,
        float strnum,
        float flnum,
@@ -370,6 +370,13 @@ void Create_Notification_Entity(
        string typestring = "";
        switch(typeid)
        {
+               case MSG_ANNCE:
+               {
+                       typestring = "MSG_ANNCE";
+                       msg_info_notifs[nameid - 1] = notif;
+                       notif.classname = "msg_annce_notification";
+                       break;
+               }
                case MSG_INFO:
                {
                        typestring = "MSG_INFO";
@@ -455,6 +462,29 @@ void Create_Notification_Entity(
                        notif.nent_floatcount = max(infoname_floatcount, centername_floatcount);
                }
        }
+       else if(typeid == MSG_ANNCE)
+       {
+               // Set MSG_ANNCE information and handle precaching
+               if(snd != "")
+               {
+                       notif.nent_channel = channel;
+                       notif.nent_snd = strzone(snd);
+                       notif.nent_vol = vol;
+                       notif.nent_position = position;
+               }
+               else
+               {
+                       print(sprintf(
+                               strcat(
+                                       "^1NOTIFICATION WITH NO SOUND: ",
+                                       "^7net_type = %s, net_name = %s.\n"
+                               ),
+                               typestring,
+                               namestring
+                       ));
+                       notif_error = TRUE;
+               }
+       }
        else
        {
                // Set MSG_INFO and MSG_CENTER string/float counts