Skip to content

Commit 6b3cbd4

Browse files
authored
1.4.2 - Fix for #904 (#979)
We track the human readable timeline_name and return it during emitted signals
1 parent 6348856 commit 6b3cbd4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

addons/dialogic/Nodes/DialogNode.gd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ extends Control
66
## -----------------------------------------------------------------------------
77
## The timeline to load when starting the scene
88
var timeline: String
9+
var timeline_name: String
910

1011
### MODE
1112
var preview: bool = false
@@ -398,6 +399,7 @@ func play_audio(name):
398399
## -----------------------------------------------------------------------------
399400
# load a timeline file and start parsing
400401
func set_current_dialog(dialog_path: String):
402+
print(dialog_path)
401403
current_timeline = dialog_path
402404
dialog_script = DialogicResources.get_timeline_json(dialog_path)
403405
return load_dialog()
@@ -545,8 +547,8 @@ func on_timeline_start():
545547
# save to the default slot
546548
Dialogic.save('', true)
547549
# TODO remove event_start in 2.0
548-
emit_signal("event_start", "timeline", current_timeline)
549-
emit_signal("timeline_start", current_timeline)
550+
emit_signal("event_start", "timeline", timeline_name)
551+
emit_signal("timeline_start", timeline_name)
550552

551553
# emits timeline_end and handles autosaving
552554
func on_timeline_end():
@@ -556,7 +558,7 @@ func on_timeline_end():
556558
Dialogic.save('', true)
557559
# TODO remove event_end in 2.0
558560
emit_signal("event_end", "timeline")
559-
emit_signal("timeline_end", current_timeline)
561+
emit_signal("timeline_end", timeline_name)
560562

561563
# does checks and calls the above functions
562564
func _emit_timeline_signals():

addons/dialogic/Other/DialogicClass.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static func start(timeline: String = '', default_timeline: String ='', dialog_sc
7272
for t in DialogicUtil.get_timeline_list():
7373
if t['file'] == timeline:
7474
dialog_node.timeline = t['file']
75+
dialog_node.timeline_name = timeline
7576
return returned_dialog_node
7677
# No file found. Show error
7778
dialog_node.dialog_script = {
@@ -88,6 +89,7 @@ static func start(timeline: String = '', default_timeline: String ='', dialog_sc
8889
var timeline_file = _get_timeline_file_from_name(timeline)
8990
if timeline_file:
9091
dialog_node.timeline = timeline_file
92+
dialog_node.timeline_name = timeline
9193
return returned_dialog_node
9294

9395
# Just in case everything else fails.

0 commit comments

Comments
 (0)