porymap/include/ui/newmapdialog.h

80 lines
1.8 KiB
C
Raw Normal View History

2024-11-12 18:23:15 +00:00
#ifndef NEWMAPDIALOG_H
#define NEWMAPDIALOG_H
2024-11-12 18:23:15 +00:00
#include <QDialog>
#include <QString>
#include "editor.h"
#include "project.h"
#include "map.h"
namespace Ui {
2024-11-12 18:23:15 +00:00
class NewMapDialog;
}
2024-11-12 18:23:15 +00:00
class NewMapDialog : public QDialog
{
Q_OBJECT
public:
2024-11-12 18:23:15 +00:00
explicit NewMapDialog(QWidget *parent = nullptr, Project *project = nullptr);
~NewMapDialog();
Map *map;
int group;
2019-02-01 17:43:25 +00:00
bool existingLayout;
bool importedMap;
2019-02-01 17:43:25 +00:00
QString layoutId;
void init();
2024-11-12 18:44:04 +00:00
//void initUi();
2024-10-30 02:18:16 +00:00
void init(int tabIndex, QString data);
void init(Layout *);
static void setDefaultSettings(Project *project);
signals:
void applied();
private:
2024-11-12 18:23:15 +00:00
Ui::NewMapDialog *ui;
Project *project;
2024-11-12 18:44:04 +00:00
bool validateMapDimensions();
bool validateMapGroup();
bool validateTilesets();
bool validateID();
bool validateName();
void saveSettings();
void useLayout(QString layoutId);
void useLayoutSettings(Layout *mapLayout);
2022-10-24 20:23:53 +01:00
struct Settings {
QString group;
int width;
int height;
int borderWidth;
int borderHeight;
QString primaryTilesetLabel;
QString secondaryTilesetLabel;
2022-10-24 20:23:53 +01:00
QString song;
2024-11-12 18:44:04 +00:00
QString location;
bool requiresFlash;
QString weather;
QString type;
QString battleScene;
2022-10-24 20:23:53 +01:00
bool showLocationName;
bool allowRunning;
bool allowBiking;
bool allowEscaping;
int floorNumber;
2024-11-12 18:44:04 +00:00
bool canFlyTo;
2022-10-24 20:23:53 +01:00
};
static struct Settings settings;
private slots:
2024-11-12 18:44:04 +00:00
//void on_checkBox_UseExistingLayout_stateChanged(int state);
//void on_comboBox_Layout_currentTextChanged(const QString &text);
void on_pushButton_Accept_clicked();
void on_lineEdit_Name_textChanged(const QString &);
void on_lineEdit_ID_textChanged(const QString &);
};
2024-11-12 18:23:15 +00:00
#endif // NEWMAPDIALOG_H