add a11y settings and class to main menu
This commit is contained in:
parent
356f9fd24a
commit
2d8a3329d3
|
|
@ -0,0 +1,57 @@
|
|||
extends VBoxContainer
|
||||
|
||||
signal changed
|
||||
signal leave_stage
|
||||
|
||||
var has_stage:bool = false:
|
||||
set(stage):
|
||||
has_stage = stage
|
||||
if is_node_ready() and has_stage:
|
||||
screenreader_check.grab_focus()
|
||||
|
||||
@export var is_in_beginning: bool = false
|
||||
|
||||
@onready var reduce_motion_check: CheckBox = %ReduceMotion
|
||||
@onready var screenreader_check: CheckBox = %Screenreader
|
||||
@onready var disable_rendering_check: CheckBox = %DisableRendering
|
||||
@onready var simplify_controls_check: CheckBox = %SimplyifyControls
|
||||
@onready var font_picker: OptionButton = %FontSeettings
|
||||
@onready var subtitle_picker: OptionButton = %SubtitleSettings
|
||||
@onready var scale_slider: HSlider = %UIScaleSlider
|
||||
@onready var accept_or_continue: Button = %SaveButton
|
||||
@onready var back_button: Button = %BackButton
|
||||
|
||||
func _ready() -> void:
|
||||
if is_in_beginning:
|
||||
%SaveButton.text = "save and continue"
|
||||
else:
|
||||
%SaveButton.text = "save and exit"
|
||||
|
||||
update_ui_from_state()
|
||||
|
||||
reduce_motion_check.pressed.connect(func(value): State.reduce_motion = value)
|
||||
screenreader_check.pressed.connect(func(value): State.screen_reader_enabled = value)
|
||||
disable_rendering_check.pressed.connect(func(value): State.rendering_disabled = value)
|
||||
simplify_controls_check.pressed.connect(func(value): State.use_simplified_navigation = value)
|
||||
font_picker.item_selected.connect(func(value): State.font_style = value)
|
||||
subtitle_picker.item_selected.connect(func(value): State.subtitles = value)
|
||||
scale_slider.drag_ended.connect(_on_scale_slider_dragged)
|
||||
|
||||
|
||||
func _on_scale_slider_dragged(update:bool):
|
||||
if update:
|
||||
State.ui_scaling = scale_slider.value
|
||||
|
||||
func update_ui_from_state():
|
||||
reduce_motion_check.button_pressed = State.reduce_motion
|
||||
screenreader_check.button_pressed = State.screen_reader_enabled
|
||||
disable_rendering_check.button_pressed = State.rendering_disabled
|
||||
simplify_controls_check.button_pressed = State.use_simplified_navigation
|
||||
font_picker.selected = State.font_style
|
||||
subtitle_picker.selected = State.subtitles
|
||||
scale_slider.value = State.ui_scaling
|
||||
|
||||
func _on_exit_button_pressed() -> void:
|
||||
leave_stage.emit()
|
||||
State.save_settings()
|
||||
State.leave_stage(self)
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://b3wlecqvelh22"]
|
||||
|
||||
[ext_resource type="Script" path="res://logic-scenes/main menu/acessability_settings.gd" id="1_x3lym"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_v567h"]
|
||||
script/source = "extends CheckBox
|
||||
|
||||
func _ready():
|
||||
grab_focus()
|
||||
"
|
||||
|
||||
[node name="Accessibility" type="VBoxContainer"]
|
||||
script = ExtResource("1_x3lym")
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "Accessibility"
|
||||
|
||||
[node name="Label4" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Greyed-out items do not work yet."
|
||||
|
||||
[node name="Container2" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ReduceMotion" type="CheckBox" parent="Container2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "reduce motion and flickering"
|
||||
|
||||
[node name="Screenreader" type="CheckBox" parent="Container2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "use Screenreader"
|
||||
script = SubResource("GDScript_v567h")
|
||||
|
||||
[node name="margin2" type="MarginContainer" parent="Container2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DisableRendering" type="CheckBox" parent="Container2/margin2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "disable video"
|
||||
|
||||
[node name="SimplyifyControls" type="CheckBox" parent="Container2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "simplified Controls"
|
||||
|
||||
[node name="margin" type="MarginContainer" parent="Container2"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ShowNavUI" type="CheckBox" parent="Container2/margin"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "show Navigation Buttons"
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="Container2"]
|
||||
layout_mode = 2
|
||||
columns = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Container2/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "Font-Style:"
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="Container2/GridContainer"]
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="FontSeettings" type="OptionButton" parent="Container2/GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
disabled = true
|
||||
selected = 0
|
||||
item_count = 4
|
||||
popup/item_0/text = "handwriting"
|
||||
popup/item_0/id = 1
|
||||
popup/item_1/text = "serif"
|
||||
popup/item_1/id = 2
|
||||
popup/item_2/text = "hyperlegible sans"
|
||||
popup/item_2/id = 3
|
||||
popup/item_3/text = "system font"
|
||||
popup/item_3/id = 4
|
||||
|
||||
[node name="Label2" type="Label" parent="Container2/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "Subtitles:"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="Container2/GridContainer"]
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubtitleSettings" type="OptionButton" parent="Container2/GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
disabled = true
|
||||
selected = 1
|
||||
item_count = 3
|
||||
popup/item_0/text = "none"
|
||||
popup/item_1/text = "spoken text"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "closed captions"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="Label3" type="Label" parent="Container2/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "UI scale:"
|
||||
|
||||
[node name="VSeparator3" type="VSeparator" parent="Container2/GridContainer"]
|
||||
custom_minimum_size = Vector2(30, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UIScaleSlider" type="HSlider" parent="Container2/GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
min_value = 0.5
|
||||
max_value = 3.0
|
||||
step = 0.0
|
||||
value = 1.0
|
||||
editable = false
|
||||
|
||||
[node name="navbuttons" type="HSplitContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 10
|
||||
dragger_visibility = 1
|
||||
|
||||
[node name="BackButton" type="Button" parent="navbuttons"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "go back"
|
||||
|
||||
[node name="SaveButton" type="Button" parent="navbuttons"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "save and continue"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
extends Panel
|
||||
class_name MainMenu extends Panel
|
||||
|
||||
var has_stage: bool = false:
|
||||
set(value):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=27 format=3 uid="uid://b51wdql4mby47"]
|
||||
[gd_scene load_steps=29 format=3 uid="uid://b51wdql4mby47"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/handwriting.theme" id="1_2dg4n"]
|
||||
[ext_resource type="Script" path="res://logic-scenes/main menu/main_menu.gd" id="2_rm576"]
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
[ext_resource type="Script" path="res://dev-util/settings_popup.gd" id="4_k8jo0"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfhkfocy8axb8" path="res://logic-scenes/main menu/audio_settings.tscn" id="4_o07mg"]
|
||||
[ext_resource type="Script" path="res://tab_container.gd" id="5_lhfti"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3wlecqvelh22" path="res://logic-scenes/main menu/acessability_settings.tscn" id="6_875a3"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxwqkxq6qjk7i" path="res://logic-scenes/main menu/gameplay_settings.tscn" id="6_p7ypt"]
|
||||
[ext_resource type="PackedScene" uid="uid://chal0ioagspx0" path="res://logic-scenes/main menu/content_settings.tscn" id="7_pnd48"]
|
||||
[ext_resource type="Script" path="res://logic-scenes/main menu/save_game_list.gd" id="8_o0cpj"]
|
||||
|
|
@ -348,6 +349,17 @@ thumbnail = ExtResource("12_6qu04")
|
|||
last_saved = 1.72904e+09
|
||||
is_save_file_valid = false
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yy8tc"]
|
||||
script = ExtResource("11_cspq7")
|
||||
filepath = ""
|
||||
unique_save_name = "frame_of_mind_2024-10-18_17:50:04"
|
||||
current_room = 0
|
||||
mementos_complete = 0
|
||||
board_state = {}
|
||||
thumbnail = ExtResource("12_6qu04")
|
||||
last_saved = 1.72927e+09
|
||||
is_save_file_valid = false
|
||||
|
||||
[node name="Main Menu" type="Panel"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
|
@ -397,14 +409,16 @@ text = "load"
|
|||
layout_mode = 2
|
||||
text = "settings"
|
||||
flat = false
|
||||
item_count = 4
|
||||
popup/item_0/text = "Video"
|
||||
popup/item_1/text = "Accessibility"
|
||||
item_count = 5
|
||||
popup/item_0/text = "Accessibility"
|
||||
popup/item_1/text = "Video"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Gameplay"
|
||||
popup/item_2/text = "Audio"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "Content Notes"
|
||||
popup/item_3/text = "Gameplay"
|
||||
popup/item_3/id = 3
|
||||
popup/item_4/text = "Content Notes"
|
||||
popup/item_4/id = 4
|
||||
|
||||
[node name="CreditsButton" type="Button" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
|
@ -461,31 +475,37 @@ pivot_offset = Vector2(374, 378.5)
|
|||
[node name="TabContainer" type="TabContainer" parent="SettingsPopup"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
current_tab = 1
|
||||
current_tab = 2
|
||||
use_hidden_tabs_for_min_size = true
|
||||
script = ExtResource("5_lhfti")
|
||||
|
||||
[node name="Accessibility" parent="SettingsPopup/TabContainer" instance=ExtResource("6_875a3")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Video Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("3_f0dcd")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="Audio Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("4_o07mg")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 2
|
||||
|
||||
[node name="Gameplay Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("6_p7ypt")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 2
|
||||
metadata/_tab_index = 3
|
||||
|
||||
[node name="Content Notes" parent="SettingsPopup/TabContainer" instance=ExtResource("7_pnd48")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 3
|
||||
metadata/_tab_index = 4
|
||||
|
||||
[node name="SaveGameHandle" type="CenterContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
|
@ -497,7 +517,7 @@ anchor_bottom = 1.0
|
|||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("8_o0cpj")
|
||||
saves = Array[ExtResource("11_cspq7")]([SubResource("Resource_civda"), SubResource("Resource_ny8h2"), SubResource("Resource_eypce"), SubResource("Resource_0aleq"), SubResource("Resource_yamni"), SubResource("Resource_ofqsy"), SubResource("Resource_775qv"), SubResource("Resource_epdda"), SubResource("Resource_idh7b")])
|
||||
saves = Array[ExtResource("11_cspq7")]([SubResource("Resource_civda"), SubResource("Resource_ny8h2"), SubResource("Resource_eypce"), SubResource("Resource_0aleq"), SubResource("Resource_yamni"), SubResource("Resource_ofqsy"), SubResource("Resource_775qv"), SubResource("Resource_epdda"), SubResource("Resource_idh7b"), SubResource("Resource_yy8tc")])
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue