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 virtual void showEvent(QShowEvent*) override;
35 virtual void paintEvent(QPaintEvent*) override;
36
37private:
38 void loadState(int slot);
39 void triggerState(int slot);
40
41 Ui::LoadSaveState m_ui;
42 GameController* m_controller;
43 SavestateButton* m_slots[NUM_SLOTS];
44 LoadSave m_mode;
45
46 int m_currentFocus;
47 QPixmap m_currentImage;
48};
49
50}
51
52#endif