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,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