mapeditor / mapeditor/tiled

Custom Map Format's extension can't include dot on MacOS

Open
#2,222 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

macos
Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

ENV:
MacOS: 10.15
Tiled: 1.3RC

Fllow http://doc.mapeditor.org/en/latest/reference/scripting/#script-registermapformat:
```javascript
var customMapFormat = {
name: "Custom map format",
extension: "custom.txt",

write: function(map, fileName) {
var m = {
width: map.width,
height: map.height,
layers: []
};

for (var i = 0; i < map.layerCount; ++i) {
var layer = map.layerAt(i);
if (layer.isTileLayer) {
var rows = [];
for (y = 0; y < layer.height; ++y) {
var row = [];
for (x = 0; x < layer.width; ++x)
row.push(layer.cellAt(x, y).tileId);
rows.push(row);
}
m.layers.push(rows);
}
}

return JSON.stringify(m);
},
}

tiled.registerMapFormat("custom", customMapFormat)
```

When I select the custom format in the export dialog, the export box is hung up.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the export-dialog hang on macOS using the documented registerMapFormat example with extension "custom.txt". Trace the registerMapFormat and export-dialog path; done means selecting the custom format no longer hangs and the map exports with the dotted extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, macos
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.