mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 21:07:44 -05:00
Add ability to export map stitch images.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <QSysInfo>
|
||||
#include <QDesktopServices>
|
||||
#include <QMatrix>
|
||||
#include <QSet>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
@@ -2080,13 +2081,21 @@ void MainWindow::onTilesetsSaved(QString primaryTilesetLabel, QString secondaryT
|
||||
this->editor->updateSecondaryTileset(secondaryTilesetLabel, true);
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Export_Map_Image_triggered()
|
||||
{
|
||||
if (!this->mapImageExporter) {
|
||||
this->mapImageExporter = new MapImageExporter(this, this->editor);
|
||||
connect(this->mapImageExporter, &QObject::destroyed, [=](QObject *) { this->mapImageExporter = nullptr; });
|
||||
this->mapImageExporter->setAttribute(Qt::WA_DeleteOnClose);
|
||||
}
|
||||
void MainWindow::on_action_Export_Map_Image_triggered() {
|
||||
showExportMapImageWindow(false);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExport_Stitched_Map_Image_triggered() {
|
||||
showExportMapImageWindow(true);
|
||||
}
|
||||
|
||||
void MainWindow::showExportMapImageWindow(bool stitchMode) {
|
||||
if (this->mapImageExporter)
|
||||
delete this->mapImageExporter;
|
||||
|
||||
this->mapImageExporter = new MapImageExporter(this, this->editor, stitchMode);
|
||||
connect(this->mapImageExporter, &QObject::destroyed, [=](QObject *) { this->mapImageExporter = nullptr; });
|
||||
this->mapImageExporter->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
if (!this->mapImageExporter->isVisible()) {
|
||||
this->mapImageExporter->show();
|
||||
|
||||
Reference in New Issue
Block a user