ModLoaderUserProfile🔗
Inherits: Object
This Class provides methods for working with user profiles.
Constants🔗
• LOG_NAME
: "ModLoader:UserProfile"
🔗
• FILE_PATH_USER_PROFILES
: "user://mod_user_profiles.json"
🔗
Method Descriptions🔗
• bool
enable_mod(mod_id: String, user_profile: ModUserProfile)
static🔗
Description:🔗
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
: True on success.
• bool
force_enable_mod(mod_id: String, user_profile: ModUserProfile)
static🔗
Description:🔗
Forces a mod to enable, ensuring it loads at the next game start, regardless of load warnings.
Parameters:🔗
mod_id
(String
): The ID of the mod to enable.user_profile
(ModUserProfile
): (Optional) The user profile for which the mod will be enabled. Defaults to the current user profile.
Returns:
bool
: True on success.
• bool
disable_mod(mod_id: String, user_profile: ModUserProfile)
static🔗
Description:🔗
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
: True on success.
• bool
set_mod_current_config(mod_id: String, mod_config: ModConfig, user_profile: ModUserProfile)
static🔗
Description:🔗
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
: True on success.
• bool
create_profile(profile_name: String)
static🔗
Description:🔗
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
: True on success.
• bool
set_profile(user_profile: ModUserProfile)
static🔗
Description:🔗
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
: True on success.
• bool
delete_profile(user_profile: ModUserProfile)
static🔗
Description:🔗
Deletes the given user profile.
Parameters:🔗
user_profile
(ModUserProfile
): The user profile to delete.
Returns:
bool
: True on success.
• ModUserProfile
get_current()
static🔗
Description:🔗
Returns the current user profile.
Returns:
ModUserProfile
: The current profile ornull
if not set.
• ModUserProfile
get_profile(profile_name: String)
static🔗
Description:🔗
Returns the user profile with the given name.
Parameters:🔗
profile_name
(String
): The name of the user profile to retrieve.
Returns:
ModUserProfile
: The profile ornull
if not found
• Array
get_all_as_array()
static🔗
Description:🔗
Returns an array containing all user profiles stored in ModLoaderStore.
Returns:
Array
: A list ofModUserProfile
Objects
• bool
is_initialized()
static🔗
Description:🔗
Returns true if the Mod User Profiles are initialized.
Returns:
bool
: True if profiles are ready.
On the first execution of the game, user profiles might not yet be created. Use this method to check if everything is ready to interact with the ModLoaderUserProfile API.