UI: Added shortcuts to select a specific save slot

This commit is contained in:
Sour 2019-12-23 14:50:34 -05:00
parent 515fd45aa9
commit 11720fd30d
16 changed files with 165 additions and 1 deletions

View file

@ -394,6 +394,16 @@ enum class EmulatorShortcut
RewindTenSecs,
RewindOneMin,
SelectSaveSlot1,
SelectSaveSlot2,
SelectSaveSlot3,
SelectSaveSlot4,
SelectSaveSlot5,
SelectSaveSlot6,
SelectSaveSlot7,
SelectSaveSlot8,
SelectSaveSlot9,
SelectSaveSlot10,
MoveToNextStateSlot,
MoveToPreviousStateSlot,
SaveState,

View file

@ -36,6 +36,12 @@ uint64_t SaveStateManager::GetStateInfo(int stateIndex)
return 0;
}
void SaveStateManager::SelectSaveSlot(int slotIndex)
{
_lastIndex = slotIndex;
MessageManager::DisplayMessage("SaveStates", "SaveStateSlotSelected", std::to_string(_lastIndex));
}
void SaveStateManager::MoveToNextSlot()
{
_lastIndex = (_lastIndex % MaxIndex) + 1;

View file

@ -35,6 +35,7 @@ public:
void SaveRecentGame(string romName, string romPath, string patchPath);
void LoadRecentGame(string filename, bool resetGame);
void SelectSaveSlot(int slotIndex);
void MoveToNextSlot();
void MoveToPreviousSlot();
};

View file

@ -180,6 +180,12 @@ void ShortcutKeyHandler::CheckMappedKeys()
}
}
for(int i = 0; i < 10; i++) {
if(DetectKeyPress((EmulatorShortcut)((int)EmulatorShortcut::SelectSaveSlot1 + i))) {
_console->GetSaveStateManager()->SelectSaveSlot(i + 1);
}
}
if(DetectKeyPress(EmulatorShortcut::MoveToNextStateSlot)) {
_console->GetSaveStateManager()->MoveToNextSlot();
}

View file

@ -922,6 +922,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Load State - Auto Save Slot</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Carrega la partida des d'un fitxer</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Load Last Session</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Obre un fitxer</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Obre el depurador</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Obre l'assemblador</Message>

View file

@ -955,6 +955,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Load State - Auto Save Slot</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Load State from File</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Load Last Session</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Open File</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Open Debugger</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Open Assembler</Message>

View file

@ -939,6 +939,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Cargar partida - Hueco de auto guardado</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Cargar partida de archivo</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Cargar última sesión</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Abrir archivo</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Abrir depurador</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Abrir ensamblador</Message>

View file

@ -953,6 +953,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Chargement d'état - Sauvegarde auto</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Charger l'état à partir d'un fichier</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Charger la session précédente</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Choisir position de sauvegarde 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Choisir position de sauvegarde 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Choisir position de sauvegarde 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Choisir position de sauvegarde 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Choisir position de sauvegarde 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Choisir position de sauvegarde 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Choisir position de sauvegarde 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Choisir position de sauvegarde 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Choisir position de sauvegarde 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Choisir position de sauvegarde 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Ouvrir un fichier</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Ouvrir le débogueur</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Ouvrir l'assembleur</Message>

View file

@ -955,6 +955,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Carica Stato - Slot Salvataggio Automatico</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Carica Stato da File</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Carica Ultima Sessione</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Apri File</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Apri Debugger</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Apri Assembler</Message>

View file

@ -941,6 +941,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">自動クイックセーブスロットからロードする</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">クイックセーブデータをファイルからロードする</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">前セッションをロードする</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">クイックセーブスロット1を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">クイックセーブスロット2を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">クイックセーブスロット3を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">クイックセーブスロット4を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">クイックセーブスロット5を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">クイックセーブスロット6を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">クイックセーブスロット7を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">クイックセーブスロット8を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">クイックセーブスロット9を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">クイックセーブスロット10を選ぶ</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">ファイルを開く</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">デバッガを開く</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">アセンブラを開く</Message>

View file

@ -955,6 +955,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Carregar estado - Compartimento de salvamento automático</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Carregar estado de arquivo</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Carregar a última sessão</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Abrir arquivo</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Abrir depurador</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Abrir assembler</Message>

View file

@ -941,6 +941,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Load State - Auto Save Slot</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Load State from File</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Load Last Session</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Open File</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Open Debugger</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Open Assembler</Message>

View file

@ -941,6 +941,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">Завантаження стану - Автозавантаження</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">Завантажити стан з файлу</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">Завантажити останню сесію</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">Відкрити файл</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">Відкрити налагоджувач</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">Відкрити асемблер</Message>

View file

@ -960,6 +960,18 @@
<Message ID="EmulatorShortcutMappings_LoadStateSlotAuto">载入自动进度</Message>
<Message ID="EmulatorShortcutMappings_LoadStateFromFile">载入进度文件</Message>
<Message ID="EmulatorShortcutMappings_LoadLastSession">载入上次会话</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot1">Select Save Slot 1</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot2">Select Save Slot 2</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot3">Select Save Slot 3</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot4">Select Save Slot 4</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot5">Select Save Slot 5</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot6">Select Save Slot 6</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot7">Select Save Slot 7</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot8">Select Save Slot 8</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot9">Select Save Slot 9</Message>
<Message ID="EmulatorShortcutMappings_SelectSaveSlot10">Select Save Slot 10</Message>
<Message ID="EmulatorShortcutMappings_OpenFile">打开文件</Message>
<Message ID="EmulatorShortcutMappings_OpenDebugger">打开调试器</Message>
<Message ID="EmulatorShortcutMappings_OpenAssembler">打开反编译</Message>

View file

@ -117,6 +117,18 @@ namespace Mesen.GUI.Forms.Config
EmulatorShortcut.LoadStateSlot10,
EmulatorShortcut.LoadStateSlotAuto,
EmulatorShortcut.LoadStateFromFile,
EmulatorShortcut.SelectSaveSlot1,
EmulatorShortcut.SelectSaveSlot2,
EmulatorShortcut.SelectSaveSlot3,
EmulatorShortcut.SelectSaveSlot4,
EmulatorShortcut.SelectSaveSlot5,
EmulatorShortcut.SelectSaveSlot6,
EmulatorShortcut.SelectSaveSlot7,
EmulatorShortcut.SelectSaveSlot8,
EmulatorShortcut.SelectSaveSlot9,
EmulatorShortcut.SelectSaveSlot10,
EmulatorShortcut.LoadLastSession,
};

View file

@ -1895,6 +1895,16 @@ namespace Mesen.GUI
RewindTenSecs,
RewindOneMin,
SelectSaveSlot1,
SelectSaveSlot2,
SelectSaveSlot3,
SelectSaveSlot4,
SelectSaveSlot5,
SelectSaveSlot6,
SelectSaveSlot7,
SelectSaveSlot8,
SelectSaveSlot9,
SelectSaveSlot10,
MoveToNextStateSlot,
MoveToPreviousStateSlot,
SaveState,
@ -1982,7 +1992,6 @@ namespace Mesen.GUI
LoadLastSession,
OpenFile,
//Deprecated shortcuts
OpenDebugger = 0xFFFF,