uiScript resetDefaults

This commit is contained in:
Andrei Drexler 2011-08-06 22:27:31 +00:00
parent bad77c913d
commit 90ffa604bb

View file

@ -6097,9 +6097,18 @@ static void UI_RunMenuScript(char **args)
UI_GameType_HandleKey(0, 0, K_MOUSE1, qfalse);
UI_GameType_HandleKey(0, 0, K_MOUSE2, qfalse);
} else if (Q_stricmp(name, "resetDefaults") == 0) {
trap_Cmd_ExecuteText(EXEC_APPEND, "exec default.cfg\n");
// Makro - changed the order a bit
// First we reset the cvars, then we exec default.cfg to have
// all of them initialized with the proper values, even (c)game cvars
// when (c)game isn't loaded yet.
// Also, Controls_SetDefaults() is no longer called because we already
// set up default bindings in default.cfg
trap_Cmd_ExecuteText(EXEC_APPEND, "cvar_restart\n");
Controls_SetDefaults();
trap_Cmd_ExecuteText(EXEC_APPEND, "exec default.cfg\n");
//Controls_SetDefaults();
trap_Cvar_Set("com_introPlayed", "1");
trap_Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
} else if (Q_stricmp(name, "getCDKey") == 0) {