summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-31 13:18:13 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-31 13:18:13 +0100
commit5f90989c265e40ad01868a56dd4cb7f0c585d93a (patch)
treed9a33b7b06b633a45903adbe078414e9bacb4bcf
parent6c859889eb6b19641fa163665c2bab028ffcfa03 (diff)
parent23f566ee1f8314c78589cf4c9ee4ec60e17d4273 (diff)
Merge pull request #72447 from TokageItLab/fix-sprite-frames-edit-switching
Fix SpriteFramesEditor is spamming to switch bottom panel
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 9df2f0a9d1..14b5f7cefb 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -1523,8 +1523,25 @@ SpriteFramesEditor::SpriteFramesEditor() {
delete_anim->set_disabled(true);
delete_anim->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_remove));
+ autoplay_container = memnew(HBoxContainer);
+ hbc_animlist->add_child(autoplay_container);
+
+ autoplay_container->add_child(memnew(VSeparator));
+
+ autoplay = memnew(Button);
+ autoplay->set_flat(true);
+ autoplay->set_tooltip_text(TTR("Autoplay on Load"));
+ autoplay_container->add_child(autoplay);
+
hbc_animlist->add_child(memnew(VSeparator));
+ anim_loop = memnew(Button);
+ anim_loop->set_toggle_mode(true);
+ anim_loop->set_flat(true);
+ anim_loop->set_tooltip_text(TTR("Animation Looping"));
+ anim_loop->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_loop_changed));
+ hbc_animlist->add_child(anim_loop);
+
anim_speed = memnew(SpinBox);
anim_speed->set_suffix(TTR("FPS"));
anim_speed->set_min(0);
@@ -1535,23 +1552,6 @@ SpriteFramesEditor::SpriteFramesEditor() {
anim_speed->connect("value_changed", callable_mp(this, &SpriteFramesEditor::_animation_speed_changed));
hbc_animlist->add_child(anim_speed);
- anim_loop = memnew(Button);
- anim_loop->set_toggle_mode(true);
- anim_loop->set_flat(true);
- anim_loop->set_tooltip_text(TTR("Animation Looping"));
- anim_loop->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_loop_changed));
- hbc_animlist->add_child(anim_loop);
-
- autoplay_container = memnew(HBoxContainer);
- hbc_animlist->add_child(autoplay_container);
-
- autoplay_container->add_child(memnew(VSeparator));
-
- autoplay = memnew(Button);
- autoplay->set_flat(true);
- autoplay->set_tooltip_text(TTR("Autoplay on Load"));
- autoplay_container->add_child(autoplay);
-
anim_search_box = memnew(LineEdit);
sub_vb->add_child(anim_search_box);
anim_search_box->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -1953,9 +1953,7 @@ void SpriteFramesEditorPlugin::make_visible(bool p_visible) {
EditorNode::get_singleton()->make_bottom_panel_item_visible(frames_editor);
} else {
button->hide();
- if (frames_editor->is_visible_in_tree()) {
- EditorNode::get_singleton()->hide_bottom_panel();
- }
+ frames_editor->edit(Ref<SpriteFrames>());
}
}