From: Samual Lenks Date: Fri, 8 Feb 2013 12:42:20 +0000 (-0500) Subject: Updates to .qh files :D X-Git-Tag: xonotic-v0.7.0~62^2~23^2~259 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dd51c461ca9967ed078e94815e659eb5f0d55b26;p=xonotic%2Fxonotic-data.pk3dir.git Updates to .qh files :D --- diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index c55047bd0..de1ddfe5d 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -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) diff --git a/qcsrc/common/teams.qh b/qcsrc/common/teams.qh index 00500a161..c15f461af 100644 --- a/qcsrc/common/teams.qh +++ b/qcsrc/common/teams.qh @@ -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)) diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 316ee7277..b69f80b04 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -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