Table of Contents

Class SwapClothingRequested

Namespace
Uncreated.Warfare.Events.Models.Items
Assembly
Uncreated.Warfare.dll

Invoked when a player tries to swap their clothes to another item or remove clothes completely.

[EventModel(EventSynchronizationContext.PerPlayer, SynchronizedModelTags = new string[] { "modify_inventory" })]
public class SwapClothingRequested : CancellablePlayerEvent, IPlayerEvent, ICancellable
Inheritance
SwapClothingRequested
Implements
Inherited Members

Constructors

SwapClothingRequested(Page, byte, byte, ItemJar?, ItemClothingAsset?)

public SwapClothingRequested(Page page, byte x, byte y, ItemJar? jar, ItemClothingAsset? clothing)

Parameters

page Page
x byte
y byte
jar ItemJar
clothing ItemClothingAsset

Properties

CurrentClothing

The asset of the current clothing equipped to the slot, if any.

public required ItemClothingAsset? CurrentClothing { get; init; }

Property Value

ItemClothingAsset

CurrentClothingQuality

The quality of the current clothing equipped to the slot, if any.

public required byte CurrentClothingQuality { get; init; }

Property Value

byte

CurrentClothingState

The state of the current clothing equipped to the slot, if any.

public required byte[]? CurrentClothingState { get; init; }

Property Value

byte[]

EquippingClothing

The asset of the item being equipped, if any.

public ItemClothingAsset? EquippingClothing { get; }

Property Value

ItemClothingAsset

EquippingItem

The item being equipped, if any.

public Item? EquippingItem { get; }

Property Value

Item

EquippingJar

The jar of the item being equipped, if any.

public ItemJar? EquippingJar { get; }

Property Value

ItemJar

EquippingOriginalPage

The page of the original location of the item being equipped, if any.

public Page EquippingOriginalPage { get; }

Property Value

Page

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

EquippingOriginalX

The X position of the original location of the item being equipped, if any.

public byte EquippingOriginalX { get; }

Property Value

byte

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

EquippingOriginalY

The Y position of the original location of the item being equipped, if any.

public byte EquippingOriginalY { get; }

Property Value

byte

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

EquippingPage

The page of the item being equipped, if any.

public Page EquippingPage { get; }

Property Value

Page

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

EquippingX

The X position of the item being equipped, if any.

public byte EquippingX { get; }

Property Value

byte

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

EquippingY

The Y position of the item being equipped, if any.

public byte EquippingY { get; }

Property Value

byte

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

IsRemoving

If clothes are being removed.

public bool IsRemoving { get; }

Property Value

bool

Remarks

This can be changed using TryChangeItem(Page, byte, byte) or DequipItem().

Type

The clothing slot being modified.

public required ClothingType Type { get; init; }

Property Value

ClothingType

Methods

DequipItem()

Set the item to be equipped as none, effectively dequipping the existing clothing.

public void DequipItem()

TryChangeItem(Page, byte, byte)

Set the item that is being equipped.

public bool TryChangeItem(Page page, byte x, byte y)

Parameters

page Page
x byte
y byte

Returns

bool

true if the selected item exists and it's type matches the clothing type required, otherwise false.