-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainWindow.h
195 lines (151 loc) · 6.73 KB
/
MainWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*
* QtSssSNibblers: SwissalpS Nibbles written with Qt-Framework
* Copyright (C) 2018-2019 Luke J. Zimmermann aka SwissalpS <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "AppSettings.h"
#include "History.h"
#include "Lingo.h"
namespace Ui {
class MainWindow;
} // namespace Ui
namespace SwissalpS { namespace QtNibblers {
class MainWindow : public QMainWindow {
Q_OBJECT
private:
Ui::MainWindow *pUi;
private slots:
void on_buttonAP0_clicked();
void on_buttonAP1_clicked();
void on_buttonAP2_clicked();
void on_buttonAP3_clicked();
void on_buttonAP4_clicked();
void on_buttonAP5_clicked();
void on_buttonAP6_clicked();
void on_buttonAP7_clicked();
void on_buttonAP8_clicked();
void on_buttonClearHistory_clicked();
void on_buttonClearHistorySelected_clicked();
void on_buttonHP0_clicked();
void on_buttonHP1_clicked();
void on_buttonHP2_clicked();
void on_buttonHP3_clicked();
void on_buttonHP4_clicked();
void on_buttonZap0_clicked();
void on_buttonZap128_clicked();
void on_buttonZap255_clicked();
void on_cbFakeBonuses_stateChanged(int iState);
void on_cbGameOverOnLastDead_stateChanged(int iState);
void on_cbLimitLives_toggled(bool bChecked);
void on_cbLoadSetsStartLevel_stateChanged(int iState);
void on_cbRelative1_toggled(bool bChecked);
void on_cbRelative2_toggled(bool bChecked);
void on_cbRelative3_toggled(bool bChecked);
void on_cbRelative4_toggled(bool bChecked);
void on_cbSound_stateChanged(int iState);
void on_cbUseMouse1_toggled(bool bChecked);
void on_cbUseMouse2_toggled(bool bChecked);
void on_cbUseMouse3_toggled(bool bChecked);
void on_cbUseMouse4_toggled(bool bChecked);
void on_kseDown1_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseDown2_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseDown3_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseDown4_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseLeft1_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseLeft2_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseLeft3_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseLeft4_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseRight1_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseRight2_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseRight3_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseRight4_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseUp1_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseUp2_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseUp3_keySequenceChanged(const QKeySequence &oKeySequence);
void on_kseUp4_keySequenceChanged(const QKeySequence &oKeySequence);
void on_leName1_editingFinished();
void on_leName2_editingFinished();
void on_leName3_editingFinished();
void on_leName4_editingFinished();
void on_radioBLloop_toggled(bool bChecked);
void on_radioBLskip_toggled(bool bChecked);
void on_radioBLwin_toggled(bool bChecked);
void on_selectColour1_currentIndexChanged(int iIndex);
void on_selectColour2_currentIndexChanged(int iIndex);
void on_selectColour3_currentIndexChanged(int iIndex);
void on_selectColour4_currentIndexChanged(int iIndex);
void on_selectColour5_currentIndexChanged(int iIndex);
void on_selectColour6_currentIndexChanged(int iIndex);
void on_selectColour7_currentIndexChanged(int iIndex);
void on_selectColour8_currentIndexChanged(int iIndex);
void on_selectSpeed_currentIndexChanged(int iIndex);
void on_selectStartLevel_currentIndexChanged(int iIndex);
void on_selectStartLives_currentIndexChanged(int iIndex);
void on_sliderDust_valueChanged(int iValue);
void on_tabWidgetMain_currentChanged(int iIndex);
protected:
AppSettings *pAS;
History *pHistory;
void changeEvent(QEvent *pEvent);
void closeEvent(QCloseEvent *pEvent);
virtual void initBuilder();
virtual void initGame();
virtual void initHistory();
virtual void initSettings();
virtual void mousePressEvent(QMouseEvent *pEvent) override;
virtual void onPlayerColourChanged(const quint8 ubWorm, const quint8 ubIndex);
virtual void onPlayerKeyDownChanged(const quint8 ubWorm, const QKeySequence &oKeySequence);
virtual void onPlayerKeyLeftChanged(const quint8 ubWorm, const QKeySequence &oKeySequence);
virtual void onPlayerKeyRightChanged(const quint8 ubWorm, const QKeySequence &oKeySequence);
virtual void onPlayerKeyUpChanged(const quint8 ubWorm, const QKeySequence &oKeySequence);
virtual void onPlayerNameChanged(const quint8 ubWorm, const QString sName);
virtual void onPlayerRelativeToggled(const quint8 ubWorm, const bool bChecked);
virtual void onPlayerUseMouseToggled(const quint8 ubWorm, const bool bChecked);
virtual void settingsUpdatePlayerColours();
virtual void settingsUpdatePlayerCount();
virtual void settingsUpdatePlayerKeys();
virtual void settingsUpdatePlayerNames();
virtual void settingsUpdatePlayerMouseAndRelative();
public:
explicit MainWindow(QWidget *pParent = nullptr);
~MainWindow();
signals:
void debugMessage(const QString &sMessage) const;
void mainTabIndexChanged(const int iIndex) const;
void mouseButtonLeft() const;
void mouseButtonRight() const;
void quitting() const;
void settingsPlayerColoursChanged(const QVector<quint8> aubColours) const;
void settingsPlayerCountChanged(const quint8 ubCountHumans,
const quint8 ubCountAIs) const;
void settingsPlayerKeyChanged(const quint8 ubWorm,
const QKeySequence &oKeySequence,
const L::Heading eHeading) const;
void settingsPlayerNameChanged(const quint8 ubWorm, const QString sName) const;
void settingsPlayerUseMouseChanged() const;
void settingsRelativeChanged(const quint8 ubWorm, const bool bRelative) const;
void settingsSpeedChanged(const int iIndex) const;
void settingsTrailChanged(const int iValue) const;
public slots:
void onDebugMessage(const QString &sMessage) const;
void onStatusMessage(const QString &sMessage) const;
virtual void onUpdateHistory();
void run();
}; // MainWindow
} } // namespace SwissalpS::QtNibblers
#endif // MAINWINDOW_H