mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
save-overlays: add entry size info
This commit is contained in:
parent
14b6d6291b
commit
3c37036f7a
3 changed files with 24 additions and 3 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include "Loader/PSF.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
#include "Utilities/span.h"
|
||||
#include "Utilities/date_time.h"
|
||||
|
||||
#include <mutex>
|
||||
#include <algorithm>
|
||||
|
|
@ -53,6 +54,23 @@ SaveDialogBase::~SaveDialogBase()
|
|||
{
|
||||
}
|
||||
|
||||
std::string SaveDataEntry::date() const
|
||||
{
|
||||
return date_time::fmt_time("%c", mtime);
|
||||
}
|
||||
|
||||
std::string SaveDataEntry::data_size() const
|
||||
{
|
||||
std::string metric = "KB";
|
||||
u64 sz = utils::aligned_div(size, 1000);
|
||||
if (sz > 1000)
|
||||
{
|
||||
metric = "MB";
|
||||
sz = utils::aligned_div(sz, 1000);
|
||||
}
|
||||
return fmt::format("%lu %s", sz, metric);
|
||||
}
|
||||
|
||||
// cellSaveData aliases (only for cellSaveData.cpp)
|
||||
using PSetList = vm::ptr<CellSaveDataSetList>;
|
||||
using PSetBuf = vm::ptr<CellSaveDataSetBuf>;
|
||||
|
|
@ -315,7 +333,7 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C
|
|||
|
||||
static std::string get_confirmation_message(u32 operation, const SaveDataEntry& entry)
|
||||
{
|
||||
const std::string info = entry.title + "\n" + entry.subtitle + "\n" + entry.details;
|
||||
const std::string info = fmt::format("%s\n%s\n%s\n%s\n\n%s", entry.title, entry.subtitle, entry.date(), entry.data_size(), entry.details);
|
||||
|
||||
if (operation == SAVEDATA_OP_LIST_DELETE || operation == SAVEDATA_OP_FIXED_DELETE)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue