2019-08-31 19:18:15 -07:00
|
|
|
/*
|
2022-07-07 09:10:14 -07:00
|
|
|
* Copyright (c) 2016-2022 Vera Visions LLC.
|
2019-08-31 19:18:15 -07:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2022-07-07 09:10:14 -07:00
|
|
|
*/
|
2018-12-27 14:53:24 -08:00
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
var bool g_initialized = false;
|
2022-11-30 14:21:55 -08:00
|
|
|
var bool g_input_received = false;
|
2019-01-18 16:37:31 -08:00
|
|
|
|
2020-04-12 06:50:42 -07:00
|
|
|
#define FN_UPDATE_PKGLIST "http://www.frag-net.com/dl/%s_packages"
|
|
|
|
|
2019-08-31 19:18:15 -07:00
|
|
|
const string LICENSE_TEXT = "\
|
2019-09-04 09:11:55 -07:00
|
|
|
==============================================================================\
|
2022-07-16 15:11:33 -07:00
|
|
|
Copyright (c) 2016-2022 Marco Cawthorne <marco@vera-visions.com>\
|
2019-03-19 12:01:24 -07:00
|
|
|
\
|
2019-08-31 19:18:15 -07:00
|
|
|
Permission to use, copy, modify, and distribute this software for any\
|
|
|
|
purpose with or without fee is hereby granted, provided that the above\
|
|
|
|
copyright notice and this permission notice appear in all copies.\
|
2019-03-19 12:01:24 -07:00
|
|
|
\
|
2019-08-31 19:18:15 -07:00
|
|
|
THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER\
|
|
|
|
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING\
|
|
|
|
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\
|
2019-09-04 09:11:55 -07:00
|
|
|
==============================================================================";
|
2019-03-19 12:01:24 -07:00
|
|
|
|
2021-01-22 13:37:06 -08:00
|
|
|
/* r_autoscale forces vid_conautoscale to be one of 4 integer values.
|
|
|
|
* this is due to vid_conautoscale 0 scaling with in floating point... which
|
|
|
|
* in turns results in skipped rows/columns and shimmering. */
|
2020-04-12 06:50:42 -07:00
|
|
|
var int autocvar_r_autoscale = TRUE;
|
2021-08-29 12:41:31 -07:00
|
|
|
var int autocvar_r_pixelscale = FALSE;
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
Menu_AutoScale(void)
|
|
|
|
{
|
|
|
|
if (autocvar_r_autoscale) {
|
|
|
|
vector psize = getproperty(VF_SCREENPSIZE);
|
|
|
|
if (psize[1] >= (480 * 4)) {
|
|
|
|
cvar_set("vid_conautoscale", "4");
|
|
|
|
} else if (psize[1] >= (480 * 3)) {
|
|
|
|
cvar_set("vid_conautoscale", "3");
|
|
|
|
} else if (psize[1] >= (480 * 2)) {
|
|
|
|
cvar_set("vid_conautoscale", "2");
|
|
|
|
} else {
|
|
|
|
cvar_set("vid_conautoscale", "1");
|
|
|
|
}
|
2021-08-29 12:41:31 -07:00
|
|
|
|
|
|
|
if (autocvar_r_pixelscale) {
|
|
|
|
float scale = bound(0.0, 480 / psize[1], 1.0);
|
|
|
|
cvar_set("r_renderscale", sprintf("-%f", scale));
|
|
|
|
}
|
2020-04-12 06:50:42 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-22 13:37:06 -08:00
|
|
|
/* old Half-Life configs that have a completely different gamma model would
|
|
|
|
* mess up visibility on initial launch - so we catch that and and force
|
|
|
|
* our default to fix it */
|
2020-08-08 15:53:18 -07:00
|
|
|
void
|
|
|
|
Menu_GammaHack(void)
|
|
|
|
{
|
|
|
|
if (cvar("brightness") != cvar("vid_brightness")) {
|
2022-07-16 15:11:33 -07:00
|
|
|
localcmd("seta brightness 0\n");
|
2020-08-08 15:53:18 -07:00
|
|
|
print("^1Menu_RendererRestarted^7: Brightness hack.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cvar("gamma") != cvar("vid_gamma")) {
|
2022-07-16 15:11:33 -07:00
|
|
|
localcmd("seta gamma 1\n");
|
2020-08-08 15:53:18 -07:00
|
|
|
print("^1Menu_RendererRestarted^7: Gamma hack.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-22 13:37:06 -08:00
|
|
|
/* called upon menu init/restart */
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_init(void)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
|
|
|
vector g_btnsize;
|
|
|
|
|
2021-05-22 06:21:28 -07:00
|
|
|
/* things that should really be default. platform_default.cfg is supposed to set
|
|
|
|
* them the first time - however FTE doesn't do that when switching manifests
|
|
|
|
* for unknown reasons. It'll be fixed */
|
|
|
|
cvar_set("r_ignoreentpvs", "0");
|
|
|
|
cvar_set("_pext_infoblobs", "1");
|
2022-09-25 16:29:20 -07:00
|
|
|
cvar_set("_pext_vrinputs", "0");
|
2021-05-22 06:21:28 -07:00
|
|
|
cvar_set("_q3bsp_bihtraces", "1");
|
|
|
|
cvar_set("sv_gameplayfix_setmodelsize_qw", "1");
|
|
|
|
cvar_set("sv_gameplayfix_setmodelrealbox", "1");
|
|
|
|
cvar_set("cl_bob", "0");
|
|
|
|
cvar_set("maxpitch", "89");
|
|
|
|
cvar_set("minpitch", "-89");
|
|
|
|
cvar_set("r_meshpitch", "1");
|
|
|
|
cvar_set("v_contentblend", "0");
|
|
|
|
cvar_set("gl_mindist", "4");
|
2021-06-26 12:45:46 -07:00
|
|
|
cvar_set("con_textsize", "12");
|
2021-05-22 06:21:28 -07:00
|
|
|
cvar_set("scr_conalpha", "1");
|
|
|
|
cvar_set("con_notifylines", "0");
|
|
|
|
cvar_set("cfg_save_auto", "1");
|
|
|
|
cvar_set("r_imageextensions", "tga bmp pcx png jpg");
|
|
|
|
cvar_set("cl_cursor_scale", "1");
|
|
|
|
|
2019-08-31 19:18:15 -07:00
|
|
|
print(LICENSE_TEXT);
|
2019-03-19 12:01:24 -07:00
|
|
|
print("\n\n");
|
|
|
|
|
2021-01-23 05:54:31 -08:00
|
|
|
registercommand("menu_updates");
|
2019-01-18 20:50:25 -08:00
|
|
|
registercommand("menu_customgame");
|
2020-09-27 05:25:10 -07:00
|
|
|
registercommand("map_background");
|
2020-10-06 05:27:44 -07:00
|
|
|
registercommand("menu_musicstart");
|
2022-04-25 17:00:13 -07:00
|
|
|
registercommand("richpresence_dump");
|
2020-10-06 05:27:44 -07:00
|
|
|
|
2021-11-04 14:48:19 -07:00
|
|
|
Font_Load("fonts/fontcon.font", font_console);
|
|
|
|
Font_Load("fonts/menu_label.font", font_label);
|
|
|
|
Font_Load("fonts/menu_main.font", font_arial);
|
|
|
|
Font_Load("fonts/menu_label_bold.font", font_label_b);
|
|
|
|
Font_Load("fonts/menu_header.font", font_label_p);
|
2018-12-27 14:53:24 -08:00
|
|
|
|
2019-01-15 16:14:54 -08:00
|
|
|
localcmd("plug_load ffmpeg\n");
|
2019-01-18 16:37:31 -08:00
|
|
|
|
2018-12-27 14:53:24 -08:00
|
|
|
for (int i = 0; i < g_bmp.length; i++) {
|
|
|
|
precache_pic(g_bmp[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_btnsize = drawgetimagesize(g_bmp[BTNS_MAIN]);
|
|
|
|
g_btnofs = 26 / g_btnsize[1];
|
|
|
|
|
2019-01-18 12:05:42 -08:00
|
|
|
games_init();
|
2018-12-27 14:53:24 -08:00
|
|
|
main_init();
|
2019-01-18 20:50:25 -08:00
|
|
|
|
|
|
|
Colors_Init();
|
|
|
|
Strings_Init();
|
2020-03-30 05:46:55 -07:00
|
|
|
|
2021-11-01 13:43:01 -07:00
|
|
|
if (games[gameinfo_current].gamedir != "valve" || games[gameinfo_current].steambg == 1) {
|
2020-03-30 05:46:55 -07:00
|
|
|
m_intro_skip();
|
2020-04-03 06:01:55 -07:00
|
|
|
Music_MenuStart();
|
2020-03-30 05:46:55 -07:00
|
|
|
}
|
2020-09-05 23:37:36 -07:00
|
|
|
|
2021-03-05 15:23:59 -08:00
|
|
|
if (games[gameinfo_current].pkgfile != "")
|
2022-07-16 16:51:37 -07:00
|
|
|
if not (whichpack(games[gameinfo_current].pkgfile) || autocvar_menu_updating) {
|
2021-02-17 02:17:28 -08:00
|
|
|
/* reload in case of video restarts? */
|
2021-01-23 05:54:31 -08:00
|
|
|
shaderforname("logo_avi", "{\n{\nvideomap av:media/logo.avi\n}\n}");
|
2020-04-12 06:50:42 -07:00
|
|
|
g_menupage = PAGE_UPDATES;
|
|
|
|
}
|
2020-09-05 23:37:36 -07:00
|
|
|
|
2020-04-12 06:50:42 -07:00
|
|
|
Menu_AutoScale();
|
2020-08-08 15:53:18 -07:00
|
|
|
Menu_GammaHack();
|
2021-02-17 02:17:28 -08:00
|
|
|
|
|
|
|
if (g_intro_stage == 0) {
|
2021-03-05 15:23:59 -08:00
|
|
|
string videofile = games[gameinfo_current].introvideo;
|
2021-02-17 02:17:28 -08:00
|
|
|
|
|
|
|
if (videofile) {
|
|
|
|
localcmd(strcat("playvideo ", videofile, "\n"));
|
|
|
|
}
|
2022-02-23 01:41:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (games[gameinfo_current].menumap != "") {
|
|
|
|
string mapname = games[gameinfo_current].menumap;
|
|
|
|
localcmd(strcat("map_background ", mapname, "\n"));
|
2021-02-17 02:17:28 -08:00
|
|
|
}
|
2022-07-16 15:11:33 -07:00
|
|
|
|
2023-02-09 17:12:31 -08:00
|
|
|
/* prepare spray logo keys */
|
|
|
|
spray_setinfokeys();
|
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
g_initialized = true;
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
|
|
|
|
2021-01-22 13:37:06 -08:00
|
|
|
/* called upon vid_reload, vid_restart, but not menu init/restart */
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
2020-05-31 03:54:04 -07:00
|
|
|
Menu_RendererRestarted(string rendererdesc)
|
2020-04-12 06:50:42 -07:00
|
|
|
{
|
|
|
|
Menu_AutoScale();
|
2020-08-08 15:53:18 -07:00
|
|
|
Menu_GammaHack();
|
2020-04-12 06:50:42 -07:00
|
|
|
}
|
|
|
|
|
2021-01-22 13:37:06 -08:00
|
|
|
/* called, in theory, whenever the menu gets killed */
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_shutdown(void)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
2022-07-16 15:11:33 -07:00
|
|
|
g_initialized = false;
|
|
|
|
|
2019-01-18 12:05:42 -08:00
|
|
|
/*int i = 0;
|
|
|
|
for (i = 0; i < g_bmp.length; i++) {
|
|
|
|
freepic(g_bmp[i]);
|
2019-01-18 16:37:31 -08:00
|
|
|
}*/
|
|
|
|
|
2019-01-18 12:05:42 -08:00
|
|
|
entity e;
|
2019-01-18 16:37:31 -08:00
|
|
|
while((e=nextent(__NULL__)))
|
2019-01-18 12:05:42 -08:00
|
|
|
remove(e);
|
|
|
|
|
|
|
|
memfree(g_sprays);
|
|
|
|
memfree(g_models);
|
|
|
|
memfree(games);
|
2021-08-12 03:36:48 -07:00
|
|
|
|
|
|
|
cr_closeconnection();
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
|
|
|
|
2021-01-22 13:37:06 -08:00
|
|
|
/* called every frame, influenced by cl_idlefps */
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_draw(vector screensize)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
2020-04-12 06:50:42 -07:00
|
|
|
static float oldtime;
|
2022-11-30 14:21:55 -08:00
|
|
|
|
|
|
|
if (!g_input_received) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-12-27 14:53:24 -08:00
|
|
|
frametime = time - oldtime;
|
2022-07-16 15:11:33 -07:00
|
|
|
|
|
|
|
/* don't attempt to draw unless we're done loading everything */
|
|
|
|
if (g_initialized == false) {
|
2019-01-18 16:37:31 -08:00
|
|
|
return;
|
|
|
|
}
|
2018-12-27 14:53:24 -08:00
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* set new scale whenever the resolution changes */
|
2018-12-27 14:53:24 -08:00
|
|
|
if ((screensize[0] != g_vidsize[0]) || (screensize[1] != g_vidsize[1])) {
|
|
|
|
g_vidsize[0] = screensize[0];
|
|
|
|
g_vidsize[1] = screensize[1];
|
|
|
|
g_menuofs[0] = (g_vidsize[0] / 2) - 320;
|
|
|
|
g_menuofs[1] = (g_vidsize[1] / 2) - 240;
|
2020-04-12 06:50:42 -07:00
|
|
|
Menu_AutoScale();
|
|
|
|
}
|
|
|
|
|
2020-09-27 05:25:10 -07:00
|
|
|
g_background = cvar("_background");
|
|
|
|
|
2020-09-29 05:24:21 -07:00
|
|
|
/* make sure input carries over when a map background is active */
|
2020-09-27 05:25:10 -07:00
|
|
|
if (g_background) {
|
2020-09-29 05:24:21 -07:00
|
|
|
if (getkeydest() != KEY_MENU) {
|
|
|
|
setkeydest(KEY_MENU);
|
|
|
|
setmousetarget(TARGET_MENU);
|
|
|
|
setcursormode(TRUE, "gfx/cursor");
|
|
|
|
}
|
2020-09-27 05:25:10 -07:00
|
|
|
}
|
|
|
|
|
2020-06-30 08:14:06 -07:00
|
|
|
/* to prevent TCP timeouts */
|
|
|
|
menu_chatrooms_keepalive();
|
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* clear rich presence whenever the state suddenly changes */
|
2022-04-26 11:22:12 -07:00
|
|
|
if (g_gamestate != clientstate()) {
|
|
|
|
g_gamestate = clientstate();
|
|
|
|
|
|
|
|
if (g_gamestate == 1)
|
|
|
|
RichPresence_Clear();
|
|
|
|
}
|
|
|
|
|
2022-04-25 17:00:13 -07:00
|
|
|
/* rich presence sanity check */
|
|
|
|
if (RichPresence_WasSet() == false) {
|
|
|
|
if (clientstate() == 2)
|
|
|
|
RichPresence_Set("status", "In-game (Unknown)");
|
|
|
|
else
|
|
|
|
RichPresence_Set("status", "Main Menu");
|
|
|
|
}
|
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* if the menu is not visible and we're no background map... */
|
2020-09-27 05:25:10 -07:00
|
|
|
if (!g_active && !g_background) {
|
2020-09-29 05:24:21 -07:00
|
|
|
/* make sure we're redirecting input when the background's gone */
|
|
|
|
if (getkeydest() != KEY_GAME) {
|
|
|
|
setkeydest(KEY_GAME);
|
|
|
|
setmousetarget(TARGET_CLIENT);
|
|
|
|
setcursormode(FALSE);
|
|
|
|
}
|
2022-07-16 15:11:33 -07:00
|
|
|
|
|
|
|
/* don't draw the menu below */
|
2020-04-12 06:50:42 -07:00
|
|
|
return;
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* when ingame, we'll draw a slight black tint... */
|
2018-12-27 14:53:24 -08:00
|
|
|
if (clientstate() == 2) {
|
2022-07-16 15:11:33 -07:00
|
|
|
/* ...unless we're in background map mode. */
|
2020-09-27 05:25:10 -07:00
|
|
|
if (!g_background)
|
|
|
|
drawfill([0,0], screensize, [0,0,0], 0.75f);
|
2018-12-27 14:53:24 -08:00
|
|
|
} else {
|
2022-07-16 15:11:33 -07:00
|
|
|
/* clear screen */
|
2018-12-27 14:53:24 -08:00
|
|
|
drawfill([0,0], screensize, [0,0,0], 1.0f);
|
2021-05-08 08:20:30 -07:00
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* draw either WON or Steam background */
|
2021-05-08 08:20:30 -07:00
|
|
|
if (games[gameinfo_current].steambg == 0)
|
|
|
|
Background_WON();
|
|
|
|
else
|
|
|
|
Background_Steam();
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* water mark for version info */
|
2020-07-11 11:59:45 -07:00
|
|
|
const string ver = "Nuclide (build " __DATE__ ")";
|
2021-11-04 14:48:19 -07:00
|
|
|
drawfont = Font_GetID(font_console);
|
2020-07-11 11:59:45 -07:00
|
|
|
|
2020-09-10 10:28:36 -07:00
|
|
|
WLabel_Static(640 - 8 - stringwidth(ver, TRUE, [12,12]),
|
2020-07-24 15:50:51 -07:00
|
|
|
466,
|
2020-07-11 11:59:45 -07:00
|
|
|
ver,
|
2020-09-10 10:28:36 -07:00
|
|
|
12, 12,
|
|
|
|
[1.0f,1.0f,1.0f],
|
|
|
|
0.5f, 0, font_console);
|
2020-07-11 11:59:45 -07:00
|
|
|
|
2022-07-16 15:11:33 -07:00
|
|
|
/* draw the actual widgets */
|
2018-12-27 14:53:24 -08:00
|
|
|
main_draw();
|
2021-01-23 05:54:31 -08:00
|
|
|
|
2018-12-27 14:53:24 -08:00
|
|
|
oldtime = time;
|
|
|
|
}
|
|
|
|
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_drawloading(vector screensize, float opaque)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
2019-09-04 09:11:55 -07:00
|
|
|
vector pos;
|
|
|
|
pos = (screensize / 2) - [32,32];
|
2020-04-12 06:50:42 -07:00
|
|
|
drawfill([0,0], screensize, [0.5,0.5,0.5], 1.0f);
|
2021-08-02 13:36:36 -07:00
|
|
|
drawpic(pos, "gfx/loading", [64,64], [1,1,1], 1.0f);
|
2019-09-04 09:11:55 -07:00
|
|
|
}
|
2018-12-27 14:53:24 -08:00
|
|
|
|
2020-04-12 06:50:42 -07:00
|
|
|
float
|
|
|
|
Menu_InputEvent(float evtype, float scanx, float chary, float devid)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
2022-11-30 14:21:55 -08:00
|
|
|
g_input_received = true;
|
|
|
|
|
2018-12-27 14:53:24 -08:00
|
|
|
switch (evtype) {
|
2021-02-17 02:17:28 -08:00
|
|
|
case IE_KEYDOWN:
|
|
|
|
if (chary == K_ESCAPE) {
|
|
|
|
if (clientstate() == 2 && !g_background) {
|
|
|
|
m_toggle(0);
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
2021-02-17 02:17:28 -08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IE_MOUSEABS:
|
|
|
|
g_mousepos[0] = scanx;
|
|
|
|
g_mousepos[1] = chary;
|
|
|
|
break;
|
|
|
|
case IE_MOUSEDELTA:
|
|
|
|
g_mousepos[0] += scanx;
|
|
|
|
g_mousepos[1] += chary;
|
|
|
|
break;
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
main_input(evtype, scanx, chary, devid);
|
2021-05-09 23:14:10 -07:00
|
|
|
return (1);
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
|
|
|
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_display(void)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
|
|
|
g_active = TRUE;
|
|
|
|
setkeydest(KEY_MENU);
|
|
|
|
setmousetarget(TARGET_MENU);
|
|
|
|
setcursormode(TRUE, "gfx/cursor");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=================
|
|
|
|
m_hide
|
|
|
|
=================
|
|
|
|
*/
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_hide(void)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
|
|
|
g_active = FALSE;
|
|
|
|
setkeydest(KEY_GAME);
|
|
|
|
setmousetarget(TARGET_CLIENT);
|
|
|
|
setcursormode(FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=================
|
|
|
|
m_toggle
|
|
|
|
=================
|
|
|
|
*/
|
2020-04-12 06:50:42 -07:00
|
|
|
void
|
|
|
|
m_toggle(float fMode)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
|
|
|
if (fMode == FALSE) {
|
|
|
|
m_hide();
|
|
|
|
} else {
|
|
|
|
m_display();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-12 06:50:42 -07:00
|
|
|
float
|
|
|
|
m_consolecommand(string cmd)
|
2018-12-27 14:53:24 -08:00
|
|
|
{
|
|
|
|
tokenize(cmd);
|
|
|
|
switch (argv(0)) {
|
2022-04-25 17:00:13 -07:00
|
|
|
case "richpresence_dump":
|
|
|
|
RichPresence_DumpInfo();
|
|
|
|
break;
|
2021-02-17 02:17:28 -08:00
|
|
|
case "menu_musicstart":
|
|
|
|
Music_MenuStart();
|
|
|
|
break;
|
|
|
|
case "menu_musictrack":
|
|
|
|
Music_ParseTrack(argv(1));
|
|
|
|
break;
|
|
|
|
case "menu_musicloop":
|
|
|
|
Music_ParseLoop(argv(1));
|
|
|
|
break;
|
|
|
|
case "menu_updates":
|
|
|
|
g_menupage = PAGE_UPDATES;
|
|
|
|
m_intro_skip();
|
|
|
|
break;
|
|
|
|
case "menu_customgame":
|
|
|
|
g_menupage = PAGE_CUSTOMGAME;
|
|
|
|
m_intro_skip();
|
|
|
|
break;
|
|
|
|
case "togglemenu":
|
|
|
|
m_display();
|
|
|
|
break;
|
|
|
|
case "map_background":
|
|
|
|
localcmd(sprintf("maxplayers 2\nset coop 1\nset sv_background 1\nmap %s\n",
|
|
|
|
argv(1)));
|
|
|
|
break;
|
|
|
|
default:
|
2021-05-09 23:14:10 -07:00
|
|
|
return (0);
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|
2021-05-09 23:14:10 -07:00
|
|
|
return (1);
|
2018-12-27 14:53:24 -08:00
|
|
|
}
|