From e2459479dea6a853bc180b182f1817ede4baa611 Mon Sep 17 00:00:00 2001 From: merumelu Date: Fri, 30 Aug 2019 19:02:46 +0200 Subject: Editor: remove TOOLS_ENABLED guards For code inside editor/ `#ifdef TOOLS_ENABLED` is always true so those checks are redundant. --- editor/collada/collada.cpp | 4 ---- editor/collada/collada.h | 4 ---- editor/editor_inspector.cpp | 12 ------------ editor/editor_properties.cpp | 3 +-- editor/editor_properties_array_dict.cpp | 6 ------ editor/plugins/script_text_editor.cpp | 10 ---------- editor/plugins/spatial_editor_plugin.cpp | 8 -------- 7 files changed, 1 insertion(+), 46 deletions(-) (limited to 'editor') diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index aea7f461f1..1bb49a4167 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -28,8 +28,6 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifdef TOOLS_ENABLED - #include "collada.h" #include @@ -2576,5 +2574,3 @@ Error Collada::load(const String &p_path, int p_flags) { Collada::Collada() { } - -#endif diff --git a/editor/collada/collada.h b/editor/collada/collada.h index 9ed62b46b7..317c3f1d37 100644 --- a/editor/collada/collada.h +++ b/editor/collada/collada.h @@ -28,8 +28,6 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifdef TOOLS_ENABLED - #ifndef COLLADA_H #define COLLADA_H @@ -647,5 +645,3 @@ private: // private stuff }; #endif // COLLADA_H - -#endif diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 8b3e108690..a76d34e122 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1044,7 +1044,6 @@ void EditorInspectorSection::_notification(int p_what) { Ref font = get_font("font", "Tree"); Ref arrow; -#ifdef TOOLS_ENABLED if (foldable) { if (object->editor_is_section_unfolded(section)) { arrow = get_icon("arrow_up", "Tree"); @@ -1052,7 +1051,6 @@ void EditorInspectorSection::_notification(int p_what) { arrow = get_icon("arrow", "Tree"); } } -#endif Size2 size = get_size(); Point2 offset; @@ -1087,7 +1085,6 @@ void EditorInspectorSection::_notification(int p_what) { Ref arrow; -#ifdef TOOLS_ENABLED if (foldable) { if (object->editor_is_section_unfolded(section)) { arrow = get_icon("arrow_up", "Tree"); @@ -1095,7 +1092,6 @@ void EditorInspectorSection::_notification(int p_what) { arrow = get_icon("arrow", "Tree"); } } -#endif Ref font = get_font("font", "Tree"); @@ -1155,7 +1151,6 @@ void EditorInspectorSection::setup(const String &p_section, const String &p_labe vbox_added = true; } -#ifdef TOOLS_ENABLED if (foldable) { _test_unfold(); if (object->editor_is_section_unfolded(section)) { @@ -1164,7 +1159,6 @@ void EditorInspectorSection::setup(const String &p_section, const String &p_labe vbox->hide(); } } -#endif } void EditorInspectorSection::_gui_input(const Ref &p_event) { @@ -1172,7 +1166,6 @@ void EditorInspectorSection::_gui_input(const Ref &p_event) { if (!foldable) return; -#ifdef TOOLS_ENABLED Ref mb = p_event; if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { @@ -1191,7 +1184,6 @@ void EditorInspectorSection::_gui_input(const Ref &p_event) { vbox->hide(); } } -#endif } VBoxContainer *EditorInspectorSection::get_vbox() { @@ -1205,11 +1197,9 @@ void EditorInspectorSection::unfold() { _test_unfold(); -#ifdef TOOLS_ENABLED object->editor_set_section_unfold(section, true); vbox->show(); update(); -#endif } void EditorInspectorSection::fold() { @@ -1219,11 +1209,9 @@ void EditorInspectorSection::fold() { if (!vbox_added) return; //kinda pointless -#ifdef TOOLS_ENABLED object->editor_set_section_unfold(section, false); vbox->hide(); update(); -#endif } void EditorInspectorSection::_bind_methods() { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 378dd34e39..d7b3c7733b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2540,7 +2540,7 @@ void EditorPropertyResource::update_property() { if (res.is_valid() != assign->is_toggle_mode()) { assign->set_toggle_mode(res.is_valid()); } -#ifdef TOOLS_ENABLED + if (res.is_valid() && get_edited_object()->editor_is_section_unfolded(get_edited_property())) { if (!sub_inspector) { @@ -2609,7 +2609,6 @@ void EditorPropertyResource::update_property() { } } } -#endif } preview->set_texture(Ref()); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index d1371a04b1..ff19be8bd5 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -271,8 +271,6 @@ void EditorPropertyArray::update_property() { edit->set_text(arrtype + " (size " + itos(array.call("size")) + ")"); -#ifdef TOOLS_ENABLED - bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); if (edit->is_pressed() != unfolded) { edit->set_pressed(unfolded); @@ -397,7 +395,6 @@ void EditorPropertyArray::update_property() { vbox = NULL; } } -#endif } void EditorPropertyArray::_remove_pressed(int p_index) { @@ -643,8 +640,6 @@ void EditorPropertyDictionary::update_property() { edit->set_text("Dictionary (size " + itos(dict.size()) + ")"); -#ifdef TOOLS_ENABLED - bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); if (edit->is_pressed() != unfolded) { edit->set_pressed(unfolded); @@ -959,7 +954,6 @@ void EditorPropertyDictionary::update_property() { vbox = NULL; } } -#endif } void EditorPropertyDictionary::_object_id_selected(const String &p_property, ObjectID p_id) { diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index bded590351..edc454ad1c 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1436,8 +1436,6 @@ bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_ return false; } -#ifdef TOOLS_ENABLED - static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref