aboutsummaryrefslogtreecommitdiff
path: root/game/src/OptionMenu
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-03-04 19:06:05 +0100
committer Hop311 <hop3114@gmail.com>2023-03-04 19:06:05 +0100
commit3e088a2642d2d05eed011b2dd1bdee566225719f (patch)
tree4b80e3cbc20413f9b1ea57fed5a6f7a847328a29 /game/src/OptionMenu
parent3a46095b678d75292090802280ce9dbd3f2d24dc (diff)
Comments marking implemeneted requirements
Diffstat (limited to 'game/src/OptionMenu')
-rw-r--r--game/src/OptionMenu/OptionsMenu.gd9
-rw-r--r--game/src/OptionMenu/OptionsMenu.tscn6
-rw-r--r--game/src/OptionMenu/ResolutionSelector.gd4
-rw-r--r--game/src/OptionMenu/ScreenModeSelector.gd3
-rw-r--r--game/src/OptionMenu/VideoTab.tscn2
-rw-r--r--game/src/OptionMenu/VolumeGrid.gd7
6 files changed, 30 insertions, 1 deletions
diff --git a/game/src/OptionMenu/OptionsMenu.gd b/game/src/OptionMenu/OptionsMenu.gd
index c25c3b8..e7ad7f6 100644
--- a/game/src/OptionMenu/OptionsMenu.gd
+++ b/game/src/OptionMenu/OptionsMenu.gd
@@ -1,5 +1,8 @@
extends Control
+# REQUIREMENTS
+# * SS-13
+
signal back_button_pressed
func _ready():
@@ -13,11 +16,17 @@ func _ready():
button_list.alignment = BoxContainer.ALIGNMENT_END
tab_bar.add_child(button_list)
+ # REQUIREMENTS
+ # * UI-12
+ # * UIFUN-14
var reset_button := Button.new()
reset_button.text = "R"
reset_button.pressed.connect(Events.Options.try_reset_settings)
button_list.add_child(reset_button)
+ # REQUIREMENTS
+ # * UI-11
+ # * UIFUN-17
var back_button := Button.new()
back_button.text = "X"
back_button.pressed.connect(_on_back_button_pressed)
diff --git a/game/src/OptionMenu/OptionsMenu.tscn b/game/src/OptionMenu/OptionsMenu.tscn
index eafe37f..bdb80f1 100644
--- a/game/src/OptionMenu/OptionsMenu.tscn
+++ b/game/src/OptionMenu/OptionsMenu.tscn
@@ -8,6 +8,7 @@
[ext_resource type="PackedScene" uid="uid://dp2grvybtecqu" path="res://src/OptionMenu/OtherTab.tscn" id="5_ahefp"]
[node name="OptionsMenu" type="Control"]
+editor_description = "UI-25"
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@@ -29,19 +30,23 @@ theme_override_constants/margin_right = 250
theme_override_constants/margin_bottom = 200
[node name="Tab" type="TabContainer" parent="Margin"]
+editor_description = "UI-45"
layout_mode = 2
size_flags_vertical = 3
tab_alignment = 1
use_hidden_tabs_for_min_size = true
[node name="Video" parent="Margin/Tab" instance=ExtResource("2_ji8xr")]
+editor_description = "UI-46, UIFUN-43"
layout_mode = 2
[node name="Sound" parent="Margin/Tab" instance=ExtResource("3_4w35t")]
+editor_description = "UI-47, UIFUN-44"
visible = false
layout_mode = 2
[node name="Controls" parent="Margin/Tab" instance=ExtResource("4_vdhjp")]
+editor_description = "SS-27, UI-49, UIFUN-46"
visible = false
layout_mode = 2
@@ -64,4 +69,5 @@ mouse_filter = 2
alignment = 2
[node name="LocaleButton" parent="LocaleVBox/LocaleHBox" instance=ExtResource("2_d7wvq")]
+editor_description = "UI-79"
layout_mode = 2
diff --git a/game/src/OptionMenu/ResolutionSelector.gd b/game/src/OptionMenu/ResolutionSelector.gd
index 6cdaca8..2fdcba2 100644
--- a/game/src/OptionMenu/ResolutionSelector.gd
+++ b/game/src/OptionMenu/ResolutionSelector.gd
@@ -1,5 +1,9 @@
extends SettingOptionButton
+# REQUIREMENTS
+# * UIFUN-21
+# * UIFUN-28
+
@export
var default_value : Vector2i = Resolution.error_resolution
diff --git a/game/src/OptionMenu/ScreenModeSelector.gd b/game/src/OptionMenu/ScreenModeSelector.gd
index b4fc5ab..f17fefb 100644
--- a/game/src/OptionMenu/ScreenModeSelector.gd
+++ b/game/src/OptionMenu/ScreenModeSelector.gd
@@ -1,5 +1,8 @@
extends SettingOptionButton
+# REQUIREMENTS
+# * UIFUN-42
+
enum ScreenMode { Unknown = -1, Fullscreen, Borderless, Windowed }
func get_screen_mode_from_window_mode(window_mode : int) -> ScreenMode:
diff --git a/game/src/OptionMenu/VideoTab.tscn b/game/src/OptionMenu/VideoTab.tscn
index f14f757..245d15d 100644
--- a/game/src/OptionMenu/VideoTab.tscn
+++ b/game/src/OptionMenu/VideoTab.tscn
@@ -26,6 +26,7 @@ layout_mode = 2
text = "Resolution"
[node name="ResolutionSelector" type="OptionButton" parent="VBoxContainer/GridContainer"]
+editor_description = "UI-19"
layout_mode = 2
item_count = 1
selected = 0
@@ -36,6 +37,7 @@ section_name = "Video"
setting_name = "Resolution"
[node name="ScreenModeLabel" type="Label" parent="VBoxContainer/GridContainer"]
+editor_description = "UI-44"
layout_mode = 2
text = "Screen Mode"
diff --git a/game/src/OptionMenu/VolumeGrid.gd b/game/src/OptionMenu/VolumeGrid.gd
index 8d5a016..297de6f 100644
--- a/game/src/OptionMenu/VolumeGrid.gd
+++ b/game/src/OptionMenu/VolumeGrid.gd
@@ -31,10 +31,14 @@ func add_volume_row(bus_name : StringName, bus_index : int) -> HSlider:
_slider_dictionary[volume_label.text] = volume_slider
return volume_slider
+# REQUIREMENTS
+# * UI-22
func _ready():
for bus_index in AudioServer.bus_count:
add_volume_row(AudioServer.get_bus_name(bus_index), bus_index)
+# REQUIREMENTS
+# * UIFUN-30
func _on_slider_value_changed(value : float, bus_index : int) -> void:
AudioServer.set_bus_volume_db(bus_index, get_volume_value_as_db(value))
@@ -43,7 +47,8 @@ func _on_options_menu_load_settings(load_file : ConfigFile):
for volume_slider in _slider_dictionary.values():
volume_slider.load_setting(load_file)
-
+# REQUIREMENTS
+# * UIFUN-23
func _on_options_menu_save_settings(save_file : ConfigFile):
for volume_slider in _slider_dictionary.values():
volume_slider.save_setting(save_file)