Skip to main content

Shop2Vars

Namespace with shop-specific variables that are expected to mutate over the course of the (sub-)screens lifetime

Index

Variables

BuyItems

BuyItems: ShopItem[] = []

All (filtered) items that can still be bought

ClothesMode

ClothesMode: ShopClothesMode = "Clothes"

The current dressing state of the preview character

readonlyDefaults

Defaults: Readonly<{ BuyItems: any; ClothesMode: any; DropdownState: any; EquippedItem: any; Filters: any; Page: any; PreviewItems: any; Push: any; SellItems: any }>

Default values that should be restored to the container upon calling Reset

DropdownState

DropdownState: ShopDropdownState = ShopDropdownState.NONE

The currently active dropdown menu

EquippedItem

EquippedItem: Item = null

The item (if any) currently equipped in preview mode

Filters

Filters: Record<string, (item: ShopItem) => (Sell | Buy | Preview)[]> = {}

A record mapping filter ID to filter callbacks. Each callback is expected to return a list denoting for which modes the item is to-be shown. Note that an item will only be shown if the respective mode is included in the output list of every callback.

Page

Page: number = 0

The current page

PreviewItems

PreviewItems: ShopItem[] = []

All (filtered) items that can be equipped in preview mode

Push

Push: boolean = false

Whether any item has been bought or sold, thus requiring a push to the server

SellItems

SellItems: ShopItem[] = []

All (filtered) items that can still be sold

Functions

readonlyReset

  • Reset(): void
  • Returns void

Accessors

CurrentAssets

  • get CurrentAssets(): readonly ShopItem[]

Mode

PageCount

  • get PageCount(): number
  • Get the maximum number of pages for the current Shop2Vars.Mode.


    Returns number