You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Merge pull request #18168 from Chaosus/fixcrash
Fix possible crash when clicking on Skeleton2D or Sprite editor options
This commit is contained in:
@@ -20,6 +20,10 @@ void Skeleton2DEditor::edit(Skeleton2D *p_sprite) {
|
|||||||
|
|
||||||
void Skeleton2DEditor::_menu_option(int p_option) {
|
void Skeleton2DEditor::_menu_option(int p_option) {
|
||||||
|
|
||||||
|
if (!node) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (p_option) {
|
switch (p_option) {
|
||||||
case MENU_OPTION_MAKE_REST: {
|
case MENU_OPTION_MAKE_REST: {
|
||||||
|
|
||||||
@@ -107,6 +111,7 @@ Skeleton2DEditorPlugin::Skeleton2DEditorPlugin(EditorNode *p_node) {
|
|||||||
editor = p_node;
|
editor = p_node;
|
||||||
sprite_editor = memnew(Skeleton2DEditor);
|
sprite_editor = memnew(Skeleton2DEditor);
|
||||||
editor->get_viewport()->add_child(sprite_editor);
|
editor->get_viewport()->add_child(sprite_editor);
|
||||||
|
make_visible(false);
|
||||||
|
|
||||||
//sprite_editor->options->hide();
|
//sprite_editor->options->hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ Vector<Vector2> expand(const Vector<Vector2> &points, const Rect2i &rect, float
|
|||||||
|
|
||||||
void SpriteEditor::_menu_option(int p_option) {
|
void SpriteEditor::_menu_option(int p_option) {
|
||||||
|
|
||||||
|
if (!node) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (p_option) {
|
switch (p_option) {
|
||||||
case MENU_OPTION_CREATE_MESH_2D: {
|
case MENU_OPTION_CREATE_MESH_2D: {
|
||||||
|
|
||||||
@@ -389,6 +393,7 @@ SpriteEditorPlugin::SpriteEditorPlugin(EditorNode *p_node) {
|
|||||||
editor = p_node;
|
editor = p_node;
|
||||||
sprite_editor = memnew(SpriteEditor);
|
sprite_editor = memnew(SpriteEditor);
|
||||||
editor->get_viewport()->add_child(sprite_editor);
|
editor->get_viewport()->add_child(sprite_editor);
|
||||||
|
make_visible(false);
|
||||||
|
|
||||||
//sprite_editor->options->hide();
|
//sprite_editor->options->hide();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user