imported main menu scene addon

This commit is contained in:
2026-05-10 15:48:56 +02:00
parent 86d9f75161
commit 71c2850a34
458 changed files with 14881 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
[gd_scene format=3 uid="uid://cs7gpqjmiqrk0"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/labels/credits_label.gd" id="1_yhcaj"]
[node name="CreditsLabel" type="RichTextLabel" unique_id=525943618]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 5
bbcode_enabled = true
text = "[font_size=48]Collaborators[/font_size]
[font_size=32]Role[/font_size]
Person 1
Person 2
[url=]Person w/ Link[/url]
[font_size=48]Sourced[/font_size]
[font_size=32]Asset Type[/font_size]
[font_size=24]Use Case[/font_size]
Author: [url=]Name[/url]
Source: [url=]Domain : webpage.html[/url]
License: [url=]License[/url]
[font_size=24]Godot Engine Logo[/font_size]
Author: Andrea Calabró
Source: [url=https://godotengine.org/press/]godotengine.org : press[/url]
License: [url=https://github.com/godotengine/godot/blob/master/LOGO_LICENSE.txt]CC BY 4.0 International[/url]
[font_size=48]Tools[/font_size]
[font_size=24]Godot[/font_size]
[img=80]res:///assets/godot_engine_logo/logo_vertical_color_dark.png[/img]
Author: [url=https://godotengine.org/contact]Juan Linietsky, Ariel Manzur, and contributors[/url]
Source: [url=https://godotengine.org/]godotengine.org[/url]
License: [url=https://github.com/godotengine/godot/blob/master/LICENSE.txt]MIT License[/url]
[font_size=24]Godot Game Template[/font_size]
[img=80]res:///assets/plugin_logo/logo.png[/img]
Author: [url=https://github.com/Maaack/Godot-Game-Template/graphs/contributors]Marek Belski and contributors[/url]
Source: [url=https://github.com/Maaack/Godot-Game-Template]github: Godot-Game-Template[/url]
License: [url=LICENSE.txt]MIT License[/url]
[font_size=24]Git[/font_size]
[img=80]res:///assets/git_logo/Git-Logo-2Color.png[/img]
Author: [url=https://github.com/torvalds]Linus Torvalds[/url]
Source: [url=https://git-scm.com/downloads]git-scm.com[/url]
License: [url=https://opensource.org/licenses/GPL-2.0]GNU General Public License version 2[/url]
"
fit_content = true
scroll_active = false
horizontal_alignment = 1
script = ExtResource("1_yhcaj")
attribution_file_path = "res://ATTRIBUTION.md"
h1_font_size = 64
h2_font_size = 48
h3_font_size = 32
h4_font_size = 24
h5_font_size = 20
h6_font_size = 16
max_image_width = 80

View File

@@ -0,0 +1,29 @@
@tool
extends Control
@onready var credits_label : RichTextLabel = %CreditsLabel
@export var input_scroll_speed : float = 10.0
var _line_number : float = 0
func _on_visibility_changed() -> void:
if visible:
credits_label.scroll_to_line(0)
credits_label.grab_focus()
func _ready() -> void:
visibility_changed.connect(_on_visibility_changed)
func _process(delta : float) -> void:
if Engine.is_editor_hint() or not visible:
return
var input_axis = Input.get_axis("ui_up", "ui_down")
if abs(input_axis) > 0.5:
_line_number += input_axis * delta * input_scroll_speed
var max_lines = credits_label.get_line_count() - credits_label.get_visible_line_count()
if _line_number < 0:
_line_number = 0
if _line_number > max_lines:
_line_number = max_lines
credits_label.scroll_to_line(round(_line_number))

View File

@@ -0,0 +1 @@
uid://bw18ru8waloim

View File

@@ -0,0 +1,19 @@
[gd_scene format=3 uid="uid://bw6rkyxtffvmp"]
[ext_resource type="Script" path="res://scenes/credits/scrollable_credits.gd" id="1_jnbjt"]
[ext_resource type="PackedScene" path="res://scenes/credits/credits_label.tscn" id="2_35kdw"]
[node name="ScrollableCredits" type="Control" unique_id=1649718614]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_jnbjt")
[node name="CreditsLabel" parent="." unique_id=967293869 instance=ExtResource("2_35kdw")]
unique_name_in_owner = true
layout_mode = 1
fit_content = false
scroll_active = true

View File

@@ -0,0 +1,92 @@
@tool
extends Control
signal end_reached
@export var auto_scroll_speed: float = 60.0
@export var input_scroll_speed : float = 400.0
@export var scroll_restart_delay : float = 1.5
@export var scroll_paused : bool = false
var timer : Timer = Timer.new()
var _current_scroll_position : float = 0.0
@onready var header_space : Control = %HeaderSpace
@onready var footer_space : Control = %FooterSpace
@onready var credits_label : Control = %CreditsLabel
@onready var scroll_container : ScrollContainer = %ScrollContainer
func set_header_and_footer() -> void:
header_space.custom_minimum_size.y = size.y
footer_space.custom_minimum_size.y = size.y
credits_label.custom_minimum_size.x = size.x
func _on_resized() -> void:
set_header_and_footer()
_current_scroll_position = scroll_container.scroll_vertical
func _end_reached() -> void:
scroll_paused = true
end_reached.emit()
func is_end_reached() -> bool:
var _end_of_credits_vertical = credits_label.size.y + header_space.size.y
return scroll_container.scroll_vertical > _end_of_credits_vertical
func _check_end_reached() -> void:
if not is_end_reached():
return
_end_reached()
func _scroll_container(amount : float) -> void:
if not visible or scroll_paused:
return
_current_scroll_position += amount
scroll_container.scroll_vertical = round(_current_scroll_position)
_check_end_reached()
func _on_gui_input(event : InputEvent) -> void:
# Captures the mouse scroll wheel input event
if event is InputEventMouseButton:
scroll_paused = true
_start_scroll_restart_timer()
_check_end_reached()
func _on_scroll_started() -> void:
# Captures the touch input event
scroll_paused = true
_start_scroll_restart_timer()
func _start_scroll_restart_timer() -> void:
timer.start(scroll_restart_delay)
func _on_scroll_restart_timer_timeout() -> void:
_current_scroll_position = scroll_container.scroll_vertical
scroll_paused = false
func _on_visibility_changed() -> void:
if visible:
scroll_container.scroll_vertical = 0
_current_scroll_position = scroll_container.scroll_vertical
scroll_paused = false
func _ready() -> void:
scroll_container.scroll_started.connect(_on_scroll_started)
gui_input.connect(_on_gui_input)
resized.connect(_on_resized)
visibility_changed.connect(_on_visibility_changed)
timer.timeout.connect(_on_scroll_restart_timer_timeout)
set_header_and_footer()
add_child(timer)
scroll_paused = false
func _process(delta : float) -> void:
var input_axis = Input.get_axis("ui_up", "ui_down")
if input_axis != 0:
_scroll_container(input_axis * input_scroll_speed * delta)
else:
_scroll_container(auto_scroll_speed * delta)
func _exit_tree() -> void:
_current_scroll_position = scroll_container.scroll_vertical

View File

@@ -0,0 +1 @@
uid://cfy35bmhpaiq6

View File

@@ -0,0 +1,39 @@
[gd_scene format=3 uid="uid://b0oyosa2d7fav"]
[ext_resource type="Script" path="res://scenes/credits/scrolling_credits.gd" id="1_hgjqm"]
[ext_resource type="PackedScene" path="res://scenes/credits/credits_label.tscn" id="2_cxj1u"]
[node name="ScrollingCredits" type="Control" unique_id=1162279489]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_hgjqm")
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=1039720129]
unique_name_in_owner = true
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
horizontal_scroll_mode = 0
vertical_scroll_mode = 3
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer" unique_id=2067921385]
layout_mode = 2
size_flags_horizontal = 3
[node name="HeaderSpace" type="Control" parent="ScrollContainer/VBoxContainer" unique_id=1552560353]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 720)
layout_mode = 2
[node name="CreditsLabel" parent="ScrollContainer/VBoxContainer" unique_id=1486745388 instance=ExtResource("2_cxj1u")]
unique_name_in_owner = true
layout_mode = 2
[node name="FooterSpace" type="Control" parent="ScrollContainer/VBoxContainer" unique_id=1703782196]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 720)
layout_mode = 2

View File

@@ -0,0 +1,61 @@
@tool
extends "res://scenes/credits/scrolling_credits.gd"
## Defines the path to the main menu. Hides the Main Menu button if not set.
## Will attempt to read from AppConfig if left empty.
@export_file("*.tscn") var main_menu_scene_path : String
## This option forces the mouse to be visible when the menu shows up.
## Useful for games that capture the mouse, and don't automatically return it.
@export var force_mouse_mode_visible : bool = false
@onready var end_message_panel = %EndMessagePanel
@onready var exit_button = %ExitButton
@onready var menu_button = %MenuButton
@onready var init_mouse_filter : MouseFilter = mouse_filter
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 _end_reached() -> void:
end_message_panel.show()
mouse_filter = Control.MOUSE_FILTER_STOP
if force_mouse_mode_visible:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
super._end_reached()
func load_main_menu() -> void:
SceneLoader.load_scene(get_main_menu_scene_path())
func exit_game() -> void:
if OS.has_feature("web"):
load_main_menu()
get_tree().quit()
func _on_visibility_changed() -> void:
if visible:
end_message_panel.hide()
mouse_filter = init_mouse_filter
super._on_visibility_changed()
func _ready() -> void:
if get_main_menu_scene_path().is_empty():
menu_button.hide()
if OS.has_feature("web"):
exit_button.hide()
end_message_panel.hide()
super._ready()
func _unhandled_input(event : InputEvent) -> void:
if event.is_action_released("ui_cancel"):
if not end_message_panel.visible:
_end_reached()
else:
exit_game()
func _on_exit_button_pressed():
exit_game()
func _on_menu_button_pressed():
load_main_menu()

View File

@@ -0,0 +1 @@
uid://qb0nxsu5pjsm

View File

@@ -0,0 +1,88 @@
[gd_scene format=3 uid="uid://chy2p20a0je14"]
[ext_resource type="PackedScene" path="res://scenes/credits/scrolling_credits.tscn" id="1_0sycx"]
[ext_resource type="Script" path="res://scenes/end_credits/end_credits.gd" id="2_2v40y"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/music_players/background_music_player.tscn" id="3_bfvdl"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="4_1kqi1"]
[node name="EndCredits" unique_id=613298766 instance=ExtResource("1_0sycx")]
script = ExtResource("2_2v40y")
main_menu_scene_path = ""
force_mouse_mode_visible = false
[node name="BackgroundMusicPlayer" parent="." index="0" unique_id=1411252862 instance=ExtResource("3_bfvdl")]
[node name="BackgroundColor" type="ColorRect" parent="." index="1" unique_id=813188635]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="BackgroundTextureRect" type="TextureRect" parent="." index="2" unique_id=1166831285]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
expand_mode = 1
stretch_mode = 5
[node name="CenterContainer" type="CenterContainer" parent="." index="4" unique_id=535959837]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
[node name="EndMessagePanel" type="Panel" parent="CenterContainer" index="0" unique_id=680051131]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(360, 120)
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/EndMessagePanel" index="0" unique_id=899651798]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
[node name="ThankPlayer" type="Label" parent="CenterContainer/EndMessagePanel/VBoxContainer" index="0" unique_id=1020885934]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Thanks for playing!"
horizontal_alignment = 1
vertical_alignment = 1
[node name="CenterContainer" type="CenterContainer" parent="CenterContainer/EndMessagePanel/VBoxContainer" index="1" unique_id=1208569595]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/EndMessagePanel/VBoxContainer/CenterContainer" index="0" unique_id=1415249609]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 16
script = ExtResource("4_1kqi1")
[node name="ExitButton" type="Button" parent="CenterContainer/EndMessagePanel/VBoxContainer/CenterContainer/HBoxContainer" index="0" unique_id=1382070624]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Exit"
[node name="MenuButton" type="Button" parent="CenterContainer/EndMessagePanel/VBoxContainer/CenterContainer/HBoxContainer" index="1" unique_id=1504498101]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Menu"
[connection signal="pressed" from="CenterContainer/EndMessagePanel/VBoxContainer/CenterContainer/HBoxContainer/ExitButton" to="." method="_on_exit_button_pressed"]
[connection signal="pressed" from="CenterContainer/EndMessagePanel/VBoxContainer/CenterContainer/HBoxContainer/MenuButton" to="." method="_on_menu_button_pressed"]

View File

@@ -0,0 +1,12 @@
extends SubViewport
## Script to apply the anti-aliasing setting from [PlayerConfig] to a [SubViewport].
## The name of the anti-aliasing variable in the [ConfigFile].
@export var anti_aliasing_key : StringName = "Anti-aliasing"
## The name of the section of the anti-aliasing variable in the [ConfigFile].
@export var video_section : StringName = AppSettings.VIDEO_SECTION
func _ready() -> void:
var anti_aliasing : int = PlayerConfig.get_config(video_section, anti_aliasing_key, Viewport.MSAA_DISABLED)
msaa_2d = anti_aliasing as MSAA
msaa_3d = anti_aliasing as MSAA

View File

@@ -0,0 +1 @@
uid://cxalcykynhnqa

View File

@@ -0,0 +1,27 @@
extends Node
var play_time : int
var total_time : int
func _add_timers() -> void:
var play_timer := Timer.new()
play_timer.one_shot = false
play_timer.process_mode = Node.PROCESS_MODE_PAUSABLE
play_timer.timeout.connect(func() : play_time += 1)
add_child(play_timer)
play_timer.start(1)
var total_timer := Timer.new()
total_timer.one_shot = false
total_timer.process_mode = Node.PROCESS_MODE_ALWAYS
total_timer.timeout.connect(func() : total_time += 1)
add_child(total_timer)
total_timer.start(1)
func _enter_tree() -> void:
_add_timers()
func _exit_tree() -> void:
var game_state := GameState.get_or_create_state()
game_state.play_time += play_time
game_state.total_time += total_time
GlobalState.save()

View File

@@ -0,0 +1 @@
uid://4mvjvxsdahll

View File

@@ -0,0 +1,71 @@
[gd_scene format=3 uid="uid://bumbxg3bfrwtd"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/pause_menu_controller.gd" id="1_bmy5n"]
[ext_resource type="PackedScene" path="res://scenes/windows/pause_menu_layer.tscn" id="2_7aihr"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/music_players/background_music_player.tscn" id="3_3re04"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/extras/scripts/level_loader.gd" id="4_ascoc"]
[ext_resource type="Script" path="res://scripts/level_and_state_manager.gd" id="5_wr4n6"]
[ext_resource type="PackedScene" path="res://scenes/windows/game_won_window.tscn" id="6_ukb12"]
[ext_resource type="PackedScene" path="res://scenes/windows/level_lost_window.tscn" id="7_i7m4m"]
[ext_resource type="PackedScene" path="res://scenes/windows/level_won_window.tscn" id="8_rkfhe"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/extras/scripts/scene_lister.gd" id="9_g2ndc"]
[ext_resource type="PackedScene" path="res://scenes/loading_screen/level_loading_screen.tscn" id="10_0v86b"]
[ext_resource type="Script" path="res://scenes/game_scene/configurable_sub_viewport.gd" id="11_ulq3g"]
[ext_resource type="Script" path="res://scenes/game_scene/game_timer.gd" id="12_gpor5"]
[node name="GameUI" type="Control" unique_id=1609552811]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="PauseMenuController" type="Node" parent="." unique_id=1685173287 node_paths=PackedStringArray("focused_viewport")]
script = ExtResource("1_bmy5n")
pause_menu_packed = ExtResource("2_7aihr")
focused_viewport = NodePath("../ViewportContainer/ConfigurableSubViewport")
[node name="BackgroundMusicPlayer" parent="." unique_id=986713811 instance=ExtResource("3_3re04")]
[node name="LevelLoader" type="Node" parent="." unique_id=1047451806 node_paths=PackedStringArray("level_container", "level_loading_screen")]
script = ExtResource("4_ascoc")
level_container = NodePath("../ViewportContainer/ConfigurableSubViewport")
level_loading_screen = NodePath("../LevelLoadingScreen")
[node name="LevelManager" type="Node" parent="." unique_id=1350972375 node_paths=PackedStringArray("level_loader", "scene_lister")]
script = ExtResource("5_wr4n6")
level_loader = NodePath("../LevelLoader")
starting_level_path = "res://scenes/game_scene/levels/level_1.tscn"
scene_lister = NodePath("SceneLister")
game_won_scene = ExtResource("6_ukb12")
level_lost_scene = ExtResource("7_i7m4m")
level_won_scene = ExtResource("8_rkfhe")
[node name="SceneLister" type="Node" parent="LevelManager" unique_id=673614733]
script = ExtResource("9_g2ndc")
files = Array[String](["res://scenes/game_scene/levels/level_1.tscn", "res://scenes/game_scene/levels/level_2.tscn", "res://scenes/game_scene/levels/level_3.tscn"])
directory = "res://scenes/game_scene/levels"
[node name="LevelLoadingScreen" parent="." unique_id=816430938 instance=ExtResource("10_0v86b")]
visible = false
[node name="ViewportContainer" type="SubViewportContainer" parent="." unique_id=1831513653]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
stretch = true
[node name="ConfigurableSubViewport" type="SubViewport" parent="ViewportContainer" unique_id=204786699]
handle_input_locally = false
audio_listener_enable_2d = true
audio_listener_enable_3d = true
size = Vector2i(1280, 720)
render_target_update_mode = 4
script = ExtResource("11_ulq3g")
[node name="GameTimer" type="Node" parent="." unique_id=116840261]
script = ExtResource("12_gpor5")

View File

@@ -0,0 +1,21 @@
extends Label
@onready var action_names := AppSettings.get_action_names()
func _get_inputs_as_string() -> String:
var all_inputs : String = ""
var is_first : bool = true
for action_name in action_names:
if Input.is_action_pressed(action_name):
if is_first:
is_first = false
all_inputs += action_name
else:
all_inputs += " + " + action_name
return all_inputs
func _process(_delta : float) -> void:
if Input.is_anything_pressed():
text = _get_inputs_as_string()
else:
text = ""

View File

@@ -0,0 +1 @@
uid://jiyup3v57kj0

View File

@@ -0,0 +1,37 @@
extends Node
signal level_lost
signal level_won(level_path : String)
@warning_ignore("unused_signal")
signal level_changed(level_path : String)
## Optional path to the next level if using an open world level system.
@export_file("*.tscn") var next_level_path : String
var level_state : LevelState
func _on_lose_button_pressed() -> void:
level_lost.emit()
func _on_win_button_pressed() -> void:
level_won.emit(next_level_path)
func open_tutorials() -> void:
%TutorialManager.open_tutorials()
level_state.tutorial_read = true
GlobalState.save()
func _ready() -> void:
level_state = GameState.get_level_state(scene_file_path)
%ColorPickerButton.color = level_state.color
%BackgroundColor.color = level_state.color
if not level_state.tutorial_read:
open_tutorials()
func _on_color_picker_button_color_changed(color : Color) -> void:
%BackgroundColor.color = color
level_state.color = color
GlobalState.save()
func _on_tutorial_button_pressed() -> void:
open_tutorials()

View File

@@ -0,0 +1 @@
uid://efly2n6s1ers

View File

@@ -0,0 +1,101 @@
[gd_scene format=3 uid="uid://rkbotocsegqk"]
[ext_resource type="Script" path="res://scenes/game_scene/levels/level.gd" id="1_623lg"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="2_sycfm"]
[ext_resource type="Script" path="res://scenes/game_scene/input_display_label.gd" id="3_pmyid"]
[ext_resource type="Script" path="res://scenes/game_scene/tutorial_manager.gd" id="4_bsimd"]
[ext_resource type="PackedScene" path="res://scenes/game_scene/tutorials/tutorial_1.tscn" id="5_fmabn"]
[node name="Level1" type="Control" unique_id=235822082]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_623lg")
next_level_path = "res://scenes/game_scene/levels/level_2.tscn"
[node name="BackgroundColor" type="ColorRect" parent="." unique_id=1389548597]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1051608179]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 32
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 32
theme_override_constants/margin_bottom = 32
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=1696412727]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1771422232]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Example Level #1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1105591262]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=580896160]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 32
script = ExtResource("2_sycfm")
[node name="LoseButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1120638699]
layout_mode = 2
size_flags_horizontal = 3
text = "Lose"
[node name="WinButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1019168185]
layout_mode = 2
size_flags_horizontal = 3
text = "Win"
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1186288776]
layout_mode = 2
[node name="TutorialButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=501380068]
layout_mode = 2
text = "Tutorial"
[node name="InputDisplayLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=743402689]
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
script = ExtResource("3_pmyid")
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1165919418]
layout_mode = 2
text = "Change Level Color: "
[node name="ColorPickerButton" type="ColorPickerButton" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=2109296008]
unique_name_in_owner = true
layout_mode = 2
text = "Change Color"
[node name="TutorialManager" type="Node" parent="." unique_id=928060640]
unique_name_in_owner = true
script = ExtResource("4_bsimd")
tutorial_scenes = Array[PackedScene]([ExtResource("5_fmabn")])
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/LoseButton" to="." method="_on_lose_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/WinButton" to="." method="_on_win_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/TutorialButton" to="." method="_on_tutorial_button_pressed"]
[connection signal="color_changed" from="MarginContainer/VBoxContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_color_picker_button_color_changed"]

View File

@@ -0,0 +1,107 @@
[gd_scene format=3 uid="uid://dok28ptvihsse"]
[ext_resource type="Script" path="res://scenes/game_scene/levels/level.gd" id="1_rgywr"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="2_8s04l"]
[ext_resource type="Script" path="res://scenes/game_scene/input_display_label.gd" id="3_kjg0a"]
[ext_resource type="Script" path="res://scenes/game_scene/tutorial_manager.gd" id="4_w8c7f"]
[ext_resource type="PackedScene" path="res://scenes/game_scene/tutorials/tutorial_2.tscn" id="5_i1l6d"]
[node name="Level2" type="Control" unique_id=2110036821]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_rgywr")
next_level_path = "res://scenes/game_scene/levels/level_3.tscn"
[node name="BackgroundColor" type="ColorRect" parent="." unique_id=1479828644]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=523912810]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 32
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 32
theme_override_constants/margin_bottom = 32
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=107158970]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer" unique_id=806912222]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Example Level #2"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1089021380]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1396072092]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 32
script = ExtResource("2_8s04l")
[node name="LoseButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=842568930]
layout_mode = 2
size_flags_horizontal = 3
text = "Lose"
[node name="WinButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=2033630088]
layout_mode = 2
size_flags_horizontal = 3
text = "Win"
[node name="LoseButton2" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=866810661]
layout_mode = 2
size_flags_horizontal = 3
text = "Lose"
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=429267659]
layout_mode = 2
[node name="TutorialButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=63948276]
layout_mode = 2
text = "Tutorial"
[node name="InputDisplayLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=919863907]
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
script = ExtResource("3_kjg0a")
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1863562002]
layout_mode = 2
text = "Change Level Color: "
[node name="ColorPickerButton" type="ColorPickerButton" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=153143410]
unique_name_in_owner = true
layout_mode = 2
text = "Change Color"
[node name="TutorialManager" type="Node" parent="." unique_id=927712379]
unique_name_in_owner = true
script = ExtResource("4_w8c7f")
tutorial_scenes = Array[PackedScene]([ExtResource("5_i1l6d")])
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/LoseButton" to="." method="_on_lose_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/WinButton" to="." method="_on_win_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/LoseButton2" to="." method="_on_lose_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/TutorialButton" to="." method="_on_tutorial_button_pressed"]
[connection signal="color_changed" from="MarginContainer/VBoxContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_color_picker_button_color_changed"]

View File

@@ -0,0 +1,112 @@
[gd_scene format=3 uid="uid://d4idbbaheqxq7"]
[ext_resource type="Script" path="res://scenes/game_scene/levels/level.gd" id="1_3s8h5"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="2_satlj"]
[ext_resource type="Script" path="res://scenes/game_scene/input_display_label.gd" id="3_4popk"]
[ext_resource type="Script" path="res://scenes/game_scene/tutorial_manager.gd" id="4_mdq82"]
[ext_resource type="PackedScene" path="res://scenes/game_scene/tutorials/tutorial_3.tscn" id="5_32y40"]
[node name="Level3" type="Control" unique_id=710690354]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_3s8h5")
[node name="BackgroundColor" type="ColorRect" parent="." unique_id=2048289432]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1139802558]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 32
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 32
theme_override_constants/margin_bottom = 32
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=24784916]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1118917856]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Example Level #3"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1867660130]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1499324122]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 32
script = ExtResource("2_satlj")
[node name="WinButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=500607117]
layout_mode = 2
size_flags_horizontal = 3
text = "Win"
[node name="LoseButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1616502597]
layout_mode = 2
size_flags_horizontal = 3
text = "Lose"
[node name="LoseButton2" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1282863293]
layout_mode = 2
size_flags_horizontal = 3
text = "Lose"
[node name="LoseButton3" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=760845382]
layout_mode = 2
size_flags_horizontal = 3
text = "Lose"
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1147500718]
layout_mode = 2
[node name="TutorialButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=90402611]
layout_mode = 2
text = "Tutorial"
[node name="InputDisplayLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1335603973]
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
script = ExtResource("3_4popk")
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1223774581]
layout_mode = 2
text = "Change Level Color: "
[node name="ColorPickerButton" type="ColorPickerButton" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=550861861]
unique_name_in_owner = true
layout_mode = 2
text = "Change Color"
[node name="TutorialManager" type="Node" parent="." unique_id=18876677]
unique_name_in_owner = true
script = ExtResource("4_mdq82")
tutorial_scenes = Array[PackedScene]([ExtResource("5_32y40")])
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/WinButton" to="." method="_on_win_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/LoseButton" to="." method="_on_lose_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/LoseButton2" to="." method="_on_lose_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/LoseButton3" to="." method="_on_lose_button_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/TutorialButton" to="." method="_on_tutorial_button_pressed"]
[connection signal="color_changed" from="MarginContainer/VBoxContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_color_picker_button_color_changed"]

View File

@@ -0,0 +1,30 @@
extends Node
## A script to add into a level or game scene to display tutorial windows.
## A list of tutorial scenes to open, one after the other.
@export var tutorial_scenes : Array[PackedScene]
## If true, open the tutorials when the scene becomes ready.
@export var auto_open : bool = false
## Delay before opening the tutorials when the scene becomes ready.
@export var auto_open_delay : float = 0.25
func open_tutorials() -> void:
var _initial_focus_control : Control = get_viewport().gui_get_focus_owner()
for tutorial_scene in tutorial_scenes:
var tutorial_menu : Control = tutorial_scene.instantiate()
if tutorial_menu == null:
push_warning("tutorial failed to open %s" % tutorial_scene)
return
get_tree().current_scene.call_deferred("add_child", tutorial_menu)
if tutorial_menu.has_signal(&"closed"):
await tutorial_menu.closed
else:
await tutorial_menu.tree_exited
if is_inside_tree() and _initial_focus_control:
_initial_focus_control.grab_focus()
func _ready() -> void:
if auto_open:
if auto_open_delay > 0.0:
await get_tree().create_timer(auto_open_delay, false).timeout
open_tutorials.call_deferred()

View File

@@ -0,0 +1 @@
uid://bpvusqa2olipb

View File

@@ -0,0 +1,19 @@
[gd_scene format=3 uid="uid://l2prmgoscdt0"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_b2dkv"]
[node name="OverlaidWindow" unique_id=1876550858 instance=ExtResource("1_b2dkv")]
custom_minimum_size = Vector2(420, 200)
update_content = true
text = "Click the Win button to progress.
Click the Lose button to try again."
title = "Tutorial"
title_font_size = 20
[node name="TitleLabel" parent="ContentContainer/BoxContainer/TitleMargin/BoxContainer" parent_id_path=PackedInt32Array(1788474031) index="0" unique_id=1049966061]
theme_override_font_sizes/font_size = 20
text = "Tutorial"
[node name="DescriptionLabel" parent="ContentContainer/BoxContainer/BodyMargin" parent_id_path=PackedInt32Array(590613964) index="0" unique_id=617407155]
text = "Click the Win button to progress.
Click the Lose button to try again."

View File

@@ -0,0 +1,19 @@
[gd_scene format=3 uid="uid://byo4w7vrunyfn"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_sjjon"]
[node name="OverlaidWindow" unique_id=902196267 instance=ExtResource("1_sjjon")]
custom_minimum_size = Vector2(420, 200)
update_content = true
text = "Progress is saved.
Pressing Continue from the main menu will load at the last checkpoint."
title = "Tutorial"
title_font_size = 20
[node name="TitleLabel" parent="ContentContainer/BoxContainer/TitleMargin/BoxContainer" parent_id_path=PackedInt32Array(1788474031) index="0" unique_id=1049966061]
theme_override_font_sizes/font_size = 20
text = "Tutorial"
[node name="DescriptionLabel" parent="ContentContainer/BoxContainer/BodyMargin" parent_id_path=PackedInt32Array(590613964) index="0" unique_id=617407155]
text = "Progress is saved.
Pressing Continue from the main menu will load at the last checkpoint."

View File

@@ -0,0 +1,21 @@
[gd_scene format=3 uid="uid://cktxovjiylmpi"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/overlaid_window.tscn" id="1_hy5iy"]
[node name="OverlaidWindow" unique_id=1491564368 instance=ExtResource("1_hy5iy")]
custom_minimum_size = Vector2(420, 200)
update_content = true
text = "The color picker at the bottom-right updates the level state. This change persists until the game is reset.
The label at the bottom-center displays the current input action detected, if any are setup for the project."
title = "Tutorial"
title_font_size = 20
[node name="TitleLabel" parent="ContentContainer/BoxContainer/TitleMargin/BoxContainer" parent_id_path=PackedInt32Array(1788474031) index="0" unique_id=1049966061]
theme_override_font_sizes/font_size = 20
text = "Tutorial"
[node name="DescriptionLabel" parent="ContentContainer/BoxContainer/BodyMargin" parent_id_path=PackedInt32Array(590613964) index="0" unique_id=617407155]
text = "The color picker at the bottom-right updates the level state. This change persists until the game is reset.
The label at the bottom-center displays the current input action detected, if any are setup for the project."

View File

@@ -0,0 +1,11 @@
[gd_scene format=3 uid="uid://brhug56ihh06"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/loading_screen/loading_screen.tscn" id="1_akme8"]
[ext_resource type="Script" path="res://scenes/loading_screen/loading_screen.gd" id="2_kl30i"]
[node name="LevelLoadingScreen" unique_id=1716792690 instance=ExtResource("1_akme8")]
script = ExtResource("2_kl30i")
_in_progress = "Loading Level..."
_in_progress_waiting = "Still Loading Level..."
_in_progress_still_waiting = "Still Loading Level... (%d seconds)"
_complete = "Loading Level Complete!"

View File

@@ -0,0 +1 @@
extends LoadingScreen

View File

@@ -0,0 +1 @@
uid://ca3k1q1qyu51x

View File

@@ -0,0 +1,7 @@
[gd_scene format=3 uid="uid://cj6bp67uxoetc"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/loading_screen/loading_screen.tscn" id="1_a8kcw"]
[ext_resource type="Script" path="res://scenes/loading_screen/loading_screen.gd" id="2_53rj4"]
[node name="LoadingScreen" unique_id=179842335 instance=ExtResource("1_a8kcw")]
script = ExtResource("2_53rj4")

View File

@@ -0,0 +1,98 @@
extends LoadingScreen
## Loading Screen extension that pre-loads shaders before opening the next scene.
## Path to directory with the material shaders that should be pre-loaded.
@export_dir var _spatial_shader_material_dir : String
## Path to the scene that should trigger a shader pre-loading.
@export_file("*.tscn") var _cache_shaders_scene : String
## Mesh object that the material shaders should be applied to.
@export var _mesh : Mesh
@export_group("Advanced")
## Includes material scenes with extensions that match the strings.
@export var _matching_extensions : Array[String] = [".tres", ".material", ".res"]
## Excludes subfolders that match the strings.
@export var _ignore_subfolders : Array[String] = [".", ".."]
## Delay between loading each shader onto the mesh.
@export var _shader_delay_timer : float = 0.1
var _loading_shader_cache : bool = false
var _caching_progress : float = 0.0 :
set(value):
if value <= _caching_progress:
return
_caching_progress = value
update_total_loading_progress()
_reset_loading_stage()
func can_load_shader_cache() -> bool:
return not _spatial_shader_material_dir.is_empty() and \
not _cache_shaders_scene.is_empty() and \
SceneLoader.is_loading_scene(_cache_shaders_scene)
func update_total_loading_progress() -> void:
var partial_total := _scene_loading_progress
if can_load_shader_cache():
partial_total += _caching_progress
partial_total /= 2
_total_loading_progress = partial_total
func _set_scene_loading_complete() -> void:
super._set_scene_loading_complete()
if can_load_shader_cache() and not _loading_shader_cache:
_loading_shader_cache = true
_show_all_draw_passes_once()
if can_load_shader_cache() and _caching_progress < 1.0:
return
SceneLoader._background_loading = false
SceneLoader.set_process(true)
func _show_all_draw_passes_once() -> void:
var all_materials := _traverse_folders(_spatial_shader_material_dir)
var total_material_count := all_materials.size()
var cached_material_count := 0
for material_path in all_materials:
_load_material(material_path)
cached_material_count += 1
_caching_progress = float(cached_material_count) / total_material_count
if _shader_delay_timer > 0:
await(get_tree().create_timer(_shader_delay_timer).timeout)
func _traverse_folders(dir_path:String) -> PackedStringArray:
var material_list:PackedStringArray = []
if not dir_path.ends_with("/"):
dir_path += "/"
var dir := DirAccess.open(dir_path)
if not dir:
push_error("failed to access the path ", dir_path)
return []
if dir.list_dir_begin() != OK:
push_error("failed to access the path ", dir_path)
return []
var file_name := dir.get_next()
while file_name != "":
if not dir.current_is_dir():
var matches : bool = false
for extension in _matching_extensions:
if file_name.ends_with(extension):
matches = true
break
if matches:
material_list.append(dir_path + file_name)
else:
var subfolder_name := file_name
if not subfolder_name in _ignore_subfolders:
material_list.append_array(_traverse_folders(dir_path + subfolder_name))
file_name = dir.get_next()
return material_list
func _load_material(path:String) -> void:
var material_shower := MeshInstance3D.new()
material_shower.mesh = _mesh
var material := ResourceLoader.load(path) as Material
material_shower.set_surface_override_material(0, material)
%SpatialShaderTypeCaches.add_child(material_shower)
func _ready() -> void:
SceneLoader._background_loading = true

View File

@@ -0,0 +1 @@
uid://cg7lkm5qw226o

View File

@@ -0,0 +1,22 @@
[gd_scene format=3 uid="uid://26mrq3f5vqql"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/loading_screen/loading_screen.tscn" id="1_alqvd"]
[ext_resource type="Script" path="res://scenes/loading_screen/loading_screen_with_shader_caching.gd" id="2_n5fdm"]
[sub_resource type="QuadMesh" id="QuadMesh_klnwy"]
[node name="LoadingScreen" unique_id=1866533347 instance=ExtResource("1_alqvd")]
script = ExtResource("2_n5fdm")
_spatial_shader_material_dir = ""
_cache_shaders_scene = "res://scenes/game_scene/game_ui.tscn"
_mesh = SubResource("QuadMesh_klnwy")
_matching_extensions = Array[String]([".tres", ".material", ".res"])
_ignore_subfolders = Array[String]([".", ".."])
_shader_delay_timer = 0.1
[node name="SpatialShaderTypeCaches" type="Node3D" parent="." index="2" unique_id=634879644]
unique_name_in_owner = true
[node name="Camera3D" type="Camera3D" parent="SpatialShaderTypeCaches" index="0" unique_id=387206904]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.408)
current = true

View File

@@ -0,0 +1,33 @@
extends Control
## Loads a simple ItemList node within a margin container. SceneLister updates
## the available scenes in the directory provided. Activating a level will update
## the GameState's current_level, and emit a signal. The main menu node will trigger
## a load action from that signal.
signal level_selected
@onready var level_buttons_container: ItemList = %LevelButtonsContainer
@onready var scene_lister: SceneLister = $SceneLister
var level_paths : Array[String]
func _ready() -> void:
add_levels_to_container()
## A fresh level list is propgated into the ItemList, and the file names are cleaned
func add_levels_to_container() -> void:
level_buttons_container.clear()
level_paths.clear()
var game_state := GameState.get_or_create_state()
for file_path in game_state.level_states.keys():
var file_name : String = file_path.get_file() # e.g., "level_1.tscn"
file_name = file_name.trim_suffix(".tscn") # Remove the ".tscn" extension
file_name = file_name.replace("_", " ") # Replace underscores with spaces
file_name = file_name.capitalize() # Convert to proper case
var button_name := str(file_name)
level_buttons_container.add_item(button_name)
level_paths.append(file_path)
func _on_level_buttons_container_item_activated(index: int) -> void:
GameState.set_checkpoint_level_path(level_paths[index])
level_selected.emit()

View File

@@ -0,0 +1 @@
uid://b2722vtbsd4q1

View File

@@ -0,0 +1,49 @@
[gd_scene format=3 uid="uid://ccab8m5dn7vjx"]
[ext_resource type="Script" path="res://scenes/menus/level_select_menu/level_select_menu.gd" id="1_a0tqu"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="2_tjb7s"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/extras/scripts/scene_lister.gd" id="3_le4jx"]
[node name="LevelSelectMenu" type="Control" unique_id=1470024191]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_a0tqu")
[node name="Control" type="Control" parent="." unique_id=1541649425]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_tjb7s")
[node name="LevelButtonsContainer" type="ItemList" parent="Control" unique_id=17921809]
unique_name_in_owner = true
custom_minimum_size = Vector2(400, 0)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -200.0
offset_top = -17.5
offset_right = 200.0
offset_bottom = 17.5
grow_horizontal = 2
grow_vertical = 2
auto_height = true
item_count = 1
item_0/text = "1 - ExampleLevel"
[node name="SceneLister" type="Node" parent="." unique_id=1851760223]
script = ExtResource("3_le4jx")
files = Array[String](["res://scenes/game_scene/levels/level_1.tscn", "res://scenes/game_scene/levels/level_2.tscn", "res://scenes/game_scene/levels/level_3.tscn"])
directory = "res://scenes/game_scene/levels"
[connection signal="item_activated" from="Control/LevelButtonsContainer" to="." method="_on_level_buttons_container_item_activated"]

View File

@@ -0,0 +1,50 @@
extends MainMenu
## Main menu extension that adds options.
## The scene adds a 'Continue' button if a game is in progress.
## Optional scene to open when the player clicks a 'Level Select' button.
@export var level_select_packed_scene: PackedScene
## If true, have the player confirm before starting a new game if a game is in progress.
@export var confirm_new_game : bool = true
@onready var continue_game_button = %ContinueGameButton
@onready var level_select_button = %LevelSelectButton
@onready var new_game_confirmation = %NewGameConfirmation
func load_game_scene() -> void:
GameState.start_game()
super.load_game_scene()
func new_game() -> void:
if confirm_new_game and continue_game_button.visible:
new_game_confirmation.show()
else:
GameState.reset()
load_game_scene()
func _add_level_select_if_set() -> void:
if level_select_packed_scene == null: return
if GameState.get_levels_reached() <= 1 : return
level_select_button.show()
func _show_continue_if_set() -> void:
if GameState.get_current_level_path().is_empty(): return
continue_game_button.show()
func _ready() -> void:
super._ready()
_add_level_select_if_set()
_show_continue_if_set()
func _on_continue_game_button_pressed() -> void:
GameState.continue_game()
load_game_scene()
func _on_level_select_button_pressed() -> void:
var level_select_scene := _open_sub_menu(level_select_packed_scene)
if level_select_scene.has_signal("level_selected"):
level_select_scene.connect("level_selected", load_game_scene)
func _on_new_game_confirmation_confirmed() -> void:
GameState.reset()
load_game_scene()

View File

@@ -0,0 +1 @@
uid://djw25uvv3uu1f

View File

@@ -0,0 +1,44 @@
[gd_scene format=3 uid="uid://xci60pu6vaeq"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/main_menu/main_menu.tscn" id="1_ub2bi"]
[ext_resource type="Script" path="res://scenes/menus/main_menu/main_menu.gd" id="2_x31ro"]
[ext_resource type="PackedScene" path="res://scenes/windows/main_menu_options_window.tscn" id="3_0jpat"]
[ext_resource type="PackedScene" path="res://scenes/windows/main_menu_credits_window.tscn" id="4_m0ubd"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="5_627ab"]
[node name="MainMenu" unique_id=869232425 instance=ExtResource("1_ub2bi")]
script = ExtResource("2_x31ro")
level_select_packed_scene = null
confirm_new_game = true
options_packed_scene = ExtResource("3_0jpat")
credits_packed_scene = ExtResource("4_m0ubd")
[node name="ContinueGameButton" type="Button" parent="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer" parent_id_path=PackedInt32Array(2017477786) index="1" unique_id=1495566523]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "Continue"
[node name="LevelSelectButton" type="Button" parent="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer" parent_id_path=PackedInt32Array(2017477786) index="2" unique_id=1348895676]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "Level Select"
[node name="NewGameConfirmation" parent="." index="5" unique_id=487332143 instance=ExtResource("5_627ab")]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(420, 200)
layout_mode = 1
offset_left = -210.0
offset_top = -100.0
offset_right = 210.0
offset_bottom = 100.0
text = "Are you sure you want to start a new game?
All progress in the current game will be lost."
title = "New Game"
[connection signal="pressed" from="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer/ContinueGameButton" to="." method="_on_continue_game_button_pressed"]
[connection signal="pressed" from="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer/LevelSelectButton" to="." method="_on_level_select_button_pressed"]
[connection signal="confirmed" from="NewGameConfirmation" to="." method="_on_new_game_confirmation_confirmed"]

View File

@@ -0,0 +1,80 @@
extends MainMenu
## Main menu extension that adds options and animates the title and menu fading in.
## The scene adds a 'Continue' button if a game is in progress.
## The animation can be skipped by the player with any input.
## Optional scene to open when the player clicks a 'Level Select' button.
@export var level_select_packed_scene: PackedScene
## If true, have the player confirm before starting a new game if a game is in progress.
@export var confirm_new_game : bool = true
var animation_state_machine : AnimationNodeStateMachinePlayback
@onready var continue_game_button = %ContinueGameButton
@onready var level_select_button = %LevelSelectButton
@onready var new_game_confirmation = %NewGameConfirmation
func load_game_scene() -> void:
GameState.start_game()
super.load_game_scene()
func new_game() -> void:
if confirm_new_game and continue_game_button.visible:
new_game_confirmation.show()
else:
GameState.reset()
load_game_scene()
func intro_done() -> void:
animation_state_machine.travel("OpenMainMenu")
func _is_in_intro() -> bool:
return animation_state_machine.get_current_node() == "Intro"
func _event_skips_intro(event : InputEvent) -> bool:
return event.is_action_released("ui_accept") or \
event.is_action_released("ui_select") or \
event.is_action_released("ui_cancel") or \
_event_is_mouse_button_released(event)
func _open_sub_menu(menu : PackedScene) -> Node:
animation_state_machine.travel("OpenSubMenu")
return super._open_sub_menu(menu)
func _close_sub_menu() -> void:
super._close_sub_menu()
animation_state_machine.travel("OpenMainMenu")
func _input(event : InputEvent) -> void:
if _is_in_intro() and _event_skips_intro(event):
intro_done()
return
super._input(event)
func _show_level_select_if_set() -> void:
if level_select_packed_scene == null: return
if GameState.get_levels_reached() <= 1 : return
level_select_button.show()
func _show_continue_if_set() -> void:
if GameState.get_current_level_path().is_empty(): return
continue_game_button.show()
func _ready() -> void:
super._ready()
_show_level_select_if_set()
_show_continue_if_set()
animation_state_machine = $MenuAnimationTree.get("parameters/playback")
func _on_continue_game_button_pressed() -> void:
GameState.continue_game()
load_game_scene()
func _on_level_select_button_pressed() -> void:
var level_select_scene := _open_sub_menu(level_select_packed_scene)
if level_select_scene.has_signal("level_selected"):
level_select_scene.connect("level_selected", load_game_scene)
func _on_new_game_confirmation_confirmed() -> void:
GameState.reset()
load_game_scene()

View File

@@ -0,0 +1 @@
uid://6itnsrcgk2wu

View File

@@ -0,0 +1,385 @@
[gd_scene format=3 uid="uid://bq4y2g0eurewb"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/main_menu/main_menu.tscn" id="1_sr523"]
[ext_resource type="Script" path="res://scenes/menus/main_menu/main_menu_with_animations.gd" id="2_ixa71"]
[ext_resource type="PackedScene" path="res://scenes/windows/main_menu_options_window.tscn" id="3_2k5l7"]
[ext_resource type="PackedScene" path="res://scenes/windows/main_menu_credits_window.tscn" id="4_vsp5b"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/windows/confirmation_overlaid_window.tscn" id="5_6xh1d"]
[sub_resource type="Animation" id="1"]
resource_name = "Intro"
length = 2.4
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(2.4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"intro_done"
}]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MenuContainer/TitleMargin/TitleContainer:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MenuContainer/SubTitleMargin/SubTitleContainer:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.8, 1.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MenuContainer/MenuButtonsMargin/MenuButtonsContainer:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 1.6, 2.4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("MouseFilter:mouse_filter")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 2.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 2]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VersionMargin/VersionContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0, 1.6, 2.4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="6"]
resource_name = "OpenMainMenu"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MenuContainer/TitleMargin/TitleContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MenuContainer/SubTitleMargin/SubTitleContainer:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MenuContainer/MenuButtonsMargin/MenuButtonsContainer:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MouseFilter:mouse_filter")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("MenuContainer:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VersionMargin/VersionContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer:lock")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="4"]
resource_name = "OpenSubMenu"
length = 0.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MenuContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="2"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MenuContainer/TitleMargin/TitleContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MenuContainer/SubTitleMargin/SubTitleContainer:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MenuContainer/MenuButtonsMargin/MenuButtonsContainer:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MouseFilter:mouse_filter")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("MenuContainer:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VersionMargin/VersionContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer:lock")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2kqig"]
_data = {
&"Intro": SubResource("1"),
&"OpenMainMenu": SubResource("6"),
&"OpenSubMenu": SubResource("4"),
&"RESET": SubResource("2")
}
[sub_resource type="AnimationNodeAnimation" id="7"]
animation = &"Intro"
[sub_resource type="AnimationNodeAnimation" id="10"]
animation = &"OpenMainMenu"
[sub_resource type="AnimationNodeAnimation" id="13"]
animation = &"OpenSubMenu"
[sub_resource type="AnimationNodeStateMachineTransition" id="11"]
advance_condition = &"intro_done"
[sub_resource type="AnimationNodeStateMachineTransition" id="14"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_j0orr"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_63dxc"]
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_vikuh"]
states/End/position = Vector2(958, 123)
states/Intro/node = SubResource("7")
states/Intro/position = Vector2(259, 123)
states/OpenMainMenu/node = SubResource("10")
states/OpenMainMenu/position = Vector2(472, 123)
states/OpenSubMenu/node = SubResource("13")
states/OpenSubMenu/position = Vector2(734, 123)
states/Start/position = Vector2(82, 123)
transitions = ["Intro", "OpenMainMenu", SubResource("11"), "OpenMainMenu", "OpenSubMenu", SubResource("14"), "Start", "Intro", SubResource("AnimationNodeStateMachineTransition_j0orr"), "OpenSubMenu", "OpenMainMenu", SubResource("AnimationNodeStateMachineTransition_63dxc")]
graph_offset = Vector2(-180.277, 49)
[node name="MainMenu" unique_id=589811630 instance=ExtResource("1_sr523")]
script = ExtResource("2_ixa71")
level_select_packed_scene = null
confirm_new_game = true
options_packed_scene = ExtResource("3_2k5l7")
credits_packed_scene = ExtResource("4_vsp5b")
[node name="MenuAnimationPlayer" type="AnimationPlayer" parent="." index="1" unique_id=1492532975]
libraries/ = SubResource("AnimationLibrary_2kqig")
[node name="MenuAnimationTree" type="AnimationTree" parent="." index="2" unique_id=1630488919]
tree_root = SubResource("AnimationNodeStateMachine_vikuh")
anim_player = NodePath("../MenuAnimationPlayer")
parameters/conditions/intro_done = false
[node name="TitleContainer" parent="MenuContainer/TitleMargin" parent_id_path=PackedInt32Array(2112060331) index="0" unique_id=556427956]
modulate = Color(1, 1, 1, 0)
[node name="SubTitleContainer" parent="MenuContainer/SubTitleMargin" parent_id_path=PackedInt32Array(1510335937) index="0" unique_id=930520368]
modulate = Color(1, 1, 1, 0)
[node name="MenuButtonsContainer" parent="MenuContainer/MenuButtonsMargin" parent_id_path=PackedInt32Array(210553886) index="0" unique_id=116448484]
modulate = Color(1, 1, 1, 0)
[node name="MenuButtonsBoxContainer" parent="MenuContainer/MenuButtonsMargin/MenuButtonsContainer" index="0" unique_id=2017477786]
lock = true
[node name="ContinueGameButton" type="Button" parent="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer" index="1" unique_id=1206401873]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "Continue"
[node name="LevelSelectButton" type="Button" parent="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer" index="2" unique_id=78300098]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "Level Select"
[node name="VersionContainer" parent="VersionMargin" parent_id_path=PackedInt32Array(1732528471) index="0" unique_id=1603969262]
modulate = Color(1, 1, 1, 0)
[node name="NewGameConfirmation" parent="." index="7" unique_id=1747133399 instance=ExtResource("5_6xh1d")]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(420, 200)
layout_mode = 1
offset_left = -210.0
offset_top = -100.0
offset_right = 210.0
offset_bottom = 100.0
text = "Are you sure you want to start a new game?
All progress in the current game will be lost."
title = "New Game"
[node name="MouseFilter" type="Control" parent="." index="8" unique_id=33285267]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
metadata/_edit_lock_ = true
[connection signal="pressed" from="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer/ContinueGameButton" to="." method="_on_continue_game_button_pressed"]
[connection signal="pressed" from="MenuContainer/MenuButtonsMargin/MenuButtonsContainer/MenuButtonsBoxContainer/LevelSelectButton" to="." method="_on_level_select_button_pressed"]
[connection signal="confirmed" from="NewGameConfirmation" to="." method="_on_new_game_confirmation_confirmed"]

View File

@@ -0,0 +1,39 @@
@tool
extends ListOptionControl
func _set_input_device() -> void:
var current_setting : Variant = _get_setting(default_value)
if current_setting is bool:
current_setting = &"Default"
AudioServer.input_device = _get_setting(default_value)
func _add_microphone_audio_stream() -> void:
var instance := AudioStreamPlayer.new()
instance.stream = AudioStreamMicrophone.new()
instance.autoplay = true
add_child.call_deferred(instance)
instance.ready.connect(_set_input_device)
func _ready() -> void:
if ProjectSettings.get_setting("audio/driver/enable_input", false):
show()
if AudioServer.input_device.is_empty():
_add_microphone_audio_stream()
else:
_set_input_device()
if not Engine.is_editor_hint():
option_values = AudioServer.get_input_device_list()
else:
hide()
super._ready()
func _on_setting_changed(value : Variant) -> void:
if value >= option_values.size(): return
AudioServer.input_device = option_values[value]
super._on_setting_changed(value)
func _value_title_map(value : Variant) -> String:
if value is String:
return value
else:
return super._value_title_map(value)

View File

@@ -0,0 +1 @@
uid://h71jrpe7r1cx

View File

@@ -0,0 +1,21 @@
[gd_scene format=3 uid="uid://7hqbc80e06sy"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/list_option_control.tscn" id="1_lfo7w"]
[ext_resource type="Script" path="res://scenes/menus/options_menu/audio/audio_input_option_control.gd" id="2_m6bxx"]
[node name="AudioInputOptionControl" unique_id=1866818783 instance=ExtResource("1_lfo7w")]
visible = false
script = ExtResource("2_m6bxx")
option_name = "Input Device"
option_section = 2
key = "InputDevice"
section = "AudioSettings"
property_type = 4
[node name="OptionLabel" parent="." index="0" unique_id=1854788461]
text = "Input Device :"
[node name="OptionButton" parent="." index="1" unique_id=264509485]
size_flags_horizontal = 3
text_overrun_behavior = 1
clip_text = true

View File

@@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://b5sx6r7ohjrj"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/audio/audio_options_menu.tscn" id="1_33wdu"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/audio/audio_input_option_control.tscn" id="2_vnecy"]
[node name="Audio" unique_id=651805888 instance=ExtResource("1_33wdu")]
[node name="AudioInputOptionControl" parent="VBoxContainer" parent_id_path=PackedInt32Array(1265848630) index="2" unique_id=774781052 instance=ExtResource("2_vnecy")]
layout_mode = 2

View File

@@ -0,0 +1,4 @@
extends Control
func _on_ResetGameControl_reset_confirmed() -> void:
GameState.reset()

View File

@@ -0,0 +1 @@
uid://uqwakd86xudk

View File

@@ -0,0 +1,26 @@
[gd_scene format=3 uid="uid://1vbfefiimyns"]
[ext_resource type="Script" path="res://scenes/menus/options_menu/game/game_options_menu.gd" id="1_hvcyg"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="2_t8t6j"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/game/reset_game_control/reset_game_control.tscn" id="3_pfgxr"]
[node name="Game" type="MarginContainer" unique_id=205916118]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_constants/margin_top = 24
theme_override_constants/margin_bottom = 24
script = ExtResource("1_hvcyg")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=93516622]
custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 4
alignment = 1
script = ExtResource("2_t8t6j")
search_depth = 2
[node name="ResetGameControl" parent="VBoxContainer" unique_id=208719318 instance=ExtResource("3_pfgxr")]
layout_mode = 2
[connection signal="reset_confirmed" from="VBoxContainer/ResetGameControl" to="." method="_on_ResetGameControl_reset_confirmed"]

View File

@@ -0,0 +1,25 @@
extends HBoxContainer
const RESET_STRING := "Reset Game:"
const CONFIRM_STRING := "Confirm Reset:"
signal reset_confirmed
func _on_cancel_button_pressed():
%CancelButton.hide()
%ConfirmButton.hide()
%ResetButton.show()
%ResetButton.grab_focus()
%ResetLabel.text = RESET_STRING
func _on_reset_button_pressed():
%CancelButton.show()
%ConfirmButton.show()
%CancelButton.grab_focus()
%ResetButton.hide()
%ResetLabel.text = CONFIRM_STRING
func _on_confirm_button_pressed():
reset_confirmed.emit()
get_tree().paused = false
SceneLoader.reload_current_scene()

View File

@@ -0,0 +1,40 @@
[gd_scene format=3 uid="uid://jam2ds44byob"]
[ext_resource type="Script" path="res://scenes/menus/options_menu/game/reset_game_control/reset_game_control.gd" id="1_mkb8o"]
[node name="ResetGameControl" type="HBoxContainer" unique_id=1147095030]
custom_minimum_size = Vector2(0, 32)
offset_top = 210.0
offset_right = 305.0
offset_bottom = 242.0
script = ExtResource("1_mkb8o")
[node name="ResetLabel" type="Label" parent="." unique_id=666807423]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Reset Game :"
[node name="ResetButton" type="Button" parent="." unique_id=846056487]
unique_name_in_owner = true
custom_minimum_size = Vector2(72, 32)
layout_mode = 2
text = "Reset"
[node name="CancelButton" type="Button" parent="." unique_id=130771510]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(72, 32)
layout_mode = 2
text = "No"
[node name="ConfirmButton" type="Button" parent="." unique_id=963578876]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(72, 32)
layout_mode = 2
text = "Yes"
[connection signal="pressed" from="ResetButton" to="." method="_on_reset_button_pressed"]
[connection signal="pressed" from="CancelButton" to="." method="_on_cancel_button_pressed"]
[connection signal="pressed" from="ConfirmButton" to="." method="_on_confirm_button_pressed"]

View File

@@ -0,0 +1,65 @@
[gd_scene format=3 uid="uid://bp41gchfamu7y"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="1_1v5x4"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/slider_option_control.tscn" id="2_goqr1"]
[node name="Inputs" type="MarginContainer" unique_id=998049297]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1869351161]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_constants/separation = 8
script = ExtResource("1_1v5x4")
search_depth = 5
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer" unique_id=561522128]
layout_mode = 2
theme_override_constants/margin_top = 32
theme_override_constants/margin_bottom = 32
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MarginContainer" unique_id=796157829]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 8
alignment = 1
[node name="MouseSensitivityControl" parent="VBoxContainer/MarginContainer/VBoxContainer" unique_id=1921387610 instance=ExtResource("2_goqr1")]
layout_mode = 2
option_name = "Mouse Sensitivity"
option_section = 1
key = "MouseSensitivity"
section = "InputSettings"
[node name="OptionLabel" parent="VBoxContainer/MarginContainer/VBoxContainer/MouseSensitivityControl" index="0" unique_id=1854788461]
text = "Mouse Sensitivity :"
[node name="HSlider" parent="VBoxContainer/MarginContainer/VBoxContainer/MouseSensitivityControl" index="1" unique_id=424108384]
min_value = 0.25
max_value = 2.0
tick_count = 8
[node name="JoypadSensitivityControl" parent="VBoxContainer/MarginContainer/VBoxContainer" unique_id=256777414 instance=ExtResource("2_goqr1")]
layout_mode = 2
option_name = "Joypad Sensitivity"
option_section = 1
key = "JoypadSensitivity"
section = "InputSettings"
[node name="OptionLabel" parent="VBoxContainer/MarginContainer/VBoxContainer/JoypadSensitivityControl" index="0" unique_id=1854788461]
text = "Joypad Sensitivity :"
[node name="HSlider" parent="VBoxContainer/MarginContainer/VBoxContainer/JoypadSensitivityControl" index="1" unique_id=424108384]
min_value = 0.25
max_value = 2.0
tick_count = 8
[editable path="VBoxContainer/MarginContainer/VBoxContainer/MouseSensitivityControl"]
[editable path="VBoxContainer/MarginContainer/VBoxContainer/JoypadSensitivityControl"]

View File

@@ -0,0 +1,5 @@
[gd_scene format=3 uid="uid://clsvhv4a67jt2"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/input/input_icon_mapper.tscn" id="1_7vieq"]
[node name="InputIconMapper" unique_id=2136107125 instance=ExtResource("1_7vieq")]

View File

@@ -0,0 +1,14 @@
[gd_scene format=3 uid="uid://bke7evcujycfq"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/input/input_options_menu.tscn" id="1_i27v5"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/input/input_icon_mapper.tscn" id="2_hyv0n"]
[node name="Controls" unique_id=294191899 instance=ExtResource("1_i27v5")]
[node name="InputActionsList" parent="VBoxContainer/InputMappingContainer" parent_id_path=PackedInt32Array(1004992485) index="1" unique_id=2089976301 node_paths=PackedStringArray("input_icon_mapper")]
input_icon_mapper = NodePath("../../../InputIconMapper")
[node name="InputActionsTree" parent="VBoxContainer/InputMappingContainer" parent_id_path=PackedInt32Array(1004992485) index="2" unique_id=780755880 node_paths=PackedStringArray("input_icon_mapper")]
input_icon_mapper = NodePath("../../../InputIconMapper")
[node name="InputIconMapper" parent="." index="6" unique_id=1326793573 instance=ExtResource("2_hyv0n")]

View File

@@ -0,0 +1,39 @@
[gd_scene format=3 uid="uid://b5fr8lxqhfu2s"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/input/input_options_menu.tscn" id="1_fwapm"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/slider_option_control.tscn" id="2_56ptf"]
[node name="Controls" unique_id=1972124152 instance=ExtResource("1_fwapm")]
[node name="VBoxContainer" parent="." index="0" unique_id=539297323]
theme_override_constants/separation = 16
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer" index="0" unique_id=1399429015]
layout_mode = 2
theme_override_constants/margin_top = 32
theme_override_constants/margin_bottom = 32
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MarginContainer" index="0" unique_id=951107081]
layout_mode = 2
size_flags_vertical = 3
alignment = 1
[node name="MouseSensitivityControl" parent="VBoxContainer/MarginContainer/VBoxContainer" index="0" unique_id=1384087 instance=ExtResource("2_56ptf")]
layout_mode = 2
option_name = "Mouse Sensitivity"
option_section = 1
key = "MouseSensitivity"
section = "InputSettings"
[node name="OptionLabel" parent="VBoxContainer/MarginContainer/VBoxContainer/MouseSensitivityControl" index="0" unique_id=1854788461]
text = "Mouse Sensitivity :"
[node name="HSlider" parent="VBoxContainer/MarginContainer/VBoxContainer/MouseSensitivityControl" index="1" unique_id=424108384]
min_value = 0.25
max_value = 2.0
tick_count = 8
[node name="HSeparator" type="HSeparator" parent="VBoxContainer" index="1" unique_id=714626530]
layout_mode = 2
[editable path="VBoxContainer/MarginContainer/VBoxContainer/MouseSensitivityControl"]

View File

@@ -0,0 +1,42 @@
[gd_scene format=3 uid="uid://dokae2ohhidmw"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/paginated_tab_container.gd" id="1_fqpxk"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/input/input_options_menu.tscn" id="2_w1dvr"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/input/input_extras_menu.tscn" id="3_bn2s3"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/audio/audio_options_menu.tscn" id="4_6wkjv"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/video/video_options_menu_with_extras.tscn" id="5_kr6xa"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/game/game_options_menu.tscn" id="6_n2uhm"]
[node name="MasterOptionsMenu" type="TabContainer" unique_id=1111795112]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
tab_alignment = 1
current_tab = 0
script = ExtResource("1_fqpxk")
[node name="Controls" parent="." unique_id=1827648101 instance=ExtResource("2_w1dvr")]
layout_mode = 2
metadata/_tab_index = 0
[node name="Inputs" parent="." unique_id=1534818691 instance=ExtResource("3_bn2s3")]
visible = false
layout_mode = 2
metadata/_tab_index = 1
[node name="Audio" parent="." unique_id=506115522 instance=ExtResource("4_6wkjv")]
visible = false
layout_mode = 2
metadata/_tab_index = 2
[node name="Video" parent="." unique_id=382045299 instance=ExtResource("5_kr6xa")]
visible = false
layout_mode = 2
metadata/_tab_index = 3
[node name="Game" parent="." unique_id=1395408076 instance=ExtResource("6_n2uhm")]
visible = false
layout_mode = 2
metadata/_tab_index = 4

View File

@@ -0,0 +1,51 @@
[gd_scene format=3 uid="uid://b08lr2rh336kn"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/mini_options_menu.gd" id="1_w3x3l"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/slider_option_control.tscn" id="2_7t2pa"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="3_x0e25"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/toggle_option_control.tscn" id="4_xg1r4"]
[node name="MiniOptionsMenu" type="VBoxContainer" unique_id=2109470311]
custom_minimum_size = Vector2(400, 260)
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -200.0
offset_top = -130.0
offset_right = 200.0
offset_bottom = 130.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
theme_override_constants/separation = 8
alignment = 1
script = ExtResource("1_w3x3l")
audio_control_scene = ExtResource("2_7t2pa")
[node name="AudioControlContainer" type="VBoxContainer" parent="." unique_id=2081802894]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 8
script = ExtResource("3_x0e25")
search_depth = 2
[node name="MuteControl" parent="." unique_id=1533689152 instance=ExtResource("4_xg1r4")]
unique_name_in_owner = true
layout_mode = 2
option_name = "Mute"
option_section = 2
key = "Mute"
section = "AudioSettings"
[node name="FullscreenControl" parent="." unique_id=311912129 instance=ExtResource("4_xg1r4")]
unique_name_in_owner = true
layout_mode = 2
option_name = "Fullscreen"
option_section = 3
key = "FullscreenEnabled"
section = "VideoSettings"
[connection signal="setting_changed" from="MuteControl" to="." method="_on_mute_control_setting_changed"]
[connection signal="setting_changed" from="FullscreenControl" to="." method="_on_fullscreen_control_setting_changed"]

View File

@@ -0,0 +1,4 @@
extends "res://addons/maaacks_game_template/base/nodes/menus/options_menu/mini_options_menu.gd"
func _on_reset_game_control_reset_confirmed() -> void:
GameState.reset()

View File

@@ -0,0 +1 @@
uid://s0fjtumwwnu4

View File

@@ -0,0 +1,56 @@
[gd_scene format=3 uid="uid://chjqs8p4fglv4"]
[ext_resource type="Script" path="res://scenes/menus/options_menu/mini_options_menu_with_reset.gd" id="1_kj0d4"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/slider_option_control.tscn" id="2_kdjme"]
[ext_resource type="Script" path="res://addons/maaacks_game_template/base/nodes/utilities/capture_focus.gd" id="3_8p5p7"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/toggle_option_control.tscn" id="4_iq5ao"]
[ext_resource type="PackedScene" path="res://scenes/menus/options_menu/game/reset_game_control/reset_game_control.tscn" id="5_bvuwx"]
[node name="MiniOptionsMenu" type="VBoxContainer" unique_id=1724615502]
custom_minimum_size = Vector2(400, 260)
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -200.0
offset_top = -130.0
offset_right = 200.0
offset_bottom = 130.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
theme_override_constants/separation = 8
alignment = 1
script = ExtResource("1_kj0d4")
audio_control_scene = ExtResource("2_kdjme")
[node name="AudioControlContainer" type="VBoxContainer" parent="." unique_id=803318905]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 8
script = ExtResource("3_8p5p7")
search_depth = 2
[node name="MuteControl" parent="." unique_id=1252265559 instance=ExtResource("4_iq5ao")]
unique_name_in_owner = true
layout_mode = 2
option_name = "Mute"
option_section = 2
key = "Mute"
section = "AudioSettings"
[node name="FullscreenControl" parent="." unique_id=836716545 instance=ExtResource("4_iq5ao")]
unique_name_in_owner = true
layout_mode = 2
option_name = "Fullscreen"
option_section = 3
key = "FullscreenEnabled"
section = "VideoSettings"
[node name="ResetGameControl" parent="." unique_id=919045811 instance=ExtResource("5_bvuwx")]
layout_mode = 2
[connection signal="setting_changed" from="MuteControl" to="." method="_on_mute_control_setting_changed"]
[connection signal="setting_changed" from="FullscreenControl" to="." method="_on_fullscreen_control_setting_changed"]
[connection signal="reset_confirmed" from="ResetGameControl" to="." method="_on_reset_game_control_reset_confirmed"]

View File

@@ -0,0 +1,5 @@
[gd_scene format=3 uid="uid://c3e0iq6i1of70"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/video/video_options_menu.tscn" id="1_ytjyv"]
[node name="Video" unique_id=1641772648 instance=ExtResource("1_ytjyv")]

View File

@@ -0,0 +1,31 @@
[gd_scene format=3 uid="uid://ctfdv3navnuv8"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/video/video_options_menu.tscn" id="1_n1b6r"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/menus/options_menu/option_control/list_option_control.tscn" id="2_r8snp"]
[node name="Video" unique_id=2066056515 instance=ExtResource("1_n1b6r")]
[node name="AntiAliasingControl" parent="VBoxContainer" parent_id_path=PackedInt32Array(1251699420) index="3" unique_id=1035813408 instance=ExtResource("2_r8snp")]
layout_mode = 2
lock_titles = true
option_values = [0, 1, 2, 3]
option_titles = Array[String](["Disabled (Fastest)", "2x", "4x", "8x (Slowest)"])
option_name = "Anti-Aliasing"
option_section = 3
key = "Anti-aliasing"
section = "VideoSettings"
property_type = 2
default_value = 0
[node name="CameraShakeControl" parent="VBoxContainer" parent_id_path=PackedInt32Array(1251699420) index="4" unique_id=683521251 instance=ExtResource("2_r8snp")]
visible = false
layout_mode = 2
lock_titles = true
option_values = [1.0, 0.75, 0.5, 0.0]
option_titles = Array[String](["Normal", "Reduced", "Minimal", "None"])
option_name = "Camera Shake"
option_section = 3
key = "CameraShake"
section = "VideoSettings"
property_type = 3
default_value = 1.0

View File

@@ -0,0 +1,13 @@
[gd_scene format=3 uid="uid://5pyqca1inqp5"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/opening/opening.tscn" id="1_ke3tw"]
[ext_resource type="Texture2D" path="res://assets/godot_engine_logo/logo_vertical_color_dark.png" id="2_yhkvs"]
[node name="Opening" unique_id=1930105641 instance=ExtResource("1_ke3tw")]
images = Array[Texture2D]([ExtResource("2_yhkvs")])
[node name="ImagesContainer" parent="." index="1" unique_id=1471559661]
theme_override_constants/margin_left = 64
theme_override_constants/margin_top = 64
theme_override_constants/margin_right = 64
theme_override_constants/margin_bottom = 64

View 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()

View File

@@ -0,0 +1 @@
uid://dsfwkcr0yyfkg

View 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"]

View 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()

View File

@@ -0,0 +1 @@
uid://70x32kal3kpt

View 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"]

View 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()

View File

@@ -0,0 +1 @@
uid://djwfx2841d4n1

View 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"]

View File

@@ -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)

View File

@@ -0,0 +1 @@
uid://civblior38i0f

View File

@@ -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"

View File

@@ -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"

View 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()

View File

@@ -0,0 +1 @@
uid://rgxs4ktm1qf1

View 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"]

View 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)

View File

@@ -0,0 +1 @@
uid://df8ch4715k8oo

View 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"]

View File

@@ -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"