diff options
Diffstat (limited to 'editor')
68 files changed, 174 insertions, 386 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 92d53cc005..aab9743c43 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -1122,8 +1122,6 @@ void ActionMapEditor::use_external_search_box(LineEdit *p_searchbox) { } ActionMapEditor::ActionMapEditor() { - show_builtin_actions = false; - // Main Vbox Container VBoxContainer *main_vbox = memnew(VBoxContainer); main_vbox->set_anchors_and_offsets_preset(PRESET_WIDE); diff --git a/editor/action_map_editor.h b/editor/action_map_editor.h index de24d3ee1f..34c70c942e 100644 --- a/editor/action_map_editor.h +++ b/editor/action_map_editor.h @@ -164,7 +164,7 @@ private: // Filtering and Adding actions - bool show_builtin_actions; + bool show_builtin_actions = false; CheckButton *show_builtin_actions_checkbutton; LineEdit *action_list_search; diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index af25403736..e61a1aae9c 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1886,8 +1886,6 @@ void AnimationTimelineEdit::_bind_methods() { } AnimationTimelineEdit::AnimationTimelineEdit() { - use_fps = false; - editing = false; name_limit = 150 * EDSCALE; zoom = nullptr; track_edit = nullptr; @@ -1935,9 +1933,6 @@ AnimationTimelineEdit::AnimationTimelineEdit() { add_track->get_popup()->connect("index_pressed", callable_mp(this, &AnimationTimelineEdit::_track_added)); len_hb->hide(); - dragging_timeline = false; - dragging_hsize = false; - panner.instantiate(); panner->set_callbacks(callable_mp(this, &AnimationTimelineEdit::_scroll_callback), callable_mp(this, &AnimationTimelineEdit::_pan_callback), callable_mp(this, &AnimationTimelineEdit::_zoom_callback)); @@ -3151,13 +3146,8 @@ AnimationTrackEdit::AnimationTrackEdit() { path = nullptr; path_popup = nullptr; menu = nullptr; - clicking_on_name = false; dropping_at = 0; - in_group = false; - - moving_selection_attempt = false; - moving_selection = false; select_single_attempt = -1; play_position_pos = 0; @@ -6316,8 +6306,6 @@ AnimationTrackEditor::AnimationTrackEditor() { add_child(method_selector); method_selector->connect("selected", callable_mp(this, &AnimationTrackEditor::_add_method_key)); - insert_queue = false; - insert_confirm = memnew(ConfirmationDialog); add_child(insert_confirm); insert_confirm->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_confirm_insert_list)); @@ -6335,8 +6323,6 @@ AnimationTrackEditor::AnimationTrackEditor() { insert_confirm_reset->set_text(TTR("Create RESET Track(s)", "")); insert_confirm_reset->set_pressed(EDITOR_GET("editors/animation/default_create_reset_tracks")); ichb->add_child(insert_confirm_reset); - keying = false; - moving_selection = false; key_edit = nullptr; multi_key_edit = nullptr; @@ -6346,7 +6332,6 @@ AnimationTrackEditor::AnimationTrackEditor() { box_selection->set_mouse_filter(MOUSE_FILTER_IGNORE); box_selection->hide(); box_selection->connect("draw", callable_mp(this, &AnimationTrackEditor::_box_selection_draw)); - box_selecting = false; // Default Plugins. @@ -6443,7 +6428,6 @@ AnimationTrackEditor::AnimationTrackEditor() { track_copy_select->set_hide_root(true); track_vbox->add_child(track_copy_select); track_copy_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed), varray(EDIT_COPY_TRACKS_CONFIRM)); - animation_changing_awaiting_update = false; } AnimationTrackEditor::~AnimationTrackEditor() { diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index ab3a6f682a..1baebc469e 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -77,16 +77,16 @@ class AnimationTimelineEdit : public Range { UndoRedo *undo_redo; Rect2 hsize_rect; - bool editing; - bool use_fps; + bool editing = false; + bool use_fps = false; Ref<ViewPanner> panner; void _scroll_callback(Vector2 p_scroll_vec, bool p_alt); void _pan_callback(Vector2 p_scroll_vec); void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt); - bool dragging_timeline; - bool dragging_hsize; + bool dragging_timeline = false; + bool dragging_hsize = false; float dragging_hsize_from; float dragging_hsize_at; @@ -171,7 +171,7 @@ class AnimationTrackEdit : public Control { PopupMenu *menu; - bool clicking_on_name; + bool clicking_on_name = false; void _zoom_changed(); @@ -188,12 +188,12 @@ class AnimationTrackEdit : public Control { mutable int dropping_at; float insert_at_pos; - bool moving_selection_attempt; + bool moving_selection_attempt = false; int select_single_attempt; - bool moving_selection; + bool moving_selection = false; float moving_selection_from_ofs; - bool in_group; + bool in_group = false; AnimationTrackEditor *editor; protected: @@ -312,7 +312,7 @@ class AnimationTrackEditor : public VBoxContainer { Vector<AnimationTrackEdit *> track_edits; Vector<AnimationTrackEditGroup *> groups; - bool animation_changing_awaiting_update; + bool animation_changing_awaiting_update = false; void _animation_update(); int _get_track_selected(); void _animation_changed(); @@ -342,7 +342,7 @@ class AnimationTrackEditor : public VBoxContainer { int adding_track_type; NodePath adding_track_path; - bool keying; + bool keying = false; struct InsertData { Animation::TrackType type; @@ -357,7 +357,7 @@ class AnimationTrackEditor : public VBoxContainer { CheckBox *insert_confirm_bezier; CheckBox *insert_confirm_reset; ConfirmationDialog *insert_confirm; - bool insert_queue; + bool insert_queue = false; List<InsertData> insert_data; void _query_insert(const InsertData &p_id); @@ -412,7 +412,7 @@ class AnimationTrackEditor : public VBoxContainer { void _key_selected(int p_key, bool p_single, int p_track); void _key_deselected(int p_key, int p_track); - bool moving_selection; + bool moving_selection = false; float moving_selection_offset; void _move_selection_begin(); void _move_selection(float p_offset); @@ -427,7 +427,7 @@ class AnimationTrackEditor : public VBoxContainer { Control *box_selection; void _box_selection_draw(); - bool box_selecting; + bool box_selecting = false; Vector2 box_selecting_from; Rect2 box_select_rect; void _scroll_input(const Ref<InputEvent> &p_event); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 9fd42a8ab8..2ad8b2d2a4 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -1119,7 +1119,6 @@ void AnimationTrackEditTypeAudio::gui_input(const Ref<InputEvent> &p_event) { get_undo_redo()->commit_action(); } - len_resizing = false; len_resizing_index = -1; update(); accept_event(); diff --git a/editor/animation_track_editor_plugins.h b/editor/animation_track_editor_plugins.h index 7022f524c5..adfe517356 100644 --- a/editor/animation_track_editor_plugins.h +++ b/editor/animation_track_editor_plugins.h @@ -81,7 +81,7 @@ class AnimationTrackEditSpriteFrame : public AnimationTrackEdit { GDCLASS(AnimationTrackEditSpriteFrame, AnimationTrackEdit); ObjectID id; - bool is_coords; + bool is_coords = false; public: virtual int get_key_height() const override; @@ -92,7 +92,7 @@ public: void set_node(Object *p_object); void set_as_coords(); - AnimationTrackEditSpriteFrame() { is_coords = false; } + AnimationTrackEditSpriteFrame() {} }; class AnimationTrackEditSubAnim : public AnimationTrackEdit { @@ -114,7 +114,7 @@ class AnimationTrackEditTypeAudio : public AnimationTrackEdit { void _preview_changed(ObjectID p_which); - bool len_resizing; + bool len_resizing = false; bool len_resizing_start; int len_resizing_index; float len_resizing_from_px; diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 22d3155159..2896fda2d2 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -618,8 +618,6 @@ void FindReplaceBar::_bind_methods() { FindReplaceBar::FindReplaceBar() { results_count = -1; - replace_all_mode = false; - preserve_cursor = false; vbc_lineedit = memnew(VBoxContainer); add_child(vbc_lineedit); @@ -1887,8 +1885,6 @@ CodeTextEditor::CodeTextEditor() { error_button->set_default_cursor_shape(CURSOR_POINTING_HAND); error_button->connect("pressed", callable_mp(this, &CodeTextEditor::_error_button_pressed)); error_button->set_tooltip(TTR("Errors")); - - is_errors_panel_opened = false; set_error_count(0); // Warnings @@ -1899,8 +1895,6 @@ CodeTextEditor::CodeTextEditor() { warning_button->set_default_cursor_shape(CURSOR_POINTING_HAND); warning_button->connect("pressed", callable_mp(this, &CodeTextEditor::_warning_button_pressed)); warning_button->set_tooltip(TTR("Warnings")); - - is_warnings_panel_opened = false; set_warning_count(0); // Line and column diff --git a/editor/code_editor.h b/editor/code_editor.h index 24316bf8b0..d7025e7fd9 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -86,8 +86,8 @@ class FindReplaceBar : public HBoxContainer { int result_col; int results_count; - bool replace_all_mode; - bool preserve_cursor; + bool replace_all_mode = false; + bool preserve_cursor = false; void _get_search_from(int &r_line, int &r_col); void _update_results_count(); @@ -206,8 +206,8 @@ protected: void _notification(int); static void _bind_methods(); - bool is_warnings_panel_opened; - bool is_errors_panel_opened; + bool is_warnings_panel_opened = false; + bool is_errors_panel_opened = false; public: void trim_trailing_whitespace(); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 4a51f7c6c2..f1674c47c5 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -356,7 +356,5 @@ EditorAssetInstaller::EditorAssetInstaller() { get_ok_button()->set_text(TTR("Install")); set_title(TTR("Asset Installer")); - updating = false; - set_hide_on_ok(true); } diff --git a/editor/editor_asset_installer.h b/editor/editor_asset_installer.h index f5993f73e7..58c232f351 100644 --- a/editor/editor_asset_installer.h +++ b/editor/editor_asset_installer.h @@ -42,7 +42,7 @@ class EditorAssetInstaller : public ConfirmationDialog { String asset_name; AcceptDialog *error; Map<String, TreeItem *> status_map; - bool updating; + bool updating = false; void _item_edited(); void _check_propagated_to_item(Object *p_obj, int column); virtual void ok_pressed() override; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index cd79238844..4474d6893a 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -771,9 +771,7 @@ void EditorAudioBus::_bind_methods() { EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { buses = p_buses; - updating_bus = false; is_master = p_is_master; - hovering_drop = false; set_tooltip(TTR("Drag & drop to rearrange.")); @@ -992,7 +990,6 @@ void EditorAudioBusDrop::_bind_methods() { } EditorAudioBusDrop::EditorAudioBusDrop() { - hovering_drop = false; } void EditorAudioBuses::_update_buses() { diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index a830a2719d..0020b61370 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -85,9 +85,9 @@ class EditorAudioBus : public PanelContainer { Tree *effects; - bool updating_bus; + bool updating_bus = false; bool is_master; - mutable bool hovering_drop; + mutable bool hovering_drop = false; virtual void gui_input(const Ref<InputEvent> &p_event) override; void _effects_gui_input(Ref<InputEvent> p_event); @@ -140,7 +140,7 @@ class EditorAudioBusDrop : public Control { virtual bool can_drop_data(const Point2 &p_point, const Variant &p_data) const override; virtual void drop_data(const Point2 &p_point, const Variant &p_data) override; - mutable bool hovering_drop; + mutable bool hovering_drop = false; protected: static void _bind_methods(); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 69c7e9d52c..c16451f3c6 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -1206,9 +1206,6 @@ void EditorSelection::clear() { } EditorSelection::EditorSelection() { - emitted = false; - changed = false; - nl_changed = false; } EditorSelection::~EditorSelection() { diff --git a/editor/editor_data.h b/editor/editor_data.h index 0d1efc9b62..79f8227e5c 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -239,9 +239,9 @@ class EditorSelection : public Object { private: Map<Node *, Object *> selection; - bool emitted; - bool changed; - bool nl_changed; + bool emitted = false; + bool changed = false; + bool nl_changed = false; void _node_removed(Node *p_node); diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index f181c04004..32ef87a4ab 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -175,8 +175,6 @@ void EditorDirDialog::_bind_methods() { } EditorDirDialog::EditorDirDialog() { - updating = false; - set_title(TTR("Choose a Directory")); set_hide_on_ok(false); @@ -206,6 +204,4 @@ EditorDirDialog::EditorDirDialog() { add_child(mkdirerr); get_ok_button()->set_text(TTR("Choose")); - - must_reload = false; } diff --git a/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h index 053c1f5503..e97b5ce8af 100644 --- a/editor/editor_dir_dialog.h +++ b/editor/editor_dir_dialog.h @@ -47,7 +47,7 @@ class EditorDirDialog : public ConfirmationDialog { Set<String> opened_paths; Tree *tree; - bool updating; + bool updating = false; void _item_collapsed(Object *p_item); void _item_activated(); @@ -58,7 +58,7 @@ class EditorDirDialog : public ConfirmationDialog { void ok_pressed() override; - bool must_reload; + bool must_reload = false; protected: void _notification(int p_what); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index d081ee05a0..c3c8f40164 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -678,7 +678,6 @@ void EditorExportPlugin::_bind_methods() { } EditorExportPlugin::EditorExportPlugin() { - skipped = false; } EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_containers(const Ref<EditorExportPreset> &p_preset) { @@ -1722,7 +1721,6 @@ EditorExport::EditorExport() { save_timer->set_wait_time(0.8); save_timer->set_one_shot(true); save_timer->connect("timeout", callable_mp(this, &EditorExport::_save)); - block_save = false; _export_presets_updated = "export_presets_updated"; diff --git a/editor/editor_export.h b/editor/editor_export.h index 796fb12793..182312b18f 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -297,7 +297,7 @@ class EditorExportPlugin : public RefCounted { bool remap = false; }; Vector<ExtraFile> extra_files; - bool skipped; + bool skipped = false; Vector<String> ios_frameworks; Vector<String> ios_embedded_frameworks; @@ -379,7 +379,7 @@ class EditorExport : public Node { StringName _export_presets_updated; Timer *save_timer; - bool block_save; + bool block_save = false; static EditorExport *singleton; diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index b1708e756a..3d5ca7de42 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -1010,7 +1010,5 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { update_timer->connect("timeout", callable_mp(this, &EditorFeatureProfileManager::_emit_current_profile_changed)); update_timer->set_one_shot(true); - updating_features = false; - singleton = this; } diff --git a/editor/editor_feature_profile.h b/editor/editor_feature_profile.h index 7ea40502a6..881f14638f 100644 --- a/editor/editor_feature_profile.h +++ b/editor/editor_feature_profile.h @@ -155,7 +155,7 @@ class EditorFeatureProfileManager : public AcceptDialog { void _import_profiles(const Vector<String> &p_paths); void _export_profile(const String &p_path); - bool updating_features; + bool updating_features = false; void _class_list_item_selected(); void _class_list_item_edited(); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 236910eee7..31f2f24066 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1557,7 +1557,6 @@ EditorFileDialog::EditorFileDialog() { show_hidden_files = default_show_hidden_files; display_mode = default_display_mode; local_history_pos = 0; - disable_overwrite_warning = false; VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); @@ -1814,15 +1813,12 @@ EditorFileDialog::EditorFileDialog() { set_hide_on_ok(false); vbox = vbc; - invalidated = true; if (register_func) { register_func(this); } - previews_enabled = true; preview_wheel_timeout = 0; preview_wheel_index = 0; - preview_waiting = false; } EditorFileDialog::~EditorFileDialog() { diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 65a4c9e544..a747255ce8 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -135,8 +135,8 @@ private: Vector<String> filters; - bool previews_enabled; - bool preview_waiting; + bool previews_enabled = true; + bool preview_waiting = false; int preview_wheel_index; float preview_wheel_timeout; @@ -145,8 +145,8 @@ private: bool show_hidden_files; DisplayMode display_mode; - bool disable_overwrite_warning; - bool invalidated; + bool disable_overwrite_warning = false; + bool invalidated = true; void update_dir(); void update_file_name(); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 45362896ca..98ba3ae3d8 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -194,7 +194,6 @@ void EditorFileSystemDirectory::_bind_methods() { EditorFileSystemDirectory::EditorFileSystemDirectory() { modified_time = 0; parent = nullptr; - verified = false; } EditorFileSystemDirectory::~EditorFileSystemDirectory() { @@ -2383,24 +2382,14 @@ EditorFileSystem::EditorFileSystem() { filesystem = memnew(EditorFileSystemDirectory); //like, empty filesystem->parent = nullptr; - scanning = false; - importing = false; - use_threads = true; new_filesystem = nullptr; - abort_scan = false; - scanning_changes = false; - scanning_changes_done = false; - // This should probably also work on Unix and use the string it returns for FAT32 or exFAT DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES); using_fat32_or_exfat = (da->get_filesystem_type() == "FAT32" || da->get_filesystem_type() == "exFAT"); scan_total = 0; update_script_classes_queued.clear(); - first_scan = true; - scan_changes_pending = false; - revalidate_import_files = false; import_threads.init(); ResourceUID::get_singleton()->clear(); //will be updated on scan ResourceSaver::set_get_resource_id_for_path(_resource_saver_get_resource_id_for_path); diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 0c1bfbca47..0ec0094030 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -47,7 +47,7 @@ class EditorFileSystemDirectory : public Object { String name; uint64_t modified_time; - bool verified; //used for checking changes + bool verified = false; //used for checking changes EditorFileSystemDirectory *parent; Vector<EditorFileSystemDirectory *> subdirs; @@ -132,20 +132,20 @@ class EditorFileSystem : public Node { EditorFileSystemDirectory::FileInfo *new_file = nullptr; }; - bool use_threads; + bool use_threads = true; Thread thread; static void _thread_func(void *_userdata); EditorFileSystemDirectory *new_filesystem; - bool abort_scan; - bool scanning; - bool importing; - bool first_scan; - bool scan_changes_pending; + bool abort_scan = false; + bool scanning = false; + bool importing = false; + bool first_scan = true; + bool scan_changes_pending = false; float scan_total; String filesystem_settings_version_for_import; - bool revalidate_import_files; + bool revalidate_import_files = false; void _scan_filesystem(); @@ -197,8 +197,8 @@ class EditorFileSystem : public Node { void _scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess *da, const ScanProgress &p_progress); Thread thread_sources; - bool scanning_changes; - bool scanning_changes_done; + bool scanning_changes = false; + bool scanning_changes_done = false; static void _thread_func_sources(void *_userdata); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 39c8509148..622547f0a8 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1897,8 +1897,6 @@ EditorHelp::EditorHelp() { class_desc->set_selection_enabled(true); - scroll_locked = false; - select_locked = false; class_desc->hide(); } diff --git a/editor/editor_help.h b/editor/editor_help.h index 10281a764c..b40d1709b6 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -98,7 +98,7 @@ class EditorHelp : public VBoxContainer { }; - bool select_locked; + bool select_locked = false; String prev_search; @@ -144,7 +144,7 @@ class EditorHelp : public VBoxContainer { void _help_callback(const String &p_topic); void _add_text(const String &p_bbcode); - bool scroll_locked; + bool scroll_locked = false; //void _button_pressed(int p_idx); void _add_type(const String &p_type, const String &p_enum = String()); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index eab62349d1..8e03c55712 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -180,8 +180,6 @@ void EditorHelpSearch::popup_dialog(const String &p_term) { } EditorHelpSearch::EditorHelpSearch() { - old_search = false; - set_hide_on_ok(false); set_title(TTR("Search Help")); diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index 7d918d0c68..bf69fe1693 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -60,7 +60,7 @@ class EditorHelpSearch : public ConfirmationDialog { Button *hierarchy_button; OptionButton *filter_combo; Tree *results_tree; - bool old_search; + bool old_search = false; String old_term; class Runner; diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index f5d318a227..20b8079689 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -948,31 +948,13 @@ void EditorProperty::_bind_methods() { } EditorProperty::EditorProperty() { - draw_top_bg = true; object = nullptr; split_ratio = 0.5; - selectable = true; text_size = 0; - read_only = false; - checkable = false; - checked = false; - draw_warning = false; - keying = false; - deletable = false; - keying_hover = false; - revert_hover = false; - check_hover = false; - can_revert = false; - can_pin = false; - pin_hidden = false; - pinned = false; - use_folding = false; property_usage = 0; - selected = false; selected_focusable = -1; label_reference = nullptr; bottom_editor = nullptr; - delete_hover = false; menu = nullptr; set_process_unhandled_key_input(true); } @@ -3675,25 +3657,11 @@ EditorInspector::EditorInspector() { add_child(main_vbox); set_horizontal_scroll_mode(SCROLL_MODE_DISABLED); - wide_editors = false; - show_categories = false; - hide_script = true; - use_doc_hints = false; - capitalize_paths = true; - use_filter = false; - autoclear = false; changing = 0; - use_folding = false; - update_all_pending = false; - update_tree_pending = false; - read_only = false; search_box = nullptr; - keying = false; _prop_edited = "property_edited"; set_process(false); property_focusable = -1; - sub_inspector = false; - deletable_properties = false; property_clipboard = Variant(); get_v_scroll_bar()->connect("value_changed", callable_mp(this, &EditorInspector::_vscroll_changed)); diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 43f71740e3..c1454ad84c 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -71,12 +71,12 @@ private: int property_usage; - bool read_only; - bool checkable; - bool checked; - bool draw_warning; - bool keying; - bool deletable; + bool read_only = false; + bool checkable = false; + bool checked = false; + bool draw_warning = false; + bool keying = false; + bool deletable = false; Rect2 right_child_rect; Rect2 bottom_child_rect; @@ -90,19 +90,19 @@ private: Rect2 delete_rect; bool delete_hover = false; - bool can_revert; - bool can_pin; - bool pin_hidden; - bool pinned; + bool can_revert = false; + bool can_pin = false; + bool pin_hidden = false; + bool pinned = false; - bool use_folding; - bool draw_top_bg; + bool use_folding = false; + bool draw_top_bg = true; void _update_popup(); void _focusable_focused(int p_index); - bool selectable; - bool selected; + bool selectable = true; + bool selected = false; int selected_focusable; float split_ratio; @@ -442,23 +442,23 @@ class EditorInspector : public ScrollContainer { // LineEdit *search_box; - bool show_categories; - bool hide_script; - bool use_doc_hints; - bool capitalize_paths; - bool use_filter; - bool autoclear; - bool use_folding; + bool show_categories = false; + bool hide_script = true; + bool use_doc_hints = false; + bool capitalize_paths = true; + bool use_filter = false; + bool autoclear = false; + bool use_folding = false; int changing; - bool update_all_pending; - bool read_only; - bool keying; - bool sub_inspector; - bool wide_editors; - bool deletable_properties; + bool update_all_pending = false; + bool read_only = false; + bool keying = false; + bool sub_inspector = false; + bool wide_editors = false; + bool deletable_properties = false; float refresh_countdown; - bool update_tree_pending; + bool update_tree_pending = false; StringName _prop_edited; StringName property_selected; int property_focusable; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c508856638..5fe2172771 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5841,16 +5841,7 @@ EditorNode::EditorNode() { } singleton = this; - exiting = false; - dimmed = false; last_checked_version = 0; - changing_scene = false; - _initializing_addons = false; - docks_visible = true; - restoring_scenes = false; - cmdline_export_mode = false; - scene_distraction = false; - script_distraction = false; TranslationServer::get_singleton()->set_enabled(false); // load settings @@ -7112,9 +7103,6 @@ EditorNode::EditorNode() { current = nullptr; saving_resource = Ref<Resource>(); - reference_resource_mem = true; - save_external_resources_mem = true; - set_process(true); open_imported = memnew(ConfirmationDialog); @@ -7125,7 +7113,6 @@ EditorNode::EditorNode() { gui_base->add_child(open_imported); saved_version = 1; - unsaved_cache = true; _last_instantiated_scene = nullptr; quick_open = memnew(EditorQuickOpen); @@ -7139,10 +7126,7 @@ EditorNode::EditorNode() { _update_recent_scenes(); editor_data.restore_editor_global_states(); - convert_old = false; - opening_prev = false; set_process_unhandled_input(true); - _playing_edited = false; load_errors = memnew(RichTextLabel); load_error_dialog = memnew(AcceptDialog); @@ -7183,8 +7167,6 @@ EditorNode::EditorNode() { FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify); - waiting_for_first_scan = true; - print_handler.printfunc = _print_handler; print_handler.userdata = this; add_print_handler(&print_handler); diff --git a/editor/editor_node.h b/editor/editor_node.h index c05e6cd281..0b6dbaec49 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -263,8 +263,8 @@ private: TextureRect *tab_preview; int tab_closing; - bool exiting; - bool dimmed; + bool exiting = false; + bool dimmed = false; int old_split_ofs; VSplitContainer *top_split; @@ -380,15 +380,15 @@ private: Button *dock_tab_move_right; int dock_popup_selected; Timer *dock_drag_timer; - bool docks_visible; + bool docks_visible = true; HBoxContainer *tabbar_container; Button *distraction_free; Button *scene_tab_add; Control *scene_tab_add_ph; - bool scene_distraction; - bool script_distraction; + bool scene_distraction = false; + bool script_distraction = false; String _tmp_import_path; @@ -397,18 +397,15 @@ private: Object *current; Ref<Resource> saving_resource; - bool _playing_edited; + bool _playing_edited = false; String run_custom_filename; - bool reference_resource_mem; - bool save_external_resources_mem; + bool reference_resource_mem = true; uint64_t saved_version; uint64_t last_checked_version; - bool unsaved_cache; + bool unsaved_cache = true; String open_navigate; - bool changing_scene; - bool waiting_for_first_scan; - - bool waiting_for_sources_changed; + bool changing_scene = false; + bool waiting_for_first_scan = true; uint64_t update_spinner_step_msec; uint64_t update_spinner_step_frame; @@ -457,7 +454,7 @@ private: String external_file; List<String> previous_scenes; - bool opening_prev; + bool opening_prev = false; void _dialog_action(String p_file); @@ -534,7 +531,7 @@ private: void _exit_editor(int p_exit_code); - bool convert_old; + bool convert_old = false; virtual void unhandled_input(const Ref<InputEvent> &p_event) override; @@ -551,7 +548,7 @@ private: Map<String, Ref<Texture2D>> icon_type_cache; void _build_icon_type_cache(); - bool _initializing_addons; + bool _initializing_addons = false; Map<String, EditorPlugin *> plugin_addons; static Ref<Texture2D> _file_dialog_get_icon(const String &p_path); @@ -587,7 +584,7 @@ private: bool pack_only = false; } export_defer; - bool cmdline_export_mode; + bool cmdline_export_mode = false; static EditorNode *singleton; @@ -627,7 +624,7 @@ private: void _update_dock_slots_visibility(); void _dock_tab_changed(int p_tab); - bool restoring_scenes; + bool restoring_scenes = false; void _save_open_scenes_to_config(Ref<ConfigFile> p_layout, const String &p_section); void _load_open_scenes_from_config(Ref<ConfigFile> p_layout, const String &p_section); diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 401414ae50..b6f48c7536 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -240,6 +240,4 @@ EditorPluginSettings::EditorPluginSettings() { mc->set_h_size_flags(SIZE_EXPAND_FILL); add_child(mc); - - updating = false; } diff --git a/editor/editor_plugin_settings.h b/editor/editor_plugin_settings.h index 4648d105f7..c239b735de 100644 --- a/editor/editor_plugin_settings.h +++ b/editor/editor_plugin_settings.h @@ -48,7 +48,7 @@ class EditorPluginSettings : public VBoxContainer { Button *create_plugin; Button *update_list; Tree *plugin_list; - bool updating; + bool updating = false; void _plugin_activity_changed(); void _create_clicked(); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 4b07897459..b495d29911 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -110,9 +110,6 @@ EditorPropertyText::EditorPropertyText() { add_focusable(text); text->connect("text_changed", callable_mp(this, &EditorPropertyText::_text_changed)); text->connect("text_submitted", callable_mp(this, &EditorPropertyText::_text_submitted)); - - string_name = false; - updating = false; } ///////////////////// MULTILINE TEXT ///////////////////////// @@ -500,9 +497,6 @@ EditorPropertyPath::EditorPropertyPath() { add_focusable(path); dialog = nullptr; path_edit->connect("pressed", callable_mp(this, &EditorPropertyPath::_path_pressed)); - folder = false; - global = false; - save_mode = false; } ///////////////////// CLASS NAME ///////////////////////// @@ -1278,7 +1272,6 @@ EditorPropertyInteger::EditorPropertyInteger() { add_child(spin); add_focusable(spin); spin->connect("value_changed", callable_mp(this, &EditorPropertyInteger::_value_changed)); - setting = false; } ///////////////////// OBJECT ID ///////////////////////// @@ -1587,10 +1580,6 @@ EditorPropertyEasing::EditorPropertyEasing() { spin->get_line_edit()->connect("focus_exited", callable_mp(this, &EditorPropertyEasing::_spin_focus_exited)); spin->hide(); add_child(spin); - - dragging = false; - flip = false; - full = false; } ///////////////////// VECTOR2 ///////////////////////// @@ -1680,7 +1669,6 @@ EditorPropertyVector2::EditorPropertyVector2(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// RECT2 ///////////////////////// @@ -1784,7 +1772,6 @@ EditorPropertyRect2::EditorPropertyRect2(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// VECTOR3 ///////////////////////// @@ -1993,7 +1980,6 @@ EditorPropertyVector2i::EditorPropertyVector2i(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// RECT2i ///////////////////////// @@ -2097,7 +2083,6 @@ EditorPropertyRect2i::EditorPropertyRect2i(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// VECTOR3i ///////////////////////// @@ -2188,7 +2173,6 @@ EditorPropertyVector3i::EditorPropertyVector3i(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// PLANE ///////////////////////// @@ -2282,7 +2266,6 @@ EditorPropertyPlane::EditorPropertyPlane(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// QUATERNION ///////////////////////// @@ -2373,7 +2356,6 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// AABB ///////////////////////// @@ -2457,7 +2439,6 @@ EditorPropertyAABB::EditorPropertyAABB() { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyAABB::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ///////////////////// TRANSFORM2D ///////////////////////// @@ -2547,7 +2528,6 @@ EditorPropertyTransform2D::EditorPropertyTransform2D(bool p_include_origin) { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform2D::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ///////////////////// BASIS ///////////////////////// @@ -2636,7 +2616,6 @@ EditorPropertyBasis::EditorPropertyBasis() { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyBasis::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ///////////////////// TRANSFORM ///////////////////////// @@ -2733,7 +2712,6 @@ EditorPropertyTransform3D::EditorPropertyTransform3D() { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform3D::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ////////////// COLOR PICKER ////////////////////// @@ -2969,7 +2947,6 @@ EditorPropertyNodePath::EditorPropertyNodePath() { clear->set_flat(true); clear->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_clear)); hbc->add_child(clear); - use_path_from_scene_root = false; scene_tree = nullptr; //do not allocate unnecessarily } diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 9a16a78ff8..c21e0e0b4d 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -54,8 +54,8 @@ class EditorPropertyText : public EditorProperty { GDCLASS(EditorPropertyText, EditorProperty); LineEdit *text; - bool updating; - bool string_name; + bool updating = false; + bool string_name = false; void _text_changed(const String &p_string); void _text_submitted(const String &p_string); @@ -131,9 +131,9 @@ public: class EditorPropertyPath : public EditorProperty { GDCLASS(EditorPropertyPath, EditorProperty); Vector<String> extensions; - bool folder; - bool global; - bool save_mode; + bool folder = false; + bool global = false; + bool save_mode = false; EditorFileDialog *dialog; LineEdit *path; Button *path_edit; @@ -359,7 +359,7 @@ public: class EditorPropertyInteger : public EditorProperty { GDCLASS(EditorPropertyInteger, EditorProperty); EditorSpinSlider *spin; - bool setting; + bool setting = false; void _value_changed(int64_t p_val); protected: @@ -410,11 +410,11 @@ class EditorPropertyEasing : public EditorProperty { Control *easing_draw; PopupMenu *preset; EditorSpinSlider *spin; - bool setting; + bool setting = false; - bool dragging; - bool full; - bool flip; + bool dragging = false; + bool full = false; + bool flip = false; enum { EASING_ZERO, @@ -450,7 +450,7 @@ public: class EditorPropertyVector2 : public EditorProperty { GDCLASS(EditorPropertyVector2, EditorProperty); EditorSpinSlider *spin[2]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -467,7 +467,7 @@ public: class EditorPropertyRect2 : public EditorProperty { GDCLASS(EditorPropertyRect2, EditorProperty); EditorSpinSlider *spin[4]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -504,7 +504,7 @@ public: class EditorPropertyVector2i : public EditorProperty { GDCLASS(EditorPropertyVector2i, EditorProperty); EditorSpinSlider *spin[2]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -521,7 +521,7 @@ public: class EditorPropertyRect2i : public EditorProperty { GDCLASS(EditorPropertyRect2i, EditorProperty); EditorSpinSlider *spin[4]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -538,7 +538,7 @@ public: class EditorPropertyVector3i : public EditorProperty { GDCLASS(EditorPropertyVector3i, EditorProperty); EditorSpinSlider *spin[3]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -555,7 +555,7 @@ public: class EditorPropertyPlane : public EditorProperty { GDCLASS(EditorPropertyPlane, EditorProperty); EditorSpinSlider *spin[4]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -572,7 +572,7 @@ public: class EditorPropertyQuaternion : public EditorProperty { GDCLASS(EditorPropertyQuaternion, EditorProperty); EditorSpinSlider *spin[4]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -589,7 +589,7 @@ public: class EditorPropertyAABB : public EditorProperty { GDCLASS(EditorPropertyAABB, EditorProperty); EditorSpinSlider *spin[6]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -606,7 +606,7 @@ public: class EditorPropertyTransform2D : public EditorProperty { GDCLASS(EditorPropertyTransform2D, EditorProperty); EditorSpinSlider *spin[6]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -623,7 +623,7 @@ public: class EditorPropertyBasis : public EditorProperty { GDCLASS(EditorPropertyBasis, EditorProperty); EditorSpinSlider *spin[9]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -640,7 +640,7 @@ public: class EditorPropertyTransform3D : public EditorProperty { GDCLASS(EditorPropertyTransform3D, EditorProperty); EditorSpinSlider *spin[12]; - bool setting; + bool setting = false; void _value_changed(double p_val, const String &p_name); protected: @@ -681,7 +681,7 @@ class EditorPropertyNodePath : public EditorProperty { Button *clear; SceneTreeDialog *scene_tree; NodePath base_hint; - bool use_path_from_scene_root; + bool use_path_from_scene_root = false; Vector<StringName> valid_types; void _node_selected(const NodePath &p_path); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 533ecc196f..76d1ada820 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -714,7 +714,6 @@ EditorPropertyArray::EditorPropertyArray() { size_slider = nullptr; button_add_item = nullptr; paginator = nullptr; - updating = false; change_type = memnew(PopupMenu); add_child(change_type); change_type->connect("id_pressed", callable_mp(this, &EditorPropertyArray::_change_type_menu)); @@ -723,8 +722,6 @@ EditorPropertyArray::EditorPropertyArray() { subtype = Variant::NIL; subtype_hint = PROPERTY_HINT_NONE; subtype_hint_string = ""; - - dropping = false; } ///////////////////// DICTIONARY /////////////////////////// @@ -1211,7 +1208,6 @@ EditorPropertyDictionary::EditorPropertyDictionary() { vbox = nullptr; button_add_item = nullptr; paginator = nullptr; - updating = false; change_type = memnew(PopupMenu); add_child(change_type); change_type->connect("id_pressed", callable_mp(this, &EditorPropertyDictionary::_change_type_menu)); diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h index 6c22f7f606..3d9fe90b20 100644 --- a/editor/editor_properties_array_dict.h +++ b/editor/editor_properties_array_dict.h @@ -81,8 +81,8 @@ class EditorPropertyArray : public EditorProperty { GDCLASS(EditorPropertyArray, EditorProperty); PopupMenu *change_type; - bool updating; - bool dropping; + bool updating = false; + bool dropping = false; Ref<EditorPropertyArrayObject> object; int page_length = 20; @@ -139,7 +139,7 @@ class EditorPropertyDictionary : public EditorProperty { GDCLASS(EditorPropertyDictionary, EditorProperty); PopupMenu *change_type; - bool updating; + bool updating = false; Ref<EditorPropertyDictionaryObject> object; int page_length = 20; diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 77f135bb63..5db7b8673f 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -168,7 +168,6 @@ bool EditorRunNative::is_deploy_debug_remote_enabled() const { EditorRunNative::EditorRunNative() { set_process(true); - first = true; resume_idx = 0; resume_platform = 0; } diff --git a/editor/editor_run_native.h b/editor/editor_run_native.h index 199d094e55..4cb5779350 100644 --- a/editor/editor_run_native.h +++ b/editor/editor_run_native.h @@ -38,7 +38,7 @@ class EditorRunNative : public HBoxContainer { GDCLASS(EditorRunNative, HBoxContainer); Map<int, MenuButton *> menus; - bool first; + bool first = true; int resume_idx; int resume_platform; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 179a88dc60..00b6b84461 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1660,8 +1660,6 @@ void EditorSettings::_bind_methods() { EditorSettings::EditorSettings() { last_order = 0; - optimize_save = true; - save_changed_setting = true; _load_defaults(); } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 65723a24f8..4f25259a01 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -92,8 +92,8 @@ private: Vector<String> favorites; Vector<String> recent_dirs; - bool save_changed_setting; - bool optimize_save; //do not save stuff that came from config but was not set from engine + bool save_changed_setting = true; + bool optimize_save = true; //do not save stuff that came from config but was not set from engine bool _set(const StringName &p_name, const Variant &p_value); bool _set_only(const StringName &p_name, const Variant &p_value); diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 1ec6d4a3a6..eb3cf08578 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -764,8 +764,6 @@ EditorSettingsDialog::EditorSettingsDialog() { add_child(timer); EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &EditorSettingsDialog::_settings_changed)); get_ok_button()->set_text(TTR("Close")); - - updating = false; } EditorSettingsDialog::~EditorSettingsDialog() { diff --git a/editor/editor_settings_dialog.h b/editor/editor_settings_dialog.h index 4b90506b4b..e3139bb07a 100644 --- a/editor/editor_settings_dialog.h +++ b/editor/editor_settings_dialog.h @@ -43,7 +43,7 @@ class EditorSettingsDialog : public AcceptDialog { GDCLASS(EditorSettingsDialog, AcceptDialog); - bool updating; + bool updating = false; TabContainer *tabs; Control *tab_general; diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 509a316ef3..ef34f13d45 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -655,14 +655,10 @@ void EditorSpinSlider::_ensure_input_popup() { } EditorSpinSlider::EditorSpinSlider() { - flat = false; - grabbing_spinner_attempt = false; - grabbing_spinner = false; grabbing_spinner_dist_cache = 0; pre_grab_value = 0; set_focus_mode(FOCUS_ALL); updown_offset = -1; - hover_updown = false; grabber = memnew(TextureRect); add_child(grabber); grabber->hide(); @@ -671,12 +667,5 @@ EditorSpinSlider::EditorSpinSlider() { grabber->connect("mouse_entered", callable_mp(this, &EditorSpinSlider::_grabber_mouse_entered)); grabber->connect("mouse_exited", callable_mp(this, &EditorSpinSlider::_grabber_mouse_exited)); grabber->connect("gui_input", callable_mp(this, &EditorSpinSlider::_grabber_gui_input)); - mouse_over_spin = false; - mouse_over_grabber = false; - mousewheel_over_grabber = false; - grabbing_grabber = false; grabber_range = 1; - value_input_just_closed = false; - hide_slider = false; - read_only = false; } diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h index 4e52980804..405c3bfc22 100644 --- a/editor/editor_spin_slider.h +++ b/editor/editor_spin_slider.h @@ -41,24 +41,24 @@ class EditorSpinSlider : public Range { String label; String suffix; int updown_offset; - bool hover_updown; - bool mouse_hover; + bool hover_updown = false; + bool mouse_hover = false; TextureRect *grabber; int grabber_range; - bool mouse_over_spin; - bool mouse_over_grabber; - bool mousewheel_over_grabber; + bool mouse_over_spin = false; + bool mouse_over_grabber = false; + bool mousewheel_over_grabber = false; - bool grabbing_grabber; + bool grabbing_grabber = false; int grabbing_from; float grabbing_ratio; - bool grabbing_spinner_attempt; - bool grabbing_spinner; + bool grabbing_spinner_attempt = false; + bool grabbing_spinner = false; - bool read_only; + bool read_only = false; float grabbing_spinner_dist_cache; Vector2 grabbing_spinner_mouse_pos; double pre_grab_value; @@ -73,8 +73,8 @@ class EditorSpinSlider : public Range { void _value_input_submitted(const String &); void _value_focus_exited(); void _value_input_gui_input(const Ref<InputEvent> &p_event); - bool hide_slider; - bool flat; + bool hide_slider = false; + bool flat = false; void _evaluate_input_text(); diff --git a/editor/editor_vcs_interface.cpp b/editor/editor_vcs_interface.cpp index 97611d9786..0954779300 100644 --- a/editor/editor_vcs_interface.cpp +++ b/editor/editor_vcs_interface.cpp @@ -153,7 +153,6 @@ String EditorVCSInterface::get_vcs_name() { } EditorVCSInterface::EditorVCSInterface() { - is_initialized = false; } EditorVCSInterface::~EditorVCSInterface() { diff --git a/editor/editor_vcs_interface.h b/editor/editor_vcs_interface.h index 091936dadc..487625e84c 100644 --- a/editor/editor_vcs_interface.h +++ b/editor/editor_vcs_interface.h @@ -38,7 +38,7 @@ class EditorVCSInterface : public Object { GDCLASS(EditorVCSInterface, Object) - bool is_initialized; + bool is_initialized = false; protected: static EditorVCSInterface *singleton; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index d9539784ac..038cc2ab2f 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -3172,10 +3172,7 @@ FileSystemDock::FileSystemDock() { searched_string = String(); uncollapsed_paths_before_search = Vector<String>(); - updating_tree = false; tree_update_id = 0; - initialized = false; - import_dock_needs_update = false; history_pos = 0; history_max_size = 20; @@ -3184,8 +3181,6 @@ FileSystemDock::FileSystemDock() { display_mode = DISPLAY_MODE_TREE_ONLY; old_display_mode = DISPLAY_MODE_TREE_ONLY; file_list_display_mode = FILE_LIST_DISPLAY_THUMBNAILS; - - always_show_folders = false; } FileSystemDock::~FileSystemDock() { diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index e98ffd68b4..92dac374ec 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -154,7 +154,7 @@ private: ShaderCreateDialog *make_shader_dialog; CreateDialog *new_resource_dialog; - bool always_show_folders; + bool always_show_folders = false; class FileOrFolder { public: @@ -177,13 +177,13 @@ private: String path; - bool initialized; + bool initialized = false; - bool updating_tree; + bool updating_tree = false; int tree_update_id; Tree *tree; ItemList *files; - bool import_dock_needs_update; + bool import_dock_needs_update = false; bool holding_branch = false; Vector<TreeItem *> tree_items_selected_on_drag_begin; diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index eff9185c71..1ce363c651 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -612,8 +612,6 @@ FindInFilesPanel::FindInFilesPanel() { _results_display->create_item(); // Root vbc->add_child(_results_display); - _with_replace = false; - { _replace_container = memnew(HBoxContainer); diff --git a/editor/find_in_files.h b/editor/find_in_files.h index 1b6666b554..cf14f3d5c3 100644 --- a/editor/find_in_files.h +++ b/editor/find_in_files.h @@ -210,7 +210,7 @@ private: ProgressBar *_progress_bar; Map<String, TreeItem *> _file_items; Map<TreeItem *, Result> _result_items; - bool _with_replace; + bool _with_replace = false; HBoxContainer *_replace_container; LineEdit *_replace_line_edit; diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index a766650cd9..77594dde78 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -473,7 +473,6 @@ void LocalizationEditor::_bind_methods() { LocalizationEditor::LocalizationEditor() { undo_redo = EditorNode::get_undo_redo(); - updating_translations = false; localization_changed = "localization_changed"; TabContainer *translations = memnew(TabContainer); diff --git a/editor/localization_editor.h b/editor/localization_editor.h index bde1b894e2..3424ba7c55 100644 --- a/editor/localization_editor.h +++ b/editor/localization_editor.h @@ -56,7 +56,7 @@ class LocalizationEditor : public VBoxContainer { EditorFileDialog *pot_generate_dialog; UndoRedo *undo_redo; - bool updating_translations; + bool updating_translations = false; String localization_changed; void _translation_file_open(); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 401d579c23..9963ac0232 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1128,9 +1128,6 @@ ProjectExportDialog::ProjectExportDialog() { // Script export parameters. - updating_script_key = false; - updating_enc_filters = false; - VBoxContainer *sec_vb = memnew(VBoxContainer); sec_vb->set_name(TTR("Encryption")); @@ -1195,8 +1192,6 @@ ProjectExportDialog::ProjectExportDialog() { // Export buttons, dialogs and errors. - updating = false; - get_cancel_button()->set_text(TTR("Close")); get_ok_button()->set_text(TTR("Export PCK/ZIP...")); export_button = add_button(TTR("Export Project..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export"); diff --git a/editor/project_export.h b/editor/project_export.h index 569563ba55..057fd31168 100644 --- a/editor/project_export.h +++ b/editor/project_export.h @@ -71,7 +71,7 @@ private: CheckButton *runnable; Button *button_export; - bool updating; + bool updating = false; AcceptDialog *error_dialog; ConfirmationDialog *delete_confirm; @@ -152,8 +152,8 @@ private: void _update_feature_list(); void _custom_features_changed(const String &p_text); - bool updating_script_key; - bool updating_enc_filters; + bool updating_script_key = false; + bool updating_enc_filters = false; void _enc_pck_changed(bool p_pressed); void _enc_directory_changed(bool p_pressed); void _enc_filters_changed(const String &p_text); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index dd4b963fc0..52fb0d4f4e 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -1771,9 +1771,6 @@ void CustomPropertyEditor::_bind_methods() { } CustomPropertyEditor::CustomPropertyEditor() { - read_only = false; - updating = false; - value_vbox = memnew(VBoxContainer); add_child(value_vbox); diff --git a/editor/property_editor.h b/editor/property_editor.h index c4287dc115..73306e0bc2 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -119,7 +119,7 @@ class CustomPropertyEditor : public PopupPanel { TextureRect *texture_preview; ColorPicker *color_picker; TextEdit *text_edit; - bool read_only; + bool read_only = false; bool picking_viewport; GridContainer *checks20gc; CheckBox *checks20[20]; @@ -132,7 +132,7 @@ class CustomPropertyEditor : public PopupPanel { Object *owner; - bool updating; + bool updating = false; PropertyValueEvaluator *evaluator; diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 453ecb6b24..1ac15a0a9d 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -589,7 +589,6 @@ PropertySelector::PropertySelector() { search_options->connect("cell_selected", callable_mp(this, &PropertySelector::_item_selected)); search_options->set_hide_root(true); search_options->set_hide_folding(true); - virtuals_only = false; help_bit = memnew(EditorHelpBit); vbc->add_margin_child(TTR("Description:"), help_bit); diff --git a/editor/property_selector.h b/editor/property_selector.h index 1e8c6300a0..7e629a847e 100644 --- a/editor/property_selector.h +++ b/editor/property_selector.h @@ -56,7 +56,7 @@ class PropertySelector : public ConfirmationDialog { String base_type; ObjectID script; Object *instance; - bool virtuals_only; + bool virtuals_only = false; Vector<Variant::Type> type_filter; diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index 4e64aba1db..53da945868 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -245,8 +245,6 @@ void EditorQuickOpen::_bind_methods() { } EditorQuickOpen::EditorQuickOpen() { - allow_multi_select = false; - VBoxContainer *vbc = memnew(VBoxContainer); vbc->connect("theme_changed", callable_mp(this, &EditorQuickOpen::_theme_changed)); add_child(vbc); diff --git a/editor/quick_open.h b/editor/quick_open.h index dc485a7c86..f50f09604c 100644 --- a/editor/quick_open.h +++ b/editor/quick_open.h @@ -42,7 +42,7 @@ class EditorQuickOpen : public ConfirmationDialog { LineEdit *search_box; Tree *search_options; StringName base_type; - bool allow_multi_select; + bool allow_multi_select = false; Vector<String> files; OAHashMap<String, Ref<Texture2D>> icons; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 27f6854140..8d7916685a 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -3497,8 +3497,6 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec menu_subresources->set_name("Sub-Resources"); menu_subresources->connect("id_pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(false)); menu->add_child(menu_subresources); - first_enter = true; - restore_script_editor_on_drag = false; menu_properties = memnew(PopupMenu); add_child(menu_properties); @@ -3512,9 +3510,6 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec set_process_input(true); set_process(true); - profile_allow_editing = true; - profile_allow_script_editing = true; - EDITOR_DEF("interface/editors/show_scene_tree_root_selection", true); EDITOR_DEF("interface/editors/derive_script_globals_by_name", true); EDITOR_DEF("_use_favorites_root_selection", false); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 2a98c469dc..938f83725d 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -105,7 +105,7 @@ class SceneTreeDock : public VBoxContainer { Vector<ObjectID> subresources; - bool restore_script_editor_on_drag; + bool restore_script_editor_on_drag = false; bool reset_create_dialog = false; int current_option; @@ -166,7 +166,7 @@ class SceneTreeDock : public VBoxContainer { PopupMenu *menu_properties; ConfirmationDialog *clear_inherit_confirm; - bool first_enter; + bool first_enter = true; void _create(); void _do_create(Node *p_parent); @@ -261,8 +261,8 @@ class SceneTreeDock : public VBoxContainer { void _create_remap_for_node(Node *p_node, Map<RES, RES> &r_remap); void _create_remap_for_resource(RES p_resource, Map<RES, RES> &r_remap); - bool profile_allow_editing; - bool profile_allow_script_editing; + bool profile_allow_editing = true; + bool profile_allow_script_editing = true; static void _update_configuration_warning(); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index c6a8a928db..3b8c540592 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1197,17 +1197,11 @@ void SceneTreeEditor::_bind_methods() { } SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_open_instance) { - connect_to_script_mode = false; - connecting_signal = false; undo_redo = nullptr; - tree_dirty = true; selected = nullptr; - marked_selectable = false; - marked_children_selectable = false; can_rename = p_can_rename; can_open_instance = p_can_open_instance; - display_foreign = false; editor_selection = nullptr; if (p_label) { @@ -1249,11 +1243,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope add_child(warning); warning->set_title(TTR("Node Configuration Warning!")); - show_enabled_subscene = false; - last_hash = 0; - pending_test_update = false; - updating_tree = false; blocked = 0; update_timer = memnew(Timer); diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index f700182681..2466b8576a 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -65,8 +65,8 @@ class SceneTreeEditor : public Control { AcceptDialog *warning; bool auto_expand_selected = true; - bool connect_to_script_mode; - bool connecting_signal; + bool connect_to_script_mode = false; + bool connecting_signal = false; int blocked; @@ -92,18 +92,18 @@ class SceneTreeEditor : public Control { bool can_rename; bool can_open_instance; - bool updating_tree; - bool show_enabled_subscene; + bool updating_tree = false; + bool show_enabled_subscene = false; void _renamed(); UndoRedo *undo_redo; Set<Node *> marked; - bool marked_selectable; - bool marked_children_selectable; - bool display_foreign; - bool tree_dirty; - bool pending_test_update; + bool marked_selectable = false; + bool marked_children_selectable = false; + bool display_foreign = false; + bool tree_dirty = true; + bool pending_test_update = false; static void _bind_methods(); void _cell_button_pressed(Object *p_item, int p_column, int p_id); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 1e6286bc9c..baafef8639 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -1026,7 +1026,6 @@ ScriptCreateDialog::ScriptCreateDialog() { hb->add_child(parent_browse_button); gc->add_child(memnew(Label(TTR("Inherits:")))); gc->add_child(hb); - is_browsing_parent = false; /* Class Name */ @@ -1037,8 +1036,6 @@ ScriptCreateDialog::ScriptCreateDialog() { gc->add_child(class_name); /* Templates */ - - is_using_templates = true; gc->add_child(memnew(Label(TTR("Template:")))); HBoxContainer *template_hb = memnew(HBoxContainer); template_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -1079,7 +1076,6 @@ ScriptCreateDialog::ScriptCreateDialog() { Label *label = memnew(Label(TTR("Path:"))); gc->add_child(label); gc->add_child(hb); - re_check_path = false; path_controls[0] = label; path_controls[1] = hb; @@ -1116,17 +1112,4 @@ ScriptCreateDialog::ScriptCreateDialog() { set_hide_on_ok(false); set_title(TTR("Attach Node Script")); - - is_parent_name_valid = false; - is_class_name_valid = false; - is_path_valid = false; - - has_named_classes = false; - supports_built_in = false; - can_inherit_from_file = false; - is_built_in = false; - built_in_enabled = true; - load_enabled = true; - - is_new_script_created = true; } diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 5c0f51812f..d7c43f322c 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -66,25 +66,23 @@ class ScriptCreateDialog : public ConfirmationDialog { VBoxContainer *path_vb; AcceptDialog *alert; CreateDialog *select_class; - bool path_valid; - bool create_new; - bool is_browsing_parent; + bool is_browsing_parent = false; String template_inactive_message; String initial_bp; - bool is_new_script_created; - bool is_path_valid; - bool has_named_classes; - bool supports_built_in; - bool can_inherit_from_file; - bool is_parent_name_valid; - bool is_class_name_valid; - bool is_built_in; - bool is_using_templates; - bool built_in_enabled; - bool load_enabled; + bool is_new_script_created = true; + bool is_path_valid = false; + bool has_named_classes = false; + bool supports_built_in = false; + bool can_inherit_from_file = false; + bool is_parent_name_valid = false; + bool is_class_name_valid = false; + bool is_built_in = false; + bool is_using_templates = true; + bool built_in_enabled = true; + bool load_enabled = true; int current_language; int default_language; - bool re_check_path; + bool re_check_path = false; Control *path_controls[2]; Control *name_controls[2]; |