|
@@ -29,9 +29,9 @@
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
#include "visual_script_func_nodes.h"
|
|
#include "visual_script_func_nodes.h"
|
|
|
|
|
|
|
|
+#include "engine.h"
|
|
#include "io/resource_loader.h"
|
|
#include "io/resource_loader.h"
|
|
#include "os/os.h"
|
|
#include "os/os.h"
|
|
-#include "project_settings.h"
|
|
|
|
#include "scene/main/node.h"
|
|
#include "scene/main/node.h"
|
|
#include "scene/main/scene_tree.h"
|
|
#include "scene/main/scene_tree.h"
|
|
#include "visual_script_nodes.h"
|
|
#include "visual_script_nodes.h"
|
|
@@ -344,7 +344,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName &p_type) {
|
|
return;
|
|
return;
|
|
|
|
|
|
singleton = p_type;
|
|
singleton = p_type;
|
|
- Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
|
|
|
|
|
|
+ Object *obj = Engine::get_singleton()->get_singleton_object(singleton);
|
|
if (obj) {
|
|
if (obj) {
|
|
base_type = obj->get_class();
|
|
base_type = obj->get_class();
|
|
}
|
|
}
|
|
@@ -380,7 +380,7 @@ void VisualScriptFunctionCall::_update_method_cache() {
|
|
|
|
|
|
} else if (call_mode == CALL_MODE_SINGLETON) {
|
|
} 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) {
|
|
if (obj) {
|
|
type = obj->get_class();
|
|
type = obj->get_class();
|
|
script = obj->get_script();
|
|
script = obj->get_script();
|
|
@@ -565,11 +565,11 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
|
|
if (call_mode != CALL_MODE_SINGLETON) {
|
|
if (call_mode != CALL_MODE_SINGLETON) {
|
|
property.usage = 0;
|
|
property.usage = 0;
|
|
} else {
|
|
} 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;
|
|
property.hint = PROPERTY_HINT_ENUM;
|
|
String sl;
|
|
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())
|
|
if (sl != String())
|
|
sl += ",";
|
|
sl += ",";
|
|
sl += E->get().name;
|
|
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());
|
|
property.hint_string = itos(get_visual_script()->get_instance_id());
|
|
} else if (call_mode == CALL_MODE_SINGLETON) {
|
|
} 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) {
|
|
if (obj) {
|
|
property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
|
|
property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
|
|
property.hint_string = itos(obj->get_instance_id());
|
|
property.hint_string = itos(obj->get_instance_id());
|
|
@@ -879,7 +879,7 @@ public:
|
|
} break;
|
|
} break;
|
|
case VisualScriptFunctionCall::CALL_MODE_SINGLETON: {
|
|
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) {
|
|
if (!object) {
|
|
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
|
|
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
|
|
r_error_str = "Invalid singleton name: '" + String(singleton) + "'";
|
|
r_error_str = "Invalid singleton name: '" + String(singleton) + "'";
|