Trigger save slot display from UI code.
Core shouldn't be calling UI code.
This commit is contained in:
parent
afdd01571c
commit
e6cf296d1a
4 changed files with 8 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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", "");
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue