Merge pull request #12565 from LillyJadeKatrin/retroachievements-bugfix
Retain Save State Folder
This commit is contained in:
commit
ca81d8b8a6
|
@ -15,5 +15,6 @@ const Info<bool> MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}
|
|||
#endif
|
||||
const Info<bool> MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true};
|
||||
const Info<bool> MAIN_RECURSIVE_ISO_PATHS{{System::Main, "General", "RecursiveISOPaths"}, false};
|
||||
const Info<std::string> MAIN_CURRENT_STATE_PATH{{System::Main, "General", "CurrentStatePath"}, ""};
|
||||
|
||||
} // namespace Config
|
||||
|
|
|
@ -19,5 +19,6 @@ extern const Info<bool> MAIN_USE_DISCORD_PRESENCE;
|
|||
extern const Info<bool> MAIN_USE_GAME_COVERS;
|
||||
extern const Info<bool> MAIN_FOCUSED_HOTKEYS;
|
||||
extern const Info<bool> MAIN_RECURSIVE_ISO_PATHS;
|
||||
extern const Info<std::string> MAIN_CURRENT_STATE_PATH;
|
||||
|
||||
} // namespace Config
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "Core/Config/AchievementSettings.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/Config/UISettings.h"
|
||||
#include "Core/Config/WiimoteSettings.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/FreeLookManager.h"
|
||||
|
@ -1404,18 +1405,24 @@ void MainWindow::ShowInfinityBase()
|
|||
|
||||
void MainWindow::StateLoad()
|
||||
{
|
||||
QString path =
|
||||
DolphinFileDialog::getOpenFileName(this, tr("Select a File"), QDir::currentPath(),
|
||||
tr("All Save States (*.sav *.s##);; All Files (*)"));
|
||||
QString dialog_path = (Config::Get(Config::MAIN_CURRENT_STATE_PATH).empty()) ?
|
||||
QDir::currentPath() :
|
||||
QString::fromStdString(Config::Get(Config::MAIN_CURRENT_STATE_PATH));
|
||||
QString path = DolphinFileDialog::getOpenFileName(
|
||||
this, tr("Select a File"), dialog_path, tr("All Save States (*.sav *.s##);; All Files (*)"));
|
||||
Config::SetBase(Config::MAIN_CURRENT_STATE_PATH, QFileInfo(path).dir().path().toStdString());
|
||||
if (!path.isEmpty())
|
||||
State::LoadAs(path.toStdString());
|
||||
}
|
||||
|
||||
void MainWindow::StateSave()
|
||||
{
|
||||
QString path =
|
||||
DolphinFileDialog::getSaveFileName(this, tr("Select a File"), QDir::currentPath(),
|
||||
tr("All Save States (*.sav *.s##);; All Files (*)"));
|
||||
QString dialog_path = (Config::Get(Config::MAIN_CURRENT_STATE_PATH).empty()) ?
|
||||
QDir::currentPath() :
|
||||
QString::fromStdString(Config::Get(Config::MAIN_CURRENT_STATE_PATH));
|
||||
QString path = DolphinFileDialog::getSaveFileName(
|
||||
this, tr("Select a File"), dialog_path, tr("All Save States (*.sav *.s##);; All Files (*)"));
|
||||
Config::SetBase(Config::MAIN_CURRENT_STATE_PATH, QFileInfo(path).dir().path().toStdString());
|
||||
if (!path.isEmpty())
|
||||
State::SaveAs(path.toStdString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue