-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix multiple issues with 'add alternative tile' tileset editor button #102640
Conversation
The commits should likely be squashed, but aside from that, looks good to me. |
27ed2fb
to
33e1598
Compare
void TileSetAtlasSourceEditor::_tile_alternatives_create_button_pressed(const Vector2i p_atlas_coords) { | ||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); | ||
|
||
// FIXME: doesn't undo changes to `next_alternative_id` counter |
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.
// FIXME: doesn't undo changes to `next_alternative_id` counter | |
// FIXME: Doesn't undo changes to `next_alternative_id` counter. |
It just means that some alternative IDs will be skipped when you undo and make them again, no?
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.
Correct. I mention it because the counter is saved, so a sequence of user actions "create tile"->"undo"->"save" produces an unexpected change in the resource file. Intuitive behavior would be to leave no evidence of undone change.
Actually there is some error spam when creating new alternate tiles
Probably related to the ID problem you mentioned. |
That seems to happen whenever an alternative tile is created while painting any kind of property. I'm not sure how to fix these errors, but I could make it so the button is disabled while "Paint" tab is active, and user can't create alternative tiles while painting properties. Would such solution be fine? Edit: this would be consistent with how alternative tiles can be created via RMB only in "Setup" and "Select" tabs, but not "Paint" tab. |
@groud ^ |
Well, in theory, the create alternative button should only be visible in the "setup" tab. That's where you define tiles and their alternatives. |
Fix button sizing for small tile sizes. Stop button from preventing MMB panning. Support undo operations for the button. Hide button when "Paint" mode is active.
33e1598
to
f389776
Compare
Applied suggested changes, and also stopped the button from appearing in "paint" tab.
At this moment the UI already allows creating and deleting tiles (both base and alternative) in both "setup" and "select" tabs with RMB, and entire alternative tile config has to be done in "select" tab anyway, so stopping the button from appearing in "select" tab feels unnecessarily restrictive. Although if that's something still wanted, I'll change it. |
Well, in the "select" mode I think it kind of make sense to make it a bit more difficult to create tiles, as a missclick could easily happen and would maybe be a bit annoying. You can create alternatives there with right click too (though I think the option to create a new alternative should be available in the dropdown menu of alternative tiles too). In any case, I don't really have a strong opinion on that, so if others want the button, I guess it makes sense to add it there. |
I tested the updated version and it works in both Setup and Select modes without errors, so it's fine. |
Thanks! Congratulations on your first merged contribution! 🎉 |
Fix multiple issues with 'add alternative tile' tileset editor button in "Alternative tiles" section:
The undo doesn't undo increments in
next_alternative_id
counter within TileSetAtlasSource, but that's an existing issue that also happens when creating alternative tiles via RMB.Before/after:
