summaryrefslogtreecommitdiffstats
path: root/modules/visual_script/visual_script_func_nodes.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-11-14 20:44:55 +0100
committerGitHub <noreply@github.com>2017-11-14 20:44:55 +0100
commit61a693cf782c952dc151d8d77b1ab365888e6701 (patch)
treef6e629e3b1a4546105edcd0ea9a5bb130b9198f0 /modules/visual_script/visual_script_func_nodes.cpp
parent04edfc090b0e78f4f820977da8cb4eb2d015c5f7 (diff)
parentacb23adad37b459e64b8f9bafbbdd1185d46093d (diff)
downloadredot-engine-61a693cf782c952dc151d8d77b1ab365888e6701.tar.gz
Merge pull request #12922 from eska014/engine-singletons
Singleton management changes
Diffstat (limited to 'modules/visual_script/visual_script_func_nodes.cpp')
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index a5dc6ffc13..cbe4438cdf 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -29,9 +29,9 @@
/*************************************************************************/
#include "visual_script_func_nodes.h"
+#include "engine.h"
#include "io/resource_loader.h"
#include "os/os.h"
-#include "project_settings.h"
#include "scene/main/node.h"
#include "scene/main/scene_tree.h"
#include "visual_script_nodes.h"
@@ -344,7 +344,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName &p_type) {
return;
singleton = p_type;
- Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
+ Object *obj = Engine::get_singleton()->get_singleton_object(singleton);
if (obj) {
base_type = obj->get_class();
}
@@ -380,7 +380,7 @@ void VisualScriptFunctionCall::_update_method_cache() {
} else if (call_mode == CALL_MODE_SINGLETON) {
- Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
+ Object *obj = Engine::get_singleton()->get_singleton_object(singleton);
if (obj) {
type = obj->get_class();
script = obj->get_script();
@@ -565,11 +565,11 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
if (call_mode != CALL_MODE_SINGLETON) {
property.usage = 0;
} else {
- List<ProjectSettings::Singleton> names;
- ProjectSettings::get_singleton()->get_singletons(&names);
+ List<Engine::Singleton> names;
+ Engine::get_singleton()->get_singletons(&names);
property.hint = PROPERTY_HINT_ENUM;
String sl;
- for (List<ProjectSettings::Singleton>::Element *E = names.front(); E; E = E->next()) {
+ for (List<Engine::Singleton>::Element *E = names.front(); E; E = E->next()) {
if (sl != String())
sl += ",";
sl += E->get().name;
@@ -603,7 +603,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_SINGLETON) {
- Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
+ Object *obj = Engine::get_singleton()->get_singleton_object(singleton);
if (obj) {
property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
property.hint_string = itos(obj->get_instance_id());
@@ -879,7 +879,7 @@ public:
} break;
case VisualScriptFunctionCall::CALL_MODE_SINGLETON: {
- Object *object = ProjectSettings::get_singleton()->get_singleton_object(singleton);
+ Object *object = Engine::get_singleton()->get_singleton_object(singleton);
if (!object) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = "Invalid singleton name: '" + String(singleton) + "'";