From: Mario Date: Sun, 12 Feb 2017 01:13:31 +0000 (+1000) Subject: Colorize vote and race record names when they're used instead of zoning them with... X-Git-Tag: xonotic-v0.8.2~230 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b458797b891e91c3035c5333d6fcea9fc4bda50a;p=xonotic%2Fxonotic-data.pk3dir.git Colorize vote and race record names when they're used instead of zoning them with the color (allows toggling stripcolorcodes) --- diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index 02b631b30..5efbd00ce 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -71,7 +71,7 @@ string MakeRaceString(int cp, float mytime, float theirtime, float lapdelta, str else if(theirname == "") return strcat(col, sprintf("%s (%s)", cpname, timestr)); else - return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(theirname, col, lapstr))); + return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(ColorTranslateRGB(theirname), col, lapstr))); } void HUD_RaceTimer () diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index 1c2ea03bc..d974bee4b 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -116,7 +116,7 @@ void HUD_Vote() if(uid2name_dialog) s = _("Allow servers to store and display your name?"); drawstring_aspect(pos, s, eX * mySize.x + eY * (2/8) * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - s = textShortenToWidth(vote_called_vote, mySize.x, '1 1 0' * mySize.y * (1/8), stringwidth_colors); + s = textShortenToWidth(ColorTranslateRGB(vote_called_vote), mySize.x, '1 1 0' * mySize.y * (1/8), stringwidth_colors); if(autocvar__hud_configure) s = _("^1Configure the HUD"); drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize.y, s, eX * mySize.x + eY * (1.75/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 9a6c25c35..4fbb2f282 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -567,7 +567,7 @@ NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew) { if(vote_called_vote) strunzone(vote_called_vote); - vote_called_vote = strzone(ColorTranslateRGB(ReadString())); + vote_called_vote = strzone(ReadString()); } if(nags & 1) @@ -1033,7 +1033,7 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) race_previousbesttime = ReadInt24_t(); if(race_previousbestname) strunzone(race_previousbestname); - race_previousbestname = strzone(ColorTranslateRGB(ReadString())); + race_previousbestname = strzone(ReadString()); race_checkpointtime = time; @@ -1060,7 +1060,7 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) race_nextbesttime = ReadInt24_t(); if(race_nextbestname) strunzone(race_nextbestname); - race_nextbestname = strzone(ColorTranslateRGB(ReadString())); + race_nextbestname = strzone(ReadString()); break; case RACE_NET_CHECKPOINT_HIT_RACE: @@ -1072,7 +1072,7 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) race_mycheckpointlapsdelta -= 256; if(race_mycheckpointenemy) strunzone(race_mycheckpointenemy); - race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString())); + race_mycheckpointenemy = strzone(ReadString()); break; case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT: @@ -1084,7 +1084,7 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) race_othercheckpointlapsdelta -= 256; if(race_othercheckpointenemy) strunzone(race_othercheckpointenemy); - race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString())); + race_othercheckpointenemy = strzone(ReadString()); break; case RACE_NET_PENALTY_RACE: