]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Make player color indicator textures part of the HUD as well
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 3 Feb 2013 00:18:30 +0000 (02:18 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 3 Feb 2013 00:18:30 +0000 (02:18 +0200)
data/gfx/hud/default/sb_playercolor_base.tga [new file with mode: 0644]
data/gfx/hud/default/sb_playercolor_pants.tga [new file with mode: 0644]
data/gfx/hud/default/sb_playercolor_shirt.tga [new file with mode: 0644]
data/gfx/sb_playercolor_base.tga [deleted file]
data/gfx/sb_playercolor_pants.tga [deleted file]
data/gfx/sb_playercolor_shirt.tga [deleted file]
data/hudVT.cfg
data/qcsrc/client/hud.qc

diff --git a/data/gfx/hud/default/sb_playercolor_base.tga b/data/gfx/hud/default/sb_playercolor_base.tga
new file mode 100644 (file)
index 0000000..645457d
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 (file)
index 0000000..608f96f
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 (file)
index 0000000..61ad4da
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 (file)
index 645457d..0000000
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 (file)
index 608f96f..0000000
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 (file)
index 61ad4da..0000000
Binary files a/data/gfx/sb_playercolor_shirt.tga and /dev/null differ
index 0572ac325a8fefd27ee0ebb4c07cfe458e1b93d7..920e77bbfff3d51913943b466419b19b3248f180 100644 (file)
@@ -1,7 +1,7 @@
 // Only some HUD components can be customized here at the time.\r
 // Components left to do: Portrait, Sbar ring, "HUD disabled" warnings, some race timers, some spectator messages.\r
 \r
-set hud_style default // which subfolder to use for HUD images in gfx/hud/\r
+set hud_style "default" // which subfolder to use for HUD images in gfx/hud/\r
 \r
 set hud_backgrounds 4 // total number of backgrounds defined\r
 set hud_background_1_texture "bg_status"\r
index f5f9cf17e2b1c8d78d858480bc7857e981dee81f..cd3922623a5dd6e65fe5673709b5255cef49f72c 100644 (file)
@@ -625,6 +625,12 @@ void Cmd_Sbar_SetFields(float argc)
        sbar_field[sbar_num_fields] = SP_END;\r
 }\r
 \r
+string Sbar_GetTexture(string img)\r
+{\r
+       string path = cvar_string("hud_style");\r
+       return strcat("gfx/hud/", path, "/", img);\r
+}\r
+\r
 // MOVEUP::\r
 vector sbar_field_rgb;\r
 string sbar_field_icon0;\r
@@ -686,10 +692,10 @@ string Sbar_GetField(entity pl, float field)
                        {\r
                                f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
                                {\r
-                                       sbar_field_icon0 = "gfx/sb_playercolor_base";\r
-                                       sbar_field_icon1 = "gfx/sb_playercolor_shirt";\r
+                                       sbar_field_icon0 = Sbar_GetTexture("sb_playercolor_base");\r
+                                       sbar_field_icon1 = Sbar_GetTexture("sb_playercolor_shirt");\r
                                        sbar_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0);\r
-                                       sbar_field_icon2 = "gfx/sb_playercolor_pants";\r
+                                       sbar_field_icon2 = Sbar_GetTexture("sb_playercolor_pants");\r
                                        sbar_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1);\r
                                }\r
                        }\r
@@ -801,12 +807,6 @@ vector Sbar_ColorFade(vector target_color)
        return colorfade_current;\r
 }\r
 \r
-string Sbar_GetTexture(string img)\r
-{\r
-       string path = cvar_string("hud_style");\r
-       return strcat("gfx/hud/", path, "/", img);\r
-}\r
-\r
 float xmin, xmax, ymin, ymax, sbwidth;\r
 float sbar_fixscoreboardcolumnwidth_len;\r
 float sbar_fixscoreboardcolumnwidth_iconlen;\r
@@ -1047,9 +1047,9 @@ void Sbar_PrintStomachboardItem(entity pl, vector position, vector dimensions)
                        sz_x = dimensions_x * cvar("hud_item_preylist_colors_length");\r
 \r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
-                       drawpic(pos, "gfx/sb_playercolor_base", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_shirt", sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_pants", sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, Sbar_GetTexture("sb_playercolor_base"), sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, Sbar_GetTexture("sb_playercolor_shirt"), sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, Sbar_GetTexture("sb_playercolor_pants"), sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                        pos_x = position_x + dimensions_x * cvar("hud_item_preylist_name_location");\r
                        sz_x = dimensions_x * cvar("hud_item_preylist_name_length");\r
@@ -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");\r
                        sz_x = dimensions_x * cvar("hud_item_predator_colors_length");\r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
-                       drawpic(pos, "gfx/sb_playercolor_base", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_shirt", sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_pants", sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, Sbar_GetTexture("sb_playercolor_base"), sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, Sbar_GetTexture("sb_playercolor_shirt"), sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, Sbar_GetTexture("sb_playercolor_pants"), sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                        pos_x = position_x + dimensions_x * cvar("hud_item_predator_name_location");\r
                        sz_x = dimensions_x * cvar("hud_item_predator_name_length");\r