From f8858db42895e885ab87ebc74a0fd2165612bb42 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 3 Feb 2013 02:18:30 +0200 Subject: [PATCH] Make player color indicator textures part of the HUD as well --- .../{ => hud/default}/sb_playercolor_base.tga | Bin .../default}/sb_playercolor_pants.tga | Bin .../default}/sb_playercolor_shirt.tga | Bin data/hudVT.cfg | 2 +- data/qcsrc/client/hud.qc | 30 +++++++++--------- 5 files changed, 16 insertions(+), 16 deletions(-) rename data/gfx/{ => hud/default}/sb_playercolor_base.tga (100%) rename data/gfx/{ => hud/default}/sb_playercolor_pants.tga (100%) rename data/gfx/{ => hud/default}/sb_playercolor_shirt.tga (100%) diff --git a/data/gfx/sb_playercolor_base.tga b/data/gfx/hud/default/sb_playercolor_base.tga similarity index 100% rename from data/gfx/sb_playercolor_base.tga rename to data/gfx/hud/default/sb_playercolor_base.tga diff --git a/data/gfx/sb_playercolor_pants.tga b/data/gfx/hud/default/sb_playercolor_pants.tga similarity index 100% rename from data/gfx/sb_playercolor_pants.tga rename to data/gfx/hud/default/sb_playercolor_pants.tga diff --git a/data/gfx/sb_playercolor_shirt.tga b/data/gfx/hud/default/sb_playercolor_shirt.tga similarity index 100% rename from data/gfx/sb_playercolor_shirt.tga rename to data/gfx/hud/default/sb_playercolor_shirt.tga diff --git a/data/hudVT.cfg b/data/hudVT.cfg index 0572ac32..920e77bb 100644 --- a/data/hudVT.cfg +++ b/data/hudVT.cfg @@ -1,7 +1,7 @@ // Only some HUD components can be customized here at the time. // Components left to do: Portrait, Sbar ring, "HUD disabled" warnings, some race timers, some spectator messages. -set hud_style default // which subfolder to use for HUD images in gfx/hud/ +set hud_style "default" // which subfolder to use for HUD images in gfx/hud/ set hud_backgrounds 4 // total number of backgrounds defined set hud_background_1_texture "bg_status" diff --git a/data/qcsrc/client/hud.qc b/data/qcsrc/client/hud.qc index f5f9cf17..cd392262 100644 --- a/data/qcsrc/client/hud.qc +++ b/data/qcsrc/client/hud.qc @@ -625,6 +625,12 @@ void Cmd_Sbar_SetFields(float argc) sbar_field[sbar_num_fields] = SP_END; } +string Sbar_GetTexture(string img) +{ + string path = cvar_string("hud_style"); + return strcat("gfx/hud/", path, "/", img); +} + // MOVEUP:: vector sbar_field_rgb; string sbar_field_icon0; @@ -686,10 +692,10 @@ string Sbar_GetField(entity pl, float field) { f = stof(getplayerkey(pl.sv_entnum, "colors")); { - sbar_field_icon0 = "gfx/sb_playercolor_base"; - sbar_field_icon1 = "gfx/sb_playercolor_shirt"; + sbar_field_icon0 = Sbar_GetTexture("sb_playercolor_base"); + sbar_field_icon1 = Sbar_GetTexture("sb_playercolor_shirt"); sbar_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0); - sbar_field_icon2 = "gfx/sb_playercolor_pants"; + sbar_field_icon2 = Sbar_GetTexture("sb_playercolor_pants"); sbar_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1); } } @@ -801,12 +807,6 @@ vector Sbar_ColorFade(vector target_color) return colorfade_current; } -string Sbar_GetTexture(string img) -{ - string path = cvar_string("hud_style"); - return strcat("gfx/hud/", path, "/", img); -} - float xmin, xmax, ymin, ymax, sbwidth; float sbar_fixscoreboardcolumnwidth_len; float sbar_fixscoreboardcolumnwidth_iconlen; @@ -1047,9 +1047,9 @@ void Sbar_PrintStomachboardItem(entity pl, vector position, vector dimensions) sz_x = dimensions_x * cvar("hud_item_preylist_colors_length"); f = stof(getplayerkey(pl.sv_entnum, "colors")); - drawpic(pos, "gfx/sb_playercolor_base", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(pos, "gfx/sb_playercolor_shirt", sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(pos, "gfx/sb_playercolor_pants", sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, Sbar_GetTexture("sb_playercolor_base"), sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, Sbar_GetTexture("sb_playercolor_shirt"), sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, Sbar_GetTexture("sb_playercolor_pants"), sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL); pos_x = position_x + dimensions_x * cvar("hud_item_preylist_name_location"); sz_x = dimensions_x * cvar("hud_item_preylist_name_length"); @@ -1109,9 +1109,9 @@ void Sbar_PrintStomachboardItemPred(entity pl, vector position, vector dimension pos_x = position_x + dimensions_x * cvar("hud_item_predator_colors_location"); sz_x = dimensions_x * cvar("hud_item_predator_colors_length"); f = stof(getplayerkey(pl.sv_entnum, "colors")); - drawpic(pos, "gfx/sb_playercolor_base", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(pos, "gfx/sb_playercolor_shirt", sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(pos, "gfx/sb_playercolor_pants", sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, Sbar_GetTexture("sb_playercolor_base"), sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, Sbar_GetTexture("sb_playercolor_shirt"), sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, Sbar_GetTexture("sb_playercolor_pants"), sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL); pos_x = position_x + dimensions_x * cvar("hud_item_predator_name_location"); sz_x = dimensions_x * cvar("hud_item_predator_name_length"); -- 2.39.2