11class_name ModLoaderOptionsProfile
22extends Resource
3+ ##
4+ ## Class to define and store Mod Loader Options.
5+ ##
6+ ## @tutorial(Example Customization Script): https://wiki.godotmodding.com/guides/integration/mod_loader_options/#game-version-validation
37
48
9+ ## Settings for game version validation.
10+ enum VERSION_VALIDATION {
11+ ## Uses the default semantic versioning (semver) validation.
12+ DEFAULT ,
13+
14+ ## Disables validation of the game version specified in [member semantic_version]
15+ ## and the mod's [member ModManifest.compatible_game_version].
16+ DISABLED ,
17+
18+ ## Enables custom game version validation.
19+ ## Use [member customize_script_path] to specify a script that customizes the Mod Loader options.
20+ ## In this script, you must set [member custom_game_version_validation_callable]
21+ ## to a custom validation [Callable].
22+ ## [br]
23+ ## ===[br]
24+ ## [b]Note:[color=note "Easier Mod Loader Updates"][/color][/b][br]
25+ ## Using a custom script allows you to keep your code outside the addons directory,
26+ ## making it easier to update the mod loader without affecting your modifications. [br]
27+ ## ===[br]
28+ CUSTOM ,
29+ }
30+
531## Can be used to disable mods for specific plaforms by using feature overrides
632@export var enable_mods : bool = true
733## List of mod ids that can't be turned on or off
834@export var locked_mods : Array [String ] = []
9-
35+ ## List of mods that will not be loaded
1036@export var disabled_mods : Array [String ] = []
1137## Disables the requirement for the mod loader autoloads to be first
1238@export var allow_modloader_autoloads_anywhere : bool = false
13-
39+ ## This script is loaded after [member ModLoaderStore.ml_options] has been initialized.
40+ ## It is instantiated with [member ModLoaderStore.ml_options] as an argument.
41+ ## Use this script to apply settings that cannot be configured through the editor UI.
42+ ##
43+ ## For an example, see [enum VERSION_VALIDATION] [code]CUSTOM[/code] or
44+ ## [code]res://addons/mod_loader/options/example_customize_script.gd[/code].
45+ @export_file var customize_script_path : String
1446
1547@export_group ("Logging" )
48+ ## Sets the logging verbosity level.
49+ ## Refer to [enum ModLoaderLog.VERBOSITY_LEVEL] for more details.
1650@export var log_level := ModLoaderLog .VERBOSITY_LEVEL .DEBUG
1751## Stops the mod loader from logging any deprecation related errors.
1852@export var ignore_deprecated_errors : bool = false
@@ -43,6 +77,7 @@ extends Resource
4377## Path to a folder containing mods [br]
4478## Mod zips should be directly in this folder
4579@export_dir var override_path_to_mods = ""
80+ ## Use this option to override the default path where configs are stored.
4681@export_dir var override_path_to_configs = ""
4782## Path to a folder containing workshop items.[br]
4883## Mods zips are placed in another folder, usually[br]
@@ -62,3 +97,17 @@ extends Resource
6297@export_dir var restart_notification_scene_path := "res://addons/mod_loader/restart_notification.tscn"
6398## Can be used to disable the mod loader's restart logic. Use the [signal ModLoader.new_hooks_created] to implement your own restart logic.
6499@export var disable_restart := false
100+
101+ @export_group ("Mod Validation" )
102+ ## Defines how the game version should be validated.
103+ ## This setting controls validation for the game version specified in [member semantic_version]
104+ ## and the mod's [member ModManifest.compatible_game_version].
105+ @export var game_version_validation := VERSION_VALIDATION .DEFAULT
106+
107+ ## Callable that is executed during [ModManifest] validation
108+ ## if [member game_version_validation] is set to [enum VERSION_VALIDATION] [code]CUSTOM[/code].
109+ ## See the example under [enum VERSION_VALIDATION] [code]CUSTOM[/code] to learn how to set this up.
110+ var custom_game_version_validation_callable : Callable
111+
112+ ## Stores the instance of the script specified in [member customize_script_path].
113+ var customize_script_instance : RefCounted
0 commit comments