add new options screen to main menu and pause screen

This commit is contained in:
Haze Weathers 2024-02-27 20:57:14 -05:00
parent 9333d5a61f
commit 24f763d3f6
10 changed files with 94 additions and 7 deletions

View file

@ -44,3 +44,9 @@ func _on_HighScores_button_down() -> void:
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.current_scene = load("res://menus/scoreboards.tscn").instance()
func _on_Options_button_down() -> void:
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.current_scene = load("res://menus/options_menu.tscn").instance()

View file

@ -249,6 +249,8 @@ align = 1
[connection signal="focus_entered" from="Panel/FileSelect" to="MenuSounds" method="play_select_sound"]
[connection signal="focus_entered" from="Panel/MarathonMode" to="MenuSounds" method="play_select_sound"]
[connection signal="focus_entered" from="Panel/Augmentations" to="MenuSounds" method="play_select_sound"]
[connection signal="button_down" from="Panel/Options" to="." method="_on_Options_button_down"]
[connection signal="button_down" from="Panel/Options" to="MenuSounds" method="play_confirm_sound"]
[connection signal="focus_entered" from="Panel/Options" to="MenuSounds" method="play_select_sound"]
[connection signal="button_down" from="Panel/HighScores" to="." method="_on_HighScores_button_down"]
[connection signal="button_down" from="Panel/HighScores" to="MenuSounds" method="play_confirm_sound"]

14
menus/options_menu.gd Normal file
View file

@ -0,0 +1,14 @@
extends Control
func _ready() -> void:
Fade.fade_in(Options.transition_speed_secs)
yield(Fade, "fade_finished")
$OptionsScreen.focus()
func _on_OptionsScreen_exit() -> void:
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.current_scene = load("res://menus/main_menu.tscn").instance()

29
menus/options_menu.tscn Normal file
View file

@ -0,0 +1,29 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://objects/hud/options_screen_scholar.tscn" type="PackedScene" id=1]
[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=2]
[ext_resource path="res://menus/options_menu.gd" type="Script" id=3]
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 2 )
shader_param/color_1 = Color( 1, 0.709804, 0.984314, 1 )
shader_param/color_2 = Color( 1, 0.423529, 0.4, 1 )
shader_param/checker_size = Vector2( 12, 12 )
shader_param/pan_speed = Vector2( 0, 16 )
shader_param/cycle_speed = Vector2( 4, -4 )
shader_param/cycle_alternation = Vector2( 2, 0 )
shader_param/uv_transform = Transform2D( 1, 1, 0, 1, 0, 0 )
[node name="OptionsMenu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource( 1 )
anchor_right = 1.0
anchor_bottom = 1.0
[node name="OptionsScreen" parent="." instance=ExtResource( 1 )]
[connection signal="exit" from="OptionsScreen" to="." method="_on_OptionsScreen_exit"]