mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-03-31 23:41:25 +00:00
game: add custom status bar for DoD(roarke)
This commit is contained in:
parent
94fc9a96ae
commit
65abf0188a
6 changed files with 92 additions and 9 deletions
|
@ -1136,14 +1136,18 @@ SCR_ExecuteLayoutString(char *s)
|
|||
|
||||
if ((index < 0) || (index >= MAX_STATS))
|
||||
{
|
||||
Com_Error(ERR_DROP, "bad stats index %d (0x%x)", index, index);
|
||||
Com_DPrintf("%s: bad stats index %d (0x%x)",
|
||||
__func__, index, index);
|
||||
continue;
|
||||
}
|
||||
|
||||
value = cl.frame.playerstate.stats[index];
|
||||
|
||||
if (value >= MAX_IMAGES)
|
||||
{
|
||||
Com_Error(ERR_DROP, "Pic >= MAX_IMAGES");
|
||||
Com_DPrintf("%s: Pic %d >= MAX_IMAGES",
|
||||
__func__, value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cl.configstrings[CS_IMAGES + value][0] != '\0')
|
||||
|
|
|
@ -104,6 +104,7 @@ cvar_t *g_quick_weap;
|
|||
cvar_t *g_swap_speed;
|
||||
cvar_t *g_language;
|
||||
cvar_t *g_itemsbobeffect;
|
||||
cvar_t *g_game;
|
||||
|
||||
static void G_RunFrame(void);
|
||||
|
||||
|
|
|
@ -1149,6 +1149,71 @@ static char *dm_statusbar =
|
|||
"endif "
|
||||
;
|
||||
|
||||
static char *roarke_statusbar =
|
||||
"yb -70 "
|
||||
|
||||
/* health */
|
||||
"xl 3 "
|
||||
"pic 0 "
|
||||
"yb -68 "
|
||||
"xl 35 "
|
||||
"hnum "
|
||||
|
||||
/* draw ammo value */
|
||||
"yb -35 "
|
||||
"xl 3 "
|
||||
"pic 8 "
|
||||
"yb -33 "
|
||||
"xl 35 "
|
||||
"num 3 9 "
|
||||
"yt 5 "
|
||||
"xr -35 "
|
||||
"pic 31 "
|
||||
|
||||
/* selected item */
|
||||
"if 6 "
|
||||
" yt 45 "
|
||||
" xr -70 "
|
||||
" num 2 7 "
|
||||
" xr -35 "
|
||||
" pic 6 "
|
||||
"endif "
|
||||
|
||||
/* chase camera */
|
||||
"if 16 "
|
||||
" yb -105 "
|
||||
" xr -35 "
|
||||
" pic 16 "
|
||||
"endif "
|
||||
|
||||
/* ammo */
|
||||
"if 2 "
|
||||
" yb -70 "
|
||||
" xr -87 "
|
||||
" anum "
|
||||
" yb -68 "
|
||||
" xr -35 "
|
||||
" pic 2 "
|
||||
"endif "
|
||||
|
||||
/* armor */
|
||||
"if 4 "
|
||||
" yb -35 "
|
||||
" xr -87 "
|
||||
" rnum "
|
||||
" yb -33 "
|
||||
" xr -35 "
|
||||
" pic 4 "
|
||||
"endif "
|
||||
|
||||
/* selected item */
|
||||
"if 12 "
|
||||
" xv 145 "
|
||||
" yt 5 "
|
||||
" pic 12 "
|
||||
"endif"
|
||||
;
|
||||
|
||||
/*
|
||||
* QUAKED worldspawn (0 0 0) ?
|
||||
*
|
||||
|
@ -1239,14 +1304,28 @@ SP_worldspawn(edict_t *ent)
|
|||
}
|
||||
else
|
||||
{
|
||||
gi.configstring(CS_STATUSBAR, single_statusbar);
|
||||
if (!strcmp(g_game->string, "roarke")) /* DoD */
|
||||
{
|
||||
gi.configstring(CS_STATUSBAR, roarke_statusbar);
|
||||
}
|
||||
else
|
||||
{
|
||||
gi.configstring(CS_STATUSBAR, single_statusbar);
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------- */
|
||||
|
||||
/* help icon for statusbar */
|
||||
gi.imageindex("i_help");
|
||||
level.pic_health = gi.imageindex("i_health");
|
||||
if (!strcmp(g_game->string, "roarke")) /* DoD */
|
||||
{
|
||||
level.pic_health = gi.imageindex("i_life");
|
||||
}
|
||||
else
|
||||
{
|
||||
level.pic_health = gi.imageindex("i_health");
|
||||
}
|
||||
gi.imageindex("help");
|
||||
gi.imageindex("field_3");
|
||||
|
||||
|
|
|
@ -282,17 +282,14 @@ SVCmd_WriteIP_f(void)
|
|||
char name[MAX_OSPATH];
|
||||
YQ2_ALIGNAS_TYPE(unsigned) byte b[4];
|
||||
int i;
|
||||
cvar_t *game;
|
||||
|
||||
game = gi.cvar("game", "", 0);
|
||||
|
||||
if (!*game->string)
|
||||
if (!*g_game->string)
|
||||
{
|
||||
sprintf(name, "%s/listip.cfg", GAMEVERSION);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(name, "%s/listip.cfg", game->string);
|
||||
sprintf(name, "%s/listip.cfg", g_game->string);
|
||||
}
|
||||
|
||||
gi.cprintf(NULL, PRINT_HIGH, "Writing %s.\n", name);
|
||||
|
|
|
@ -687,6 +687,7 @@ extern cvar_t *g_quick_weap;
|
|||
extern cvar_t *g_swap_speed;
|
||||
extern cvar_t *g_language;
|
||||
extern cvar_t *g_itemsbobeffect;
|
||||
extern cvar_t *g_game;
|
||||
|
||||
/* this is for the count of monsters */
|
||||
#define ENT_SLOTS_LEFT \
|
||||
|
|
|
@ -265,6 +265,7 @@ InitGame(void)
|
|||
g_swap_speed = gi.cvar("g_swap_speed", "1", CVAR_ARCHIVE);
|
||||
g_language = gi.cvar("g_language", "english", CVAR_ARCHIVE);
|
||||
g_itemsbobeffect = gi.cvar("g_itemsbobeffect", "0", CVAR_ARCHIVE);
|
||||
g_game = gi.cvar("game", "", 0);
|
||||
|
||||
/* initilize localization */
|
||||
LocalizationInit();
|
||||
|
|
Loading…
Reference in a new issue