Add quick save and quick load to the keyboard configuration menu

git-svn-id: https://svn.eduke32.com/eduke32@6876 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-05-04 22:42:31 +00:00
parent 00d1c5fc5b
commit 2e45801d43
3 changed files with 15 additions and 8 deletions

View file

@ -112,12 +112,12 @@ char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] =
"Dpad_Aiming", "Dpad_Aiming",
"Alternate_Weapon", "Alternate_Weapon",
"Last_Used_Weapon", "Last_Used_Weapon",
"Quick_Save",
"Quick_Load",
}; };
#ifdef __SETUP__ #ifdef __SETUP__
#define NUMKEYENTRIES 58
const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] = const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{ {
"W", "Kpad8", "W", "Kpad8",
@ -178,6 +178,8 @@ const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
"", "", "", "",
"", "", "", "",
"", "", "", "",
"F6", "",
"F9", "",
}; };
const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] = const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
@ -240,6 +242,8 @@ const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
"", "", "", "",
"", "", "", "",
"", "", "", "",
"F6", "",
"F9", "",
}; };
static const char * mousedefaults[MAXMOUSEBUTTONS] = static const char * mousedefaults[MAXMOUSEBUTTONS] =

View file

@ -34,8 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
extern "C" { extern "C" {
#endif #endif
#define NUMKEYENTRIES 58 #define NUMGAMEFUNCTIONS 60
#define NUMGAMEFUNCTIONS 58
#define MAXGAMEFUNCLEN 32 #define MAXGAMEFUNCLEN 32
extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
@ -102,6 +101,8 @@ enum GameFunction_t
gamefunc_Dpad_Aiming, gamefunc_Dpad_Aiming,
gamefunc_Alt_Weapon, gamefunc_Alt_Weapon,
gamefunc_Last_Weapon, gamefunc_Last_Weapon,
gamefunc_Quick_Save,
gamefunc_Quick_Load,
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -4898,9 +4898,9 @@ FAKE_F3:
P_DoQuote(QUOTE_MUSIC, g_player[myconnectindex].ps); P_DoQuote(QUOTE_MUSIC, g_player[myconnectindex].ps);
} }
if ((KB_UnBoundKeyPressed(sc_F6) || g_doQuickSave == 1) && (g_player[myconnectindex].ps->gm&MODE_GAME)) if ((BUTTON(gamefunc_Quick_Save) || g_doQuickSave == 1) && (g_player[myconnectindex].ps->gm&MODE_GAME))
{ {
KB_ClearKeyDown(sc_F6); CONTROL_ClearButton(gamefunc_Quick_Save);
g_doQuickSave = 0; g_doQuickSave = 0;
@ -4957,9 +4957,9 @@ FAKE_F3:
ud.fta_on = fta; ud.fta_on = fta;
} }
if ((KB_UnBoundKeyPressed(sc_F9) || g_doQuickSave == 2) && (g_player[myconnectindex].ps->gm&MODE_GAME)) if ((BUTTON(gamefunc_Quick_Load) || g_doQuickSave == 2) && (g_player[myconnectindex].ps->gm&MODE_GAME))
{ {
KB_ClearKeyDown(sc_F9); CONTROL_ClearButton(gamefunc_Quick_Load);
g_doQuickSave = 0; g_doQuickSave = 0;
@ -7190,4 +7190,6 @@ static void G_SetupGameButtons(void)
CONTROL_DefineFlag(gamefunc_Previous_Weapon,FALSE); CONTROL_DefineFlag(gamefunc_Previous_Weapon,FALSE);
CONTROL_DefineFlag(gamefunc_Alt_Weapon,FALSE); CONTROL_DefineFlag(gamefunc_Alt_Weapon,FALSE);
CONTROL_DefineFlag(gamefunc_Last_Weapon,FALSE); CONTROL_DefineFlag(gamefunc_Last_Weapon,FALSE);
CONTROL_DefineFlag(gamefunc_Quick_Save, FALSE);
CONTROL_DefineFlag(gamefunc_Quick_Load, FALSE);
} }