mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-04 22:32:57 +12:00
Added Roms path
Added an option to the config to set a folder that opens when selecting a game instead of having to navigate to the folder manually every time.
This commit is contained in:
parent
93d5f9901d
commit
1a13795d5d
4 changed files with 24 additions and 5 deletions
|
@ -40,6 +40,7 @@ void EmulatorConfig::load() {
|
|||
|
||||
discordRpcEnabled = toml::find_or<toml::boolean>(general, "EnableDiscordRPC", false);
|
||||
usePortableBuild = toml::find_or<toml::boolean>(general, "UsePortableBuild", false);
|
||||
romsPath = toml::find_or(general, "RomsPath","");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,6 +121,7 @@ void EmulatorConfig::save() {
|
|||
|
||||
data["General"]["EnableDiscordRPC"] = discordRpcEnabled;
|
||||
data["General"]["UsePortableBuild"] = usePortableBuild;
|
||||
data["General"]["RomsPath"] = romsPath;
|
||||
data["GPU"]["EnableShaderJIT"] = shaderJitEnabled;
|
||||
data["GPU"]["Renderer"] = std::string(Renderer::typeToString(rendererType));
|
||||
data["GPU"]["EnableVSync"] = vsyncEnabled;
|
||||
|
@ -135,4 +137,9 @@ void EmulatorConfig::save() {
|
|||
std::ofstream file(path, std::ios::out);
|
||||
file << data;
|
||||
file.close();
|
||||
} std::string EmulatorConfig::getRomsPath() {
|
||||
return EmulatorConfig::romsPath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -142,16 +142,23 @@ void MainWindow::swapEmuBuffer() {
|
|||
}
|
||||
|
||||
void MainWindow::selectROM() {
|
||||
auto path =
|
||||
QFileDialog::getOpenFileName(this, tr("Select 3DS ROM to load"), "", tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)"));
|
||||
if (emu->getConfig().getRomsPath() == "") {
|
||||
auto path =
|
||||
QFileDialog::getOpenFileName(this, tr("Select 3DS ROM to load"),"", tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)"));
|
||||
} else {
|
||||
QString Rompath = QString::fromStdString(emu->getConfig().getRomsPath());
|
||||
auto path =
|
||||
QFileDialog::getOpenFileName(this, tr("Select 3DS ROM to load"), Rompath, tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)"));
|
||||
|
||||
if (!path.isEmpty()) {
|
||||
std::filesystem::path* p = new std::filesystem::path(path.toStdU16String());
|
||||
|
||||
EmulatorMessage message{.type = MessageType::LoadROM};
|
||||
message.path.p = p;
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::selectLuaFile() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue