From 5720a32bc5104599075560fa7adcda8f56d728b8 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 24 Apr 2021 14:46:16 +0200 Subject: [PATCH] save-overlays: change list entry contents. There's no need to tell the user that the entry is for game xy, they are already playing that game. On a real PS3 only the subtitle and the date are displayed. --- Utilities/date_time.h | 14 ++++++++++++++ rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Utilities/date_time.h b/Utilities/date_time.h index bb7223ccbb..e0cd1ad671 100644 --- a/Utilities/date_time.h +++ b/Utilities/date_time.h @@ -17,6 +17,20 @@ namespace date_time return buf; } + static inline std::string fmt_time(const char* fmt, const s64 time) + { + tm buf; + time_t t = time; +#ifdef _MSC_VER + localtime_s(&buf, &t); +#else + buf = *localtime(&t); +#endif + char str[80]; + strftime(str, sizeof(str), fmt, &buf); + return str; + } + static inline std::string current_time() { char str[80]; diff --git a/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp index 7c9bc1c696..e7d85d1a0d 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp @@ -174,13 +174,13 @@ namespace rsx m_dim_background->back_color.a = 0.5f; } - std::vector icon; std::vector> entries; for (auto& entry : save_entries) { + const std::string modification_time = date_time::fmt_time("%c", entry.mtime); std::unique_ptr e; - e = std::make_unique(entry.title, entry.subtitle, entry.details, image_resource_id::raw_image, entry.iconBuf); + e = std::make_unique(entry.subtitle, modification_time, entry.details, image_resource_id::raw_image, entry.iconBuf); entries.emplace_back(std::move(e)); } @@ -211,6 +211,7 @@ namespace rsx { const char* title = "Create New"; + std::vector icon; int id = resource_config::standard_image_resource::new_entry; if (const auto picon = +listSet->newData->icon)