Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Ui

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Ui(): Ui
  • Returns Ui

Properties

screenInGame

screenInGame: InGameScreen

Accessors

visibleMenu

  • Returns the visible menu (top of the chain)

    Returns MenuId

visibleScreen

  • get visibleScreen(): ScreenId | undefined
  • The ID of the visible screen

    Returns ScreenId | undefined

Methods

addButton

  • addButton(translationId: string, imagePath: string, keyBind?: number): JQuery
  • Parameters

    • translationId: string
    • imagePath: string
    • Optional keyBind: number

    Returns JQuery

addItemToContainer

  • addItemToContainer(item: IItem, container: IContainer, internal?: boolean, isAddingMultipleItems?: boolean): void
  • Parameters

    • item: IItem
    • container: IContainer
    • Default value internal: boolean = false
    • Default value isAddingMultipleItems: boolean = false

    Returns void

afterAddingMultipleItemsToContainer

  • afterAddingMultipleItemsToContainer(container: IContainer): void

appendStyle

  • appendStyle(id: string, styleContent: string): void
  • Parameters

    • id: string
    • styleContent: string

    Returns void

backOneMenu

  • backOneMenu(args?: object, transition?: boolean): Promise<void>
  • Returns to the previous menu

    Parameters

    • Optional args: object
      • [key: string]: any
    • Default value transition: boolean = true

    Returns Promise<void>

backToFirstMenu

  • backToFirstMenu(args?: object, transition?: boolean): Promise<void>
  • Returns to the first menu in the menuChain

    Parameters

    • Optional args: object
      • [key: string]: any
    • Default value transition: boolean = true

    Returns Promise<void>

cancel

  • cancel(events: string | number | Array<string | number>, cb?: function): void
  • Parameters

    • events: string | number | Array<string | number>
    • Optional cb: function
        • (emitter: this, ...data: any[]): any
        • Parameters

          • emitter: this
          • Rest ...data: any[]

          Returns any

    Returns void

cancelAll

  • cancelAll(): void

changeEquipmentOption

  • changeEquipmentOption(id: string): void

closeAllContainers

  • closeAllContainers(): void

closeContainer

closeDialog

  • closeDialog(dialog: JQuery): boolean
  • Parameters

    • dialog: JQuery

    Returns boolean

closeMapDialog

  • closeMapDialog(): void

createDialog

  • createDialog(container: JQuery, dialogInfo: IDialogInfo): JQuery

displayChatMessage

  • displayChatMessage(player: IPlayer, message: string): void

displayHint

  • displayHint(player: IPlayer | undefined, hintType: HintType, force?: boolean): boolean
  • Parameters

    • player: IPlayer | undefined
    • hintType: HintType
    • Default value force: boolean = false

    Returns boolean

displayMessage

displayMessagePack

dumpTooltip

  • Removes the current tooltip

    Parameters

    • Optional source: IUiElement

      The element the tooltip must be for to remove it

    Returns Promise<void>

getBody

  • getBody(): JQuery
  • Returns JQuery

getCurrentHint

getDialogInfo

getHeight

  • getHeight(): number
  • Returns number

getInventoryItemOrder

  • getInventoryItemOrder(): any[]

getMaximumScale

  • getMaximumScale(): number
  • Returns the maximum scale the screen size will allow (multiplier)

    Returns number

getMenu

  • getMenu(): Menu | undefined
  • getMenu(menuId: MenuId): Menu | undefined
  • Returns Menu | undefined

  • Parameters

    Returns Menu | undefined

getMessageCount

  • getMessageCount(): number

getMessageHtml

  • Parameters

    • messagePack: IMessagePack
    • Default value tag: string = "p"
    • Default value textCase: SentenceCaseStyle = SentenceCaseStyle.None
    • Default value log: boolean = true
    • Optional addedClass: string

    Returns string

getScreen

  • getScreen(): UiScreen | undefined
  • getScreen(screenId: ScreenId): UiScreen | undefined
  • Returns the visible screen, or undefined if no screen is visible.

    Returns UiScreen | undefined

  • Parameters

    • screenId: ScreenId

      The ID of the screen to return. If this screen is not initialized, returns undefined.

    Returns UiScreen | undefined

getSerializationProperties

  • getSerializationProperties(_: string): string[]

getText

  • Returns the current translation of the given textOrTranslationData

    Parameters

    Returns string

getWidth

  • getWidth(): number
  • Returns number

hideActionsMenu

  • hideActionsMenu(): void

hideContextMenu

  • hideContextMenu(): void

hideHelpScreen

  • hideHelpScreen(): void

hideLoadingInterrupt

  • hideLoadingInterrupt(): Promise<void>

hideMenu

  • hideMenu(): Promise<void>
  • Hides the current menu and resets the menu chain

    Returns Promise<void>

hideScreen

  • hideScreen(screen?: ScreenId | IUiScreen): Promise<void>
  • Hides the current screen

    Parameters

    • Default value screen: ScreenId | IUiScreen = this._visibleScreen

    Returns Promise<void>

hideTooltip

  • Hides the current tooltip

    Parameters

    • Optional source: IUiElement

      The element the tooltip must be for to hide it

    Returns Promise<void>

highlight

  • highlight(selectors?: string[] | undefined, onlyFirstElement?: boolean, timeout?: number): void
  • Parameters

    • Optional selectors: string[] | undefined
    • Default value onlyFirstElement: boolean = true
    • Default value timeout: number = 10000

    Returns void

initialize

  • initialize(): void
  • Returns void

initializeGameState

  • initializeGameState(): void

interruptWithChoice

interruptWithConfirmation

interruptWithInfo

interruptWithInput

interruptWithMenu

  • interruptWithMenu(menuId: MenuId, args?: object): Promise<void>
  • Parameters

    • menuId: MenuId
    • Optional args: object
      • [key: string]: any

    Returns Promise<void>

isContainerOpen

isContextMenuOpen

  • isContextMenuOpen(): boolean

isHelpOverlayEnabled

  • isHelpOverlayEnabled(): boolean

isHelpOverlayShown

  • isHelpOverlayShown(): boolean

isInGameScreenShown

  • isInGameScreenShown(): boolean

isOptionsOverlayEnabled

  • isOptionsOverlayEnabled(): boolean

isOptionsOverlayShown

  • isOptionsOverlayShown(): boolean

isScreenVisible

  • isScreenVisible(screenId: ScreenId): boolean
  • Parameters

    • screenId: ScreenId

    Returns boolean

loadQuickSlots

  • loadQuickSlots(): void

messageIdToText

  • messageIdToText(message: Message): string

on

  • on(events: string | number | Array<string | number>, cb: function): this
  • Parameters

    • events: string | number | Array<string | number>
    • cb: function
        • (emitter: this, ...data: any[]): any
        • Parameters

          • emitter: this
          • Rest ...data: any[]

          Returns any

    Returns this

onBindLoop

onGameEnd

  • onGameEnd(showBlocker: boolean): void
  • Parameters

    • showBlocker: boolean

    Returns void

onMove

  • onMove(): void
  • Returns void

onUpdateDirection

  • onUpdateDirection(): void

onWindowResize

  • onWindowResize(): void

once

  • once(event: string | number, cb: function): this
  • Parameters

    • event: string | number
    • cb: function
        • (emitter: this, ...data: any[]): any
        • Parameters

          • emitter: this
          • Rest ...data: any[]

          Returns any

    Returns this

openBookDialog

  • openBookDialog(title: string, content: string): void
  • Parameters

    • title: string
    • content: string

    Returns void

openContainer

  • openContainer(container: IContainer, containerName?: string): void
  • Parameters

    • container: IContainer
    • Optional containerName: string

    Returns void

openDialog

  • openDialog(dialog: JQuery): boolean
  • Parameters

    • dialog: JQuery

    Returns boolean

openDialogs

  • openDialogs(): void
  • Returns void

openMapDialog

  • openMapDialog(): void

playActivateSound

  • playActivateSound(): void
  • Plays the "click" sound effect, used for most interface interactions

    Returns void

playClickSound

  • playClickSound(): void

playSelectSound

  • playSelectSound(): void
  • Plays the "select" sound effect, used for selecting things in the interface

    Returns void

refreshAttributes

  • refreshAttributes(): void

refreshButtonTooltip

  • refreshButtonTooltip(button: JQuery): void
  • Parameters

    • button: JQuery

    Returns void

refreshQuickSlots

  • refreshQuickSlots(): void

refreshStats

  • refreshStats(): void

refreshTranslations

  • refreshTranslations(...elements: Array<HTMLElement | UiElement>): void
  • Parameters

    • Rest ...elements: Array<HTMLElement | UiElement>

      The elements to refresh translations inside

    Returns void

refreshWorldTooltips

  • refreshWorldTooltips(): void

removeButton

  • removeButton(button: JQuery): void
  • Parameters

    • button: JQuery

    Returns void

removeItemFromContainer

removeItemFromEquipSlot

  • removeItemFromEquipSlot(equip: EquipType): void

removeItemFromQuickSlot

  • removeItemFromQuickSlot(itemId: number): void

removeOldestMessage

  • removeOldestMessage(): void

removeScreen

  • removeScreen(screenId: ScreenId): Promise<void>
  • Parameters

    • screenId: ScreenId

    Returns Promise<void>

removeStyle

  • removeStyle(id: string): void
  • Parameters

    • id: string

    Returns void

resetHelpHeight

  • resetHelpHeight(): void

setCheckboxValue

  • setCheckboxValue(element: JQuery, id: string, checked: boolean): void
  • Parameters

    • element: JQuery
    • id: string
    • checked: boolean

    Returns void

setCurrentHint

  • setCurrentHint(hintType: HintType): void

setDialogOpacity

  • setDialogOpacity(opacity?: number, save?: boolean): void
  • Parameters

    • Default value opacity: number = saveDataGlobal.options.dialogOpacity * 100
    • Default value save: boolean = true

      Whether or not to save the new scale into options. Defaults to true.

    Returns void

setEquipSlot

  • setEquipSlot(equip: EquipType, itemId: number, internal?: boolean): void
  • Parameters

    • equip: EquipType
    • itemId: number
    • Default value internal: boolean = false

    Returns void

setFontStyle

  • setFontStyle(): void

setObjectUrl

  • setObjectUrl(objectUrl: string): void
  • Parameters

    • objectUrl: string

    Returns void

setQuickSlot

  • setQuickSlot(quickSlot: number, itemId: number, internal?: boolean): void
  • Parameters

    • quickSlot: number
    • itemId: number
    • Default value internal: boolean = false

    Returns void

setScale

  • setScale(scale: number, save?: boolean): void
  • Parameters

    • scale: number
    • Default value save: boolean = true

      Whether or not to save the new scale into options. Defaults to true.

    Returns void

setVersionExtra

  • setVersionExtra(msg: string): void
  • Parameters

    • msg: string

    Returns void

setupButtons

  • setupButtons(): void

setupItemBackgrounds

  • setupItemBackgrounds(): void

shakeStat

shouldRefreshMods

  • shouldRefreshMods(): boolean

showLoadingInterrupt

showMenu

  • showMenu(menuId: MenuId, transition?: boolean, args?: object, loadingInterrupt?: InterruptOptions): Promise<void>
  • Shows a menu

    Parameters

    • menuId: MenuId

      The id of the menu to show

    • Default value transition: boolean = true

      Whether or not to transition the menu in

    • Optional args: object

      Any arguments to provide the menu before it shows

      • [key: string]: any
    • Optional loadingInterrupt: InterruptOptions

    Returns Promise<void>

showOptionsScreen

  • showOptionsScreen(): Promise<void>

showScreen

  • showScreen(screenId: ScreenId, transition?: boolean, replaceCurrent?: boolean, ...args: any[]): Promise<void>
  • Shows a screen

    Parameters

    • screenId: ScreenId

      The id of the screen to show

    • Default value transition: boolean = true

      Whether or not to transition the screen in

    • Default value replaceCurrent: boolean = true

      Defaults to true. If the current screen is not replaced, the new screen will render above the old.

    • Rest ...args: any[]

    Returns Promise<void>

showTooltip

  • Shows a tooltip

    Parameters

    • tooltip: TooltipOptionsVague

      The options with which to construct the tooltip

    • Optional source: UiElement
      The source element that the tooltip is for.
      If there currently exists a tooltip for this element, it shows the old instead of creating a new tooltip.
      

    Returns Promise<void>

  • Shows a tooltip

    Parameters

    • elementWithTooltip: UiElement
      The element the tooltip is for, that contains the options with which to construct the tooltip.
      

    Returns Promise<void>

switchToScreen

  • switchToScreen(screenId: ScreenId, menuId?: MenuId, ...args: any[]): void

toggleDialog

  • toggleDialog(dialog: JQuery): boolean
  • Parameters

    • dialog: JQuery

    Returns boolean

toggleFullscreen

  • toggleFullscreen(): void
  • toggleFullscreen(fullscreen?: boolean): void
  • Toggles fullscreen

    Returns void

  • Parameters

    • Optional fullscreen: boolean

      Whether or not fullscreen is enabled

    Returns void

toggleHelp

  • toggleHelp(): void
  • Returns void

toggleOptions

  • toggleOptions(): void

toggleUIDisplay

  • toggleUIDisplay(): void

tooltipRefresh

  • tooltipRefresh(): void

trigger

  • trigger(event: string | number, ...data: any[]): Promise<any[]>
  • Parameters

    • event: string | number
    • Rest ...data: any[]

    Returns Promise<any[]>

updateCraftingDialog

  • updateCraftingDialog(craftableItemTypes: ItemType[], nonCraftableItemTypes: ItemType[]): void

updateDismantleTab

updateInventorySort

  • updateInventorySort(): void

updateItem

  • updateItem(item: IItem): void
  • Parameters

    Returns void

updateMilestonesDialog

  • updateMilestonesDialog(): void

updateScrollableContainer

  • updateScrollableContainer(this: Element): void

updateScrollableContainersList

  • updateScrollableContainersList(): void

updateSkillsDialog

  • updateSkillsDialog(): void

waitUntil

  • waitUntil(event: string | number): Promise<Object>

Generated using TypeDoc