diff --git a/src/demo-main.tscn b/src/demo-main.tscn index f90d3faf..a2cf5244 100644 --- a/src/demo-main.tscn +++ b/src/demo-main.tscn @@ -112,6 +112,7 @@ func _on_text_button_item_selected(index: int) -> void: func _on_speech_button_item_selected(index: int) -> void: State.speech_language = index + 1 + %TextButton.select(1) func _unhandled_input(event: InputEvent) -> void: if event is InputEvent and in_game: @@ -458,26 +459,13 @@ text = "show Content Notes" layout_mode = 2 text = "reduce motion and flickering" -[node name="Label2" type="Label" parent="Menu/VBoxContainer"] -layout_mode = 2 -theme_type_variation = &"HeaderMedium" -text = "Written Text" - -[node name="TextButton" type="OptionButton" parent="Menu/VBoxContainer"] -layout_mode = 2 -selected = 0 -item_count = 2 -popup/item_0/text = "englisch" -popup/item_0/id = 1 -popup/item_1/text = "deutsch" -popup/item_1/id = 2 - [node name="Label3" type="Label" parent="Menu/VBoxContainer"] layout_mode = 2 theme_type_variation = &"HeaderMedium" text = "Spoken Text" [node name="SpeechButton" type="OptionButton" parent="Menu/VBoxContainer"] +unique_name_in_owner = true layout_mode = 2 selected = 0 item_count = 2 @@ -486,6 +474,21 @@ popup/item_0/id = 0 popup/item_1/text = "deutsch" popup/item_1/id = 1 +[node name="Label2" type="Label" parent="Menu/VBoxContainer"] +layout_mode = 2 +theme_type_variation = &"HeaderMedium" +text = "Written Text" + +[node name="TextButton" type="OptionButton" parent="Menu/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +selected = 0 +item_count = 2 +popup/item_0/text = "englisch" +popup/item_0/id = 1 +popup/item_1/text = "deutsch" +popup/item_1/id = 2 + [node name="Button" type="Button" parent="Menu/VBoxContainer"] layout_mode = 2 text = "Privacy Info" @@ -687,7 +690,7 @@ libraries = { [connection signal="pressed" from="Menu/VBoxContainer2/PressStart" to="." method="_on_start_button_pressed"] [connection signal="toggled" from="Menu/VBoxContainer/CNBox" to="." method="_on_cn_box_toggled"] [connection signal="toggled" from="Menu/VBoxContainer/MotionBox" to="." method="_on_motion_box_toggled"] -[connection signal="item_selected" from="Menu/VBoxContainer/TextButton" to="." method="_on_text_button_item_selected"] [connection signal="item_selected" from="Menu/VBoxContainer/SpeechButton" to="." method="_on_speech_button_item_selected"] +[connection signal="item_selected" from="Menu/VBoxContainer/TextButton" to="." method="_on_text_button_item_selected"] [connection signal="pressed" from="Menu/VBoxContainer/Button" to="Menu/PrivacyPanel" method="show"] [connection signal="leave_stage" from="Menu/PrivacyPanel/PrivacyAndDataProtection" to="Menu/PrivacyPanel" method="hide"] diff --git a/src/singletons/global_state.gd b/src/singletons/global_state.gd index 4c895bf2..4aea2f32 100644 --- a/src/singletons/global_state.gd +++ b/src/singletons/global_state.gd @@ -118,7 +118,7 @@ var current_main_theme:Theme = preload("res://logic-scenes/themes/handwriting.th @export_enum("system_locale", "english", "german") var text_language: int = -1: set(value): text_language = value - match text_language: + match text_language: 1: TranslationServer.set_locale("en") 2: TranslationServer.set_locale("de") _: TranslationServer.set_locale(OS.get_locale())