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

Sprite2D editor cleanup #99446

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 19, 2024

Inspired by #99210 (comment)
Removes some unused method and improves code.

@KoBeWi KoBeWi added this to the 4.x milestone Nov 19, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner November 19, 2024 22:14
@@ -587,6 +578,7 @@ Sprite2DEditor::Sprite2DEditor() {
options->get_popup()->add_item(TTR("Create LightOccluder2D Sibling"), MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D);
options->set_switch_on_hover(true);

CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options);
Copy link
Member Author

Choose a reason for hiding this comment

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

Follows a pattern where node is setup before being added to tree.

sprite_editor->options->show();
} else {
sprite_editor->options->hide();
sprite_editor->edit(nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

The only thing that sets me off is the removal of this line, but I assume that's handled by something else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's no longer necessary.

@kitbdev
Copy link
Contributor

kitbdev commented Nov 21, 2024

For make_visible, similar changes to remove edit(nullptr) can also be done in:

  • AbstractPolygon2DEditorPlugin
  • Cast2DEditorPlugin
  • CollisionShape2DEditorPlugin
  • MeshInstance3DEditorPlugin
  • MultiMeshEditorPlugin
  • NavigationLink2DEditorPlugin
  • NavigationObstacle3DEditorPlugin
  • Path2DEditorPlugin
  • Polygon3DEditorPlugin
  • Skeleton2DEditorPlugin
  • NavigationMeshEditorPlugin

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.

3 participants