Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hide loading screen on double click on the header #180

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions godot/src/ui/components/loading_screen/loading_screen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var progress: float = 0.0
var last_progress_change := Time.get_ticks_msec()
var popup_warning_pos_y: int = 0

var last_hide_click := 0.0

@onready var loading_progress = %ColorRect_LoadingProgress
@onready var loading_progress_label = %Label_LoadingProgress

Expand Down Expand Up @@ -163,3 +165,13 @@ func _on_loading_screen_progress_logic_loading_show_requested():
last_progress_change = Time.get_ticks_msec()
popup_warning.hide()
timer_check_progress_timeout.start()


# For dev purposes
func _on_color_rect_header_gui_input(event):
if event is InputEventScreenTouch:
if event.pressed:
var elapsed_time = Time.get_ticks_msec() - last_hide_click
if elapsed_time <= 500:
loading_screen_progress_logic.hide_loading_screen()
last_hide_click = Time.get_ticks_msec()
1 change: 1 addition & 0 deletions godot/src/ui/components/loading_screen/loading_screen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ layout_mode = 2
theme_type_variation = &"GrayButton"
text = "RUN ANYWAY"

[connection signal="gui_input" from="VBox_Loading/VBox_Header/ColorRect_Header" to="." method="_on_color_rect_header_gui_input"]
[connection signal="gui_input" from="VBox_Loading/ColorRect_Background/Control_Discover/VBoxContainer/HBoxContainer_Content/Control_Left/TextureRect_LeftArrow" to="." method="_on_texture_rect_left_arrow_gui_input"]
[connection signal="gui_input" from="VBox_Loading/ColorRect_Background/Control_Discover/VBoxContainer/HBoxContainer_Content/Control_Right/TextureRect_RightArrow" to="." method="_on_texture_rect_right_arrow_gui_input"]
[connection signal="timeout" from="Timer_AutoMoveCarousel" to="." method="_on_timer_auto_move_carousel_timeout"]
Expand Down
Loading