author | koda |
Sat, 06 Aug 2011 07:09:30 +0200 | |
changeset 5505 | a55aab592950 |
parent 5289 | 9d18b61bd3eb |
permissions | -rw-r--r-- |
164 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
4976 | 3 |
* Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com> |
4 |
* Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
164 | 5 |
* |
184 | 6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; version 2 of the License |
|
164 | 9 |
* |
184 | 10 |
* This program is distributed in the hope that it will be useful, |
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
164 | 14 |
* |
184 | 15 |
* You should have received a copy of the GNU General Public License |
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
164 | 18 |
*/ |
19 |
||
20 |
#ifndef _HWMAP_CONTAINER_INCLUDED |
|
21 |
#define _HWMAP_CONTAINER_INCLUDED |
|
22 |
||
23 |
#include <QWidget> |
|
1209 | 24 |
#include <QGridLayout> |
249 | 25 |
#include <QComboBox> |
1802 | 26 |
#include <QLabel> |
4489 | 27 |
#include <QByteArray> |
4519 | 28 |
#include <QLineEdit> |
164 | 29 |
|
1210 | 30 |
#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
|
31 |
#include "drawmapscene.h" |
1210 | 32 |
|
164 | 33 |
class QPushButton; |
1209 | 34 |
class IconedGroupBox; |
5289
9d18b61bd3eb
- Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
4976
diff
changeset
|
35 |
class QListView; |
164 | 36 |
|
249 | 37 |
class MapFileErrorException |
38 |
{ |
|
39 |
}; |
|
40 |
||
164 | 41 |
class HWMapContainer : public QWidget |
42 |
{ |
|
43 |
Q_OBJECT |
|
320 | 44 |
|
164 | 45 |
public: |
46 |
HWMapContainer(QWidget * parent=0); |
|
47 |
QString getCurrentSeed() const; |
|
249 | 48 |
QString getCurrentMap() const; |
49 |
QString getCurrentTheme() const; |
|
1790 | 50 |
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
|
51 |
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
|
52 |
QString getCurrentWeapons() const; |
1802 | 53 |
quint32 getTemplateFilter() const; |
3133 | 54 |
MapGenerator get_mapgen(void) const; |
4941 | 55 |
int getMazeSize(void) const; |
3008 | 56 |
bool getCurrentIsMission() const; |
4489 | 57 |
QByteArray getDrawnMapData(); |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
58 |
DrawMapScene * getDrawMapScene(); |
4534 | 59 |
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
|
60 |
QLineEdit* seedEdit; |
164 | 61 |
|
62 |
public slots: |
|
4562 | 63 |
void askForGeneratedPreview(); |
320 | 64 |
void setSeed(const QString & seed); |
65 |
void setMap(const QString & map); |
|
66 |
void setTheme(const QString & theme); |
|
1797 | 67 |
void setTemplateFilter(int); |
3133 | 68 |
void setMapgen(MapGenerator m); |
4941 | 69 |
void setMazeSize(int size); |
4537 | 70 |
void setDrawnMapData(const QByteArray & ar); |
4941 | 71 |
void setAllMapParameters(const QString & map, MapGenerator m, int mazesize, const QString & seed, int tmpl); |
164 | 72 |
|
325 | 73 |
signals: |
74 |
void seedChanged(const QString & seed); |
|
75 |
void mapChanged(const QString & map); |
|
76 |
void themeChanged(const QString & theme); |
|
1802 | 77 |
void newTemplateFilter(int filter); |
3133 | 78 |
void mapgenChanged(MapGenerator m); |
4941 | 79 |
void mazeSizeChanged(int s); |
4511 | 80 |
void drawMapRequested(); |
4525 | 81 |
void drawnMapChanged(const QByteArray & data); |
325 | 82 |
|
164 | 83 |
private slots: |
84 |
void setImage(const QImage newImage); |
|
1790 | 85 |
void setHHLimit(int hhLimit); |
249 | 86 |
void mapChanged(int index); |
320 | 87 |
void setRandomSeed(); |
1318 | 88 |
void setRandomTheme(); |
4337 | 89 |
void setRandomMap(); |
90 |
void setRandomStatic(); |
|
91 |
void setRandomMission(); |
|
5289
9d18b61bd3eb
- Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
4976
diff
changeset
|
92 |
void themeSelected(const QModelIndex & current, const QModelIndex &); |
1790 | 93 |
void addInfoToPreview(QPixmap image); |
4550
d300ea498486
added set button to seed edit so maps won't regenerate as often
Henek
parents:
4537
diff
changeset
|
94 |
void seedEdited(); |
164 | 95 |
|
96 |
protected: |
|
97 |
virtual void resizeEvent ( QResizeEvent * event ); |
|
98 |
||
99 |
private: |
|
1209 | 100 |
QGridLayout mainLayout; |
164 | 101 |
QPushButton* imageButt; |
249 | 102 |
QComboBox* chooseMap; |
1209 | 103 |
IconedGroupBox* gbThemes; |
5289
9d18b61bd3eb
- Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
4976
diff
changeset
|
104 |
QListView* lvThemes; |
169
a78d4a552500
new more working, but still not completely working version :)
displacer
parents:
168
diff
changeset
|
105 |
HWMap* pMap; |
164 | 106 |
QString m_seed; |
4550
d300ea498486
added set button to seed edit so maps won't regenerate as often
Henek
parents:
4537
diff
changeset
|
107 |
QPushButton* seedSet; |
4699 | 108 |
QLabel* seedLabel; |
1790 | 109 |
int hhLimit; |
1797 | 110 |
int templateFilter; |
1790 | 111 |
QPixmap hhSmall; |
1802 | 112 |
QLabel* lblFilter; |
4941 | 113 |
QComboBox* cbTemplateFilter; |
3133 | 114 |
QLabel *maze_size_label; |
4941 | 115 |
QComboBox *cbMazeSize; |
3133 | 116 |
MapGenerator mapgen; |
4337 | 117 |
int numMissions; |
4520
e7882bd1a894
Allow to draw maps in frontend and play them (only locally, some bugs to fix)
unc0rr
parents:
4519
diff
changeset
|
118 |
DrawMapScene drawMapScene; |
331 | 119 |
|
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
|
120 |
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
|
121 |
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
|
122 |
void intSetMapgen(MapGenerator m); |
4941 | 123 |
void intSetTemplateFilter(int); |
124 |
void intSetMazeSize(int size); |
|
4562 | 125 |
void updatePreview(); |
164 | 126 |
}; |
127 |
||
128 |
#endif // _HWMAP_CONTAINER_INCLUDED |