"Next Slot" control mapping

-added "Next Slot" to control mapping menu
-added VIRTKEY_NEXT_SLOT -> incremented VIRTKEY_TOGGLE_FULLSCREEN
-added SaveState::NextSlot(); as replacement for code in
WndMainWindow
-added entry in EmuScreen using SaveState::NextSlot();
This commit is contained in:
zack-vii 2014-01-07 15:56:04 +01:00
parent eea5b07e1a
commit 26fbb4c32c
6 changed files with 18 additions and 6 deletions

View File

@ -611,6 +611,7 @@ const KeyMap_IntStrPair psp_button_names[] = {
#endif
{VIRTKEY_SAVE_STATE, "Save State"},
{VIRTKEY_LOAD_STATE, "Load State"},
{VIRTKEY_NEXT_SLOT, "Next Slot"},
#if !defined(_WIN32) && !defined(USING_GLES2)
{VIRTKEY_TOGGLE_FULLSCREEN, "Toggle Fullscreen"},
#endif

View File

@ -43,7 +43,8 @@ enum {
VIRTKEY_REWIND = 0x1000c,
VIRTKEY_SAVE_STATE = 0x1000d,
VIRTKEY_LOAD_STATE = 0x1000e,
VIRTKEY_TOGGLE_FULLSCREEN = 0x1000f,
VIRTKEY_NEXT_SLOT = 0x1000f,
VIRTKEY_TOGGLE_FULLSCREEN = 0x10010,
VIRTKEY_LAST,
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
};

View File

@ -224,6 +224,15 @@ namespace SaveState
}
}
void NextSlot()
{
I18NCategory *sy = GetI18NCategory("System");
g_Config.iCurrentStateSlot = (g_Config.iCurrentStateSlot + 1) % SaveState::SAVESTATESLOTS;
char msg[30];
sprintf(msg, "%s: %d", sy->T("Savestate Slot"), g_Config.iCurrentStateSlot + 1);
osm.Show(msg);
}
void LoadSlot(int slot, Callback callback, void *cbUserData)
{
std::string fn = GenerateSaveSlotFilename(slot, STATE_EXTENSION);

View File

@ -29,6 +29,8 @@ namespace SaveState
void Init();
// Cycle through the 5 savestate slots
void NextSlot();
void SaveSlot(int slot, Callback callback, void *cbUserData = 0);
void LoadSlot(int slot, Callback callback, void *cbUserData = 0);
// Checks whether there's an existing save in the specified slot.

View File

@ -277,6 +277,9 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
SaveState::LoadSlot(g_Config.iCurrentStateSlot, 0);
}
break;
case VIRTKEY_NEXT_SLOT:
SaveState::NextSlot();
break;
case VIRTKEY_TOGGLE_FULLSCREEN:
System_SendMessage("toggle_fullscreen", "");
break;

View File

@ -1229,11 +1229,7 @@ namespace MainWindow
case ID_FILE_SAVESTATE_NEXT_SLOT:
{
I18NCategory *sy = GetI18NCategory("System");
g_Config.iCurrentStateSlot = (g_Config.iCurrentStateSlot + 1) % SaveState::SAVESTATESLOTS;
char msg[30];
sprintf(msg, "%s: %d", sy->T("Savestate Slot"), g_Config.iCurrentStateSlot + 1);
osm.Show(msg);
SaveState::NextSlot();
break;
}