diff --git a/editor/mainwindow.cpp b/editor/mainwindow.cpp index dcfa2b8..83c38bd 100644 --- a/editor/mainwindow.cpp +++ b/editor/mainwindow.cpp @@ -123,6 +123,13 @@ MainWindow::MainWindow(QWidget *parent) dataModel->SaveToFile(path); }); + connect(ui->actionSaveAs, &QAction::triggered, this, [&]() { + std::optional path = openFileDialog("Openblocks Level (*.obl)", ".obl", QFileDialog::AcceptSave, QString::fromStdString("Save as " + dataModel->name)); + if (path == "") return; + + dataModel->SaveToFile(path); + }); + connect(ui->actionOpen, &QAction::triggered, this, [&]() { std::optional path = openFileDialog("Openblocks Level (*.obl)", ".obl", QFileDialog::AcceptOpen); if (!path) return; diff --git a/editor/mainwindow.ui b/editor/mainwindow.ui index a12e229..5c4d6de 100644 --- a/editor/mainwindow.ui +++ b/editor/mainwindow.ui @@ -51,6 +51,7 @@ + @@ -480,6 +481,20 @@ QAction::MenuRole::NoRole + + + + + + Save As... + + + Ctrl+Shift+S + + + QAction::MenuRole::NoRole + +