|
@@ -33,6 +33,10 @@ func go_fast_to_next_slide() -> void:
|
|
|
next_slide(Focus.Transit.BEAM)
|
|
|
|
|
|
|
|
|
+func go_fast_to_previous_slide() -> void:
|
|
|
+ next_slide_at(_previous_id(), Focus.Transit.BEAM)
|
|
|
+
|
|
|
+
|
|
|
func next_slide(trans: Focus.Transit) -> void:
|
|
|
next_slide_at(_next_id(), trans)
|
|
|
|
|
@@ -96,6 +100,15 @@ func _next_id() -> int:
|
|
|
return next_id
|
|
|
|
|
|
|
|
|
+func _previous_id() -> int:
|
|
|
+ var next_id: int = current_id - 1
|
|
|
+
|
|
|
+ if next_id < 0:
|
|
|
+ return slides.size() - 1
|
|
|
+
|
|
|
+ return next_id
|
|
|
+
|
|
|
+
|
|
|
func _reset_id() -> void:
|
|
|
current_id = VOID_SLIDE_ID
|
|
|
|
|
@@ -107,6 +120,9 @@ func _unhandled_key_input(event: InputEvent) -> void:
|
|
|
if event.is_action("ui_right"):
|
|
|
get_viewport().set_input_as_handled()
|
|
|
go_fast_to_next_slide()
|
|
|
+ elif event.is_action("ui_left"):
|
|
|
+ get_viewport().set_input_as_handled()
|
|
|
+ go_fast_to_previous_slide()
|
|
|
elif event.is_action("ui_cancel"):
|
|
|
get_viewport().set_input_as_handled()
|
|
|
_reset_id()
|