From: otta8634 Date: Thu, 19 Dec 2024 19:09:41 +0000 (+0800) Subject: Allow colored text to be used in guide descriptions X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=15ca859aaa21422bbc9a3661ba262a71c2a55350;p=xonotic%2Fxonotic-data.pk3dir.git Allow colored text to be used in guide descriptions Not too sure why it was disabled. Also added a useful macro to get the colored name of a class. --- diff --git a/qcsrc/common/colors.qh b/qcsrc/common/colors.qh index 610db5094..48bf30453 100644 --- a/qcsrc/common/colors.qh +++ b/qcsrc/common/colors.qh @@ -79,3 +79,6 @@ const vector COLOR_STATUSEFFECT_BURNING = '1 0.62 0'; const vector COLOR_STATUSEFFECT_SPAWNSHIELD = '0.36 1 0.07'; 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 +#define COLORED_NAME(class) strcat(rgb_to_hexcolor(NEW(class).m_color), NEW(class).m_name, "^7") diff --git a/qcsrc/menu/xonotic/guide/description.qc b/qcsrc/menu/xonotic/guide/description.qc index ae81664e2..64ab10840 100644 --- a/qcsrc/menu/xonotic/guide/description.qc +++ b/qcsrc/menu/xonotic/guide/description.qc @@ -3,7 +3,7 @@ void XonoticGuideDescription_drawListBoxItem(entity this, int i, vector absSize, bool isSelected, bool isFocused) { tokenizebyseparator(this.descriptionWrapped, "\n"); - draw_Text(this.realUpperMargin * eY, argv(i), this.realFontSize, '1 1 1', 1, 0); + draw_Text(this.realUpperMargin * eY, argv(i), this.realFontSize, '1 1 1', 1, true); } void XonoticGuideDescription_setDescription(entity this, string desc)