summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-07-19 17:00:46 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-07-19 17:06:03 -0300
commit25678b1876816b9ccb14b2c92aef62f3b009f88f (patch)
tree189f082d788f78e16f620b056d21249118883fc5 /modules
parent89588d43349e496a9e05756d42ae87323d31269e (diff)
-Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/api_generator.cpp4
-rw-r--r--modules/gdnative/gdnative.cpp6
-rw-r--r--modules/gdnative/godot.cpp4
-rw-r--r--modules/gdscript/gd_editor.cpp20
-rw-r--r--modules/gdscript/gd_script.cpp8
-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.cpp2
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp10
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp16
-rw-r--r--modules/visual_script/visual_script_nodes.cpp14
-rw-r--r--modules/webm/video_stream_webm.cpp4
13 files changed, 49 insertions, 49 deletions
diff --git a/modules/gdnative/api_generator.cpp b/modules/gdnative/api_generator.cpp
index a9d1f96287..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);
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 348d8533ad..93e13850ac 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"
@@ -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;
@@ -1083,7 +1083,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_script.cpp b/modules/gdscript/gd_script.cpp
index 0afb6ac179..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);
}
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 84b4b0cab1..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"
diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index b53a21c53b..7074ac76c7 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "visual_script_flow_control.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "io/resource_loader.h"
#include "os/keyboard.h"
@@ -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..9cbadde521 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "visual_script_nodes.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "global_constants.h"
#include "os/input.h"
#include "os/os.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
@@ -3466,7 +3466,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/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;