author | unc0rr |
Sat, 31 Jan 2009 15:44:07 +0000 | |
changeset 1783 | 169ebeefd7ab |
parent 1782 | e7589e37a6d6 |
child 1784 | dfe9bafb4590 |
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; |
184 | 62 |
QString getCurrentSeed() const; |
249 | 63 |
QString getCurrentMap() const; |
64 |
QString getCurrentTheme() const; |
|
312 | 65 |
quint32 getInitHealth() const; |
66 |
quint32 getTurnTime() const; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
67 |
quint32 getSuddenDeathTurns() const; |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
68 |
quint32 getCaseProbability() const; |
318 | 69 |
QStringList getFullConfig() const; |
184 | 70 |
|
696 | 71 |
QComboBox* WeaponsName; |
72 |
||
320 | 73 |
public slots: |
74 |
void setSeed(const QString & seed); |
|
75 |
void setMap(const QString & map); |
|
76 |
void setTheme(const QString & theme); |
|
1427 | 77 |
void setInitHealth(int health); |
78 |
void setTurnTime(int time); |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
79 |
void setSuddenDeathTurns(int turns); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
80 |
void setCaseProbability(int prob); |
325 | 81 |
void setFortsMode(bool value); |
1427 | 82 |
void setTeamsDivide(bool value); |
1530 | 83 |
void setSolid(bool value); |
703 | 84 |
void setNetAmmo(const QString& name, const QString& ammo); |
325 | 85 |
|
86 |
signals: |
|
87 |
void seedChanged(const QString & seed); |
|
88 |
void mapChanged(const QString & map); |
|
89 |
void themeChanged(const QString & theme); |
|
1427 | 90 |
void initHealthChanged(int health); |
91 |
void turnTimeChanged(int time); |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
92 |
void suddenDeathTurnsChanged(int turns); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
93 |
void caseProbabilityChanged(int prob); |
325 | 94 |
void fortsModeChanged(bool value); |
1427 | 95 |
void teamsDivideChanged(bool value); |
1530 | 96 |
void solidChanged(bool value); |
1531 | 97 |
void newWeaponScheme(const QString & name, const QString & ammo); |
98 |
||
99 |
private slots: |
|
100 |
void ammoChanged(int index); |
|
184 | 101 |
|
102 |
private: |
|
103 |
QCheckBox * CB_mode_Forts; |
|
1427 | 104 |
QCheckBox * CB_teamsDivide; |
1530 | 105 |
QCheckBox * CB_solid; |
1217 | 106 |
QGridLayout mainLayout; |
184 | 107 |
HWMapContainer* pMapContainer; |
311 | 108 |
QSpinBox * SB_TurnTime; |
109 |
QSpinBox * SB_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
110 |
QSpinBox * SB_SuddenDeath; |
1783 | 111 |
FreqSpinBox * SB_CaseProb; |
311 | 112 |
QLabel * L_TurnTime; |
113 |
QLabel * L_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
114 |
QLabel * L_SuddenDeath; |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
115 |
QLabel * L_CaseProb; |
325 | 116 |
|
703 | 117 |
QString curNetAmmoName; |
697 | 118 |
QString curNetAmmo; |
184 | 119 |
}; |
120 |
||
121 |
#endif // GAMECONFIGWIDGET_H |