QTfrontend/ui/widget/mapContainer.h
branchios-develop
changeset 13413 ba39a1d396c0
parent 13265 8a5feb0edce5
equal deleted inserted replaced
13411:6e8b807bda4b 13413:ba39a1d396c0
    22 
    22 
    23 #include <QByteArray>
    23 #include <QByteArray>
    24 #include <QComboBox>
    24 #include <QComboBox>
    25 #include <QGridLayout>
    25 #include <QGridLayout>
    26 #include <QLabel>
    26 #include <QLabel>
       
    27 #include <QTextEdit>
    27 #include <QLineEdit>
    28 #include <QLineEdit>
    28 #include <QSlider>
    29 #include <QSlider>
    29 #include <QVBoxLayout>
    30 #include <QVBoxLayout>
    30 #include <QWidget>
    31 #include <QWidget>
    31 
    32 
    97         void mapFeatureSizeChanged(int s);
    98         void mapFeatureSizeChanged(int s);
    98         void drawMapRequested();
    99         void drawMapRequested();
    99         void drawnMapChanged(const QByteArray & data);
   100         void drawnMapChanged(const QByteArray & data);
   100 
   101 
   101     private slots:
   102     private slots:
   102         void setImage(const QPixmap & newImage);
   103         void onImageReceived(const QPixmap & newImage);
   103         void setHHLimit(int hhLimit);
   104         void setHHLimit(int hhLimit);
   104         void setRandomSeed();
   105         void setRandomSeed();
   105         void setRandomTheme();
   106         void setRandomTheme();
   106         void setRandomMap();
   107         void setRandomMap();
   107         void addInfoToPreview(const QPixmap & image);
       
   108         void setNewSeed(const QString & newSeed);
   108         void setNewSeed(const QString & newSeed);
   109         void mapTypeChanged(int);
   109         void mapTypeChanged(int);
   110         void showThemePrompt();
   110         void showThemePrompt();
   111         void updateTheme(const QModelIndex & current);
   111         void updateTheme(const QModelIndex & current);
   112         void staticMapChanged(const QModelIndex & map, const QModelIndex & old = QModelIndex());
   112         void staticMapChanged(const QModelIndex & map, const QModelIndex & old = QModelIndex());
   145         MapGenerator mapgen;
   145         MapGenerator mapgen;
   146         DrawMapScene drawMapScene;
   146         DrawMapScene drawMapScene;
   147         QComboBox * cType;
   147         QComboBox * cType;
   148         QListView * staticMapList;
   148         QListView * staticMapList;
   149         QListView * missionMapList;
   149         QListView * missionMapList;
       
   150         QTextEdit * teMapName;
   150         QListWidget * generationStyles;
   151         QListWidget * generationStyles;
   151         QListWidget * mazeStyles;
   152         QListWidget * mazeStyles;
   152         QLabel * lblMapList;
   153         QLabel * lblMapList;
   153         QLabel * lblDesc;
   154         QLabel * lblDesc;
   154         QPushButton * btnTheme;
   155         QPushButton * btnTheme;
   156         QPushButton * btnEditMap;
   157         QPushButton * btnEditMap;
   157         QPushButton * btnRandomize;
   158         QPushButton * btnRandomize;
   158         QPushButton * btnRandTheme;
   159         QPushButton * btnRandTheme;
   159         QString selectedTheme;
   160         QString selectedTheme;
   160         QPushButton * btnSeed;
   161         QPushButton * btnSeed;
       
   162         QHBoxLayout * twoColumnLayout;
   161         bool m_master;
   163         bool m_master;
   162         QList<QWidget *> m_childWidgets;
   164         QList<QWidget *> m_childWidgets;
   163         bool m_previewEnabled;
   165         bool m_previewEnabled;
   164         bool m_missionsViewSetup;
   166         bool m_missionsViewSetup;
   165         bool m_staticViewSetup;
   167         bool m_staticViewSetup;
   166         bool m_withoutDLC;
   168         bool m_withoutDLC;
       
   169         bool m_missingMap;
   167 
   170 
   168         void intSetSeed(const QString & seed);
   171         void intSetSeed(const QString & seed);
   169         void intSetMap(const QString & map);
   172         void intSetMap(const QString & map);
   170         void intSetMapgen(MapGenerator m);
   173         void intSetMapgen(MapGenerator m);
   171         void intSetTemplateFilter(int);
   174         void intSetTemplateFilter(int);
   172         void intSetMazeSize(int size);
   175         void intSetMazeSize(int size);
   173         void intSetFeatureSize(int size);
   176         void intSetFeatureSize(int size);
   174         void intSetIconlessTheme(const QString & name);
   177         void setMissingTheme(const QString & name);
   175         void mapChanged(const QModelIndex & map, int type, const QModelIndex & old = QModelIndex());
   178         void mapChanged(const QModelIndex & map, int type, const QModelIndex & old = QModelIndex());
       
   179         void setImage(const QPixmap & newImage);
       
   180         void setImage(const QPixmap & newImage, const QLinearGradient & linearGrad, bool showHHLimit);
       
   181         void addInfoToPreview(const QPixmap & image);
       
   182         void addInfoToPreview(const QPixmap & image, const QLinearGradient & linearGrad, bool drawHHLimit);
   176         void setMapInfo(MapModel::MapInfo mapInfo);
   183         void setMapInfo(MapModel::MapInfo mapInfo);
   177         void changeMapType(MapModel::MapType type, const QModelIndex & newMap = QModelIndex());
   184         void changeMapType(MapModel::MapType type, const QModelIndex & newMap = QModelIndex());
   178         void updateHelpTexts(MapModel::MapType type);
   185         void updateHelpTexts(MapModel::MapType type);
   179         void updatePreview();
   186         void updatePreview();
   180         void updateThemeButtonSize();
   187         void updateThemeButtonSize();
   181         void setupMissionMapsView();
   188         void setupMissionMapsView(const QString & initialMap = QString());
   182         void setupStaticMapsView();
   189         void setupStaticMapsView(const QString & initialMap = QString());
       
   190         void setMapNameLabel(QString mapName, bool validMap);
   183 
   191 
   184         MapModel::MapInfo m_mapInfo;
   192         MapModel::MapInfo m_mapInfo;
   185         int m_themeID;
   193         int m_themeID;
   186         int m_prevMapFeatureSize;
   194         int m_prevMapFeatureSize;
   187         int m_mapFeatureSize;
   195         int m_mapFeatureSize;
   188         QString m_theme;
   196         QString m_theme;
   189         QString m_curMap;
   197         QString m_curMap;
   190 
   198 
   191         QLinearGradient linearGrad; ///< for preview background
   199         QLinearGradient linearGradNormal; ///< for preview background
       
   200         QLinearGradient linearGradLoading; ///< for preview background while loading/generating map
       
   201         QLinearGradient linearGradNoPreview; ///< for preview background when map preview image is missing
       
   202         QLinearGradient linearGradMapError; ///< for preview background when map is missing
   192         QSize m_previewSize;
   203         QSize m_previewSize;
   193 };
   204 };
   194 
   205 
   195 #endif // _HWMAP_CONTAINER_INCLUDED
   206 #endif // _HWMAP_CONTAINER_INCLUDED