Skip to content

CommandButton beta ​

Interface of @v12-engine/client

ts
export interface CommandButton

A button of the command card

Members ​

ability ​

ts
ability?: {
        id: string;
        caster: number;
        level: number;
    };

An ability's button: which, whose and at what level, for its tooltip (see client.abilityTip)

action ​

ts
action?: string;

The action whose keys it has (card.move, hero.ability.1), where it has one: the player puts it elsewhere by that name

active ​

ts
active?: boolean;

The command is waiting for a target

autocast ​

ts
autocast?: boolean;

Whether units use it on their own. Undefined for what cannot be automated

callings ​

ts
callings?: CallingTag[];

What it trains or hires is a hero: its callings, strongest first, for the tooltip (HeroDef.callings)

charges ​

ts
charges?: number;

Uses left, of an ability with charges (AbilityDef.charges): the number in its corner

cooldown ​

ts
cooldown?: number;

Part of the cooldown that is still to go, 0..1

cost ​

ts
cost?: Cost;

What it costs the player to use it (Cost)

description ​

ts
description?: string;

What the command does, in words, for its tooltip

disabled ​

ts
disabled?: boolean;

Whether the button cannot be pressed now

hotkey ​

ts
hotkey: string;

Its key, as shown: the character the player's keyboard makes where the key is. To a game that makes or edits a button (cardButtons, editCard) it is the key as written: the letter it is on a QWERTY keyboard

icon ​

ts
icon?: string;

Its picture (IconSet.commands); the HUD draws its own where none is given

id ​

ts
id: string;

The button's id: attack, train:footman

keys ​

ts
keys?: readonly Binding[];

The keys that press it, by their place: the player's own for it, those of its action, or where its hotkey is

label ​

ts
label: string;

The words on the button, as its tooltip and its name show them

mana ​

ts
mana?: number;

Mana one use takes

passive ​

ts
passive?: boolean;

Always on, not something to press

pending ​

ts
pending?: boolean;

Pressed, and the simulation has not answered yet: over a network, a moment

refusal ​

ts
refusal?: string;

Why it cannot be used right now, in the words of the game: told when it is pressed all the same

slot ​

ts
slot: number;

Position in the 4x3 card, left to right, top to bottom. -1 when the card had no room left for it

stock ​

ts
stock?: number;

How many a shop has left

supply ​

ts
supply?: number;

Supply (food) it takes up