mapeditor / mapeditor/tiled

Add map.fileName in tiled.registerMapFormat -> write

Open
#3,911 2 comments 0 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.