From 0d01e3de34581637a116ec7634eff88e97fc694c Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Thu, 26 Dec 2019 14:45:34 +0000 Subject: [PATCH] Allow color codes to be used in campaign level titles and descriptions --- qcsrc/menu/xonotic/campaign.qc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qcsrc/menu/xonotic/campaign.qc b/qcsrc/menu/xonotic/campaign.qc index a3ad36355..ff7110464 100644 --- a/qcsrc/menu/xonotic/campaign.qc +++ b/qcsrc/menu/xonotic/campaign.qc @@ -30,7 +30,7 @@ void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize) getWrappedLine_remaining = s; while(getWrappedLine_remaining) { - s = getWrappedLine(w, theFontSize, draw_TextWidth_WithoutColors); + s = getWrappedLine(w, theFontSize, stringwidth_colors); if(--l < 0) goto toolong; r = strcat(r, s, "\n"); } @@ -232,8 +232,8 @@ void XonoticCampaignList_drawListBoxItem(entity me, int i, vector absSize, bool s = campaign_shortdesc[i]; // fteqcc sucks else s = "???"; - s = draw_TextShortenToWidth(sprintf(_("Level %d: %s"), i+1, s), me.columnNameSize, 0, me.realFontSize); - draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 0); + s = draw_TextShortenToWidth(sprintf(_("Level %d: %s"), i+1, s), me.columnNameSize, 1, me.realFontSize); + draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 1, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 1); if(i <= me.campaignIndex) { @@ -243,7 +243,7 @@ void XonoticCampaignList_drawListBoxItem(entity me, int i, vector absSize, bool for(j = 0; j < n; ++j) if(argv(j) != "") { - draw_Text(o, argv(j), me.realFontSize, theColor, theAlpha * SKINALPHA_CAMPAIGN_DESCRIPTION, 0); + draw_Text(o, argv(j), me.realFontSize, theColor, theAlpha * SKINALPHA_CAMPAIGN_DESCRIPTION, 1); o.y += me.realFontSize.y; } else -- 2.39.2