]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Updates to .qh files :D
authorSamual Lenks <samual@xonotic.org>
Fri, 8 Feb 2013 12:42:20 +0000 (07:42 -0500)
committerSamual Lenks <samual@xonotic.org>
Fri, 8 Feb 2013 12:42:20 +0000 (07:42 -0500)
qcsrc/common/notifications.qh
qcsrc/common/teams.qh
qcsrc/common/util.qh

index c55047bd05f7dc20e430dc3c519c226646f76108..de1ddfe5dcec62a01e137be5dcd244dd079f7abc 100644 (file)
@@ -9,27 +9,9 @@
 #define MSG_WEAPON 3 // "Personal" weapon messages (like "You got the Nex", sent to weapon notify panel)
 #define MSG_DEATH 4 // "Personal" AND "Global" death messages 
 
-#define TCR(input,teamcolor,teamtext) strreplace("^TC", teamcolor, strreplace("^TT", teamtext, input))
-
-// select between the normal or the gentle message string based on client (or server) settings
-/*string normal_or_gentle(string normal, string gentle)
-{
-       if(GENTLE)
-               return ((gentle != "") ? gentle : normal);
-       else
-               return normal;
-}*/
-#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
-
 void Dump_Notifications(float fh, float alsoprint);
 
 #ifndef MENUQC // SERVER AND CLIENT ONLY
-// Since this code uses macro processors to list notifications,
-// the normal compiler sees these checks as "constant" and throws
-// a warning. We have to get around this by using another function.
-//#define NOTIF_MATCH(a,b) if(min(NOTIF_MAX, a) == b)
-//#define NOTIF_MATCH(a,b) tmp_f = a; if(tmp_f == b)
-
 // notification system nullified arguments
 #define NO_STR_ARG ""
 #define NO_FL_ARG -12345
@@ -145,11 +127,6 @@ void Read_Notification(float is_new);
 .string nent_strings[4];
 .float nent_floats[4];
 
-// allow sending of notifications to also pass through to spectators (specifically for centerprints)
-#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
-#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
-#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
-
 #define IFSTR(num) ((num <= (stringcount-1)) ? ...(num, string) : NO_STR_ARG)
 #define IFFL(num) ((((stringcount-1) + num) < count) ? ...(((stringcount-1) + num), float) : NO_FL_ARG)
 
index 00500a1614a378459093e1ba87ad62a1f05f51ba..c15f461af9073b46b0278b5d720ef71cbc20f5d6 100644 (file)
@@ -140,3 +140,6 @@ float Team_TeamToNumber(float teamid)
 
 #define Team_NumberToFullName(number) Team_FullName(Team_NumberToTeam(number))
 #define Team_NumberToColoredFullName(number) Team_ColoredFullName(Team_NumberToTeam(number))
+
+// replace these flags in a string with the strings provided
+#define TCR(input,teamcolor,teamtext) strreplace("^TC", teamcolor, strreplace("^TT", teamtext, input))
index 316ee7277bb844ec9e75eb0a6f829a052d010394..b69f80b04d1d59d02ac332680f81b035ada8f042 100644 (file)
@@ -402,4 +402,10 @@ string CCR(string input);
 #else
 #define GENTLE autocvar_sv_gentle
 #endif
+#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
 #endif
+
+// allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
+#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
+#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
+#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0