author | unc0rr |
Mon, 09 Mar 2009 10:54:44 +0000 | |
changeset 1875 | 189370d394db |
parent 1874 | 1b145e099b75 |
child 1876 | b13dd4e6e98e |
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 &); |
|
81 |
void seedChanged(const QString &); |
|
82 |
void solidChanged(bool); |
|
83 |
void suddenDeathTurnsChanged(int); |
|
84 |
void teamsDivideChanged(bool); |
|
85 |
void themeChanged(const QString &); |
|
86 |
void turnTimeChanged(int); |
|
184 | 87 |
|
88 |
private: |
|
89 |
QCheckBox * CB_mode_Forts; |
|
1427 | 90 |
QCheckBox * CB_teamsDivide; |
1530 | 91 |
QCheckBox * CB_solid; |
1784 | 92 |
QCheckBox * CB_border; |
1217 | 93 |
QGridLayout mainLayout; |
311 | 94 |
QSpinBox * SB_TurnTime; |
95 |
QSpinBox * SB_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
96 |
QSpinBox * SB_SuddenDeath; |
1783 | 97 |
FreqSpinBox * SB_CaseProb; |
311 | 98 |
QLabel * L_TurnTime; |
99 |
QLabel * L_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
100 |
QLabel * L_SuddenDeath; |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
101 |
QLabel * L_CaseProb; |
325 | 102 |
|
703 | 103 |
QString curNetAmmoName; |
697 | 104 |
QString curNetAmmo; |
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
105 |
|
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
106 |
void setNetAmmo(const QString& name, const QString& ammo); |
184 | 107 |
}; |
108 |
||
109 |
#endif // GAMECONFIGWIDGET_H |