2019-01-07 23:14:44 +00:00
|
|
|
#ifndef NEWMAPPOPUP_H
|
|
|
|
#define NEWMAPPOPUP_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QString>
|
|
|
|
#include "editor.h"
|
|
|
|
#include "project.h"
|
|
|
|
#include "map.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class NewMapPopup;
|
|
|
|
}
|
|
|
|
|
|
|
|
class NewMapPopup : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit NewMapPopup(QWidget *parent = nullptr, Project *project = nullptr);
|
|
|
|
~NewMapPopup();
|
|
|
|
Map *map;
|
|
|
|
int group;
|
2019-02-01 17:43:25 +00:00
|
|
|
bool existingLayout;
|
2020-09-19 20:05:27 +01:00
|
|
|
bool importedMap;
|
2019-02-01 17:43:25 +00:00
|
|
|
QString layoutId;
|
2022-10-24 21:18:50 +01:00
|
|
|
void init();
|
2022-10-24 20:23:53 +01:00
|
|
|
void init(MapSortOrder type, QVariant data);
|
2023-02-01 15:09:50 +00:00
|
|
|
void init(Layout *);
|
2022-10-24 21:18:50 +01:00
|
|
|
static void setDefaultSettings(Project *project);
|
2019-01-07 23:14:44 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void applied();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::NewMapPopup *ui;
|
|
|
|
Project *project;
|
2020-05-17 02:19:36 +01:00
|
|
|
bool checkNewMapDimensions();
|
2021-02-19 07:15:49 +00:00
|
|
|
bool checkNewMapGroup();
|
2022-10-24 21:18:50 +01:00
|
|
|
void saveSettings();
|
|
|
|
void useLayout(QString layoutId);
|
2023-02-01 15:09:50 +00:00
|
|
|
void useLayoutSettings(Layout *mapLayout);
|
2022-10-24 20:23:53 +01:00
|
|
|
|
|
|
|
struct Settings {
|
|
|
|
QString group;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int borderWidth;
|
|
|
|
int borderHeight;
|
2022-10-24 21:18:50 +01:00
|
|
|
QString primaryTilesetLabel;
|
|
|
|
QString secondaryTilesetLabel;
|
2022-10-24 20:23:53 +01:00
|
|
|
QString type;
|
|
|
|
QString location;
|
|
|
|
QString song;
|
|
|
|
bool canFlyTo;
|
|
|
|
bool showLocationName;
|
|
|
|
bool allowRunning;
|
|
|
|
bool allowBiking;
|
|
|
|
bool allowEscaping;
|
|
|
|
int floorNumber;
|
|
|
|
};
|
|
|
|
static struct Settings settings;
|
2019-01-07 23:14:44 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_pushButton_NewMap_Accept_clicked();
|
|
|
|
void on_lineEdit_NewMap_Name_textChanged(const QString &);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NEWMAPPOPUP_H
|