summaryrefslogtreecommitdiff
path: root/editor/editor_autoload_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_autoload_settings.cpp')
-rw-r--r--editor/editor_autoload_settings.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index b83ac69141..399c22bf2c 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -30,7 +30,7 @@
#include "editor_autoload_settings.h"
#include "editor_node.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "global_constants.h"
#define PREVIEW_LIST_MAX_SIZE 10
@@ -115,12 +115,12 @@ void EditorAutoloadSettings::_autoload_add() {
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
undo_redo->create_action(TTR("Add AutoLoad"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, "*" + path);
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, "*" + path);
- if (GlobalConfig::get_singleton()->has(name)) {
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
+ if (ProjectSettings::get_singleton()->has(name)) {
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name));
} else {
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant());
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, Variant());
}
undo_redo->add_do_method(this, "update_autoload");
@@ -169,7 +169,7 @@ void EditorAutoloadSettings::_autoload_edited() {
return;
}
- if (GlobalConfig::get_singleton()->has("autoload/" + name)) {
+ if (ProjectSettings::get_singleton()->has("autoload/" + name)) {
ti->set_text(0, old_name);
EditorNode::get_singleton()->show_warning(vformat(TTR("Autoload '%s' already exists!"), name));
return;
@@ -179,18 +179,18 @@ void EditorAutoloadSettings::_autoload_edited() {
name = "autoload/" + name;
- int order = GlobalConfig::get_singleton()->get_order(selected_autoload);
- String path = GlobalConfig::get_singleton()->get(selected_autoload);
+ int order = ProjectSettings::get_singleton()->get_order(selected_autoload);
+ String path = ProjectSettings::get_singleton()->get(selected_autoload);
undo_redo->create_action(TTR("Rename Autoload"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, path);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, order);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "clear", selected_autoload);
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, path);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", selected_autoload);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), selected_autoload, path);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", selected_autoload, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "clear", name);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), selected_autoload, path);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", selected_autoload, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -207,8 +207,8 @@ void EditorAutoloadSettings::_autoload_edited() {
bool checked = ti->is_checked(2);
String base = "autoload/" + ti->get_text(0);
- int order = GlobalConfig::get_singleton()->get_order(base);
- String path = GlobalConfig::get_singleton()->get(base);
+ int order = ProjectSettings::get_singleton()->get_order(base);
+ String path = ProjectSettings::get_singleton()->get(base);
if (path.begins_with("*"))
path = path.substr(1, path.length());
@@ -218,11 +218,11 @@ void EditorAutoloadSettings::_autoload_edited() {
undo_redo->create_action(TTR("Toggle AutoLoad Globals"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), base, path);
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), base, GlobalConfig::get_singleton()->get(base));
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), base, path);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), base, ProjectSettings::get_singleton()->get(base));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", base, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", base, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", base, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", base, order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -262,16 +262,16 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
String swap_name = "autoload/" + swap->get_text(0);
- int order = GlobalConfig::get_singleton()->get_order(name);
- int swap_order = GlobalConfig::get_singleton()->get_order(swap_name);
+ int order = ProjectSettings::get_singleton()->get_order(name);
+ int swap_order = ProjectSettings::get_singleton()->get_order(swap_name);
undo_redo->create_action(TTR("Move Autoload"));
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, swap_order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", name, swap_order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", name, order);
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", swap_name, order);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", swap_name, swap_order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", swap_name, order);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", swap_name, swap_order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -283,15 +283,15 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
} break;
case BUTTON_DELETE: {
- int order = GlobalConfig::get_singleton()->get_order(name);
+ int order = ProjectSettings::get_singleton()->get_order(name);
undo_redo->create_action(TTR("Remove Autoload"));
- undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant());
+ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, Variant());
- undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_persisting", name, true);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", order);
+ undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name));
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_persisting", name, true);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -322,7 +322,7 @@ void EditorAutoloadSettings::update_autoload() {
TreeItem *root = tree->create_item();
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()) {
@@ -332,14 +332,14 @@ void EditorAutoloadSettings::update_autoload() {
continue;
String name = pi.name.get_slice("/", 1);
- String path = GlobalConfig::get_singleton()->get(pi.name);
+ String path = ProjectSettings::get_singleton()->get(pi.name);
if (name.empty())
continue;
AutoLoadInfo info;
info.name = pi.name;
- info.order = GlobalConfig::get_singleton()->get_order(pi.name);
+ info.order = ProjectSettings::get_singleton()->get_order(pi.name);
autoload_cache.push_back(info);
@@ -459,7 +459,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
move_to_back = true;
}
- int order = GlobalConfig::get_singleton()->get_order("autoload/" + name);
+ int order = ProjectSettings::get_singleton()->get_order("autoload/" + name);
AutoLoadInfo aux;
List<AutoLoadInfo>::Element *E = NULL;
@@ -476,7 +476,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
orders.resize(autoload_cache.size());
for (int i = 0; i < autoloads.size(); i++) {
- aux.order = GlobalConfig::get_singleton()->get_order("autoload/" + autoloads[i]);
+ aux.order = ProjectSettings::get_singleton()->get_order("autoload/" + autoloads[i]);
List<AutoLoadInfo>::Element *I = autoload_cache.find(aux);
@@ -506,8 +506,8 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
i = 0;
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
- undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", E->get().name, orders[i++]);
- undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", E->get().name, E->get().order);
+ undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", E->get().name, orders[i++]);
+ undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", E->get().name, E->get().order);
}
orders.clear();