mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
Make the hud type configurable via dirconf.
Currently only "id", "hipnotic" and "rogue" are supported (anything else is treated as "id"). Has no effect in quakeworld (good thing too: changing gamedirs is a little broken).
This commit is contained in:
parent
b9401fe7c6
commit
8bab548d16
6 changed files with 40 additions and 30 deletions
|
@ -16,12 +16,24 @@ Quake = {
|
|||
Inherit = QF;
|
||||
Path = "id1";
|
||||
GameCode = "progs.dat";
|
||||
HudType = "id";
|
||||
};
|
||||
QuakeWorld = {
|
||||
Inherit = (Quake);
|
||||
Path = "qw";
|
||||
SkinPath = "${path}/skins";
|
||||
GameCode = "qwprogs.dat";
|
||||
HudType = "id";
|
||||
};
|
||||
"Hipnotic" = {
|
||||
Inherit = (Quake);
|
||||
Path = "hipnotic";
|
||||
HudType = "hipnotic";
|
||||
};
|
||||
"Rogue" = {
|
||||
Inherit = (Quake);
|
||||
Path = "rogue";
|
||||
HudType = "rogue";
|
||||
};
|
||||
"qw:qw" = {
|
||||
Inherit = (QuakeWorld);
|
||||
|
@ -34,20 +46,12 @@ QuakeWorld = {
|
|||
Inherit = (Quake);
|
||||
Path = "$gamedir";
|
||||
};
|
||||
"hipnotic" = {
|
||||
Inherit = (Quake);
|
||||
Path = "hipnotic";
|
||||
};
|
||||
"hipnotic:*" = {
|
||||
Inherit = (hipnotic);
|
||||
Inherit = (Hipnotic);
|
||||
Path = "$gamedir";
|
||||
};
|
||||
"rogue" = {
|
||||
Inherit = (Quake);
|
||||
Path = "rogue";
|
||||
};
|
||||
"rogue:*" = {
|
||||
Inherit = (rogue);
|
||||
Inherit = (Rogue);
|
||||
Path = "$gamedir";
|
||||
};
|
||||
"abyss" = {
|
||||
|
@ -72,6 +76,9 @@ Supported attributes are:
|
|||
<dt><code>GameCode</code></dt>
|
||||
<dd>The name of the mod progs file. This is relative to the mod
|
||||
directory</dd>
|
||||
<dt><code>HudType</code></dt>
|
||||
<dd>The name of the hud style. Currently, "id", "hipnotic" and
|
||||
"rogue" are supported. Has no effect in quakeworld.</dd>
|
||||
<dt><code>SkinPath</code></dt>
|
||||
<dd>Directory to which downloaded skins will be saved. This is
|
||||
relative to the QuakeForge data directory, and thus the default
|
||||
|
|
|
@ -57,6 +57,7 @@ typedef struct gamedir_s {
|
|||
const char *gamedir; ///< the actual game dir
|
||||
const char *path; ///< colon separated list of search paths
|
||||
const char *gamecode; ///< name of file to load for gamecode
|
||||
const char *hudtype; ///< name of the hud type
|
||||
struct {
|
||||
const char *def; ///< directory to which to write other files
|
||||
const char *skins; ///< directory to which to write skins
|
||||
|
|
|
@ -159,12 +159,24 @@ static const char *qfs_default_dirconf =
|
|||
" Inherit = QF;"
|
||||
" Path = \"id1\";"
|
||||
" GameCode = \"progs.dat\";"
|
||||
" HudType = \"id\";"
|
||||
" };"
|
||||
" QuakeWorld = {"
|
||||
" Inherit = (Quake);"
|
||||
" Path = \"qw\";"
|
||||
" SkinPath = \"${path}/skins\";"
|
||||
" GameCode = \"qwprogs.dat\";"
|
||||
" HudType = \"id\";"
|
||||
" };"
|
||||
" \"Hipnotic\" = {"
|
||||
" Inherit = (Quake);"
|
||||
" Path = \"hipnotic\";"
|
||||
" HudType = \"hipnotic\";"
|
||||
" };"
|
||||
" \"Rogue\" = {"
|
||||
" Inherit = (Quake);"
|
||||
" Path = \"rogue\";"
|
||||
" HudType = \"rogue\";"
|
||||
" };"
|
||||
" \"qw:qw\" = {"
|
||||
" Inherit = (QuakeWorld);"
|
||||
|
@ -177,20 +189,12 @@ static const char *qfs_default_dirconf =
|
|||
" Inherit = (Quake);"
|
||||
" Path = \"$gamedir\";"
|
||||
" };"
|
||||
" \"hipnotic\" = {"
|
||||
" Inherit = (Quake);"
|
||||
" Path = \"hipnotic\";"
|
||||
" };"
|
||||
" \"hipnotic:*\" = {"
|
||||
" Inherit = (hipnotic);"
|
||||
" Inherit = (Hipnotic);"
|
||||
" Path = \"$gamedir\";"
|
||||
" };"
|
||||
" \"rogue\" = {"
|
||||
" Inherit = (Quake);"
|
||||
" Path = \"rogue\";"
|
||||
" };"
|
||||
" \"rogue:*\" = {"
|
||||
" Inherit = (rogue);"
|
||||
" Inherit = (Rogue);"
|
||||
" Path = \"$gamedir\";"
|
||||
" };"
|
||||
" \"abyss\" = {"
|
||||
|
@ -329,6 +333,8 @@ qfs_get_gd_params (plitem_t *gdpl, gamedir_t *gamedir, dstring_t *path,
|
|||
}
|
||||
if (!gamedir->gamecode && (p = PL_ObjectForKey (gdpl, "GameCode")))
|
||||
gamedir->gamecode = qfs_var_subst (PL_String (p), vars);
|
||||
if (!gamedir->hudtype && (p = PL_ObjectForKey (gdpl, "HudType")))
|
||||
gamedir->hudtype = qfs_var_subst (PL_String (p), vars);
|
||||
if (!gamedir->dir.skins && (p = PL_ObjectForKey (gdpl, "SkinPath")))
|
||||
gamedir->dir.skins = qfs_var_subst (PL_String (p), vars);
|
||||
if (!gamedir->dir.models && (p = PL_ObjectForKey (gdpl, "ModelPath")))
|
||||
|
@ -553,6 +559,7 @@ qfs_build_gamedir (const char **list)
|
|||
Sys_MaskPrintf (SYS_FS, " gamedir : %s\n", qfs_gamedir->gamedir);
|
||||
Sys_MaskPrintf (SYS_FS, " path : %s\n", qfs_gamedir->path);
|
||||
Sys_MaskPrintf (SYS_FS, " gamecode: %s\n", qfs_gamedir->gamecode);
|
||||
Sys_MaskPrintf (SYS_FS, " hudtype : %s\n", qfs_gamedir->hudtype);
|
||||
Sys_MaskPrintf (SYS_FS, " def : %s\n", qfs_gamedir->dir.def);
|
||||
Sys_MaskPrintf (SYS_FS, " skins : %s\n", qfs_gamedir->dir.skins);
|
||||
Sys_MaskPrintf (SYS_FS, " models : %s\n", qfs_gamedir->dir.models);
|
||||
|
|
|
@ -162,7 +162,7 @@ extern int current_skill; // skill level for currently loaded level (in case
|
|||
// running, this reflects the level actually in use)
|
||||
|
||||
extern qboolean isDedicated;
|
||||
extern qboolean abyss, rogue, hipnotic, standard_quake;
|
||||
extern qboolean standard_quake;
|
||||
extern struct cvar_s *registered;
|
||||
|
||||
const char *Game_Init (void);
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#include "game.h"
|
||||
|
||||
qboolean standard_quake = false;
|
||||
qboolean hipnotic, rogue, abyss;
|
||||
|
||||
|
||||
const char *
|
||||
Game_Init (void)
|
||||
|
@ -49,14 +47,11 @@ Game_Init (void)
|
|||
|
||||
if ((i = COM_CheckParm ("-hipnotic"))) {
|
||||
standard_quake = false;
|
||||
hipnotic = true;
|
||||
return "hipnotic";
|
||||
} else if ((i = COM_CheckParm ("-rogue"))) {
|
||||
standard_quake = false;
|
||||
rogue = true;
|
||||
return "rogue";
|
||||
} else if ((i = COM_CheckParm ("-abyss"))) {
|
||||
abyss = true;
|
||||
return "abyss";
|
||||
}
|
||||
|
||||
|
|
|
@ -1611,10 +1611,10 @@ init_views (void)
|
|||
view_insert (con_module->data->console->view, stuff_view, 0);
|
||||
}
|
||||
|
||||
if (hipnotic) {
|
||||
if (!strcmp (qfs_gamedir->hudtype, "hipnotic")) {
|
||||
init_hipnotic_sbar_views ();
|
||||
init_hipnotic_hud_views ();
|
||||
} else if (rogue) {
|
||||
} else if (!strcmp (qfs_gamedir->hudtype, "rogue")) {
|
||||
init_rogue_sbar_views ();
|
||||
init_rogue_hud_views ();
|
||||
} else {
|
||||
|
@ -1723,7 +1723,7 @@ Sbar_Init (void)
|
|||
sb_scorebar = Draw_PicFromWad ("scorebar");
|
||||
|
||||
// MED 01/04/97 added new hipnotic weapons
|
||||
if (hipnotic) {
|
||||
if (!strcmp (qfs_gamedir->hudtype, "hipnotic")) {
|
||||
hsb_weapons[0][0] = Draw_PicFromWad ("inv_laser");
|
||||
hsb_weapons[0][1] = Draw_PicFromWad ("inv_mjolnir");
|
||||
hsb_weapons[0][2] = Draw_PicFromWad ("inv_gren_prox");
|
||||
|
@ -1753,7 +1753,7 @@ Sbar_Init (void)
|
|||
}
|
||||
|
||||
// FIXME: MISSIONHUD
|
||||
if (rogue) {
|
||||
if (!strcmp (qfs_gamedir->hudtype, "rogue")) {
|
||||
rsb_invbar[0] = Draw_PicFromWad ("r_invbar1");
|
||||
rsb_invbar[1] = Draw_PicFromWad ("r_invbar2");
|
||||
|
||||
|
|
Loading…
Reference in a new issue