Skip to content

Commit a9065db

Browse files
committed
Merge pull request #104130 from KoBeWi/are_tools_enabled_when_tools_are_enabled
Remove `TOOLS_ENABLED` checks from `editor/`
2 parents 235b712 + 7cb2fb1 commit a9065db

34 files changed

+7
-124
lines changed

editor/editor_interface.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ bool EditorInterface::is_movie_maker_enabled() const {
747747
return EditorRunBar::get_singleton()->is_movie_maker_enabled();
748748
}
749749

750-
#ifdef TOOLS_ENABLED
751750
void EditorInterface::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
752751
const String pf = p_function;
753752
if (p_idx == 0) {
@@ -763,7 +762,6 @@ void EditorInterface::get_argument_options(const StringName &p_function, int p_i
763762
}
764763
Object::get_argument_options(p_function, p_idx, r_options);
765764
}
766-
#endif
767765

768766
// Base.
769767

editor/editor_interface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ class EditorInterface : public Object {
190190
void set_movie_maker_enabled(bool p_enabled);
191191
bool is_movie_maker_enabled() const;
192192

193-
#ifdef TOOLS_ENABLED
194193
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
195-
#endif
196194

197195
// Base.
198196
static void create();

editor/editor_settings.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,6 @@ void EditorSettings::notify_changes() {
21222122
root->propagate_notification(NOTIFICATION_EDITOR_SETTINGS_CHANGED);
21232123
}
21242124

2125-
#ifdef TOOLS_ENABLED
21262125
void EditorSettings::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
21272126
const String pf = p_function;
21282127
if (p_idx == 0) {
@@ -2149,7 +2148,6 @@ void EditorSettings::get_argument_options(const StringName &p_function, int p_id
21492148
}
21502149
Object::get_argument_options(p_function, p_idx, r_options);
21512150
}
2152-
#endif
21532151

21542152
void EditorSettings::_bind_methods() {
21552153
ClassDB::bind_method(D_METHOD("has_setting", "name"), &EditorSettings::has_setting);

editor/editor_settings.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ class EditorSettings : public Resource {
204204

205205
void notify_changes();
206206

207-
#ifdef TOOLS_ENABLED
208207
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
209-
#endif
210208

211209
EditorSettings();
212210
};

editor/import/resource_importer_texture.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ void ResourceImporterTexture::_texture_reimport_normal(const Ref<CompressedTextu
8383
}
8484

8585
inline void ResourceImporterTexture::_print_callback_message(const String &p_message) {
86-
#ifdef TOOLS_ENABLED
8786
EditorToaster::get_singleton()->popup_str(p_message);
88-
#endif
8987
print_line(p_message);
9088
}
9189

editor/plugins/camera_2d_editor_plugin.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ Camera2DEditor::Camera2DEditor() {
100100

101101
options->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &Camera2DEditor::_menu_option));
102102

103-
#ifdef TOOLS_ENABLED
104103
add_user_signal(MethodInfo("_editor_theme_changed"));
105-
#endif
106104
}
107105

108106
void Camera2DEditorPlugin::_update_approach_text_visibility() {

editor/plugins/skeleton_3d_editor_plugin.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,12 +1121,11 @@ void Skeleton3DEditor::_notification(int p_what) {
11211121
joint_tree->connect(SceneStringName(item_selected), callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed));
11221122
joint_tree->connect("item_mouse_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select));
11231123
joint_tree->connect("button_clicked", callable_mp(this, &Skeleton3DEditor::_joint_tree_button_clicked));
1124-
#ifdef TOOLS_ENABLED
1124+
11251125
skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
11261126
skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_update_properties));
11271127
skeleton->connect(SceneStringName(bone_enabled_changed), callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
11281128
skeleton->connect(SceneStringName(show_rest_only_changed), callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
1129-
#endif
11301129

11311130
get_tree()->connect("node_removed", callable_mp(this, &Skeleton3DEditor::_node_removed), Object::CONNECT_ONE_SHOT);
11321131
} break;
@@ -1149,13 +1148,12 @@ void Skeleton3DEditor::_notification(int p_what) {
11491148
case NOTIFICATION_PREDELETE: {
11501149
if (skeleton) {
11511150
select_bone(-1); // Requires that the joint_tree has not been deleted.
1152-
#ifdef TOOLS_ENABLED
11531151
skeleton->disconnect(SceneStringName(show_rest_only_changed), callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
11541152
skeleton->disconnect(SceneStringName(bone_enabled_changed), callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
11551153
skeleton->disconnect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
11561154
skeleton->disconnect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_update_properties));
11571155
skeleton->set_transform_gizmo_visible(true);
1158-
#endif
1156+
11591157
if (handles_mesh_instance->get_parent()) {
11601158
handles_mesh_instance->get_parent()->remove_child(handles_mesh_instance);
11611159
}
@@ -1437,22 +1435,16 @@ void Skeleton3DEditor::_update_gizmo_visible() {
14371435
_subgizmo_selection_change();
14381436
if (edit_mode) {
14391437
if (selected_bone == -1) {
1440-
#ifdef TOOLS_ENABLED
14411438
skeleton->set_transform_gizmo_visible(false);
1442-
#endif
14431439
} else {
1444-
#ifdef TOOLS_ENABLED
14451440
if (skeleton->is_bone_enabled(selected_bone) && !skeleton->is_show_rest_only()) {
14461441
skeleton->set_transform_gizmo_visible(true);
14471442
} else {
14481443
skeleton->set_transform_gizmo_visible(false);
14491444
}
1450-
#endif
14511445
}
14521446
} else {
1453-
#ifdef TOOLS_ENABLED
14541447
skeleton->set_transform_gizmo_visible(true);
1455-
#endif
14561448
}
14571449
_draw_gizmo();
14581450
}

modules/csg/editor/csg_gizmos.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#include "csg_gizmos.h"
3232

33-
#ifdef TOOLS_ENABLED
34-
3533
#include "editor/editor_node.h"
3634
#include "editor/editor_settings.h"
3735
#include "editor/editor_undo_redo_manager.h"
@@ -508,5 +506,3 @@ EditorPluginCSG::EditorPluginCSG() {
508506
csg_shape_editor = memnew(CSGShapeEditor);
509507
EditorNode::get_singleton()->get_gui_base()->add_child(csg_shape_editor);
510508
}
511-
512-
#endif // TOOLS_ENABLED

modules/csg/editor/csg_gizmos.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#pragma once
3232

33-
#ifdef TOOLS_ENABLED
34-
3533
#include "../csg_shape.h"
3634

3735
#include "editor/plugins/editor_plugin.h"
@@ -103,5 +101,3 @@ class EditorPluginCSG : public EditorPlugin {
103101

104102
EditorPluginCSG();
105103
};
106-
107-
#endif // TOOLS_ENABLED

modules/fbx/editor/editor_scene_importer_fbx2gltf.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#include "editor_scene_importer_fbx2gltf.h"
3232

33-
#ifdef TOOLS_ENABLED
34-
3533
#include "core/config/project_settings.h"
3634
#include "editor/editor_settings.h"
3735
#include "editor_scene_importer_ufbx.h"
@@ -142,5 +140,3 @@ void EditorSceneFormatImporterFBX2GLTF::handle_compatibility_options(HashMap<Str
142140
p_import_params["fbx/importer"] = EditorSceneFormatImporterUFBX::FBX_IMPORTER_UFBX;
143141
}
144142
}
145-
146-
#endif // TOOLS_ENABLED

0 commit comments

Comments
 (0)