Skip to content

Smartly choose a new layer name to prevent duplicate names #3501

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

Merged
merged 3 commits into from
Oct 21, 2022

Conversation

lhiginbotham
Copy link
Contributor

@lhiginbotham lhiginbotham commented Oct 14, 2022

Fixes #3452 by attempting to use the default "{Type} Layer {Number}" name, incrementing {Number} if any collisions occur.

Copy link
Member

@bjorn bjorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch looks good, but I added some comments that need to be addressed. :-)

@lhiginbotham lhiginbotham force-pushed the lhiginbotham/smart-layer-names branch from f982aec to f3ebef7 Compare October 21, 2022 00:23
@lhiginbotham
Copy link
Contributor Author

Patch looks good, but I added some comments that need to be addressed. :-)

@bjorn - changes have been made, please check it out 😃

bjorn added 2 commits October 21, 2022 09:43
Apart from some coding style tweaks, I also made the number start at the
most intuitive (in my opinion) value. So if you have two tile layers
(regardless of their name) and add a 3rd one, it will prefer to call it
"Tile Layer 3" and go upwards from there in case of collisions.
@bjorn bjorn merged commit 45ae923 into mapeditor:master Oct 21, 2022
@bjorn
Copy link
Member

bjorn commented Oct 21, 2022

@lhiginbotham Thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic layer names should be unique
2 participants