-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Auto create tile for multiple atlases #79678
Auto create tile for multiple atlases #79678
Conversation
Thanks for the contribution! Why do you create 3 functions to do handle that, and store atlases as a property of the editor ? I would suggest to instead use a single function that takes an array instead, it would be simpler. |
And commits needs to be squashed in order for PR to be accepted (see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html). |
@groud I really didn't want to store atlases as a property but I don't know how to get the array after the user accept/decline a popup. void TileSetAtlasSourceEditor::init_source(Vector<Ref<TileSetAtlasSource>> atlases) {
tool_setup_atlas_source_button->set_pressed(true);
atlases_to_auto_create_tiles = atlases;
confirm_auto_create_tiles->popup_centered();
}
@Chaosus Thank you, I will read and do right after any adjustment from feedbacks |
Ah I see what you mean. I think it's fine to do it that way then, using a property. However I would probably move the definition closer to the popup's one in the .h file, so that's it's a bit more obvious this variable is only needed for the popup. |
@groud Like this? void _auto_create_tiles();
void _auto_remove_tiles();
void _cancel_auto_create_tiles();
AcceptDialog *confirm_auto_create_tiles = nullptr; Also I renamed |
I meant something like this:
Related variables and methods close together. |
cb94347
to
b5a2ef6
Compare
7df17a3
to
914fad6
Compare
7dfb184
to
914fad6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase, but I believe looks mostly good.
fb631b7
to
9678e73
Compare
Moved the comment |
9678e73
to
d331837
Compare
@groud Can you confirm if i did rebase correctly? |
4c2be06
to
33db6dc
Compare
@AThousandShips thank you for reviewing. |
33db6dc
to
541fd0f
Compare
TileSet add button support multiple files Join most of the code of `_drop_data_fw()` and `_texture_file_selected()` in a new function `_load_texture_files()` Rename `init_source` to `init_new_atlases`
541fd0f
to
c8a94ea
Compare
Thanks! And congrats for your first merged Godot contribution 🎉 |
Based on issues: #69273 #79473
And PRs: #70790 #79558
TileSetEditor::_texture_file_selected()
andTileSetEditor::_drop_data_fw()
intoTileSetEditor::_load_texture_files()
Bugsquad edit: