Menu: Switched mod switching to be fully manifest oriented, fixed menu music playback.
This commit is contained in:
parent
9f30a2b897
commit
5810da8069
3 changed files with 17 additions and 8 deletions
|
@ -96,6 +96,8 @@ m_init(void)
|
|||
|
||||
registercommand("menu_customgame");
|
||||
registercommand("map_background");
|
||||
registercommand("menu_musicstart");
|
||||
|
||||
font_console = loadfont("font", "", "12", -1);
|
||||
font_label = loadfont("label", "gfx/shell/mssansserif.ttf", "10 12 14", -1);
|
||||
font_arial = loadfont("label", "gfx/shell/arial.ttf", "14 11 12", -1);
|
||||
|
@ -307,6 +309,9 @@ m_consolecommand(string cmd)
|
|||
{
|
||||
tokenize(cmd);
|
||||
switch (argv(0)) {
|
||||
case "menu_musicstart":
|
||||
Music_MenuStart();
|
||||
break;
|
||||
case "menu_musictrack":
|
||||
Music_ParseTrack(argv(1));
|
||||
break;
|
||||
|
|
|
@ -228,9 +228,6 @@ games_init(void)
|
|||
case "gameinfo_trainingmap":
|
||||
games[id].trainingmap = argv(i+1);
|
||||
break;
|
||||
case "gameinfo_menutrack":
|
||||
cvar_set("gameinfo_menutrack", argv(i+1));
|
||||
break;
|
||||
case "gameinfo_pkgname":
|
||||
games[id].pkgname = argv(i+1);
|
||||
games[id].pkgid = game_getpackageid(games[id].pkgname);
|
||||
|
@ -245,7 +242,7 @@ games_init(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (games[id].gamedir == cvar_string("game")) {
|
||||
if (games[id].gamedir == cvar_string("gameinfo_gamedir")) {
|
||||
games_set(id);
|
||||
}
|
||||
}
|
||||
|
@ -355,8 +352,8 @@ customgame_btnactivate_start(void)
|
|||
|
||||
games_set(nextgame);
|
||||
|
||||
#if 0
|
||||
localcmd(sprintf("fs_changegame %s.fmf\n", games[nextgame].gamedir));
|
||||
#if 1
|
||||
localcmd(sprintf("fs_changegame %s %s.fmf\n", games[nextgame].gamedir, games[nextgame].gamedir));
|
||||
#else
|
||||
/* some games/mods inherit other directories */
|
||||
if (games[nextgame].fallback_dir) {
|
||||
|
@ -366,7 +363,10 @@ customgame_btnactivate_start(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
localcmd("stopmusic\nsnd_restart\nwait\nvid_reload\nmenu_restart\nmenu_customgame\n");
|
||||
localcmd("stopmusic\nsnd_restart\nwait\nvid_reload\n");
|
||||
localcmd("menu_restart\n");
|
||||
localcmd("menu_customgame\n");
|
||||
localcmd("menu_musicstart\n");
|
||||
cvar_init();
|
||||
}
|
||||
|
||||
|
@ -393,10 +393,11 @@ customgame_btninstall_start(void)
|
|||
void
|
||||
customgame_btndeactivate_start(void)
|
||||
{
|
||||
localcmd("gamedir \"\"\n");
|
||||
localcmd(sprintf("fs_changegame %s %s.fmf\n", GAME_DIR, GAME_DIR));
|
||||
localcmd("stopmusic\nsnd_restart\nwait\nvid_reload\n");
|
||||
localcmd("menu_restart\n");
|
||||
localcmd("menu_customgame\n");
|
||||
localcmd("menu_musicstart\n");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -101,6 +101,9 @@ void
|
|||
Music_MenuStart(void)
|
||||
{
|
||||
string tinfo = cvar_string("gameinfo_menutrack");
|
||||
print(tinfo);
|
||||
print("\n");
|
||||
|
||||
if (tinfo) {
|
||||
localcmd(sprintf("music %s\n", tinfo));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue