diff options
author | Hop311 <hop3114@gmail.com> | 2023-03-04 19:06:05 +0100 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-03-04 19:06:05 +0100 |
commit | 3e088a2642d2d05eed011b2dd1bdee566225719f (patch) | |
tree | 4b80e3cbc20413f9b1ea57fed5a6f7a847328a29 /game | |
parent | 3a46095b678d75292090802280ce9dbd3f2d24dc (diff) |
Comments marking implemeneted requirements
Diffstat (limited to 'game')
-rw-r--r-- | game/src/Autoload/Events/Options.gd | 5 | ||||
-rw-r--r-- | game/src/Autoload/SoundManager.gd | 8 | ||||
-rw-r--r-- | game/src/Credits/Credits.tscn | 3 | ||||
-rw-r--r-- | game/src/GameMenu.gd | 6 | ||||
-rw-r--r-- | game/src/LobbyMenu/LobbyMenu.gd | 5 | ||||
-rw-r--r-- | game/src/LobbyMenu/LobbyMenu.tscn | 3 | ||||
-rw-r--r-- | game/src/LocaleButton.gd | 4 | ||||
-rw-r--r-- | game/src/MainMenu/MainMenu.gd | 15 | ||||
-rw-r--r-- | game/src/MainMenu/MainMenu.tscn | 8 | ||||
-rw-r--r-- | game/src/OptionMenu/OptionsMenu.gd | 9 | ||||
-rw-r--r-- | game/src/OptionMenu/OptionsMenu.tscn | 6 | ||||
-rw-r--r-- | game/src/OptionMenu/ResolutionSelector.gd | 4 | ||||
-rw-r--r-- | game/src/OptionMenu/ScreenModeSelector.gd | 3 | ||||
-rw-r--r-- | game/src/OptionMenu/VideoTab.tscn | 2 | ||||
-rw-r--r-- | game/src/OptionMenu/VolumeGrid.gd | 7 |
15 files changed, 79 insertions, 9 deletions
diff --git a/game/src/Autoload/Events/Options.gd b/game/src/Autoload/Events/Options.gd index 8af620d..6b9e089 100644 --- a/game/src/Autoload/Events/Options.gd +++ b/game/src/Autoload/Events/Options.gd @@ -7,6 +7,8 @@ signal reset_settings() func load_settings_from_file() -> void: load_settings.emit(_settings_file) +# REQUIREMENTS +# * SS-11 func save_settings_to_file() -> void: save_settings.emit(_settings_file) _settings_file.save(_settings_file_path) @@ -20,6 +22,9 @@ const settings_file_path_default : String = "user://settings.cfg" var _settings_file_path : String = ProjectSettings.get_setting(settings_file_path_setting, settings_file_path_default) var _settings_file := ConfigFile.new() +# REQUIREMENTS +# * SS-9 +# * UIFUN-7 func _init(): if FileAccess.file_exists(_settings_file_path): _settings_file.load(_settings_file_path) diff --git a/game/src/Autoload/SoundManager.gd b/game/src/Autoload/SoundManager.gd index d3f8039..c58ce1a 100644 --- a/game/src/Autoload/SoundManager.gd +++ b/game/src/Autoload/SoundManager.gd @@ -1,11 +1,16 @@ extends Node +# REQUIREMENTS: +# * SS-68 + const _audio_directory_path : StringName = &"res://audio/sfx/" var _loaded_sound : Dictionary = {} var _bus_to_stream_player : Dictionary = {} +# REQUIREMENTS: +# * SND-10 func _ready(): var dir = DirAccess.open(_audio_directory_path) for fname in dir.get_files(): @@ -28,7 +33,8 @@ func play_stream(sound : AudioStream, bus_type : String) -> void: func play(sound : String, bus_type : String) -> void: play_stream(_loaded_sound[sound], bus_type) -# SND-7 +# REQUIREMENTS: +# * SND-7 func play_effect_stream(sound : AudioStream) -> void: play_stream(sound, "SFX") diff --git a/game/src/Credits/Credits.tscn b/game/src/Credits/Credits.tscn index 7151aa8..9889119 100644 --- a/game/src/Credits/Credits.tscn +++ b/game/src/Credits/Credits.tscn @@ -6,6 +6,7 @@ [ext_resource type="LabelSettings" uid="uid://bwmyvoa3q0ve5" path="res://src/Credits/PersonLabelSettings.tres" id="4_004ma"] [node name="Credits" type="Control" node_paths=PackedStringArray("credits_list")] +editor_description = "UI-34" layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -30,10 +31,12 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 10 [node name="BackButton" type="Button" parent="ControlMargin"] +editor_description = "UI-38" layout_mode = 2 text = "Back to Main Menu" [node name="Scroll" type="ScrollContainer" parent="."] +editor_description = "UI-35" layout_mode = 2 anchor_top = 0.071 anchor_right = 1.0 diff --git a/game/src/GameMenu.gd b/game/src/GameMenu.gd index 6856e0f..3a4c88f 100644 --- a/game/src/GameMenu.gd +++ b/game/src/GameMenu.gd @@ -1,5 +1,7 @@ extends Control +# REQUIREMENTS +# * SS-10 func _ready(): Events.Options.load_settings_from_file() @@ -8,7 +10,9 @@ func _on_main_menu_new_game_button_pressed(): $LobbyMenu.show() $MainMenu.hide() - +# REQUIREMENTS +# * SS-6 +# * UIFUN-5 func _on_main_menu_options_button_pressed(): $OptionsMenu.toggle_locale_button_visibility(false) $OptionsMenu.show() diff --git a/game/src/LobbyMenu/LobbyMenu.gd b/game/src/LobbyMenu/LobbyMenu.gd index cc4bb05..873e2a2 100644 --- a/game/src/LobbyMenu/LobbyMenu.gd +++ b/game/src/LobbyMenu/LobbyMenu.gd @@ -11,6 +11,7 @@ signal save_game_selected var start_button : BaseButton # REQUIREMENTS: +# * SS-16 # * UIFUN-40 func _on_back_button_button_down(): print("Returning to Main Menu.") @@ -18,14 +19,14 @@ func _on_back_button_button_down(): # REQUIREMENTS: -# * UIFUN-65 +# * SS-21 func _on_start_button_button_down(): print("Starting new game.") get_tree().change_scene_to_file("res://src/SampleGame.tscn") # REQUIREMENTS: -# * UIFUN-61 +# * SS-19 func _on_game_select_list_item_selected(index): print("Selected save game: ", index) save_game_selected.emit(index) diff --git a/game/src/LobbyMenu/LobbyMenu.tscn b/game/src/LobbyMenu/LobbyMenu.tscn index 340d47d..fcf2263 100644 --- a/game/src/LobbyMenu/LobbyMenu.tscn +++ b/game/src/LobbyMenu/LobbyMenu.tscn @@ -3,6 +3,7 @@ [ext_resource type="Script" path="res://src/LobbyMenu/LobbyMenu.gd" id="1_cvwum"] [node name="LobbyMenu" type="HBoxContainer" node_paths=PackedStringArray("start_button")] +editor_description = "UI-36" anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -31,6 +32,7 @@ layout_mode = 2 size_flags_vertical = 3 [node name="BackButton" type="Button" parent="GameSelectPanel/VBoxContainer"] +editor_description = "UI-37" layout_mode = 2 text = "Back" @@ -66,6 +68,7 @@ layout_mode = 2 size_flags_vertical = 3 [node name="StartButton" type="Button" parent="GameStartPanel/VBoxContainer"] +editor_description = "UI-43" layout_mode = 2 disabled = true text = "Start Game" diff --git a/game/src/LocaleButton.gd b/game/src/LocaleButton.gd index 9f499b8..a8220de 100644 --- a/game/src/LocaleButton.gd +++ b/game/src/LocaleButton.gd @@ -39,6 +39,8 @@ func load_setting(file : ConfigFile) -> void: push_error("Setting value '%s' invalid for setting [%s] %s" % [load_value, section_name, setting_name]) reset_setting() +# REQUIREMENTS: +# * UIFUN-74 func save_setting(file : ConfigFile) -> void: if file == null: return file.set_value(section_name, setting_name, _locales_list[selected]) @@ -46,6 +48,8 @@ func save_setting(file : ConfigFile) -> void: func reset_setting() -> void: selected = _locales_list.find(TranslationServer.get_locale()) +# REQUIREMENTS: +# * SS-58 func _on_item_selected(index : int) -> void: if _valid_index(index): TranslationServer.set_locale(_locales_list[index]) diff --git a/game/src/MainMenu/MainMenu.gd b/game/src/MainMenu/MainMenu.gd index 4ffa3b0..7e790c0 100644 --- a/game/src/MainMenu/MainMenu.gd +++ b/game/src/MainMenu/MainMenu.gd @@ -10,16 +10,21 @@ var _new_game_button : BaseButton @export var _checksum_label : Label +# REQUIREMENTS: +# * SS-3 +# * UIFUN-97 func _ready(): print("From GDScript") TestSingleton.hello_singleton() - # UI-111 - _checksum_label.tooltip_text = "Checksum " + Checksum.get_checksum_text() - _checksum_label.text = "(" + Checksum.get_checksum_text().substr(0, 4) + ")" + # UIFUN-97 + var checksum := Checksum.get_checksum_text() + _checksum_label.tooltip_text = "Checksum " + checksum + _checksum_label.text = "(" + checksum.substr(0, 4) + ")" _new_game_button.grab_focus() # REQUIREMENTS: +# * SS-14 # * UIFUN-32 func _on_new_game_button_pressed(): print("Start a new game!") @@ -44,7 +49,9 @@ func _on_options_button_pressed(): func _on_credits_button_pressed(): credits_button_pressed.emit() - +# REQUIREMENTS +# * SS-4 +# * UIFUN-3 func _on_exit_button_pressed(): print("See you later!") get_tree().quit() diff --git a/game/src/MainMenu/MainMenu.tscn b/game/src/MainMenu/MainMenu.tscn index bf5bfe6..af2d975 100644 --- a/game/src/MainMenu/MainMenu.tscn +++ b/game/src/MainMenu/MainMenu.tscn @@ -4,6 +4,7 @@ [ext_resource type="Script" path="res://src/MainMenu/MainMenu.gd" id="2_nm1fq"] [node name="MainMenu" type="Control" node_paths=PackedStringArray("_new_game_button", "_checksum_label")] +editor_description = "UI-13" layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -49,6 +50,7 @@ theme_override_constants/separation = 18 alignment = 1 [node name="NewGameButton" type="Button" parent="Panel/VBox/Margin/ButtonList" node_paths=PackedStringArray("shortcut_context")] +editor_description = "UI-26" layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../ExitButton") @@ -74,6 +76,7 @@ text = "Continue" clip_text = true [node name="MultiplayerButton" type="Button" parent="Panel/VBox/Margin/ButtonList"] +editor_description = "UI-27" layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../ContinueButton") @@ -85,6 +88,7 @@ text = "Multiplayer" clip_text = true [node name="OptionsButton" type="Button" parent="Panel/VBox/Margin/ButtonList"] +editor_description = "UI-5" layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../MultiplayerButton") @@ -96,6 +100,7 @@ text = "Options" clip_text = true [node name="CreditsButton" type="Button" parent="Panel/VBox/Margin/ButtonList"] +editor_description = "UI-32" layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../OptionsButton") @@ -107,6 +112,7 @@ text = "Credits" clip_text = true [node name="ExitButton" type="Button" parent="Panel/VBox/Margin/ButtonList"] +editor_description = "UI-3" layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../OptionsButton") @@ -129,6 +135,7 @@ theme_override_constants/margin_right = 50 theme_override_constants/margin_bottom = 10 [node name="VersionChecksumBox" type="HBoxContainer" parent="Panel/VBox/Margin2"] +editor_description = "UI-31" layout_mode = 2 [node name="VersionLabel" type="Label" parent="Panel/VBox/Margin2/VersionChecksumBox"] @@ -138,6 +145,7 @@ mouse_filter = 1 text = "v0.01" [node name="ChecksumLabel" type="Label" parent="Panel/VBox/Margin2/VersionChecksumBox"] +editor_description = "UI-111" layout_mode = 2 tooltip_text = "Checksum 00000000" mouse_filter = 1 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) |