From 16414da77e66cedc9c9f9a09522add1941aab6fd Mon Sep 17 00:00:00 2001 From: Tiger Jove Date: Sat, 13 Dec 2025 12:42:26 +0100 Subject: [PATCH] fix: show Nav UI in accessibility is now accessible again --- src/logic-scenes/startup/startup.tscn | 106 +----------------- src/logic-scenes/startup/startup_menu.gd | 98 ++++++++++++++++ src/logic-scenes/startup/startup_menu.gd.uid | 1 + ..._settings.gd => accessibility_settings.gd} | 1 + ...s.gd.uid => accessibility_settings.gd.uid} | 0 ...tings.tscn => accessibility_settings.tscn} | 3 +- src/ui/menu_main/main_menu.tscn | 2 +- 7 files changed, 106 insertions(+), 105 deletions(-) create mode 100644 src/logic-scenes/startup/startup_menu.gd create mode 100644 src/logic-scenes/startup/startup_menu.gd.uid rename src/ui/menu_main/{acessability_settings.gd => accessibility_settings.gd} (99%) rename src/ui/menu_main/{acessability_settings.gd.uid => accessibility_settings.gd.uid} (100%) rename src/ui/menu_main/{acessability_settings.tscn => accessibility_settings.tscn} (98%) diff --git a/src/logic-scenes/startup/startup.tscn b/src/logic-scenes/startup/startup.tscn index 0cd58eb..5caa7a7 100644 --- a/src/logic-scenes/startup/startup.tscn +++ b/src/logic-scenes/startup/startup.tscn @@ -1,118 +1,18 @@ [gd_scene load_steps=6 format=3 uid="uid://gldtxysavetf"] [ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="1_8giso"] -[ext_resource type="PackedScene" uid="uid://b3wlecqvelh22" path="res://ui/menu_main/acessability_settings.tscn" id="3_2p4fc"] +[ext_resource type="Script" uid="uid://3mtyfiuxbavf" path="res://logic-scenes/startup/startup_menu.gd" id="1_lw8rc"] +[ext_resource type="PackedScene" uid="uid://b3wlecqvelh22" path="res://ui/menu_main/accessibility_settings.tscn" id="3_2p4fc"] [ext_resource type="PackedScene" uid="uid://chal0ioagspx0" path="res://ui/menu_main/content_settings.tscn" id="3_fso6q"] [ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://import/interface-elements/bottom.png" id="3_s5ssh"] -[sub_resource type="GDScript" id="GDScript_a78qq"] -script/source = "extends Panel - -@export var is_in_startup: bool - -@onready var show_navigation_buttons = $\"SettingsContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/Container2/margin/show nav ui\" - -func _ready(): - theme = State.current_main_theme - State.theme_changed.connect(func change_theme(new_theme): theme = new_theme) - TranslationServer.set_locale(\"de\") - -func starting(): - pass - #$\"CenterContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/navbuttons/Next\".grab_focus() - -func _on_reduce_motion_toggled(toggled_on): - State.reduce_motion = toggled_on - -# toggle for disable rendering -func _on_disable_rendering_toggled(toggled_on): - State.disable_rendering = toggled_on - -# toggle for simplified controls -func _on_simplified_controls_toggled(toggled_on): - State.simplified_navigation = toggled_on # this is how you reach the global state - show_navigation_buttons.disabled = not toggled_on # if simpl. controls was toggled - disabled = false - -# toggle for show nav buttons -func _on_show_nav_ui_toggled(toggled_on): - State.show_navigation_buttons = toggled_on - -# toggle streaming notes -func _on_streaming_notes_toggled(toggled_on): - State.streaming_content_notes = toggled_on - - -# select font -# still needs handling to change the style -func _on_font_style_selected(index): - match index: - 1: - State.current_main_theme = preload(\"res://logic-scenes/themes/handwriting.theme\") - print_debug(\"easy handwriting selected\") - #owner.theme.set_font(\"NanumPenScript.ttf\") - return - 2: - State.current_main_theme = preload(\"res://logic-scenes/themes/serif.theme\") - #owner.theme.set_font(\"Eczar-VariableFont_wght.ttf\") - return - 3: - State.current_main_theme = preload(\"res://logic-scenes/themes/hyperlegible.theme\") - #owner.theme.set_font(\"AtkinsonHyperlegible.ttf\") - return - 4: - State.current_main_theme = preload(\"res://logic-scenes/themes/system.theme\") - #owner.theme.set_font(SystemFont.fallbacks[0]) - return - -func _on_subtitle_option_selected(index): - match index: - 0: - State.enable_subtitles = false - State.enable_closed_caption = false - 1: - State.enable_subtitles = true - State.enable_closed_caption = false - 2: - State.enable_subtitles = true - State.enable_closed_caption = true - - print_debug(State.print_settings()) - - -# Volume Settings - - -# Final Page - -func _on_content_notes_toggled(button_pressed): - State.show_content_notes = button_pressed - - -func _on_provide_summaries_toggled(button_pressed): - State.provide_summaries = button_pressed - - -func _on_allow_skipping_toggled(button_pressed): - State.allow_skipping = button_pressed - -func hide(): - get_parent().get_child(0).get_ready() - var child_tween = create_tween() - child_tween.tween_property($CenterContainer, \"modulate\", Color(1, 1, 1, 0), .5) - await child_tween.finished - var self_tween = create_tween() - self_tween.tween_property(self, \"modulate\", Color(1, 1, 1, 0), .5) - await self_tween.finished - self.visible = false -" - [node name="Startup Menu" type="Panel"] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -script = SubResource("GDScript_a78qq") +script = ExtResource("1_lw8rc") [node name="Label" type="Label" parent="."] visible = false diff --git a/src/logic-scenes/startup/startup_menu.gd b/src/logic-scenes/startup/startup_menu.gd new file mode 100644 index 0000000..05aa566 --- /dev/null +++ b/src/logic-scenes/startup/startup_menu.gd @@ -0,0 +1,98 @@ +extends Panel + +@export var is_in_startup: bool + +@onready var show_navigation_buttons = %Accessibility/Container2/margin/ShowNavUI + +func _ready(): + theme = State.current_main_theme + State.theme_changed.connect(func change_theme(new_theme): theme = new_theme) + TranslationServer.set_locale("de") + +func starting(): + pass + #$"CenterContainer/PanelContainer/VBoxContainer/TabContainer/physical Accessibility/navbuttons/Next".grab_focus() + +func _on_reduce_motion_toggled(toggled_on): + State.reduce_motion = toggled_on + +# toggle for disable rendering +func _on_disable_rendering_toggled(toggled_on): + State.disable_rendering = toggled_on + +# toggle for simplified controls +func _on_simplified_controls_toggled(toggled_on): + State.simplified_navigation = toggled_on # this is how you reach the global state + show_navigation_buttons.disabled = not toggled_on # if simpl. controls was toggled - disabled = false + +# toggle for show nav buttons +func _on_show_nav_ui_toggled(toggled_on): + State.show_navigation_buttons = toggled_on + +# toggle streaming notes +func _on_streaming_notes_toggled(toggled_on): + State.streaming_content_notes = toggled_on + + +# select font +# still needs handling to change the style +func _on_font_style_selected(index): + match index: + 1: + State.current_main_theme = preload("res://logic-scenes/themes/handwriting.theme") + print_debug("easy handwriting selected") + #owner.theme.set_font("NanumPenScript.ttf") + return + 2: + State.current_main_theme = preload("res://logic-scenes/themes/serif.theme") + #owner.theme.set_font("Eczar-VariableFont_wght.ttf") + return + 3: + State.current_main_theme = preload("res://logic-scenes/themes/hyperlegible.theme") + #owner.theme.set_font("AtkinsonHyperlegible.ttf") + return + 4: + State.current_main_theme = preload("res://logic-scenes/themes/system.theme") + #owner.theme.set_font(SystemFont.fallbacks[0]) + return + +func _on_subtitle_option_selected(index): + match index: + 0: + State.enable_subtitles = false + State.enable_closed_caption = false + 1: + State.enable_subtitles = true + State.enable_closed_caption = false + 2: + State.enable_subtitles = true + State.enable_closed_caption = true + + print_debug(State.print_settings()) + + +# Volume Settings + + +# Final Page + +func _on_content_notes_toggled(button_pressed): + State.show_content_notes = button_pressed + + +func _on_provide_summaries_toggled(button_pressed): + State.provide_summaries = button_pressed + + +func _on_allow_skipping_toggled(button_pressed): + State.allow_skipping = button_pressed + +func hide(): + get_parent().get_child(0).get_ready() + var child_tween = create_tween() + child_tween.tween_property($CenterContainer, "modulate", Color(1, 1, 1, 0), .5) + await child_tween.finished + var self_tween = create_tween() + self_tween.tween_property(self, "modulate", Color(1, 1, 1, 0), .5) + await self_tween.finished + self.visible = false diff --git a/src/logic-scenes/startup/startup_menu.gd.uid b/src/logic-scenes/startup/startup_menu.gd.uid new file mode 100644 index 0000000..a42d1fc --- /dev/null +++ b/src/logic-scenes/startup/startup_menu.gd.uid @@ -0,0 +1 @@ +uid://3mtyfiuxbavf diff --git a/src/ui/menu_main/acessability_settings.gd b/src/ui/menu_main/accessibility_settings.gd similarity index 99% rename from src/ui/menu_main/acessability_settings.gd rename to src/ui/menu_main/accessibility_settings.gd index 081be2e..138f66c 100644 --- a/src/ui/menu_main/acessability_settings.gd +++ b/src/ui/menu_main/accessibility_settings.gd @@ -1,4 +1,5 @@ extends VBoxContainer +class AccessibilitySettings signal changed signal leave_stage diff --git a/src/ui/menu_main/acessability_settings.gd.uid b/src/ui/menu_main/accessibility_settings.gd.uid similarity index 100% rename from src/ui/menu_main/acessability_settings.gd.uid rename to src/ui/menu_main/accessibility_settings.gd.uid diff --git a/src/ui/menu_main/acessability_settings.tscn b/src/ui/menu_main/accessibility_settings.tscn similarity index 98% rename from src/ui/menu_main/acessability_settings.tscn rename to src/ui/menu_main/accessibility_settings.tscn index 514decb..2d0cf34 100644 --- a/src/ui/menu_main/acessability_settings.tscn +++ b/src/ui/menu_main/accessibility_settings.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://b3wlecqvelh22"] -[ext_resource type="Script" uid="uid://cbax2lv4pstqk" path="res://ui/menu_main/acessability_settings.gd" id="1_x3lym"] +[ext_resource type="Script" uid="uid://cbax2lv4pstqk" path="res://ui/menu_main/accessibility_settings.gd" id="1_x3lym"] [ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_24dtk"] [sub_resource type="GDScript" id="GDScript_v567h"] @@ -19,6 +19,7 @@ func _ready() -> void: [node name="Accessibility" type="VBoxContainer"] script = ExtResource("1_x3lym") +is_in_beginning = null metadata/_tab_index = 0 [node name="Label" type="Label" parent="."] diff --git a/src/ui/menu_main/main_menu.tscn b/src/ui/menu_main/main_menu.tscn index 12007d7..7020452 100644 --- a/src/ui/menu_main/main_menu.tscn +++ b/src/ui/menu_main/main_menu.tscn @@ -11,7 +11,7 @@ [ext_resource type="PackedScene" uid="uid://dfhkfocy8axb8" path="res://ui/menu_main/audio_settings.tscn" id="4_o07mg"] [ext_resource type="Script" uid="uid://dqq0wq3dvbnjs" path="res://dev-util/i18n_texture_rect.gd" id="5_8u0te"] [ext_resource type="Script" uid="uid://0tb763w0vfv7" path="res://tab_container.gd" id="5_lhfti"] -[ext_resource type="PackedScene" uid="uid://b3wlecqvelh22" path="res://ui/menu_main/acessability_settings.tscn" id="6_875a3"] +[ext_resource type="PackedScene" uid="uid://b3wlecqvelh22" path="res://ui/menu_main/accessibility_settings.tscn" id="6_875a3"] [ext_resource type="Texture2D" uid="uid://bv1o2xo71wvp6" path="res://import/interface-elements/gedanken-spiel.png" id="6_g8g3n"] [ext_resource type="PackedScene" uid="uid://dxwqkxq6qjk7i" path="res://ui/menu_main/gameplay_settings.tscn" id="6_p7ypt"] [ext_resource type="PackedScene" uid="uid://chal0ioagspx0" path="res://ui/menu_main/content_settings.tscn" id="7_pnd48"]