mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-24 02:54:35 +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
|
// Gui
|
||||||
static bool load_game_size = true;
|
static bool load_game_size = true;
|
||||||
static std::vector<GameDirectories> settings_directories = {};
|
static std::vector<GameDirectories> settings_directories = {};
|
||||||
static std::vector<bool> directories_enabled = {};
|
std::vector<bool> directories_enabled = {};
|
||||||
static std::filesystem::path settings_addon_directories = {};
|
std::filesystem::path settings_addon_directories = {};
|
||||||
static std::filesystem::path save_data_path = {};
|
std::filesystem::path save_data_path = {};
|
||||||
static bool isFullscreen = false;
|
static bool isFullscreen = false;
|
||||||
static std::string fullscreenMode = "Windowed";
|
static std::string fullscreenMode = "Windowed";
|
||||||
static bool isHDRAllowed = false;
|
static bool isHDRAllowed = false;
|
||||||
@ -486,7 +486,7 @@ void setSaveDataPath(const std::filesystem::path& path) {
|
|||||||
save_data_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;
|
std::vector<std::filesystem::path> enabled_dirs;
|
||||||
for (const auto& dir : settings_directories) {
|
for (const auto& dir : settings_directories) {
|
||||||
if (dir.enabled) {
|
if (dir.enabled) {
|
||||||
@ -496,7 +496,7 @@ const std::vector<std::filesystem::path> getGameDirectories() {
|
|||||||
return enabled_dirs;
|
return enabled_dirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<bool> getGameDirsEnabled() {
|
std::vector<bool> Config::getGameDirectoriesEnabled() {
|
||||||
std::vector<bool> enabled_dirs;
|
std::vector<bool> enabled_dirs;
|
||||||
for (const auto& dir : settings_directories) {
|
for (const auto& dir : settings_directories) {
|
||||||
enabled_dirs.push_back(dir.enabled);
|
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 setGameDirectoriesEnabled(const std::filesystem::path& dir, bool enabled);
|
||||||
void setAddonDirectories(const std::filesystem::path& dir);
|
void setAddonDirectories(const std::filesystem::path& dir);
|
||||||
|
|
||||||
const std::vector<std::filesystem::path>& getGameDirectories();
|
std::vector<std::filesystem::path> getGameDirectories();
|
||||||
const std::vector<bool>& getGameDirectoriesEnabled();
|
std::vector<bool> getGameDirectoriesEnabled();
|
||||||
const std::filesystem::path& getAddonDirectories();
|
std::filesystem::path getAddonDirectory();
|
||||||
|
|
||||||
void setDefaultValues();
|
void setDefaultValues();
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ int PS4_SYSV_ABI sceAppContentAddcontMount(u32 service_label,
|
|||||||
OrbisAppContentMountPoint* mount_point) {
|
OrbisAppContentMountPoint* mount_point) {
|
||||||
LOG_INFO(Lib_AppContent, "called");
|
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();
|
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||||
|
|
||||||
for (int i = 0; i < addcont_count; i++) {
|
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");
|
LOG_ERROR(Lib_AppContent, "(DUMMY) called");
|
||||||
auto* param_sfo = Common::Singleton<PSF>::Instance();
|
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()) {
|
if (const auto value = param_sfo->GetString("TITLE_ID"); value.has_value()) {
|
||||||
title_id = *value;
|
title_id = *value;
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,6 +47,14 @@ void GameDirectoryDialog::BrowseAddonsDirectory() {
|
|||||||
QWidget* GameDirectoryDialog::SetupGamesDirectory() {
|
QWidget* GameDirectoryDialog::SetupGamesDirectory() {
|
||||||
auto group = new QGroupBox(tr("Games Directory"));
|
auto group = new QGroupBox(tr("Games Directory"));
|
||||||
auto layout = new QHBoxLayout(group);
|
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);
|
layout->addWidget(m_gamesDirectory);
|
||||||
|
|
||||||
@ -67,7 +75,7 @@ QWidget* GameDirectoryDialog::SetupAddonsDirectory() {
|
|||||||
// Input.
|
// Input.
|
||||||
m_addonsDirectory = new QLineEdit();
|
m_addonsDirectory = new QLineEdit();
|
||||||
QString directories;
|
QString directories;
|
||||||
Common::FS::PathToQString(directories, Config::getAddonDirectories());
|
Common::FS::PathToQString(directories, Config::getAddonDirectory());
|
||||||
m_addonsDirectory->setText(directories);
|
m_addonsDirectory->setText(directories);
|
||||||
m_addonsDirectory->setMinimumWidth(400);
|
m_addonsDirectory->setMinimumWidth(400);
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ public:
|
|||||||
game_update_path = folder_path + "-patch";
|
game_update_path = folder_path + "-patch";
|
||||||
}
|
}
|
||||||
Common::FS::PathToQString(
|
Common::FS::PathToQString(
|
||||||
dlc_path, Config::getAddonDirectories() /
|
dlc_path, Config::getAddonDirectory() /
|
||||||
Common::FS::PathFromQString(folder_path).parent_path().filename());
|
Common::FS::PathFromQString(folder_path).parent_path().filename());
|
||||||
Common::FS::PathToQString(save_data_path,
|
Common::FS::PathToQString(save_data_path,
|
||||||
Config::GetSaveDataPath() / "1" / m_games[itemID].save_dir);
|
Config::GetSaveDataPath() / "1" / m_games[itemID].save_dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user