@@ -6,7 +6,7 @@ extends Resource
66@export var enable_mods : bool = true
77## List of mod ids that can't be turned on or off
88@export var locked_mods : Array [String ] = []
9-
9+ ## List of mods that will not be loaded
1010@export var disabled_mods : Array [String ] = []
1111## Disables the requirement for the mod loader autoloads to be first
1212@export var allow_modloader_autoloads_anywhere : bool = false
@@ -63,6 +63,49 @@ extends Resource
6363@export var disable_restart := false
6464
6565@export_group ("Mod Validation" )
66- ## Activate this option to disable validation of the game version specified in [member semantic_version]
67- ## and the mod's [member ModManifest.compatible_game_version].
66+ ## Activate this option to disable validation of the game version specified in [member semantic_version]
67+ ## and the mod's [member ModManifest.compatible_game_version].
6868@export var disable_game_version_validation := false
69+ ## Activate this option to use a custom game version validation, use the [member customize_script_path]
70+ ## to specify a script to customize the Mod Loader Options. In this script you have to set [member custom_game_version_validation_callable]
71+ ## with a custom validation [Callable].
72+ ##
73+ ## [codeblock]
74+ ## extends RefCounted
75+ ##
76+ ##
77+ ## func _init(mod_loader_store: ModLoaderStore) -> void:
78+ ## mod_loader_store.ml_options.custom_game_version_validation_callable = custom_is_game_version_compatible
79+ ##
80+ ##
81+ ## func custom_is_game_version_compatible(manifest: ModManifest) -> bool:
82+ ## print("! ☞゚ヮ゚)☞ CUSTOM VALIDATION HERE ☜゚ヮ゚☜) !")
83+ ##
84+ ## var mod_id := manifest.get_mod_id()
85+ ##
86+ ## for version in manifest.compatible_game_version:
87+ ## if not version == "pizza":
88+ ## manifest.validation_messages_warning.push_back(
89+ ## "The mod \"%s\" may not be compatible with the current game version.
90+ ## Enable at your own risk. (current game version: %s, mod compatible with game versions: %s)" %
91+ ## [mod_id, MyGlobalVars.MyGameVersion, manifest.compatible_game_version]
92+ ## )
93+ ## return false
94+ ##
95+ ## return true
96+ ## [/codeblock]
97+ ##
98+ ## Using the customization script allows you to place your custom code outside of the addon directory to simplify mod loader updates.
99+ ##
100+ @export var custom_game_version_validation := false
101+ ## This is the callable that is called during [ModManifest] validation.
102+ ## See the example at [member disable_game_version_validation] to learn how to set this.
103+ var custom_game_version_validation_callable : Callable
104+ ## Use this to specify a script to customize mod loader options.
105+ ## Can be used to set custom options properties.
106+ ## The customize_script is initialized with the [ModLoaderStore] as the first and only argument.
107+ ## See [member disable_game_version_validation] for an example on how to use it.
108+ @export_file var customize_script_path : String
109+
110+ ## This is where the instance of [member customize_script_path] is stored.
111+ var customize_script_instance : RefCounted
0 commit comments