2019-05-21 03:08:04 +01:00
|
|
|
#ifndef MAPIMAGEEXPORTER_H
|
|
|
|
#define MAPIMAGEEXPORTER_H
|
|
|
|
|
|
|
|
#include "map.h"
|
|
|
|
#include "editor.h"
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MapImageExporter;
|
|
|
|
}
|
|
|
|
|
2021-01-18 21:13:51 +00:00
|
|
|
enum ImageExporterMode {
|
|
|
|
Normal,
|
|
|
|
Stitch,
|
|
|
|
Timelapse,
|
|
|
|
};
|
|
|
|
|
2019-05-21 03:08:04 +01:00
|
|
|
class MapImageExporter : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-01-18 21:13:51 +00:00
|
|
|
explicit MapImageExporter(QWidget *parent, Editor *editor, ImageExporterMode mode);
|
2019-05-21 03:08:04 +01:00
|
|
|
~MapImageExporter();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::MapImageExporter *ui;
|
|
|
|
|
|
|
|
Map *map = nullptr;
|
|
|
|
Editor *editor = nullptr;
|
|
|
|
QGraphicsScene *scene = nullptr;
|
|
|
|
|
|
|
|
QPixmap preview;
|
|
|
|
|
|
|
|
bool showObjects = false;
|
|
|
|
bool showWarps = false;
|
|
|
|
bool showBGs = false;
|
|
|
|
bool showTriggers = false;
|
|
|
|
bool showHealSpots = false;
|
|
|
|
bool showUpConnections = false;
|
|
|
|
bool showDownConnections = false;
|
|
|
|
bool showLeftConnections = false;
|
|
|
|
bool showRightConnections = false;
|
|
|
|
bool showGrid = false;
|
|
|
|
bool showBorder = false;
|
|
|
|
bool showCollision = false;
|
2021-01-18 21:13:51 +00:00
|
|
|
int timelapseSkipAmount = 1;
|
|
|
|
int timelapseDelayMs = 200;
|
|
|
|
ImageExporterMode mode = ImageExporterMode::Normal;
|
2019-05-21 03:08:04 +01:00
|
|
|
|
|
|
|
void updatePreview();
|
|
|
|
void saveImage();
|
2020-04-18 19:07:41 +01:00
|
|
|
QPixmap getStitchedImage(QProgressDialog *progress, bool includeBorder);
|
|
|
|
QPixmap getFormattedMapPixmap(Map *map, bool ignoreBorder);
|
2021-01-20 02:21:15 +00:00
|
|
|
bool historyItemAppliesToFrame(const QUndoCommand *command);
|
2019-05-21 03:08:04 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_checkBox_Objects_stateChanged(int state);
|
|
|
|
void on_checkBox_Warps_stateChanged(int state);
|
|
|
|
void on_checkBox_BGs_stateChanged(int state);
|
|
|
|
void on_checkBox_Triggers_stateChanged(int state);
|
|
|
|
void on_checkBox_HealSpots_stateChanged(int state);
|
|
|
|
|
|
|
|
void on_checkBox_ConnectionUp_stateChanged(int state);
|
|
|
|
void on_checkBox_ConnectionDown_stateChanged(int state);
|
|
|
|
void on_checkBox_ConnectionLeft_stateChanged(int state);
|
|
|
|
void on_checkBox_ConnectionRight_stateChanged(int state);
|
|
|
|
|
|
|
|
void on_checkBox_Elevation_stateChanged(int state);
|
|
|
|
void on_checkBox_Grid_stateChanged(int state);
|
|
|
|
void on_checkBox_Border_stateChanged(int state);
|
|
|
|
|
|
|
|
void on_pushButton_Save_pressed();
|
|
|
|
void on_pushButton_Reset_pressed();
|
|
|
|
void on_pushButton_Cancel_pressed();
|
2021-01-18 21:13:51 +00:00
|
|
|
void on_spinBox_TimelapseDelay_valueChanged(int delayMs);
|
|
|
|
void on_spinBox_FrameSkip_valueChanged(int skip);
|
2019-05-21 03:08:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPIMAGEEXPORTER_H
|