all repos — mgba @ 38c8e4c4e1d04ef3a6d3439a9c0c55499dd9e701

mGBA Game Boy Advance Emulator

src/platform/qt/BattleChipView.h (view raw)

 1/* Copyright (c) 2013-2019 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 "BattleChipModel.h"
 9
10#include <QDialog>
11
12#include <memory>
13
14#include <mgba/core/interface.h>
15
16#include "ui_BattleChipView.h"
17
18namespace QGBA {
19
20class CoreController;
21class Window;
22
23class BattleChipView : public QDialog {
24Q_OBJECT
25
26public:
27	BattleChipView(std::shared_ptr<CoreController> controller, Window* window, QWidget* parent = nullptr);
28	~BattleChipView();
29
30public slots:
31	void setFlavor(int);
32	void insertChip(bool);
33	void reinsert();
34	void resort();
35
36private slots:
37	void advanceFrameCounter();
38	void addChip();
39	void removeChip();
40
41	void saveDeck();
42	void loadDeck();
43
44private:
45	static const int UNINSERTED_TIME = 10;
46
47	void loadChipNames(int);
48
49	Ui::BattleChipView m_ui;
50
51	BattleChipModel m_model;
52	std::shared_ptr<CoreController> m_controller;
53
54	int m_frameCounter = -1;
55	bool m_next = false;
56
57	Window* m_window;
58};
59
60}