This commit is contained in:
Rendo 2025-07-12 22:06:56 +05:00
commit 175d813230
3 changed files with 79 additions and 12 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://cfnmspei3k4p7"]
[gd_scene load_steps=32 format=3 uid="uid://cfnmspei3k4p7"]
[ext_resource type="PackedScene" uid="uid://ky35veswaytr" path="res://scenes/gui/sun_counter.tscn" id="1_le3od"]
[ext_resource type="Theme" uid="uid://b8l285cjcgeyi" path="res://resources/themes/GameStyle.tres" id="1_xf6ra"]
@ -19,6 +19,72 @@ texture_margin_right = 4.0
texture_margin_bottom = 4.0
axis_stretch_horizontal = 1
[sub_resource type="GDScript" id="GDScript_lxxir"]
resource_name = "shortcutter"
script/source = "extends Node
@export var keys : Array[InputEventKey]
@export var where_to_map : Node
func _ready() -> void:
while get_tree().paused:
await get_tree().process_frame
for i in range(where_to_map.get_child_count()):
var key = InputEventKey.new()
where_to_map.get_child(i).shortcut = Shortcut.new()
where_to_map.get_child(i).shortcut.events.append(keys[i])
"
[sub_resource type="InputEventKey" id="InputEventKey_lxxir"]
device = -1
keycode = 49
unicode = 49
[sub_resource type="InputEventKey" id="InputEventKey_5kkbf"]
device = -1
keycode = 50
unicode = 50
[sub_resource type="InputEventKey" id="InputEventKey_xq48m"]
device = -1
keycode = 51
unicode = 51
[sub_resource type="InputEventKey" id="InputEventKey_cti1a"]
device = -1
keycode = 52
unicode = 52
[sub_resource type="InputEventKey" id="InputEventKey_s07y0"]
device = -1
keycode = 53
unicode = 53
[sub_resource type="InputEventKey" id="InputEventKey_hmpwl"]
device = -1
keycode = 54
unicode = 54
[sub_resource type="InputEventKey" id="InputEventKey_kqrbi"]
device = -1
keycode = 55
unicode = 55
[sub_resource type="InputEventKey" id="InputEventKey_s6pj4"]
device = -1
keycode = 56
unicode = 56
[sub_resource type="InputEventKey" id="InputEventKey_ar74i"]
device = -1
keycode = 57
unicode = 57
[sub_resource type="InputEventKey" id="InputEventKey_k8sc7"]
device = -1
keycode = 48
unicode = 48
[sub_resource type="InputEventAction" id="InputEventAction_xq48m"]
action = &"short_shovel"
pressed = true
@ -128,6 +194,12 @@ layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 0
[node name="ShortcutSetter" type="Node" parent="MarginContainer/Control/Hotbar/PanelContainer" node_paths=PackedStringArray("where_to_map")]
process_mode = 1
script = SubResource("GDScript_lxxir")
keys = Array[InputEventKey]([SubResource("InputEventKey_lxxir"), SubResource("InputEventKey_5kkbf"), SubResource("InputEventKey_xq48m"), SubResource("InputEventKey_cti1a"), SubResource("InputEventKey_s07y0"), SubResource("InputEventKey_hmpwl"), SubResource("InputEventKey_kqrbi"), SubResource("InputEventKey_s6pj4"), SubResource("InputEventKey_ar74i"), SubResource("InputEventKey_k8sc7")])
where_to_map = NodePath("../Seedpackets")
[node name="Space" type="Control" parent="MarginContainer/Control/Hotbar"]
layout_mode = 2
size_flags_horizontal = 3