Skip to content

Commit 47f6271

Browse files
committed
Update settings and report forms to simplify instructions and add information regarding translations + warning popup in settings for community translations
1 parent 64869ee commit 47f6271

6 files changed

Lines changed: 175 additions & 15 deletions

File tree

ui/components/popups/ReportFormPopup.tscn

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,13 @@ size_flags_horizontal = 4
6767
layout_mode = 2
6868
size_flags_vertical = 3
6969
bbcode_enabled = true
70-
text = "Use the link below to report a bug or an error in a lesson on GitHub:
71-
72-
[center][b][url=https://github.com/GDQuest/learn-gdscript/issues]GitHub.com > GDQuest > learn-gdscript > Issues[/url][/b][/center]
70+
text = "Use the link below to report a bug or an error in a lesson: [b][url=https://github.com/GDQuest/learn-gdscript/issues]Report an issue on GitHub[/url][/b]
7371
7472
[font=res://ui/theme/fonts/font_title.tres]Missing translations[/font]
7573
7674
If some text in the app is not translated into your language, it is most likely because the translation for your language is incomplete. Our translations are maintained by volunteers and not every language is fully covered yet.
7775
78-
If you want to help translate the app, you can find instructions on how to contribute on this page:
79-
80-
[center][b][url=https://github.com/GDQuest/learn-gdscript-translations/#readme]GitHub.com > GDQuest > learn-gdscript-translations[/url][/b][/center]
76+
If you want to help translate the app, you can find instructions on how to contribute here: [b][url=https://github.com/GDQuest/learn-gdscript-translations/#readme]Contribute to translations[/url][/b]
8177
8278
[font=res://ui/theme/fonts/font_title.tres]What is GitHub[/font]
8379

ui/components/popups/SettingsPopup.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const FRAMERATE_MAP := {
1111

1212
@export var _panel: PanelContainer
1313
@export var _color_rect: ColorRect
14+
@export var _translation_info_button: Button
15+
@export var _translation_info_popup: CanvasLayer
1416
@export var _language_value: OptionButton
1517
@export var _font_size_value: HSlider
1618
@export var _font_size_sample: Label
@@ -38,6 +40,7 @@ func _ready() -> void:
3840
_init_languages()
3941
_init_values()
4042

43+
_translation_info_button.pressed.connect(_translation_info_popup.show)
4144
_font_size_value.value_changed.connect(_on_font_size_changed)
4245

4346
_apply_button.pressed.connect(_on_apply_settings)

ui/components/popups/SettingsPopup.tscn

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
[gd_scene format=3 uid="uid://dcl81wj587ph8"]
22

33
[ext_resource type="Script" uid="uid://clp346ybkc5c1" path="res://ui/components/popups/SettingsPopup.gd" id="1"]
4-
[ext_resource type="StyleBox" path="res://ui/theme/button_outline_large_pressed.tres" id="3"]
5-
[ext_resource type="StyleBox" path="res://ui/theme/button_outline_large_normal.tres" id="4"]
6-
[ext_resource type="StyleBox" path="res://ui/theme/panel_normal.tres" id="5"]
7-
[ext_resource type="StyleBox" path="res://ui/theme/button_outline_large_accent.tres" id="6"]
4+
[ext_resource type="StyleBox" uid="uid://bkqtmumr5t28" path="res://ui/theme/button_outline_large_pressed.tres" id="3"]
5+
[ext_resource type="StyleBox" uid="uid://b45mlqutqarjn" path="res://ui/theme/button_outline_large_normal.tres" id="4"]
6+
[ext_resource type="StyleBox" uid="uid://lvuws1hlca6y" path="res://ui/theme/panel_normal.tres" id="5"]
7+
[ext_resource type="StyleBox" uid="uid://dhdt5bfr2nel5" path="res://ui/theme/button_outline_large_accent.tres" id="6"]
88
[ext_resource type="Theme" uid="uid://b03mml1yyrchy" path="res://ui/theme/gdscript_app_theme.tres" id="7"]
9-
[ext_resource type="StyleBox" path="res://ui/theme/button_outline_large_hover.tres" id="8"]
10-
[ext_resource type="StyleBox" path="res://ui/theme/focus_accent.tres" id="9"]
9+
[ext_resource type="StyleBox" uid="uid://dkeg6cbxbpnqe" path="res://ui/theme/button_outline_large_hover.tres" id="8"]
10+
[ext_resource type="StyleBox" uid="uid://bsrxxsifsyu4k" path="res://ui/theme/focus_accent.tres" id="9"]
11+
[ext_resource type="PackedScene" uid="uid://bc84yi46l8qys" path="res://ui/components/popups/TranslationInfoPopup.tscn" id="10"]
12+
[ext_resource type="Texture2D" uid="uid://cx5pgbsm7s2qp" path="res://ui/icons/icon_report.png" id="11"]
1113

1214
[sub_resource type="StyleBoxEmpty" id="2"]
1315

@@ -17,11 +19,13 @@
1719

1820
[sub_resource type="Shortcut" id="6"]
1921

20-
[node name="CanvasLayer" type="CanvasLayer" unique_id=1461649153 node_paths=PackedStringArray("_panel", "_color_rect", "_language_value", "_font_size_value", "_font_size_sample", "_scroll_sensitivity_slider", "_framerate_settings_section", "_framerate_option", "_lower_contrast", "_dyslexia_font", "_apply_button", "_cancel_button")]
22+
[node name="CanvasLayer" type="CanvasLayer" unique_id=1461649153 node_paths=PackedStringArray("_panel", "_color_rect", "_translation_info_button", "_translation_info_popup", "_language_value", "_font_size_value", "_font_size_sample", "_scroll_sensitivity_slider", "_framerate_settings_section", "_framerate_option", "_lower_contrast", "_dyslexia_font", "_apply_button", "_cancel_button")]
2123
layer = 2
2224
script = ExtResource("1")
2325
_panel = NodePath("PanelContainer")
2426
_color_rect = NodePath("ColorRect")
27+
_translation_info_button = NodePath("PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting/LabelRow/TranslationInfoButton")
28+
_translation_info_popup = NodePath("TranslationInfoPopup")
2529
_language_value = NodePath("PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting/Value")
2630
_font_size_value = NodePath("PanelContainer/Column/Margin/Column/ScrollContainer/Settings/FontSizeSetting/ValueContainer/Value")
2731
_font_size_sample = NodePath("PanelContainer/Column/Margin/Column/ScrollContainer/Settings/FontSizeSetting/ValueContainer/SampleText")
@@ -98,15 +102,28 @@ theme_override_constants/separation = 32
98102
[node name="LanguageSetting" type="HBoxContainer" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings" unique_id=461239063]
99103
layout_mode = 2
100104

101-
[node name="Label" type="Label" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting" unique_id=478374928]
105+
[node name="LabelRow" type="HBoxContainer" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting" unique_id=561239064]
106+
layout_mode = 2
107+
size_flags_horizontal = 3
108+
109+
[node name="Label" type="Label" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting/LabelRow" unique_id=478374928]
102110
layout_mode = 2
103111
size_flags_horizontal = 3
104112
text = "Language"
105113

114+
[node name="TranslationInfoButton" type="Button" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting/LabelRow" unique_id=561239065]
115+
layout_mode = 2
116+
size_flags_horizontal = 0
117+
size_flags_vertical = 4
118+
tooltip_text = "About community translations"
119+
mouse_default_cursor_shape = 2
120+
icon = ExtResource("11")
121+
flat = true
122+
106123
[node name="Value" type="OptionButton" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings/LanguageSetting" unique_id=2054986385]
107124
layout_mode = 2
108125
size_flags_horizontal = 3
109-
tooltip_text = "Change the course's language. We plan to add other languages, but only English is available for now."
126+
tooltip_text = "Change the course's language to one of the community-contributed ones."
110127

111128
[node name="FontSizeSetting" type="HBoxContainer" parent="PanelContainer/Column/Margin/Column/ScrollContainer/Settings" unique_id=1561891103]
112129
layout_mode = 2
@@ -246,3 +263,5 @@ theme_override_styles/hover = ExtResource("6")
246263
theme_override_styles/focus = ExtResource("9")
247264
shortcut = SubResource("6")
248265
text = "Apply"
266+
267+
[node name="TranslationInfoPopup" parent="." unique_id=1351951771 instance=ExtResource("10")]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
extends CanvasLayer
2+
3+
@onready var _color_rect := $ColorRect as ColorRect
4+
@onready var _panel := $PanelContainer as PanelContainer
5+
@onready var _confirm_button := $PanelContainer/Column/Margin/Column/ConfirmButton as Button
6+
@onready var _summary_label := $PanelContainer/Column/Margin/Column/Summary as RichTextLabel
7+
@onready var _title_label: Label = $PanelContainer/Column/Margin/Column/Title
8+
9+
@onready var _title := _title_label.text
10+
@onready var _summary := _summary_label.text
11+
12+
13+
func _ready() -> void:
14+
hide()
15+
_confirm_button.pressed.connect(hide)
16+
_summary_label.meta_clicked.connect(_on_meta_clicked)
17+
_update_translations()
18+
visibility_changed.connect(_on_visibility_changed)
19+
20+
21+
func _on_visibility_changed() -> void:
22+
if visible:
23+
_color_rect.show()
24+
_panel.show()
25+
else:
26+
_confirm_button.grab_focus()
27+
_color_rect.hide()
28+
_panel.hide()
29+
30+
31+
func _on_meta_clicked(data) -> void:
32+
if typeof(data) == TYPE_STRING:
33+
var string_data: String = data
34+
if string_data.begins_with("https://"):
35+
OS.shell_open(string_data)
36+
37+
38+
func _notification(what: int) -> void:
39+
if what == NOTIFICATION_TRANSLATION_CHANGED:
40+
_update_translations()
41+
42+
43+
func _update_translations() -> void:
44+
if _title_label:
45+
_title_label.text = tr(_title)
46+
_summary_label.text = tr(_summary)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://c2dngtpunftiu
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[gd_scene format=3 uid="uid://bc84yi46l8qys"]
2+
3+
[ext_resource type="Script" uid="uid://c2dngtpunftiu" path="res://ui/components/popups/TranslationInfoPopup.gd" id="1"]
4+
[ext_resource type="StyleBox" uid="uid://bsrxxsifsyu4k" path="res://ui/theme/focus_accent.tres" id="3"]
5+
[ext_resource type="StyleBox" uid="uid://b45mlqutqarjn" path="res://ui/theme/button_outline_large_normal.tres" id="4"]
6+
[ext_resource type="StyleBox" uid="uid://lvuws1hlca6y" path="res://ui/theme/panel_normal.tres" id="5"]
7+
[ext_resource type="StyleBox" uid="uid://dhdt5bfr2nel5" path="res://ui/theme/button_outline_large_accent.tres" id="6"]
8+
[ext_resource type="Theme" uid="uid://b03mml1yyrchy" path="res://ui/theme/gdscript_app_theme.tres" id="7"]
9+
10+
[node name="TranslationInfoPopup" type="CanvasLayer" unique_id=1738910436]
11+
layer = 10
12+
script = ExtResource("1")
13+
14+
[node name="ColorRect" type="ColorRect" parent="." unique_id=1071289052]
15+
anchors_preset = 15
16+
anchor_right = 1.0
17+
anchor_bottom = 1.0
18+
color = Color(0.0352941, 0.0392157, 0.129412, 0.627451)
19+
20+
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1933627758]
21+
custom_minimum_size = Vector2(681, 480)
22+
anchors_preset = 8
23+
anchor_left = 0.5
24+
anchor_top = 0.5
25+
anchor_right = 0.5
26+
anchor_bottom = 0.5
27+
offset_left = -430.0
28+
offset_top = -295.0
29+
offset_right = 430.0
30+
offset_bottom = 295.0
31+
grow_horizontal = 2
32+
grow_vertical = 2
33+
theme = ExtResource("7")
34+
35+
[node name="Panel" type="Panel" parent="PanelContainer" unique_id=1643994035]
36+
layout_mode = 2
37+
theme_override_styles/panel = ExtResource("5")
38+
39+
[node name="Column" type="VBoxContainer" parent="PanelContainer" unique_id=1429450314]
40+
layout_mode = 2
41+
theme_override_constants/separation = 0
42+
43+
[node name="ProgressBar" type="ProgressBar" parent="PanelContainer/Column" unique_id=1495605754]
44+
custom_minimum_size = Vector2(0, 16)
45+
layout_mode = 2
46+
value = 100.0
47+
show_percentage = false
48+
49+
[node name="Margin" type="MarginContainer" parent="PanelContainer/Column" unique_id=1947591665]
50+
layout_mode = 2
51+
size_flags_vertical = 3
52+
53+
[node name="Column" type="VBoxContainer" parent="PanelContainer/Column/Margin" unique_id=60991072]
54+
layout_mode = 2
55+
theme_override_constants/separation = 12
56+
57+
[node name="Title" type="Label" parent="PanelContainer/Column/Margin/Column" unique_id=1901395612]
58+
layout_mode = 2
59+
theme_type_variation = &"LabelTitle"
60+
text = "Community Translations"
61+
horizontal_alignment = 1
62+
63+
[node name="Separator" type="HSeparator" parent="PanelContainer/Column/Margin/Column" unique_id=1918899718]
64+
custom_minimum_size = Vector2(400, 0)
65+
layout_mode = 2
66+
size_flags_horizontal = 4
67+
68+
[node name="Summary" type="RichTextLabel" parent="PanelContainer/Column/Margin/Column" unique_id=315287741]
69+
layout_mode = 2
70+
size_flags_vertical = 3
71+
bbcode_enabled = true
72+
text = "The languages available in this app are translated by community volunteers. They are not officially supported, and some translations may be incomplete or missing entirely.
73+
74+
If you see text that is still in English while using another language, this is expected. It means that part of the app has not been translated yet.
75+
76+
If you want to help make the translations more complete, you are welcome to contribute. You can find instructions on how to do so here: [b][url=https://github.com/GDQuest/learn-gdscript-translations/#readme]How to contribute translations[/url][/b]
77+
78+
Thank you to everyone who has contributed translations so far."
79+
80+
[node name="Spacer" type="Control" parent="PanelContainer/Column/Margin/Column" unique_id=624938975]
81+
custom_minimum_size = Vector2(400, 20)
82+
layout_mode = 2
83+
84+
[node name="ConfirmButton" type="Button" parent="PanelContainer/Column/Margin/Column" unique_id=486121878]
85+
custom_minimum_size = Vector2(200, 68)
86+
layout_mode = 2
87+
size_flags_horizontal = 4
88+
mouse_default_cursor_shape = 2
89+
theme_override_colors/font_pressed_color = Color(0.239216, 1, 0.431373, 1)
90+
theme_override_colors/font_hover_color = Color(0.239216, 1, 0.431373, 1)
91+
theme_override_styles/normal = ExtResource("4")
92+
theme_override_styles/pressed = ExtResource("6")
93+
theme_override_styles/hover = ExtResource("6")
94+
theme_override_styles/focus = ExtResource("3")
95+
text = "OK"

0 commit comments

Comments
 (0)