author | arrom |
Thu, 23 Dec 2010 11:06:52 -0500 | |
changeset 4643 | 050af7a71cc1 |
parent 4562 | b55f78fd2bf6 |
child 4699 | 47d8a524780a |
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(); |
4534 | 58 |
void mapDrawingFinished(); |
164 | 59 |
|
60 |
public slots: |
|
4562 | 61 |
void askForGeneratedPreview(); |
320 | 62 |
void setSeed(const QString & seed); |
63 |
void setMap(const QString & map); |
|
64 |
void setTheme(const QString & theme); |
|
1797 | 65 |
void setTemplateFilter(int); |
3133 | 66 |
void setMapgen(MapGenerator m); |
67 |
void setMaze_size(int size); |
|
4537 | 68 |
void setDrawnMapData(const QByteArray & ar); |
164 | 69 |
|
325 | 70 |
signals: |
71 |
void seedChanged(const QString & seed); |
|
72 |
void mapChanged(const QString & map); |
|
73 |
void themeChanged(const QString & theme); |
|
1802 | 74 |
void newTemplateFilter(int filter); |
3133 | 75 |
void mapgenChanged(MapGenerator m); |
76 |
void maze_sizeChanged(int s); |
|
4511 | 77 |
void drawMapRequested(); |
4525 | 78 |
void drawnMapChanged(const QByteArray & data); |
325 | 79 |
|
164 | 80 |
private slots: |
81 |
void setImage(const QImage newImage); |
|
1790 | 82 |
void setHHLimit(int hhLimit); |
249 | 83 |
void mapChanged(int index); |
320 | 84 |
void setRandomSeed(); |
1318 | 85 |
void setRandomTheme(); |
4337 | 86 |
void setRandomMap(); |
87 |
void setRandomStatic(); |
|
88 |
void setRandomMission(); |
|
1215 | 89 |
void themeSelected(int currentRow); |
1790 | 90 |
void addInfoToPreview(QPixmap image); |
1802 | 91 |
void templateFilterChanged(int filter); |
4550
d300ea498486
added set button to seed edit so maps won't regenerate as often
Henek
parents:
4537
diff
changeset
|
92 |
void seedEdited(); |
164 | 93 |
|
94 |
protected: |
|
95 |
virtual void resizeEvent ( QResizeEvent * event ); |
|
96 |
||
97 |
private: |
|
1209 | 98 |
QGridLayout mainLayout; |
164 | 99 |
QPushButton* imageButt; |
249 | 100 |
QComboBox* chooseMap; |
1209 | 101 |
IconedGroupBox* gbThemes; |
102 |
QListWidget* lwThemes; |
|
169
a78d4a552500
new more working, but still not completely working version :)
displacer
parents:
168
diff
changeset
|
103 |
HWMap* pMap; |
164 | 104 |
QString m_seed; |
4519 | 105 |
QLineEdit* seedEdit; |
4550
d300ea498486
added set button to seed edit so maps won't regenerate as often
Henek
parents:
4537
diff
changeset
|
106 |
QPushButton* seedSet; |
1790 | 107 |
int hhLimit; |
1797 | 108 |
int templateFilter; |
1790 | 109 |
QPixmap hhSmall; |
1802 | 110 |
QLabel* lblFilter; |
111 |
QComboBox* CB_TemplateFilter; |
|
3133 | 112 |
QLabel *maze_size_label; |
113 |
QComboBox *maze_size_selection; |
|
114 |
MapGenerator mapgen; |
|
4337 | 115 |
int numMissions; |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
116 |
DrawMapScene drawMapScene; |
331 | 117 |
|
4562 | 118 |
void updatePreview(); |
164 | 119 |
}; |
120 |
||
121 |
#endif // _HWMAP_CONTAINER_INCLUDED |