author | unc0rr |
Mon, 09 Mar 2009 18:43:41 +0000 | |
changeset 1876 | b13dd4e6e98e |
parent 1875 | 189370d394db |
child 1878 | b3b277d2b891 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
486 | 3 |
* Copyright (c) 2006, 2007 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
#ifndef GAMECONFIGWIDGET_H |
|
20 |
#define GAMECONFIGWIDGET_H |
|
21 |
||
22 |
#include <QWidget> |
|
318 | 23 |
#include <QStringList> |
1217 | 24 |
#include <QGroupBox> |
1783 | 25 |
#include <QSpinBox> |
184 | 26 |
|
27 |
#include "mapContainer.h" |
|
28 |
||
311 | 29 |
class QCheckBox; |
30 |
class QVBoxLayout; |
|
31 |
class QLabel; |
|
1783 | 32 |
class FreqSpinBox; |
33 |
||
34 |
class FreqSpinBox : public QSpinBox |
|
35 |
{ |
|
36 |
Q_OBJECT |
|
37 |
||
38 |
public: |
|
39 |
FreqSpinBox(QWidget* parent) : QSpinBox(parent) |
|
40 |
{ |
|
41 |
||
42 |
} |
|
43 |
||
44 |
QString textFromValue ( int value ) const |
|
45 |
{ |
|
46 |
switch (value) |
|
47 |
{ |
|
48 |
case 0 : return tr("Never"); |
|
49 |
case 1 : return tr("Every turn"); |
|
50 |
default : return tr("Each %1 turn").arg(value); |
|
51 |
} |
|
52 |
} |
|
53 |
}; |
|
311 | 54 |
|
1217 | 55 |
class GameCFGWidget : public QGroupBox |
184 | 56 |
{ |
57 |
Q_OBJECT |
|
58 |
||
59 |
public: |
|
349 | 60 |
GameCFGWidget(QWidget* parent, bool externalControl=false); |
318 | 61 |
quint32 getGameFlags() const; |
312 | 62 |
quint32 getInitHealth() const; |
318 | 63 |
QStringList getFullConfig() const; |
1875 | 64 |
QComboBox * WeaponsName; |
1802 | 65 |
HWMapContainer* pMapContainer; |
696 | 66 |
|
320 | 67 |
public slots: |
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
68 |
void setParam(const QString & param, const QStringList & value); |
1875 | 69 |
void fullNetConfig(); |
325 | 70 |
|
71 |
signals: |
|
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
72 |
void paramChanged(const QString & param, const QStringList & value); |
1531 | 73 |
|
74 |
private slots: |
|
75 |
void ammoChanged(int index); |
|
1874 | 76 |
void borderChanged(bool); |
77 |
void caseProbabilityChanged(int); |
|
78 |
void fortsModeChanged(bool); |
|
79 |
void initHealthChanged(int); |
|
80 |
void mapChanged(const QString &); |
|
1876 | 81 |
void templateFilterChanged(int); |
1874 | 82 |
void seedChanged(const QString &); |
83 |
void solidChanged(bool); |
|
84 |
void suddenDeathTurnsChanged(int); |
|
85 |
void teamsDivideChanged(bool); |
|
86 |
void themeChanged(const QString &); |
|
87 |
void turnTimeChanged(int); |
|
184 | 88 |
|
89 |
private: |
|
90 |
QCheckBox * CB_mode_Forts; |
|
1427 | 91 |
QCheckBox * CB_teamsDivide; |
1530 | 92 |
QCheckBox * CB_solid; |
1784 | 93 |
QCheckBox * CB_border; |
1217 | 94 |
QGridLayout mainLayout; |
311 | 95 |
QSpinBox * SB_TurnTime; |
96 |
QSpinBox * SB_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
97 |
QSpinBox * SB_SuddenDeath; |
1783 | 98 |
FreqSpinBox * SB_CaseProb; |
311 | 99 |
QLabel * L_TurnTime; |
100 |
QLabel * L_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
101 |
QLabel * L_SuddenDeath; |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
102 |
QLabel * L_CaseProb; |
325 | 103 |
|
703 | 104 |
QString curNetAmmoName; |
697 | 105 |
QString curNetAmmo; |
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
106 |
|
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
107 |
void setNetAmmo(const QString& name, const QString& ammo); |
184 | 108 |
}; |
109 |
||
110 |
#endif // GAMECONFIGWIDGET_H |