mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
System: Add non-persistent memory card type
This commit is contained in:
parent
3dc7ef92c2
commit
d9a655fb41
|
@ -21,6 +21,7 @@ public:
|
|||
static std::unique_ptr<MemoryCard> Open(std::string_view filename);
|
||||
|
||||
const MemoryCardImage::DataArray& GetData() const { return m_data; }
|
||||
MemoryCardImage::DataArray& GetData() { return m_data; }
|
||||
const std::string& GetFilename() const { return m_filename; }
|
||||
void SetFilename(std::string filename) { m_filename = std::move(filename); }
|
||||
|
||||
|
|
|
@ -910,13 +910,14 @@ const char* Settings::GetControllerTypeDisplayName(ControllerType type)
|
|||
return s_controller_display_names[static_cast<int>(type)];
|
||||
}
|
||||
|
||||
static std::array<const char*, 5> s_memory_card_type_names = {
|
||||
{"None", "Shared", "PerGame", "PerGameTitle", "PerGameFileTitle"}};
|
||||
static std::array<const char*, 5> s_memory_card_type_display_names = {
|
||||
static std::array<const char*, 6> s_memory_card_type_names = {
|
||||
{"None", "Shared", "PerGame", "PerGameTitle", "PerGameFileTitle", "NonPersistent"}};
|
||||
static std::array<const char*, 6> s_memory_card_type_display_names = {
|
||||
{TRANSLATABLE("MemoryCardType", "No Memory Card"), TRANSLATABLE("MemoryCardType", "Shared Between All Games"),
|
||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (Game Code)"),
|
||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (Game Title)"),
|
||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (File Title)")}};
|
||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (File Title)"),
|
||||
TRANSLATABLE("MemoryCardType", "Non-Persistent Card (Do Not Save)")}};
|
||||
|
||||
std::optional<MemoryCardType> Settings::ParseMemoryCardTypeName(const char* str)
|
||||
{
|
||||
|
|
|
@ -1871,6 +1871,12 @@ void UpdateMemoryCards()
|
|||
card = MemoryCard::Open(g_settings.memory_card_paths[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case MemoryCardType::NonPersistent:
|
||||
{
|
||||
card = MemoryCard::Create();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (card)
|
||||
|
|
|
@ -135,6 +135,7 @@ enum class MemoryCardType
|
|||
PerGame,
|
||||
PerGameTitle,
|
||||
PerGameFileTitle,
|
||||
NonPersistent,
|
||||
Count
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue