Skip to content

ModLoaderUserProfile

This class provides methods for working with user profiles.

Methods Overview🔗

Method Description
enable_mod Enables a mod - it will be loaded on the next game start.
disable_mod Disables a mod - it will not be loaded on the next game start.
set_mod_current_config Sets the current config for a mod in a user profile's mod_list.
create_profile Creates a new user profile with the given name, using the currently loaded mods as the mod list.
set_profile Sets the current user profile to the given user profile.
delete_profile Deletes the given user profile.
get_current Returns the current user profile.
get_profile Returns the user profile with the given name.
get_all_as_array Returns an array containing all user profiles stored in ModLoaderStore.

Methods🔗

enable_mod🔗

GDScript
func enable_mod(mod_id: String, user_profile: ModUserProfile) -> bool
Enables a mod - it will be loaded on the next game start

Parameters: - mod_id (String): The ID of the mod to enable. - user_profile (ModUserProfile): (Optional) The user profile to enable the mod for. Default is the current user profile.

disable_mod🔗

GDScript
func disable_mod(mod_id: String, user_profile: ModUserProfile) -> bool
Disables a mod - it will not be loaded on the next game start

Parameters: - mod_id (String): The ID of the mod to disable. - user_profile (ModUserProfile): (Optional) The user profile to disable the mod for. Default is the current user profile.

set_mod_current_config🔗

GDScript
func set_mod_current_config(mod_id: String, mod_config: ModConfig, user_profile: ModUserProfile) -> bool
Sets the current config for a mod in a user profile's mod_list.

Parameters: - mod_id (String): The ID of the mod. - mod_config (ModConfig): The mod config to set as the current config. - user_profile (ModUserProfile): (Optional) The user profile to update. Default is the current user profile.

create_profile🔗

GDScript
func create_profile(profile_name: String) -> bool
Creates a new user profile with the given name, using the currently loaded mods as the mod list.

Parameters: - profile_name (String): The name of the new user profile (must be unique).

set_profile🔗

GDScript
func set_profile(user_profile: ModUserProfile) -> bool
Sets the current user profile to the given user profile.

Parameters: - user_profile (ModUserProfile): The user profile to set as the current profile.

delete_profile🔗

GDScript
func delete_profile(user_profile: ModUserProfile) -> bool
Deletes the given user profile.

Parameters: - user_profile (ModUserProfile): The user profile to delete.

get_current🔗

GDScript
func get_current() -> ModUserProfile
Returns the current user profile.

get_profile🔗

GDScript
func get_profile(profile_name: String) -> ModUserProfile
Returns the user profile with the given name, or null if not found.

Parameters: - profile_name (String): The name of the user profile to retrieve.

get_all_as_array🔗

GDScript
func get_all_as_array() -> Array
Returns an array containing all user profiles stored in ModLoaderStore.