summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-15 00:29:04 +0100
committerGitHub <noreply@github.com>2017-01-15 00:29:04 +0100
commitfe8459ac3badc0d2b2b36bf29670d2639825d644 (patch)
tree7fd9694adcce6e512640e6e9544ca69ee50581f8
parent1d7d8e167474528f32817a1b645b0a10279ae0f0 (diff)
parenta533402695b9a78d1b3feacb68949519dcaa2d8e (diff)
Merge pull request #7515 from kbake/issue7433
Use Animation's Name as Filename When Saving
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index 59ab3bc467..a3f254ce49 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -433,7 +433,12 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource)
String existing;
if (extensions.size()) {
- existing = "new_" + p_resource->get_class().to_lower() + "." + extensions.front()->get().to_lower();
+ if( p_resource->get_name() != "" ) {
+ existing = p_resource->get_name() + "." + extensions.front()->get().to_lower();
+ }
+ else {
+ existing = "new_" + p_resource->get_class().to_lower() + "." + extensions.front()->get().to_lower();
+ }
}
file->set_current_path(existing);