Browse Source

Merge pull request #104130 from KoBeWi/are_tools_enabled_when_tools_are_enabled

Remove `TOOLS_ENABLED` checks from `editor/`
Thaddeus Crews 5 months ago
parent
commit
a9065db5ad
34 changed files with 7 additions and 124 deletions
  1. 0 2
      editor/editor_interface.cpp
  2. 0 2
      editor/editor_interface.h
  3. 0 2
      editor/editor_settings.cpp
  4. 0 2
      editor/editor_settings.h
  5. 0 2
      editor/import/resource_importer_texture.cpp
  6. 0 2
      editor/plugins/camera_2d_editor_plugin.cpp
  7. 2 10
      editor/plugins/skeleton_3d_editor_plugin.cpp
  8. 0 4
      modules/csg/editor/csg_gizmos.cpp
  9. 0 4
      modules/csg/editor/csg_gizmos.h
  10. 0 4
      modules/fbx/editor/editor_scene_importer_fbx2gltf.cpp
  11. 0 4
      modules/fbx/editor/editor_scene_importer_fbx2gltf.h
  12. 0 4
      modules/fbx/editor/editor_scene_importer_ufbx.cpp
  13. 0 3
      modules/fbx/editor/editor_scene_importer_ufbx.h
  14. 0 4
      modules/gltf/editor/editor_import_blend_runner.cpp
  15. 0 4
      modules/gltf/editor/editor_import_blend_runner.h
  16. 0 4
      modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp
  17. 0 4
      modules/gltf/editor/editor_scene_exporter_gltf_plugin.h
  18. 0 4
      modules/gltf/editor/editor_scene_exporter_gltf_settings.h
  19. 0 4
      modules/gltf/editor/editor_scene_importer_blend.cpp
  20. 0 4
      modules/gltf/editor/editor_scene_importer_blend.h
  21. 0 4
      modules/gltf/editor/editor_scene_importer_gltf.cpp
  22. 0 4
      modules/gltf/editor/editor_scene_importer_gltf.h
  23. 0 4
      modules/gridmap/editor/grid_map_editor_plugin.cpp
  24. 0 4
      modules/gridmap/editor/grid_map_editor_plugin.h
  25. 1 1
      modules/mono/editor/bindings_generator.cpp
  26. 1 1
      modules/mono/editor/bindings_generator.h
  27. 0 8
      modules/mono/editor/editor_internal_calls.cpp
  28. 0 4
      modules/navigation/editor/navigation_mesh_editor_plugin.cpp
  29. 0 4
      modules/navigation/editor/navigation_mesh_editor_plugin.h
  30. 3 1
      modules/noise/SCsub
  31. 0 4
      modules/noise/editor/noise_editor_plugin.cpp
  32. 0 4
      modules/noise/editor/noise_editor_plugin.h
  33. 0 4
      modules/websocket/editor/editor_debugger_server_websocket.cpp
  34. 0 4
      modules/websocket/editor/editor_debugger_server_websocket.h

+ 0 - 2
editor/editor_interface.cpp

@@ -747,7 +747,6 @@ bool EditorInterface::is_movie_maker_enabled() const {
 	return EditorRunBar::get_singleton()->is_movie_maker_enabled();
 }
 
-#ifdef TOOLS_ENABLED
 void EditorInterface::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
 	const String pf = p_function;
 	if (p_idx == 0) {
@@ -763,7 +762,6 @@ void EditorInterface::get_argument_options(const StringName &p_function, int p_i
 	}
 	Object::get_argument_options(p_function, p_idx, r_options);
 }
-#endif
 
 // Base.
 

+ 0 - 2
editor/editor_interface.h

@@ -190,9 +190,7 @@ public:
 	void set_movie_maker_enabled(bool p_enabled);
 	bool is_movie_maker_enabled() const;
 
-#ifdef TOOLS_ENABLED
 	virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
-#endif
 
 	// Base.
 	static void create();

+ 0 - 2
editor/editor_settings.cpp

@@ -2122,7 +2122,6 @@ void EditorSettings::notify_changes() {
 	root->propagate_notification(NOTIFICATION_EDITOR_SETTINGS_CHANGED);
 }
 
-#ifdef TOOLS_ENABLED
 void EditorSettings::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
 	const String pf = p_function;
 	if (p_idx == 0) {
@@ -2149,7 +2148,6 @@ void EditorSettings::get_argument_options(const StringName &p_function, int p_id
 	}
 	Object::get_argument_options(p_function, p_idx, r_options);
 }
-#endif
 
 void EditorSettings::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("has_setting", "name"), &EditorSettings::has_setting);

+ 0 - 2
editor/editor_settings.h

@@ -204,9 +204,7 @@ public:
 
 	void notify_changes();
 
-#ifdef TOOLS_ENABLED
 	virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
-#endif
 
 	EditorSettings();
 };

+ 0 - 2
editor/import/resource_importer_texture.cpp

@@ -83,9 +83,7 @@ void ResourceImporterTexture::_texture_reimport_normal(const Ref<CompressedTextu
 }
 
 inline void ResourceImporterTexture::_print_callback_message(const String &p_message) {
-#ifdef TOOLS_ENABLED
 	EditorToaster::get_singleton()->popup_str(p_message);
-#endif
 	print_line(p_message);
 }
 

+ 0 - 2
editor/plugins/camera_2d_editor_plugin.cpp

@@ -100,9 +100,7 @@ Camera2DEditor::Camera2DEditor() {
 
 	options->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &Camera2DEditor::_menu_option));
 
-#ifdef TOOLS_ENABLED
 	add_user_signal(MethodInfo("_editor_theme_changed"));
-#endif
 }
 
 void Camera2DEditorPlugin::_update_approach_text_visibility() {

+ 2 - 10
editor/plugins/skeleton_3d_editor_plugin.cpp

@@ -1121,12 +1121,11 @@ void Skeleton3DEditor::_notification(int p_what) {
 			joint_tree->connect(SceneStringName(item_selected), callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed));
 			joint_tree->connect("item_mouse_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select));
 			joint_tree->connect("button_clicked", callable_mp(this, &Skeleton3DEditor::_joint_tree_button_clicked));
-#ifdef TOOLS_ENABLED
+
 			skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
 			skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_update_properties));
 			skeleton->connect(SceneStringName(bone_enabled_changed), callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
 			skeleton->connect(SceneStringName(show_rest_only_changed), callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
-#endif
 
 			get_tree()->connect("node_removed", callable_mp(this, &Skeleton3DEditor::_node_removed), Object::CONNECT_ONE_SHOT);
 		} break;
@@ -1149,13 +1148,12 @@ void Skeleton3DEditor::_notification(int p_what) {
 		case NOTIFICATION_PREDELETE: {
 			if (skeleton) {
 				select_bone(-1); // Requires that the joint_tree has not been deleted.
-#ifdef TOOLS_ENABLED
 				skeleton->disconnect(SceneStringName(show_rest_only_changed), callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
 				skeleton->disconnect(SceneStringName(bone_enabled_changed), callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
 				skeleton->disconnect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
 				skeleton->disconnect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_update_properties));
 				skeleton->set_transform_gizmo_visible(true);
-#endif
+
 				if (handles_mesh_instance->get_parent()) {
 					handles_mesh_instance->get_parent()->remove_child(handles_mesh_instance);
 				}
@@ -1437,22 +1435,16 @@ void Skeleton3DEditor::_update_gizmo_visible() {
 	_subgizmo_selection_change();
 	if (edit_mode) {
 		if (selected_bone == -1) {
-#ifdef TOOLS_ENABLED
 			skeleton->set_transform_gizmo_visible(false);
-#endif
 		} else {
-#ifdef TOOLS_ENABLED
 			if (skeleton->is_bone_enabled(selected_bone) && !skeleton->is_show_rest_only()) {
 				skeleton->set_transform_gizmo_visible(true);
 			} else {
 				skeleton->set_transform_gizmo_visible(false);
 			}
-#endif
 		}
 	} else {
-#ifdef TOOLS_ENABLED
 		skeleton->set_transform_gizmo_visible(true);
-#endif
 	}
 	_draw_gizmo();
 }

+ 0 - 4
modules/csg/editor/csg_gizmos.cpp

@@ -30,8 +30,6 @@
 
 #include "csg_gizmos.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/editor_node.h"
 #include "editor/editor_settings.h"
 #include "editor/editor_undo_redo_manager.h"
@@ -508,5 +506,3 @@ EditorPluginCSG::EditorPluginCSG() {
 	csg_shape_editor = memnew(CSGShapeEditor);
 	EditorNode::get_singleton()->get_gui_base()->add_child(csg_shape_editor);
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/csg/editor/csg_gizmos.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "../csg_shape.h"
 
 #include "editor/plugins/editor_plugin.h"
@@ -103,5 +101,3 @@ public:
 
 	EditorPluginCSG();
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/fbx/editor/editor_scene_importer_fbx2gltf.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_scene_importer_fbx2gltf.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "core/config/project_settings.h"
 #include "editor/editor_settings.h"
 #include "editor_scene_importer_ufbx.h"
@@ -142,5 +140,3 @@ void EditorSceneFormatImporterFBX2GLTF::handle_compatibility_options(HashMap<Str
 		p_import_params["fbx/importer"] = EditorSceneFormatImporterUFBX::FBX_IMPORTER_UFBX;
 	}
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/fbx/editor/editor_scene_importer_fbx2gltf.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/import/3d/resource_importer_scene.h"
 
 class Animation;
@@ -51,5 +49,3 @@ public:
 			const HashMap<StringName, Variant> &p_options) override;
 	virtual void handle_compatibility_options(HashMap<StringName, Variant> &p_import_params) const override;
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/fbx/editor/editor_scene_importer_ufbx.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_scene_importer_ufbx.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "../fbx_document.h"
 #include "editor_scene_importer_fbx2gltf.h"
 
@@ -104,5 +102,3 @@ void EditorSceneFormatImporterUFBX::handle_compatibility_options(HashMap<StringN
 		p_import_params["fbx/importer"] = EditorSceneFormatImporterUFBX::FBX_IMPORTER_FBX2GLTF;
 	}
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 3
modules/fbx/editor/editor_scene_importer_ufbx.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/import/3d/resource_importer_scene.h"
 
 class Animation;
@@ -55,4 +53,3 @@ public:
 			const HashMap<StringName, Variant> &p_options) override;
 	virtual void handle_compatibility_options(HashMap<StringName, Variant> &p_import_params) const override;
 };
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_import_blend_runner.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_import_blend_runner.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "core/io/http_client.h"
 #include "editor/editor_file_system.h"
 #include "editor/editor_node.h"
@@ -392,5 +390,3 @@ EditorImportBlendRunner::EditorImportBlendRunner() {
 
 	EditorFileSystem::get_singleton()->connect("resources_reimported", callable_mp(this, &EditorImportBlendRunner::_resources_reimported));
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_import_blend_runner.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "core/io/http_client.h"
 #include "core/os/os.h"
 #include "scene/main/node.h"
@@ -65,5 +63,3 @@ public:
 
 	EditorImportBlendRunner();
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_scene_exporter_gltf_plugin.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "editor_scene_exporter_gltf_settings.h"
 
 #include "editor/editor_file_system.h"
@@ -118,5 +116,3 @@ void SceneExporterGLTFPlugin::_export_scene_as_gltf(const String &p_file_path) {
 	}
 	EditorFileSystem::get_singleton()->scan_changes();
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_exporter_gltf_plugin.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "../gltf_document.h"
 #include "editor_scene_exporter_gltf_settings.h"
 
@@ -55,5 +53,3 @@ public:
 	bool has_main_screen() const override;
 	SceneExporterGLTFPlugin();
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_exporter_gltf_settings.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "../gltf_document.h"
 
 class EditorSceneExporterGLTFSettings : public RefCounted {
@@ -62,5 +60,3 @@ public:
 	double get_bake_fps() const;
 	void set_bake_fps(const double p_bake_fps);
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_importer_blend.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_scene_importer_blend.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "../gltf_defines.h"
 #include "../gltf_document.h"
 #include "editor_import_blend_runner.h"
@@ -598,5 +596,3 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() {
 
 EditorFileSystemImportFormatSupportQueryBlend::EditorFileSystemImportFormatSupportQueryBlend() {
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_importer_blend.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/editor_file_system.h"
 #include "editor/import/3d/resource_importer_scene.h"
 
@@ -110,5 +108,3 @@ public:
 
 	EditorFileSystemImportFormatSupportQueryBlend();
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_importer_gltf.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_scene_importer_gltf.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "../gltf_defines.h"
 #include "../gltf_document.h"
 
@@ -103,5 +101,3 @@ Variant EditorSceneFormatImporterGLTF::get_option_visibility(const String &p_pat
 		const String &p_option, const HashMap<StringName, Variant> &p_options) {
 	return true;
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gltf/editor/editor_scene_importer_gltf.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/import/3d/resource_importer_scene.h"
 
 class Animation;
@@ -51,5 +49,3 @@ public:
 	virtual Variant get_option_visibility(const String &p_path, const String &p_scene_import_type,
 			const String &p_option, const HashMap<StringName, Variant> &p_options) override;
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gridmap/editor/grid_map_editor_plugin.cpp

@@ -30,8 +30,6 @@
 
 #include "grid_map_editor_plugin.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "core/os/keyboard.h"
 #include "editor/editor_command_palette.h"
 #include "editor/editor_main_screen.h"
@@ -1883,5 +1881,3 @@ GridMapEditorPlugin::GridMapEditorPlugin() {
 
 GridMapEditorPlugin::~GridMapEditorPlugin() {
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/gridmap/editor/grid_map_editor_plugin.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "../grid_map.h"
 
 #include "editor/plugins/editor_plugin.h"
@@ -298,5 +296,3 @@ public:
 	GridMapEditorPlugin();
 	~GridMapEditorPlugin();
 };
-
-#endif // TOOLS_ENABLED

+ 1 - 1
modules/mono/editor/bindings_generator.cpp

@@ -30,7 +30,7 @@
 
 #include "bindings_generator.h"
 
-#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
+#ifdef DEBUG_METHODS_ENABLED
 
 #include "../godotsharp_defs.h"
 #include "../utils/naming_utils.h"

+ 1 - 1
modules/mono/editor/bindings_generator.h

@@ -32,7 +32,7 @@
 
 #include "core/typedefs.h" // DEBUG_METHODS_ENABLED
 
-#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
+#ifdef DEBUG_METHODS_ENABLED
 
 #include "core/doc_data.h"
 #include "core/object/class_db.h"

+ 0 - 8
modules/mono/editor/editor_internal_calls.cpp

@@ -68,19 +68,11 @@ void godot_icall_GodotSharpDirs_MonoUserDir(godot_string *r_dest) {
 }
 
 void godot_icall_GodotSharpDirs_BuildLogsDirs(godot_string *r_dest) {
-#ifdef TOOLS_ENABLED
 	memnew_placement(r_dest, String(GodotSharpDirs::get_build_logs_dir()));
-#else
-	return nullptr;
-#endif
 }
 
 void godot_icall_GodotSharpDirs_DataEditorToolsDir(godot_string *r_dest) {
-#ifdef TOOLS_ENABLED
 	memnew_placement(r_dest, String(GodotSharpDirs::get_data_editor_tools_dir()));
-#else
-	return nullptr;
-#endif
 }
 
 void godot_icall_GodotSharpDirs_CSharpProjectName(godot_string *r_dest) {

+ 0 - 4
modules/navigation/editor/navigation_mesh_editor_plugin.cpp

@@ -30,8 +30,6 @@
 
 #include "navigation_mesh_editor_plugin.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/editor_node.h"
 #include "editor/editor_string_names.h"
 #include "scene/3d/navigation_region_3d.h"
@@ -181,5 +179,3 @@ NavigationMeshEditorPlugin::NavigationMeshEditorPlugin() {
 
 NavigationMeshEditorPlugin::~NavigationMeshEditorPlugin() {
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/navigation/editor/navigation_mesh_editor_plugin.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/plugins/editor_plugin.h"
 
 class AcceptDialog;
@@ -82,5 +80,3 @@ public:
 	NavigationMeshEditorPlugin();
 	~NavigationMeshEditorPlugin();
 };
-
-#endif // TOOLS_ENABLED

+ 3 - 1
modules/noise/SCsub

@@ -14,5 +14,7 @@ env_noise.Prepend(CPPPATH=[thirdparty_dir])
 module_obj = []
 
 env_noise.add_source_files(module_obj, "*.cpp")
-env_noise.add_source_files(module_obj, "editor/*.cpp")
+if env.editor_build:
+    env_noise.add_source_files(module_obj, "editor/*.cpp")
+
 env.modules_sources += module_obj

+ 0 - 4
modules/noise/editor/noise_editor_plugin.cpp

@@ -30,8 +30,6 @@
 
 #include "noise_editor_plugin.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "../noise.h"
 #include "../noise_texture_2d.h"
 
@@ -148,5 +146,3 @@ NoiseEditorPlugin::NoiseEditorPlugin() {
 	plugin.instantiate();
 	add_inspector_plugin(plugin);
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/noise/editor/noise_editor_plugin.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "editor/plugins/editor_plugin.h"
 
 class NoiseEditorPlugin : public EditorPlugin {
@@ -42,5 +40,3 @@ public:
 
 	NoiseEditorPlugin();
 };
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/websocket/editor/editor_debugger_server_websocket.cpp

@@ -30,8 +30,6 @@
 
 #include "editor_debugger_server_websocket.h"
 
-#ifdef TOOLS_ENABLED
-
 #include "../remote_debugger_peer_websocket.h"
 
 #include "editor/editor_log.h"
@@ -135,5 +133,3 @@ EditorDebuggerServer *EditorDebuggerServerWebSocket::create(const String &p_prot
 	ERR_FAIL_COND_V(p_protocol != "ws://", nullptr);
 	return memnew(EditorDebuggerServerWebSocket);
 }
-
-#endif // TOOLS_ENABLED

+ 0 - 4
modules/websocket/editor/editor_debugger_server_websocket.h

@@ -30,8 +30,6 @@
 
 #pragma once
 
-#ifdef TOOLS_ENABLED
-
 #include "../websocket_peer.h"
 
 #include "core/io/tcp_server.h"
@@ -63,5 +61,3 @@ public:
 	EditorDebuggerServerWebSocket();
 	~EditorDebuggerServerWebSocket();
 };
-
-#endif // TOOLS_ENABLED