Trigger save slot display from UI code.

Core shouldn't be calling UI code.
This commit is contained in:
Unknown W. Brackets 2016-05-27 20:53:20 -07:00
parent afdd01571c
commit e6cf296d1a
4 changed files with 8 additions and 3 deletions

View file

@ -379,10 +379,7 @@ namespace SaveState
void NextSlot()
{
I18NCategory *sy = GetI18NCategory("System");
g_Config.iCurrentStateSlot = (g_Config.iCurrentStateSlot + 1) % NUM_SLOTS;
std::string msg = StringFromFormat("%s: %d", sy->T("Savestate Slot"), g_Config.iCurrentStateSlot + 1);
osm.Show(msg);
}
void LoadSlot(const std::string &gameFilename, int slot, Callback callback, void *cbUserData)

View file

@ -398,6 +398,7 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
break;
case VIRTKEY_NEXT_SLOT:
SaveState::NextSlot();
NativeMessageReceived("savestate_displayslot", "");
break;
case VIRTKEY_TOGGLE_FULLSCREEN:
System_SendMessage("toggle_fullscreen", "");

View file

@ -766,6 +766,11 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
g_Config.sNickName = inputboxValue[1];
inputboxValue.clear();
}
if (msg == "savestate_displayslot") {
I18NCategory *sy = GetI18NCategory("System");
std::string msg = StringFromFormat("%s: %d", sy->T("Savestate Slot"), SaveState::GetCurrentSlot() + 1);
osm.Show(msg);
}
}
void NativeUpdate(InputState &input) {

View file

@ -580,6 +580,7 @@ namespace MainWindow {
case ID_FILE_SAVESTATE_NEXT_SLOT:
{
SaveState::NextSlot();
NativeMessageReceived("savestate_displayslot", "");
break;
}
@ -588,6 +589,7 @@ namespace MainWindow {
if (KeyMap::g_controllerMap[VIRTKEY_NEXT_SLOT].empty())
{
SaveState::NextSlot();
NativeMessageReceived("savestate_displayslot", "");
}
break;
}