Skip to content

HudEvents beta ​

Interface of @v12-engine/client

ts
export interface HudEvents

What happens on the HUD, as events (client.hud.on(name, listener)): for code that does something when it happens (a sound when a hero levels, a flash when an ability is ready, a hint when supply runs out) rather than draws what is. What is, is the model (client.ui), read and followed (watch, snapshot, useHud). Each is worked out from the model as it changes, and only while someone listens to it

Members ​

abilityReady ​

ts
abilityReady: {
        hero: number;
        ability: string;
        name: string;
    };

An ability of the hero whose panel is up came off its cooldown

dayPhase ​

ts
dayPhase: {
        night: boolean;
    };

Night fell, or day broke

heroDied ​

ts
heroDied: {
        hero: number;
        name: string;
    };

One of the player's heroes fell

heroLevel ​

ts
heroLevel: {
        hero: number;
        name: string;
        level: number;
    };

One of the player's heroes reached a level

heroRevived ​

ts
heroRevived: {
        hero: number;
        name: string;
    };

One of the player's heroes came back

idleWorkers ​

ts
idleWorkers: {
        count: number;
    };

The count of workers with nothing to do changed

points ​

ts
points: {
        hero: number;
        name: string;
        points: number;
    };

One of the player's heroes has more points to spend than it had

resources ​

ts
resources: {
        amounts: readonly ResourceAmount[];
    };

What the player has changed: every resource, as the bar shows them

selection ​

ts
selection: {
        ids: readonly number[];
    };

What is selected changed: who, in the HUD's order

subgroup ​

ts
subgroup: {
        type: string | undefined;
    };

The type the card is about changed (Tab, a chip): none for nothing selected

supplyCapped ​

ts
supplyCapped: {
        used: number;
        cap: number;
    };

The player's supply ran out: as much is used as there is