Skip to content

ModLoaderUserProfile

KANAjetzt edited this page Jun 16, 2023 · 5 revisions

ModLoaderUserProfile

Extends: Object

Description

This Class provides methods for working with user profiles.

Constants Descriptions

FILE_PATH_USER_PROFILES

const FILE_PATH_USER_PROFILES: String = "user://mod_user_profiles.json"

The path where the Mod User Profiles data is stored.

LOG_NAME

const LOG_NAME: String = "ModLoader:UserProfile"

Method Descriptions

enable_mod (static)

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

disable_mod (static)

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

set_mod_current_config (static)

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

create_profile (static)

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

set_profile (static)

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

delete_profile (static)

func delete_profile(user_profile: ModUserProfile) -> bool

Deletes the given user profile.

Parameters:

  • user_profile (ModUserProfile): The user profile to delete.

Returns: bool

get_current (static)

func get_current() -> ModUserProfile

Returns the current user profile.

Returns: ModUserProfile

get_profile (static)

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

get_all_as_array (static)

func get_all_as_array() -> Array

Returns an array containing all user profiles stored in ModLoaderStore.

Returns: Array of ModUserProfile Objects

Clone this wiki locally