Skip to content

Commit

Permalink
add: shortcut keys for buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
stmSi committed Jan 29, 2024
1 parent 8c3d54d commit 204cb3b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 8 deletions.
13 changes: 11 additions & 2 deletions src/ExerciseEditor/exercise_editor.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=34 format=3 uid="uid://dusuxw5u4uhul"]
[gd_scene load_steps=36 format=3 uid="uid://dusuxw5u4uhul"]

[ext_resource type="Theme" uid="uid://dppj17ign8l2n" path="res://src/Themes/main.tres" id="1_p01ag"]
[ext_resource type="Script" path="res://src/ExerciseEditor/exercise_editor.gd" id="1_sslhb"]
Expand Down Expand Up @@ -43,6 +43,14 @@ events = [SubResource("InputEventKey_iny2v")]
script/source = "extends CustomButton
"

[sub_resource type="InputEventKey" id="InputEventKey_378uw"]
device = -1
keycode = 88
unicode = 120

[sub_resource type="Shortcut" id="Shortcut_d871w"]
events = [SubResource("InputEventKey_378uw")]

[sub_resource type="GDScript" id="GDScript_5es36"]
script/source = "extends CustomButton

Expand Down Expand Up @@ -263,7 +271,8 @@ script = SubResource("GDScript_y6yfr")
[node name="ExitToMenuBtn" type="Button" parent="MarginContainer2/VBoxContainer/HBoxContainer/LessonsContainer" groups=["scene_change_element"]]
custom_minimum_size = Vector2(200, 40)
layout_mode = 2
text = "Exit To Menu"
shortcut = SubResource("Shortcut_d871w")
text = "E(x)it To Menu"
script = SubResource("GDScript_5es36")

[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer2/VBoxContainer/HBoxContainer"]
Expand Down
57 changes: 51 additions & 6 deletions src/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=3 uid="uid://cnx3k4cy1imd"]
[gd_scene load_steps=33 format=3 uid="uid://cnx3k4cy1imd"]

[ext_resource type="Theme" uid="uid://dppj17ign8l2n" path="res://src/Themes/main.tres" id="1_wgeyo"]
[ext_resource type="Script" path="res://src/main.gd" id="1_xgqc1"]
Expand All @@ -19,6 +19,14 @@
background_color = Color(0.423529, 0.423529, 0.423529, 1)
ambient_light_source = 2

[sub_resource type="InputEventKey" id="InputEventKey_1l8wj"]
device = -1
keycode = 76
unicode = 108

[sub_resource type="Shortcut" id="Shortcut_25xlf"]
events = [SubResource("InputEventKey_1l8wj")]

[sub_resource type="GDScript" id="GDScript_6o4cl"]
script/source = "extends CustomButton

Expand All @@ -27,6 +35,14 @@ func _on_pressed() -> void:
pass # R%TakeLessonBtneplace with function body.
"

[sub_resource type="InputEventKey" id="InputEventKey_4a3hf"]
device = -1
keycode = 80
unicode = 112

[sub_resource type="Shortcut" id="Shortcut_cxmsr"]
events = [SubResource("InputEventKey_4a3hf")]

[sub_resource type="GDScript" id="GDScript_dlcgn"]
script/source = "extends CustomButton

Expand All @@ -46,6 +62,14 @@ func _on_pressed() -> void:
SceneChanger.change_to_network_competition_scene()
"

[sub_resource type="InputEventKey" id="InputEventKey_ws8em"]
device = -1
keycode = 69
unicode = 101

[sub_resource type="Shortcut" id="Shortcut_haa07"]
events = [SubResource("InputEventKey_ws8em")]

[sub_resource type="GDScript" id="GDScript_hpd8f"]
script/source = "extends CustomButton

Expand All @@ -58,6 +82,14 @@ func _on_pressed() -> void:
pass # Replace with function body.
"

[sub_resource type="InputEventKey" id="InputEventKey_e8w6m"]
device = -1
keycode = 83
unicode = 115

[sub_resource type="Shortcut" id="Shortcut_fdxuy"]
events = [SubResource("InputEventKey_e8w6m")]

[sub_resource type="GDScript" id="GDScript_d0c1b"]
script/source = "extends CustomButton

Expand All @@ -67,6 +99,14 @@ func _on_pressed() -> void:
pass # Replace with function body.
"

[sub_resource type="InputEventKey" id="InputEventKey_0fb7p"]
device = -1
keycode = 88
unicode = 120

[sub_resource type="Shortcut" id="Shortcut_ucryw"]
events = [SubResource("InputEventKey_0fb7p")]

[sub_resource type="GDScript" id="GDScript_l5vsv"]
script/source = "extends CustomButton

Expand Down Expand Up @@ -124,7 +164,8 @@ custom_minimum_size = Vector2(250, 60)
layout_mode = 2
size_flags_vertical = 4
theme_override_font_sizes/font_size = 21
text = "Step by Step Lessons"
shortcut = SubResource("Shortcut_25xlf")
text = "Step by Step (L)essons"
icon = ExtResource("4_g7xuq")
script = SubResource("GDScript_6o4cl")

Expand All @@ -133,7 +174,8 @@ custom_minimum_size = Vector2(250, 60)
layout_mode = 2
size_flags_vertical = 4
theme_override_font_sizes/font_size = 21
text = "Practice"
shortcut = SubResource("Shortcut_cxmsr")
text = "(P)ractice"
icon = ExtResource("5_nb47a")
script = SubResource("GDScript_dlcgn")

Expand All @@ -154,7 +196,8 @@ custom_minimum_size = Vector2(250, 60)
layout_mode = 2
size_flags_vertical = 4
theme_override_font_sizes/font_size = 21
text = "Exercise Editor"
shortcut = SubResource("Shortcut_haa07")
text = "(E)xercise Editor"
icon = ExtResource("7_o4aed")
script = SubResource("GDScript_hpd8f")

Expand All @@ -163,7 +206,8 @@ custom_minimum_size = Vector2(250, 60)
layout_mode = 2
size_flags_vertical = 4
theme_override_font_sizes/font_size = 21
text = "Settings"
shortcut = SubResource("Shortcut_fdxuy")
text = "(S)ettings"
icon = ExtResource("8_2y7oh")
script = SubResource("GDScript_d0c1b")

Expand All @@ -172,7 +216,8 @@ custom_minimum_size = Vector2(250, 60)
layout_mode = 2
size_flags_vertical = 4
theme_override_font_sizes/font_size = 21
text = "Exit"
shortcut = SubResource("Shortcut_ucryw")
text = "E(x)it"
icon = ExtResource("9_on2em")
script = SubResource("GDScript_l5vsv")

Expand Down

0 comments on commit 204cb3b

Please sign in to comment.