From 8efbf0bf833ba5431b198ea5acf31ec790ecaa58 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:40:02 +0200 Subject: [PATCH] Add more keyboard shortcuts --- project.godot | 20 ++++++++++++++++++++ src/UI/TilesPanel.tscn | 30 +++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/project.godot b/project.godot index a899ba5a1..aa3a195ef 100644 --- a/project.godot +++ b/project.godot @@ -925,6 +925,26 @@ show_pixel_indices={ "deadzone": 0.5, "events": [] } +toggle_draw_tiles_mode={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +tile_edit_mode_manual={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":33,"location":0,"echo":false,"script":null) +] +} +tile_edit_mode_auto={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":64,"location":0,"echo":false,"script":null) +] +} +tile_edit_mode_stack={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":51,"key_label":0,"unicode":35,"location":0,"echo":false,"script":null) +] +} tile_rotate_left={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":90,"location":0,"echo":false,"script":null) diff --git a/src/UI/TilesPanel.tscn b/src/UI/TilesPanel.tscn index d92e5f031..a247c87f6 100644 --- a/src/UI/TilesPanel.tscn +++ b/src/UI/TilesPanel.tscn @@ -1,10 +1,16 @@ -[gd_scene load_steps=14 format=3 uid="uid://bfbragmmdwfbl"] +[gd_scene load_steps=22 format=3 uid="uid://bfbragmmdwfbl"] [ext_resource type="Script" path="res://src/UI/TilesPanel.gd" id="1_d2oc5"] [ext_resource type="Texture2D" uid="uid://bv7ldl8obhawm" path="res://assets/graphics/misc/icon_reload.png" id="2_r1kie"] [ext_resource type="Texture2D" uid="uid://bpsfilx47bw3r" path="res://assets/graphics/misc/mirror_x.svg" id="3_5o62r"] [ext_resource type="Texture2D" uid="uid://bk6iaxiyl74ih" path="res://assets/graphics/misc/mirror_y.svg" id="4_2xhnr"] +[sub_resource type="InputEventAction" id="InputEventAction_klv67"] +action = &"toggle_draw_tiles_mode" + +[sub_resource type="Shortcut" id="Shortcut_6ebuw"] +events = [SubResource("InputEventAction_klv67")] + [sub_resource type="InputEventAction" id="InputEventAction_yr0lx"] action = &"tile_rotate_left" @@ -31,6 +37,24 @@ events = [SubResource("InputEventAction_18g3a")] [sub_resource type="ButtonGroup" id="ButtonGroup_uxnt0"] +[sub_resource type="InputEventAction" id="InputEventAction_mhgo3"] +action = &"tile_edit_mode_manual" + +[sub_resource type="Shortcut" id="Shortcut_pgg48"] +events = [SubResource("InputEventAction_mhgo3")] + +[sub_resource type="InputEventAction" id="InputEventAction_h1wos"] +action = &"tile_edit_mode_auto" + +[sub_resource type="Shortcut" id="Shortcut_a0fx5"] +events = [SubResource("InputEventAction_h1wos")] + +[sub_resource type="InputEventAction" id="InputEventAction_i4ufh"] +action = &"tile_edit_mode_stack" + +[sub_resource type="Shortcut" id="Shortcut_ysxej"] +events = [SubResource("InputEventAction_i4ufh")] + [node name="Tiles" type="PanelContainer"] anchors_preset = 15 anchor_right = 1.0 @@ -45,6 +69,7 @@ layout_mode = 2 [node name="PlaceTiles" type="CheckBox" parent="VBoxContainer"] layout_mode = 2 mouse_default_cursor_shape = 2 +shortcut = SubResource("Shortcut_6ebuw") text = "Draw tiles" [node name="TransformButtonsContainer" type="HFlowContainer" parent="VBoxContainer"] @@ -126,6 +151,7 @@ layout_mode = 2 layout_mode = 2 mouse_default_cursor_shape = 2 button_group = SubResource("ButtonGroup_uxnt0") +shortcut = SubResource("Shortcut_pgg48") text = "Manual" [node name="Auto" type="CheckBox" parent="VBoxContainer/ModeButtonsContainer"] @@ -133,12 +159,14 @@ layout_mode = 2 mouse_default_cursor_shape = 2 button_pressed = true button_group = SubResource("ButtonGroup_uxnt0") +shortcut = SubResource("Shortcut_a0fx5") text = "Auto" [node name="Stack" type="CheckBox" parent="VBoxContainer/ModeButtonsContainer"] layout_mode = 2 mouse_default_cursor_shape = 2 button_group = SubResource("ButtonGroup_uxnt0") +shortcut = SubResource("Shortcut_ysxej") text = "Stack" [node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]