summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-10-18 16:43:37 +0200
committerkobewi <kobewi4e@gmail.com>2022-10-18 19:01:48 +0200
commite48c5daddfa70172c0eab57b8045a7087eec6e2c (patch)
tree249fa2203570136d3a2040ad612e6e86a516cd5f /core
parent28a4eec9a77bc797b7147be2453cdbe85cf47d7f (diff)
Unify usage of GLOBAL/EDITOR_GET
Diffstat (limited to 'core')
-rw-r--r--core/config/project_settings.cpp2
-rw-r--r--core/input/input_map.cpp2
-rw-r--r--core/io/resource_loader.cpp4
-rw-r--r--core/object/script_language.cpp6
-rw-r--r--core/string/translation.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index 001a351e0b..6d331846ca 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -1022,7 +1022,7 @@ Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default, bool p_restar
if (!ProjectSettings::get_singleton()->has_setting(p_var)) {
ProjectSettings::get_singleton()->set(p_var, p_default);
}
- ret = ProjectSettings::get_singleton()->get(p_var);
+ ret = GLOBAL_GET(p_var);
ProjectSettings::get_singleton()->set_initial_value(p_var, p_default);
ProjectSettings::get_singleton()->set_builtin_order(p_var);
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp
index ce76d11b6e..be3890c0f0 100644
--- a/core/input/input_map.cpp
+++ b/core/input/input_map.cpp
@@ -257,7 +257,7 @@ void InputMap::load_from_project_settings() {
String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
- Dictionary action = ProjectSettings::get_singleton()->get(pi.name);
+ Dictionary action = GLOBAL_GET(pi.name);
float deadzone = action.has("deadzone") ? (float)action["deadzone"] : 0.5f;
Array events = action["events"];
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 2fb357b520..10c794c564 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -914,7 +914,7 @@ void ResourceLoader::load_translation_remaps() {
return;
}
- Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps");
+ Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps");
List<Variant> keys;
remaps.get_key_list(&keys);
for (const Variant &E : keys) {
@@ -941,7 +941,7 @@ void ResourceLoader::load_path_remaps() {
return;
}
- Vector<String> remaps = ProjectSettings::get_singleton()->get("path_remap/remapped_paths");
+ Vector<String> remaps = GLOBAL_GET("path_remap/remapped_paths");
int rc = remaps.size();
ERR_FAIL_COND(rc & 1); //must be even
const String *r = remaps.ptr();
diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp
index 9e26289e66..056c57a5f1 100644
--- a/core/object/script_language.cpp
+++ b/core/object/script_language.cpp
@@ -184,10 +184,10 @@ void ScriptServer::unregister_language(const ScriptLanguage *p_language) {
}
void ScriptServer::init_languages() {
- { //load global classes
+ { // Load global classes.
global_classes_clear();
if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) {
- Array script_classes = ProjectSettings::get_singleton()->get("_global_script_classes");
+ Array script_classes = GLOBAL_GET("_global_script_classes");
for (int i = 0; i < script_classes.size(); i++) {
Dictionary c = script_classes[i];
@@ -305,7 +305,7 @@ void ScriptServer::save_global_classes() {
Array old;
if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) {
- old = ProjectSettings::get_singleton()->get("_global_script_classes");
+ old = GLOBAL_GET("_global_script_classes");
}
if ((!old.is_empty() || gcarr.is_empty()) && gcarr.hash() == old.hash()) {
return;
diff --git a/core/string/translation.cpp b/core/string/translation.cpp
index 9ee7f2b17b..1f5c84c321 100644
--- a/core/string/translation.cpp
+++ b/core/string/translation.cpp
@@ -628,7 +628,7 @@ TranslationServer *TranslationServer::singleton = nullptr;
bool TranslationServer::_load_translations(const String &p_from) {
if (ProjectSettings::get_singleton()->has_setting(p_from)) {
- const Vector<String> &translation_names = ProjectSettings::get_singleton()->get(p_from);
+ const Vector<String> &translation_names = GLOBAL_GET(p_from);
int tcount = translation_names.size();