-
Notifications
You must be signed in to change notification settings - Fork 30
ModLoaderUserProfile
Extends: Object
This Class provides methods for working with user profiles.
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 |
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.
Returns: bool
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.
Returns: bool
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.
Returns: bool
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).
Returns: bool
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.
Returns: bool
func delete_profile(user_profile: ModUserProfile) -> bool
Deletes the given user profile.
Parameters:
- user_profile (ModUserProfile): The user profile to delete.
Returns: bool
func get_current() -> ModUserProfile
Returns the current user profile.
Returns: ModUserProfile
func get_profile(profile_name: String) -> ModUserProfile
Returns the user profile with the given name.
Parameters:
- profile_name (String): The name of the user profile to retrieve.
Returns: ModUserProfile or null if not found
func get_all_as_array() -> Array
Returns an array containing all user profiles stored in ModLoaderStore.
Returns: Array of ModUserProfile Objects
Home ~ Setup ~ Mod Structure ~ Mod Files ~ API Methods ~ Logging