summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorSilc Renew <tokage.it.lab@gmail.com>2023-01-31 19:56:02 +0900
committerSilc Renew <tokage.it.lab@gmail.com>2023-01-31 19:56:02 +0900
commit23f566ee1f8314c78589cf4c9ee4ec60e17d4273 (patch)
tree500ba989e59d8939adfe4a44d5d5d2c1ef861a37 /editor
parent5bcf016f1134c9c28d21bf33d8fdf394f3b354db (diff)
Fix switching method in SpriteFramesEditor
Diffstat (limited to 'editor')
-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>());
}
}