summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-06 21:51:36 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-07 11:50:40 +0100
commitf3726ee99488695c4aae22fffd3649499b285faf (patch)
tree72c94797816a2f3da5ad4cb59a177ec74674a357 /editor
parentb7297fb39ca7a55390f9390666bd29803adc827f (diff)
Use modules_enabled.gen.h to improve inter dependency checks
- Fix build with gdscript module disabled. Fixes #31011. - Remove unused `gdscript` compile option. - Fix build with regex module disabled. - Fix ImageLoaderSVG to forward declare thirdparty structs.
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_themes.cpp6
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp1
-rw-r--r--editor/plugin_config_dialog.cpp14
3 files changed, 19 insertions, 2 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 8037045e77..28bc20a957 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -35,7 +35,11 @@
#include "editor_icons.gen.h"
#include "editor_scale.h"
#include "editor_settings.h"
+
+#include "modules/modules_enabled.gen.h"
+#ifdef MODULE_SVG_ENABLED
#include "modules/svg/image_loader_svg.h"
+#endif
static Ref<StyleBoxTexture> make_stylebox(Ref<Texture> p_texture, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
Ref<StyleBoxTexture> style(memnew(StyleBoxTexture));
@@ -109,7 +113,7 @@ Ref<ImageTexture> editor_generate_icon(int p_index, bool p_convert_color, float
void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = true, int p_thumb_size = 32, bool p_only_thumbs = false) {
-#ifdef SVG_ENABLED
+#ifdef MODULE_SVG_ENABLED
// The default icon theme is designed to be used for a dark theme.
// This dictionary stores color codes to convert to other colors
// for better readability on a light theme.
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index fc9c877ac7..d4664e1bb9 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "editor_scene_importer_gltf.h"
+
#include "core/crypto/crypto_core.h"
#include "core/io/json.h"
#include "core/math/disjoint_set.h"
diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp
index 07b87633a9..1506ba319c 100644
--- a/editor/plugin_config_dialog.cpp
+++ b/editor/plugin_config_dialog.cpp
@@ -35,9 +35,13 @@
#include "editor/editor_plugin.h"
#include "editor/editor_scale.h"
#include "editor/project_settings_editor.h"
-#include "modules/gdscript/gdscript.h"
#include "scene/gui/grid_container.h"
+#include "modules/modules_enabled.gen.h"
+#ifdef MODULE_GDSCRIPT_ENABLED
+#include "modules/gdscript/gdscript.h"
+#endif
+
void PluginConfigDialog::_clear_fields() {
name_edit->set_text("");
subfolder_edit->set_text("");
@@ -75,6 +79,9 @@ void PluginConfigDialog::_on_confirmed() {
// TODO Use script templates. Right now, this code won't add the 'tool' annotation to other languages.
// TODO Better support script languages with named classes (has_named_classes).
+ // FIXME: It's hacky to have hardcoded access to the GDScript module here.
+ // The editor code should not have to know what languages are enabled.
+#ifdef MODULE_GDSCRIPT_ENABLED
if (lang_name == GDScriptLanguage::get_singleton()->get_name()) {
// Hard-coded GDScript template to keep usability until we use script templates.
Ref<Script> gdscript = memnew(GDScript);
@@ -95,12 +102,15 @@ void PluginConfigDialog::_on_confirmed() {
ResourceSaver::save(script_path, gdscript);
script = gdscript;
} else {
+#endif
String script_path = path.plus_file(script_edit->get_text());
String class_name = script_path.get_file().get_basename();
script = ScriptServer::get_language(lang_idx)->get_template(class_name, "EditorPlugin");
script->set_path(script_path);
ResourceSaver::save(script_path, script);
+#ifdef MODULE_GDSCRIPT_ENABLED
}
+#endif
emit_signal("plugin_ready", script.operator->(), active_edit->is_pressed() ? subfolder_edit->get_text() : "");
} else {
@@ -229,9 +239,11 @@ PluginConfigDialog::PluginConfigDialog() {
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
ScriptLanguage *lang = ScriptServer::get_language(i);
script_option_edit->add_item(lang->get_name());
+#ifdef MODULE_GDSCRIPT_ENABLED
if (lang == GDScriptLanguage::get_singleton()) {
default_lang = i;
}
+#endif
}
script_option_edit->select(default_lang);
grid->add_child(script_option_edit);