author | unc0rr |
Mon, 02 Mar 2009 17:33:49 +0000 | |
changeset 1853 | 5618915f9ea4 |
parent 1802 | dd148e2506e2 |
child 1873 | 815a3ff1fe4b |
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; |
696 | 70 |
QComboBox* WeaponsName; |
1802 | 71 |
HWMapContainer* pMapContainer; |
696 | 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); |
1784 | 84 |
void setBorder(bool value); |
703 | 85 |
void setNetAmmo(const QString& name, const QString& ammo); |
325 | 86 |
|
87 |
signals: |
|
88 |
void seedChanged(const QString & seed); |
|
89 |
void mapChanged(const QString & map); |
|
90 |
void themeChanged(const QString & theme); |
|
1427 | 91 |
void initHealthChanged(int health); |
92 |
void turnTimeChanged(int time); |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
93 |
void suddenDeathTurnsChanged(int turns); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
94 |
void caseProbabilityChanged(int prob); |
325 | 95 |
void fortsModeChanged(bool value); |
1427 | 96 |
void teamsDivideChanged(bool value); |
1530 | 97 |
void solidChanged(bool value); |
1784 | 98 |
void borderChanged(bool value); |
1531 | 99 |
void newWeaponScheme(const QString & name, const QString & ammo); |
100 |
||
101 |
private slots: |
|
102 |
void ammoChanged(int index); |
|
184 | 103 |
|
104 |
private: |
|
105 |
QCheckBox * CB_mode_Forts; |
|
1427 | 106 |
QCheckBox * CB_teamsDivide; |
1530 | 107 |
QCheckBox * CB_solid; |
1784 | 108 |
QCheckBox * CB_border; |
1217 | 109 |
QGridLayout mainLayout; |
311 | 110 |
QSpinBox * SB_TurnTime; |
111 |
QSpinBox * SB_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
112 |
QSpinBox * SB_SuddenDeath; |
1783 | 113 |
FreqSpinBox * SB_CaseProb; |
311 | 114 |
QLabel * L_TurnTime; |
115 |
QLabel * L_InitHealth; |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
116 |
QLabel * L_SuddenDeath; |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1531
diff
changeset
|
117 |
QLabel * L_CaseProb; |
325 | 118 |
|
703 | 119 |
QString curNetAmmoName; |
697 | 120 |
QString curNetAmmo; |
184 | 121 |
}; |
122 |
||
123 |
#endif // GAMECONFIGWIDGET_H |