diff --git a/data/pref.xml b/data/pref.xml
index c151c5b36..32d9344e8 100644
--- a/data/pref.xml
+++ b/data/pref.xml
@@ -260,6 +260,7 @@
+
diff --git a/data/widgets/export_sprite_sheet.xml b/data/widgets/export_sprite_sheet.xml
index 1b9a4271d..2878af937 100644
--- a/data/widgets/export_sprite_sheet.xml
+++ b/data/widgets/export_sprite_sheet.xml
@@ -49,6 +49,10 @@
+
+
+
+
diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp
index 26324c91f..b293ee818 100644
--- a/src/app/commands/cmd_export_sprite_sheet.cpp
+++ b/src/app/commands/cmd_export_sprite_sheet.cpp
@@ -359,6 +359,7 @@ public:
m_dataFilename = m_docPref.spriteSheet.dataFilename();
dataEnabled()->setSelected(!m_dataFilename.empty());
+ dataFormat()->setSelectedItemIndex(int(m_docPref.spriteSheet.dataFormat()));
listLayers()->setSelected(m_docPref.spriteSheet.listLayers());
listTags()->setSelected(m_docPref.spriteSheet.listFrameTags());
updateDataFields();
@@ -449,6 +450,13 @@ public:
return std::string();
}
+ DocumentExporter::DataFormat dataFormatValue() const {
+ if (dataEnabled()->isSelected())
+ return DocumentExporter::DataFormat(dataFormat()->getSelectedItemIndex());
+ else
+ return DocumentExporter::DefaultDataFormat;
+ }
+
int borderPaddingValue() const {
if (paddingEnabled()->isSelected()) {
int value = borderPadding()->textInt();
@@ -758,6 +766,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
docPref.spriteSheet.bestFit(window.bestFitValue());
docPref.spriteSheet.textureFilename(window.filenameValue());
docPref.spriteSheet.dataFilename(window.dataFilenameValue());
+ docPref.spriteSheet.dataFormat(window.dataFormatValue());
docPref.spriteSheet.borderPadding(window.borderPaddingValue());
docPref.spriteSheet.shapePadding(window.shapePaddingValue());
docPref.spriteSheet.innerPadding(window.innerPaddingValue());
@@ -787,6 +796,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
bool bestFit = docPref.spriteSheet.bestFit();
std::string filename = docPref.spriteSheet.textureFilename();
std::string dataFilename = docPref.spriteSheet.dataFilename();
+ DocumentExporter::DataFormat dataFormat = docPref.spriteSheet.dataFormat();
std::string layerName = docPref.spriteSheet.layer();
std::string frameTagName = docPref.spriteSheet.frameTag();
int borderPadding = docPref.spriteSheet.borderPadding();
@@ -877,8 +887,10 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
DocumentExporter exporter;
if (!filename.empty())
exporter.setTextureFilename(filename);
- if (!dataFilename.empty())
+ if (!dataFilename.empty()) {
exporter.setDataFilename(dataFilename);
+ exporter.setDataFormat(dataFormat);
+ }
exporter.setTextureWidth(sheet_w);
exporter.setTextureHeight(sheet_h);
exporter.setSpriteSheetType(type);
diff --git a/src/app/pref/preferences.h b/src/app/pref/preferences.h
index 692b69c6c..0fd2c8b9d 100644
--- a/src/app/pref/preferences.h
+++ b/src/app/pref/preferences.h
@@ -10,6 +10,7 @@
#pragma once
#include "app/color.h"
+#include "app/document_exporter.h"
#include "app/pref/option.h"
#include "app/sprite_sheet_type.h"
#include "app/tools/freehand_algorithm.h"