From 60afd369a6c7cc55ecd758416255dc9af3bdbd8f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 23 Nov 2023 03:46:37 +0000 Subject: Make loadScriptExtension compatible with the compiler --- Archipelago/settings_screen.gd | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'Archipelago') diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 213bc84..a3305e5 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -31,16 +31,16 @@ func _ready(): apclient_instance.add_child(apdata_instance) # Let's also inject any scripts we need to inject now. - installScriptExtension("user://maps/Archipelago/doorControl.gd") - installScriptExtension("user://maps/Archipelago/load.gd") - installScriptExtension("user://maps/Archipelago/painting_eye.gd") - installScriptExtension("user://maps/Archipelago/painting_scenery.gd") - installScriptExtension("user://maps/Archipelago/panelLevelSwitch.gd") - installScriptExtension("user://maps/Archipelago/panelEnd.gd") - installScriptExtension("user://maps/Archipelago/panelInput.gd") - installScriptExtension("user://maps/Archipelago/pause_menu.gd") - installScriptExtension("user://maps/Archipelago/player.gd") - installScriptExtension("user://maps/Archipelago/worldTransporter.gd") + installScriptExtension(apclient_instance.SCRIPT_doorControl) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelEnd.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) var apclient = global.get_node("Archipelago") apclient.connect("client_connected", self, "connectionSuccessful") @@ -67,9 +67,7 @@ func _ready(): # Adapted from https://gitlab.com/Delta-V-Modding/Mods/-/blob/main/game/ModLoader.gd -func installScriptExtension(childScriptPath: String): - var childScript = ResourceLoader.load(childScriptPath) - +func installScriptExtension(childScript: Resource): # Force Godot to compile the script now. # We need to do this here to ensure that the inheritance chain is # properly set up, and multiple mods can chain-extend the same @@ -82,7 +80,7 @@ func installScriptExtension(childScriptPath: String): var parentScript = childScript.get_base_script() var parentScriptPath = parentScript.resource_path global._print( - "ModLoader: Installing script extension: %s <- %s" % [parentScriptPath, childScriptPath] + "ModLoader: Installing script extension over %s" % parentScriptPath ) childScript.take_over_path(parentScriptPath) -- cgit 1.4.1