Make adjustment to tileset column count changes a manual action
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
After [a discussion with eishiya](https://discourse.mapeditor.org/t/quality-of-life-feature-suggestions/4619/7) we agreed that the process of adjusting a map or tileset to a change in the column count of a tileset image (which can happen when the image width changed, mostly) should really be manually triggered.
Currently, Tiled tries to be helpful by automatically triggering this change, just giving the user a single chance to decide whether it is desired or not using a modal dialog. Often the user will not be able to make an informed decision at that time, and another problem is that the action may need to be repeated for other maps that were not open at the time, which is something that's currently not possible without undoing and redoing the change to the tileset image with those maps loaded.
In issue #2863 the goal is to remove the need for adjusting tile indices entirely, but at least for reasons of compatibility we should still support the current workflow and fix this behavior.
Suggested change:
* Introduce an explicit action that can be triggered, both from UI and from scripts, to adjust the tile indices in a certain asset based on an old and a new column count (in the UI, it might be more helpful to have the user enter the old and new image width). This action would use the `AdjustTileIndexes` undo command for maps and the `AdjustTileMetaData` undo command for tilesets (both commands will need to be changed to not read the column count change from the tileset).
* Turn the modal dialog into a non-modal warning. This way, the user can also see whether the map is messed up, which would allow making a more informed decision.
* Ideally, the warning should apply per-asset. So, when one map is fixed up and another broken map is loaded, Tiled should show this warning again (currently, since the expected column count is stored on the tileset, the warning would not show again).
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 the AdjustTileIndexes and AdjustTileMetaData undo commands and the current modal dialog that triggers them. Trace how the tileset's column-count change is detected and stored, then implement the explicit UI and script action, non-modal warning, and per-asset behavior described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100