summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_plugin.cpp11
-rw-r--r--editor/editor_plugin.h3
-rw-r--r--editor/project_settings_editor.cpp11
3 files changed, 24 insertions, 1 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 9dd8a7232f..b1a0efaea6 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -235,6 +235,14 @@ Control *EditorInterface::get_base_control() {
return EditorNode::get_singleton()->get_gui_base();
}
+void EditorInterface::set_plugin_enabled(const String &p_plugin, bool p_enabled) {
+ EditorNode::get_singleton()->set_addon_plugin_enabled(p_plugin, p_enabled);
+}
+
+bool EditorInterface::is_plugin_enabled(const String &p_plugin) const {
+ return EditorNode::get_singleton()->is_addon_plugin_enabled(p_plugin);
+}
+
Error EditorInterface::save_scene() {
if (!get_edited_scene_root())
return ERR_CANT_CREATE;
@@ -271,6 +279,9 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("select_file", "p_file"), &EditorInterface::select_file);
ClassDB::bind_method(D_METHOD("get_selected_path"), &EditorInterface::get_selected_path);
+ ClassDB::bind_method(D_METHOD("set_plugin_enabled", "plugin", "enabled"), &EditorInterface::set_plugin_enabled);
+ ClassDB::bind_method(D_METHOD("is_plugin_enabled", "plugin"), &EditorInterface::is_plugin_enabled);
+
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);
ClassDB::bind_method(D_METHOD("save_scene_as", "path", "with_preview"), &EditorInterface::save_scene_as, DEFVAL(true));
}
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 145dccc2d5..3d585120c0 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -90,6 +90,9 @@ public:
Control *get_base_control();
+ void set_plugin_enabled(const String &p_plugin, bool p_enabled);
+ bool is_plugin_enabled(const String &p_plugin) const;
+
Error save_scene();
void save_scene_as(const String &p_scene, bool p_with_preview = true);
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 704ec40e4c..058f517ae9 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -750,7 +750,16 @@ void ProjectSettingsEditor::_item_add() {
String catname = category->get_text().strip_edges();
String propname = property->get_text().strip_edges();
- String name = catname != "" ? catname + "/" + propname : propname;
+
+ if (propname.empty()) {
+ return;
+ }
+
+ if (catname.empty()) {
+ catname = "global";
+ }
+
+ String name = catname + "/" + propname;
undo_redo->create_action(TTR("Add Global Property"));