Skip to content

Commit

Permalink
WIP Adding in basic sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
ee0pdt committed Nov 2, 2022
1 parent 29c26bb commit 8a5df81
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 114 deletions.
2 changes: 1 addition & 1 deletion app/app.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ func _handle_quit():


func _handle_settings():
print("settings")
get_tree().paused = true
get_tree().change_scene_to_file(settings)

27 changes: 3 additions & 24 deletions default_bus_layout.tres
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
[gd_resource type="AudioBusLayout" load_steps=4 format=3 uid="uid://d3381cofw8yd4"]

[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_obxrb"]
resource_name = "Reverb"
wet = 0.34

[sub_resource type="AudioEffectCompressor" id="AudioEffectCompressor_yucvq"]
resource_name = "Compressor"
gain = 1.4

[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_inn6x"]
resource_name = "Reverb"
room_size = 0.7
damping = 0.6
spread = 0.28
wet = 0.14
[gd_resource type="AudioBusLayout" format=3 uid="uid://d3381cofw8yd4"]

[resource]
bus/1/name = &"SFX"
Expand All @@ -22,21 +7,15 @@ bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = 1.45823
bus/1/send = &"Master"
bus/1/effect/0/effect = SubResource("AudioEffectReverb_obxrb")
bus/1/effect/0/enabled = true
bus/2/name = &"Music"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = -4.12528
bus/2/volume_db = 1.75376
bus/2/send = &"Master"
bus/3/name = &"Dialog"
bus/3/solo = false
bus/3/mute = false
bus/3/bypass_fx = false
bus/3/volume_db = 2.647
bus/3/volume_db = 1.556
bus/3/send = &"Master"
bus/3/effect/0/effect = SubResource("AudioEffectCompressor_yucvq")
bus/3/effect/0/enabled = true
bus/3/effect/1/effect = SubResource("AudioEffectReverb_inn6x")
bus/3/effect/1/enabled = true
37 changes: 12 additions & 25 deletions main_menu/main_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,30 @@ theme_override_constants/margin_top = 50
theme_override_constants/margin_bottom = 50

[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/MarginContainer"]
layout_mode = 2
offset_top = 50.0
offset_right = 1152.0
offset_bottom = 598.0
offset_bottom = 626.0

[node name="Spacer" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_right = 412.0
offset_bottom = 548.0
offset_bottom = 576.0
size_flags_horizontal = 3

[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_left = 416.0
offset_right = 736.0
offset_bottom = 548.0
offset_bottom = 576.0
grow_horizontal = 2
grow_vertical = 2

[node name="LogoWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
offset_right = 320.0
offset_bottom = 360.0
theme_override_constants/margin_top = 20
theme_override_constants/margin_bottom = 20

[node name="Logo" type="TextureRect" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/LogoWrapper"]
custom_minimum_size = Vector2(320, 320)
layout_mode = 2
offset_top = 20.0
offset_right = 320.0
offset_bottom = 340.0
Expand All @@ -67,17 +62,15 @@ texture = ExtResource("3_4s4l6")
ignore_texture_size = true

[node name="StartGameWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
offset_top = 364.0
offset_right = 320.0
offset_bottom = 454.0
offset_bottom = 432.0
size_flags_vertical = 3
theme_override_constants/margin_bottom = 20

[node name="StartGameButton" type="Button" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/StartGameWrapper"]
layout_mode = 2
offset_right = 320.0
offset_bottom = 70.0
offset_bottom = 48.0
grow_horizontal = 2
grow_vertical = 2
mouse_default_cursor_shape = 2
Expand All @@ -86,18 +79,15 @@ theme_override_font_sizes/font_size = 30
text = "Start Game"

[node name="SettingsWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
visible = false
layout_mode = 2
offset_top = 420.0
offset_top = 436.0
offset_right = 320.0
offset_bottom = 512.0
offset_bottom = 504.0
size_flags_vertical = 3
theme_override_constants/margin_bottom = 20

[node name="SettingsButton" type="Button" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/SettingsWrapper"]
layout_mode = 2
offset_right = 320.0
offset_bottom = 72.0
offset_bottom = 48.0
grow_horizontal = 2
grow_vertical = 2
mouse_default_cursor_shape = 2
Expand All @@ -106,17 +96,15 @@ theme_override_font_sizes/font_size = 30
text = "Settings"

[node name="QuitWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
offset_top = 458.0
offset_top = 508.0
offset_right = 320.0
offset_bottom = 548.0
offset_bottom = 576.0
size_flags_vertical = 3
theme_override_constants/margin_bottom = 20

[node name="QuitButton" type="Button" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/QuitWrapper"]
layout_mode = 2
offset_right = 320.0
offset_bottom = 70.0
offset_bottom = 48.0
grow_horizontal = 2
grow_vertical = 2
mouse_default_cursor_shape = 2
Expand All @@ -125,10 +113,9 @@ theme_override_font_sizes/font_size = 30
text = "Quit"

[node name="Spacer2" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_left = 740.0
offset_right = 1152.0
offset_bottom = 548.0
offset_bottom = 576.0
size_flags_horizontal = 3

[node name="BabyGodotLogo" type="Sprite2D" parent="."]
Expand Down
184 changes: 120 additions & 64 deletions settings/settings.tscn
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[gd_scene load_steps=4 format=3 uid="uid://qywvxsjh5sln"]
[gd_scene load_steps=2 format=3 uid="uid://qywvxsjh5sln"]

[ext_resource type="Script" path="res://main_menu/main_menu.gd" id="1_p4fku"]
[ext_resource type="PackedScene" uid="uid://brmrxvtukr80b" path="res://game/game.tscn" id="2_8d1ow"]
[ext_resource type="Theme" uid="uid://buoc2adjg78ea" path="res://assets/ui_theme.tres" id="4_qljup"]
[ext_resource type="Script" path="res://settings/settings.gd" id="1_bkxy4"]

[node name="main_menu" type="Node2D"]
script = ExtResource("1_p4fku")
game = ExtResource("2_8d1ow")
[node name="SettingsMenu" type="Node2D"]
process_mode = 3
script = ExtResource("1_bkxy4")

[node name="CanvasLayer" type="CanvasLayer" parent="."]

Expand All @@ -28,79 +26,137 @@ theme_override_constants/margin_top = 120
theme_override_constants/margin_bottom = 120

[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/MarginContainer"]
layout_mode = 2
offset_top = 120.0
offset_right = 1152.0
offset_bottom = 528.0

[node name="Spacer" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
offset_right = 381.0
[node name="Spacer3" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_right = 227.0
offset_bottom = 408.0
size_flags_horizontal = 3

[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
offset_left = 385.0
offset_right = 766.0
[node name="AudioSlider1" type="VBoxContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_left = 231.0
offset_right = 458.0
offset_bottom = 408.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3

[node name="StartGameWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
offset_right = 381.0
offset_bottom = 133.0
alignment = 1

[node name="SliderMargin" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider1"]
layout_mode = 2
offset_left = 105.0
offset_right = 121.0
offset_bottom = 336.0
size_flags_horizontal = 4
size_flags_vertical = 3
theme_override_constants/margin_bottom = 20

[node name="StartGameButton" type="Button" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/StartGameWrapper"]
offset_right = 381.0
offset_bottom = 113.0
grow_horizontal = 2
grow_vertical = 2
mouse_default_cursor_shape = 2
theme = ExtResource("4_qljup")
theme_override_font_sizes/font_size = 30
text = "Audio"

[node name="SettingsWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
offset_top = 137.0
offset_right = 381.0
offset_bottom = 270.0
size_flags_stretch_ratio = 5.0

[node name="SoundEffectsSlider" type="VSlider" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider1/SliderMargin"]
unique_name_in_owner = true
layout_mode = 2
offset_right = 16.0
offset_bottom = 336.0

[node name="LabelMargin" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider1"]
layout_mode = 2
offset_top = 340.0
offset_right = 227.0
offset_bottom = 408.0
size_flags_vertical = 3
theme_override_constants/margin_bottom = 20

[node name="SettingsButton" type="Button" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/SettingsWrapper"]
offset_right = 381.0
offset_bottom = 113.0
grow_horizontal = 2
grow_vertical = 2
mouse_default_cursor_shape = 2
theme = ExtResource("4_qljup")
theme_override_font_sizes/font_size = 30
text = "Controls"

[node name="QuitWrapper" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer"]
offset_top = 274.0
offset_right = 381.0
theme_override_constants/margin_top = 20

[node name="SFXLabel" type="RichTextLabel" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider1/LabelMargin"]
layout_mode = 2
offset_top = 20.0
offset_right = 227.0
offset_bottom = 68.0
bbcode_enabled = true
text = "[center]SoundEffects[/center]"

[node name="AudioSlider2" type="VBoxContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_left = 462.0
offset_right = 689.0
offset_bottom = 408.0
size_flags_horizontal = 3
alignment = 1

[node name="SliderMargin" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider2"]
layout_mode = 2
offset_left = 105.0
offset_right = 121.0
offset_bottom = 336.0
size_flags_horizontal = 4
size_flags_vertical = 3
theme_override_constants/margin_bottom = 20
size_flags_stretch_ratio = 5.0

[node name="MusicSlider" type="VSlider" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider2/SliderMargin"]
unique_name_in_owner = true
layout_mode = 2
offset_right = 16.0
offset_bottom = 336.0

[node name="LabelMargin" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider2"]
layout_mode = 2
offset_top = 340.0
offset_right = 227.0
offset_bottom = 408.0
size_flags_vertical = 3
theme_override_constants/margin_top = 20

[node name="MusicLabel" type="RichTextLabel" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider2/LabelMargin"]
layout_mode = 2
offset_top = 20.0
offset_right = 227.0
offset_bottom = 68.0
bbcode_enabled = true
text = "[center]Music[/center]"

[node name="AudioSlider3" type="VBoxContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
layout_mode = 2
offset_left = 693.0
offset_right = 920.0
offset_bottom = 408.0
size_flags_horizontal = 3
alignment = 1

[node name="SliderMargin" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider3"]
layout_mode = 2
offset_left = 105.0
offset_right = 121.0
offset_bottom = 336.0
size_flags_horizontal = 4
size_flags_vertical = 3
size_flags_stretch_ratio = 5.0

[node name="DialogSlider" type="VSlider" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider3/SliderMargin"]
unique_name_in_owner = true
layout_mode = 2
offset_right = 16.0
offset_bottom = 336.0

[node name="LabelMargin" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider3"]
layout_mode = 2
offset_top = 340.0
offset_right = 227.0
offset_bottom = 408.0
size_flags_vertical = 3
theme_override_constants/margin_top = 20

[node name="QuitButton" type="Button" parent="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/QuitWrapper"]
offset_right = 381.0
offset_bottom = 114.0
grow_horizontal = 2
grow_vertical = 2
mouse_default_cursor_shape = 2
theme = ExtResource("4_qljup")
theme_override_font_sizes/font_size = 30
text = "Quit"
[node name="DialogLabel" type="RichTextLabel" parent="CanvasLayer/MarginContainer/HBoxContainer/AudioSlider3/LabelMargin"]
layout_mode = 2
offset_top = 20.0
offset_right = 227.0
offset_bottom = 68.0
bbcode_enabled = true
text = "[center]Dialog[/center]"

[node name="Spacer2" type="MarginContainer" parent="CanvasLayer/MarginContainer/HBoxContainer"]
offset_left = 770.0
layout_mode = 2
offset_left = 924.0
offset_right = 1152.0
offset_bottom = 408.0
size_flags_horizontal = 3

[connection signal="pressed" from="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/StartGameWrapper/StartGameButton" to="." method="_on_start_game_pressed"]
[connection signal="pressed" from="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/SettingsWrapper/SettingsButton" to="." method="_on_settings_button_pressed"]
[connection signal="pressed" from="CanvasLayer/MarginContainer/HBoxContainer/VBoxContainer/QuitWrapper/QuitButton" to="." method="_on_quit_pressed"]

0 comments on commit 8a5df81

Please sign in to comment.