src/platform/qt/LoadSaveState.h (view raw)
1#ifndef QGBA_LOAD_SAVE_STATE
2#define QGBA_LOAD_SAVE_STATE
3
4#include <QWidget>
5
6#include "ui_LoadSaveState.h"
7
8namespace QGBA {
9
10class GameController;
11class SavestateButton;
12
13enum class LoadSave {
14 LOAD,
15 SAVE
16};
17
18class LoadSaveState : public QWidget {
19Q_OBJECT
20
21public:
22 const static int NUM_SLOTS = 9;
23
24 LoadSaveState(GameController* controller, QWidget* parent = nullptr);
25
26 void setMode(LoadSave mode);
27
28signals:
29 void closed();
30
31protected:
32 virtual bool eventFilter(QObject*, QEvent*) override;
33 virtual void closeEvent(QCloseEvent*) override;
34
35private:
36 void loadState(int slot);
37 void triggerState(int slot);
38
39 Ui::LoadSaveState m_ui;
40 GameController* m_controller;
41 SavestateButton* m_slots[NUM_SLOTS];
42 LoadSave m_mode;
43
44 int m_currentFocus;
45 QPixmap m_currentImage;
46};
47
48}
49
50#endif