Menus: Add "Save Setup" menu, currently for standalone builds only

git-svn-id: https://svn.eduke32.com/eduke32@6742 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2018-03-08 03:55:12 +00:00
parent 3d8e1afba9
commit b80501b2c2
8 changed files with 27 additions and 1 deletions

View file

@ -281,6 +281,7 @@ void CONFIG_SetDefaults(void)
ud.menu_scrollbartilenum = -1;
ud.menu_scrollbarz = 65536;
ud.menu_scrollcursorz = 65536;
ud.autosave = 1;
ud.config.CheckForUpdates = 1;

View file

@ -189,6 +189,8 @@ typedef struct {
int32_t default_volume, default_skill;
int32_t autosave;
int32_t returnvar[MAX_RETURN_VALUES-1];
uint32_t userbytever;

View file

@ -1308,6 +1308,7 @@ const memberlabel_t UserdefsLabels[]=
{ "menu_scrollcursorz", USERDEFS_MENU_SCROLLCURSORZ, 0, 0 },
{ "return", USERDEFS_RETURN, LABEL_HASPARM2, MAX_RETURN_VALUES },
{ "userbyteversion", USERDEFS_USERBYTEVERSION, 0, 0 },
{ "autosave", USERDEFS_AUTOSAVE, 0, 0 },
{ NULL, -1, 0, 0 } // END OF LIST
};

View file

@ -602,6 +602,7 @@ enum UserdefsLabel_t
USERDEFS_MENU_SCROLLCURSORZ,
USERDEFS_RETURN,
USERDEFS_USERBYTEVERSION,
USERDEFS_AUTOSAVE,
USERDEFS_END
};

View file

@ -231,6 +231,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int32_t const lParm2)
labelNum = ud.returnvar[lParm2-1];
break;
case USERDEFS_USERBYTEVERSION: labelNum = ud.userbytever; break;
case USERDEFS_AUTOSAVE: labelNum = ud.autosave; break;
default: labelNum = -1; break;
}
@ -419,7 +420,7 @@ void __fastcall VM_SetUserdef(int32_t const labelNum, int32_t const lParm2, int3
else
ud.returnvar[lParm2-1] = iSet;
break;
case USERDEFS_USERBYTEVERSION: ud.userbytever = iSet; break;
case USERDEFS_AUTOSAVE: ud.autosave = iSet; break;
default: break;
}
}

View file

@ -385,6 +385,11 @@ static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_C
static MenuEntry_t ME_SKILL[MAXSKILLS];
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
#ifdef EDUKE32_SIMPLE_MENU
static MenuLink_t MEO_GAMESETUP_SAVESETUP = { MENU_SAVESETUP, MA_Advance, };
static MenuEntry_t ME_GAMESETUP_SAVESETUP = MAKE_MENUENTRY( "Save setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_SAVESETUP, Link );
#endif
#if defined STARTUP_SETUP_WINDOW && !defined EDUKE32_SIMPLE_MENU
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.ForceSetup );
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
@ -681,6 +686,7 @@ static MenuEntry_t *MEL_OPTIONS[] = {
&ME_OPTIONS_TOUCHSETUP,
#endif
#ifdef EDUKE32_SIMPLE_MENU
&ME_GAMESETUP_SAVESETUP,
&ME_OPTIONS_CHEATS
#endif
};
@ -1208,6 +1214,15 @@ static MenuEntry_t *MEL_ADVSOUND[] = {
&ME_SOUND_RESTART,
};
static MenuOption_t MEO_SAVESETUP_AUTOSAVE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.autosave );
static MenuEntry_t ME_SAVESETUP_AUTOSAVE = MAKE_MENUENTRY( "Autosaves:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SAVESETUP_AUTOSAVE, Option );
static MenuEntry_t *MEL_SAVESETUP[] = {
&ME_SAVESETUP_AUTOSAVE,
};
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, NETWORK_PLAYERSETUP, MENU_PLAYER );
MAKE_MENU_TOP_ENTRYLINK( "Join Game", MEF_CenterMenu, NETWORK_JOINGAME, MENU_NETJOIN );
MAKE_MENU_TOP_ENTRYLINK( "Host Game", MEF_CenterMenu, NETWORK_HOSTGAME, MENU_NETHOST );
@ -1365,6 +1380,7 @@ static MenuMenu_t M_LOAD = MAKE_MENUMENU_CUSTOMSIZE( s_LoadGame, &MMF_LoadSave,
static MenuMenu_t M_SAVE = MAKE_MENUMENU_CUSTOMSIZE( s_SaveGame, &MMF_LoadSave, MEL_SAVE );
static MenuMenu_t M_SOUND = MAKE_MENUMENU( "Sound Setup", &MMF_BigOptions, MEL_SOUND );
static MenuMenu_t M_ADVSOUND = MAKE_MENUMENU( "Advanced Sound", &MMF_BigOptions, MEL_ADVSOUND );
static MenuMenu_t M_SAVESETUP = MAKE_MENUMENU( "Save Setup", &MMF_BigOptions, MEL_SAVESETUP );
static MenuMenu_t M_NETWORK = MAKE_MENUMENU( "Network Game", &MMF_Top_Joystick_Network, MEL_NETWORK );
static MenuMenu_t M_PLAYER = MAKE_MENUMENU( "Player Setup", &MMF_SmallOptions, MEL_PLAYER );
static MenuMenu_t M_MACROS = MAKE_MENUMENU( "Multiplayer Macros", &MMF_Macros, MEL_MACROS );
@ -1459,6 +1475,7 @@ static Menu_t Menus[] = {
{ &M_SOUND, MENU_SOUND, MENU_OPTIONS, MA_Return, Menu },
{ &M_SOUND, MENU_SOUND_INGAME, MENU_CLOSE, MA_Return, Menu },
{ &M_ADVSOUND, MENU_ADVSOUND, MENU_SOUND, MA_Return, Menu },
{ &M_SAVESETUP, MENU_SAVESETUP, MENU_OPTIONS, MA_Return, Menu },
#ifdef EDUKE32_SIMPLE_MENU
{ &M_CHEATS, MENU_CHEATS, MENU_OPTIONS, MA_Return, Menu },
#else

View file

@ -80,6 +80,7 @@ enum MenuIndex_t {
MENU_SOUND = 700,
MENU_SOUND_INGAME = 701,
MENU_ADVSOUND = 702,
MENU_SAVESETUP = 750,
MENU_CHEATS = 800,
MENU_CHEATENTRY = 801,
MENU_CHEAT_WARP = 802,

View file

@ -1721,6 +1721,8 @@ int32_t registerosdcommands(void)
{ "snd_reversestereo", "reverses the stereo channels", (void *)&ud.config.ReverseStereo, CVAR_BOOL, 0, 1 },
{ "snd_speech", "enables/disables player speech", (void *)&ud.config.VoiceToggle, CVAR_INT, 0, 5 },
{ "sv_autosave", "enable/disable autosaves", (void *)&ud.autosave, CVAR_BOOL, 0, 1 },
{ "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 },
#ifdef EDUKE32_TOUCH_DEVICES