From: FruitieX Date: Fri, 2 Jul 2010 16:55:03 +0000 (+0300) Subject: fix colors X-Git-Tag: xonotic-v0.1.0preview~457^2~32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cbd9bf61c4d1b6fbdad0dd7896a862a57d4f046b;p=xonotic%2Fxonotic-data.pk3dir.git fix colors --- diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 9520990d3..76a93b45a 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -78,6 +78,7 @@ var float panel_accuracy_alreadyvoted_alpha; // ---------------------- // Little help for the poor people who have to make sense of this: Start from the bottom +// TODO: shirt, pants, team colors #define HUD_Panel_GetProgressBarColor(item) \ switch(item) {\ case "strength": progressbar_color = autocvar_hud_progressbar_strength_color; break;\ @@ -105,15 +106,19 @@ if(!autocvar__hud_configure && panel_bg_str == "0") {\ // Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector. #define HUD_Panel_GetColor()\ -if(panel_bg_color_str == "") {\ - panel_bg_color = autocvar_hud_bg_color;\ -} if(teamplay && panel_bg_color_team) {\ +if(teamplay && panel_bg_color_team) {\ panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(player_localentnum - 1, "colors")), 16), 1) * panel_bg_color_team;\ } else {\ - if(panel_bg_color_str == "shirt") {\ - panel_bg_color = colormapPaletteColor(floor(stof(getplayerkey(player_localentnum - 1, "colors")) / 16), 0);\ - } else if(panel_bg_color_str == "pants") {\ - panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(player_localentnum - 1, "colors")), 16), 1);\ + if(panel_bg_color_str == "") {\ + panel_bg_color = autocvar_hud_bg_color;\ + } else {\ + if(panel_bg_color_str == "shirt") {\ + panel_bg_color = colormapPaletteColor(floor(stof(getplayerkey(player_localentnum - 1, "colors")) / 16), 0);\ + } else if(panel_bg_color_str == "pants") {\ + panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(player_localentnum - 1, "colors")), 16), 1);\ + } else {\ + panel_bg_color = stov(panel_bg_color_str);\ + }\ }\ }