ソースを参照

Merge pull request #34706 from KoBeWi/grindput

Don't handle Gridmap input when have no effect
Rémi Verschelde 5 年 前
コミット
5aa96b72c7
1 ファイル変更3 行追加2 行削除
  1. 3 2
      modules/gridmap/grid_map_editor_plugin.cpp

+ 3 - 2
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;
 				input_action = INPUT_NONE;
 			} else if (mb->get_button_index() == BUTTON_LEFT) {
 			} else if (mb->get_button_index() == BUTTON_LEFT) {
 
 
+				bool can_edit = (node && node->get_mesh_library().is_valid());
 				if (input_action == INPUT_PASTE) {
 				if (input_action == INPUT_PASTE) {
 					_do_paste();
 					_do_paste();
 					input_action = INPUT_NONE;
 					input_action = INPUT_NONE;
 					_update_paste_indicator();
 					_update_paste_indicator();
-				} else if (mb->get_shift()) {
+				} else if (mb->get_shift() && can_edit) {
 					input_action = INPUT_SELECT;
 					input_action = INPUT_SELECT;
 					last_selection = selection;
 					last_selection = selection;
-				} else if (mb->get_command()) {
+				} else if (mb->get_command() && can_edit) {
 					input_action = INPUT_PICK;
 					input_action = INPUT_PICK;
 				} else {
 				} else {
 					input_action = INPUT_PAINT;
 					input_action = INPUT_PAINT;