Skip to content

Commit

Permalink
Initialize bools in the headers in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfranke committed Mar 12, 2022
1 parent d7019de commit 918b09c
Show file tree
Hide file tree
Showing 70 changed files with 175 additions and 389 deletions.
2 changes: 0 additions & 2 deletions editor/action_map_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion editor/action_map_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class ActionMapEditor : public Control {

// Filtering and Adding actions

bool show_builtin_actions;
bool show_builtin_actions = false;
CheckButton *show_builtin_actions_checkbutton;
LineEdit *action_list_search;

Expand Down
16 changes: 0 additions & 16 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1886,8 +1886,6 @@ void AnimationTimelineEdit::_bind_methods() {
}

AnimationTimelineEdit::AnimationTimelineEdit() {
use_fps = false;
editing = false;
name_limit = 150 * EDSCALE;
zoom = nullptr;
track_edit = nullptr;
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand All @@ -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;

Expand All @@ -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.

Expand Down Expand Up @@ -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() {
Expand Down
26 changes: 13 additions & 13 deletions editor/animation_track_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -171,7 +171,7 @@ class AnimationTrackEdit : public Control {

PopupMenu *menu;

bool clicking_on_name;
bool clicking_on_name = false;

void _zoom_changed();

Expand All @@ -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:
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion editor/animation_track_editor_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions editor/animation_track_editor_plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -92,7 +92,7 @@ class AnimationTrackEditSpriteFrame : public AnimationTrackEdit {
void set_node(Object *p_object);
void set_as_coords();

AnimationTrackEditSpriteFrame() { is_coords = false; }
AnimationTrackEditSpriteFrame() {}
};

class AnimationTrackEditSubAnim : public AnimationTrackEdit {
Expand All @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions editor/code_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -206,8 +206,8 @@ class CodeTextEditor : public VBoxContainer {
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();
Expand Down
2 changes: 0 additions & 2 deletions editor/editor_asset_installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion editor/editor_asset_installer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));

Expand Down Expand Up @@ -992,7 +990,6 @@ void EditorAudioBusDrop::_bind_methods() {
}

EditorAudioBusDrop::EditorAudioBusDrop() {
hovering_drop = false;
}

void EditorAudioBuses::_update_buses() {
Expand Down
6 changes: 3 additions & 3 deletions editor/editor_audio_buses.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions editor/editor_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,6 @@ void EditorSelection::clear() {
}

EditorSelection::EditorSelection() {
emitted = false;
changed = false;
nl_changed = false;
}

EditorSelection::~EditorSelection() {
Expand Down
6 changes: 3 additions & 3 deletions editor/editor_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions editor/editor_dir_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ void EditorDirDialog::_bind_methods() {
}

EditorDirDialog::EditorDirDialog() {
updating = false;

set_title(TTR("Choose a Directory"));
set_hide_on_ok(false);

Expand Down Expand Up @@ -206,6 +204,4 @@ EditorDirDialog::EditorDirDialog() {
add_child(mkdirerr);

get_ok_button()->set_text(TTR("Choose"));

must_reload = false;
}
4 changes: 2 additions & 2 deletions editor/editor_dir_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions editor/editor_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ void EditorExportPlugin::_bind_methods() {
}

EditorExportPlugin::EditorExportPlugin() {
skipped = false;
}

EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_containers(const Ref<EditorExportPreset> &p_preset) {
Expand Down Expand Up @@ -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";

Expand Down
Loading

0 comments on commit 918b09c

Please sign in to comment.