summaryrefslogtreecommitdiffstats
path: root/modules/gridmap/grid_map_editor_plugin.cpp
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2019-12-30 23:35:40 +0100
committerTomasz Chabora <kobewi4e@gmail.com>2019-12-30 23:35:43 +0100
commitbf143c05d251005a9b68654892e41ce1fe6b21cf (patch)
treed202b24b3231ec05a3ff4a00a364ae79fee934a9 /modules/gridmap/grid_map_editor_plugin.cpp
parent5fa1905131bc20e8a4a939d0edf8370091c88a50 (diff)
downloadredot-engine-bf143c05d251005a9b68654892e41ce1fe6b21cf.tar.gz
Don't handle Gridmap input when have no effect
Diffstat (limited to 'modules/gridmap/grid_map_editor_plugin.cpp')
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 63771f1583..e6a1993a20 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -664,14 +664,15 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
input_action = INPUT_NONE;
} else if (mb->get_button_index() == BUTTON_LEFT) {
+ bool can_edit = (node && node->get_mesh_library().is_valid());
if (input_action == INPUT_PASTE) {
_do_paste();
input_action = INPUT_NONE;
_update_paste_indicator();
- } else if (mb->get_shift()) {
+ } else if (mb->get_shift() && can_edit) {
input_action = INPUT_SELECT;
last_selection = selection;
- } else if (mb->get_command()) {
+ } else if (mb->get_command() && can_edit) {
input_action = INPUT_PICK;
} else {
input_action = INPUT_PAINT;