Skip to content

Commit

Permalink
Fix possible errors on autoskip _init
Browse files Browse the repository at this point in the history
_init is called again later, because we can't be certain of the order the subsystems are added in, but that could lead to it already being connected, so this is to avoid error messages.
  • Loading branch information
Jowan-Spooner committed Jun 25, 2024
1 parent 51a40d6 commit be2908b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/dialogic/Modules/Text/auto_advance.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends RefCounted
class_name DialogicAutoAdvance
extends RefCounted
## This class holds the settings for the Auto-Advance feature.
## Changing the variables will alter the behaviour of Auto-Advance.
##
Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Modules/Text/auto_skip.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends RefCounted
class_name DialogicAutoSkip
extends RefCounted
## This class holds the settings for the Auto-Skip feature.
## Changing the variables will alter the behaviour of Auto-Skip.
##
Expand Down Expand Up @@ -40,7 +40,7 @@ var time_per_event: float = 0.1
func _init() -> void:
time_per_event = ProjectSettings.get_setting('dialogic/text/autoskip_time_per_event', time_per_event)

if DialogicUtil.autoload().has_subsystem('History'):
if DialogicUtil.autoload().has_subsystem("History") and not DialogicUtil.autoload().History.visited_event.is_connected(_handle_seen_event):
DialogicUtil.autoload().History.visited_event.connect(_handle_seen_event)
DialogicUtil.autoload().History.unvisited_event.connect(_handle_unseen_event)

Expand Down

0 comments on commit be2908b

Please sign in to comment.