Add and autogenerate PathType::TrophyDir (#4538)

This commit is contained in:
kalaposfos13
2026-06-28 10:47:44 +02:00
committed by GitHub
parent 56fd63cc95
commit 9f4b713dfd
5 changed files with 6 additions and 4 deletions
+1
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);
+2
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";
+1 -1
View File
@@ -833,7 +833,7 @@ int PS4_SYSV_ABI sceNpTrophyRegisterContext(OrbisNpTrophyContext context,
np_comm_id = it->second;
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(ctx.user_id) / "trophy" /
(np_comm_id + ".xml");
ctx.xml_dir = trophy_base / "Xml";
+1 -2
View File
@@ -178,8 +178,7 @@ static void CheckAndMigrateTrophies(TransferOption option) {
auto const user_dir = EmulatorSettings.GetHomeDir() / "1000";
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";
auto const new_trophy_global_dir = Common::FS::GetUserPath(Common::FS::PathType::TrophyDir);
try {
for (auto const& entry : fs::directory_iterator(old_trophy_base_dir)) {
if (!entry.is_directory()) {
+1 -1
View File
@@ -161,7 +161,7 @@ std::map<s32, std::string> ExtractTrophies(const std::filesystem::path& npbind_p
// Extract the actual trophies if they're no extracted yet
const auto& trophy_output_dir =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "trophy" / np_comm_id;
Common::FS::GetUserPath(Common::FS::PathType::TrophyDir) / np_comm_id;
if (!std::filesystem::exists(trophy_output_dir)) {
TRP trp;
if (!trp.Extract(entry, np_comm_id, trophy_output_dir)) {