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

Fix tileset editor visiblity and selection context #58361

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

SaracenOne
Copy link
Member

Makes sure the tileset editor is automatically selected when editing a tileset by clicking on it from the tilemap property in the insepctor. Also makes sure the tileset editor button's visibility is immediately toggled when a tileset is assigned or unassigned from a currently selected tilemap node.

Closes #56413

@SaracenOne
Copy link
Member Author

Wait, need to change something...

@SaracenOne SaracenOne marked this pull request as draft February 20, 2022 17:38
@SaracenOne SaracenOne force-pushed the tileset_editor_selection branch from 7f8f0d2 to e2d5db1 Compare February 20, 2022 18:26
@SaracenOne
Copy link
Member Author

Okay, should be sorted now. Silly oversight on my behalf

@SaracenOne SaracenOne marked this pull request as ready for review February 20, 2022 18:27
@SaracenOne SaracenOne requested a review from groud February 20, 2022 18:27
@SaracenOne SaracenOne marked this pull request as draft February 20, 2022 18:38
@akien-mga akien-mga added this to the 4.0 milestone Feb 20, 2022
@SaracenOne SaracenOne marked this pull request as ready for review February 20, 2022 18:58
@SaracenOne SaracenOne force-pushed the tileset_editor_selection branch from e2d5db1 to 04535bd Compare February 21, 2022 13:35
@SaracenOne
Copy link
Member Author

Updated to be a tad less hacky

@@ -158,6 +158,9 @@ void TilesEditorPlugin::_update_editors() {
// Update the viewport.
CanvasItemEditor::get_singleton()->update_viewport();

// Make sure the tile set editor is visible if we have one assigned.
tileset_editor_button->set_visible(is_visible && tile_set.is_valid());
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I understand why this is needed. Wasn't this already working?
Reading what is in make_visible() it seems like this is already done.

Copy link
Member Author

Choose a reason for hiding this comment

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

@groud Sorry, I completely forgot about this, but I remember it now because I'm doing another pass over all the editor plugins at the moment. With regards to this visibility check, it needs both checks to be successful otherwise the tileset button will still be visible even when you aren't highlighting a tileset node.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Approved in PR review meeting.

@akien-mga akien-mga merged commit 2e05cc3 into godotengine:master Jul 28, 2022
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

TileSet editor doesn't open right after creating TileSet
3 participants