author | koda |
Mon, 25 Feb 2013 10:04:31 +0100 | |
branch | experimental3D |
changeset 4846 | 668602df25a6 |
parent 4720 | a9f9c96db60c |
child 4936 | d65d438acd23 |
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(); |
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); |
68 |
void setMaze_size(int size); |
|
4537 | 69 |
void setDrawnMapData(const QByteArray & ar); |
164 | 70 |
|
325 | 71 |
signals: |
72 |
void seedChanged(const QString & seed); |
|
73 |
void mapChanged(const QString & map); |
|
74 |
void themeChanged(const QString & theme); |
|
1802 | 75 |
void newTemplateFilter(int filter); |
3133 | 76 |
void mapgenChanged(MapGenerator m); |
77 |
void maze_sizeChanged(int s); |
|
4511 | 78 |
void drawMapRequested(); |
4525 | 79 |
void drawnMapChanged(const QByteArray & data); |
325 | 80 |
|
164 | 81 |
private slots: |
82 |
void setImage(const QImage newImage); |
|
1790 | 83 |
void setHHLimit(int hhLimit); |
249 | 84 |
void mapChanged(int index); |
320 | 85 |
void setRandomSeed(); |
1318 | 86 |
void setRandomTheme(); |
4337 | 87 |
void setRandomMap(); |
88 |
void setRandomStatic(); |
|
89 |
void setRandomMission(); |
|
1215 | 90 |
void themeSelected(int currentRow); |
1790 | 91 |
void addInfoToPreview(QPixmap image); |
1802 | 92 |
void templateFilterChanged(int filter); |
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; |
112 |
QComboBox* CB_TemplateFilter; |
|
3133 | 113 |
QLabel *maze_size_label; |
114 |
QComboBox *maze_size_selection; |
|
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 |
|
4562 | 119 |
void updatePreview(); |
164 | 120 |
}; |
121 |
||
122 |
#endif // _HWMAP_CONTAINER_INCLUDED |