[nostalgia/core/studio] Fix ng export to only attempt export if output file is given
This commit is contained in:
parent
5f8104efea
commit
1d8f8566c5
@ -461,13 +461,14 @@ TileSheetEditor::~TileSheetEditor() {
|
|||||||
saveState();
|
saveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TileSheetEditor::itemName() {
|
QString TileSheetEditor::itemName() const {
|
||||||
return m_itemName;
|
return m_itemName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditor::exportFile() {
|
void TileSheetEditor::exportFile() {
|
||||||
auto path = QFileDialog::getSaveFileName(this, tr("Export to Image"), "",
|
auto path = QFileDialog::getSaveFileName(this, tr("Export to Image"), "",
|
||||||
tr("PNG (*.png)"));
|
tr("PNG (*.png)"));
|
||||||
|
if (path != "") {
|
||||||
auto ng = m_sheetData.toNostalgiaGraphic();
|
auto ng = m_sheetData.toNostalgiaGraphic();
|
||||||
QString palPath;
|
QString palPath;
|
||||||
if (palPath == "" && ng->defaultPalette.type() == ox::FileAddressType::Path) {
|
if (palPath == "" && ng->defaultPalette.type() == ox::FileAddressType::Path) {
|
||||||
@ -481,6 +482,7 @@ void TileSheetEditor::exportFile() {
|
|||||||
// TODO: message box to notify of failure
|
// TODO: message box to notify of failure
|
||||||
}
|
}
|
||||||
toQImage(ng.get(), npal.get()).save(path, "PNG");
|
toQImage(ng.get(), npal.get()).save(path, "PNG");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditor::saveItem() {
|
void TileSheetEditor::saveItem() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user