imported main menu scene addon
This commit is contained in:
26
evolve-die-repeat/scenes/windows/game_won_window.gd
Normal file
26
evolve-die-repeat/scenes/windows/game_won_window.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
@tool
|
||||
extends OverlaidWindow
|
||||
|
||||
signal continue_pressed
|
||||
signal main_menu_pressed
|
||||
|
||||
func _ready():
|
||||
if OS.has_feature("web"):
|
||||
%ExitButton.hide()
|
||||
|
||||
func _on_exit_button_pressed():
|
||||
%ExitConfirmation.show()
|
||||
|
||||
func _on_main_menu_button_pressed():
|
||||
%MainMenuConfirmation.show()
|
||||
|
||||
func _on_close_button_pressed():
|
||||
continue_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_main_menu_confirmation_confirmed():
|
||||
main_menu_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_exit_confirmation_confirmed():
|
||||
get_tree().quit()
|
||||
1
evolve-die-repeat/scenes/windows/game_won_window.gd.uid
Normal file
1
evolve-die-repeat/scenes/windows/game_won_window.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dsfwkcr0yyfkg
|
||||
60
evolve-die-repeat/scenes/windows/game_won_window.tscn
Normal file
60
evolve-die-repeat/scenes/windows/game_won_window.tscn
Normal file
@@ -0,0 +1,60 @@
|
||||
[gd_scene format=3 uid="uid://dv2hmqhj41nmr"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_lpba5"]
|
||||
[ext_resource type="Script" path="res://scenes/windows/game_won_window.gd" id="2_rvsdo"]
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="3_ga0ue"]
|
||||
|
||||
[node name="GameWonWindow" unique_id=862385343 instance=ExtResource("1_lpba5")]
|
||||
custom_minimum_size = Vector2(432, 240)
|
||||
script = ExtResource("2_rvsdo")
|
||||
update_content = true
|
||||
text = "You won!"
|
||||
close_button_text = "Continue"
|
||||
title_visible = false
|
||||
|
||||
[node name="TitleMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="0" unique_id=1262022916]
|
||||
visible = false
|
||||
|
||||
[node name="DescriptionLabel" parent="ContentContainer/BoxContainer/BodyMargin" parent_id_path=PackedInt32Array(590613964) index="0" unique_id=617407155]
|
||||
text = "You won!"
|
||||
|
||||
[node name="MenuButtons" parent="ContentContainer/BoxContainer/MenuButtonsMargin" parent_id_path=PackedInt32Array(1413292752) index="0" unique_id=1371114575]
|
||||
vertical = false
|
||||
|
||||
[node name="ExitButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="0" unique_id=809131362]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Exit"
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="1" unique_id=1169131466]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="2" unique_id=314526102]
|
||||
size_flags_horizontal = 3
|
||||
text = "Continue"
|
||||
|
||||
[node name="MainMenuConfirmation" parent="." index="1" unique_id=1489862545 instance=ExtResource("3_ga0ue")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(220, 0)
|
||||
layout_mode = 2
|
||||
text = "Exit to the main menu?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[node name="ExitConfirmation" parent="." index="2" unique_id=1941427183 instance=ExtResource("3_ga0ue")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Exit the game?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
|
||||
[connection signal="confirmed" from="MainMenuConfirmation" to="." method="_on_main_menu_confirmation_confirmed"]
|
||||
[connection signal="confirmed" from="ExitConfirmation" to="." method="_on_exit_confirmation_confirmed"]
|
||||
26
evolve-die-repeat/scenes/windows/level_lost_window.gd
Normal file
26
evolve-die-repeat/scenes/windows/level_lost_window.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
@tool
|
||||
extends OverlaidWindow
|
||||
|
||||
signal restart_pressed
|
||||
signal main_menu_pressed
|
||||
|
||||
func _ready():
|
||||
if OS.has_feature("web"):
|
||||
%ExitButton.hide()
|
||||
|
||||
func _on_exit_button_pressed():
|
||||
%ExitConfirmation.show()
|
||||
|
||||
func _on_main_menu_button_pressed():
|
||||
%MainMenuConfirmation.show()
|
||||
|
||||
func _on_close_button_pressed():
|
||||
restart_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_main_menu_confirmation_confirmed():
|
||||
main_menu_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_exit_confirmation_confirmed():
|
||||
get_tree().quit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://70x32kal3kpt
|
||||
58
evolve-die-repeat/scenes/windows/level_lost_window.tscn
Normal file
58
evolve-die-repeat/scenes/windows/level_lost_window.tscn
Normal file
@@ -0,0 +1,58 @@
|
||||
[gd_scene format=3 uid="uid://b31vngtb7lxa2"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_jt3uh"]
|
||||
[ext_resource type="Script" path="res://scenes/windows/level_lost_window.gd" id="2_6m2xx"]
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="3_o54tf"]
|
||||
|
||||
[node name="LevelLostWindow" unique_id=493104306 instance=ExtResource("1_jt3uh")]
|
||||
custom_minimum_size = Vector2(432, 240)
|
||||
script = ExtResource("2_6m2xx")
|
||||
update_content = true
|
||||
text = "You lost..."
|
||||
close_button_text = "Restart"
|
||||
title_visible = false
|
||||
|
||||
[node name="TitleMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="0" unique_id=1262022916]
|
||||
visible = false
|
||||
|
||||
[node name="DescriptionLabel" parent="ContentContainer/BoxContainer/BodyMargin" parent_id_path=PackedInt32Array(590613964) index="0" unique_id=617407155]
|
||||
text = "You lost..."
|
||||
|
||||
[node name="MenuButtons" parent="ContentContainer/BoxContainer/MenuButtonsMargin" parent_id_path=PackedInt32Array(1413292752) index="0" unique_id=1371114575]
|
||||
vertical = false
|
||||
|
||||
[node name="ExitButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="0" unique_id=1961310547]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Exit"
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="1" unique_id=1630609548]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="2" unique_id=314526102]
|
||||
size_flags_horizontal = 3
|
||||
text = "Restart"
|
||||
|
||||
[node name="MainMenuConfirmation" parent="." index="1" unique_id=390342294 instance=ExtResource("3_o54tf")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(220, 0)
|
||||
layout_mode = 2
|
||||
text = "Exit to the main menu?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[node name="ExitConfirmation" parent="." index="2" unique_id=2076311752 instance=ExtResource("3_o54tf")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Exit the game?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
|
||||
[connection signal="confirmed" from="MainMenuConfirmation" to="." method="_on_main_menu_confirmation_confirmed"]
|
||||
[connection signal="confirmed" from="ExitConfirmation" to="." method="_on_exit_confirmation_confirmed"]
|
||||
31
evolve-die-repeat/scenes/windows/level_won_window.gd
Normal file
31
evolve-die-repeat/scenes/windows/level_won_window.gd
Normal file
@@ -0,0 +1,31 @@
|
||||
@tool
|
||||
extends OverlaidWindow
|
||||
|
||||
signal continue_pressed
|
||||
signal main_menu_pressed
|
||||
signal restart_pressed
|
||||
|
||||
func _ready():
|
||||
if OS.has_feature("web"):
|
||||
%ExitButton.hide()
|
||||
|
||||
func _on_exit_button_pressed():
|
||||
%ExitConfirmation.show()
|
||||
|
||||
func _on_main_menu_button_pressed():
|
||||
%MainMenuConfirmation.show()
|
||||
|
||||
func _on_close_button_pressed():
|
||||
continue_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_main_menu_confirmation_confirmed():
|
||||
main_menu_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_restart_button_pressed():
|
||||
restart_pressed.emit()
|
||||
close()
|
||||
|
||||
func _on_exit_confirmation_confirmed():
|
||||
get_tree().quit()
|
||||
1
evolve-die-repeat/scenes/windows/level_won_window.gd.uid
Normal file
1
evolve-die-repeat/scenes/windows/level_won_window.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://djwfx2841d4n1
|
||||
66
evolve-die-repeat/scenes/windows/level_won_window.tscn
Normal file
66
evolve-die-repeat/scenes/windows/level_won_window.tscn
Normal file
@@ -0,0 +1,66 @@
|
||||
[gd_scene format=3 uid="uid://ch8b5ccmxnjo2"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_218i2"]
|
||||
[ext_resource type="Script" path="res://scenes/windows/level_won_window.gd" id="2_2bpb8"]
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="3_ss43f"]
|
||||
|
||||
[node name="LevelWonWindow" unique_id=568930815 instance=ExtResource("1_218i2")]
|
||||
custom_minimum_size = Vector2(432, 240)
|
||||
script = ExtResource("2_2bpb8")
|
||||
update_content = true
|
||||
text = "Level complete!"
|
||||
close_button_text = "Continue"
|
||||
title_visible = false
|
||||
|
||||
[node name="TitleMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="0" unique_id=1262022916]
|
||||
visible = false
|
||||
|
||||
[node name="DescriptionLabel" parent="ContentContainer/BoxContainer/BodyMargin" parent_id_path=PackedInt32Array(590613964) index="0" unique_id=617407155]
|
||||
text = "Level complete!"
|
||||
|
||||
[node name="MenuButtons" parent="ContentContainer/BoxContainer/MenuButtonsMargin" parent_id_path=PackedInt32Array(1413292752) index="0" unique_id=1371114575]
|
||||
vertical = false
|
||||
|
||||
[node name="ExitButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="0" unique_id=1553412824]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Exit"
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="1" unique_id=2132893693]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="RestartButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="2" unique_id=1391591256]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Restart"
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" index="3" unique_id=314526102]
|
||||
size_flags_horizontal = 3
|
||||
text = "Continue"
|
||||
|
||||
[node name="MainMenuConfirmation" parent="." index="1" unique_id=1746461395 instance=ExtResource("3_ss43f")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(220, 0)
|
||||
layout_mode = 2
|
||||
text = "Exit to the main menu?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[node name="ExitConfirmation" parent="." index="2" unique_id=1965127230 instance=ExtResource("3_ss43f")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Exit the game?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/RestartButton" to="." method="_on_restart_button_pressed"]
|
||||
[connection signal="confirmed" from="MainMenuConfirmation" to="." method="_on_main_menu_confirmation_confirmed"]
|
||||
[connection signal="confirmed" from="ExitConfirmation" to="." method="_on_exit_confirmation_confirmed"]
|
||||
@@ -0,0 +1,7 @@
|
||||
@tool
|
||||
extends "res://addons/maaacks_game_template/base/nodes/windows/overlaid_window_scene_container.gd"
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
if instance and instance.has_signal(&"end_reached"):
|
||||
instance.connect(&"end_reached", close)
|
||||
@@ -0,0 +1 @@
|
||||
uid://civblior38i0f
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_scene format=3 uid="uid://dlqsxp2qiqdpb"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window_scene_container.tscn" id="1_rkudv"]
|
||||
[ext_resource type="Script" path="res://scenes/windows/main_menu_credits_window.gd" id="2_bndrm"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/credits/scrollable_credits.tscn" id="3_8w6bb"]
|
||||
|
||||
[node name="MainMenuCreditsOverlaidWindow" unique_id=1453761674 instance=ExtResource("1_rkudv")]
|
||||
anchors_preset = 15
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 0.0
|
||||
offset_top = 0.0
|
||||
offset_right = 0.0
|
||||
offset_bottom = 0.0
|
||||
script = ExtResource("2_bndrm")
|
||||
packed_scene = ExtResource("3_8w6bb")
|
||||
|
||||
[node name="TitleMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="0" unique_id=1262022916]
|
||||
visible = false
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="0" unique_id=314526102]
|
||||
size_flags_horizontal = 0
|
||||
text = "Back"
|
||||
@@ -0,0 +1,28 @@
|
||||
[gd_scene format=3 uid="uid://bm14qu13csdji"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window_scene_container.tscn" id="1_miy0a"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/master_options_menu_with_tabs.tscn" id="2_mljqd"]
|
||||
|
||||
[node name="MainMenuOptionsOverlaidWindow" unique_id=1787637973 instance=ExtResource("1_miy0a")]
|
||||
anchors_preset = 15
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 0.0
|
||||
offset_top = 0.0
|
||||
offset_right = 0.0
|
||||
offset_bottom = 0.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
packed_scene = ExtResource("2_mljqd")
|
||||
update_content = true
|
||||
close_button_text = "Back"
|
||||
title_visible = false
|
||||
|
||||
[node name="TitleMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="0" unique_id=1262022916]
|
||||
visible = false
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="0" unique_id=314526102]
|
||||
size_flags_horizontal = 0
|
||||
text = "Back"
|
||||
117
evolve-die-repeat/scenes/windows/pause_menu.gd
Normal file
117
evolve-die-repeat/scenes/windows/pause_menu.gd
Normal file
@@ -0,0 +1,117 @@
|
||||
@tool
|
||||
extends OverlaidWindow
|
||||
|
||||
@export var options_menu_scene : PackedScene
|
||||
## Path to a main menu scene.
|
||||
## Will attempt to read from AppConfig if left empty.
|
||||
@export_file("*.tscn") var main_menu_scene_path : String
|
||||
@export_node_path(&"ConfirmationOverlaidWindow") var restart_confirmation_node_path : NodePath
|
||||
@export_node_path(&"ConfirmationOverlaidWindow") var main_menu_confirmation_node_path : NodePath
|
||||
@export_node_path(&"ConfirmationOverlaidWindow") var exit_confirmation_node_path : NodePath
|
||||
@export var menu_container_node_path : NodePath = ^".."
|
||||
|
||||
@onready var restart_confirmation : ConfirmationOverlaidWindow = get_node(restart_confirmation_node_path)
|
||||
@onready var main_menu_confirmation : ConfirmationOverlaidWindow = get_node(main_menu_confirmation_node_path)
|
||||
@onready var exit_confirmation : ConfirmationOverlaidWindow = get_node(exit_confirmation_node_path)
|
||||
@onready var menu_container : Node = get_node(menu_container_node_path)
|
||||
@onready var options_button = %OptionsButton
|
||||
@onready var main_menu_button = %MainMenuButton
|
||||
@onready var exit_button = %ExitButton
|
||||
|
||||
var open_window : Node
|
||||
var _ignore_first_cancel : bool = false
|
||||
|
||||
func get_main_menu_scene_path() -> String:
|
||||
if main_menu_scene_path.is_empty():
|
||||
return AppConfig.main_menu_scene_path
|
||||
return main_menu_scene_path
|
||||
|
||||
func close_window() -> void:
|
||||
if open_window != null:
|
||||
if open_window.has_method("close"):
|
||||
open_window.close()
|
||||
else:
|
||||
open_window.hide()
|
||||
open_window = null
|
||||
|
||||
func _disable_focus() -> void:
|
||||
for child in %MenuButtons.get_children():
|
||||
if child is Control:
|
||||
child.focus_mode = FOCUS_NONE
|
||||
|
||||
func _enable_focus() -> void:
|
||||
for child in %MenuButtons.get_children():
|
||||
if child is Control:
|
||||
child.focus_mode = FOCUS_ALL
|
||||
|
||||
func _load_scene(scene_path: String) -> void:
|
||||
_scene_tree.paused = false
|
||||
SceneLoader.load_scene(scene_path)
|
||||
|
||||
func _show_window(window : Control) -> void:
|
||||
_disable_focus.call_deferred()
|
||||
window.show()
|
||||
open_window = window
|
||||
await window.hidden
|
||||
open_window = null
|
||||
_enable_focus.call_deferred()
|
||||
|
||||
func _load_and_show_menu(scene : PackedScene) -> void:
|
||||
var window_instance : Control = scene.instantiate()
|
||||
window_instance.visible = false
|
||||
menu_container.add_child.call_deferred(window_instance)
|
||||
await _show_window(window_instance)
|
||||
window_instance.queue_free()
|
||||
|
||||
func _handle_cancel_input() -> void:
|
||||
if _ignore_first_cancel:
|
||||
_ignore_first_cancel = false
|
||||
return
|
||||
if open_window != null:
|
||||
close_window()
|
||||
else:
|
||||
super._handle_cancel_input()
|
||||
|
||||
func show() -> void:
|
||||
super.show()
|
||||
if Input.is_action_pressed("ui_cancel"):
|
||||
_ignore_first_cancel = true
|
||||
|
||||
func _refresh_exit_button() -> void:
|
||||
exit_button.visible = !OS.has_feature("web")
|
||||
|
||||
func _refresh_options_button() -> void:
|
||||
options_button.visible = options_menu_scene != null
|
||||
|
||||
func _refresh_main_menu_button() -> void:
|
||||
main_menu_button.visible = !get_main_menu_scene_path().is_empty()
|
||||
|
||||
func _ready() -> void:
|
||||
_refresh_exit_button()
|
||||
_refresh_options_button()
|
||||
_refresh_main_menu_button()
|
||||
restart_confirmation.confirmed.connect(_on_restart_confirmation_confirmed)
|
||||
main_menu_confirmation.confirmed.connect(_on_main_menu_confirmation_confirmed)
|
||||
exit_confirmation.confirmed.connect(_on_exit_confirmation_confirmed)
|
||||
|
||||
func _on_restart_button_pressed() -> void:
|
||||
_show_window(restart_confirmation)
|
||||
|
||||
func _on_options_button_pressed() -> void:
|
||||
_load_and_show_menu(options_menu_scene)
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
_show_window(main_menu_confirmation)
|
||||
|
||||
func _on_exit_button_pressed() -> void:
|
||||
_show_window(exit_confirmation)
|
||||
|
||||
func _on_restart_confirmation_confirmed() -> void:
|
||||
SceneLoader.reload_current_scene()
|
||||
close()
|
||||
|
||||
func _on_main_menu_confirmation_confirmed():
|
||||
_load_scene(get_main_menu_scene_path())
|
||||
|
||||
func _on_exit_confirmation_confirmed():
|
||||
get_tree().quit()
|
||||
1
evolve-die-repeat/scenes/windows/pause_menu.gd.uid
Normal file
1
evolve-die-repeat/scenes/windows/pause_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://rgxs4ktm1qf1
|
||||
82
evolve-die-repeat/scenes/windows/pause_menu.tscn
Normal file
82
evolve-die-repeat/scenes/windows/pause_menu.tscn
Normal file
@@ -0,0 +1,82 @@
|
||||
[gd_scene format=3 uid="uid://qyv16uiuxokm"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_yn032"]
|
||||
[ext_resource type="Script" path="res://scenes/windows/pause_menu.gd" id="2_00o4m"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/windows/pause_menu_options_window.tscn" id="3_mdvg7"]
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="4_6lma4"]
|
||||
|
||||
[node name="PauseMenu" unique_id=156357199 instance=ExtResource("1_yn032")]
|
||||
process_mode = 3
|
||||
custom_minimum_size = Vector2(256, 312)
|
||||
offset_left = -128.0
|
||||
offset_top = -155.0
|
||||
offset_right = 128.0
|
||||
offset_bottom = 157.0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
script = ExtResource("2_00o4m")
|
||||
options_menu_scene = ExtResource("3_mdvg7")
|
||||
main_menu_scene_path = ""
|
||||
restart_confirmation_node_path = NodePath("RestartConfirmation")
|
||||
main_menu_confirmation_node_path = NodePath("MainMenuConfirmation")
|
||||
exit_confirmation_node_path = NodePath("ExitConfirmation")
|
||||
menu_container_node_path = NodePath("..")
|
||||
pauses_game = true
|
||||
|
||||
[node name="TitleLabel" parent="ContentContainer/BoxContainer/TitleMargin/BoxContainer" parent_id_path=PackedInt32Array(1788474031) index="0" unique_id=1049966061]
|
||||
text = "Paused"
|
||||
|
||||
[node name="BodyMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="1" unique_id=590613964]
|
||||
visible = false
|
||||
|
||||
[node name="MenuButtonsMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="2" unique_id=1413292752]
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="0" unique_id=314526102]
|
||||
text = "Resume"
|
||||
|
||||
[node name="RestartButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="1" unique_id=1371657172]
|
||||
layout_mode = 2
|
||||
text = "Restart"
|
||||
|
||||
[node name="OptionsButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="2" unique_id=1126383675]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Options"
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="3" unique_id=928043706]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="ExitButton" type="Button" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="4" unique_id=1398257582]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Exit Game"
|
||||
|
||||
[node name="RestartConfirmation" parent="." index="1" unique_id=1405814931 instance=ExtResource("4_6lma4")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Restart the game?"
|
||||
title = "Confirm Restart"
|
||||
|
||||
[node name="MainMenuConfirmation" parent="." index="2" unique_id=1770307648 instance=ExtResource("4_6lma4")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(220, 0)
|
||||
layout_mode = 2
|
||||
text = "Exit to the main menu?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[node name="ExitConfirmation" parent="." index="3" unique_id=1587469343 instance=ExtResource("4_6lma4")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Exit the game?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/RestartButton" to="." method="_on_restart_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/OptionsButton" to="." method="_on_options_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
13
evolve-die-repeat/scenes/windows/pause_menu_layer.gd
Normal file
13
evolve-die-repeat/scenes/windows/pause_menu_layer.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var pause_menu = %PauseMenu
|
||||
|
||||
func _on_pause_menu_hidden():
|
||||
hide()
|
||||
|
||||
func _on_visibility_changed():
|
||||
if visible:
|
||||
pause_menu.show()
|
||||
|
||||
func _ready():
|
||||
visibility_changed.connect(_on_visibility_changed)
|
||||
1
evolve-die-repeat/scenes/windows/pause_menu_layer.gd.uid
Normal file
1
evolve-die-repeat/scenes/windows/pause_menu_layer.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://df8ch4715k8oo
|
||||
98
evolve-die-repeat/scenes/windows/pause_menu_layer.tscn
Normal file
98
evolve-die-repeat/scenes/windows/pause_menu_layer.tscn
Normal file
@@ -0,0 +1,98 @@
|
||||
[gd_scene format=3 uid="uid://drd6kloy08obm"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/windows/pause_menu_layer.gd" id="1_i1w7n"]
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="2_1r40g"]
|
||||
[ext_resource type="Script" path="res://scenes/windows/pause_menu.gd" id="3_okuwl"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/windows/pause_menu_options_window.tscn" id="4_mh1be"]
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="5_bgbk1"]
|
||||
|
||||
[node name="PauseMenuLayer" type="CanvasLayer" unique_id=914002369]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_i1w7n")
|
||||
|
||||
[node name="PauseMenu" parent="." unique_id=6629802 instance=ExtResource("2_1r40g")]
|
||||
unique_name_in_owner = true
|
||||
process_mode = 3
|
||||
custom_minimum_size = Vector2(256, 312)
|
||||
script = ExtResource("3_okuwl")
|
||||
options_menu_scene = ExtResource("4_mh1be")
|
||||
main_menu_scene_path = ""
|
||||
restart_confirmation_node_path = NodePath("../RestartConfirmation")
|
||||
main_menu_confirmation_node_path = NodePath("../MainMenuConfirmation")
|
||||
exit_confirmation_node_path = NodePath("../ExitConfirmation")
|
||||
menu_container_node_path = NodePath("..")
|
||||
pauses_game = true
|
||||
update_content = true
|
||||
title = "Paused"
|
||||
|
||||
[node name="TitleLabel" parent="PauseMenu/ContentContainer/BoxContainer/TitleMargin/BoxContainer" parent_id_path=PackedInt32Array(6629802, 1788474031) index="0" unique_id=1049966061]
|
||||
text = "Paused"
|
||||
|
||||
[node name="BodyMargin" parent="PauseMenu/ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(6629802, 394030069) index="1" unique_id=590613964]
|
||||
visible = false
|
||||
|
||||
[node name="MenuButtonsMargin" parent="PauseMenu/ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(6629802, 394030069) index="2" unique_id=1413292752]
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="CloseButton" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="0" unique_id=314526102]
|
||||
text = "Resume"
|
||||
|
||||
[node name="RestartButton" type="Button" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="1" unique_id=261040990]
|
||||
layout_mode = 2
|
||||
text = "Restart"
|
||||
|
||||
[node name="SaveGameButton" type="Button" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="2" unique_id=1952904817]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Save Game"
|
||||
|
||||
[node name="LoadGameButton" type="Button" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="3" unique_id=31108573]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Load Game"
|
||||
|
||||
[node name="OptionsButton" type="Button" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="4" unique_id=487135325]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Options"
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="5" unique_id=920922356]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="ExitButton" type="Button" parent="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(6629802, 1371114575) index="6" unique_id=2037900804]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Exit Game"
|
||||
|
||||
[node name="RestartConfirmation" parent="." unique_id=1453441706 instance=ExtResource("5_bgbk1")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
text = "Restart the game?"
|
||||
title = "Confirm Restart"
|
||||
|
||||
[node name="MainMenuConfirmation" parent="." unique_id=1848000740 instance=ExtResource("5_bgbk1")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(220, 0)
|
||||
text = "Exit to the main menu?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[node name="ExitConfirmation" parent="." unique_id=1161491301 instance=ExtResource("5_bgbk1")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
text = "Exit the game?"
|
||||
title = "Confirm Exit"
|
||||
|
||||
[connection signal="hidden" from="PauseMenu" to="." method="_on_pause_menu_hidden"]
|
||||
[connection signal="pressed" from="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/RestartButton" to="PauseMenu" method="_on_restart_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/SaveGameButton" to="PauseMenu" method="_on_save_game_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/LoadGameButton" to="PauseMenu" method="_on_load_game_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/OptionsButton" to="PauseMenu" method="_on_options_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/MainMenuButton" to="PauseMenu" method="_on_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons/ExitButton" to="PauseMenu" method="_on_exit_button_pressed"]
|
||||
|
||||
[editable path="PauseMenu"]
|
||||
@@ -0,0 +1,28 @@
|
||||
[gd_scene format=3 uid="uid://b6beu33krojpq"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window_scene_container.tscn" id="1_a6sle"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/master_options_menu_with_tabs.tscn" id="2_r1t3m"]
|
||||
|
||||
[node name="PauseMenuOptionsOverlaidWindow" unique_id=701085877 instance=ExtResource("1_a6sle")]
|
||||
process_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 0.0
|
||||
offset_top = 0.0
|
||||
offset_right = 0.0
|
||||
offset_bottom = 0.0
|
||||
packed_scene = ExtResource("2_r1t3m")
|
||||
title_visible = false
|
||||
|
||||
[node name="TitleMargin" parent="ContentContainer/BoxContainer" parent_id_path=PackedInt32Array(394030069) index="0" unique_id=1262022916]
|
||||
visible = false
|
||||
|
||||
[node name="TitleLabel" parent="ContentContainer/BoxContainer/TitleMargin/BoxContainer" parent_id_path=PackedInt32Array(1788474031) index="0" unique_id=1049966061]
|
||||
text = "Options"
|
||||
|
||||
[node name="CloseButton" parent="ContentContainer/BoxContainer/MenuButtonsMargin/MenuButtons" parent_id_path=PackedInt32Array(1371114575) index="0" unique_id=314526102]
|
||||
size_flags_horizontal = 0
|
||||
text = "Back"
|
||||
Reference in New Issue
Block a user