From 15ca859aaa21422bbc9a3661ba262a71c2a55350 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Fri, 20 Dec 2024 03:09:41 +0800 Subject: [PATCH] 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. --- qcsrc/common/colors.qh | 3 +++ qcsrc/menu/xonotic/guide/description.qc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.2