From 6b1d3ecfd70b811e74100db71cbd5b433579cca2 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 14 Sep 2003 03:52:21 +0000 Subject: [PATCH] more Nexuiz hud stuff from BlackHC, minor style edits to fit in with surrounding code better git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3459 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 11 +++++----- client.h | 2 ++ quakedef.h | 33 ++++++++++++++-------------- sbar.c | 64 +++++++++++++++++++++++++++++++++++++++++------------- sv_main.c | 2 +- 5 files changed, 75 insertions(+), 37 deletions(-) diff --git a/cl_parse.c b/cl_parse.c index 38de3397..c208a7b9 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -807,11 +807,12 @@ void CL_ParseClientdata (int bits) cl.stats[STAT_CELLS] = MSG_ReadByte(); i = MSG_ReadByte (); - - if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE) - cl.stats[STAT_ACTIVEWEAPON] = (1<name, w_width * w_scale, w_height * w_scale, (active) ? 1 : 0.6, active ? 1 : 0.6, active ? 1 : 1, fade, DRAWFLAG_ADDITIVE); + DrawQ_String(vid.conwidth - (w_space + font_size ), (w_height + w_space) * w_scale * nr + w_space, va("%i",nr+1), 0, font_size, font_size, 1, 0, 0, fade, 0); + + if (active) + DrawQ_Fill(vid.conwidth - (w_width + w_space) * w_scale, (w_height + w_space) * w_scale * nr + w_space, w_width * w_scale, w_height * w_scale, 0.3, 0.3, 0.3, fade, DRAWFLAG_ADDITIVE); +} + /* =============== Sbar_DrawInventory @@ -451,10 +469,34 @@ Sbar_DrawInventory */ void Sbar_DrawInventory (void) { - int i; - char num[6]; - float time; - int flashon; + int i; + char num[6]; + float time; + int flashon; + // AK 2003 + float fade; + + if(gamemode == GAME_NEXUIZ) + { + num[0] = cl.stats[STAT_ACTIVEWEAPON]; + // we have a max time 2s (min time = 0) + if ((time = cl.time - cl.weapontime) > 2) + return; + + fade = (1.0 - 0.5 * time); + fade *= fade; + for (i = 0; i < 8;i++) + { + if (!(cl.items & (1 << i))) + continue; + Sbar_DrawWeapon(i + 1, fade, (i == num[0])); + } + + if(!(cl.items & (1<<12))) + return; + Sbar_DrawWeapon(0, fade, (num[0] == 12)); + return; + } if (gamemode == GAME_ROGUE) { @@ -791,16 +833,13 @@ void Sbar_Draw (void) return; } - if(gamemode == GAME_NEXUIZ) + if (gamemode == GAME_NEXUIZ) { sbar_y = vid.conheight - 47; sbar_x = (vid.conwidth - 640)/2; if (sb_lines > 24) - { - if (!cl.islocalgame) - Sbar_DrawFrags (); - } + Sbar_DrawFrags (); if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) { @@ -838,12 +877,7 @@ void Sbar_Draw (void) //Sbar_DrawAlphaPic(0,0,sb_sbar_overlay,0.5); DrawQ_Pic(sbar_x,sbar_y,sb_sbar_overlay->name,0,0,1,1,1,1,DRAWFLAG_MODULATE); - } - - if (vid.conwidth > 320 && cl.gametype == GAME_DEATHMATCH) - Sbar_MiniDeathmatchOverlay (); - } else { diff --git a/sv_main.c b/sv_main.c index df5dd141..109f87ff 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1275,7 +1275,7 @@ void SV_WriteClientdataToMessage (edict_t *ent, sizebuf_t *msg) MSG_WriteByte (msg, ent->v->ammo_rockets); MSG_WriteByte (msg, ent->v->ammo_cells); - if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE) + if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_NEXUIZ) { for(i=0;i<32;i++) { -- 2.39.2