summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-09-29 14:03:09 +0200
committerGitHub <noreply@github.com>2017-09-29 14:03:09 +0200
commit7704bd593e5483707caf14d9929c2d1c745a461a (patch)
treeff95aa8aba840b69ecca212618e7449219fe7645 /Source/Core
parent235f86021afe2c978c37fefe089e84eec520f3c6 (diff)
parent0e7e7f6fc6368070b6100e2746ab3764488810f7 (diff)
Merge pull request #2821 from Mushman/master
Change Wii Save Import alerts
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/WiiSaveCrypted.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/Source/Core/Core/HW/WiiSaveCrypted.cpp b/Source/Core/Core/HW/WiiSaveCrypted.cpp
index 48fcc8f765..835ff9b980 100644
--- a/Source/Core/Core/HW/WiiSaveCrypted.cpp
+++ b/Source/Core/Core/HW/WiiSaveCrypted.cpp
@@ -85,7 +85,7 @@ void CWiiSaveCrypted::ExportAllSaves()
}
}
}
- SuccessAlertT("Found %zu save files", titles.size());
+ SuccessAlertT("Found %zu save file(s)", titles.size());
u32 success = 0;
for (const u64& title : titles)
{
@@ -93,7 +93,7 @@ void CWiiSaveCrypted::ExportAllSaves()
if (export_save.m_valid)
success++;
}
- SuccessAlertT("Successfully exported %u saves to %s", success,
+ SuccessAlertT("Successfully exported %u save(s) to %s", success,
(File::GetUserPath(D_USER_IDX) + "private/wii/title/").c_str());
}
@@ -112,7 +112,7 @@ CWiiSaveCrypted::CWiiSaveCrypted(const std::string& filename, u64 title_id)
// TODO: check_sig()
if (m_valid)
{
- SuccessAlertT("Successfully imported save files");
+ SuccessAlertT("Successfully imported save file(s)");
}
else
{
@@ -183,12 +183,18 @@ void CWiiSaveCrypted::ReadHDR()
}
std::string banner_file_path = m_wii_title_path + "banner.bin";
if (!File::Exists(banner_file_path) ||
- AskYesNoT("%s already exists, overwrite?", banner_file_path.c_str()))
+ AskYesNoT("%s already exists. Consider making a backup of the current save files before "
+ "overwriting.\nOverwrite now?",
+ banner_file_path.c_str()))
{
INFO_LOG(CONSOLE, "Creating file %s", banner_file_path.c_str());
File::IOFile banner_file(banner_file_path, "wb");
banner_file.WriteBytes(m_header.BNR, banner_size);
}
+ else
+ {
+ m_valid = false;
+ }
}
void CWiiSaveCrypted::WriteHDR()
@@ -362,14 +368,10 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
mbedtls_aes_crypt_cbc(&m_aes_ctx, MBEDTLS_AES_DECRYPT, file_size_rounded, m_iv,
static_cast<const u8*>(file_data_enc.data()), file_data.data());
- if (!file_info.Exists() ||
- AskYesNoT("%s already exists, overwrite?", file_path_full.c_str()))
- {
- INFO_LOG(CONSOLE, "Creating file %s", file_path_full.c_str());
+ INFO_LOG(CONSOLE, "Creating file %s", file_path_full.c_str());
- File::IOFile raw_save_file(file_path_full, "wb");
- raw_save_file.WriteBytes(file_data.data(), file_size);
- }
+ File::IOFile raw_save_file(file_path_full, "wb");
+ raw_save_file.WriteBytes(file_data.data(), file_size);
}
else if (file_hdr_tmp.type == 2)
{
@@ -586,7 +588,7 @@ bool CWiiSaveCrypted::getPaths(bool for_export)
if (!File::Exists(m_wii_title_path + "banner.bin"))
{
m_valid = false;
- ERROR_LOG(CONSOLE, "No banner file found for title %s", game_id);
+ ERROR_LOG(CONSOLE, "No banner file found for title %s", game_id);
return false;
}
if (m_encrypted_save_path.length() == 0)
@@ -600,12 +602,6 @@ bool CWiiSaveCrypted::getPaths(bool for_export)
else
{
File::CreateFullPath(m_wii_title_path);
- if (!AskYesNoT("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to "
- "continue?",
- m_wii_title_path.c_str()))
- {
- return false;
- }
}
return true;
}