Added victory screen
This commit is contained in:
@@ -9,7 +9,7 @@ action = &"ui_cancel"
|
||||
[sub_resource type="Shortcut" id="Shortcut_s4s14"]
|
||||
events = [SubResource("InputEventAction_g2smo")]
|
||||
|
||||
[node name="SeedSelection" type="Control"]
|
||||
[node name="SeedSelectionMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
extends Control
|
||||
|
||||
|
||||
signal show_main_menu
|
||||
|
||||
|
||||
@onready var main_menu_button : Button = $%MainMenuButton
|
||||
@onready var button_focus_timer : Timer = $ButtonFocusTimer
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
main_menu_button.grab_focus()
|
||||
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
show_main_menu.emit()
|
||||
|
||||
|
||||
func _on_visibility_changed() -> void:
|
||||
if visible and button_focus_timer:
|
||||
button_focus_timer.start()
|
||||
@@ -0,0 +1 @@
|
||||
uid://b0p1ewlw18ijg
|
||||
@@ -0,0 +1,45 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bdcs2ff85qjs4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b0p1ewlw18ijg" path="res://menu/victory_screen.gd" id="1_asigk"]
|
||||
[ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_wb4d8"]
|
||||
|
||||
[node name="VictoryScreen" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_asigk")
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer"]
|
||||
z_index = 100
|
||||
layout_mode = 2
|
||||
text = "Victory!"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="CenterContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
z_index = 100
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("2_wb4d8")
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="ButtonFocusTimer" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
|
||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
|
||||
[connection signal="timeout" from="ButtonFocusTimer" to="." method="_on_timer_timeout"]
|
||||
Reference in New Issue
Block a user