Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing a map in a world does not update the size stored in the world immediately #3020

Closed
m-r-hunt opened this issue Apr 4, 2021 · 1 comment
Assignees
Labels
bug Broken behavior.
Projects

Comments

@m-r-hunt
Copy link

m-r-hunt commented Apr 4, 2021

Simple enough to reproduce: Resize a map that's part of a world using Map>Resize Map. The world file will not be updated straight away, and cannot be saved manually. You have to do something else like moving a map to resave the world and get the updated size.

This was a problem for me as I am reading the map sizes from the world file in my game to determine which map the player is in (without actually loading up the maps to check their size that way).

@bjorn bjorn added the bug Broken behavior. label Feb 1, 2022
@bjorn bjorn added this to Bugs in Roadmap Feb 18, 2022
@bjorn bjorn self-assigned this Mar 29, 2022
@bjorn
Copy link
Member

bjorn commented Mar 29, 2022

I've decided to address this for the upcoming Tiled 1.8.3, but it was rather more involved than I had expected. The main problem is that a change of map size is not at all a change to the world, in terms of undo commands. And whether a world needs saving was solely based on whether any changes were made directly to the world.

It's essentially duplicate information of course, but since I can see it being useful I've implemented a workaround that marks a world as "modified" when a map size is changed (either due to resizing it, or by changing its tile size). This will then allow the world to be saved, and triggers a prompt when you try to close Tiled without saving the world.

Other implementation difficulties came about due to another bug (cda4fcb) and due to WorldDocument instances getting created on-demand (I've decided to not make them on-demand anymore).

The whole approach to worlds should probably get a redesign at some point, but for now I just hope I didn't introduce any new issues. :-)

@bjorn bjorn closed this as completed in 2743017 Mar 30, 2022
Roadmap automation moved this from Bugs to Completed Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
Archived in project
Roadmap
  
Completed
Development

No branches or pull requests

2 participants