mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-09 13:19:00 +00:00
Game specific configs (#3376)
* poc * Set up variable game specific variable copies * Set up getters to return the game specific option if it exists * Avoid exceptions if a value isn't in the config * Make sure the custom configs folder exists * Update + review comments + rewrite * The loathsome clang-formatter * Specify which getter/setter is used everywhere
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@ struct GameInstallDir {
|
|||||||
|
|
||||||
enum HideCursorState : int { Never, Idle, Always };
|
enum HideCursorState : int { Never, Idle, Always };
|
||||||
|
|
||||||
void load(const std::filesystem::path& path);
|
void load(const std::filesystem::path& path, bool is_game_specific = false);
|
||||||
void save(const std::filesystem::path& path);
|
void save(const std::filesystem::path& path);
|
||||||
|
|
||||||
int getVolumeSlider();
|
int getVolumeSlider();
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ static auto UserPaths = [] {
|
|||||||
create_path(PathType::PatchesDir, user_dir / PATCHES_DIR);
|
create_path(PathType::PatchesDir, user_dir / PATCHES_DIR);
|
||||||
create_path(PathType::MetaDataDir, user_dir / METADATA_DIR);
|
create_path(PathType::MetaDataDir, user_dir / METADATA_DIR);
|
||||||
create_path(PathType::CustomTrophy, user_dir / CUSTOM_TROPHY);
|
create_path(PathType::CustomTrophy, user_dir / CUSTOM_TROPHY);
|
||||||
|
create_path(PathType::CustomConfigs, user_dir / CUSTOM_CONFIGS);
|
||||||
|
|
||||||
std::ofstream notice_file(user_dir / CUSTOM_TROPHY / "Notice.txt");
|
std::ofstream notice_file(user_dir / CUSTOM_TROPHY / "Notice.txt");
|
||||||
if (notice_file.is_open()) {
|
if (notice_file.is_open()) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ enum class PathType {
|
|||||||
PatchesDir, // Where patches are stored.
|
PatchesDir, // Where patches are stored.
|
||||||
MetaDataDir, // Where game metadata (e.g. trophies and menu backgrounds) is stored.
|
MetaDataDir, // Where game metadata (e.g. trophies and menu backgrounds) is stored.
|
||||||
CustomTrophy, // Where custom files for trophies are stored.
|
CustomTrophy, // Where custom files for trophies are stored.
|
||||||
|
CustomConfigs, // Where custom files for different games are stored.
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr auto PORTABLE_DIR = "user";
|
constexpr auto PORTABLE_DIR = "user";
|
||||||
@@ -44,6 +45,7 @@ constexpr auto CHEATS_DIR = "cheats";
|
|||||||
constexpr auto PATCHES_DIR = "patches";
|
constexpr auto PATCHES_DIR = "patches";
|
||||||
constexpr auto METADATA_DIR = "game_data";
|
constexpr auto METADATA_DIR = "game_data";
|
||||||
constexpr auto CUSTOM_TROPHY = "custom_trophy";
|
constexpr auto CUSTOM_TROPHY = "custom_trophy";
|
||||||
|
constexpr auto CUSTOM_CONFIGS = "custom_configs";
|
||||||
|
|
||||||
// Filenames
|
// Filenames
|
||||||
constexpr auto LOG_FILE = "shad_log.txt";
|
constexpr auto LOG_FILE = "shad_log.txt";
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ void Emulator::Run(std::filesystem::path file, const std::vector<std::string> ar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Config::load(Common::FS::GetUserPath(Common::FS::PathType::CustomConfigs) / (id + ".toml"),
|
||||||
|
true);
|
||||||
|
|
||||||
// Initialize logging as soon as possible
|
// Initialize logging as soon as possible
|
||||||
if (!id.empty() && Config::getSeparateLogFilesEnabled()) {
|
if (!id.empty() && Config::getSeparateLogFilesEnabled()) {
|
||||||
Common::Log::Initialize(id + ".log");
|
Common::Log::Initialize(id + ".log");
|
||||||
|
|||||||
Reference in New Issue
Block a user