cvar_t sbar_alpha_fg = {CVAR_SAVE, "sbar_alpha_fg", "1", "opacity value of the statusbar weapon/item icons and numbers"};
cvar_t sbar_hudselector = {CVAR_SAVE, "sbar_hudselector", "0", "selects which of the builtin hud layouts to use (meaning is somewhat dependent on gamemode, so nexuiz has a very different set of hud layouts than quake for example)"};
cvar_t sbar_miniscoreboard_size = {CVAR_SAVE, "sbar_miniscoreboard_size", "-1", "sets the size of the mini deathmatch overlay in items, or disables it when set to 0, or sets it to a sane default when set to -1"};
+cvar_t sbar_flagstatus_right = {CVAR_SAVE, "sbar_flagstatus_right", "0", "moves Nexuiz flag status icons to the right"};
cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1", "shows scoreboard (+showscores) while dead"};
{
int i;
- if (gamemode == GAME_NETHERWORLD)
+ if (gamemode == GAME_DELUXEQUAKE)
{
}
else if (gamemode == GAME_SOM)
Cvar_RegisterVariable(&crosshair_color_alpha);
Cvar_RegisterVariable(&crosshair_size);
+ if(gamemode == GAME_NEXUIZ)
+ Cvar_RegisterVariable(&sbar_flagstatus_right); // this cvar makes no sense in other games
+
R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
}
s = &cl.scores[k];
// draw background
- c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4];
+ c = palette_rgb_pantsscoreboard[(s->colors & 0xf0) >> 4];
DrawQ_Fill (sbar_x + x + 10, sbar_y - 23, 28, 4, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf];
+ c = palette_rgb_shirtscoreboard[s->colors & 0xf];
DrawQ_Fill (sbar_x + x + 10, sbar_y + 4 - 23, 28, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
// draw number
s = &cl.scores[cl.viewentity - 1];
// draw background
Sbar_DrawPic (112, 0, rsb_teambord);
- c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4];
+ c = palette_rgb_pantsscoreboard[(s->colors & 0xf0) >> 4];
DrawQ_Fill (sbar_x + 113, vid_conheight.integer-SBAR_HEIGHT+3, 22, 9, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf];
+ c = palette_rgb_shirtscoreboard[s->colors & 0xf];
DrawQ_Fill (sbar_x + 113, vid_conheight.integer-SBAR_HEIGHT+12, 22, 9, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
// draw number
}
else if (cl.intermission == 2)
Sbar_FinaleOverlay();
- else if (gamemode == GAME_NETHERWORLD)
+ else if (gamemode == GAME_DELUXEQUAKE)
{
}
else if (gamemode == GAME_SOM)
int i;
float fade;
int redflag, blueflag;
+ float x;
sbar_x = (vid_conwidth.integer - 320)/2;
sbar_y = vid_conheight.integer - 24 - 16;
// flag icons
redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
+ x = sbar_flagstatus_right.integer ? vid_conwidth.integer - 10 - sbar_x - 64 : 10 - sbar_x;
if (redflag == 3 && blueflag == 3)
{
// The Impossible Combination[tm]
// Can only happen in Key Hunt mode...
- Sbar_DrawPic (10 - sbar_x, -179, sb_items[14]);
+ Sbar_DrawPic (x, -179, sb_items[14]);
}
else
{
if (redflag)
- Sbar_DrawPic (10 - sbar_x, -117, sb_items[redflag+10]);
+ Sbar_DrawPic (x, -117, sb_items[redflag+10]);
if (blueflag)
- Sbar_DrawPic (10 - sbar_x, -177, sb_items[blueflag+14]);
+ Sbar_DrawPic (x, -177, sb_items[blueflag+14]);
}
// armor
if (cl.stats[STAT_ARMOR] > 0)
{
Sbar_DrawStretchPic (0, 0, sb_armor[0], sbar_alpha_fg.value, 24, 24);
- if(cl.stats[STAT_ARMOR] > 100)
- Sbar_DrawXNum(24,0,cl.stats[STAT_ARMOR],3,24,1,1,0,1,0);
- else if(cl.stats[STAT_ARMOR] > 25)
+ if(cl.stats[STAT_ARMOR] > 200)
+ Sbar_DrawXNum(24,0,cl.stats[STAT_ARMOR],3,24,0,1,0,1,0);
+ else if(cl.stats[STAT_ARMOR] > 100)
+ Sbar_DrawXNum(24,0,cl.stats[STAT_ARMOR],3,24,0.2,1,0.2,1,0);
+ else if(cl.stats[STAT_ARMOR] > 50)
Sbar_DrawXNum(24,0,cl.stats[STAT_ARMOR],3,24,0.6,0.7,0.8,1,0);
+ else if(cl.stats[STAT_ARMOR] > 25)
+ Sbar_DrawXNum(24,0,cl.stats[STAT_ARMOR],3,24,1,1,0.2,1,0);
else
Sbar_DrawXNum(24,0,cl.stats[STAT_ARMOR],3,24,0.7,0,0,1,0);
}
if (cl.stats[STAT_HEALTH] != 0)
{
Sbar_DrawStretchPic (112, 0, sb_health, sbar_alpha_fg.value, 24, 24);
- if(cl.stats[STAT_HEALTH] > 100)
- Sbar_DrawXNum(136,0,cl.stats[STAT_HEALTH],3,24,1,1,0,1,0);
- else if(cl.stats[STAT_HEALTH] > 25)
+ if(cl.stats[STAT_HEALTH] > 200)
+ Sbar_DrawXNum(136,0,cl.stats[STAT_HEALTH],3,24,0,1,0,1,0);
+ else if(cl.stats[STAT_HEALTH] > 100)
+ Sbar_DrawXNum(136,0,cl.stats[STAT_HEALTH],3,24,0.2,1,0.2,1,0);
+ else if(cl.stats[STAT_HEALTH] > 50)
Sbar_DrawXNum(136,0,cl.stats[STAT_HEALTH],3,24,0.6,0.7,0.8,1,0);
+ else if(cl.stats[STAT_HEALTH] > 25)
+ Sbar_DrawXNum(136,0,cl.stats[STAT_HEALTH],3,24,1,1,0.2,1,0);
else
Sbar_DrawXNum(136,0,cl.stats[STAT_HEALTH],3,24,0.7,0,0,1,0);
}
int i;
float fade;
int redflag, blueflag;
+ float x;
sbar_x = (vid_conwidth.integer - 640)/2;
sbar_y = vid_conheight.integer - 47;
// flag icons
redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
+ x = sbar_flagstatus_right.integer ? vid_conwidth.integer - 10 - sbar_x - 64 : 10 - sbar_x;
if (redflag == 3 && blueflag == 3)
{
// The Impossible Combination[tm]
// Can only happen in Key Hunt mode...
- Sbar_DrawPic (10 - sbar_x, -179, sb_items[14]);
+ Sbar_DrawPic (x, -179, sb_items[14]);
}
else
{
if (redflag)
- Sbar_DrawPic (10 - sbar_x, -117, sb_items[redflag+10]);
+ Sbar_DrawPic (x, -117, sb_items[redflag+10]);
if (blueflag)
- Sbar_DrawPic (10 - sbar_x, -177, sb_items[blueflag+14]);
+ Sbar_DrawPic (x, -177, sb_items[blueflag+14]);
}
// armor
//
//
//
- c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4];
+ c = palette_rgb_pantsscoreboard[(s->colors & 0xf0) >> 4];
DrawQ_Fill(x + 14*8, y+1, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf];
+ c = palette_rgb_shirtscoreboard[s->colors & 0xf];
DrawQ_Fill(x + 14*8, y+4, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
// print the text
//DrawQ_String(x, y, va("%c%4i %s", myself ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true);
else
{
// draw colors behind score
- c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4];
+ c = palette_rgb_pantsscoreboard[(s->colors & 0xf0) >> 4];
DrawQ_Fill(x + 9*8, y+1, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf];
+ c = palette_rgb_shirtscoreboard[s->colors & 0xf];
DrawQ_Fill(x + 9*8, y+4, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
// print the text
//DrawQ_String(x, y, va("%c%4i %s", myself ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true);
MSG_WriteByte(&cls.netcon->message, qw_clc_stringcmd);
MSG_WriteString(&cls.netcon->message, "pings");
}
- else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6/* || cls.protocol == PROTOCOL_DARKPLACES7*/)
+ else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6/* || cls.protocol == PROTOCOL_DARKPLACES7*/)
{
// these servers usually lack the pings command and so a less efficient "ping" command must be sent, which on modern DP servers will also reply with a pingplreport command after the ping listing
static int ping_anyway_counter = 0;
for(i = 0; i < teamlines; ++i)
{
int cindex = teamcolorsort[i]->colors & 15;
- unsigned char *c = (unsigned char *)&palette_shirtscoreboard[cindex];
+ unsigned char *c = palette_rgb_shirtscoreboard[cindex];
float cm = max(max(c[0], c[1]), c[2]);
float cr = c[0] / cm;
float cg = c[1] / cm;