QTfrontend/mapContainer.h
branchexperimental3D
changeset 4812 f924be23ffb4
parent 4720 a9f9c96db60c
child 4936 d65d438acd23
equal deleted inserted replaced
4347:0ddb100fea61 4812:f924be23ffb4
    21 
    21 
    22 #include <QWidget>
    22 #include <QWidget>
    23 #include <QGridLayout>
    23 #include <QGridLayout>
    24 #include <QComboBox>
    24 #include <QComboBox>
    25 #include <QLabel>
    25 #include <QLabel>
       
    26 #include <QByteArray>
       
    27 #include <QLineEdit>
    26 
    28 
    27 #include "hwmap.h"
    29 #include "hwmap.h"
       
    30 #include "drawmapscene.h"
    28 
    31 
    29 class QPushButton;
    32 class QPushButton;
    30 class IconedGroupBox;
    33 class IconedGroupBox;
    31 class QListWidget;
    34 class QListWidget;
    32 
    35 
    42   HWMapContainer(QWidget * parent=0);
    45   HWMapContainer(QWidget * parent=0);
    43   QString getCurrentSeed() const;
    46   QString getCurrentSeed() const;
    44   QString getCurrentMap() const;
    47   QString getCurrentMap() const;
    45   QString getCurrentTheme() const;
    48   QString getCurrentTheme() const;
    46   int     getCurrentHHLimit() const;
    49   int     getCurrentHHLimit() const;
       
    50   QString getCurrentScheme() const;
       
    51   QString getCurrentWeapons() const;
    47   quint32 getTemplateFilter() const;
    52   quint32 getTemplateFilter() const;
    48   MapGenerator get_mapgen(void) const;
    53   MapGenerator get_mapgen(void) const;
    49   int get_maze_size(void) const;
    54   int get_maze_size(void) const;
    50   bool getCurrentIsMission() const;
    55   bool getCurrentIsMission() const;
       
    56   QByteArray getDrawnMapData();
       
    57   DrawMapScene * getDrawMapScene();
       
    58   void mapDrawingFinished();
       
    59   QLineEdit* seedEdit;
    51 
    60 
    52  public slots:
    61  public slots:
    53   void changeImage();
    62   void askForGeneratedPreview();
    54   void setSeed(const QString & seed);
    63   void setSeed(const QString & seed);
    55   void setMap(const QString & map);
    64   void setMap(const QString & map);
    56   void setTheme(const QString & theme);
    65   void setTheme(const QString & theme);
    57   void setTemplateFilter(int);
    66   void setTemplateFilter(int);
    58   void setMapgen(MapGenerator m);
    67   void setMapgen(MapGenerator m);
    59   void setMaze_size(int size);
    68   void setMaze_size(int size);
       
    69   void setDrawnMapData(const QByteArray & ar);
    60 
    70 
    61  signals:
    71  signals:
    62   void seedChanged(const QString & seed);
    72   void seedChanged(const QString & seed);
    63   void mapChanged(const QString & map);
    73   void mapChanged(const QString & map);
    64   void themeChanged(const QString & theme);
    74   void themeChanged(const QString & theme);
    65   void newTemplateFilter(int filter);
    75   void newTemplateFilter(int filter);
    66   void mapgenChanged(MapGenerator m);
    76   void mapgenChanged(MapGenerator m);
    67   void maze_sizeChanged(int s);
    77   void maze_sizeChanged(int s);
       
    78   void drawMapRequested();
       
    79   void drawnMapChanged(const QByteArray & data);
    68 
    80 
    69  private slots:
    81  private slots:
    70   void setImage(const QImage newImage);
    82   void setImage(const QImage newImage);
    71   void setHHLimit(int hhLimit);
    83   void setHHLimit(int hhLimit);
    72   void mapChanged(int index);
    84   void mapChanged(int index);
    76   void setRandomStatic();
    88   void setRandomStatic();
    77   void setRandomMission();
    89   void setRandomMission();
    78   void themeSelected(int currentRow);
    90   void themeSelected(int currentRow);
    79   void addInfoToPreview(QPixmap image);
    91   void addInfoToPreview(QPixmap image);
    80   void templateFilterChanged(int filter);
    92   void templateFilterChanged(int filter);
       
    93   void seedEdited();
    81 
    94 
    82  protected:
    95  protected:
    83   virtual void resizeEvent ( QResizeEvent * event );
    96   virtual void resizeEvent ( QResizeEvent * event );
    84 
    97 
    85  private:
    98  private:
    88   QComboBox* chooseMap;
   101   QComboBox* chooseMap;
    89   IconedGroupBox* gbThemes;
   102   IconedGroupBox* gbThemes;
    90   QListWidget* lwThemes;
   103   QListWidget* lwThemes;
    91   HWMap* pMap;
   104   HWMap* pMap;
    92   QString m_seed;
   105   QString m_seed;
       
   106   QPushButton* seedSet;
       
   107   QLabel* seedLabel;
    93   int hhLimit;
   108   int hhLimit;
    94   int templateFilter;
   109   int templateFilter;
    95   QPixmap hhSmall;
   110   QPixmap hhSmall;
    96   QLabel* lblFilter;
   111   QLabel* lblFilter;
    97   QComboBox* CB_TemplateFilter;
   112   QComboBox* CB_TemplateFilter;
    98   QLabel *maze_size_label;
   113   QLabel *maze_size_label;
    99   QComboBox *maze_size_selection;
   114   QComboBox *maze_size_selection;
   100   MapGenerator mapgen;
   115   MapGenerator mapgen;
   101   int numMissions;
   116   int numMissions;
   102   int maze_size;
   117   DrawMapScene drawMapScene;
   103 
   118 
   104   void loadMap(int index);
   119   void updatePreview();
   105 };
   120 };
   106 
   121 
   107 #endif // _HWMAP_CONTAINER_INCLUDED
   122 #endif // _HWMAP_CONTAINER_INCLUDED