]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
This can be a macro too. MWAHAHAHAAHAHAHAHA.
authorSamual Lenks <samual@xonotic.org>
Thu, 7 Feb 2013 04:18:52 +0000 (23:18 -0500)
committerSamual Lenks <samual@xonotic.org>
Thu, 7 Feb 2013 04:18:52 +0000 (23:18 -0500)
qcsrc/common/util.qc
qcsrc/common/util.qh

index 89eae22239d20c16166768b48f9274bf682bd3fa..0cc53bd33c35de1f7f659ad83df5be142bb22b76 100644 (file)
@@ -2530,25 +2530,3 @@ 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", autocvar_hud_colorset_foreground_1, input); 
-       input = strreplace("^F2", autocvar_hud_colorset_foreground_2, input); 
-       input = strreplace("^F3", autocvar_hud_colorset_foreground_3, input); 
-       input = strreplace("^F4", autocvar_hud_colorset_foreground_4, input); 
-
-       // "kill" colors
-       input = strreplace("^K1", autocvar_hud_colorset_kill_1, input);
-       input = strreplace("^K2", autocvar_hud_colorset_kill_2, input);
-       input = strreplace("^K3", autocvar_hud_colorset_kill_3, input);
-
-       // background colors
-       input = strreplace("^BG", autocvar_hud_colorset_background, input);
-       input = strreplace("^N", "^7", input); // "none"-- reset to white...
-       return input;
-}
index 6b1e5d39a3fd6f1f91dedc75f11371680afb6c47..9b63cbda7b3e513fada321027e71bbc6a90aaa08 100644 (file)
@@ -381,15 +381,25 @@ float Count_Proper_Floats(float improper, float...count);
 
 void backtrace(string msg);
 
-// color code replace, place inside of sprintf and parse the string
-// defaults described as comments
+// color code replace, place inside of sprintf and parse the string... defaults described as constants
+// foreground/normal colors
 var string autocvar_hud_colorset_foreground_1 = "^2"; // F1 - Green  // primary priority (important names, etc)
 var string autocvar_hud_colorset_foreground_2 = "^3"; // F2 - Yellow // secondary priority (items, locations, numbers, etc)
 var string autocvar_hud_colorset_foreground_3 = "^4"; // F3 - Blue   // tertiary priority or relatively inconsequential text
 var string autocvar_hud_colorset_foreground_4 = "^1"; // F4 - Red    // notice/attention grabbing texting
+// "kill" colors
 var string autocvar_hud_colorset_kill_1 = "^1"; // K1 - Red    // "bad" or "dangerous" text (death messages against you, kill notifications, etc)
 var string autocvar_hud_colorset_kill_2 = "^3"; // K2 - Yellow // similar to above, but less important... OR, a highlight out of above message type
 var string autocvar_hud_colorset_kill_3 = "^4"; // K3 - Blue   // "good" or "beneficial" text (you fragging someone, etc)
+// background color
 var string autocvar_hud_colorset_background = "^7"; // BG - White // neutral/unimportant text
 
-string CCR(string input);
+#define CCR(input) strreplace("^F1", autocvar_hud_colorset_foreground_1, \
+       strreplace("^F2", autocvar_hud_colorset_foreground_2, \
+       strreplace("^F3", autocvar_hud_colorset_foreground_3, \
+       strreplace("^F4", autocvar_hud_colorset_foreground_4, \
+       strreplace("^K1", autocvar_hud_colorset_kill_1, \
+       strreplace("^K2", autocvar_hud_colorset_kill_2, \
+       strreplace("^K3", autocvar_hud_colorset_kill_3, \
+       strreplace("^BG", autocvar_hud_colorset_background, \
+       strreplace("^N", "^7", input)))))))))