38 { |
38 { |
39 }; |
39 }; |
40 |
40 |
41 class HWMapContainer : public QWidget |
41 class HWMapContainer : public QWidget |
42 { |
42 { |
43 Q_OBJECT |
43 Q_OBJECT |
44 |
44 |
45 public: |
45 public: |
46 HWMapContainer(QWidget * parent=0); |
46 HWMapContainer(QWidget * parent=0); |
47 QString getCurrentSeed() const; |
47 QString getCurrentSeed() const; |
48 QString getCurrentMap() const; |
48 QString getCurrentMap() const; |
49 QString getCurrentTheme() const; |
49 QString getCurrentTheme() const; |
50 int getCurrentHHLimit() const; |
50 int getCurrentHHLimit() const; |
51 QString getCurrentScheme() const; |
51 QString getCurrentScheme() const; |
52 QString getCurrentWeapons() const; |
52 QString getCurrentWeapons() const; |
53 quint32 getTemplateFilter() const; |
53 quint32 getTemplateFilter() const; |
54 MapGenerator get_mapgen(void) const; |
54 MapGenerator get_mapgen(void) const; |
55 int getMazeSize(void) const; |
55 int getMazeSize(void) const; |
56 bool getCurrentIsMission() const; |
56 bool getCurrentIsMission() const; |
57 QByteArray getDrawnMapData(); |
57 QByteArray getDrawnMapData(); |
58 DrawMapScene * getDrawMapScene(); |
58 DrawMapScene * getDrawMapScene(); |
59 void mapDrawingFinished(); |
59 void mapDrawingFinished(); |
60 QLineEdit* seedEdit; |
60 QLineEdit* seedEdit; |
61 |
61 |
62 public slots: |
62 public slots: |
63 void askForGeneratedPreview(); |
63 void askForGeneratedPreview(); |
64 void setSeed(const QString & seed); |
64 void setSeed(const QString & seed); |
65 void setMap(const QString & map); |
65 void setMap(const QString & map); |
66 void setTheme(const QString & theme); |
66 void setTheme(const QString & theme); |
67 void setTemplateFilter(int); |
67 void setTemplateFilter(int); |
68 void setMapgen(MapGenerator m); |
68 void setMapgen(MapGenerator m); |
69 void setMazeSize(int size); |
69 void setMazeSize(int size); |
70 void setDrawnMapData(const QByteArray & ar); |
70 void setDrawnMapData(const QByteArray & ar); |
71 void setAllMapParameters(const QString & map, MapGenerator m, int mazesize, const QString & seed, int tmpl); |
71 void setAllMapParameters(const QString & map, MapGenerator m, int mazesize, const QString & seed, int tmpl); |
72 |
72 |
73 signals: |
73 signals: |
74 void seedChanged(const QString & seed); |
74 void seedChanged(const QString & seed); |
75 void mapChanged(const QString & map); |
75 void mapChanged(const QString & map); |
76 void themeChanged(const QString & theme); |
76 void themeChanged(const QString & theme); |
77 void newTemplateFilter(int filter); |
77 void newTemplateFilter(int filter); |
78 void mapgenChanged(MapGenerator m); |
78 void mapgenChanged(MapGenerator m); |
79 void mazeSizeChanged(int s); |
79 void mazeSizeChanged(int s); |
80 void drawMapRequested(); |
80 void drawMapRequested(); |
81 void drawnMapChanged(const QByteArray & data); |
81 void drawnMapChanged(const QByteArray & data); |
82 |
82 |
83 private slots: |
83 private slots: |
84 void setImage(const QImage newImage); |
84 void setImage(const QImage newImage); |
85 void setHHLimit(int hhLimit); |
85 void setHHLimit(int hhLimit); |
86 void mapChanged(int index); |
86 void mapChanged(int index); |
87 void setRandomSeed(); |
87 void setRandomSeed(); |
88 void setRandomTheme(); |
88 void setRandomTheme(); |
89 void setRandomMap(); |
89 void setRandomMap(); |
90 void setRandomStatic(); |
90 void setRandomStatic(); |
91 void setRandomMission(); |
91 void setRandomMission(); |
92 void themeSelected(const QModelIndex & current, const QModelIndex &); |
92 void themeSelected(const QModelIndex & current, const QModelIndex &); |
93 void addInfoToPreview(QPixmap image); |
93 void addInfoToPreview(QPixmap image); |
94 void seedEdited(); |
94 void seedEdited(); |
95 |
95 |
96 protected: |
96 protected: |
97 virtual void resizeEvent ( QResizeEvent * event ); |
97 virtual void resizeEvent ( QResizeEvent * event ); |
98 |
98 |
99 private: |
99 private: |
100 QGridLayout mainLayout; |
100 QGridLayout mainLayout; |
101 QPushButton* imageButt; |
101 QPushButton* imageButt; |
102 QComboBox* chooseMap; |
102 QComboBox* chooseMap; |
103 IconedGroupBox* gbThemes; |
103 IconedGroupBox* gbThemes; |
104 QListView* lvThemes; |
104 QListView* lvThemes; |
105 HWMap* pMap; |
105 HWMap* pMap; |
106 QString m_seed; |
106 QString m_seed; |
107 QPushButton* seedSet; |
107 QPushButton* seedSet; |
108 QLabel* seedLabel; |
108 QLabel* seedLabel; |
109 int hhLimit; |
109 int hhLimit; |
110 int templateFilter; |
110 int templateFilter; |
111 QPixmap hhSmall; |
111 QPixmap hhSmall; |
112 QLabel* lblFilter; |
112 QLabel* lblFilter; |
113 QComboBox* cbTemplateFilter; |
113 QComboBox* cbTemplateFilter; |
114 QLabel *maze_size_label; |
114 QLabel *maze_size_label; |
115 QComboBox *cbMazeSize; |
115 QComboBox *cbMazeSize; |
116 MapGenerator mapgen; |
116 MapGenerator mapgen; |
117 int numMissions; |
117 int numMissions; |
118 DrawMapScene drawMapScene; |
118 DrawMapScene drawMapScene; |
119 |
119 |
120 void intSetSeed(const QString & seed); |
120 void intSetSeed(const QString & seed); |
121 void intSetMap(const QString & map); |
121 void intSetMap(const QString & map); |
122 void intSetMapgen(MapGenerator m); |
122 void intSetMapgen(MapGenerator m); |
123 void intSetTemplateFilter(int); |
123 void intSetTemplateFilter(int); |
124 void intSetMazeSize(int size); |
124 void intSetMazeSize(int size); |
125 void updatePreview(); |
125 void updatePreview(); |
126 }; |
126 }; |
127 |
127 |
128 #endif // _HWMAP_CONTAINER_INCLUDED |
128 #endif // _HWMAP_CONTAINER_INCLUDED |