ModLoaderConfig
This class provides functionality for working with per-mod Configurations.
Methods Overview🔗
Method | Description |
---|---|
create_config |
Creates a new configuration for a mod. |
update_config |
Updates an existing ModConfig object with new data and save the config file. |
delete_config |
Deletes a ModConfig object and performs cleanup operations. |
set_current_config |
Sets the current configuration of a mod to the specified configuration. |
get_config_schema |
Returns the schema for the specified mod id. If no configuration file exists for the mod, an empty dictionary is returned. |
get_schema_for_prop |
Retrieves the schema for a specific property key. |
get_mods_with_config |
Retrieves an Array of mods that have configuration files. |
get_configs |
Retrieves the configurations dictionary for a given mod ID. |
get_config |
Retrieves the configuration for a specific mod and configuration name. Returns the configuration as a ModConfig object or null if not found. |
get_default_config |
Retrieves the default configuration for a specified mod ID. |
get_current_config |
Retrieves the currently active configuration for a specific mod |
get_current_config_name |
Retrieves the name of the current configuration for a specific mod Returns an empty string if no configuration exists for the mod or the user profile has not been loaded |
Methods🔗
create_config🔗
GDScript | |
---|---|
Parameters: - mod_id (String): The ID of the mod for which the configuration is being created. - config_name (String): The name of the configuration. - config_data (Dictionary): The configuration data to be stored in the new configuration.
Returns: - ModConfig: The created ModConfig object if successful, or null otherwise.
update_config🔗
GDScript | |
---|---|
Parameters: - config (ModConfig): The ModConfig object to be updated.
Returns: - ModConfig: The updated ModConfig object if successful, or null otherwise.
delete_config🔗
GDScript | |
---|---|
Parameters: - config (ModConfig): The ModConfig object to be deleted.
Returns: - bool: True if the deletion was successful, False otherwise.
set_current_config🔗
GDScript | |
---|---|
Parameters: - config (ModConfig): The ModConfig object to be set as current config.
get_config_schema🔗
GDScript | |
---|---|
Parameters: - mod_id (String): the ID of the mod to get the configuration schema for
Returns: - A dictionary representing the schema for the mod's configuration file
get_schema_for_prop🔗
GDScript | |
---|---|
Parameters:
- config (ModConfig): The ModConfig object from which to retrieve the schema.
- prop (String): The property key for which to retrieve the schema. e.g. parentProp.childProp.nthChildProp
or propKey
Returns: - Dictionary: The schema dictionary for the specified property.
get_mods_with_config🔗
GDScript | |
---|---|
Returns: - An Array containing the mod data of mods that have configuration files.
get_configs🔗
GDScript | |
---|---|
Parameters: - mod_id: The ID of the mod for which to retrieve the configurations.
Returns: - A dictionary containing the configurations for the specified mod. If the mod ID is invalid or no configurations are found, an empty dictionary is returned.
get_config🔗
GDScript | |
---|---|
Parameters: - mod_id (String): The ID of the mod to retrieve the configuration for. - config_name (String): The name of the configuration to retrieve.
Returns: - The configuration as a ModConfig object or null if not found.
get_default_config🔗
GDScript | |
---|---|
Parameters: - mod_id: The ID of the mod for which to retrieve the default configuration.
Returns: - The ModConfig object representing the default configuration for the specified mod. If the mod ID is invalid or no configuration is found, returns null.
get_current_config🔗
GDScript | |
---|---|
Parameters: - mod_id (String): The ID of the mod to retrieve the configuration for.
Returns: - The configuration as a ModConfig object or null if not found.
get_current_config_name🔗
GDScript | |
---|---|
Parameters: - mod_id (String): The ID of the mod to retrieve the current configuration name for.
Returns: - The currently active configuration name for the given mod id or an empty string if not found.
Constants Descriptions🔗
DEFAULT_CONFIG_NAME🔗
GDScript | |
---|---|
LOG_NAME🔗
GDScript | |
---|---|