HudEvents beta
Interface of @v12-engine/client
export interface HudEventsWhat 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
abilityReady: {
hero: number;
ability: string;
name: string;
};An ability of the hero whose panel is up came off its cooldown
dayPhase
dayPhase: {
night: boolean;
};Night fell, or day broke
heroDied
heroDied: {
hero: number;
name: string;
};One of the player's heroes fell
heroLevel
heroLevel: {
hero: number;
name: string;
level: number;
};One of the player's heroes reached a level
heroRevived
heroRevived: {
hero: number;
name: string;
};One of the player's heroes came back
idleWorkers
idleWorkers: {
count: number;
};The count of workers with nothing to do changed
points
points: {
hero: number;
name: string;
points: number;
};One of the player's heroes has more points to spend than it had
resources
resources: {
amounts: readonly ResourceAmount[];
};What the player has changed: every resource, as the bar shows them
selection
selection: {
ids: readonly number[];
};What is selected changed: who, in the HUD's order
subgroup
subgroup: {
type: string | undefined;
};The type the card is about changed (Tab, a chip): none for nothing selected
supplyCapped
supplyCapped: {
used: number;
cap: number;
};The player's supply ran out: as much is used as there is