From 927c5ea09bbe4f68f328b5f2f95fed1539d57317 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Sun, 7 Jun 2026 11:32:46 +0200 Subject: [PATCH] Add and autogenerate PathType::TrophyDir --- src/common/path_util.cpp | 1 + src/common/path_util.h | 2 ++ src/core/libraries/np/np_trophy.cpp | 2 +- src/core/user_manager.cpp | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/path_util.cpp b/src/common/path_util.cpp index dc9043006..b0162c21d 100644 --- a/src/common/path_util.cpp +++ b/src/common/path_util.cpp @@ -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); diff --git a/src/common/path_util.h b/src/common/path_util.h index 130d3d4fc..e135b1254 100644 --- a/src/common/path_util.h +++ b/src/common/path_util.h @@ -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"; diff --git a/src/core/libraries/np/np_trophy.cpp b/src/core/libraries/np/np_trophy.cpp index 21a4a16f5..930fe30b4 100644 --- a/src/core/libraries/np/np_trophy.cpp +++ b/src/core/libraries/np/np_trophy.cpp @@ -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"; diff --git a/src/core/user_manager.cpp b/src/core/user_manager.cpp index adc576110..8236279b2 100644 --- a/src/core/user_manager.cpp +++ b/src/core/user_manager.cpp @@ -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()) {