tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Swapping between maps jiggles the selected layer and groups

Open Macksaur opened this issue 2 years ago • 7 comments

Problem

When I am moving around multiple maps and copy/pasting pieces as source material and I swap back to the target map I find all the groups closed and the layer I was on forgotten and instead replaced with a "best guess" at a layer with the same name.

Map A:
- Group1
    - Objects
    - ActualTarget <-- this layer is selected
- Group0
    - Objects

Map B:
- Group1
    - Objects <-- this layer will be selected in order to copy objects

Swapping between Map A -> Map B and swapping back to Map A after selecting some objects from Map B it places me in Group0/Objects when I return to Map A instead of Group1/Objects, not that it matters because I had selected the layer Group1/ActualTarget before I left Map A, intending to paste there.

Goal

I want to be able to edit multiple maps simultaneously with complex group structures and copy/paste between them onto different layers without having to constantly find the layer I was previously on.

  1. Remember the open/closed status of group layers when switching maps
  2. Remember the selected layer when swapping between maps
  3. If none of the above, make a better guess at the layer including group structure?

Macksaur avatar Feb 21 '22 01:02 Macksaur

  1. Remember the open/closed status of group layers when switching maps

This feature is currently missing.

2. Remember the selected layer when swapping between maps

That's what Tiled does by default. The exception is when using a world to jump from one map to another, in which case it tries to be smart by keeping the same layer(s) selected, which it does by looking for layers with the same name.

3. If none of the above, make a better guess at the layer including group structure?

I guess indeed the way forward would be to make the search for matching layers take into account group layers.

bjorn avatar Feb 21 '22 08:02 bjorn

I don't how complex this is all to implement, but point 1 "Remember the open/closed status of group layers when switching maps" would be very helpful for us as we have a lot of groups and using at least 2 TMX files in parallel. And this drives us crazy opening the groups again after switching...

Would it be possible to implement at least point 1 "soon-ish", as I could imagine the other two are more complex?

UliAbo avatar Mar 27 '22 14:03 UliAbo

@UliAbo Sure, I'll have a look at it.

bjorn avatar Mar 28 '22 07:03 bjorn

@UliAbo Done for Tiled 1.8.5 or 1.9, whichever comes first. You can get a build from here in a moment. :-)

bjorn avatar Apr 04 '22 11:04 bjorn

That's cool @bjorn I will give it a try today!

UliAbo avatar Apr 04 '22 11:04 UliAbo

Isn't this implemented / done? Or am I wrong again? :D I just tested it and it feels like all is in.

UliAbo avatar Aug 09 '22 14:08 UliAbo

Isn't this implemented / done? Or am I wrong again? :D I just tested it and it feels like all is in.

Well, only "point 1" was implemented, but not "make the search for matching layers take into account group layers". So, when switching between maps in a world (so, not using the document tabs), currently the code synchronizing selected layers can still interfere in case you have multiple layers with the same name.

bjorn avatar Aug 11 '22 07:08 bjorn