Skip to content

Commit c81e9de

Browse files
committed
fix: make sure course thumbnails are clickable on end screens, simplify ui core
1 parent 2fc11f7 commit c81e9de

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

ui/UICore.gd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ var _course_navigator: UINavigator
1414
onready var _pages := $Pages as Control
1515
onready var _loading_screen := $Pages/LoadingScreen as LoadingScreen
1616
onready var _welcome_screen := $Pages/WelcomeScreen as WelcomeScreen
17-
onready var _end_screen := $Pages/EndScreen as Control
18-
onready var _sponsorless_end_screen := $Pages/SponsorlessEndScreen as Control
1917
onready var _settings_screen := $Pages/SettingsScreen as Control
2018
onready var _course_screen := $Pages/CourseScreen as Control
2119

@@ -138,9 +136,9 @@ func _show_end_screen(_course: Course) -> void:
138136
page.hide()
139137

140138
if show_sponsored_screen:
141-
_end_screen.show()
139+
get_tree().change_scene("res://ui/screens/end_screen/EndScreen.tscn")
142140
else:
143-
_sponsorless_end_screen.show()
141+
get_tree().change_scene("res://ui/screens/end_screen/SponsorlessEndScreen.tscn")
144142

145143

146144
func _go_to_welcome_screen() -> void:

ui/UICore.tscn

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
[gd_scene load_steps=11 format=2]
1+
[gd_scene load_steps=9 format=2]
22

33
[ext_resource path="res://ui/screens/welcome_screen/WelcomeScreen.tscn" type="PackedScene" id=1]
44
[ext_resource path="res://ui/theme/gdscript_app_theme.tres" type="Theme" id=2]
55
[ext_resource path="res://ui/LoadingScreen.tscn" type="PackedScene" id=3]
66
[ext_resource path="res://ui/UICore.gd" type="Script" id=4]
77
[ext_resource path="res://ui/components/popups/ReportFormPopup.tscn" type="PackedScene" id=5]
88
[ext_resource path="res://ui/components/popups/SettingsPopup.tscn" type="PackedScene" id=6]
9-
[ext_resource path="res://ui/screens/end_screen/EndScreen.tscn" type="PackedScene" id=7]
109
[ext_resource path="res://ui/UIVersion.gd" type="Script" id=8]
1110
[ext_resource path="res://ui/theme/fonts/font_version.tres" type="DynamicFont" id=9]
12-
[ext_resource path="res://ui/screens/end_screen/SponsorlessEndScreen.tscn" type="PackedScene" id=10]
1311

1412
[node name="UICore" type="Control"]
1513
pause_mode = 2
1614
anchor_right = 1.0
1715
anchor_bottom = 1.0
16+
margin_left = 2.0
17+
margin_right = 2.0
1818
mouse_filter = 2
1919
theme = ExtResource( 2 )
2020
script = ExtResource( 4 )
@@ -39,13 +39,6 @@ anchor_right = 1.0
3939
anchor_bottom = 1.0
4040
mouse_filter = 2
4141

42-
[node name="EndScreen" parent="Pages" instance=ExtResource( 7 )]
43-
visible = false
44-
mouse_filter = 2
45-
46-
[node name="SponsorlessEndScreen" parent="Pages" instance=ExtResource( 10 )]
47-
visible = false
48-
4942
[node name="LoadingScreen" parent="Pages" instance=ExtResource( 3 )]
5043
mouse_filter = 2
5144

@@ -72,6 +65,7 @@ margin_right = -2.0
7265
grow_vertical = 0
7366
rect_min_size = Vector2( 1918, 20 )
7467
focus_mode = 2
68+
mouse_filter = 2
7569
custom_colors/default_color = Color( 0.572549, 0.560784, 0.721569, 1 )
7670
custom_fonts/normal_font = ExtResource( 9 )
7771
bbcode_enabled = true

ui/screens/end_screen/EndScreen.tscn

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=49 format=2]
1+
[gd_scene load_steps=50 format=2]
22

33
[ext_resource path="res://ui/theme/fonts/Inter-Medium.ttf" type="DynamicFontData" id=1]
44
[ext_resource path="res://ui/theme/gdscript_app_theme.tres" type="Theme" id=2]
@@ -23,6 +23,13 @@
2323
[ext_resource path="res://ui/screens/end_screen/third-person-platformer-panoramic.jpg" type="Texture" id=21]
2424
[ext_resource path="res://ui/screens/end_screen/arrow_black.svg" type="Texture" id=22]
2525

26+
[sub_resource type="GDScript" id=37]
27+
script/source = "extends Button
28+
29+
func _ready() -> void:
30+
connect(\"pressed\", get_tree(), \"change_scene\", [\"res://ui/UICore.tscn\"])
31+
"
32+
2633
[sub_resource type="StyleBoxFlat" id=1]
2734
bg_color = Color( 0.251478, 0.2021, 0.43, 0.894118 )
2835
shadow_offset = Vector2( 0, 4 )
@@ -241,6 +248,7 @@ hint_tooltip = "Open the course index"
241248
mouse_default_cursor_shape = 2
242249
icon = ExtResource( 11 )
243250
flat = true
251+
script = SubResource( 37 )
244252
245253
[node name="Control" type="Control" parent="Layout/TopBar/MarginContainer/ToolBarLayout"]
246254
margin_left = 48.0

ui/screens/end_screen/SponsorlessEndScreen.tscn

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=20 format=2]
1+
[gd_scene load_steps=21 format=2]
22

33
[ext_resource path="res://ui/theme/fonts/font_title.tres" type="DynamicFont" id=1]
44
[ext_resource path="res://ui/theme/gdscript_app_theme.tres" type="Theme" id=2]
@@ -13,6 +13,13 @@
1313
[ext_resource path="res://ui/screens/end_screen/main_menu/sky_dark.png" type="Texture" id=12]
1414
[ext_resource path="res://ui/screens/end_screen/main_menu/sky_day_blurred.png" type="Texture" id=13]
1515

16+
[sub_resource type="GDScript" id=10]
17+
script/source = "extends Button
18+
19+
func _ready() -> void:
20+
connect(\"pressed\", get_tree(), \"change_scene\", [\"res://ui/UICore.tscn\"])
21+
"
22+
1623
[sub_resource type="GDScript" id=2]
1724
script/source = "tool
1825
extends HBoxContainer
@@ -117,6 +124,7 @@ hint_tooltip = "Open the course index"
117124
mouse_default_cursor_shape = 2
118125
icon = ExtResource( 11 )
119126
flat = true
127+
script = SubResource( 10 )
120128
121129
[node name="Control" type="Control" parent="Layout/TopBar/MarginContainer/ToolBarLayout"]
122130
margin_left = 48.0
@@ -223,7 +231,7 @@ bbcode_enabled = true
223231
bbcode_text = "Like Godot, this app and course is free and open-source.
224232

225233
You can find the app's source code and contribute translations here: [url=\"https://github.com/GDQuest/learn-gdscript\"]Learn GDScript From Zero (Github repository)[/url]."
226-
text = "Like Godot, this app and course are free and open-source.
234+
text = "Like Godot, this app and course is free and open-source.
227235
228236
You can find the app's source code and contribute translations here: Learn GDScript From Zero (Github repository)."
229237
fit_content_height = true

0 commit comments

Comments
 (0)