Add map.fileName in tiled.registerMapFormat -> write
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
**Is your feature request related to a problem? Please describe.**
Sometimes I need to get the file name of tiledmap when export.
**Describe the solution you'd like**
```js
tiled.registerMapFormat("Custom Export", {
name: "Custom Export",
extension: "json2",
write: function(map, fileName) {
tiled.log("map.fileName = " + map.fileName)
}
});
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating tiled.registerMapFormat and its write callback in the Tiled scripting API implementation, then trace how the map argument is created during export. Use the provided Custom Export example to verify that map.fileName is available to the writer and contains the exported tiled map's file name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100