ui bug fix
This commit is contained in:
@@ -5,12 +5,10 @@ extends Control
|
||||
@onready var settings_button: Button = $%SettingsButton
|
||||
@onready var save_button: Button = $%SaveButton
|
||||
@onready var quit_button: Button = $%QuitButton
|
||||
@onready var show_container_tween: ContainerTween = $%ShowContainerTween
|
||||
@onready var hide_container_tween: ContainerTween = $%HideContainerTween
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
play_button.pressed.connect(_on_play_button_pressed)
|
||||
settings_button.pressed.connect(_on_settings_button_pressed)
|
||||
save_button.pressed.connect(_on_save_button_pressed)
|
||||
quit_button.pressed.connect(_on_quit_button_pressed)
|
||||
|
||||
@@ -23,9 +21,3 @@ func _on_save_button_pressed() -> void:
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
GameState.quit_game()
|
||||
|
||||
func _on_settings_button_pressed() -> void:
|
||||
if $%SettingsMenu.visible:
|
||||
hide_container_tween.start_tween()
|
||||
else:
|
||||
show_container_tween.start_tween()
|
||||
|
||||
16
core/main_menu/main_menu.gd
Normal file
16
core/main_menu/main_menu.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends Control
|
||||
|
||||
@onready var settings_menu: Control = $%SettingsMenu
|
||||
@onready var option_menu: Control = $%OptionMenu
|
||||
@onready var show_container_tween: ContainerTween = $%ShowContainerTween
|
||||
@onready var hide_container_tween: ContainerTween = $%HideContainerTween
|
||||
|
||||
func _ready() -> void:
|
||||
option_menu.settings_button.pressed.connect(_on_settings_button_pressed)
|
||||
|
||||
|
||||
func _on_settings_button_pressed() -> void:
|
||||
if settings_menu.visible:
|
||||
hide_container_tween.start_tween()
|
||||
else:
|
||||
show_container_tween.start_tween()
|
||||
1
core/main_menu/main_menu.gd.uid
Normal file
1
core/main_menu/main_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://csqxuftsnv1br
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://btcpge7cj2041"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://csqxuftsnv1br" path="res://core/main_menu/main_menu.gd" id="1_jy6on"]
|
||||
[ext_resource type="PackedScene" uid="uid://cxf8s80ivwj1p" path="res://core/game_menu/option_menu.tscn" id="1_uvy4f"]
|
||||
[ext_resource type="Texture2D" uid="uid://buy4x63u237np" path="res://core/main_menu/assets/main_menu_background.png" id="2_mloc8"]
|
||||
[ext_resource type="PackedScene" uid="uid://caqf471x0kttc" path="res://core/game_menu/settings_menu.tscn" id="3_26agx"]
|
||||
@@ -12,6 +13,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_jy6on")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="." unique_id=11805511]
|
||||
layout_mode = 1
|
||||
@@ -23,6 +25,7 @@ grow_vertical = 2
|
||||
texture = ExtResource("2_mloc8")
|
||||
|
||||
[node name="OptionMenu" parent="." unique_id=1055457221 instance=ExtResource("1_uvy4f")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 6
|
||||
anchor_left = 1.0
|
||||
|
||||
@@ -113,6 +113,21 @@ layout_mode = 2
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AudioPlayer" parent="." unique_id=425192018 node_paths=PackedStringArray("radio") instance=ExtResource("7_lapqe")]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -146.0
|
||||
offset_top = -57.0
|
||||
offset_right = -146.0
|
||||
offset_bottom = -57.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
radio = NodePath("../Radio")
|
||||
|
||||
[node name="GameMenuPanel" type="Panel" parent="." unique_id=846120687]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
@@ -130,21 +145,6 @@ layout_mode = 1
|
||||
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("5_nevjt")]
|
||||
playlist = Array[AudioStream]([ExtResource("6_kd244")])
|
||||
|
||||
[node name="AudioPlayer" parent="." unique_id=425192018 node_paths=PackedStringArray("radio") instance=ExtResource("7_lapqe")]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -146.0
|
||||
offset_top = -57.0
|
||||
offset_right = -146.0
|
||||
offset_bottom = -57.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
radio = NodePath("../Radio")
|
||||
|
||||
[node name="ShowContainerTween" parent="." unique_id=902285649 node_paths=PackedStringArray("targets") instance=ExtResource("8_msh61")]
|
||||
unique_name_in_owner = true
|
||||
targets = [NodePath("../GameMenuPanel/GameMenu")]
|
||||
|
||||
Reference in New Issue
Block a user