Menu improvements
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://b47b6tt142b25" path="res://assets/sprites/main_menu.BMP" id="3_bqqt6"]
|
||||
[ext_resource type="AudioStream" uid="uid://5ndo4w06umsa" path="res://assets/sounds/SE020.WAV" id="4_wu84c"]
|
||||
[ext_resource type="Texture2D" uid="uid://8kr4vmvhu03p" path="res://assets/sprites/menu_selector_flame.BMP" id="5_flame"]
|
||||
[ext_resource type="AudioStream" uid="uid://d1hacs4t5qni1" path="res://assets/sounds/SE015.WAV" id="5_rtw2f"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wu84c"]
|
||||
atlas = ExtResource("3_bqqt6")
|
||||
@@ -37,12 +38,14 @@ script/source = "extends VBoxContainer
|
||||
@onready var hover_sfx: AudioStreamPlayer = $HoverSFX
|
||||
@onready var left_indicator: Control = %LeftIndicator
|
||||
@onready var right_indicator: Control = %RightIndicator
|
||||
@onready var click_sfx: AudioStreamPlayer = $ClickSFX
|
||||
|
||||
func _ready() -> void:
|
||||
for child in get_children():
|
||||
if child is TextureButton:
|
||||
child.mouse_entered.connect(_on_button_hovered.bind(child))
|
||||
child.mouse_exited.connect(_on_button_unhovered)
|
||||
child.pressed.connect(_on_button_clicked)
|
||||
|
||||
func _on_button_hovered(button: TextureButton) -> void:
|
||||
hover_sfx.play()
|
||||
@@ -55,6 +58,9 @@ func _on_button_hovered(button: TextureButton) -> void:
|
||||
func _on_button_unhovered() -> void:
|
||||
left_indicator.visible = false
|
||||
right_indicator.visible = false
|
||||
|
||||
func _on_button_clicked() -> void:
|
||||
click_sfx.play()
|
||||
"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tbmy8"]
|
||||
@@ -82,6 +88,7 @@ const MAP_LAYOUT := \"\"\"\\
|
||||
#####\"\"\"
|
||||
|
||||
func _pressed() -> void:
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
var combat_instance := COMBAT_SCENE.instantiate()
|
||||
var combat_map: CombatMap = combat_instance.find_child(\"CombatMap\")
|
||||
|
||||
@@ -147,6 +154,7 @@ resource_name = "ExitButton"
|
||||
script/source = "extends TextureButton
|
||||
|
||||
func _pressed():
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
get_tree().quit(0)
|
||||
"
|
||||
|
||||
@@ -382,6 +390,9 @@ metadata/_edit_use_anchors_ = true
|
||||
[node name="HoverSFX" type="AudioStreamPlayer" parent="Buttons" unique_id=256435189]
|
||||
stream = ExtResource("4_wu84c")
|
||||
|
||||
[node name="ClickSFX" type="AudioStreamPlayer" parent="Buttons" unique_id=2129807302]
|
||||
stream = ExtResource("5_rtw2f")
|
||||
|
||||
[node name="StartButton" type="TextureButton" parent="Buttons" unique_id=973041905]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
@@ -422,10 +433,10 @@ offset_right = 50.0
|
||||
offset_bottom = 50.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="LeftIndicator" unique_id=1510731086]
|
||||
position = Vector2(0, 15)
|
||||
texture = SubResource("AtlasTexture_tcusk")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="LeftIndicator" unique_id=1906133697]
|
||||
modulate = Color(1, 1, 1, 0.7411765)
|
||||
material = SubResource("CanvasItemMaterial_8ln24")
|
||||
scale = Vector2(0.75, 0.75)
|
||||
sprite_frames = SubResource("SpriteFrames_tcusk")
|
||||
@@ -441,6 +452,7 @@ offset_right = 50.0
|
||||
offset_bottom = 50.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="RightIndicator" unique_id=979863490]
|
||||
position = Vector2(0, 15)
|
||||
texture = SubResource("AtlasTexture_tcusk")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="RightIndicator" unique_id=1047794140]
|
||||
|
||||
Reference in New Issue
Block a user