mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 20:14:45 +00:00
save timestamp when trophies are unlocked
This commit is contained in:
parent
1ca7bf8331
commit
b88d1735b8
1 changed files with 32 additions and 0 deletions
|
@ -685,6 +685,16 @@ int PS4_SYSV_ABI sceNpTrophyUnlockTrophy(OrbisNpTrophyContext context, OrbisNpTr
|
|||
it->attribute("unlockstate").set_value("unlocked");
|
||||
}
|
||||
|
||||
Rtc::OrbisRtcTick trophyTimestamp;
|
||||
Rtc::sceRtcGetCurrentTick(&trophyTimestamp);
|
||||
|
||||
if (std::string(it->attribute("timestamp").value()).empty()) {
|
||||
it->append_attribute("timestamp") =
|
||||
std::to_string(trophyTimestamp.tick).c_str();
|
||||
} else {
|
||||
it->attribute("timestamp").set_value(std::to_string(trophyTimestamp.tick).c_str());
|
||||
}
|
||||
|
||||
g_trophy_ui.AddTrophyToQueue(trophyId, currentTrophyName);
|
||||
}
|
||||
}
|
||||
|
@ -696,6 +706,17 @@ int PS4_SYSV_ABI sceNpTrophyUnlockTrophy(OrbisNpTrophyContext context, OrbisNpTr
|
|||
|
||||
platinumIt->append_attribute("unlockstate") = "unlocked";
|
||||
|
||||
Rtc::OrbisRtcTick trophyTimestamp;
|
||||
Rtc::sceRtcGetCurrentTick(&trophyTimestamp);
|
||||
|
||||
if (std::string(platinumIt->attribute("timestamp").value()).empty()) {
|
||||
platinumIt->append_attribute("timestamp") =
|
||||
std::to_string(trophyTimestamp.tick).c_str();
|
||||
} else {
|
||||
platinumIt->attribute("timestamp")
|
||||
.set_value(std::to_string(trophyTimestamp.tick).c_str());
|
||||
}
|
||||
|
||||
std::string platinumTrophyId = platinumIt->attribute("id").value();
|
||||
std::string platinumTrophyName = platinumIt->child("name").text().as_string();
|
||||
|
||||
|
@ -707,6 +728,17 @@ int PS4_SYSV_ABI sceNpTrophyUnlockTrophy(OrbisNpTrophyContext context, OrbisNpTr
|
|||
|
||||
platinumIt->attribute("unlockstate").set_value("unlocked");
|
||||
|
||||
Rtc::OrbisRtcTick trophyTimestamp;
|
||||
Rtc::sceRtcGetCurrentTick(&trophyTimestamp);
|
||||
|
||||
if (std::string(platinumIt->attribute("timestamp").value()).empty()) {
|
||||
platinumIt->append_attribute("timestamp") =
|
||||
std::to_string(trophyTimestamp.tick).c_str();
|
||||
} else {
|
||||
platinumIt->attribute("timestamp")
|
||||
.set_value(std::to_string(trophyTimestamp.tick).c_str());
|
||||
}
|
||||
|
||||
std::string platinumTrophyId = platinumIt->attribute("id").value();
|
||||
std::string platinumTrophyName = platinumIt->child("name").text().as_string();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue