@@ -726,12 +726,12 @@ bool TileMapLayerEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEven
726
726
}
727
727
} else {
728
728
// Check if we are picking a tile.
729
- if (picker_button->is_pressed () || (Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
729
+ if (picker_button->is_pressed () || (Input::get_singleton ()->is_command_or_control_pressed ( ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
730
730
drag_type = DRAG_TYPE_PICK;
731
731
drag_start_mouse_pos = mpos;
732
732
} else {
733
733
// Paint otherwise.
734
- if (tool_buttons_group->get_pressed_button () == paint_tool_button && !Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT)) {
734
+ if (tool_buttons_group->get_pressed_button () == paint_tool_button && !Input::get_singleton ()->is_command_or_control_pressed ( ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT)) {
735
735
drag_type = DRAG_TYPE_PAINT;
736
736
drag_start_mouse_pos = mpos;
737
737
drag_modified.clear ();
@@ -747,11 +747,11 @@ bool TileMapLayerEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEven
747
747
edited_layer->set_cell (coords, E.value .source_id , E.value .get_atlas_coords (), E.value .alternative_tile );
748
748
}
749
749
_fix_invalid_tiles_in_tile_map_selection ();
750
- } else if (tool_buttons_group->get_pressed_button () == line_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && !Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ))) {
750
+ } else if (tool_buttons_group->get_pressed_button () == line_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && !Input::get_singleton ()->is_command_or_control_pressed ( ))) {
751
751
drag_type = DRAG_TYPE_LINE;
752
752
drag_start_mouse_pos = mpos;
753
753
drag_modified.clear ();
754
- } else if (tool_buttons_group->get_pressed_button () == rect_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ))) {
754
+ } else if (tool_buttons_group->get_pressed_button () == rect_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && Input::get_singleton ()->is_command_or_control_pressed ( ))) {
755
755
drag_type = DRAG_TYPE_RECT;
756
756
drag_start_mouse_pos = mpos;
757
757
drag_modified.clear ();
@@ -813,7 +813,7 @@ void TileMapLayerEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p
813
813
// Draw the selection.
814
814
if ((tiles_bottom_panel->is_visible_in_tree () || patterns_bottom_panel->is_visible_in_tree ()) && tool_buttons_group->get_pressed_button () == select_tool_button) {
815
815
// In select mode, we only draw the current selection if we are modifying it (pressing control or shift).
816
- if (drag_type == DRAG_TYPE_MOVE || (drag_type == DRAG_TYPE_SELECT && !Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
816
+ if (drag_type == DRAG_TYPE_MOVE || (drag_type == DRAG_TYPE_SELECT && !Input::get_singleton ()->is_command_or_control_pressed ( ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
817
817
// Do nothing.
818
818
} else {
819
819
Color grid_color = EDITOR_GET (" editors/tiles_editor/grid_color" );
@@ -883,7 +883,7 @@ void TileMapLayerEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p
883
883
Vector2i coords = tile_set->map_pattern (tile_set->local_to_map (mpos - mouse_offset), clipboard_used_cells[i], tile_map_clipboard);
884
884
preview[coords] = TileMapCell (tile_map_clipboard->get_cell_source_id (clipboard_used_cells[i]), tile_map_clipboard->get_cell_atlas_coords (clipboard_used_cells[i]), tile_map_clipboard->get_cell_alternative_tile (clipboard_used_cells[i]));
885
885
}
886
- } else if (!picker_button->is_pressed () && !(drag_type == DRAG_TYPE_NONE && Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
886
+ } else if (!picker_button->is_pressed () && !(drag_type == DRAG_TYPE_NONE && Input::get_singleton ()->is_command_or_control_pressed ( ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
887
887
bool expand_grid = false ;
888
888
if (tool_buttons_group->get_pressed_button () == paint_tool_button && drag_type == DRAG_TYPE_NONE) {
889
889
// Preview for a single pattern.
@@ -1284,14 +1284,14 @@ void TileMapLayerEditorTilesPlugin::_stop_dragging() {
1284
1284
undo_redo->create_action_for_history (TTR (" Change selection" ), EditorNode::get_editor_data ().get_current_edited_scene_history_id (), UndoRedo::MERGE_DISABLE, false , false );
1285
1285
undo_redo->add_undo_method (this , " _set_tile_map_selection" , _get_tile_map_selection ());
1286
1286
1287
- if (!Input::get_singleton ()->is_key_pressed (Key::SHIFT) && !Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL )) {
1287
+ if (!Input::get_singleton ()->is_key_pressed (Key::SHIFT) && !Input::get_singleton ()->is_command_or_control_pressed ( )) {
1288
1288
tile_map_selection.clear ();
1289
1289
}
1290
1290
Rect2i rect = Rect2i (tile_set->local_to_map (drag_start_mouse_pos), tile_set->local_to_map (mpos) - tile_set->local_to_map (drag_start_mouse_pos)).abs ();
1291
1291
for (int x = rect.position .x ; x <= rect.get_end ().x ; x++) {
1292
1292
for (int y = rect.position .y ; y <= rect.get_end ().y ; y++) {
1293
1293
Vector2i coords = Vector2i (x, y);
1294
- if (Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL )) {
1294
+ if (Input::get_singleton ()->is_command_or_control_pressed ( )) {
1295
1295
if (tile_map_selection.has (coords)) {
1296
1296
tile_map_selection.erase (coords);
1297
1297
}
@@ -3054,7 +3054,7 @@ bool TileMapLayerEditorTerrainsPlugin::forward_canvas_gui_input(const Ref<InputE
3054
3054
drag_type = DRAG_TYPE_PICK;
3055
3055
} else {
3056
3056
// Paint otherwise.
3057
- if (tool_buttons_group->get_pressed_button () == paint_tool_button && !Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT)) {
3057
+ if (tool_buttons_group->get_pressed_button () == paint_tool_button && !Input::get_singleton ()->is_command_or_control_pressed ( ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT)) {
3058
3058
if (selected_terrain_set < 0 || selected_terrain < 0 || (selected_type == SELECTED_TYPE_PATTERN && !selected_terrains_pattern.is_valid ())) {
3059
3059
return true ;
3060
3060
}
@@ -3069,14 +3069,14 @@ bool TileMapLayerEditorTerrainsPlugin::forward_canvas_gui_input(const Ref<InputE
3069
3069
drag_modified[E.key ] = edited_layer->get_cell (E.key );
3070
3070
edited_layer->set_cell (E.key , E.value .source_id , E.value .get_atlas_coords (), E.value .alternative_tile );
3071
3071
}
3072
- } else if (tool_buttons_group->get_pressed_button () == line_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && !Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ))) {
3072
+ } else if (tool_buttons_group->get_pressed_button () == line_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && !Input::get_singleton ()->is_command_or_control_pressed ( ))) {
3073
3073
if (selected_terrain_set < 0 || selected_terrain < 0 || (selected_type == SELECTED_TYPE_PATTERN && !selected_terrains_pattern.is_valid ())) {
3074
3074
return true ;
3075
3075
}
3076
3076
drag_type = DRAG_TYPE_LINE;
3077
3077
drag_start_mouse_pos = mpos;
3078
3078
drag_modified.clear ();
3079
- } else if (tool_buttons_group->get_pressed_button () == rect_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ))) {
3079
+ } else if (tool_buttons_group->get_pressed_button () == rect_tool_button || (tool_buttons_group->get_pressed_button () == paint_tool_button && Input::get_singleton ()->is_key_pressed (Key::SHIFT) && Input::get_singleton ()->is_command_or_control_pressed ( ))) {
3080
3080
if (selected_terrain_set < 0 || selected_terrain < 0 || (selected_type == SELECTED_TYPE_PATTERN && !selected_terrains_pattern.is_valid ())) {
3081
3081
return true ;
3082
3082
}
@@ -3147,7 +3147,7 @@ void TileMapLayerEditorTerrainsPlugin::forward_canvas_draw_over_viewport(Control
3147
3147
tile_xform.set_scale (tile_shape_size);
3148
3148
tile_set->draw_tile_shape (p_overlay, xform * tile_xform, Color (1.0 , 1.0 , 1.0 ), false );
3149
3149
}
3150
- } else if (!picker_button->is_pressed () && !(drag_type == DRAG_TYPE_NONE && Input::get_singleton ()->is_key_pressed (Key::CMD_OR_CTRL ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
3150
+ } else if (!picker_button->is_pressed () && !(drag_type == DRAG_TYPE_NONE && Input::get_singleton ()->is_command_or_control_pressed ( ) && !Input::get_singleton ()->is_key_pressed (Key::SHIFT))) {
3151
3151
bool expand_grid = false ;
3152
3152
if (tool_buttons_group->get_pressed_button () == paint_tool_button && drag_type == DRAG_TYPE_NONE) {
3153
3153
// Preview for a single tile.
0 commit comments