Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseTooltipPart

Base implementation of every tooltip part

Hierarchy

Index

Constructors

constructor

  • new BaseTooltipPart(root: any, entity: any, actionMapper: any): BaseTooltipPart
  • Parameters

    • root: any
    • entity: any
    • actionMapper: any

    Returns BaseTooltipPart

Methods

acquireKeybinding

  • acquireKeybinding(id: any): any
  • Fetches a keybinding and tracks it

    Parameters

    • id: any

    Returns any

addUpdateTask

  • addUpdateTask(task: any): void
  • Adds a new task to get executed every update tick

    Parameters

    • task: any

    Returns void

clearUpClickDetectorsAndKeybindings

  • clearUpClickDetectorsAndKeybindings(): void
  • Clears up all click detectors and keybindings

    Returns void

handleCleanup

  • handleCleanup(): void
  • Internal cleanup handler

    Returns void

handleTooltipClose

  • handleTooltipClose(): void
  • Callback when the tooltip got closed

    Returns void

handleUpdate

  • handleUpdate(): void
  • Can be used to update stuff like buttons which depend on how many crystals you have

    Returns void

helperInitDiv

  • helperInitDiv(className: any): void
  • Helper method to create the tooltip div

    Parameters

    • className: any

    Returns void

initialize

  • initialize(): void
  • Should initialize the part

    Returns void

onCleanup

  • onCleanup(): void
  • Cleanup callback, override to perform additional cleanupĆ¼ work

    Returns void

onStructureEnhanced

  • onStructureEnhanced(): void
  • Override if this tooltip part depends on the structures enhancements

    Returns void

onTooltipClosed

  • onTooltipClosed(): void
  • On close handler. Parts are not directly destroyed, only when the tooltip is finally hidden (after 500ms or so). However, this gets called when the tooltip was closed

    Returns void

parentTo

  • parentTo(parent: any): void
  • Appends the part to a given parent

    Parameters

    • parent: any

    Returns void

removeWholeContent

  • removeWholeContent(): void
  • Cleans up the whole div contents, also clears up keybindings

    Returns void

trackClicks

  • trackClicks(element: any, handler: any, args?: object): ClickDetector
  • Helper method to track clicks on an element

    Parameters

    • element: any
    • handler: any
    • Default value args: object = {}

    Returns ClickDetector

update

  • update(): void
  • Perform any per-frame updates here

    Returns void

Static getTargetComponent

  • getTargetComponent(): any
  • Returns any

Static shouldShowForEntity

  • shouldShowForEntity(entity: any, root?: any): any
  • Should return true if the part is active for the given entity

    Parameters

    • entity: any
    • Default value root: any = null

    Returns any