]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/notifications.qc
Move that to another section
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / notifications.qc
index 19b782ff75e4d3b7c0333c0422f8e8c51b22ef9b..9395013f603d7fd448f759b1d443568ad393d313 100644 (file)
@@ -100,6 +100,43 @@ string Notification_CheckArgs(
 //  Initialization Core Functions
 // ===============================
 
+// used by restartnotifs command to initialize notifications
+void Destroy_Notification_Entity(entity notif)
+{
+       if(notif.nent_name != "") { strunzone(notif.nent_name); }
+       if(notif.nent_args != "") { strunzone(notif.nent_args); }
+       if(notif.nent_hudargs != "") { strunzone(notif.nent_hudargs); }
+       if(notif.nent_icon != "") { strunzone(notif.nent_icon); }
+       if(notif.nent_durcnt != "") { strunzone(notif.nent_durcnt); }
+       if(notif.nent_string != "") { strunzone(notif.nent_string); }
+       remove(notif);
+}
+
+void Destroy_All_Notifications(void)
+{
+       entity notif;
+       float i;
+       
+       #define DESTROY_LOOP(type,count) \
+               for(i = 1; i <= count; ++i) \
+               { \
+                       notif = Get_Notif_Ent(type, i); \
+                       if not(notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \
+                       Destroy_Notification_Entity(notif); \
+               }
+
+       // kill all networked notifications
+       #ifdef SVQC
+       Kill_Notification(NOTIF_ALL, world, 0, 0);
+       #endif
+
+       // kill all real notification entities
+       DESTROY_LOOP(MSG_INFO, NOTIF_INFO_COUNT)
+       DESTROY_LOOP(MSG_CENTER, NOTIF_CENTER_COUNT)
+       DESTROY_LOOP(MSG_MULTI, NOTIF_MULTI_COUNT)
+       #undef DESTROY_LOOP
+}
+
 string Process_Notif_Line(
        float msg_is_info,
        float chat,
@@ -562,42 +599,6 @@ void Create_Notification_Entity(
        }
 }
 
-void Destroy_Notification_Entity(entity notif)
-{
-       if(notif.nent_name != "") { strunzone(notif.nent_name); }
-       if(notif.nent_args != "") { strunzone(notif.nent_args); }
-       if(notif.nent_hudargs != "") { strunzone(notif.nent_hudargs); }
-       if(notif.nent_icon != "") { strunzone(notif.nent_icon); }
-       if(notif.nent_durcnt != "") { strunzone(notif.nent_durcnt); }
-       if(notif.nent_string != "") { strunzone(notif.nent_string); }
-       remove(notif);
-}
-
-void Destroy_All_Notifications(void)
-{
-       entity notif;
-       float i;
-       
-       #define DESTROY_LOOP(type,count) \
-               for(i = 1; i <= count; ++i) \
-               { \
-                       notif = Get_Notif_Ent(type, i); \
-                       if not(notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \
-                       Destroy_Notification_Entity(notif); \
-               }
-
-       // kill all networked notifications
-       #ifdef SVQC
-       Kill_Notification(NOTIF_ALL, world, 0, 0);
-       #endif
-
-       // kill all real notification entities
-       DESTROY_LOOP(MSG_INFO, NOTIF_INFO_COUNT)
-       DESTROY_LOOP(MSG_CENTER, NOTIF_CENTER_COUNT)
-       DESTROY_LOOP(MSG_MULTI, NOTIF_MULTI_COUNT)
-       #undef DESTROY_LOOP
-}
-
 
 // =========================================
 //  Cvar Handling With 'dumpnotifs' Command