From 0b784043374f8470aad3455523750899250bd802 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 27 Dec 2019 11:45:37 +0100 Subject: [PATCH] cellSaveData: get confirmation if not CELL_SAVEDATA_OPTION_NOCONFIRM --- rpcs3/Emu/Cell/Modules/cellSaveData.cpp | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index 7e174f1131..809f43ff67 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Emu/System.h" #include "Emu/Cell/lv2/sys_sync.h" #include "Emu/Cell/lv2/sys_process.h" @@ -916,6 +916,35 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v } } + if (fixedSet->option != CELL_SAVEDATA_OPTION_NOCONFIRM) + { + std::string message; + + if (selected == -1) + { + message = "Create new Save Data?"; + } + else + { + // Get information from the selected entry + SaveDataEntry entry = save_entries[selected]; + message = get_confirmation_message(operation) + "\n\n" + entry.title + "\n" + entry.subtitle + "\n" + entry.details; + } + + // Get user confirmation + error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, vm::make_str(message)); + + if (res != CELL_OK) + { + return CELL_SAVEDATA_ERROR_INTERNAL; + } + + if (g_last_user_response != CELL_MSGDIALOG_BUTTON_YES) + { + return CELL_CANCEL; + } + } + if (selected == -1) { save_entry.dirName = fixedSet->dirName.get_ptr();