summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-02-02 08:06:59 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-02-02 08:06:59 -0300
commita9412b8744a570db96d08747321e45347790801f (patch)
treef7cb3a1ae18ed5d841bf8388810154783157abe3 /tools
parenta479ce6e86f13ede8c265595e211144130adbf53 (diff)
-make autoloads keep order when toggling singleton, fixes #3482
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/project_settings.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index c13b08d871..879eb4227c 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -835,6 +835,7 @@ void ProjectSettings::_autoload_edited() {
String base="autoload/"+ti->get_text(0);
String path = Globals::get_singleton()->get(base);
+ int order = Globals::get_singleton()->get_order(base);
if (path.begins_with("*"))
path=path.substr(1,path.length());
@@ -845,6 +846,8 @@ void ProjectSettings::_autoload_edited() {
undo_redo->create_action("Toggle Autoload GlobalVar");
undo_redo->add_do_property(Globals::get_singleton(),base,path);
undo_redo->add_undo_property(Globals::get_singleton(),base,Globals::get_singleton()->get(base));
+ undo_redo->add_do_method(Globals::get_singleton(),"set_order",base,order);
+ undo_redo->add_undo_method(Globals::get_singleton(),"set_order",base,order);
undo_redo->add_do_method(this,"_update_autoload");
undo_redo->add_undo_method(this,"_update_autoload");
undo_redo->add_do_method(this,"_settings_changed");