]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Undo that macrofication... Apparently, not EVERYTHING should be a macro
authorSamual Lenks <samual@xonotic.org>
Thu, 7 Feb 2013 10:22:50 +0000 (05:22 -0500)
committerSamual Lenks <samual@xonotic.org>
Thu, 7 Feb 2013 10:22:50 +0000 (05:22 -0500)
qcsrc/common/util.qc
qcsrc/common/util.qh

index 0cc53bd33c35de1f7f659ad83df5be142bb22b76..dc882194e1463e12e0be9d84877d0be91ad9147c 100644 (file)
@@ -2530,3 +2530,25 @@ void backtrace(string msg)
        cvar_set("prvm_backtraceforwarnings", ftos(war));
 }
 #endif
+
+// color code replace, place inside of sprintf and parse the string
+string CCR(string input)
+{
+       // See the autocvar declarations in util.qh for default values
+       
+       // foreground/normal colors
+       input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input); 
+       input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input); 
+       input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input); 
+       input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input); 
+
+       // "kill" colors
+       input = strreplace("^K1", strcat("^", autocvar_hud_colorset_kill_1), input);
+       input = strreplace("^K2", strcat("^", autocvar_hud_colorset_kill_2), input);
+       input = strreplace("^K3", strcat("^", autocvar_hud_colorset_kill_3), input);
+
+       // background colors
+       input = strreplace("^BG", strcat("^", autocvar_hud_colorset_background), input);
+       input = strreplace("^N", "^7", input); // "none"-- reset to white...
+       return input;
+}
index 072def8e474660237d0d7fa40961dca435d9a4ad..316ee7277bb844ec9e75eb0a6f829a052d010394 100644 (file)
@@ -394,15 +394,7 @@ var string autocvar_hud_colorset_kill_3 = "4"; // K3 - Blue   // "good" or "bene
 // background color
 var string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimportant text
 
-#define CCR(input) strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), \
-       strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), \
-       strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), \
-       strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), \
-       strreplace("^K1", strcat("^", autocvar_hud_colorset_kill_1), \
-       strreplace("^K2", strcat("^", autocvar_hud_colorset_kill_2), \
-       strreplace("^K3", strcat("^", autocvar_hud_colorset_kill_3), \
-       strreplace("^BG", strcat("^", autocvar_hud_colorset_background), \
-       strreplace("^N", "^7", input)))))))))
+string CCR(string input);
 
 #ifndef MENUQC
 #ifdef CSQC