mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
VMManager: Reword save state error messages
This commit is contained in:
parent
e8c2cfa843
commit
743b0b11d8
@ -1834,7 +1834,7 @@ bool VMManager::DoLoadState(const char* filename, Error* error)
|
|||||||
{
|
{
|
||||||
if (GSDumpReplayer::IsReplayingDump())
|
if (GSDumpReplayer::IsReplayingDump())
|
||||||
{
|
{
|
||||||
Error::SetString(error, TRANSLATE_STR("VMManager", "Cannot load state while replaying GS dump."));
|
Error::SetString(error, TRANSLATE_STR("VMManager", "Cannot load state while replaying a GS dump."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1858,7 +1858,7 @@ void VMManager::DoSaveState(const char* filename, s32 slot_for_message, bool zip
|
|||||||
{
|
{
|
||||||
if (GSDumpReplayer::IsReplayingDump())
|
if (GSDumpReplayer::IsReplayingDump())
|
||||||
{
|
{
|
||||||
error_callback(TRANSLATE_STR("VMManager", "Cannot save state while replaying GS dump."));
|
error_callback(TRANSLATE_STR("VMManager", "Cannot save state while replaying a GS dump."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1866,8 +1866,7 @@ void VMManager::DoSaveState(const char* filename, s32 slot_for_message, bool zip
|
|||||||
std::unique_ptr<ArchiveEntryList> elist = SaveState_DownloadState(&error);
|
std::unique_ptr<ArchiveEntryList> elist = SaveState_DownloadState(&error);
|
||||||
if (!elist)
|
if (!elist)
|
||||||
{
|
{
|
||||||
error_callback(fmt::format(
|
error_callback(error.GetDescription());
|
||||||
TRANSLATE_FS("VMManager", "Failed to save state: {}."), error.GetDescription()));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1915,14 +1914,14 @@ void VMManager::ZipSaveState(std::unique_ptr<ArchiveEntryList> elist,
|
|||||||
if (slot_for_message >= 0 && VMManager::HasValidVM())
|
if (slot_for_message >= 0 && VMManager::HasValidVM())
|
||||||
{
|
{
|
||||||
Host::AddIconOSDMessage("SaveState", ICON_FA_FLOPPY_DISK,
|
Host::AddIconOSDMessage("SaveState", ICON_FA_FLOPPY_DISK,
|
||||||
fmt::format(TRANSLATE_FS("VMManager", "State saved to slot {}."), slot_for_message),
|
fmt::format(TRANSLATE_FS("VMManager", "Saved state to slot {}."), slot_for_message),
|
||||||
Host::OSD_QUICK_DURATION);
|
Host::OSD_QUICK_DURATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error_callback(fmt::format(
|
error_callback(fmt::format(
|
||||||
TRANSLATE_FS("VMManager", "Failed to save state to slot {}."), slot_for_message));
|
TRANSLATE_FS("VMManager", "Cannot zip state."), slot_for_message));
|
||||||
}
|
}
|
||||||
|
|
||||||
DevCon.WriteLn("Zipping save state to '%s' took %.2f ms", filename, timer.GetTimeMilliseconds());
|
DevCon.WriteLn("Zipping save state to '%s' took %.2f ms", filename, timer.GetTimeMilliseconds());
|
||||||
@ -1991,23 +1990,25 @@ bool VMManager::LoadState(const char* filename, Error* error)
|
|||||||
if (Achievements::IsHardcoreModeActive())
|
if (Achievements::IsHardcoreModeActive())
|
||||||
{
|
{
|
||||||
Error::SetString(error,
|
Error::SetString(error,
|
||||||
TRANSLATE_STR("VMManager", "Cannot load save state while RetroAchievements Hardcore Mode is active."));
|
TRANSLATE_STR("VMManager", "Cannot load state while RetroAchievements Hardcore Mode is active."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MemcardBusy::IsBusy())
|
if (MemcardBusy::IsBusy())
|
||||||
{
|
{
|
||||||
Error::SetString(error,
|
Error::SetString(error,
|
||||||
TRANSLATE_STR("VMManager", "Memory card is busy."));
|
TRANSLATE_STR("VMManager", "The memory card is busy, so the state load operation has been cancelled to prevent data loss."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Save the current state so we don't need to reset.
|
// TODO: Save the current state so we don't need to reset.
|
||||||
if (DoLoadState(filename, error))
|
if (!DoLoadState(filename, error))
|
||||||
return true;
|
{
|
||||||
|
Reset();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Reset();
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VMManager::LoadStateFromSlot(s32 slot, bool backup, Error* error)
|
bool VMManager::LoadStateFromSlot(s32 slot, bool backup, Error* error)
|
||||||
@ -2015,41 +2016,42 @@ bool VMManager::LoadStateFromSlot(s32 slot, bool backup, Error* error)
|
|||||||
const std::string filename = GetCurrentSaveStateFileName(slot, backup);
|
const std::string filename = GetCurrentSaveStateFileName(slot, backup);
|
||||||
if (filename.empty() || !FileSystem::FileExists(filename.c_str()))
|
if (filename.empty() || !FileSystem::FileExists(filename.c_str()))
|
||||||
{
|
{
|
||||||
if (backup)
|
Error::SetString(error, TRANSLATE_STR("VMManager", "The save slot is empty."));
|
||||||
Error::SetStringFmt(error,
|
|
||||||
TRANSLATE_FS("VMManager", "There is no save state in backup slot {}."), slot);
|
|
||||||
else
|
|
||||||
Error::SetStringFmt(error,
|
|
||||||
TRANSLATE_FS("VMManager", "There is no save state in slot {}."), slot);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Achievements::IsHardcoreModeActive())
|
if (Achievements::IsHardcoreModeActive())
|
||||||
{
|
{
|
||||||
if (backup)
|
Error::SetString(error,
|
||||||
Error::SetStringFmt(error,
|
TRANSLATE_STR("VMManager", "Cannot load state while RetroAchievements Hardcore Mode is active."));
|
||||||
TRANSLATE_FS("VMManager", "Cannot load save state from backup slot {} while RetroAchievements Hardcore Mode is active."), slot);
|
|
||||||
else
|
|
||||||
Error::SetStringFmt(error,
|
|
||||||
TRANSLATE_FS("VMManager", "Cannot load save state from slot {} while RetroAchievements Hardcore Mode is active."), slot);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MemcardBusy::IsBusy())
|
if (MemcardBusy::IsBusy())
|
||||||
{
|
{
|
||||||
if (backup)
|
Error::SetString(error,
|
||||||
Error::SetStringFmt(error,
|
TRANSLATE_STR("VMManager",
|
||||||
TRANSLATE_FS("VMManager", "Failed to load save state from backup slot {} (memory card is busy)."), slot);
|
"The memory card is busy, so the state load operation has been cancelled to prevent data loss."));
|
||||||
else
|
|
||||||
Error::SetStringFmt(error,
|
|
||||||
TRANSLATE_FS("VMManager", "Failed to load save state from slot {} (memory card is busy)."), slot);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_FOLDER_OPEN,
|
if (!DoLoadState(filename.c_str(), error))
|
||||||
fmt::format(TRANSLATE_FS("VMManager", "Loading {} from slot {}..."), backup ? TRANSLATE("VMManager", "backup state") : TRANSLATE("VMManager", "state"), slot), Host::OSD_QUICK_DURATION);
|
return false;
|
||||||
|
|
||||||
return DoLoadState(filename.c_str(), error);
|
if (backup)
|
||||||
|
{
|
||||||
|
Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_FOLDER_OPEN,
|
||||||
|
fmt::format(TRANSLATE_FS("VMManager", "Loaded state from backup slot {}."), slot),
|
||||||
|
Host::OSD_QUICK_DURATION);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_FOLDER_OPEN,
|
||||||
|
fmt::format(TRANSLATE_FS("VMManager", "Loaded state from slot {}."), slot),
|
||||||
|
Host::OSD_QUICK_DURATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VMManager::SaveState(
|
void VMManager::SaveState(
|
||||||
@ -2057,7 +2059,8 @@ void VMManager::SaveState(
|
|||||||
{
|
{
|
||||||
if (MemcardBusy::IsBusy())
|
if (MemcardBusy::IsBusy())
|
||||||
{
|
{
|
||||||
error_callback(TRANSLATE_STR("VMManager", "Failed to save state (memory card is busy)."));
|
error_callback(TRANSLATE_STR("VMManager",
|
||||||
|
"The memory card is busy, so the state save operation has been cancelled to prevent data loss."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2069,14 +2072,14 @@ void VMManager::SaveStateToSlot(s32 slot, bool zip_on_thread, std::function<void
|
|||||||
const std::string filename(GetCurrentSaveStateFileName(slot));
|
const std::string filename(GetCurrentSaveStateFileName(slot));
|
||||||
if (filename.empty())
|
if (filename.empty())
|
||||||
{
|
{
|
||||||
error_callback(TRANSLATE_STR("VMManager", "Failed to generate filename for save state."));
|
error_callback(TRANSLATE_STR("VMManager", "Cannot generate filename for save state."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MemcardBusy::IsBusy())
|
if (MemcardBusy::IsBusy())
|
||||||
{
|
{
|
||||||
error_callback(fmt::format(
|
error_callback(TRANSLATE_STR("VMManager",
|
||||||
TRANSLATE_FS("VMManager", "Failed to save state to slot {} (Memory card is busy)"), slot));
|
"The memory card is busy, so the state save operation has been cancelled to prevent data loss."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user