mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +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
|
@ -475,7 +475,7 @@ if(NOT BUILD_HYDRA_CORE)
|
||||||
qt_add_resources(AlberCore "app_images"
|
qt_add_resources(AlberCore "app_images"
|
||||||
PREFIX "/"
|
PREFIX "/"
|
||||||
FILES
|
FILES
|
||||||
docs/img/rsob_icon.png docs/img/rstarstruck_icon.png
|
docs/img/rsob_icon.png docs/img/rstarstruck_icon.png docs/icon/NewPand.svg
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp src/panda_sdl/frontend_sdl.cpp src/panda_sdl/mappings.cpp)
|
set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp src/panda_sdl/frontend_sdl.cpp src/panda_sdl/mappings.cpp)
|
||||||
|
@ -487,7 +487,9 @@ if(NOT BUILD_HYDRA_CORE)
|
||||||
elseif(BUILD_HYDRA_CORE)
|
elseif(BUILD_HYDRA_CORE)
|
||||||
target_compile_definitions(AlberCore PRIVATE PANDA3DS_HYDRA_CORE=1)
|
target_compile_definitions(AlberCore PRIVATE PANDA3DS_HYDRA_CORE=1)
|
||||||
include_directories(third_party/hydra_core/include)
|
include_directories(third_party/hydra_core/include)
|
||||||
add_library(Alber SHARED src/hydra_core.cpp)
|
add_library(Alber SHARED src/hydra_core.cpp
|
||||||
|
src/panda_qt/main.cpp
|
||||||
|
)
|
||||||
target_link_libraries(Alber PUBLIC AlberCore)
|
target_link_libraries(Alber PUBLIC AlberCore)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,12 @@ struct EmulatorConfig {
|
||||||
// Default to 3% battery to make users suffer
|
// Default to 3% battery to make users suffer
|
||||||
int batteryPercentage = 3;
|
int batteryPercentage = 3;
|
||||||
|
|
||||||
|
std::string romsPath = "";
|
||||||
|
|
||||||
std::filesystem::path filePath;
|
std::filesystem::path filePath;
|
||||||
|
|
||||||
EmulatorConfig(const std::filesystem::path& path);
|
EmulatorConfig(const std::filesystem::path& path);
|
||||||
void load();
|
void load();
|
||||||
void save();
|
void save();
|
||||||
|
std::string getRomsPath();
|
||||||
};
|
};
|
|
@ -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);
|
||||||
|
romsPath = toml::find_or(general, "RomsPath","");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"]["RomsPath"] = romsPath;
|
||||||
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;
|
||||||
|
@ -135,4 +137,9 @@ void EmulatorConfig::save() {
|
||||||
std::ofstream file(path, std::ios::out);
|
std::ofstream file(path, std::ios::out);
|
||||||
file << data;
|
file << data;
|
||||||
file.close();
|
file.close();
|
||||||
|
} std::string EmulatorConfig::getRomsPath() {
|
||||||
|
return EmulatorConfig::romsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -142,16 +142,23 @@ void MainWindow::swapEmuBuffer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::selectROM() {
|
void MainWindow::selectROM() {
|
||||||
|
if (emu->getConfig().getRomsPath() == "") {
|
||||||
auto path =
|
auto path =
|
||||||
QFileDialog::getOpenFileName(this, tr("Select 3DS ROM to load"),"", tr("Nintendo 3DS ROMs (*.3ds *.cci *.cxi *.app *.3dsx *.elf *.axf)"));
|
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());
|
std::filesystem::path* p = new std::filesystem::path(path.toStdU16String());
|
||||||
|
|
||||||
EmulatorMessage message{.type = MessageType::LoadROM};
|
EmulatorMessage message{.type = MessageType::LoadROM};
|
||||||
message.path.p = p;
|
message.path.p = p;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::selectLuaFile() {
|
void MainWindow::selectLuaFile() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue