CombatTracker

CombatTracker

The sidebar directory which organizes and displays world-level Combat documents.

Constructor

new CombatTracker()

Extends

Members

(static) defaultOptions

_original :SidebarTab

Overrides:

Denote whether or not this is the original version of the sidebar tab, or a pop-out variant

Type:

(protected) _popout :SidebarTab

Overrides:

A reference to the pop-out variant of this SidebarTab, if one exists

Type:

combats :Array.<Combat>

Return an array of Combat encounters which occur within the current Scene.

Type:

tabName :string

Overrides:

The base name of this sidebar tab

Type:
  • string

viewed :Combat|null

Record the currently tracked Combat encounter

Type:

Methods

_onLazyLoadImage(entries, observer)

Overrides:

Handle lazy loading for sidebar images to only load them once they become observed

Parameters:
Name Type Description
entries Array.<HTMLElement>

The entries which are now observed

observer IntersectionObserver

The intersection observer instance

(async) _render()

Inherited From:

(async) _renderInner()

Inherited From:

activate()

Overrides:

Activate this SidebarTab, switching focus to it

activateListeners()

(async) close()

Inherited From:

createPopout() → {SidebarTab}

Overrides:

Create a second instance of this SidebarTab class which represents a singleton popped-out container

Returns:

The popped out sidebar tab instance

Type
SidebarTab

(async) getData()

initialize(combat, render)

Initialize the combat tracker to display a specific combat encounter. If no encounter is provided, the tracker will be initialized with the first encounter in the viewed scene.

Parameters:
Name Type Description
combat Combat | null

The combat encounter to initialize

render boolean

Whether to re-render the sidebar after initialization

(async) render()

Inherited From:

renderPopout()

Overrides:

Render the SidebarTab as a pop-out container

scrollToTurn()

Scroll the combat log container to ensure the current Combatant turn is centered vertically