Skip to content

Commit

Permalink
Support PackedScene in the Call Event.
Browse files Browse the repository at this point in the history
  • Loading branch information
CakeVR authored Apr 6, 2024
1 parent 1e2b089 commit 733526a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion addons/dialogic/Modules/Call/event_call.gd
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,17 @@ func get_method_suggestions(filter:String="", temp_autoload:String = "") -> Dict
var script: Script
if temp_autoload:
script = load(ProjectSettings.get_setting('autoload/'+temp_autoload).trim_prefix('*'))

elif autoload_name and ProjectSettings.has_setting('autoload/'+autoload_name):
script = load(ProjectSettings.get_setting('autoload/'+autoload_name).trim_prefix('*'))
var loaded_autoload := load(ProjectSettings.get_setting('autoload/'+autoload_name).trim_prefix('*'))

if loaded_autoload is PackedScene:
var packed_scene: PackedScene = loaded_autoload
script = packed_scene.instantiate().get_script()

else:
script = autoload_load

if script:
for method in script.get_script_method_list():
if method.name.begins_with('@') or method.name.begins_with('_'):
Expand Down

0 comments on commit 733526a

Please sign in to comment.