Setttings added

This commit is contained in:
Your Name
2025-07-19 22:40:07 +04:00
parent 877b5fc14f
commit 49d4167499
7 changed files with 256 additions and 5 deletions

128
ui/SettingsMenu.tscn Normal file
View File

@@ -0,0 +1,128 @@
[gd_scene load_steps=2 format=3 uid="uid://57obmcwyos2g"]
[ext_resource type="Script" uid="uid://c8mlvlerv4y03" path="res://scripts/SettingsMenu.gd" id="1_oqkcn"]
[node name="SettingsMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_oqkcn")
[node name="Background" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.209, 0.5159, 0.55, 1)
[node name="SettingsContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -34.5
offset_top = -20.0
offset_right = 34.5
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
[node name="SettingsTitle" type="Label" parent="SettingsContainer"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
text = "Settings"
[node name="MasterVolumeContainer" type="HBoxContainer" parent="SettingsContainer"]
layout_mode = 2
[node name="MasterVolume" type="Label" parent="SettingsContainer/MasterVolumeContainer"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "Master Volume"
[node name="MasterVolumeSlider" type="HSlider" parent="SettingsContainer/MasterVolumeContainer"]
layout_mode = 2
size_flags_horizontal = 3
max_value = 1.0
step = 0.1
value = 0.5
[node name="MusicVolumeContainer" type="HBoxContainer" parent="SettingsContainer"]
layout_mode = 2
[node name="MusicVolume" type="Label" parent="SettingsContainer/MusicVolumeContainer"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "Music Volume"
[node name="MusicVolumeSlider" type="HSlider" parent="SettingsContainer/MusicVolumeContainer"]
layout_mode = 2
size_flags_horizontal = 3
max_value = 1.0
step = 0.1
value = 0.5
[node name="SFXVolumeContainer" type="HBoxContainer" parent="SettingsContainer"]
layout_mode = 2
[node name="SFXVolume" type="Label" parent="SettingsContainer/SFXVolumeContainer"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "SFX Volume"
[node name="SFXVolumeSlider" type="HSlider" parent="SettingsContainer/SFXVolumeContainer"]
layout_mode = 2
size_flags_horizontal = 3
max_value = 1.0
step = 0.1
value = 0.5
[node name="LanguageContainer" type="HBoxContainer" parent="SettingsContainer"]
layout_mode = 2
size_flags_vertical = 4
[node name="LanguageLabel" type="Label" parent="SettingsContainer/LanguageContainer"]
custom_minimum_size = Vector2(150, 0)
layout_mode = 2
text = "Language"
[node name="LanguageSelector" type="OptionButton" parent="SettingsContainer/LanguageContainer"]
layout_mode = 2
size_flags_horizontal = 4
selected = 0
item_count = 5
popup/item_0/text = "English"
popup/item_0/id = 0
popup/item_1/text = "Español"
popup/item_1/id = 1
popup/item_2/text = "Français"
popup/item_2/id = 2
popup/item_3/text = "Deutsch"
popup/item_3/id = 3
popup/item_4/text = "Русский"
popup/item_4/id = 4
[node name="BackButtonContainer" type="Control" parent="."]
layout_mode = 1
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Button" type="Button" parent="BackButtonContainer"]
layout_mode = 0
offset_right = 8.0
offset_bottom = 8.0
text = "back"
[connection signal="value_changed" from="SettingsContainer/MasterVolumeContainer/MasterVolumeSlider" to="." method="_on_master_volume_changed"]
[connection signal="value_changed" from="SettingsContainer/MusicVolumeContainer/MusicVolumeSlider" to="." method="_on_music_volume_changed"]
[connection signal="value_changed" from="SettingsContainer/SFXVolumeContainer/SFXVolumeSlider" to="." method="_on_sfx_volume_changed"]
[connection signal="item_selected" from="SettingsContainer/LanguageContainer/LanguageSelector" to="." method="_on_language_selector_item_selected"]
[connection signal="pressed" from="BackButtonContainer/Button" to="." method="_on_back_button_pressed"]