Add and autogenerate PathType::TrophyDir

This commit is contained in:
kalaposfos13 2026-06-07 11:32:46 +02:00
parent 6af6ab12d8
commit 927c5ea09b
4 changed files with 5 additions and 2 deletions

View File

@ -130,6 +130,7 @@ static auto UserPaths = [] {
create_path(PathType::CustomConfigs, user_dir / CUSTOM_CONFIGS);
create_path(PathType::CacheDir, user_dir / CACHE_DIR);
create_path(PathType::FontsDir, user_dir / FONTS_DIR);
create_path(PathType::TrophyDir, user_dir / TROPHY_DIR);
create_path(PathType::HomeDir, user_dir / HOME_DIR);
create_path(PathType::CustomModulesDir, user_dir / CUSTOM_MODULES_DIR);

View File

@ -26,6 +26,7 @@ enum class PathType {
CustomConfigs, // Where custom files for different games are stored.
CacheDir, // Where pipeline and shader cache is stored.
FontsDir, // Where dumped system fonts are stored.
TrophyDir, // Where general trophy metadata is stored.
HomeDir, // PS4 home directory
CustomModulesDir // Where custom modules are stored.
};
@ -48,6 +49,7 @@ constexpr auto CUSTOM_TROPHY = "custom_trophy";
constexpr auto CUSTOM_CONFIGS = "custom_configs";
constexpr auto CACHE_DIR = "cache";
constexpr auto FONTS_DIR = "fonts";
constexpr auto TROPHY_DIR = "trophy";
constexpr auto HOME_DIR = "home";
constexpr auto CUSTOM_MODULES_DIR = "custom_modules";

View File

@ -229,7 +229,7 @@ s32 PS4_SYSV_ABI sceNpTrophyCreateContext(OrbisNpTrophyContext* context,
return ORBIS_NP_TROPHY_ERROR_UNKNOWN;
}
const auto trophy_base =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "trophy" / np_comm_id;
Common::FS::GetUserPath(Common::FS::PathType::TrophyDir) / np_comm_id;
ctx.xml_save_file =
EmulatorSettings.GetHomeDir() / std::to_string(user_id) / "trophy" / (np_comm_id + ".xml");
ctx.xml_dir = trophy_base / "Xml";

View File

@ -179,7 +179,7 @@ static void CheckAndMigrateTrophies(TransferOption option) {
auto const old_trophy_base_dir =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "game_data";
auto const new_trophy_global_dir =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "trophy";
Common::FS::GetUserPath(Common::FS::PathType::TrophyDir);
try {
for (auto const& entry : fs::directory_iterator(old_trophy_base_dir)) {
if (!entry.is_directory()) {