]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Partial attempt at porting the stomach board list to the new system. This commit...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 May 2012 11:18:41 +0000 (14:18 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 May 2012 11:18:41 +0000 (14:18 +0300)
data/hudVT.cfg
data/qcsrc/client/hud.qc

index d0b107ae04fcf831eaed2b712492618a5af6c95d..7072a139c2972c91007d7bf09f801cd774e7dc32 100644 (file)
@@ -21,4 +21,8 @@ set hud_item_ammo_noload_text_scale 16
 set hud_item_ammo_load_text_position "0.015 -0.935 0"\r
 set hud_item_ammo_load_text_scale 12\r
 set hud_item_clip_load_text_position "0.03 -0.89 0"\r
-set hud_item_clip_load_text_scale 16
\ No newline at end of file
+set hud_item_clip_load_text_scale 16\r
+\r
+set hud_item_preylist_position "0 0 0"\r
+set hud_item_preylist_scale "0.25 0.25 0"\r
+set hud_item_preylist_items 9
\ No newline at end of file
index 2b01044cab9d027db2b105cbb61a70faa3d552d4..e81da42c0fbfc2d715b456a0cdbc11ab97e517bb 100644 (file)
@@ -950,7 +950,7 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num
 }\r
 \r
 float fieldcounter;\r
-void Sbar_PrintStomachboardItem(vector pos, entity pl)\r
+void Sbar_PrintStomachboardItem(entity pl, vector position, vector dimensions)\r
 {\r
        // lists all players in the stomach\r
 \r
@@ -961,12 +961,16 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
 \r
        for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter)\r
        {\r
+               vector pos, sz;\r
                field = -fieldcounter;\r
                str = Sbar_GetStomachField(pl, field);\r
 \r
                // row highlighting\r
                if(field == ST_HIGHLIGHT)\r
                {\r
+                       pos = position;\r
+                       sz = dimensions;\r
+\r
                        if(getstati(STAT_VORE_EATEN))\r
                        {\r
                                if(teamplay && (GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1) || GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(spectatee_status - 1))) // same team\r
@@ -976,36 +980,43 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                        }\r
                        else\r
                                hl_color = stov(cvar_string("sbar_stomachboard_color1"));\r
-                       drawfill(pos - '0 0 0', '193 11 0', hl_color, cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawfill(pos, sz, hl_color, cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
                if(field == ST_NAME) {\r
+                       pos_x = position_x / 9;\r
+                       sz_x = dimensions_x / 9;\r
+\r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
-                       drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\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
 \r
-                       pos_x += 24;\r
-                       drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       pos_x = position_x / 4;\r
+                       sz_x = dimensions_x / 4;\r
+                       drawcolorcodedstring(pos, textShortenToWidth(str, sz_x, '1 1 0' * sz_y, stringwidth_colors), '1 1 0' * sz_y, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
                if(field == ST_HEALTH) {\r
-                       pos_x += 138;\r
-                               if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
-                                       drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                               else\r
-                               {\r
-                                       drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       pos_x = position_x / 1.05;\r
+                       sz_x = sz_y = dimensions_y;\r
 \r
-                                       pos_x += 9;\r
-                                               drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                               }\r
+                       if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
+                               drawcolorcodedstring(pos, "self", sz, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       else\r
+                       {\r
+                               drawpic(pos, "gfx/hud/sb_health", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+                               pos_x = position_x / 1.05;\r
+                               sz_x = sz_y = dimensions_y;\r
+                               drawcolorcodedstring(pos, str, sz, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       }\r
                }\r
        }\r
 }\r
 \r
 float fieldcounter2;\r
-void Sbar_PrintStomachboardItemPred(vector pos, entity pl)\r
+void Sbar_PrintStomachboardItemPred(entity pl, vector position, vector dimensions)\r
 {\r
        // shows the name of our predator\r
 \r
@@ -1020,12 +1031,12 @@ void Sbar_PrintStomachboardItemPred(vector pos, entity pl)
 \r
                if(field == STP_NAME) {\r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
-                       drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(position, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(position, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(position, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
-                       pos_x += 24;\r
-                       drawcolorcodedstring(pos, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       //pos_x += 24;\r
+                       drawcolorcodedstring(position, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
        }\r
 }\r
@@ -3256,7 +3267,7 @@ void Sbar_Draw (void)
                                {\r
                                        if(l <= 8) // limit the stomach board to 9 entries due to the HUD design\r
                                        {\r
-                                               Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
+                                               Sbar_PrintStomachboardItem(pl, stov(cvar_string("hud_item_preylist_position")), stov(cvar_string("hud_item_preylist_scale")));\r
                                                pos_y += 1.1 * sbar_fontsize_y;\r
                                                l += 1;\r
                                        }\r
@@ -3274,7 +3285,7 @@ void Sbar_Draw (void)
                        }\r
 \r
                        // draw the predator's name\r
-                       Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred);\r
+//                     Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred);\r
                }\r
 \r
                // draw status, scores, timer, ring and portrait\r