Added a new macro to color extra words after the m_name, in the guide.
Bounded RGB parameters in rgb_to_hexcolor to [0,1].
const vector COLOR_STATUSEFFECT_STUNNED = '0.67 0.84 1';
const vector COLOR_STATUSEFFECT_WEBBED = '0.94 0.3 1';
-// Useful macro for the guide
+// Useful macros for the guide
#define COLORED_NAME(class) strcat(rgb_to_hexcolor(NEW(class).m_color), NEW(class).m_name, "^7")
+#define COLORED_NAME_WITH_CONCAT(class, concat) strcat(rgb_to_hexcolor(NEW(class).m_color), NEW(class).m_name, " ", concat, "^7")
+// These can't be used everywhere, or else it would cause circular includes by including "class"
{
return strcat(
"^x",
- DEC_TO_HEXDIGIT(floor(rgb.x * 15 + 0.5)),
- DEC_TO_HEXDIGIT(floor(rgb.y * 15 + 0.5)),
- DEC_TO_HEXDIGIT(floor(rgb.z * 15 + 0.5))
+ DEC_TO_HEXDIGIT(floor(bound(0, rgb.x, 1) * 15 + 0.5)),
+ DEC_TO_HEXDIGIT(floor(bound(0, rgb.y, 1) * 15 + 0.5)),
+ DEC_TO_HEXDIGIT(floor(bound(0, rgb.z, 1) * 15 + 0.5))
);
}