full gamepad support

This commit is contained in:
Rendo 2025-07-28 18:03:26 +05:00
commit a57d79e84a
21 changed files with 213 additions and 46 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=3 uid="uid://dpxxjfd5lv5sv"]
[gd_scene load_steps=23 format=3 uid="uid://dpxxjfd5lv5sv"]
[ext_resource type="Theme" uid="uid://e8n88g31w7x7" path="res://assets/themes/ChooseYourSeeds.tres" id="1_bfo8i"]
[ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="2_so2bw"]
@ -7,13 +7,16 @@
[ext_resource type="Script" uid="uid://eq3ecja30mlj" path="res://scripts/gui/choose_your_seeds/GridLoader.cs" id="4_i7sou"]
[ext_resource type="PackedScene" uid="uid://10b1egek6upx" path="res://scenes/gui/level_run_button.tscn" id="5_n80ic"]
[ext_resource type="Script" uid="uid://d26waisd3v488" path="res://scripts/gui/choose_your_seeds/LevelRunButton.cs" id="7_k6b6g"]
[ext_resource type="Texture2D" uid="uid://y2hhywmmy0t5" path="res://assets/sprites/lehauico.png" id="8_f8xw6"]
[ext_resource type="Texture2D" uid="uid://drydueofrb448" path="res://assets/sprites/gui/almanach/book.tres" id="8_hmdmm"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="8_v7xff"]
[ext_resource type="Script" uid="uid://diwjgekhvn017" path="res://scripts/gui/choose_your_seeds/CYSResetButton.cs" id="9_kwnqh"]
[ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="9_v7xff"]
[ext_resource type="Script" uid="uid://c1x4n4nqyq72f" path="res://scripts/audio/ChannelSettings.cs" id="10_nlh6x"]
[ext_resource type="PackedScene" uid="uid://bvpt0q4j6nx18" path="res://scenes/gui/almanach.tscn" id="11_nlh6x"]
[ext_resource type="AudioStream" uid="uid://mu86q1r1dvgo" path="res://assets/audio/music/03. Choose Your Seeds.mp3" id="13_y65t1"]
[ext_resource type="Script" uid="uid://b4ysi1iutmju3" path="res://scripts/audio/ChooseYourSeedsMusic.cs" id="14_rptyw"]
[ext_resource type="Script" uid="uid://bksslrqq5vhm3" path="res://scripts/gui/choose_your_seeds/CYSFocusSetup.cs" id="15_rptyw"]
[sub_resource type="ViewportTexture" id="ViewportTexture_rmoaa"]
viewport_path = NodePath("Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame/Previewport")
@ -28,8 +31,8 @@ script/source = "extends Button
func _pressed() -> void:
$\"../../Independer/Almanach\".visible = true
$\"../../ChannelPlayer\".call(\"Play\")
$\"../../../Independer/Almanach\".visible = true
$\"../../../ChannelPlayer\".call(\"Play\")
"
[sub_resource type="Resource" id="Resource_l66rp"]
@ -114,6 +117,7 @@ size_flags_horizontal = 3
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer"]
layout_mode = 2
focus_mode = 2
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer"]
@ -141,22 +145,33 @@ layout_mode = 2
columns = 7
script = ExtResource("4_i7sou")
[node name="LevelRunButton" parent="Panel" instance=ExtResource("5_n80ic")]
[node name="ButtonContainer" type="VBoxContainer" parent="Panel"]
layout_mode = 1
anchors_preset = -1
anchor_left = 1.0
anchor_right = 1.181
anchor_bottom = 0.131
offset_right = -16.16
offset_bottom = -16.016
anchor_right = 1.18889
anchor_bottom = 0.997024
grow_vertical = 2
metadata/_edit_use_anchors_ = true
[node name="LevelRunButton" parent="Panel/ButtonContainer" instance=ExtResource("5_n80ic")]
layout_mode = 2
focus_neighbor_left = NodePath("../../MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer")
focus_neighbor_bottom = NodePath("../Button")
script = ExtResource("7_k6b6g")
[node name="AlmanachButton" type="Button" parent="Panel"]
layout_mode = 0
anchor_left = 1.0
anchor_top = 0.883929
anchor_right = 1.14167
anchor_bottom = 1.0
offset_bottom = -3.05176e-05
[node name="Button" type="Button" parent="Panel/ButtonContainer"]
layout_mode = 2
focus_neighbor_top = NodePath("../LevelRunButton")
focus_neighbor_bottom = NodePath("../AlmanachButton")
icon = ExtResource("8_f8xw6")
icon_alignment = 1
script = ExtResource("9_kwnqh")
[node name="AlmanachButton" type="Button" parent="Panel/ButtonContainer"]
layout_mode = 2
focus_neighbor_left = NodePath("../../MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer")
focus_neighbor_top = NodePath("../Button")
icon = ExtResource("8_hmdmm")
icon_alignment = 1
script = SubResource("GDScript_hmdmm")
@ -180,4 +195,10 @@ autoplay = true
bus = &"MusicBus"
script = ExtResource("14_rptyw")
[connection signal="pressed" from="Panel/LevelRunButton" to="ChannelPlayer" method="Play"]
[node name="FocusSetup" type="Node" parent="." node_paths=PackedStringArray("grid", "button", "textContainer")]
script = ExtResource("15_rptyw")
grid = NodePath("../Panel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer")
button = NodePath("../Panel/ButtonContainer/LevelRunButton")
textContainer = NodePath("../Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer")
[connection signal="pressed" from="Panel/ButtonContainer/LevelRunButton" to="ChannelPlayer" method="Play"]