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(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
PersonLikeThe 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(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
PersonLikeThe person.
parent
ElementThe 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
PersonLikeThe 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
PersonLikeThe 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(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
PersonLikeThe person.
parent
ElementThe 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
PersonLikeThe person who is buying the
clothes
.clothes
WornClothesThe clothes whose price to get.
Returns
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
PersonLikeThe 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
PersonLikeThe 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(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
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