Use Slot in GCMemcardManager

This commit is contained in:
Pokechu22
2022-01-11 13:02:50 -08:00
parent 777bb4d82c
commit 9109258b85
2 changed files with 103 additions and 87 deletions

View File

@ -12,6 +12,8 @@
#include <QDialog>
#include "Common/CommonTypes.h"
#include "Common/EnumMap.h"
#include "Core/HW/EXI/EXI.h"
namespace Memcard
{
@ -53,26 +55,26 @@ private:
void LoadDefaultMemcards();
void UpdateActions();
void UpdateSlotTable(int slot);
void SetSlotFile(int slot, QString path);
void SetSlotFileInteractive(int slot);
void SetActiveSlot(int slot);
void UpdateSlotTable(ExpansionInterface::Slot slot);
void SetSlotFile(ExpansionInterface::Slot slot, QString path);
void SetSlotFileInteractive(ExpansionInterface::Slot slot);
void SetActiveSlot(ExpansionInterface::Slot slot);
std::vector<u8> GetSelectedFileIndices();
void ImportFiles(int slot, const std::vector<Memcard::Savefile>& savefiles);
void ImportFiles(ExpansionInterface::Slot slot, const std::vector<Memcard::Savefile>& savefiles);
void CopyFiles();
void ImportFile();
void DeleteFiles();
void ExportFiles(Memcard::SavefileFormat format);
void FixChecksums();
void CreateNewCard(int slot);
void CreateNewCard(ExpansionInterface::Slot slot);
void DrawIcons();
QPixmap GetBannerFromSaveFile(int file_index, int slot);
QPixmap GetBannerFromSaveFile(int file_index, ExpansionInterface::Slot slot);
IconAnimationData GetIconFromSaveFile(int file_index, int slot);
IconAnimationData GetIconFromSaveFile(int file_index, ExpansionInterface::Slot slot);
// Actions
QPushButton* m_select_button;
@ -87,17 +89,18 @@ private:
QPushButton* m_fix_checksums_button;
// Slots
static constexpr int SLOT_COUNT = 2;
std::array<std::map<u8, IconAnimationData>, SLOT_COUNT> m_slot_active_icons;
std::array<std::unique_ptr<Memcard::GCMemcard>, SLOT_COUNT> m_slot_memcard;
std::array<QGroupBox*, SLOT_COUNT> m_slot_group;
std::array<QLineEdit*, SLOT_COUNT> m_slot_file_edit;
std::array<QPushButton*, SLOT_COUNT> m_slot_open_button;
std::array<QPushButton*, SLOT_COUNT> m_slot_create_button;
std::array<QTableWidget*, SLOT_COUNT> m_slot_table;
std::array<QLabel*, SLOT_COUNT> m_slot_stat_label;
Common::EnumMap<std::map<u8, IconAnimationData>, ExpansionInterface::MAX_MEMCARD_SLOT>
m_slot_active_icons;
Common::EnumMap<std::unique_ptr<Memcard::GCMemcard>, ExpansionInterface::MAX_MEMCARD_SLOT>
m_slot_memcard;
Common::EnumMap<QGroupBox*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_group;
Common::EnumMap<QLineEdit*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_file_edit;
Common::EnumMap<QPushButton*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_open_button;
Common::EnumMap<QPushButton*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_create_button;
Common::EnumMap<QTableWidget*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_table;
Common::EnumMap<QLabel*, ExpansionInterface::MAX_MEMCARD_SLOT> m_slot_stat_label;
int m_active_slot;
ExpansionInterface::Slot m_active_slot;
u64 m_current_frame = 0;
QDialogButtonBox* m_button_box;