System: Clear out memcard warnings when changing to valid config
This commit is contained in:
parent
e1e2dcd435
commit
d5a3770663
|
@ -2892,14 +2892,16 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
if (is_running_psf)
|
if (is_running_psf)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
std::string message_key = fmt::format("MemoryCard{}SharedWarning", slot);
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MemoryCardType::PerGame:
|
case MemoryCardType::PerGame:
|
||||||
{
|
{
|
||||||
if (s_running_game_serial.empty())
|
if (s_running_game_serial.empty())
|
||||||
{
|
{
|
||||||
Host::AddFormattedOSDMessage(
|
Host::AddKeyedFormattedOSDMessage(
|
||||||
5.0f,
|
std::move(message_key), 5.0f,
|
||||||
Host::TranslateString("System", "Per-game memory card cannot be used for slot %u as the running "
|
Host::TranslateString("System", "Per-game memory card cannot be used for slot %u as the running "
|
||||||
"game has no code. Using shared card instead."),
|
"game has no code. Using shared card instead."),
|
||||||
slot + 1u);
|
slot + 1u);
|
||||||
|
@ -2907,6 +2909,7 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage(std::move(message_key));
|
||||||
return MemoryCard::Open(g_settings.GetGameMemoryCardPath(s_running_game_serial.c_str(), slot));
|
return MemoryCard::Open(g_settings.GetGameMemoryCardPath(s_running_game_serial.c_str(), slot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2915,8 +2918,8 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
{
|
{
|
||||||
if (s_running_game_title.empty())
|
if (s_running_game_title.empty())
|
||||||
{
|
{
|
||||||
Host::AddFormattedOSDMessage(
|
Host::AddKeyedFormattedOSDMessage(
|
||||||
5.0f,
|
std::move(message_key), 5.0f,
|
||||||
Host::TranslateString("System", "Per-game memory card cannot be used for slot %u as the running "
|
Host::TranslateString("System", "Per-game memory card cannot be used for slot %u as the running "
|
||||||
"game has no title. Using shared card instead."),
|
"game has no title. Using shared card instead."),
|
||||||
slot + 1u);
|
slot + 1u);
|
||||||
|
@ -2924,6 +2927,7 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage(std::move(message_key));
|
||||||
return MemoryCard::Open(g_settings.GetGameMemoryCardPath(
|
return MemoryCard::Open(g_settings.GetGameMemoryCardPath(
|
||||||
MemoryCard::SanitizeGameTitleForFileName(s_running_game_title).c_str(), slot));
|
MemoryCard::SanitizeGameTitleForFileName(s_running_game_title).c_str(), slot));
|
||||||
}
|
}
|
||||||
|
@ -2935,8 +2939,8 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
const std::string_view file_title(Path::GetFileTitle(display_name));
|
const std::string_view file_title(Path::GetFileTitle(display_name));
|
||||||
if (file_title.empty())
|
if (file_title.empty())
|
||||||
{
|
{
|
||||||
Host::AddFormattedOSDMessage(
|
Host::AddKeyedFormattedOSDMessage(
|
||||||
5.0f,
|
std::move(message_key), 5.0f,
|
||||||
Host::TranslateString("System", "Per-game memory card cannot be used for slot %u as the running "
|
Host::TranslateString("System", "Per-game memory card cannot be used for slot %u as the running "
|
||||||
"game has no path. Using shared card instead."),
|
"game has no path. Using shared card instead."),
|
||||||
slot + 1u);
|
slot + 1u);
|
||||||
|
@ -2944,6 +2948,7 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage(std::move(message_key));
|
||||||
return MemoryCard::Open(
|
return MemoryCard::Open(
|
||||||
g_settings.GetGameMemoryCardPath(MemoryCard::SanitizeGameTitleForFileName(file_title).c_str(), slot));
|
g_settings.GetGameMemoryCardPath(MemoryCard::SanitizeGameTitleForFileName(file_title).c_str(), slot));
|
||||||
}
|
}
|
||||||
|
@ -2951,17 +2956,24 @@ std::unique_ptr<MemoryCard> System::GetMemoryCardForSlot(u32 slot, MemoryCardTyp
|
||||||
|
|
||||||
case MemoryCardType::Shared:
|
case MemoryCardType::Shared:
|
||||||
{
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage(std::move(message_key));
|
||||||
return MemoryCard::Open(g_settings.GetSharedMemoryCardPath(slot));
|
return MemoryCard::Open(g_settings.GetSharedMemoryCardPath(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
case MemoryCardType::NonPersistent:
|
case MemoryCardType::NonPersistent:
|
||||||
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage(std::move(message_key));
|
||||||
return MemoryCard::Create();
|
return MemoryCard::Create();
|
||||||
|
}
|
||||||
|
|
||||||
case MemoryCardType::None:
|
case MemoryCardType::None:
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage(std::move(message_key));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void System::UpdateMemoryCardTypes()
|
void System::UpdateMemoryCardTypes()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue