CommandButton beta
Interface of @v12-engine/client
export interface CommandButtonA button of the command card
Members
ability
ability?: {
id: string;
caster: number;
level: number;
};An ability's button: which, whose and at what level, for its tooltip (see client.abilityTip)
action
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
active?: boolean;The command is waiting for a target
autocast
autocast?: boolean;Whether units use it on their own. Undefined for what cannot be automated
callings
callings?: CallingTag[];What it trains or hires is a hero: its callings, strongest first, for the tooltip (HeroDef.callings)
charges
charges?: number;Uses left, of an ability with charges (AbilityDef.charges): the number in its corner
cooldown
cooldown?: number;Part of the cooldown that is still to go, 0..1
cost
cost?: Cost;What it costs the player to use it (Cost)
description
description?: string;What the command does, in words, for its tooltip
disabled
disabled?: boolean;Whether the button cannot be pressed now
hotkey
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
icon?: string;Its picture (IconSet.commands); the HUD draws its own where none is given
id
id: string;The button's id: attack, train:footman
keys
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
label: string;The words on the button, as its tooltip and its name show them
mana
mana?: number;Mana one use takes
passive
passive?: boolean;Always on, not something to press
pending
pending?: boolean;Pressed, and the simulation has not answered yet: over a network, a moment
refusal
refusal?: string;Why it cannot be used right now, in the words of the game: told when it is pressed all the same
slot
slot: number;Position in the 4x3 card, left to right, top to bottom. -1 when the card had no room left for it
stock
stock?: number;How many a shop has left
supply
supply?: number;Supply (food) it takes up