diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-05-20 10:39:37 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-05-20 10:39:37 +0200 |
commit | 3bf63f1615868cb4a8625356a49eff4aed36879c (patch) | |
tree | 54d7092a3f68740e92008e073334d6beb3154a8b /game | |
parent | e80966ad4d92599bd5f899dfa708d2e6d131b7e7 (diff) |
Add revert dialog functionality to ScreenModeSelector
Fix recursion bug caused by invalid default value in `reset_setting`
Add `option_selected` signal to SettingOptionButton
Allows discerning between user option selection and system option selection
Add `no_emit` bool defaulted to false for `SettingOptionButton.reset_setting`
Add push_error for failing to generate option as well
Generalize ResolutionRevertDialog functionality
Using the `dialog_reverted` signal enables custom revert functionality instead
Disables process function while not visible
Displayed time is more correct
Add Resolution `resolution_added`, `resolution_changed`, and `window_mode_changed` signals
Add `get_resolution_name` to Resolution
Change ResolutionSelector `_sync_resolutions` to use `Resolution.resolution_added` signal
Reduces unnecessary resolution option list rebuilds
Move Resolution display_name functionality to ResolutionSelector
Makes it easier to denote default functionality an inline fashion
Add SettingRevertButton to automatically handle revert setting behavior
Rename VideoTab VBoxContainer/GridContainer to VideoSettingGrid
Rename VideoTab VBoxContainer to VideoSettingList
Remove `horizontal_alignment` from AutosaveIntervalLabel
Diffstat (limited to 'game')
-rw-r--r-- | game/src/Autoload/Resolution.gd | 12 | ||||
-rw-r--r-- | game/src/OptionMenu/GeneralTab.tscn | 1 | ||||
-rw-r--r-- | game/src/OptionMenu/GuiScaleSelector.gd | 4 | ||||
-rw-r--r-- | game/src/OptionMenu/MonitorDisplaySelector.gd | 6 | ||||
-rw-r--r-- | game/src/OptionMenu/ResolutionRevertDialog.gd | 35 | ||||
-rw-r--r-- | game/src/OptionMenu/ResolutionSelector.gd | 78 | ||||
-rw-r--r-- | game/src/OptionMenu/ScreenModeSelector.gd | 16 | ||||
-rw-r--r-- | game/src/OptionMenu/SettingNodes/SettingOptionButton.gd | 14 | ||||
-rw-r--r-- | game/src/OptionMenu/SettingNodes/SettingRevertButton.gd | 27 | ||||
-rw-r--r-- | game/src/OptionMenu/VideoTab.tscn | 80 |
10 files changed, 176 insertions, 97 deletions
diff --git a/game/src/Autoload/Resolution.gd b/game/src/Autoload/Resolution.gd index 56aa4a5..c973ba9 100644 --- a/game/src/Autoload/Resolution.gd +++ b/game/src/Autoload/Resolution.gd @@ -1,5 +1,9 @@ extends Node +signal resolution_added(value : Vector2i, name : StringName, display_name : StringName) +signal resolution_changed(value : Vector2i) +signal window_mode_changed(value : Window.Mode) + const error_resolution : Vector2i = Vector2i(-1,-1) @export @@ -39,7 +43,7 @@ func has_resolution(resolution_value : Vector2i) -> bool: func add_resolution(resolution_value : Vector2i, resolution_name : StringName = &"") -> bool: if has_resolution(resolution_value): return true - var res_dict := { value = resolution_value } + var res_dict := { value = resolution_value, name = &"" } var display_name := "%sx%s" % [resolution_value.x, resolution_value.y] if not resolution_name.is_empty(): res_dict.name = resolution_name @@ -48,6 +52,7 @@ func add_resolution(resolution_value : Vector2i, resolution_name : StringName = if resolution_value.x < minimum_resolution.x or resolution_value.y < minimum_resolution.y: push_error("Resolution %s is smaller than minimum (%sx%s)" % [res_dict.display_name, minimum_resolution.x, minimum_resolution.y]) return false + resolution_added.emit(resolution_value, resolution_name, display_name) _resolutions[resolution_value] = res_dict return true @@ -56,6 +61,9 @@ func get_resolution_value_list() -> Array: list.sort_custom(func(a, b): return a > b) return list +func get_resolution_name(resolution_value : Vector2i) -> StringName: + return _resolutions.get(resolution_value, { name = &"unknown resolution" }).name + func get_resolution_display_name(resolution_value : Vector2i) -> StringName: return _resolutions.get(resolution_value, { display_name = &"unknown resolution" }).display_name @@ -80,6 +88,8 @@ func set_resolution(resolution : Vector2i) -> void: if not has_resolution(resolution): push_warning("Setting resolution to non-standard value %sx%s" % [resolution.x, resolution.y]) var window := get_viewport().get_window() + if get_current_resolution() != resolution: + resolution_changed.emit(resolution) match window.mode: Window.MODE_EXCLUSIVE_FULLSCREEN, Window.MODE_FULLSCREEN: window.content_scale_size = resolution diff --git a/game/src/OptionMenu/GeneralTab.tscn b/game/src/OptionMenu/GeneralTab.tscn index a9223af..68415d4 100644 --- a/game/src/OptionMenu/GeneralTab.tscn +++ b/game/src/OptionMenu/GeneralTab.tscn @@ -46,7 +46,6 @@ default_selected = 0 [node name="AutosaveIntervalLabel" type="Label" parent="VBoxContainer/GridContainer"] layout_mode = 2 text = "OPTIONS_GENERAL_AUTOSAVE" -horizontal_alignment = 1 [node name="AutosaveIntervalSelector" type="OptionButton" parent="VBoxContainer/GridContainer"] editor_description = "UI-15" diff --git a/game/src/OptionMenu/GuiScaleSelector.gd b/game/src/OptionMenu/GuiScaleSelector.gd index 6593a07..4dd86e1 100644 --- a/game/src/OptionMenu/GuiScaleSelector.gd +++ b/game/src/OptionMenu/GuiScaleSelector.gd @@ -56,9 +56,9 @@ func _set_value_from_file(load_value): push_error("Setting value '%s' invalid for setting [%s] %s" % [load_value, section_name, setting_name]) selected = default_selected -func _on_item_selected(index:int): +func _on_option_selected(index : int, by_user : bool): if _valid_index(index): GuiScale.set_guiscale(get_item_metadata(index)) else: push_error("Invalid GuiScaleSelector index: %d" % index) - reset_setting() + reset_setting(not by_user) diff --git a/game/src/OptionMenu/MonitorDisplaySelector.gd b/game/src/OptionMenu/MonitorDisplaySelector.gd index b665658..7de033a 100644 --- a/game/src/OptionMenu/MonitorDisplaySelector.gd +++ b/game/src/OptionMenu/MonitorDisplaySelector.gd @@ -1,12 +1,12 @@ extends SettingOptionButton -func _setup_button(): +func _setup_button() -> void: clear() for screen_index in DisplayServer.get_screen_count(): add_item("Monitor %d" % (screen_index + 1)) default_selected = get_viewport().get_window().current_screen -func _on_item_selected(index : int): +func _on_option_selected(index : int, by_user : bool) -> void: if _valid_index(index): var window := get_viewport().get_window() var mode := window.mode @@ -15,4 +15,4 @@ func _on_item_selected(index : int): window.mode = mode else: push_error("Invalid MonitorDisplaySelector index: %d" % index) - reset_setting() + reset_setting(not by_user) diff --git a/game/src/OptionMenu/ResolutionRevertDialog.gd b/game/src/OptionMenu/ResolutionRevertDialog.gd new file mode 100644 index 0000000..4d2b8f2 --- /dev/null +++ b/game/src/OptionMenu/ResolutionRevertDialog.gd @@ -0,0 +1,35 @@ +extends ConfirmationDialog +class_name ResolutionRevertDialog + +signal dialog_accepted(button : SettingRevertButton) +signal dialog_reverted(button : SettingRevertButton) + +@export_group("Nodes") +@export var timer : Timer + +var _revert_node : SettingRevertButton = null + +func show_dialog(button : SettingRevertButton, time : float = 0) -> void: + timer.start(time) + popup_centered(Vector2(1,1)) + _revert_node = button + +func _notification(what): + if what == NOTIFICATION_VISIBILITY_CHANGED: + set_process(visible) + if not visible: _revert_node = null + +func _process(_delta) -> void: + dialog_text = tr("OPTIONS_VIDEO_RESOLUTION_DIALOG_TEXT").format({ "time": int(timer.time_left) }) + +func _on_canceled_or_close_requested() -> void: + timer.stop() + dialog_reverted.emit(_revert_node) + +func _on_confirmed() -> void: + timer.stop() + dialog_accepted.emit(_revert_node) + +func _on_resolution_revert_timer_timeout() -> void: + dialog_reverted.emit(_revert_node) + hide() diff --git a/game/src/OptionMenu/ResolutionSelector.gd b/game/src/OptionMenu/ResolutionSelector.gd index fee6e31..ebdf718 100644 --- a/game/src/OptionMenu/ResolutionSelector.gd +++ b/game/src/OptionMenu/ResolutionSelector.gd @@ -1,4 +1,4 @@ -extends SettingOptionButton +extends SettingRevertButton # REQUIREMENTS # * UIFUN-21 @@ -6,12 +6,7 @@ extends SettingOptionButton # * UIFUN-301 # * UIFUN-302 -@export -var default_value : Vector2i = Resolution.error_resolution - -var previous_resolution : Vector2i = Resolution.error_resolution -@export var revert_dialog : ConfirmationDialog -@export var timer : Timer +@export var default_value : Vector2i = Resolution.error_resolution func _find_resolution_index_by_value(value : Vector2i) -> int: for item_index in item_count: @@ -19,18 +14,31 @@ func _find_resolution_index_by_value(value : Vector2i) -> int: return item_index return -1 -func _sync_resolutions(to_select : Vector2i = Resolution.get_current_resolution()) -> void: +func _sync_resolutions( + value : Vector2i = Resolution.error_resolution, + _resolution_name = null, + _resolution_display_name = null +) -> void: clear() default_selected = -1 selected = -1 - for resolution_value in Resolution.get_resolution_value_list(): - add_item(Resolution.get_resolution_display_name(resolution_value)) + var resolution_list := Resolution.get_resolution_value_list() + if value != Resolution.error_resolution: + resolution_list.append(value) + for resolution_value in resolution_list: + var display_name := "%sx%s" % [resolution_value.x, resolution_value.y] + var resolution_name := Resolution.get_resolution_name(resolution_value) + if resolution_name == &"Default": + display_name = "Default (%s)" % resolution_name + if not resolution_name.is_empty(): + display_name = "%s (%s)" % [display_name, resolution_name + (", Default" if resolution_value == default_value else "")] + add_item(display_name) set_item_metadata(item_count - 1, resolution_value) if resolution_value == default_value: default_selected = item_count - 1 - if resolution_value == to_select: + if resolution_value == Resolution.get_current_resolution(): selected = item_count - 1 if default_selected == -1: @@ -39,21 +47,24 @@ func _sync_resolutions(to_select : Vector2i = Resolution.get_current_resolution( if selected == -1: selected = default_selected -func _setup_button(): +func _setup_button() -> void: + Resolution.resolution_added.connect(_sync_resolutions) if default_value.x <= 0: default_value.x = ProjectSettings.get_setting("display/window/size/viewport_width") if default_value.y <= 0: default_value.y = ProjectSettings.get_setting("display/window/size/viewport_height") - Resolution.add_resolution(default_value, &"default") - _sync_resolutions() + if not Resolution.has_resolution(default_value): + Resolution.add_resolution(default_value, &"Default") + else: + _sync_resolutions() -func _get_value_for_file(select_value : int): +func _get_value_for_file(select_value : int) -> Variant: if _valid_index(select_value): return get_item_metadata(select_value) else: return null -func _set_value_from_file(load_value): +func _set_value_from_file(load_value) -> void: var target_resolution := Resolution.error_resolution match typeof(load_value): TYPE_VECTOR2I: target_resolution = load_value @@ -62,38 +73,19 @@ func _set_value_from_file(load_value): selected = _find_resolution_index_by_value(target_resolution) if selected != -1: return if Resolution.add_resolution(target_resolution): - _sync_resolutions(target_resolution) + Resolution.set_resolution(target_resolution) return push_error("Setting value '%s' invalid for setting [%s] %s" % [load_value, section_name, setting_name]) selected = default_selected -func _on_item_selected(index : int): +func _on_option_selected(index : int, by_user : bool) -> void: if _valid_index(index): - previous_resolution = Resolution.get_current_resolution() - Resolution.set_resolution(get_item_metadata(index)) - var new_resolution = get_item_metadata(index) - - #has_focus() indicates the user is calling _on_item_selected, not some other function - if has_focus() and previous_resolution != new_resolution: + if by_user: print("Start Revert Countdown!") - start_revert_countdown() + revert_dialog.show_dialog.call_deferred(self) + previous_index = _find_resolution_index_by_value(Resolution.get_current_resolution()) + + Resolution.set_resolution(get_item_metadata(index)) else: push_error("Invalid ResolutionSelector index: %d" % index) - reset_setting() - -func _process(_delta): - revert_dialog.dialog_text = tr("OPTIONS_VIDEO_RESOLUTION_DIALOG_TEXT").format({"time":round(timer.time_left)}) - -func start_revert_countdown() -> void: - timer.start() - revert_dialog.popup_centered(Vector2(1,1)) - -func _on_confirmed() -> void: - timer.stop() - -func _cancel_changes() -> void: - Resolution.set_resolution(previous_resolution) - _sync_resolutions() - print("Resolution reset to (%dx%d)" % [previous_resolution.x,previous_resolution.y]) - timer.stop() - revert_dialog.hide() + reset_setting(not by_user) diff --git a/game/src/OptionMenu/ScreenModeSelector.gd b/game/src/OptionMenu/ScreenModeSelector.gd index f17fefb..af95901 100644 --- a/game/src/OptionMenu/ScreenModeSelector.gd +++ b/game/src/OptionMenu/ScreenModeSelector.gd @@ -1,4 +1,4 @@ -extends SettingOptionButton +extends SettingRevertButton # REQUIREMENTS # * UIFUN-42 @@ -31,12 +31,18 @@ func _setup_button(): default_selected = get_screen_mode_from_window_mode(get_viewport().get_window().mode) selected = default_selected -func _on_item_selected(index : int): +func _on_option_selected(index : int, by_user : bool) -> void: if _valid_index(index): - var window := get_viewport().get_window() + if by_user: + print("Start Revert Countdown!") + revert_dialog.show_dialog.call_deferred(self) + previous_index = get_screen_mode_from_window_mode(get_viewport().get_window().mode) + var current_resolution := Resolution.get_current_resolution() - window.mode = get_window_mode_from_screen_mode(index) + var window_mode := get_window_mode_from_screen_mode(index) + Resolution.window_mode_changed.emit(window_mode) + get_viewport().get_window().mode = window_mode Resolution.set_resolution(current_resolution) else: push_error("Invalid ScreenModeSelector index: %d" % index) - reset_setting() + reset_setting(not by_user) diff --git a/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd b/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd index e0b8e4c..c5a805e 100644 --- a/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd +++ b/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd @@ -1,6 +1,8 @@ extends OptionButton class_name SettingOptionButton +signal option_selected(index : int, by_user : bool) + @export var section_name : String = "setting" @@ -52,20 +54,24 @@ func _ready(): Events.Options.load_settings.connect(load_setting) Events.Options.save_settings.connect(save_setting) Events.Options.reset_settings.connect(reset_setting) + item_selected.connect(func(index : int): option_selected.emit(index, true)) _setup_button() if not _valid_index(default_selected) or selected == -1: - OS.alert("Failed to generate %s %s options." % [setting_name, section_name], "%s Options Error" % section_name) + var msg := "Failed to generate %s %s options." % [setting_name, section_name] + push_error(msg) + OS.alert(msg, "%s Options Error" % section_name) get_tree().quit() func load_setting(file : ConfigFile) -> void: if file == null: return _set_value_from_file(file.get_value(section_name, setting_name, _get_value_for_file(default_selected))) - item_selected.emit(selected) + option_selected.emit(selected, false) func save_setting(file : ConfigFile) -> void: if file == null: return file.set_value(section_name, setting_name, _get_value_for_file(selected)) -func reset_setting() -> void: +func reset_setting(no_emit : bool = false) -> void: selected = default_selected - item_selected.emit(selected) + if not no_emit: + option_selected.emit(selected, false) diff --git a/game/src/OptionMenu/SettingNodes/SettingRevertButton.gd b/game/src/OptionMenu/SettingNodes/SettingRevertButton.gd new file mode 100644 index 0000000..945d35b --- /dev/null +++ b/game/src/OptionMenu/SettingNodes/SettingRevertButton.gd @@ -0,0 +1,27 @@ +extends SettingOptionButton +class_name SettingRevertButton + +@export_group("Nodes") +@export var revert_dialog : ResolutionRevertDialog + +var previous_index : int = -1 + +func _ready(): + super() + if revert_dialog != null: + revert_dialog.visibility_changed.connect(_on_revert_dialog_visibility_changed) + revert_dialog.dialog_accepted.connect(_on_accepted) + revert_dialog.dialog_reverted.connect(_on_reverted) + +func _on_revert_dialog_visibility_changed() -> void: + disabled = revert_dialog.visible + if not revert_dialog.visible: + previous_index = -1 + +func _on_reverted(button : SettingRevertButton) -> void: + if button != self: return + selected = previous_index + option_selected.emit(selected, false) + +func _on_accepted(button : SettingRevertButton) -> void: + if button != self: return diff --git a/game/src/OptionMenu/VideoTab.tscn b/game/src/OptionMenu/VideoTab.tscn index 0802eb9..89b71d7 100644 --- a/game/src/OptionMenu/VideoTab.tscn +++ b/game/src/OptionMenu/VideoTab.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://bq3awxxjn1tuw"] +[gd_scene load_steps=9 format=3 uid="uid://bq3awxxjn1tuw"] [ext_resource type="Script" path="res://src/OptionMenu/ResolutionSelector.gd" id="1_i8nro"] [ext_resource type="Script" path="res://src/OptionMenu/VideoTab.gd" id="1_jvv62"] @@ -7,31 +7,32 @@ [ext_resource type="Script" path="res://src/OptionMenu/MonitorDisplaySelector.gd" id="3_y6lyb"] [ext_resource type="Script" path="res://src/OptionMenu/RefreshRateSelector.gd" id="4_381mg"] [ext_resource type="Script" path="res://src/OptionMenu/QualityPresetSelector.gd" id="5_srg4v"] +[ext_resource type="Script" path="res://src/OptionMenu/ResolutionRevertDialog.gd" id="8_802cr"] [node name="Video" type="HBoxContainer" node_paths=PackedStringArray("initial_focus")] editor_description = "UI-46" alignment = 1 script = ExtResource("1_jvv62") -initial_focus = NodePath("VBoxContainer/GridContainer/ResolutionSelector") +initial_focus = NodePath("VideoSettingList/VideoSettingGrid/ResolutionSelector") -[node name="VBoxContainer" type="VBoxContainer" parent="."] +[node name="VideoSettingList" type="VBoxContainer" parent="."] layout_mode = 2 -[node name="Control" type="Control" parent="VBoxContainer"] +[node name="Control" type="Control" parent="VideoSettingList"] layout_mode = 2 size_flags_vertical = 3 size_flags_stretch_ratio = 0.1 -[node name="GridContainer" type="GridContainer" parent="VBoxContainer"] +[node name="VideoSettingGrid" type="GridContainer" parent="VideoSettingList"] layout_mode = 2 size_flags_vertical = 3 columns = 2 -[node name="ResolutionLabel" type="Label" parent="VBoxContainer/GridContainer"] +[node name="ResolutionLabel" type="Label" parent="VideoSettingList/VideoSettingGrid"] layout_mode = 2 text = "OPTIONS_VIDEO_RESOLUTION" -[node name="ResolutionSelector" type="OptionButton" parent="VBoxContainer/GridContainer" node_paths=PackedStringArray("revert_dialog", "timer")] +[node name="ResolutionSelector" type="OptionButton" parent="VideoSettingList/VideoSettingGrid" node_paths=PackedStringArray("revert_dialog")] editor_description = "UI-19" layout_mode = 2 focus_neighbor_bottom = NodePath("../ScreenModeSelector") @@ -40,28 +41,15 @@ selected = 0 popup/item_0/text = "MISSING" popup/item_0/id = 0 script = ExtResource("1_i8nro") -revert_dialog = NodePath("ConfirmationDialog") -timer = NodePath("Timer") +revert_dialog = NodePath("../../../ResolutionRevertDialog") section_name = "video" setting_name = "resolution" -[node name="ConfirmationDialog" type="ConfirmationDialog" parent="VBoxContainer/GridContainer/ResolutionSelector"] -editor_description = "UI-873" -disable_3d = true -title = "OPTIONS_VIDEO_RESOLUTION_DIALOG_TITLE" -size = Vector2i(730, 100) -ok_button_text = "DIALOG_OK" -cancel_button_text = "DIALOG_CANCEL" - -[node name="Timer" type="Timer" parent="VBoxContainer/GridContainer/ResolutionSelector"] -wait_time = 5.0 -one_shot = true - -[node name="GuiScaleLabel" type="Label" parent="VBoxContainer/GridContainer"] +[node name="GuiScaleLabel" type="Label" parent="VideoSettingList/VideoSettingGrid"] layout_mode = 2 text = "OPTIONS_VIDEO_GUI_SCALE" -[node name="GuiScaleSelector" type="OptionButton" parent="VBoxContainer/GridContainer"] +[node name="GuiScaleSelector" type="OptionButton" parent="VideoSettingList/VideoSettingGrid"] editor_description = "UI-23" layout_mode = 2 focus_neighbor_bottom = NodePath("../ScreenModeSelector") @@ -73,12 +61,12 @@ script = ExtResource("3_pgc5d") section_name = "video" setting_name = "gui_scale" -[node name="ScreenModeLabel" type="Label" parent="VBoxContainer/GridContainer"] +[node name="ScreenModeLabel" type="Label" parent="VideoSettingList/VideoSettingGrid"] editor_description = "UI-44" layout_mode = 2 text = "OPTIONS_VIDEO_SCREEN_MODE" -[node name="ScreenModeSelector" type="OptionButton" parent="VBoxContainer/GridContainer"] +[node name="ScreenModeSelector" type="OptionButton" parent="VideoSettingList/VideoSettingGrid" node_paths=PackedStringArray("revert_dialog")] layout_mode = 2 focus_neighbor_top = NodePath("../ResolutionSelector") focus_neighbor_bottom = NodePath("../MonitorDisplaySelector") @@ -91,14 +79,15 @@ popup/item_1/id = 1 popup/item_2/text = "OPTIONS_VIDEO_WINDOWED" popup/item_2/id = 2 script = ExtResource("2_wa7vw") +revert_dialog = NodePath("../../../ResolutionRevertDialog") section_name = "video" setting_name = "mode_selected" -[node name="MonitorSelectionLabel" type="Label" parent="VBoxContainer/GridContainer"] +[node name="MonitorSelectionLabel" type="Label" parent="VideoSettingList/VideoSettingGrid"] layout_mode = 2 text = "OPTIONS_VIDEO_MONITOR_SELECTION" -[node name="MonitorDisplaySelector" type="OptionButton" parent="VBoxContainer/GridContainer"] +[node name="MonitorDisplaySelector" type="OptionButton" parent="VideoSettingList/VideoSettingGrid"] layout_mode = 2 focus_neighbor_top = NodePath("../ScreenModeSelector") focus_neighbor_bottom = NodePath("../RefreshRateSelector") @@ -110,11 +99,11 @@ script = ExtResource("3_y6lyb") section_name = "video" setting_name = "current_screen" -[node name="RefreshRateLabel" type="Label" parent="VBoxContainer/GridContainer"] +[node name="RefreshRateLabel" type="Label" parent="VideoSettingList/VideoSettingGrid"] layout_mode = 2 text = "OPTIONS_VIDEO_REFRESH_RATE" -[node name="RefreshRateSelector" type="OptionButton" parent="VBoxContainer/GridContainer"] +[node name="RefreshRateSelector" type="OptionButton" parent="VideoSettingList/VideoSettingGrid"] editor_description = "UI-18" layout_mode = 2 tooltip_text = "OPTIONS_VIDEO_REFRESH_RATE_TOOLTIP" @@ -143,11 +132,11 @@ section_name = "video" setting_name = "refresh_rate" default_selected = 0 -[node name="QualityPresetLabel" type="Label" parent="VBoxContainer/GridContainer"] +[node name="QualityPresetLabel" type="Label" parent="VideoSettingList/VideoSettingGrid"] layout_mode = 2 text = "OPTIONS_VIDEO_QUALITY" -[node name="QualityPresetSelector" type="OptionButton" parent="VBoxContainer/GridContainer"] +[node name="QualityPresetSelector" type="OptionButton" parent="VideoSettingList/VideoSettingGrid"] editor_description = "UI-21" layout_mode = 2 focus_neighbor_top = NodePath("../RefreshRateSelector") @@ -168,10 +157,25 @@ section_name = "video" setting_name = "quality_preset" default_selected = 1 -[connection signal="item_selected" from="VBoxContainer/GridContainer/ResolutionSelector" to="VBoxContainer/GridContainer/ResolutionSelector" method="_on_item_selected"] -[connection signal="canceled" from="VBoxContainer/GridContainer/ResolutionSelector/ConfirmationDialog" to="VBoxContainer/GridContainer/ResolutionSelector" method="_cancel_changes"] -[connection signal="confirmed" from="VBoxContainer/GridContainer/ResolutionSelector/ConfirmationDialog" to="VBoxContainer/GridContainer/ResolutionSelector" method="_on_confirmed"] -[connection signal="timeout" from="VBoxContainer/GridContainer/ResolutionSelector/Timer" to="VBoxContainer/GridContainer/ResolutionSelector" method="_cancel_changes"] -[connection signal="item_selected" from="VBoxContainer/GridContainer/GuiScaleSelector" to="VBoxContainer/GridContainer/GuiScaleSelector" method="_on_item_selected"] -[connection signal="item_selected" from="VBoxContainer/GridContainer/ScreenModeSelector" to="VBoxContainer/GridContainer/ScreenModeSelector" method="_on_item_selected"] -[connection signal="item_selected" from="VBoxContainer/GridContainer/MonitorDisplaySelector" to="VBoxContainer/GridContainer/MonitorDisplaySelector" method="_on_item_selected"] +[node name="ResolutionRevertDialog" type="ConfirmationDialog" parent="." node_paths=PackedStringArray("timer")] +editor_description = "UI-873" +disable_3d = true +title = "OPTIONS_VIDEO_RESOLUTION_DIALOG_TITLE" +size = Vector2i(730, 100) +ok_button_text = "DIALOG_OK" +cancel_button_text = "DIALOG_CANCEL" +script = ExtResource("8_802cr") +timer = NodePath("ResolutionRevertTimer") + +[node name="ResolutionRevertTimer" type="Timer" parent="ResolutionRevertDialog"] +wait_time = 5.0 +one_shot = true + +[connection signal="option_selected" from="VideoSettingList/VideoSettingGrid/ResolutionSelector" to="VideoSettingList/VideoSettingGrid/ResolutionSelector" method="_on_option_selected"] +[connection signal="option_selected" from="VideoSettingList/VideoSettingGrid/GuiScaleSelector" to="VideoSettingList/VideoSettingGrid/GuiScaleSelector" method="_on_option_selected"] +[connection signal="option_selected" from="VideoSettingList/VideoSettingGrid/ScreenModeSelector" to="VideoSettingList/VideoSettingGrid/ScreenModeSelector" method="_on_option_selected"] +[connection signal="option_selected" from="VideoSettingList/VideoSettingGrid/MonitorDisplaySelector" to="VideoSettingList/VideoSettingGrid/MonitorDisplaySelector" method="_on_option_selected"] +[connection signal="canceled" from="ResolutionRevertDialog" to="ResolutionRevertDialog" method="_on_canceled_or_close_requested"] +[connection signal="close_requested" from="ResolutionRevertDialog" to="ResolutionRevertDialog" method="_on_canceled_or_close_requested"] +[connection signal="confirmed" from="ResolutionRevertDialog" to="ResolutionRevertDialog" method="_on_confirmed"] +[connection signal="timeout" from="ResolutionRevertDialog/ResolutionRevertTimer" to="ResolutionRevertDialog" method="_on_resolution_revert_timer_timeout"] |