Skip to content

UiPipOverlay

The UiPipOverlay class renders floating "pip" indicators above entities — resource gain/loss numbers and damage numbers. Pips briefly appear at the entity's screen position and auto-remove after 500ms.

UiPipOverlay private

Extends UiComponent.

Properties

NameTypeDescription
uiUiCurrent Ui instance. Inherited from UiComponent.
componentElemHTMLElementThe root #hud-pip-overlay DOM element. Inherited from UiComponent.
resourceGainElemsRecord<number, HTMLElement>Map of IDs to active resource gain pip elements.
damageElemsRecord<number, HTMLElement>Map of IDs to active damage pip elements.
lastPlayerTickobjectCached previous player tick resource values.
lastPetWoodGainnumberLast pet wood gain, to avoid double-counting.
lastPetStoneGainnumberLast pet stone gain, to avoid double-counting.

Methods

constructor()

ts
function constructor(ui: Ui): void

Registers listeners for playerTickUpdate, playerDidDamage, petDidDamage, petGainedWood, and petGainedStone.

showResourceGain()

ts
function showResourceGain(uid: number, resourceName: string, value: number): void

Creates a floating pip showing the resource gain/loss above the entity. Filters values < 0.5. Auto-removes after 500ms.

showDamage()

ts
function showDamage(uid: number, value: number): void

Creates a floating damage pip above the target entity. Auto-removes after 500ms.

onPlayerTickUpdate()

ts
function onPlayerTickUpdate(playerTick: object): void

Computes resource deltas and shows pips. Excludes pet-attributed wood/stone gains.

onPlayerDidDamage()

ts
function onPlayerDidDamage(playerTick: object): void

Shows a damage pip on the player's last damage target.

onPetDidDamage()

ts
function onPetDidDamage(playerTick: object): void

Shows a damage pip on the pet's last damage target.

onPetGainedWood()

ts
function onPetGainedWood(petTick: { uid: number, woodGain: number }): void

Records pet wood gain and shows a pip on the pet.

onPetGainedStone()

ts
function onPetGainedStone(petTick: { uid: number, stoneGain: number }): void

Records pet stone gain and shows a pip on the pet.