seta hud_skin old "skin folder where to look for images"
seta hud_bg 0 "default background for the panels, file must exist in gfx/hud/[skin name]/, 0 = disable background by default"
-seta hud_bg_color "0 0.6 0.9" "default background color for the panels"
+seta hud_bg_color "0 0.6 0.9" "default background color for the panels, accepts \"shirt\" and \"pants\""
seta hud_bg_alpha 0.8 "default alpha of the background"
seta hud_bg_border 10 "default border size for the panels"
seta hud_bg_padding 0 "default padding of contents from the border"
seta hud_configure_grid_y 10 "snap each Y pixels"
seta hud_dock "dock" "enable a fullscreen background for the hud, useful for creating artificial docks, \"\" = disable"
-seta hud_dock_color "0 0.6 0.9" "dock color"
+seta hud_dock_color "0 0.6 0.9" "dock color, accepts \"shirt\" and \"pants\""
seta hud_dock_alpha 0.8 "alpha of the dock"
seta sbar_info_pos 50
break;
case 3:
if(cvar("hud_healtharmor") == 2)
- mySize_y = 0.23 * mySize_x; // 0.32 * width, trial and error...
+ mySize_y = 0.23 * mySize_x; // 0.23 * width, trial and error...
break;
case 5:
mySize_y = (1/4.1) * mySize_x; // 1/4.1 * width, trial and error...
vector HUD_Panel_GetColor(float id)
{
- // TODO: idea: let user choose colors "pants", "shirt"
+ float f;
+ vector color_vec;
string color;
color = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color"));
- if(color == "")
+ color_vec = stov(color);
+ if(color == "") {
color = cvar_string("hud_bg_color");
- return stov(color);
+ color_vec = stov(color);
+ if(color == "shirt") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(color == "pants") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1);
+ }
+ }
+ else if(color == "shirt") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(color == "pants") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1);
+ }
+ return color_vec;
+}
+
+vector HUD_Panel_Dock_GetColor(void)
+{
+ float f;
+ vector color_vec;
+ string color;
+ color = cvar_string("hud_dock_color");
+ color_vec = stov(color);
+ if(color == "shirt") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(floor(f / 16), 0);
+ }
+ else if(color == "pants") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1);
+ }
+ return color_vec;
}
float HUD_Panel_GetAlpha(float id)
// Drawing stuff
if(cvar_string("hud_dock") != "")
- drawpic_skin('0 0 0', cvar_string("hud_dock"), eX * vid_conwidth + eY * vid_conheight, stov(cvar_string("hud_dock_color")), cvar("hud_dock_alpha"), DRAWFLAG_NORMAL);
+ drawpic_skin('0 0 0', cvar_string("hud_dock"), eX * vid_conwidth + eY * vid_conheight, HUD_Panel_Dock_GetColor(), cvar("hud_dock_alpha"), DRAWFLAG_NORMAL);
if(HUD_Panel_CheckActive(0))
HUD_WeaponIcons();