From: MirceaKitsune Date: Sun, 3 Feb 2013 00:18:30 +0000 (+0200) Subject: Make player color indicator textures part of the HUD as well X-Git-Url: https://git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=f8858db42895e885ab87ebc74a0fd2165612bb42 Make player color indicator textures part of the HUD as well --- diff --git a/data/gfx/hud/default/sb_playercolor_base.tga b/data/gfx/hud/default/sb_playercolor_base.tga new file mode 100644 index 00000000..645457dc Binary files /dev/null and b/data/gfx/hud/default/sb_playercolor_base.tga differ diff --git a/data/gfx/hud/default/sb_playercolor_pants.tga b/data/gfx/hud/default/sb_playercolor_pants.tga new file mode 100644 index 00000000..608f96fa Binary files /dev/null and b/data/gfx/hud/default/sb_playercolor_pants.tga differ diff --git a/data/gfx/hud/default/sb_playercolor_shirt.tga b/data/gfx/hud/default/sb_playercolor_shirt.tga new file mode 100644 index 00000000..61ad4da9 Binary files /dev/null and b/data/gfx/hud/default/sb_playercolor_shirt.tga differ diff --git a/data/gfx/sb_playercolor_base.tga b/data/gfx/sb_playercolor_base.tga deleted file mode 100644 index 645457dc..00000000 Binary files a/data/gfx/sb_playercolor_base.tga and /dev/null differ diff --git a/data/gfx/sb_playercolor_pants.tga b/data/gfx/sb_playercolor_pants.tga deleted file mode 100644 index 608f96fa..00000000 Binary files a/data/gfx/sb_playercolor_pants.tga and /dev/null differ diff --git a/data/gfx/sb_playercolor_shirt.tga b/data/gfx/sb_playercolor_shirt.tga deleted file mode 100644 index 61ad4da9..00000000 Binary files a/data/gfx/sb_playercolor_shirt.tga and /dev/null differ 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");