Volume Sliders

This commit is contained in:
Marco 2025-03-17 11:43:11 +01:00
commit c75d9d226f
19 changed files with 257 additions and 49 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=31 format=3 uid="uid://dkwi1hu1bixoe"]
[gd_scene load_steps=29 format=3 uid="uid://dkwi1hu1bixoe"]
[ext_resource type="Script" uid="uid://baf6pxbvhqmjk" path="res://Scripts/Hud.cs" id="1_m0hb0"]
[ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="2_0xmx2"]
@ -11,10 +11,10 @@
[ext_resource type="PackedScene" uid="uid://bwlstkdibs7oc" path="res://Scenes/HUD/BossHud.tscn" id="5_vmict"]
[ext_resource type="FontFile" uid="uid://coek1e2q257pq" path="res://fonts/at01.ttf" id="6_sk1eq"]
[ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="9_sx5r0"]
[ext_resource type="StyleBox" uid="uid://dnb4ogn847dyp" path="res://Resources/Styles/HealthBarBackground.tres" id="10_n0pka"]
[ext_resource type="Script" uid="uid://bobo5f4ud60qw" path="res://Scripts/UI/ItemsMenu.cs" id="10_oflr6"]
[ext_resource type="Texture2D" uid="uid://teydwmu6h04b" path="res://Sprites/UI/HealthBar.png" id="10_sjdna"]
[ext_resource type="Script" uid="uid://com5b4ffsmj7s" path="res://Scripts/UI/InventoryMenu.cs" id="11_7pulb"]
[ext_resource type="Texture2D" uid="uid://b4itkpf7s61p3" path="res://Sprites/UI/HealthBar_Foreground.png" id="11_86ddi"]
[ext_resource type="StyleBox" uid="uid://6ydsirgc5xi5" path="res://Resources/Styles/HealthBarFill.tres" id="11_j6myr"]
[ext_resource type="Texture2D" uid="uid://bhmtp6i2g2f1c" path="res://Sprites/UI/ShieldBar.png" id="12_n0pka"]
[ext_resource type="Texture2D" uid="uid://cihsd5rw8i5xm" path="res://Sprites/UI/ShieldBar_Foreground.png" id="13_j6myr"]
[ext_resource type="StyleBox" uid="uid://24hh6h4juk3r" path="res://Resources/Styles/PixelStyleBoxRed_SquareBackground.tres" id="13_sjdna"]
@ -56,26 +56,6 @@ animations = [{
"speed": 5.0
}]
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_86ddi"]
texture = ExtResource("10_sjdna")
texture_margin_left = 3.0
texture_margin_top = 3.0
texture_margin_right = 3.0
texture_margin_bottom = 3.0
expand_margin_left = 1.0
expand_margin_top = 1.0
expand_margin_right = 1.0
expand_margin_bottom = 1.0
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_qpigx"]
texture = ExtResource("11_86ddi")
texture_margin_left = 3.0
texture_margin_top = 3.0
texture_margin_right = 3.0
texture_margin_bottom = 3.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_h6xwv"]
texture = ExtResource("12_n0pka")
texture_margin_left = 3.0
@ -172,8 +152,8 @@ layout_mode = 2
custom_minimum_size = Vector2(34, 8)
layout_mode = 2
size_flags_vertical = 4
theme_override_styles/background = SubResource("StyleBoxTexture_86ddi")
theme_override_styles/fill = SubResource("StyleBoxTexture_qpigx")
theme_override_styles/background = ExtResource("10_n0pka")
theme_override_styles/fill = ExtResource("11_j6myr")
value = 50.0
rounded = true
show_percentage = false

View file

@ -1,10 +1,11 @@
[gd_scene load_steps=7 format=3 uid="uid://bnhcgsyh6wfo3"]
[gd_scene load_steps=8 format=3 uid="uid://bnhcgsyh6wfo3"]
[ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="1_il8fq"]
[ext_resource type="Script" uid="uid://c1874e6ryvd1g" path="res://Scripts/UI/OptionsMenu.cs" id="1_mpohc"]
[ext_resource type="Texture2D" uid="uid://b4fhb0wyc5vw" path="res://Sprites/UI/BackIcon.png" id="2_4kao5"]
[ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="2_l5i2j"]
[ext_resource type="StyleBox" uid="uid://ctw2hju32l3rg" path="res://Resources/Styles/PixelStyleBoxRed.tres" id="3_l5i2j"]
[ext_resource type="PackedScene" uid="uid://cwhm3802fhdax" path="res://Scenes/HUD/Volume_Slider.tscn" id="6_x23el"]
[sub_resource type="LabelSettings" id="LabelSettings_4kao5"]
font = ExtResource("2_l5i2j")
@ -12,13 +13,14 @@ font_size = 20
outline_size = 4
outline_color = Color(0, 0, 0, 1)
[node name="OptionsMenu" type="VBoxContainer"]
[node name="OptionsMenu" type="VBoxContainer" node_paths=PackedStringArray("ResolutionsList")]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_mpohc")
ResolutionsList = NodePath("ScrollContainer/HBoxContainer/HFlowContainer/Resolution/ResolutionsList")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
@ -58,19 +60,15 @@ layout_mode = 2
text = "Note: The options currently do nothing"
[node name="Resolution" type="VBoxContainer" parent="ScrollContainer/HBoxContainer/HFlowContainer"]
visible = false
layout_mode = 2
[node name="Label" type="Label" parent="ScrollContainer/HBoxContainer/HFlowContainer/Resolution"]
layout_mode = 2
text = "Resolution"
[node name="OptionButton" type="OptionButton" parent="ScrollContainer/HBoxContainer/HFlowContainer/Resolution"]
[node name="ResolutionsList" type="OptionButton" parent="ScrollContainer/HBoxContainer/HFlowContainer/Resolution"]
layout_mode = 2
item_count = 2
popup/item_0/text = "1920x1080"
popup/item_0/id = 0
popup/item_1/text = "Test 1"
popup/item_1/id = 1
[node name="CheckBox" type="CheckBox" parent="ScrollContainer/HBoxContainer/HFlowContainer"]
layout_mode = 2
@ -80,7 +78,7 @@ text = "VSync"
[node name="CheckBox2" type="CheckBox" parent="ScrollContainer/HBoxContainer/HFlowContainer"]
layout_mode = 2
size_flags_vertical = 0
text = "Whatever"
text = "Full Screen"
[node name="CheckBox3" type="CheckBox" parent="ScrollContainer/HBoxContainer/HFlowContainer"]
layout_mode = 2
@ -95,16 +93,28 @@ text = "adsfdsaf"
[node name="VBoxContainer3" type="VBoxContainer" parent="ScrollContainer/HBoxContainer"]
layout_mode = 2
[node name="VBoxContainer3" type="VBoxContainer" parent="ScrollContainer/HBoxContainer/VBoxContainer3"]
layout_mode = 2
theme = ExtResource("1_il8fq")
[node name="Label" type="Label" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer3"]
layout_mode = 2
text = "Master Volume"
[node name="MusicSlider" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer3" instance=ExtResource("6_x23el")]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer/HBoxContainer/VBoxContainer3"]
layout_mode = 2
theme = ExtResource("1_il8fq")
[node name="Label" type="Label" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer"]
layout_mode = 2
text = "Music Volume"
[node name="HSlider" type="HSlider" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer"]
[node name="MusicSlider" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer" instance=ExtResource("6_x23el")]
layout_mode = 2
value = 50.0
AudioBusName = &"Music"
[node name="VBoxContainer2" type="VBoxContainer" parent="ScrollContainer/HBoxContainer/VBoxContainer3"]
layout_mode = 2
@ -113,8 +123,8 @@ layout_mode = 2
layout_mode = 2
text = "Sound Effects Volume"
[node name="HSlider" type="HSlider" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer2"]
[node name="SoundSlider" parent="ScrollContainer/HBoxContainer/VBoxContainer3/VBoxContainer2" instance=ExtResource("6_x23el")]
layout_mode = 2
value = 50.0
AudioBusName = &"Effects"
[connection signal="pressed" from="HBoxContainer/BackButton" to="." method="_on_back_button_pressed"]

View file

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://cwhm3802fhdax"]
[ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="1_guyi5"]
[ext_resource type="Script" uid="uid://du6nu7qvqvd8w" path="res://Scripts/UI/AudioSlider.cs" id="2_i14ck"]
[node name="VolumeSlider" type="HSlider"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_guyi5")
max_value = 1.0
step = 0.05
value = 0.6
script = ExtResource("2_i14ck")
[connection signal="mouse_exited" from="." to="." method="release_focus"]

View file

@ -20,9 +20,9 @@
[ext_resource type="Resource" uid="uid://byo74ews118nl" path="res://Resources/Music/No_Reason.tres" id="13_fh7cp"]
[ext_resource type="FontFile" uid="uid://cyk27h5aox1n7" path="res://fonts/sector_034.ttf" id="14_yxkem"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ljnfb"]
[sub_resource type="AtlasTexture" id="AtlasTexture_hbsma"]
atlas = ExtResource("9_riqfo")
region = Rect2(128, 0, 32, 16)
region = Rect2(192, 0, 32, 16)
[sub_resource type="Theme" id="Theme_c7h4d"]
@ -67,7 +67,7 @@ offset_top = 40.995
offset_right = 186.42
offset_bottom = 56.995
rotation = 3.14159
texture = SubResource("AtlasTexture_ljnfb")
texture = SubResource("AtlasTexture_hbsma")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchors_preset = 15
@ -203,14 +203,16 @@ text = "Credits"
[node name="AudioStreamPlayer2D" parent="." instance=ExtResource("8_koqhg")]
stream = ExtResource("4_i6ku4")
autoplay = true
bus = &"Music"
MusicData = ExtResource("13_fh7cp")
[node name="SubMenuContainer" type="PanelContainer" parent="."]
visible = false
offset_left = 13.0
offset_top = 23.0
offset_right = 312.0
offset_bottom = 156.0
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("7_rrcx7")
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/StartButton" to="." method="_on_start_button_pressed"]

View file

@ -61,7 +61,7 @@
[sub_resource type="Resource" id="Resource_6wo78"]
script = ExtResource("4_u1i8n")
EggIndex = 0
StartingEquipment = Array[ExtResource("5_u1i8n")]([])
StartingEquipment = []
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rff8l"]
size = Vector2(30, 52.5)