mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 23:59:27 +01:00
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
|
#endif
|
||||||
const Info<bool> MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true};
|
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<bool> MAIN_RECURSIVE_ISO_PATHS{{System::Main, "General", "RecursiveISOPaths"}, false};
|
||||||
|
const Info<std::string> MAIN_CURRENT_STATE_PATH{{System::Main, "General", "CurrentStatePath"}, ""};
|
||||||
|
|
||||||
} // namespace Config
|
} // 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_USE_GAME_COVERS;
|
||||||
extern const Info<bool> MAIN_FOCUSED_HOTKEYS;
|
extern const Info<bool> MAIN_FOCUSED_HOTKEYS;
|
||||||
extern const Info<bool> MAIN_RECURSIVE_ISO_PATHS;
|
extern const Info<bool> MAIN_RECURSIVE_ISO_PATHS;
|
||||||
|
extern const Info<std::string> MAIN_CURRENT_STATE_PATH;
|
||||||
|
|
||||||
} // namespace Config
|
} // namespace Config
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "Core/Config/AchievementSettings.h"
|
#include "Core/Config/AchievementSettings.h"
|
||||||
#include "Core/Config/MainSettings.h"
|
#include "Core/Config/MainSettings.h"
|
||||||
#include "Core/Config/NetplaySettings.h"
|
#include "Core/Config/NetplaySettings.h"
|
||||||
|
#include "Core/Config/UISettings.h"
|
||||||
#include "Core/Config/WiimoteSettings.h"
|
#include "Core/Config/WiimoteSettings.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/FreeLookManager.h"
|
#include "Core/FreeLookManager.h"
|
||||||
@ -1404,18 +1405,24 @@ void MainWindow::ShowInfinityBase()
|
|||||||
|
|
||||||
void MainWindow::StateLoad()
|
void MainWindow::StateLoad()
|
||||||
{
|
{
|
||||||
QString path =
|
QString dialog_path = (Config::Get(Config::MAIN_CURRENT_STATE_PATH).empty()) ?
|
||||||
DolphinFileDialog::getOpenFileName(this, tr("Select a File"), QDir::currentPath(),
|
QDir::currentPath() :
|
||||||
tr("All Save States (*.sav *.s##);; All Files (*)"));
|
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())
|
if (!path.isEmpty())
|
||||||
State::LoadAs(path.toStdString());
|
State::LoadAs(path.toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::StateSave()
|
void MainWindow::StateSave()
|
||||||
{
|
{
|
||||||
QString path =
|
QString dialog_path = (Config::Get(Config::MAIN_CURRENT_STATE_PATH).empty()) ?
|
||||||
DolphinFileDialog::getSaveFileName(this, tr("Select a File"), QDir::currentPath(),
|
QDir::currentPath() :
|
||||||
tr("All Save States (*.sav *.s##);; All Files (*)"));
|
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())
|
if (!path.isEmpty())
|
||||||
State::SaveAs(path.toStdString());
|
State::SaveAs(path.toStdString());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user