Skip to content

Commit

Permalink
Check for UIDs in strings as well (#2497)
Browse files Browse the repository at this point in the history
If you use an exported variable with a path to a file (let's say a timeline):

`@export_file var timeline = ""`

Godot will automatically use a UID path (something like `uid://d0kqf1bb2ev0` instead of `res://timeline.dtl`) file to avoid having issues when moving that file in the future. This check in Dialogic is only expecting for the string `res://` in the argument, so if you do something like `Dialogic.start(timeline)` it will fail to run.

The fix just adds a check for UID as well.
  • Loading branch information
coppolaemilio authored Jan 6, 2025
1 parent 986c730 commit 2cfb62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/dialogic/Core/DialogicGameHandler.gd
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func start_timeline(timeline:Variant, label_or_idx:Variant = "") -> void:
# load the resource if only the path is given
if typeof(timeline) == TYPE_STRING:
#check the lookup table if it's not a full file name
if (timeline as String).contains("res://"):
if (timeline as String).contains("res://") or (timeline as String).contains("uid://"):
timeline = load((timeline as String))
else:
timeline = DialogicResourceUtil.get_timeline_resource((timeline as String))
Expand Down

0 comments on commit 2cfb62e

Please sign in to comment.