Skip to content

useHud beta ​

Function of @v12-engine/client/hud

ts
export declare function useHud(client: HudClient): {
    selection: Accessor<import("../../client/ui").SelectionItem[]>;
    subgroups: Accessor<SubgroupInfo[]>;
    activeSubgroup: Accessor<SubgroupInfo | undefined>;
    hero: () => import("../../client/ui").HeroPanelInfo | null;
    heroes: () => import("../../client/ui").HeroPortrait[];
    commands: Accessor<import("../../client/ui").CommandButton[]>;
    resources: Accessor<import("../../client/ui").ResourceInfo>;
    clock: Accessor<import("../../client/ui").ClockInfo | null>;
    title: Accessor<import("../../client/ui").HudTitle | null>;
    idleWorkers: Accessor<number>;
    groups: Accessor<import("../../client/ui").GroupInfo[]>;
    objectives: Accessor<import("../../client/ui").ObjectiveInfo[]>;
    stats: Accessor<import("../../client/ui").StatsShown>;
    focus: Accessor<HudFocus>;
    pickSubgroup(type: string): void;
    select(ids: number[], add?: boolean): void;
};

The HUD's model for a Solid component, read where it is used (client.ui's signals) and what is worked out of it: what the bottom is about (focus), the subgroup the card is about, and the moves a HUD makes (pickSubgroup, select). The client's own parts are made with it. Without Solid: client.ui.watch, client.ui.snapshot() and client.hud.on