mapeditor / mapeditor/tiled

"Detach templates" does not work with "Repeat last export on save" when exporting to the same file.

Open
#4,456 5 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

Describe the bug

With both "Detach templates" and "Repeat last export on save" options enabled, when last export was to the same file that is being edited - templates do not detach, you still get <object id="59" template="chest.tx" x="15" y="94"/> all over the file.

Steps to reproduce
  1. Create and save map in the "Map.tmx" file.
  2. Open it, go into the preferences, set "Detach templates" and "Repeat last export on save".
  3. Now export this map into itself "Map.tmx"
  4. Now add some templates on the map.
  5. Now press Ctrl+S to save the map(Which should perform last export and trigger template detaching).
  6. Open "Map.tml" in the text editor and observe that templates did no detach, you have "template" objects everywhere.
Expected behavior

Templates should detach.

OS version

Windows 10

Tiled version

1.12.0

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

Reproduce with "Detach templates" and "Repeat last export on save" enabled, exporting Map.tmx to itself, then saving after adding templates. Start at the Ctrl+S save path and the repeat-last-export handling, and compare it with a normal export. Done means saving detaches the template objects in the resulting Map.tml.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.