author | unc0rr |
Sun, 27 Feb 2011 21:06:28 +0300 | |
changeset 4968 | 8e1673f0dc05 |
parent 4941 | 90572c338e60 |
child 4976 | 088d40d8aba2 |
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; |
4941 | 54 |
int getMazeSize(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(); |
4720
a9f9c96db60c
Allow people to see my clever seed names if I set to something other than random seed hash.
nemo
parents:
4699
diff
changeset
|
59 |
QLineEdit* seedEdit; |
164 | 60 |
|
61 |
public slots: |
|
4562 | 62 |
void askForGeneratedPreview(); |
320 | 63 |
void setSeed(const QString & seed); |
64 |
void setMap(const QString & map); |
|
65 |
void setTheme(const QString & theme); |
|
1797 | 66 |
void setTemplateFilter(int); |
3133 | 67 |
void setMapgen(MapGenerator m); |
4941 | 68 |
void setMazeSize(int size); |
4537 | 69 |
void setDrawnMapData(const QByteArray & ar); |
4941 | 70 |
void setAllMapParameters(const QString & map, MapGenerator m, int mazesize, const QString & seed, int tmpl); |
164 | 71 |
|
325 | 72 |
signals: |
73 |
void seedChanged(const QString & seed); |
|
74 |
void mapChanged(const QString & map); |
|
75 |
void themeChanged(const QString & theme); |
|
1802 | 76 |
void newTemplateFilter(int filter); |
3133 | 77 |
void mapgenChanged(MapGenerator m); |
4941 | 78 |
void mazeSizeChanged(int s); |
4511 | 79 |
void drawMapRequested(); |
4525 | 80 |
void drawnMapChanged(const QByteArray & data); |
325 | 81 |
|
164 | 82 |
private slots: |
83 |
void setImage(const QImage newImage); |
|
1790 | 84 |
void setHHLimit(int hhLimit); |
249 | 85 |
void mapChanged(int index); |
320 | 86 |
void setRandomSeed(); |
1318 | 87 |
void setRandomTheme(); |
4337 | 88 |
void setRandomMap(); |
89 |
void setRandomStatic(); |
|
90 |
void setRandomMission(); |
|
1215 | 91 |
void themeSelected(int currentRow); |
1790 | 92 |
void addInfoToPreview(QPixmap image); |
4550
d300ea498486
added set button to seed edit so maps won't regenerate as often
Henek
parents:
4537
diff
changeset
|
93 |
void seedEdited(); |
164 | 94 |
|
95 |
protected: |
|
96 |
virtual void resizeEvent ( QResizeEvent * event ); |
|
97 |
||
98 |
private: |
|
1209 | 99 |
QGridLayout mainLayout; |
164 | 100 |
QPushButton* imageButt; |
249 | 101 |
QComboBox* chooseMap; |
1209 | 102 |
IconedGroupBox* gbThemes; |
103 |
QListWidget* lwThemes; |
|
169
a78d4a552500
new more working, but still not completely working version :)
displacer
parents:
168
diff
changeset
|
104 |
HWMap* pMap; |
164 | 105 |
QString m_seed; |
4550
d300ea498486
added set button to seed edit so maps won't regenerate as often
Henek
parents:
4537
diff
changeset
|
106 |
QPushButton* seedSet; |
4699 | 107 |
QLabel* seedLabel; |
1790 | 108 |
int hhLimit; |
1797 | 109 |
int templateFilter; |
1790 | 110 |
QPixmap hhSmall; |
1802 | 111 |
QLabel* lblFilter; |
4941 | 112 |
QComboBox* cbTemplateFilter; |
3133 | 113 |
QLabel *maze_size_label; |
4941 | 114 |
QComboBox *cbMazeSize; |
3133 | 115 |
MapGenerator mapgen; |
4337 | 116 |
int numMissions; |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
117 |
DrawMapScene drawMapScene; |
331 | 118 |
|
4936
d65d438acd23
Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents:
4720
diff
changeset
|
119 |
void intSetSeed(const QString & seed); |
d65d438acd23
Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents:
4720
diff
changeset
|
120 |
void intSetMap(const QString & map); |
d65d438acd23
Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents:
4720
diff
changeset
|
121 |
void intSetMapgen(MapGenerator m); |
4941 | 122 |
void intSetTemplateFilter(int); |
123 |
void intSetMazeSize(int size); |
|
4562 | 124 |
void updatePreview(); |
164 | 125 |
}; |
126 |
||
127 |
#endif // _HWMAP_CONTAINER_INCLUDED |