summaryrefslogtreecommitdiffstats
path: root/editor/animation_track_editor.cpp
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-27 21:15:49 +0000
committerGitHub <noreply@github.com>2024-11-27 21:15:49 +0000
commit85d87116e184e7923b8d6804cab2681b61c62d83 (patch)
tree55ec5bfa061a5c27272b831e697b78ed1b756a70 /editor/animation_track_editor.cpp
parentb06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (diff)
parent721f53fde47c2727d99e3ecccdb789a67df36de0 (diff)
downloadredot-engine-master.tar.gz
Merge pull request #886 from Spartan322/merge/f128f38HEADmaster
Merge commit godotengine/godot@f128f38
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r--editor/animation_track_editor.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index d3e79dbe04..5210092a3f 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1402,12 +1402,26 @@ void AnimationTimelineEdit::_anim_loop_pressed() {
undo_redo->add_undo_method(this, "update_values");
undo_redo->commit_action();
} else {
- String base_path = animation->get_path();
- if (FileAccess::exists(base_path + ".import")) {
- EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from imported scene."));
+ String base = animation->get_path();
+ int srpos = base.find("::");
+ if (srpos != -1) {
+ base = animation->get_path().substr(0, srpos);
+ }
+
+ if (FileAccess::exists(base + ".import")) {
+ if (ResourceLoader::get_resource_type(base) == "PackedScene") {
+ EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from an imported scene.\n\nTo change this animation's loop mode, navigate to the scene's Advanced Import settings and select the animation.\nYou can then change the loop mode from the inspector menu."));
+ } else {
+ EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from an imported resource."));
+ }
} else {
- EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another scene."));
+ if (ResourceLoader::get_resource_type(base) == "PackedScene") {
+ EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another scene.\n\nYou must open this scene and change the animation's loop mode from there."));
+ } else {
+ EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another resource."));
+ }
}
+
update_values();
}
}
@@ -6630,6 +6644,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
case EDIT_SCALE_SELECTION:
case EDIT_SCALE_FROM_CURSOR: {
scale_dialog->popup_centered(Size2(200, 100) * EDSCALE);
+ scale->get_line_edit()->grab_focus();
} break;
case EDIT_SCALE_CONFIRM: {
if (selection.is_empty()) {
@@ -7877,10 +7892,13 @@ AnimationTrackEditor::AnimationTrackEditor() {
scale->set_min(-99999);
scale->set_max(99999);
scale->set_step(0.001);
+ scale->set_select_all_on_focus(true);
vbc->add_margin_child(TTR("Scale Ratio:"), scale);
- scale_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM));
+ scale_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM), CONNECT_DEFERRED);
add_child(scale_dialog);
+ scale_dialog->register_text_enter(scale->get_line_edit());
+
//
ease_dialog = memnew(ConfirmationDialog);
ease_dialog->set_title(TTR("Select Transition and Easing"));