From: MirceaKitsune Date: Sat, 4 Sep 2010 23:42:05 +0000 (+0300) Subject: Put the eater name in a different function X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d03d24e8d53b46e9afb7487222f269863a08d81e;p=voretournament%2Fvoretournament.git Put the eater name in a different function --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index f5a1a507..a0ed0ab2 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -949,6 +949,8 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num float fieldcounter; void Sbar_PrintStomachboardItem(vector pos, entity pl) { + // list the players in the stomach + string str; float f, field; @@ -979,7 +981,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) } if(field == ST_HEALTH) - if(g_vore_showpreyhealth && stof(str)) { // only if player health is not 0. Also used to hide the predators health + if(g_vore_showpreyhealth) { pos_x += 138; if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1)) drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); @@ -994,6 +996,34 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) } } +float fieldcounter2; +void Sbar_PrintStomachboardItem2(vector pos, entity pl) +{ + // show the name of our eater + + string str; + float f, field; + + for(fieldcounter2 = 1; fieldcounter2 <= 2; ++fieldcounter2) + { + field = -fieldcounter2; + if(field == SP_SEPARATOR) + break; + + str = Sbar_GetStomachField(pl, field); + + if(field == ST_NAME) { + f = stof(getplayerkey(pl.sv_entnum, "colors")); + drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL); + + pos_x += 24; + drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + } + } +} + /* * Sbar_Scoreboard_MakeTable * @@ -2979,7 +3009,7 @@ void Sbar_Draw (void) if(getstati(STAT_STOMACH_EATEN)) if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1) - Sbar_PrintStomachboardItem(bottomleft - '-76 156 0', pl); + Sbar_PrintStomachboardItem2(bottomleft - '-76 156 0', pl); } if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {