-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Milestone
Description
@torcado194 found a clever solution to find the matching script to a scene - just enforce a convention.
Yes some people have different conventions or don't like them at all. In those cases they can either edit the mod loader to use that convention (like searching in a separate scripts folder), or modders will just go back to the old method of manually refreshing them.
last 3 lines are the additions to script_extension.gd.
child_script.reload()
var parent_script: Script = child_script.get_base_script()
var parent_script_path: String = parent_script.resource_path
var parent_scene: String = parent_script_path.get_basename() + ".tscn"
if ResourceLoader.exists(parent_scene):
ModLoaderMod.refresh_scene(parent_scene)Since we are looking for a tscn here, FileAccess does not do the job in exported games, as noted by the docs.