mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-18 17:40:48 +02:00
68 lines
1.1 KiB
C++
68 lines
1.1 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QGraphicsScene>
|
|
#include <QStandardItemModel>
|
|
|
|
#include "maphandler.h"
|
|
|
|
#include "mapview.h"
|
|
class CMap;
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
void setMapRaw(std::unique_ptr<CMap> cmap);
|
|
void setMap(bool isNew);
|
|
void reloadMap(int level = 0);
|
|
void saveMap();
|
|
|
|
CMap * getMap();
|
|
|
|
void loadObjectsTree();
|
|
|
|
void setStatusMessage(const QString & status);
|
|
|
|
private slots:
|
|
void on_actionOpen_triggered();
|
|
|
|
void on_actionSave_as_triggered();
|
|
|
|
void on_actionNew_triggered();
|
|
|
|
void on_actionLevel_triggered();
|
|
|
|
void on_actionSave_triggered();
|
|
|
|
void on_actionPass_triggered(bool checked);
|
|
|
|
void on_actionGrid_triggered(bool checked);
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
|
|
std::array<MapScene *, 2> scenes;
|
|
QGraphicsScene * sceneMini;
|
|
QPixmap minimap;
|
|
|
|
std::unique_ptr<CMap> map;
|
|
QString filename;
|
|
bool unsaved = false;
|
|
|
|
QStandardItemModel objectsModel;
|
|
|
|
int mapLevel = 0;
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|