[Kernel] Fixed issue with WINE crash while opening played titles or achievements tab
This commit is contained in:
committed by
Radosław Gliński
parent
703531d541
commit
2e9c459846
@@ -103,21 +103,21 @@ xe::ui::ImmediateTexture* GameAchievementsUI::GetIcon(
|
||||
std::string GameAchievementsUI::GetUnlockedTime(
|
||||
const Achievement& achievement_entry) const {
|
||||
if (achievement_entry.IsUnlockedOnline()) {
|
||||
const auto unlock_time = chrono::WinSystemClock::to_local(
|
||||
achievement_entry.unlock_time.to_time_point());
|
||||
const auto unlock_time =
|
||||
std::chrono::system_clock::to_time_t(chrono::WinSystemClock::to_sys(
|
||||
achievement_entry.unlock_time.to_time_point()));
|
||||
|
||||
return fmt::format(
|
||||
"Unlocked: {:%Y-%m-%d %H:%M}",
|
||||
std::chrono::system_clock::time_point(unlock_time.time_since_epoch()));
|
||||
return fmt::format("Unlocked: {:%Y-%m-%d %H:%M}",
|
||||
fmt::localtime(unlock_time));
|
||||
}
|
||||
|
||||
if (achievement_entry.unlock_time.is_valid()) {
|
||||
const auto unlock_time = chrono::WinSystemClock::to_local(
|
||||
achievement_entry.unlock_time.to_time_point());
|
||||
const auto unlock_time =
|
||||
std::chrono::system_clock::to_time_t(chrono::WinSystemClock::to_sys(
|
||||
achievement_entry.unlock_time.to_time_point()));
|
||||
|
||||
return fmt::format(
|
||||
"Unlocked: Offline ({:%Y-%m-%d %H:%M})",
|
||||
std::chrono::system_clock::time_point(unlock_time.time_since_epoch()));
|
||||
return fmt::format("Unlocked: Offline ({:%Y-%m-%d %H:%M})",
|
||||
fmt::localtime(unlock_time));
|
||||
}
|
||||
return fmt::format("Unlocked: Offline");
|
||||
}
|
||||
|
||||
@@ -86,8 +86,9 @@ void TitleListUI::DrawTitleEntry(ImGuiIO& io, TitleInfo& entry) {
|
||||
if (entry.WasTitlePlayed()) {
|
||||
ImGui::TextUnformatted(
|
||||
fmt::format("Last played: {:%Y-%m-%d %H:%M}",
|
||||
std::chrono::system_clock::time_point(
|
||||
entry.last_played.time_since_epoch()))
|
||||
fmt::localtime(std::chrono::system_clock::to_time_t(
|
||||
std::chrono::system_clock::time_point(
|
||||
entry.last_played.time_since_epoch()))))
|
||||
.c_str());
|
||||
} else {
|
||||
ImGui::TextUnformatted("Last played: Unknown");
|
||||
|
||||
Reference in New Issue
Block a user