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

Automatic layer names should be unique #3452

Closed
eishiya opened this issue Aug 14, 2022 · 0 comments · Fixed by #3501
Closed

Automatic layer names should be unique #3452

eishiya opened this issue Aug 14, 2022 · 0 comments · Fixed by #3501
Labels
usability Generally about making something more intuitive or efficient.

Comments

@eishiya
Copy link
Contributor

eishiya commented Aug 14, 2022

Tiled automatically names newly created layers, e.g. "Tile Layer 3". However, Tiled seems to use the number of layers of that type +1 as the number in this automatic name, which means layer names can repeat if, e.g. a user deleted some layers, or manually named some in that pattern. If I have two Tile Layers called "Tile Layer 1" and "Tile Layer 3", Tiled will suggest "Tile Layer 3" for the next one, which doesn't seem right and can lead to confusion.

Tiled should choose numbers for these layers such that the layer name is unique. A few options for this are possible:

  1. Always the layer ID, instead of the layer count of that type of layer. This would be free since the layer ID is incremented anyway. However, this will mean that deleting layers or using multiple layer types will cause the names to be larger than expected in most cases, which will annoy some users (including me).
  2. Do what Photoshop does: Find the largest layer name of that type, and add 1. If no such layer names exist, suggest "Tile Layer 1". So, if there are two layers, "Tile Layer 1" and "Tile Layer 5", Tiled would suggest "Tile Layer 6". This means if the user always gives custom names to all their layers after creating them, Tiled will suggest "Tile Layer 1" for every new layer.
  3. Do a mix of Photoshop-type and current naming: Take the larger value of the layer count for that layer type, and the current layer names. So, if you have two tile layers, "Tile Layer 1" and "Other Tile Layer", Tiled will suggest "Tile Layer 3", but if it's "Tile Layer 5" and "Other Tile Layer", Tiled will suggest "Tile Layer 6".

I'd probably go with the second option, because I'm used to that style of layer naming from the art programs I use - Photoshop, Aseprite, and Krita all use that approach. However, I should mention that all of these programs name all layers with the same number sequence, regardless of type. In Krita, if you have "Paint Layer 1" and then add a new Filter Layer, it'll be called "Filter Layer 2", while in Aseprite and Photoshop, they're all just "Layer 1", "Layer 2", and so on. I think Tiled's independent numbering for each layer type makes sense for Tiled, and should be kept.

@bjorn bjorn added the usability Generally about making something more intuitive or efficient. label Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Generally about making something more intuitive or efficient.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants