Table of Contents

Class CharacterCreator

Namespace
TinyLife.Uis
Assembly
Tiny Life.dll

The character creator is displayed when a person (or household) is being edited in terms of their Clothes and PersonalityTypes.

public class CharacterCreator
Inheritance
CharacterCreator
Inherited Members
Extension Methods

Fields

MaxHouseholdSize

The maximum amount of people allowed in one household at a time. This is a constant that is set to 8.

public const int MaxHouseholdSize = 8

Field Value

int

MaxOutfitAmount

The maximum amount of outfits that any given person can have. This is a constant that is set to 10.

public const int MaxOutfitAmount = 10

Field Value

int

Properties

Active

The currently displayed CharacterCreator instance, or null if the character editor is closed

public static CharacterCreator Active { get; }

Property Value

CharacterCreator

Methods

BoughtItem(PersonLike, WornClothes)

A method that is called in CharacterCreator when a PersonLike buys the given clothes. This method also causes OnBoughtItem to be raised.

public static void BoughtItem(PersonLike person, WornClothes clothes)

Parameters

person PersonLike

The person who is buying the clothes.

clothes WornClothes

The clothes bought.

CanCloseOrExport()

Returns whether the character creator currently allows being closed or for the current household to be exported. The return value is based on IsPersonComplete(PersonLike), as well as whether the household's GetAgeGroups(IEnumerable<PersonLike>) contain at least one adult.

public CharacterCreator.CharacterCompletion CanCloseOrExport()

Returns

CharacterCreator.CharacterCompletion

Whether the character creator can currently be closed or exported.

CreateNameSelector(PersonLike, Element)

Creates a name selector element for the given person and adds it to the given parent.

public static void CreateNameSelector(PersonLike person, Element parent)

Parameters

person PersonLike

The person.

parent Element

The parent element to add the name selector to.

CreatePersonalitySelector(PersonLike, int?)

Creates a personality selector element for the given person and returns it as a MLEM.Ui.Elements.Group.

public static Group CreatePersonalitySelector(PersonLike person, int? amountRemovable)

Parameters

person PersonLike

The person.

amountRemovable int?

The amount of personalities that can be removed from the person's current PersonalityTypes. If this is 0, no current personalities are removable. If this is null, the personality selector is considered to be in "full edit mode", meaning all personalities can be removed or changed.

Returns

Group

CreatePregnancyAbilitySelector(PersonLike, Element)

Creates a pregnancy ability selector element for the given person and adds it to the given parent.

public static void CreatePregnancyAbilitySelector(PersonLike person, Element parent)

Parameters

person PersonLike

The person.

parent Element

The parent element to add the pregnancy ability selector to.

CreatePronounSelector(Person, Element)

Creates a pronoun selector element for the given person and adds it to the given parent.

public static bool CreatePronounSelector(Person person, Element parent)

Parameters

person Person

The person.

parent Element

The parent element to add the pronoun selector to.

Returns

bool

CreateVoiceSelector(PersonLike, Element)

Creates a voice selector element for the given person and adds it to the given parent.

public static void CreateVoiceSelector(PersonLike person, Element parent)

Parameters

person PersonLike

The person.

parent Element

The parent element to add the voice selector to.

GetCustomPrice(PersonLike, WornClothes)

Returns the custom price that the given WornClothes should be sold with in the CharacterCreator. This is influenced by the given person's personalities, as well as the OnGetCustomPrice event.

public static float? GetCustomPrice(PersonLike person, WornClothes clothes)

Parameters

person PersonLike

The person who is buying the clothes.

clothes WornClothes

The clothes whose price to get.

Returns

float?

The clothes item's custom price, or null to use the default price.

IsPersonComplete(PersonLike)

A method that determines whether the given person is complete, meaning the character creator can now be exited. A person is considered complete if their PersonalityType set is full based on MaxMajorsPerPerson, as well as if their FirstName, LastName and Pronouns are set.

public static CharacterCreator.CharacterCompletion IsPersonComplete(PersonLike person)

Parameters

person PersonLike

The person.

Returns

CharacterCreator.CharacterCompletion

Whether the person is complete.

Open(PersonLike, bool)

Opens a new CharacterCreator for the given person (and their household).

public static void Open(PersonLike person, bool full)

Parameters

person PersonLike

The person to open in the character creator

full bool

If this value is true, editing the person's name, skin and eye color and personality is possible

Events

OnBoughtItem

An event that is invoked when a Clothes item is bought in BoughtItem(PersonLike, WornClothes). Use this event to add emotion modifiers based on the clothing item bought in the character creator.

public static event CharacterCreator.BoughtItemDelegate OnBoughtItem

Event Type

CharacterCreator.BoughtItemDelegate

OnBuildModeButton

An event that is invoked when this tool's build mode buttons are created using BuildModeButton(string, GenericCallback, DrawCallback, float, TextureRegion, string, IEnumerable<string>, float?). The button that is created is passed as the second argument, and can be modified based on the object type.

public static event Action<Clothes, WornClothes, Button> OnBuildModeButton

Event Type

Action<Clothes, WornClothes, Button>

OnGetCustomPrice

An event that is invoked when GetCustomPrice(PersonLike, WornClothes) is called. Use this event to change the custom price of a clothing item bought in the character creator.

public static event CharacterCreator.GetCustomPriceDelegate OnGetCustomPrice

Event Type

CharacterCreator.GetCustomPriceDelegate