Win32 - Next save slot and Previous save slot menu items added.

This commit is contained in:
adelikat 2008-12-26 23:49:45 +00:00
parent d3697ca84e
commit e7cf0d62c6
5 changed files with 32 additions and 3 deletions

View File

@ -149,6 +149,7 @@ void FCEUD_SoundToggle(void);
void FCEUD_SoundVolumeAdjust(int);
int FCEUI_SelectState(int, int);
extern void FCEUI_SelectStateNext(int);
//"fname" overrides the default save state filename code if non-NULL.
void FCEUI_SaveState(const char *fname);
@ -317,6 +318,7 @@ void FCEUD_VideoChanged();
enum EFCEUI
{
FCEUI_STOPAVI, FCEUI_QUICKSAVE, FCEUI_QUICKLOAD, FCEUI_SAVESTATE, FCEUI_LOADSTATE,
FCEUI_NEXTSAVESTATE,FCEUI_PREVIOUSSAVESTATE,
FCEUI_STOPMOVIE, FCEUI_RECORDMOVIE, FCEUI_PLAYMOVIE,
FCEUI_OPENGAME, FCEUI_CLOSEGAME,
FCEUI_TASEDIT,

View File

@ -49,6 +49,9 @@ BEGIN
MENUITEM "Save State", MENU_SAVESTATE
MENUITEM "Load State From...", MENU_LOAD_STATE
MENUITEM "Save State As...", MENU_SAVE_STATE
MENUITEM SEPARATOR
MENUITEM "Next save slot", MENU_NEXTSAVESTATE
MENUITEM "Previous save slot", MENU_PREVIOUSSAVESTATE
END
POPUP "Movie"
BEGIN

View File

@ -657,6 +657,10 @@
#define ID_LOADSTATE 40342
#define MENU_LOADSTATE 40343
#define MENU_SAVESTATE 40344
#define ID_SAVESTATE_NEXTSAVESLOT 40345
#define ID_SAVESTATE_PREVIOUSSAVESLOT 40346
#define MENU_NEXTSAVESTATE 40347
#define MENU_PREVIOUSSAVESTATE 40348
#define IDC_DEBUGGER_ICONTRAY 55535
#define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426
@ -666,7 +670,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 125
#define _APS_NEXT_COMMAND_VALUE 40345
#define _APS_NEXT_COMMAND_VALUE 40349
#define _APS_NEXT_CONTROL_VALUE 1199
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -957,13 +957,18 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case MENU_LOADSTATE: //Load State
FCEUI_LoadState(0);
break;
case MENU_SAVE_STATE: //Save state as
FCEUD_SaveStateAs();
break;
case MENU_LOAD_STATE: //Load state as
FCEUD_LoadStateFrom();
break;
case MENU_NEXTSAVESTATE: //Next Save slot
FCEUI_SelectStateNext(1);
break;
case MENU_PREVIOUSSAVESTATE: //Previous Save slot
FCEUI_SelectStateNext(-1);
break;
//Movie submenu
case FCEUX_CONTEXT_RECORDMOVIE:
@ -1454,7 +1459,9 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
EnableMenuItem(fceumenu,MENU_LOADSTATE,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_QUICKLOAD)?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_SAVE_STATE,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_SAVESTATE)?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_LOAD_STATE,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_LOADSTATE)?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_STOP_AVI,MF_BYCOMMAND | (FCEUI_AviIsRecording()?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_NEXTSAVESTATE,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_NEXTSAVESTATE)?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_PREVIOUSSAVESTATE,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_PREVIOUSSAVESTATE)?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_STOP_AVI,MF_BYCOMMAND | (FCEUI_AviIsRecording()?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,MENU_STOP_WAV,MF_BYCOMMAND | (loggingSound?MF_ENABLED:MF_GRAYED));
EnableMenuItem(fceumenu,ID_FILE_STOPLUASCRIPT,MF_BYCOMMAND | (luaRunning?MF_ENABLED:MF_GRAYED));
default:
@ -1926,6 +1933,17 @@ void UpdateMenuHotkeys()
combined = "Save State As...\t" + combo;
ChangeMenuItemText(MENU_SAVE_STATE, combined);
//Next Save Slot
combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_SAVE_SLOT_NEXT]);
combined = "Next save slot\t" + combo;
ChangeMenuItemText(MENU_NEXTSAVESTATE, combined);
//Previous Save Slot
combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_SAVE_SLOT_PREV]);
combined = "Previous save slot\t" + combo;
ChangeMenuItemText(MENU_PREVIOUSSAVESTATE, combined);
//Record Movie
combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_MOVIE_RECORD_TO]);
combined = "Record Movie...\t" + combo;

View File

@ -941,6 +941,8 @@ bool FCEU_IsValidUI(EFCEUI ui)
case FCEUI_QUICKLOAD:
case FCEUI_SAVESTATE:
case FCEUI_LOADSTATE:
case FCEUI_NEXTSAVESTATE:
case FCEUI_PREVIOUSSAVESTATE:
if(!GameInfo) return false;
if(FCEUMOV_Mode(MOVIEMODE_TASEDIT)) return false;
break;