Connected the last few buttons. Done with UI!

This commit is contained in:
Florian 2025-09-17 19:55:21 +02:00
parent f4ca41ae09
commit 4f35cb88f2
3 changed files with 45 additions and 9 deletions

View file

@ -4,12 +4,11 @@ func _on_button_quit_pressed() -> void:
get_tree().quit() get_tree().quit()
func _on_button_main_menu_pressed() -> void: func _on_button_main_menu_pressed() -> void:
print("TODO") Engine.time_scale = 1.
pass # TODO get_tree().change_scene_to_file("res://main_menu/main_menu.tscn")
func _on_player_player_died() -> void: func _on_player_player_died() -> void:
visible = true visible = true
Engine.time_scale = 0.2 Engine.time_scale = 0.2

View file

@ -4,3 +4,7 @@ extends Node
func _on_button_start_pressed() -> void: func _on_button_start_pressed() -> void:
get_tree().change_scene_to_file("res://main.tscn") get_tree().change_scene_to_file("res://main.tscn")
func _on_button_quit_pressed() -> void:
get_tree().quit()

View file

@ -13,11 +13,18 @@ corner_radius_top_right = 350
corner_radius_bottom_right = 350 corner_radius_bottom_right = 350
corner_radius_bottom_left = 350 corner_radius_bottom_left = 350
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3shxk"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3f7m4"]
draw_center = false
border_color = Color(0.8, 0.8, 0.8, 0)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_bws42"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_bws42"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3f7m4"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bws42"]
bg_color = Color(0, 0, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="main" type="Node"] [node name="main" type="Node"]
script = ExtResource("1_bws42") script = ExtResource("1_bws42")
@ -64,10 +71,36 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_d3a7t")
[node name="ButtonStart" type="Button" parent="CanvasLayer/Control/PanelContainer"] [node name="ButtonStart" type="Button" parent="CanvasLayer/Control/PanelContainer"]
layout_mode = 2 layout_mode = 2
theme_type_variation = &"FlatButton" theme_type_variation = &"FlatButton"
theme_override_styles/pressed = SubResource("StyleBoxEmpty_3shxk") theme_override_styles/pressed = SubResource("StyleBoxFlat_3f7m4")
theme_override_styles/hover = SubResource("StyleBoxEmpty_bws42") theme_override_styles/focus = SubResource("StyleBoxEmpty_bws42")
theme_override_styles/focus = SubResource("StyleBoxEmpty_3f7m4") text = "PLAY"
text = "Play Again"
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/Control"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -400.0
offset_top = -100.0
grow_horizontal = 0
grow_vertical = 0
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 50
theme_override_constants/margin_right = 50
theme_override_constants/margin_bottom = 50
[node name="PanelContainer" type="PanelContainer" parent="CanvasLayer/Control/MarginContainer"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_bws42")
[node name="Button_Quit" type="Button" parent="CanvasLayer/Control/MarginContainer/PanelContainer"]
custom_minimum_size = Vector2(400, 100)
layout_mode = 2
theme_type_variation = &"FlatButton"
text = "Quit Forever"
[connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"] [connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"]
[connection signal="pressed" from="CanvasLayer/Control/PanelContainer/ButtonStart" to="." method="_on_button_start_pressed"] [connection signal="pressed" from="CanvasLayer/Control/PanelContainer/ButtonStart" to="." method="_on_button_start_pressed"]
[connection signal="pressed" from="CanvasLayer/Control/MarginContainer/PanelContainer/Button_Quit" to="." method="_on_button_quit_pressed"]