mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 10:04:39 +00:00
Fixing errors and reading path box for games directories
This commit is contained in:
parent
76f58e0cda
commit
a1aeed0268
@ -77,9 +77,9 @@ static bool isPSNSignedIn = false;
|
||||
// Gui
|
||||
static bool load_game_size = true;
|
||||
static std::vector<GameDirectories> settings_directories = {};
|
||||
static std::vector<bool> directories_enabled = {};
|
||||
static std::filesystem::path settings_addon_directories = {};
|
||||
static std::filesystem::path save_data_path = {};
|
||||
std::vector<bool> directories_enabled = {};
|
||||
std::filesystem::path settings_addon_directories = {};
|
||||
std::filesystem::path save_data_path = {};
|
||||
static bool isFullscreen = false;
|
||||
static std::string fullscreenMode = "Windowed";
|
||||
static bool isHDRAllowed = false;
|
||||
@ -486,7 +486,7 @@ void setSaveDataPath(const std::filesystem::path& path) {
|
||||
save_data_path = path;
|
||||
}
|
||||
|
||||
const std::vector<std::filesystem::path> getGameDirectories() {
|
||||
std::vector<std::filesystem::path> Config::getGameDirectories() {
|
||||
std::vector<std::filesystem::path> enabled_dirs;
|
||||
for (const auto& dir : settings_directories) {
|
||||
if (dir.enabled) {
|
||||
@ -496,7 +496,7 @@ const std::vector<std::filesystem::path> getGameDirectories() {
|
||||
return enabled_dirs;
|
||||
}
|
||||
|
||||
const std::vector<bool> getGameDirsEnabled() {
|
||||
std::vector<bool> Config::getGameDirectoriesEnabled() {
|
||||
std::vector<bool> enabled_dirs;
|
||||
for (const auto& dir : settings_directories) {
|
||||
enabled_dirs.push_back(dir.enabled);
|
||||
|
@ -121,9 +121,9 @@ void removeGameDirectories(const std::filesystem::path& dir);
|
||||
void setGameDirectoriesEnabled(const std::filesystem::path& dir, bool enabled);
|
||||
void setAddonDirectories(const std::filesystem::path& dir);
|
||||
|
||||
const std::vector<std::filesystem::path>& getGameDirectories();
|
||||
const std::vector<bool>& getGameDirectoriesEnabled();
|
||||
const std::filesystem::path& getAddonDirectories();
|
||||
std::vector<std::filesystem::path> getGameDirectories();
|
||||
std::vector<bool> getGameDirectoriesEnabled();
|
||||
std::filesystem::path getAddonDirectory();
|
||||
|
||||
void setDefaultValues();
|
||||
|
||||
|
@ -57,7 +57,7 @@ int PS4_SYSV_ABI sceAppContentAddcontMount(u32 service_label,
|
||||
OrbisAppContentMountPoint* mount_point) {
|
||||
LOG_INFO(Lib_AppContent, "called");
|
||||
|
||||
const auto& mount_dir = Config::getAddonDirectories() / title_id / entitlement_label->data;
|
||||
const auto& mount_dir = Config::getAddonDirectory() / title_id / entitlement_label->data;
|
||||
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||
|
||||
for (int i = 0; i < addcont_count; i++) {
|
||||
@ -244,7 +244,7 @@ int PS4_SYSV_ABI sceAppContentInitialize(const OrbisAppContentInitParam* initPar
|
||||
LOG_ERROR(Lib_AppContent, "(DUMMY) called");
|
||||
auto* param_sfo = Common::Singleton<PSF>::Instance();
|
||||
|
||||
const auto addons_dir = Config::getAddonDirectories();
|
||||
const auto addons_dir = Config::getAddonDirectory();
|
||||
if (const auto value = param_sfo->GetString("TITLE_ID"); value.has_value()) {
|
||||
title_id = *value;
|
||||
} else {
|
||||
|
@ -47,6 +47,14 @@ void GameDirectoryDialog::BrowseAddonsDirectory() {
|
||||
QWidget* GameDirectoryDialog::SetupGamesDirectory() {
|
||||
auto group = new QGroupBox(tr("Games Directory"));
|
||||
auto layout = new QHBoxLayout(group);
|
||||
// Input.
|
||||
m_gamesDirectory = new QLineEdit();
|
||||
QString directory;
|
||||
std::filesystem::path directory_path =
|
||||
Config::getGameDirectories().empty() ? "" : Config::getGameDirectories().front();
|
||||
Common::FS::PathToQString(directory, directory_path);
|
||||
m_gamesDirectory->setText(directory);
|
||||
m_gamesDirectory->setMinimumWidth(400);
|
||||
|
||||
layout->addWidget(m_gamesDirectory);
|
||||
|
||||
@ -67,7 +75,7 @@ QWidget* GameDirectoryDialog::SetupAddonsDirectory() {
|
||||
// Input.
|
||||
m_addonsDirectory = new QLineEdit();
|
||||
QString directories;
|
||||
Common::FS::PathToQString(directories, Config::getAddonDirectories());
|
||||
Common::FS::PathToQString(directories, Config::getAddonDirectory());
|
||||
m_addonsDirectory->setText(directories);
|
||||
m_addonsDirectory->setMinimumWidth(400);
|
||||
|
||||
|
@ -504,7 +504,7 @@ public:
|
||||
game_update_path = folder_path + "-patch";
|
||||
}
|
||||
Common::FS::PathToQString(
|
||||
dlc_path, Config::getAddonDirectories() /
|
||||
dlc_path, Config::getAddonDirectory() /
|
||||
Common::FS::PathFromQString(folder_path).parent_path().filename());
|
||||
Common::FS::PathToQString(save_data_path,
|
||||
Config::GetSaveDataPath() / "1" / m_games[itemID].save_dir);
|
||||
|
Loading…
Reference in New Issue
Block a user