mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-08-04 15:18:52 +00:00
Added rom path (#474)
* Added app icon to the window * 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. * Clear up PR * Clear up PR --------- Co-authored-by: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
This commit is contained in:
parent
5284109fd4
commit
429dc2a944
3 changed files with 9 additions and 3 deletions
|
@ -29,6 +29,8 @@ struct EmulatorConfig {
|
||||||
// Default to 3% battery to make users suffer
|
// Default to 3% battery to make users suffer
|
||||||
int batteryPercentage = 3;
|
int batteryPercentage = 3;
|
||||||
|
|
||||||
|
// Default ROM path to open in Qt and misc frontends
|
||||||
|
std::filesystem::path defaultRomPath = "";
|
||||||
std::filesystem::path filePath;
|
std::filesystem::path filePath;
|
||||||
|
|
||||||
EmulatorConfig(const std::filesystem::path& path);
|
EmulatorConfig(const std::filesystem::path& path);
|
||||||
|
|
|
@ -40,6 +40,7 @@ void EmulatorConfig::load() {
|
||||||
|
|
||||||
discordRpcEnabled = toml::find_or<toml::boolean>(general, "EnableDiscordRPC", false);
|
discordRpcEnabled = toml::find_or<toml::boolean>(general, "EnableDiscordRPC", false);
|
||||||
usePortableBuild = toml::find_or<toml::boolean>(general, "UsePortableBuild", false);
|
usePortableBuild = toml::find_or<toml::boolean>(general, "UsePortableBuild", false);
|
||||||
|
defaultRomPath = toml::find_or<std::string>(general, "DefaultRomPath", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +121,7 @@ void EmulatorConfig::save() {
|
||||||
|
|
||||||
data["General"]["EnableDiscordRPC"] = discordRpcEnabled;
|
data["General"]["EnableDiscordRPC"] = discordRpcEnabled;
|
||||||
data["General"]["UsePortableBuild"] = usePortableBuild;
|
data["General"]["UsePortableBuild"] = usePortableBuild;
|
||||||
|
data["General"]["DefaultRomPath"] = defaultRomPath.string();
|
||||||
data["GPU"]["EnableShaderJIT"] = shaderJitEnabled;
|
data["GPU"]["EnableShaderJIT"] = shaderJitEnabled;
|
||||||
data["GPU"]["Renderer"] = std::string(Renderer::typeToString(rendererType));
|
data["GPU"]["Renderer"] = std::string(Renderer::typeToString(rendererType));
|
||||||
data["GPU"]["EnableVSync"] = vsyncEnabled;
|
data["GPU"]["EnableVSync"] = vsyncEnabled;
|
||||||
|
|
|
@ -139,8 +139,10 @@ void MainWindow::swapEmuBuffer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::selectROM() {
|
void MainWindow::selectROM() {
|
||||||
auto path =
|
auto path = QFileDialog::getOpenFileName(
|
||||||
QFileDialog::getOpenFileName(this, tr("Select 3DS ROM to load"), "", tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)"));
|
this, tr("Select 3DS ROM to load"), QString::fromStdU16String(emu->getConfig().defaultRomPath.u16string()),
|
||||||
|
tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)")
|
||||||
|
);
|
||||||
|
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
std::filesystem::path* p = new std::filesystem::path(path.toStdU16String());
|
std::filesystem::path* p = new std::filesystem::path(path.toStdU16String());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue