Skip to main content

CustomizationVisualManager

A class in Root.Township, Alta.Customization.

Tracks which cosmetic items are on a character, which slots they fill or disable, and attaches their visual parts to every registered handler (character dummy).

Constructors​

MemberWhat it is
CustomizationVisualManager()Creates a CustomizationVisualManager with default values.

Fields​

5 private and internal fields
MemberWhat it is
private readonly HashSet<ICustomizationHandler> handlersBacking set for Handlers.
private readonly HashSet<int> hiddenSlotsSlot keys marked hidden; only cleared here.
private readonly Dictionary<uint, List<CustomizationSlotEntry>> itemsSlot entries per registered item hash. Entry 0 is the item itself, the rest are its parts.
private static readonly Logger loggerNLog logger for this class.
private readonly Dictionary<int, CustomizationSlot> slotsSlots by key.

Properties​

MemberWhat it is
IEnumerable<ICustomizationHandler> Handlers { get; }The handlers that show this character's cosmetics.
bool IsPaused { get; set; }When true, handlers added by Attach keep their packer paused.

Methods​

MemberWhat it is
void ApplyArguments(uint item, CustomizationArguments[] arguments)Pushes new arguments (colours and so on) for an item's parts to all handlers.
void Attach(ICustomizationHandler handler)Adds a handler and attaches every registered item's parts to it, pausing its packer meanwhile unless IsPaused.
void Clear()Clears every handler's packer inputs and forgets all slots and items.
void Deregister(ICustomizationDefinition item)Removes an item: detaches its parts from all handlers and releases its slots.
void Detach(ICustomizationHandler handler)Removes a handler and detaches all item parts from it, unless the handler is already destroyed.
bool IsSlotDisabled(int key)Whether a slot is disabled by some registered item.
void Register(ICustomizationDefinition item, CustomizationArguments[] arguments)Adds an item with its arguments: disables its blocked slots, fills its slots and attaches its parts to all handlers. Ignored if already registered.
void UpdateFirstPerson(ICustomizationHandler handler)Updates first-person visibility of every item part for one handler.
1 private and internal method
MemberWhat it is
private CustomizationSlot GetOrAddSlot(int key)Returns the slot for a key, creating it if missing.