diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-12-31 00:33:07 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-12-31 00:33:07 -0300 |
commit | 335c52ba03ecbccd0c9af8f9278b69da09a3e931 (patch) | |
tree | 5e4f5e2ea0d735228de7733e2fb689abbc2bc9c9 /main/main.cpp | |
parent | fd836cad270f7eb9645356cd583c8f11bf737b0f (diff) | |
parent | ac13c8c0c6fc346462b21ee00139dddd2e4ec1e3 (diff) | |
download | redot-engine-335c52ba03ecbccd0c9af8f9278b69da09a3e931.tar.gz |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index 66391ffa7e..4dca79fd55 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -56,7 +56,7 @@ #ifdef TOOLS_ENABLED #include "tools/editor/editor_node.h" #include "tools/editor/project_manager.h" -#include "tools/editor/console.h" + #include "tools/pck/pck_packer.h" #endif @@ -1330,6 +1330,12 @@ bool Main::start() { continue; String name = s.get_slicec('/',1); String path = Globals::get_singleton()->get(s); + bool global_var=false; + if (path.begins_with("*")) { + global_var=true; + path=path.substr(1,path.length()-1); + } + RES res = ResourceLoader::load(path); ERR_EXPLAIN("Can't autoload: "+path); ERR_CONTINUE(res.is_null()); @@ -1355,7 +1361,16 @@ bool Main::start() { ERR_EXPLAIN("Path in autoload not a node or script: "+path); ERR_CONTINUE(!n); n->set_name(name); + sml->get_root()->add_child(n); + + if (global_var) { + for(int i=0;i<ScriptServer::get_language_count();i++) { + ScriptServer::get_language(i)->add_global_constant(name,n); + } + } + + } } |