author | unc0rr |
Mon, 13 Dec 2010 22:12:30 +0300 | |
changeset 4520 | e7882bd1a894 |
parent 4519 | aee36896d46b |
child 4525 | 0a81be113e21 |
permissions | -rw-r--r-- |
164 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
486 | 3 |
* Copyright (c) 2006, 2007 Igor Ulyanov <iulyanov@gmail.com> |
164 | 4 |
* |
184 | 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 |
|
164 | 8 |
* |
184 | 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. |
|
164 | 13 |
* |
184 | 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 |
|
164 | 17 |
*/ |
18 |
||
19 |
#ifndef _HWMAP_CONTAINER_INCLUDED |
|
20 |
#define _HWMAP_CONTAINER_INCLUDED |
|
21 |
||
22 |
#include <QWidget> |
|
1209 | 23 |
#include <QGridLayout> |
249 | 24 |
#include <QComboBox> |
1802 | 25 |
#include <QLabel> |
4489 | 26 |
#include <QByteArray> |
4519 | 27 |
#include <QLineEdit> |
164 | 28 |
|
1210 | 29 |
#include "hwmap.h" |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
30 |
#include "drawmapscene.h" |
1210 | 31 |
|
164 | 32 |
class QPushButton; |
1209 | 33 |
class IconedGroupBox; |
34 |
class QListWidget; |
|
164 | 35 |
|
249 | 36 |
class MapFileErrorException |
37 |
{ |
|
38 |
}; |
|
39 |
||
164 | 40 |
class HWMapContainer : public QWidget |
41 |
{ |
|
42 |
Q_OBJECT |
|
320 | 43 |
|
164 | 44 |
public: |
45 |
HWMapContainer(QWidget * parent=0); |
|
46 |
QString getCurrentSeed() const; |
|
249 | 47 |
QString getCurrentMap() const; |
48 |
QString getCurrentTheme() const; |
|
1790 | 49 |
int getCurrentHHLimit() const; |
4513
1dd97c710f5a
added general scripts to multiplayer and added option for scripts to allow user set schemes or weapon sets.
Henek
parents:
4511
diff
changeset
|
50 |
QString getCurrentScheme() const; |
1dd97c710f5a
added general scripts to multiplayer and added option for scripts to allow user set schemes or weapon sets.
Henek
parents:
4511
diff
changeset
|
51 |
QString getCurrentWeapons() const; |
1802 | 52 |
quint32 getTemplateFilter() const; |
3133 | 53 |
MapGenerator get_mapgen(void) const; |
54 |
int get_maze_size(void) const; |
|
3008 | 55 |
bool getCurrentIsMission() const; |
4489 | 56 |
QByteArray getDrawnMapData(); |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
57 |
DrawMapScene * getDrawMapScene(); |
164 | 58 |
|
59 |
public slots: |
|
60 |
void changeImage(); |
|
320 | 61 |
void setSeed(const QString & seed); |
62 |
void setMap(const QString & map); |
|
63 |
void setTheme(const QString & theme); |
|
1797 | 64 |
void setTemplateFilter(int); |
3133 | 65 |
void setMapgen(MapGenerator m); |
66 |
void setMaze_size(int size); |
|
164 | 67 |
|
325 | 68 |
signals: |
69 |
void seedChanged(const QString & seed); |
|
70 |
void mapChanged(const QString & map); |
|
71 |
void themeChanged(const QString & theme); |
|
1802 | 72 |
void newTemplateFilter(int filter); |
3133 | 73 |
void mapgenChanged(MapGenerator m); |
74 |
void maze_sizeChanged(int s); |
|
4511 | 75 |
void drawMapRequested(); |
325 | 76 |
|
164 | 77 |
private slots: |
78 |
void setImage(const QImage newImage); |
|
1790 | 79 |
void setHHLimit(int hhLimit); |
249 | 80 |
void mapChanged(int index); |
320 | 81 |
void setRandomSeed(); |
1318 | 82 |
void setRandomTheme(); |
4337 | 83 |
void setRandomMap(); |
84 |
void setRandomStatic(); |
|
85 |
void setRandomMission(); |
|
1215 | 86 |
void themeSelected(int currentRow); |
1790 | 87 |
void addInfoToPreview(QPixmap image); |
1802 | 88 |
void templateFilterChanged(int filter); |
4519 | 89 |
void seedEdited(const QString & seed); |
164 | 90 |
|
91 |
protected: |
|
92 |
virtual void resizeEvent ( QResizeEvent * event ); |
|
93 |
||
94 |
private: |
|
1209 | 95 |
QGridLayout mainLayout; |
164 | 96 |
QPushButton* imageButt; |
249 | 97 |
QComboBox* chooseMap; |
1209 | 98 |
IconedGroupBox* gbThemes; |
99 |
QListWidget* lwThemes; |
|
169
a78d4a552500
new more working, but still not completely working version :)
displacer
parents:
168
diff
changeset
|
100 |
HWMap* pMap; |
164 | 101 |
QString m_seed; |
4519 | 102 |
QLineEdit* seedEdit; |
1790 | 103 |
int hhLimit; |
1797 | 104 |
int templateFilter; |
1790 | 105 |
QPixmap hhSmall; |
1802 | 106 |
QLabel* lblFilter; |
107 |
QComboBox* CB_TemplateFilter; |
|
3133 | 108 |
QLabel *maze_size_label; |
109 |
QComboBox *maze_size_selection; |
|
110 |
MapGenerator mapgen; |
|
4337 | 111 |
int numMissions; |
3133 | 112 |
int maze_size; |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
113 |
DrawMapScene drawMapScene; |
331 | 114 |
|
115 |
void loadMap(int index); |
|
164 | 116 |
}; |
117 |
||
118 |
#endif // _HWMAP_CONTAINER_INCLUDED |