]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
More integration
authorSamual Lenks <samual@xonotic.org>
Mon, 15 Apr 2013 02:22:08 +0000 (22:22 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 15 Apr 2013 02:22:08 +0000 (22:22 -0400)
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh

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
index f758cd2d7c1a3bbe392835043fdc59457bfbb155..c525bdd0c3fd0c70c1faf224d91a8a94ab09fc28 100644 (file)
@@ -50,7 +50,7 @@ void Create_Notification_Entity(
        float centername,
        float channel,
        string snd,
-       float volume,
+       float vol,
        float position,
        float strnum,
        float flnum,
@@ -1027,7 +1027,7 @@ float NOTIF_CPID_COUNT;
 .entity nent_msgcenter;
 .float nent_channel;
 .string nent_snd;
-.float nent_volume;
+.float nent_vol;
 .float nent_position;
 .float nent_stringcount;
 .float nent_floatcount; 
@@ -1063,8 +1063,8 @@ float NOTIF_CPID_COUNT;
                        NO_MSG,                        /* infoname */ \
                        NO_MSG,                        /* centername */ \
                        channel,                       /* channel */ \
-                       sound,                         /* sound */ \
-                       volume,                        /* volume */ \
+                       sound,                         /* snd */ \
+                       volume,                        /* vol */ \
                        position,                      /* position */ \
                        NO_MSG,                        /* strnum */ \
                        NO_MSG,                        /* flnum */ \
@@ -1075,7 +1075,7 @@ float NOTIF_CPID_COUNT;
                        "",                            /* durcnt */ \
                        "",                            /* normal */ \
                        "",                            /* gentle */ \
-                       TRUE,                          /* msg_is_info */ \
+                       FALSE,                         /* msg_is_info */ \
                        FALSE);                        /* msg_is_multi */ \
        } \
        ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
@@ -1097,8 +1097,8 @@ float NOTIF_CPID_COUNT;
                        NO_MSG,                        /* infoname */ \
                        NO_MSG,                        /* centername */ \
                        NO_MSG,                        /* channel */ \
-                       "",                            /* sound */ \
-                       NO_MSG,                        /* volume */ \
+                       "",                            /* snd */ \
+                       NO_MSG,                        /* vol */ \
                        NO_MSG,                        /* position */ \
                        strnum,                        /* strnum */ \
                        flnum,                         /* flnum */ \
@@ -1133,8 +1133,8 @@ float NOTIF_CPID_COUNT;
                        NO_MSG,                        /* infoname */ \
                        NO_MSG,                        /* centername */ \
                        NO_MSG,                        /* channel */ \
-                       "",                            /* sound */ \
-                       NO_MSG,                        /* volume */ \
+                       "",                            /* snd */ \
+                       NO_MSG,                        /* vol */ \
                        NO_MSG,                        /* position */ \
                        strnum,                        /* strnum */ \
                        flnum,                         /* flnum */ \
@@ -1167,8 +1167,8 @@ float NOTIF_CPID_COUNT;
                        infoname,                      /* infoname */ \
                        centername,                    /* centername */ \
                        NO_MSG,                        /* channel */ \
-                       "",                            /* sound */ \
-                       NO_MSG,                        /* volume */ \
+                       "",                            /* snd */ \
+                       NO_MSG,                        /* vol */ \
                        NO_MSG,                        /* position */ \
                        NO_MSG,                        /* strnum */ \
                        NO_MSG,                        /* flnum */ \