mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-09 20:30:05 +00:00
savestates: save the build name to be displayed when there's a version mismatch (#6493)
* savestates: add a build_name field to the header * savestates: display build name on save/load menu * savestates: add zero member to header just in case of UB from an older save state * savestates: add legacy hash lookup * savestate_data: update hash database
This commit is contained in:
parent
af78268dd5
commit
eb8d2941c9
5 changed files with 1470 additions and 11 deletions
|
@ -1422,10 +1422,17 @@ void GMainWindow::UpdateSaveStates() {
|
|||
actions_save_state[i]->setText(tr("Slot %1").arg(i + 1));
|
||||
}
|
||||
for (const auto& savestate : savestates) {
|
||||
const auto text = tr("Slot %1 - %2")
|
||||
.arg(savestate.slot)
|
||||
.arg(QDateTime::fromSecsSinceEpoch(savestate.time)
|
||||
.toString(QStringLiteral("yyyy-MM-dd hh:mm:ss")));
|
||||
const bool display_name =
|
||||
savestate.status == Core::SaveStateInfo::ValidationStatus::RevisionDismatch &&
|
||||
!savestate.build_name.empty();
|
||||
const auto text =
|
||||
tr("Slot %1 - %2 %3")
|
||||
.arg(savestate.slot)
|
||||
.arg(QDateTime::fromSecsSinceEpoch(savestate.time)
|
||||
.toString(QStringLiteral("yyyy-MM-dd hh:mm:ss")))
|
||||
.arg(display_name ? QString::fromStdString(savestate.build_name) : QLatin1String())
|
||||
.trimmed();
|
||||
|
||||
actions_load_state[savestate.slot - 1]->setEnabled(true);
|
||||
actions_load_state[savestate.slot - 1]->setText(text);
|
||||
actions_save_state[savestate.slot - 1]->setText(text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue