Permalink
Browse files

CSV plugin: Fixed exporting of nested tile layers

The plugin was not updated when support for group layers was added in
Tiled 1.0, causing only top-level tile layers to get exported.

See https://discourse.mapeditor.org/t/tile-layers-placed-in-groups-arent-considered-for-csv-export/3719
  • Loading branch information...
bjorn committed Jan 30, 2019
1 parent 91a3bf6 commit c7080ab77225f72f6aeb88637e96b4f45cfca1e5
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/plugins/csv/csvplugin.cpp
@@ -42,10 +42,7 @@ bool CsvPlugin::write(const Map *map, const QString &fileName)

// Traverse all tile layers
int currentLayer = 0;
for (const Layer *layer : map->layers()) {
if (layer->layerType() != Layer::TileLayerType)
continue;

for (const Layer *layer : map->tileLayers()) {
const TileLayer *tileLayer = static_cast<const TileLayer*>(layer);

SaveFile file(layerPaths.at(currentLayer));
@@ -109,10 +106,7 @@ QStringList CsvPlugin::outputFiles(const Tiled::Map *map, const QString &fileNam
const QString path = fileInfo.path();

// Loop layers to calculate the path for the exported file
for (const Layer *layer : map->layers()) {
if (layer->layerType() != Layer::TileLayerType)
continue;

for (const Layer *layer : map->tileLayers()) {
// Get the output file name for this layer
const QString layerName = layer->name();
const QString layerFileName = base + layerName + QLatin1String(".csv");

0 comments on commit c7080ab

Please sign in to comment.