rename cl_overlay_gravity to cl_scoreboard_gravity, rename the hud/sbar,

stuff from cl_* to hud_*, add hud_scoreboard_gravity to nq.
This commit is contained in:
Bill Currie 2003-05-09 20:30:50 +00:00
parent aaba7260e9
commit 31db390df5
6 changed files with 76 additions and 41 deletions

View file

@ -258,7 +258,7 @@ extern struct cvar_s *cl_autofire;
extern struct cvar_s *cl_shownet;
extern struct cvar_s *cl_nolerp;
extern struct cvar_s *cl_sbar;
extern struct cvar_s *hud_sbar;
extern struct cvar_s *cl_pitchdriftspeed;
extern struct cvar_s *lookspring;

View file

@ -655,7 +655,7 @@ V_CalcRefdef (void)
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
if (cl_sbar->int_val == 0 && scr_viewsize->int_val >= 100)
if (hud_sbar->int_val == 0 && scr_viewsize->int_val >= 100)
;
else if (scr_viewsize->int_val == 110)
view->origin[2] += 1;

View file

@ -93,10 +93,9 @@ int hipweapons[4] =
{ HIT_LASER_CANNON_BIT, HIT_MJOLNIR_BIT, 4, HIT_PROXIMITY_GUN_BIT };
qpic_t *hsb_items[2]; // MED 01/04/97 added hipnotic items array
qboolean sbar_centered;
cvar_t *cl_sbar;
cvar_t *cl_hudswap;
cvar_t *hud_sbar;
cvar_t *hud_swap;
cvar_t *hud_scoreboard_gravity;
static view_t *sbar_view;
static view_t *sbar_inventory_view;
@ -111,7 +110,7 @@ static view_t *overlay_view;
static view_t *stuff_view;
static void
cl_hudswap_f (cvar_t *var)
hud_swap_f (cvar_t *var)
{
if (var->int_val) {
hud_armament_view->gravity = grav_southwest;
@ -129,6 +128,35 @@ cl_hudswap_f (cvar_t *var)
view_move (stuff_view, stuff_view->xpos, stuff_view->ypos);
}
static void
hud_scoreboard_gravity_f (cvar_t *var)
{
grav_t grav;
if (strequal (var->string, "center"))
grav = grav_center;
else if (strequal (var->string, "northwest"))
grav = grav_northwest;
else if (strequal (var->string, "north"))
grav = grav_north;
else if (strequal (var->string, "northeast"))
grav = grav_northeast;
else if (strequal (var->string, "west"))
grav = grav_west;
else if (strequal (var->string, "east"))
grav = grav_east;
else if (strequal (var->string, "southwest"))
grav = grav_southwest;
else if (strequal (var->string, "south"))
grav = grav_south;
else if (strequal (var->string, "southeast"))
grav = grav_southeast;
else
grav = grav_center;
overlay_view->gravity = grav;
view_move (overlay_view, overlay_view->xpos, overlay_view->ypos);
}
static void
calc_sb_lines (cvar_t *var)
{
@ -163,7 +191,7 @@ calc_sb_lines (cvar_t *var)
}
static void
cl_sbar_f (cvar_t *var)
hud_sbar_f (cvar_t *var)
{
vid.recalc_refdef = true;
if (scr_viewsize)
@ -186,8 +214,8 @@ static void
viewsize_f (cvar_t *var)
{
calc_sb_lines (var);
if (cl_sbar)
r_lineadj = cl_sbar->int_val ? sb_lines : 0;
if (hud_sbar)
r_lineadj = hud_sbar->int_val ? sb_lines : 0;
}
@ -998,7 +1026,7 @@ Sbar_Draw (void)
sbar_view->visible = 0;
headsup = !(cl_sbar->int_val || scr_viewsize->int_val < 100);
headsup = !(hud_sbar->int_val || scr_viewsize->int_val < 100);
if ((sb_updates >= vid.numpages) && !headsup)
return;
@ -1676,8 +1704,14 @@ Sbar_Init (void)
}
r_viewsize_callback = viewsize_f;
cl_sbar = Cvar_Get ("cl_sbar", "0", CVAR_ARCHIVE, cl_sbar_f,
"status bar mode");
cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, cl_hudswap_f,
"new HUD on left side?");
hud_sbar = Cvar_Get ("hud_sbar", "0", CVAR_ARCHIVE, hud_sbar_f,
"status bar mode");
hud_swap = Cvar_Get ("hud_swap", "0", CVAR_ARCHIVE, hud_swap_f,
"new HUD on left side?");
hud_scoreboard_gravity = Cvar_Get ("hud_scoreboard_gravity", "center",
CVAR_ARCHIVE, hud_scoreboard_gravity_f,
"control placement of scoreboard "
"overlay: center, northwest, north, "
"northeast, west, east, southwest, "
"south, southeast");
}

View file

@ -310,9 +310,9 @@ extern struct cvar_s *cl_pitchspeed;
extern struct cvar_s *cl_anglespeedkey;
extern struct cvar_s *cl_shownet;
extern struct cvar_s *cl_sbar;
extern struct cvar_s *cl_sbar_separator;
extern struct cvar_s *cl_hudswap;
extern struct cvar_s *hud_sbar;
extern struct cvar_s *hud_sbar_separator;
extern struct cvar_s *hud_swap;
extern struct cvar_s *cl_pitchdriftspeed;
extern struct cvar_s *lookspring;

View file

@ -657,7 +657,7 @@ V_CalcRefdef (void)
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
if (cl_sbar->int_val == 0 && scr_viewsize->int_val >= 100)
if (hud_sbar->int_val == 0 && scr_viewsize->int_val >= 100)
;
else if (scr_viewsize->int_val == 110)
view->origin[2] += 1;

View file

@ -96,10 +96,10 @@ static qboolean largegame = false;
cvar_t *cl_showscoresuid;
cvar_t *fs_fraglog;
cvar_t *cl_fraglog;
cvar_t *cl_sbar;
cvar_t *cl_sbar_separator;
cvar_t *cl_hudswap;
cvar_t *cl_overlay_gravity;
cvar_t *hud_sbar;
cvar_t *hud_sbar_separator;
cvar_t *hud_swap;
cvar_t *hud_scoreboard_gravity;
static view_t *sbar_view;
static view_t *sbar_inventory_view;
@ -118,7 +118,7 @@ static void Sbar_TeamOverlay (view_t *view);
static void Sbar_DeathmatchOverlay (view_t *view, int start);
static void
cl_hudswap_f (cvar_t *var)
hud_swap_f (cvar_t *var)
{
hudswap = var->int_val;
if (var->int_val) {
@ -134,7 +134,7 @@ cl_hudswap_f (cvar_t *var)
}
static void
cl_overlay_gravity_f (cvar_t *var)
hud_scoreboard_gravity_f (cvar_t *var)
{
grav_t grav;
@ -196,7 +196,7 @@ calc_sb_lines (cvar_t *var)
}
static void
cl_sbar_f (cvar_t *var)
hud_sbar_f (cvar_t *var)
{
vid.recalc_refdef = true;
if (scr_viewsize)
@ -219,8 +219,8 @@ static void
viewsize_f (cvar_t *var)
{
calc_sb_lines (var);
if (cl_sbar)
r_lineadj = cl_sbar->int_val ? sb_lines : 0;
if (hud_sbar)
r_lineadj = hud_sbar->int_val ? sb_lines : 0;
}
@ -940,7 +940,7 @@ Sbar_Draw (void)
sbar_view->visible = 0;
headsup = !(cl_sbar->int_val || scr_viewsize->int_val < 100);
headsup = !(hud_sbar->int_val || scr_viewsize->int_val < 100);
if ((sb_updates >= vid.numpages) && !headsup)
return;
@ -1560,7 +1560,7 @@ draw_miniteam (view_t *view)
/*
// draw separator
x += 208;
if (cl_sbar_separator->int_val)
if (hud_sbar_separator->int_val)
for (y = vid.height - sb_lines; y < (int) vid.height - 6; y += 2)
Draw_Character (x, y, 14);
*/
@ -1975,15 +1975,16 @@ Sbar_Init (void)
cl_fraglog = Cvar_Get ("cl_fraglog", "0", CVAR_ARCHIVE, NULL,
"Automatic fraglogging, non-zero value will switch "
"it on.");
cl_sbar = Cvar_Get ("cl_sbar", "0", CVAR_ARCHIVE, cl_sbar_f,
"status bar mode: 0 = hud, 1 = oldstyle");
cl_sbar_separator = Cvar_Get ("cl_sbar_separator", "0", CVAR_ARCHIVE, NULL,
"turns on status bar separator");
cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, cl_hudswap_f,
"new HUD on left side?");
cl_overlay_gravity = Cvar_Get ("cl_overlay_gravity", "center",
CVAR_ARCHIVE, cl_overlay_gravity_f,
"control placement of scoreboard overlay: "
"center, northwest, north, northeast, "
"west, east, southwest, south, southeast");
hud_sbar = Cvar_Get ("hud_sbar", "0", CVAR_ARCHIVE, hud_sbar_f,
"status bar mode: 0 = hud, 1 = oldstyle");
hud_sbar_separator = Cvar_Get ("hud_sbar_separator", "0", CVAR_ARCHIVE,
NULL, "turns on status bar separator");
hud_swap = Cvar_Get ("hud_swap", "0", CVAR_ARCHIVE, hud_swap_f,
"new HUD on left side?");
hud_scoreboard_gravity = Cvar_Get ("hud_scoreboard_gravity", "center",
CVAR_ARCHIVE, hud_scoreboard_gravity_f,
"control placement of scoreboard "
"overlay: center, northwest, north, "
"northeast, west, east, southwest, "
"south, southeast");
}