src/platform/qt/OverrideView.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#pragma once
7
8#include <QDialog>
9#include <QTimer>
10
11#include <memory>
12
13#ifdef M_CORE_GB
14#include <mgba/gb/interface.h>
15#endif
16
17#include "ColorPicker.h"
18#include "Override.h"
19
20#include "ui_OverrideView.h"
21
22struct mCoreThread;
23
24namespace QGBA {
25
26class ConfigController;
27class CoreController;
28class Override;
29
30class OverrideView : public QDialog {
31Q_OBJECT
32
33public:
34 OverrideView(ConfigController* config, QWidget* parent = nullptr);
35
36 void setController(std::shared_ptr<CoreController> controller);
37
38public slots:
39 void saveOverride();
40 void recheck();
41
42private slots:
43 void updateOverrides();
44 void gameStarted();
45 void gameStopped();
46
47private:
48 Ui::OverrideView m_ui;
49
50 std::shared_ptr<CoreController> m_controller;
51 ConfigController* m_config;
52 bool m_savePending = false;
53 QTimer m_recheck;
54
55#ifdef M_CORE_GB
56 uint32_t m_gbColors[12]{};
57 ColorPicker m_colorPickers[12];
58
59 static QList<enum GBModel> s_gbModelList;
60 static QList<enum GBMemoryBankControllerType> s_mbcList;
61#endif
62};
63
64}