Allow Mod Loader to automatically add hooks on export (#405)

* Update Mod Loader and Tool addons

* Mod tool checks if script exists before reloading

* Change script export mode to Text for hook export

* Change return type of load_image_from_path to Texture2D
This commit is contained in:
BarrierFalki
2025-09-26 13:30:40 -05:00
committed by GitHub
parent 1c309ce731
commit 78f68b3be1
59 changed files with 104 additions and 69 deletions

View File

@@ -10,7 +10,7 @@ class_name ModToolUtils
static func reload_script(script: Script, mod_tool_store: ModToolStore) -> void:
var pending_reloads := mod_tool_store.pending_reloads
if script.resource_path in pending_reloads:
if script and script.resource_path in pending_reloads:
var source_code_from_disc := FileAccess.open(script.resource_path, FileAccess.READ).get_as_text()
var script_editor := EditorInterface.get_script_editor()

View File

@@ -89,7 +89,7 @@ func add_custom_context_actions(context_menu: PopupMenu, file_paths: Array[Strin
add_hooks_context_action(context_menu, script_paths)
if asset_override_paths.size() > 0:
add_asset_override_context_action(context_menu, script_paths)
add_asset_override_context_action(context_menu, asset_override_paths)
func create_script_extension(file_path: String) -> String: