diff --git a/root/mods-unpacked/AuthorName-ModName/extensions/main.gd b/root/mods-unpacked/AuthorName-ModName/extensions/main.gd index de975ac..29a59c0 100644 --- a/root/mods-unpacked/AuthorName-ModName/extensions/main.gd +++ b/root/mods-unpacked/AuthorName-ModName/extensions/main.gd @@ -16,7 +16,7 @@ func _ready()->void: # ! Note that you won't see this in the log immediately, because main.gd # ! doesn't run until you start a run - ModLoaderUtils.log_info("Ready", MYMOD_LOG) + ModLoaderLog.info("Ready", MYMOD_LOG) # ! These are custom functions. It will run after vanilla's own _ready is # ! finished @@ -45,4 +45,4 @@ func _modname_my_custom_edit_1()->void: # ! `void` means it doesn't return anyth func _modname_my_custom_edit_2()->void: - ModLoaderUtils.log_info("Main.gd has been modified", MYMOD_LOG) + ModLoaderLog.info("Main.gd has been modified", MYMOD_LOG) diff --git a/root/mods-unpacked/AuthorName-ModName/mod_main.gd b/root/mods-unpacked/AuthorName-ModName/mod_main.gd index 8ea6ac8..741ed04 100644 --- a/root/mods-unpacked/AuthorName-ModName/mod_main.gd +++ b/root/mods-unpacked/AuthorName-ModName/mod_main.gd @@ -15,19 +15,19 @@ var dir = "" var ext_dir = "" -func _init(modLoader = ModLoader): - ModLoaderUtils.log_info("Init", MYMOD_LOG) +func _init(): + ModLoaderLog.info("Init", MYMOD_LOG) # ! We can't use `ModLoader` because the ModLoader instance isn't available # ! at this point in the mod's loading process. Instead, the class instance # ! is passed to a mod's `_init` func via the variable `modLoader`. # ! It will be available in any other places in your mod though, such as in # ! your _ready func. - dir = modLoader.UNPACKED_DIR + MOD_DIR + dir = ModLoaderMod.get_unpacked_dir() + MOD_DIR ext_dir = dir + "extensions/" # ! any script extensions should go in this folder, and should follow the same folder structure as vanilla # Add extensions - modLoader.install_script_extension(ext_dir + "main.gd") # brief description of this edit... + ModLoaderMod.install_script_extension(ext_dir + "main.gd") # brief description of this edit... #modLoader.install_script_extension(ext_dir + "entities/units/player/player.gd") # ! Note that this file does not exist in this example mod # ! Add extensions (longform version of the above) @@ -40,12 +40,12 @@ func _init(modLoader = ModLoader): # ! Godot will automatically generate a ".translation" file, eg "modname.en.translation". # ! Note that in this example, only the file called "modname.csv" is custom; # ! any other files in the "translations" folder were automatically generated by Godot - modLoader.add_translation_from_resource(dir + "translations/modname.en.translation") + ModLoaderMod.add_translation(dir + "translations/modname.en.translation") func _ready()->void: - ModLoaderUtils.log_info("Ready", MYMOD_LOG) + ModLoaderLog.info("Ready", MYMOD_LOG) # ! This uses Godot's native `tr` func, which translates a string. You'll # ! find this particular string in the example CSV here: translations/modname.csv - ModLoaderUtils.log_info(str("Translation Demo: ", tr("MODNAME_READY_TEXT")), MYMOD_LOG) + ModLoaderLog.info(str("Translation Demo: ", tr("MODNAME_READY_TEXT")), MYMOD_LOG)