Api Sandbox ClothingContainer
class

ClothingContainer

public class ClothingContainer

Holds a collection of clothing items. Won't let you add items that aren't compatible.

Constructors

ClothingContainer()

Properties

Name Type Description
DisplayName String A user set name for this setup
Height Single The avatar's height. Default is 0.5f.
Age Single The avatar's age. Default is 0.0f. We'll pick a skin based on this.
Tint Single For the citizen the skin color is dynamic, based on a gradient. This is 0-1.
PrefersHuman Boolean If true, this avatar prefers to use a human model when possible

Methods

Void Normalize()

Restrict things like Height to their sensible limits

Void Toggle(Clothing clothing)

Add a clothing item if we don't already contain it, else remove it

ClothingEntry Add(Clothing clothing)

Add clothing item

Void Add(ClothingEntry clothing)

Add clothing item

Void AddRange(IEnumerable<ClothingEntry> clothing)
ClothingEntry FindEntry(Clothing clothing)

Find a clothing entry matching this clothing item

Boolean Has(Clothing clothing)

Returns true if we have this clothing item

ValueTuple<String, Int32>> GetBodyGroups()

Return a list of bodygroups and what their value should be

ValueTuple<String, Int32>> GetBodyGroups(IEnumerable<Clothing> items)
String Serialize()

Serialize to Json

Void Deserialize(String json)

Deserialize from Json

static ClothingContainer CreateFromJson(String json)

Create the container from json definitions

static ClothingContainer CreateFromLocalUser()

Create the container from the local user's setup

static ClothingContainer CreateFromConnection(Connection connection, Boolean removeUnowned = True)

Create the container from a connection's avatar, filtered to only items they are verified to own.

Void RemoveUnownedItems()

Removes any clothing items that require Steam inventory ownership but the local user doesn't own.

Void RemoveUnownedItems(Connection connection)

Removes clothing items that the given connection is not verified to own.

Task ApplyAsync(SkinnedModelRenderer body, CancellationToken token)

Dresses a skinned model with an outfit. Will apply all the clothes it can immediately, then download any missing clothing.

Void Apply(SkinnedModelRenderer body)

Dress a skinned model renderer with an outfit. Doesn't download missing clothing.

Void Reset(SkinnedModelRenderer body)

Clear the outfit from this model, make it named

Fields

Name Type Description
Clothing List<ClothingEntry> A list of clothing items the avatar is wearing
Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.ClothingContainer