summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/api_generator.cpp6
-rw-r--r--modules/gdnative/gdnative.cpp75
-rw-r--r--modules/gdnative/godot.cpp4
-rw-r--r--modules/gdscript/gd_editor.cpp20
-rw-r--r--modules/gdscript/gd_functions.cpp4
-rw-r--r--modules/gdscript/gd_script.cpp10
-rw-r--r--modules/openssl/stream_peer_openssl.cpp4
-rw-r--r--modules/openssl/stream_peer_openssl.h2
-rw-r--r--modules/theora/video_stream_theora.cpp4
-rw-r--r--modules/visual_script/visual_script.cpp4
-rw-r--r--modules/visual_script/visual_script_editor.cpp5
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp14
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp16
-rw-r--r--modules/visual_script/visual_script_nodes.cpp26
-rw-r--r--modules/visual_script/visual_script_nodes.h2
-rw-r--r--modules/webm/video_stream_webm.cpp4
16 files changed, 137 insertions, 63 deletions
diff --git a/modules/gdnative/api_generator.cpp b/modules/gdnative/api_generator.cpp
index d5f22ee7a3..47162bfc49 100644
--- a/modules/gdnative/api_generator.cpp
+++ b/modules/gdnative/api_generator.cpp
@@ -32,8 +32,8 @@
#ifdef TOOLS_ENABLED
#include "class_db.h"
-#include "core/global_config.h"
#include "core/global_constants.h"
+#include "core/project_settings.h"
#include "os/file_access.h"
// helper stuff
@@ -150,7 +150,7 @@ List<ClassAPI> generate_c_api_classes() {
if (name.begins_with("_")) {
name.remove(0);
}
- class_api.is_singleton = GlobalConfig::get_singleton()->has_singleton(name);
+ class_api.is_singleton = ProjectSettings::get_singleton()->has_singleton(name);
}
class_api.is_instanciable = !class_api.is_singleton && ClassDB::can_instance(class_name);
@@ -268,6 +268,8 @@ List<ClassAPI> generate_c_api_classes() {
method_api.method_name = method_api.method_name.get_slice(":", 0);
} else if (m->get().return_val.type != Variant::NIL) {
method_api.return_type = m->get().return_val.hint == PROPERTY_HINT_RESOURCE_TYPE ? m->get().return_val.hint_string : Variant::get_type_name(m->get().return_val.type);
+ } else if (m->get().return_val.name != "") {
+ method_api.return_type = m->get().return_val.name;
} else {
method_api.return_type = "void";
}
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index dad9a54df6..214164ef89 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -29,11 +29,11 @@
/*************************************************************************/
#include "gdnative.h"
-#include "global_config.h"
#include "global_constants.h"
#include "io/file_access_encrypted.h"
#include "os/file_access.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/scene_tree.h"
#include "scene/resources/scene_format_text.h"
@@ -481,8 +481,8 @@ void GDNativeScript::set_script_name(StringName p_script_name) {
}
void GDNativeScript::_bind_methods() {
- ClassDB::bind_method(D_METHOD("get_library"), &GDNativeScript::get_library);
- ClassDB::bind_method(D_METHOD("set_library", "library"), &GDNativeScript::set_library);
+ ClassDB::bind_method(D_METHOD("get_library:GDNativeLibrary"), &GDNativeScript::get_library);
+ ClassDB::bind_method(D_METHOD("set_library", "library:GDNativeLibrary"), &GDNativeScript::set_library);
ClassDB::bind_method(D_METHOD("get_script_name"), &GDNativeScript::get_script_name);
ClassDB::bind_method(D_METHOD("set_script_name", "script_name"), &GDNativeScript::set_script_name);
@@ -573,7 +573,7 @@ Error GDNativeLibrary::_initialize() {
}
ERR_FAIL_COND_V(platform_file == "", ERR_DOES_NOT_EXIST);
- StringName path = GlobalConfig::get_singleton()->globalize_path(platform_file);
+ StringName path = ProjectSettings::get_singleton()->globalize_path(platform_file);
GDNativeLibrary::currently_initialized_library = this;
@@ -847,6 +847,16 @@ bool GDNativeInstance::set(const StringName &p_name, const Variant &p_value) {
script->script_data->properties[p_name].setter.set_func((godot_object *)owner, script->script_data->properties[p_name].setter.method_data, userdata, *(godot_variant *)&p_value);
return true;
}
+
+ Map<StringName, GDNativeScriptData::Method>::Element *E = script->script_data->methods.find("_set");
+ if (E) {
+ Variant name = p_name;
+ const Variant *args[2] = { &name, &p_value };
+
+ E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 2, (godot_variant **)args);
+ return true;
+ }
+
return false;
}
@@ -856,14 +866,69 @@ bool GDNativeInstance::get(const StringName &p_name, Variant &r_ret) const {
if (script->script_data->properties.has(p_name)) {
godot_variant value = script->script_data->properties[p_name].getter.get_func((godot_object *)owner, script->script_data->properties[p_name].getter.method_data, userdata);
r_ret = *(Variant *)&value;
+ godot_variant_destroy(&value);
return true;
}
+
+ Map<StringName, GDNativeScriptData::Method>::Element *E = script->script_data->methods.find("_get");
+ if (E) {
+ Variant name = p_name;
+ const Variant *args[1] = { &name };
+
+ godot_variant result = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 1, (godot_variant **)args);
+ if (((Variant *)&result)->get_type() != Variant::NIL) {
+ r_ret = *(Variant *)&result;
+ godot_variant_destroy(&result);
+ return true;
+ }
+ godot_variant_destroy(&result);
+ }
+
return false;
}
void GDNativeInstance::get_property_list(List<PropertyInfo> *p_properties) const {
script->get_script_property_list(p_properties);
// TODO: dynamic properties
+
+ Map<StringName, GDNativeScriptData::Method>::Element *E = script->script_data->methods.find("_get_property_list");
+ if (E) {
+ godot_variant result = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 0, NULL);
+ Variant ret = *(Variant *)&result;
+ godot_variant_destroy(&result);
+
+ if (ret.get_type() != Variant::ARRAY) {
+ ERR_EXPLAIN("Wrong type for _get_property_list, must be an array of dictionaries.");
+ ERR_FAIL();
+ }
+
+ Array arr = ret;
+ for (int i = 0; i < arr.size(); i++) {
+ Dictionary d = arr[i];
+ ERR_CONTINUE(!d.has("name"))
+ ERR_CONTINUE(!d.has("type"))
+
+ PropertyInfo pinfo;
+
+ pinfo.type = Variant::Type(d["type"].operator int());
+ ERR_CONTINUE(pinfo.type < 0 || pinfo.type >= Variant::VARIANT_MAX);
+
+ pinfo.name = d["name"];
+ ERR_CONTINUE(pinfo.name == "");
+
+ if (d.has("hint")) {
+ pinfo.hint = PropertyHint(d["hint"].operator int());
+ }
+ if (d.has("hint_string")) {
+ pinfo.hint_string = d["hint_string"];
+ }
+ if (d.has("usage")) {
+ pinfo.usage = d["usage"];
+ }
+
+ p_properties->push_back(pinfo);
+ }
+ }
}
Variant::Type GDNativeInstance::get_property_type(const StringName &p_name, bool *r_is_valid) const {
@@ -1021,7 +1086,7 @@ void GDNativeScriptLanguage::init() {
// TODO: Expose globals
GLOBAL_DEF("gdnative/default_gdnativelibrary", "");
PropertyInfo prop_info(Variant::STRING, "gdnative/default_gdnativelibrary", PROPERTY_HINT_FILE, "tres,res,dllib");
- GlobalConfig::get_singleton()->set_custom_property_info("gdnative/default_gdnativelibrary", prop_info);
+ ProjectSettings::get_singleton()->set_custom_property_info("gdnative/default_gdnativelibrary", prop_info);
// generate bindings
#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
diff --git a/modules/gdnative/godot.cpp b/modules/gdnative/godot.cpp
index 4dbb72bba1..764ce7c3ea 100644
--- a/modules/gdnative/godot.cpp
+++ b/modules/gdnative/godot.cpp
@@ -32,8 +32,8 @@
#include "class_db.h"
#include "error_macros.h"
#include "gdnative.h"
-#include "global_config.h"
#include "global_constants.h"
+#include "project_settings.h"
#include "variant.h"
#ifdef __cplusplus
@@ -93,7 +93,7 @@ void GDAPI godot_object_destroy(godot_object *p_o) {
// Singleton API
godot_object GDAPI *godot_global_get_singleton(char *p_name) {
- return (godot_object *)GlobalConfig::get_singleton()->get_singleton_object(String(p_name));
+ return (godot_object *)ProjectSettings::get_singleton()->get_singleton_object(String(p_name));
} // result shouldn't be freed
// MethodBind API
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index adf3c8edc4..f1b4828a3e 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -30,7 +30,7 @@
#include "editor/editor_settings.h"
#include "gd_compiler.h"
#include "gd_script.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/file_access.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_file_system.h"
@@ -638,7 +638,7 @@ static bool _guess_expression_type(GDCompletionContext &context, const GDParser:
String which = arg1.get_slice("/", 2);
if (which != "") {
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
//print_line("find singleton");
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -650,7 +650,7 @@ static bool _guess_expression_type(GDCompletionContext &context, const GDParser:
String name = s.get_slice("/", 1);
//print_line("name: "+name+", which: "+which);
if (name == which) {
- String script = GlobalConfig::get_singleton()->get(s);
+ String script = ProjectSettings::get_singleton()->get(s);
if (!script.begins_with("res://")) {
script = "res://" + script;
@@ -1105,7 +1105,7 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con
//autoloads as singletons
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -1115,7 +1115,7 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con
String name = s.get_slice("/", 1);
if (name == String(p_identifier)) {
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
if (path.begins_with("*")) {
String script = path.substr(1, path.length());
@@ -1344,7 +1344,7 @@ static void _find_identifiers(GDCompletionContext &context, int p_line, bool p_o
//autoload singletons
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -1352,7 +1352,7 @@ static void _find_identifiers(GDCompletionContext &context, int p_line, bool p_o
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slice("/", 1);
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
if (path.begins_with("*")) {
result.insert(name);
}
@@ -1685,7 +1685,7 @@ static void _find_type_arguments(GDCompletionContext &context, const GDParser::N
if (p_argidx == 0 && (String(p_method) == "get_node" || String(p_method) == "has_node") && ClassDB::is_parent_class(id.obj_type, "Node")) {
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -2660,7 +2660,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
//guess in autoloads as singletons
List<PropertyInfo> props;
- GlobalConfig::get_singleton()->get_property_list(&props);
+ ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -2670,7 +2670,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
String name = s.get_slice("/", 1);
if (name == String(p_symbol)) {
- String path = GlobalConfig::get_singleton()->get(s);
+ String path = ProjectSettings::get_singleton()->get(s);
if (path.begins_with("*")) {
String script = path.substr(1, path.length());
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index a361971ef4..8bc3b24a5e 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -1587,13 +1587,13 @@ MethodInfo GDFunctions::get_info(Function p_func) {
} break;
case TO_JSON: {
- MethodInfo mi("to_json", PropertyInfo(Variant::NIL, "var:Variant"));
+ MethodInfo mi("to_json", PropertyInfo(Variant::NIL, "var"));
mi.return_val.type = Variant::STRING;
return mi;
} break;
case HASH: {
- MethodInfo mi("hash", PropertyInfo(Variant::NIL, "var:Variant"));
+ MethodInfo mi("hash", PropertyInfo(Variant::NIL, "var"));
mi.return_val.type = Variant::INT;
return mi;
} break;
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 1dcc442234..ca62122342 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "gd_script.h"
#include "gd_compiler.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "global_constants.h"
#include "io/file_access_encrypted.h"
#include "os/file_access.h"
@@ -1454,9 +1454,9 @@ void GDScriptLanguage::init() {
//populate singletons
- List<GlobalConfig::Singleton> singletons;
- GlobalConfig::get_singleton()->get_singletons(&singletons);
- for (List<GlobalConfig::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
+ List<ProjectSettings::Singleton> singletons;
+ ProjectSettings::get_singleton()->get_singletons(&singletons);
+ for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
_add_global(E->get().name, E->get().ptr);
}
@@ -1885,7 +1885,7 @@ GDScriptLanguage::GDScriptLanguage() {
script_frame_time = 0;
_debug_call_stack_pos = 0;
- int dmcs = GLOBAL_DEF("debug/script/max_call_stack", 1024);
+ int dmcs = GLOBAL_DEF("debug/settings/gdscript/max_call_stack", 1024);
if (ScriptDebugger::get_singleton()) {
//debugging enabled!
diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp
index 8159296b3c..7a9d5195a9 100644
--- a/modules/openssl/stream_peer_openssl.cpp
+++ b/modules/openssl/stream_peer_openssl.cpp
@@ -560,7 +560,7 @@ void StreamPeerOpenSSL::initialize_ssl() {
ERR_load_BIO_strings(); // Load BIO error strings
OpenSSL_add_all_algorithms(); // Load all available encryption algorithms
String certs_path = GLOBAL_DEF("network/ssl/certificates", "");
- GlobalConfig::get_singleton()->set_custom_property_info("network/ssl/certificates", PropertyInfo(Variant::STRING, "network/ssl/certificates", PROPERTY_HINT_FILE, "*.crt"));
+ ProjectSettings::get_singleton()->set_custom_property_info("network/ssl/certificates", PropertyInfo(Variant::STRING, "network/ssl/certificates", PROPERTY_HINT_FILE, "*.crt"));
if (certs_path != "") {
FileAccess *f = FileAccess::open(certs_path, FileAccess::READ);
@@ -581,7 +581,7 @@ void StreamPeerOpenSSL::initialize_ssl() {
}
}
String config_path = GLOBAL_DEF("network/ssl/config", "");
- GlobalConfig::get_singleton()->set_custom_property_info("network/ssl/config", PropertyInfo(Variant::STRING, "network/ssl/config", PROPERTY_HINT_FILE, "*.cnf"));
+ ProjectSettings::get_singleton()->set_custom_property_info("network/ssl/config", PropertyInfo(Variant::STRING, "network/ssl/config", PROPERTY_HINT_FILE, "*.cnf"));
if (config_path != "") {
Vector<uint8_t> data = FileAccess::get_file_as_array(config_path);
diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h
index 5c830ebf37..10e02202aa 100644
--- a/modules/openssl/stream_peer_openssl.h
+++ b/modules/openssl/stream_peer_openssl.h
@@ -30,7 +30,7 @@
#ifndef STREAM_PEER_OPEN_SSL_H
#define STREAM_PEER_OPEN_SSL_H
-#include "global_config.h"
+#include "project_settings.h"
#include "io/stream_peer_ssl.h"
#include "os/file_access.h"
diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp
index d895f60280..f4af5026de 100644
--- a/modules/theora/video_stream_theora.cpp
+++ b/modules/theora/video_stream_theora.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "video_stream_theora.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/os.h"
#include "thirdparty/misc/yuv2rgb.h"
@@ -728,7 +728,7 @@ void VideoStreamPlaybackTheora::play() {
}
playing = true;
- delay_compensation = GlobalConfig::get_singleton()->get("audio/video_delay_compensation_ms");
+ delay_compensation = ProjectSettings::get_singleton()->get("audio/video_delay_compensation_ms");
delay_compensation /= 1000.0;
};
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp
index a922fdf354..619ed8f6c0 100644
--- a/modules/visual_script/visual_script.cpp
+++ b/modules/visual_script/visual_script.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "visual_script.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/os.h"
#include "scene/main/node.h"
#include "visual_script_nodes.h"
@@ -2658,7 +2658,7 @@ VisualScriptLanguage::VisualScriptLanguage() {
_debug_parse_err_node = -1;
_debug_parse_err_file = "";
_debug_call_stack_pos = 0;
- int dmcs = GLOBAL_DEF("debug/script/max_call_stack", 1024);
+ int dmcs = GLOBAL_DEF("debug/settings/visual_script/max_call_stack", 1024);
if (ScriptDebugger::get_singleton()) {
//debugging enabled!
_debug_max_call_stack = dmcs;
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 08757f4c61..ba3463445d 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -2746,7 +2746,7 @@ void VisualScriptEditor::_node_filter_changed(const String &p_text) {
void VisualScriptEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
- node_filter_icon->set_texture(Control::get_icon("Search", "EditorIcons"));
+ node_filter->add_icon_override("right_icon", Control::get_icon("Search", "EditorIcons"));
variable_editor->connect("changed", this, "_update_members");
signal_editor->connect("changed", this, "_update_members");
}
@@ -3215,9 +3215,6 @@ VisualScriptEditor::VisualScriptEditor() {
node_filter->connect("text_changed", this, "_node_filter_changed");
hbc_nodes->add_child(node_filter);
node_filter->set_h_size_flags(SIZE_EXPAND_FILL);
- node_filter_icon = memnew(TextureRect);
- node_filter_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
- hbc_nodes->add_child(node_filter_icon);
vbc_nodes->add_child(hbc_nodes);
nodes = memnew(Tree);
diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index b53a21c53b..77f3111d94 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -29,9 +29,9 @@
/*************************************************************************/
#include "visual_script_flow_control.h"
-#include "global_config.h"
#include "io/resource_loader.h"
#include "os/keyboard.h"
+#include "project_settings.h"
//////////////////////////////////////////
////////////////RETURN////////////////////
@@ -138,11 +138,11 @@ public:
if (with_value) {
*p_working_mem = *p_inputs[0];
+ return STEP_EXIT_FUNCTION_BIT;
} else {
*p_working_mem = Variant();
+ return 0;
}
-
- return 0;
}
};
@@ -875,7 +875,7 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const
case Ref<InputEvent>::ACTION: {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
int index = 1;
text = "No Action";
@@ -1119,7 +1119,7 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va
if (what == "action_name") {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
int index = 1;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
@@ -1325,7 +1325,7 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con
if (what == "action_name") {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
int index = 1;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
@@ -1456,7 +1456,7 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con
actions = "None";
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
Vector<String> al;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 93b2aa2982..c42e784fbc 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "visual_script_func_nodes.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "io/resource_loader.h"
#include "os/os.h"
#include "scene/main/node.h"
@@ -347,7 +347,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName &p_path) {
return;
singleton = p_path;
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (obj) {
base_type = obj->get_class();
}
@@ -383,7 +383,7 @@ void VisualScriptFunctionCall::_update_method_cache() {
} else if (call_mode == CALL_MODE_SINGLETON) {
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (obj) {
type = obj->get_class();
script = obj->get_script();
@@ -568,11 +568,11 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
if (call_mode != CALL_MODE_SINGLETON) {
property.usage = 0;
} else {
- List<GlobalConfig::Singleton> names;
- GlobalConfig::get_singleton()->get_singletons(&names);
+ List<ProjectSettings::Singleton> names;
+ ProjectSettings::get_singleton()->get_singletons(&names);
property.hint = PROPERTY_HINT_ENUM;
String sl;
- for (List<GlobalConfig::Singleton>::Element *E = names.front(); E; E = E->next()) {
+ for (List<ProjectSettings::Singleton>::Element *E = names.front(); E; E = E->next()) {
if (sl != String())
sl += ",";
sl += E->get().name;
@@ -606,7 +606,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 = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
if (obj) {
property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
property.hint_string = itos(obj->get_instance_ID());
@@ -867,7 +867,7 @@ public:
} break;
case VisualScriptFunctionCall::CALL_MODE_SINGLETON: {
- Object *object = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *object = ProjectSettings::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) + "'";
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 5f24bcc2c3..771d0463c8 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -29,10 +29,10 @@
/*************************************************************************/
#include "visual_script_nodes.h"
-#include "global_config.h"
#include "global_constants.h"
#include "os/input.h"
#include "os/os.h"
+#include "project_settings.h"
#include "scene/main/node.h"
#include "scene/main/scene_tree.h"
@@ -1939,13 +1939,13 @@ public:
VisualScriptNodeInstance *VisualScriptEngineSingleton::instance(VisualScriptInstance *p_instance) {
VisualScriptNodeInstanceEngineSingleton *instance = memnew(VisualScriptNodeInstanceEngineSingleton);
- instance->singleton = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ instance->singleton = ProjectSettings::get_singleton()->get_singleton_object(singleton);
return instance;
}
VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output_type(TypeGuess *p_inputs, int p_output) const {
- Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton);
+ Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton);
TypeGuess tg;
tg.type = Variant::OBJECT;
if (obj) {
@@ -1963,11 +1963,11 @@ void VisualScriptEngineSingleton::_bind_methods() {
String cc;
- List<GlobalConfig::Singleton> singletons;
+ List<ProjectSettings::Singleton> singletons;
- GlobalConfig::get_singleton()->get_singletons(&singletons);
+ ProjectSettings::get_singleton()->get_singletons(&singletons);
- for (List<GlobalConfig::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
+ for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
if (E->get().name == "VS" || E->get().name == "PS" || E->get().name == "PS2D" || E->get().name == "AS" || E->get().name == "TS" || E->get().name == "SS" || E->get().name == "SS2D")
continue; //skip these, too simple named
@@ -2596,10 +2596,10 @@ public:
in_values.resize(in_count);
for (int i = 0; i < in_count; i++) {
- in_values[i] = p_inputs[i];
+ in_values[i] = *p_inputs[i];
}
- out_values.resize(in_count);
+ out_values.resize(out_count);
work_mem.resize(work_mem_size);
@@ -2645,6 +2645,7 @@ VisualScriptNodeInstance *VisualScriptCustomNode::instance(VisualScriptInstance
VisualScriptNodeInstanceCustomNode *instance = memnew(VisualScriptNodeInstanceCustomNode);
instance->instance = p_instance;
+ instance->node = this;
instance->in_count = get_input_value_port_count();
instance->out_count = get_output_value_port_count();
@@ -2657,6 +2658,10 @@ VisualScriptNodeInstance *VisualScriptCustomNode::instance(VisualScriptInstance
return instance;
}
+void VisualScriptCustomNode::_script_changed() {
+ ports_changed_notify();
+}
+
void VisualScriptCustomNode::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::INT, "_get_output_sequence_port_count"));
@@ -2679,6 +2684,8 @@ void VisualScriptCustomNode::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::INT, "_get_working_memory_size"));
BIND_VMETHOD(MethodInfo(Variant::NIL, "_step:Variant", PropertyInfo(Variant::ARRAY, "inputs"), PropertyInfo(Variant::ARRAY, "outputs"), PropertyInfo(Variant::INT, "start_mode"), PropertyInfo(Variant::ARRAY, "working_mem")));
+ ClassDB::bind_method(D_METHOD("_script_changed"), &VisualScriptCustomNode::_script_changed);
+
BIND_CONSTANT(START_MODE_BEGIN_SEQUENCE);
BIND_CONSTANT(START_MODE_CONTINUE_SEQUENCE);
BIND_CONSTANT(START_MODE_RESUME_YIELD);
@@ -2691,6 +2698,7 @@ void VisualScriptCustomNode::_bind_methods() {
}
VisualScriptCustomNode::VisualScriptCustomNode() {
+ connect("script_changed", this, "_script_changed");
}
//////////////////////////////////////////
@@ -3466,7 +3474,7 @@ void VisualScriptInputAction::_validate_property(PropertyInfo &property) const {
String actions;
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
Vector<String> al;
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h
index 5ae9a1b30b..7a3b26fe55 100644
--- a/modules/visual_script/visual_script_nodes.h
+++ b/modules/visual_script/visual_script_nodes.h
@@ -712,6 +712,8 @@ public:
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
+ void _script_changed();
+
VisualScriptCustomNode();
};
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp
index eaf4215302..ff0bca0fc5 100644
--- a/modules/webm/video_stream_webm.cpp
+++ b/modules/webm/video_stream_webm.cpp
@@ -34,7 +34,7 @@
#include "mkvparser/mkvparser.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/file_access.h"
#include "thirdparty/misc/yuv2rgb.h"
@@ -168,7 +168,7 @@ void VideoStreamPlaybackWebm::play() {
stop();
- delay_compensation = GlobalConfig::get_singleton()->get("audio/video_delay_compensation_ms");
+ delay_compensation = ProjectSettings::get_singleton()->get("audio/video_delay_compensation_ms");
delay_compensation /= 1000.0;
playing = true;