Class CharacterCreator
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
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
Properties
Active
The currently displayed CharacterCreator instance, or null if the character editor is closed
public static CharacterCreator Active { get; }
Property Value
Methods
BoughtItem(Person, WornClothes)
A method that is called in CharacterCreator when a Person buys the given clothes
.
This method also causes OnBoughtItem to be raised.
public static void BoughtItem(Person person, WornClothes clothes)
Parameters
person
PersonThe person who is buying the
clothes
.clothes
WornClothesThe 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(Person), as well as HasAdult(IEnumerable<Person>).
public bool CanCloseOrExport()
Returns
- bool
Whether the character creator can currently be closed or exported.
CreateNameSelector(Person, Element)
Creates a name selector element for the given person
and adds it to the given parent
.
public static void CreateNameSelector(Person person, Element parent)
Parameters
person
PersonThe person.
parent
ElementThe parent element to add the name selector to.
CreatePersonalitySelector(Person, bool)
Creates a personality selector element for the given person
and returns it as a MLEM.Ui.Elements.Group.
public static Group CreatePersonalitySelector(Person person, bool lockCurrent)
Parameters
person
PersonThe person.
lockCurrent
boolWhether personalities that the
person
already has should be locked; that is, blocked from being removed.
Returns
- Group
CreatePregnancyAbilitySelector(Person, Element)
Creates a pregnancy ability selector element for the given person
and adds it to the given parent
.
public static void CreatePregnancyAbilitySelector(Person person, Element parent)
Parameters
person
PersonThe person.
parent
ElementThe 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
PersonThe person.
parent
ElementThe parent element to add the pronoun selector to.
Returns
CreateVoiceSelector(Person, Element)
Creates a voice selector element for the given person
and adds it to the given parent
.
public static void CreateVoiceSelector(Person person, Element parent)
Parameters
person
PersonThe person.
parent
ElementThe parent element to add the voice selector to.
GetCustomPrice(Person, 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(Person person, WornClothes clothes)
Parameters
person
PersonThe person who is buying the
clothes
.clothes
WornClothesThe clothes whose price to get.
Returns
IsPersonComplete(Person)
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 bool IsPersonComplete(Person person)
Parameters
person
PersonThe person.
Returns
- bool
Whether the person is complete.
Open(Person, bool)
Opens a new CharacterCreator for the given person (and their household).
public static void Open(Person person, bool full)
Parameters
person
PersonThe person to open in the character creator
full
boolIf 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(Person, 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
OnGetCustomPrice
An event that is invoked when GetCustomPrice(Person, 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