summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-22 12:55:18 +0200
committerGitHub <noreply@github.com>2019-10-22 12:55:18 +0200
commit10518d5d84d4fba9b697c6380834c78f58e537e3 (patch)
tree0dcdcfdf408aaa168d214391c10f15483d23a5e0
parentbd23cce055334704dac503f12451df8bd259b751 (diff)
parent28c274bc27fbc5052d3be9196f1ab279b45a60b2 (diff)
Merge pull request #32893 from Nehluxhes/delete_gridmap
Disable gridmap selection actions when nothing is selected
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index c97524a54d..86a8df652c 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -354,6 +354,11 @@ void GridMapEditor::_set_selection(bool p_active, const Vector3 &p_begin, const
selection.current = p_end;
_update_selection_transform();
+
+ options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_CLEAR), !selection.active);
+ options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_CUT), !selection.active);
+ options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_DUPLICATE), !selection.active);
+ options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_FILL), !selection.active);
}
bool GridMapEditor::do_input_action(Camera *p_camera, const Point2 &p_point, bool p_click) {
@@ -1465,7 +1470,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
}
}
- selection.active = false;
+ _set_selection(false);
updating = false;
accumulated_floor_delta = 0.0;
}