Data/Buttons

## Buttons

### **Description**

Buttons are Data Types that allow a unit to perform commands within the command card. Usually they are linked to abilities and placed on units' command cards for use. When a player presses the button the orders defined by the command card section of the unit.

### Hints

* Buttons are used to allow a unit to use abilities, learn abilities, build structures, research upgrades etc.
* Buttons can be hidden or turned off using requirements.
* Buttons can be used to change the command card's page or submenu, and to come out of the page/submenu.
* Unlike most data types, buttons don't have any subtypes.
* Tooltip text can contain codes that reference certain field data so the text can stay true as upgrades occur. Colors may be added as well.

### **Example Usage**

#### **Ability Button**

The zergling's burrow button is found in the bottom right corner of the zergling's command card. It has a requirement to only allow use when the burrow ability has been researched. If a player has researched the burrow ability and clicks it via the zergling's command card, the zergling will morph(ability) into its burrowed counterpart. The burrowed counterpart has a button called unburrow which allows it to morph(ability) to its former self.

#### **Tooltip Text**

The sentry's Hallucination button tool tip text references the behavior duration through this code here *<d ref="Behavior,HallucinationTimedLife,Duration"/>*

## Fields Categories

### **(None):**

* **Charge Text:** Text that should appear instead or where the charge text usually is on a button.
* **Hotkey Toggle Unit:**
* **Placeholder:**
* **Tooltip Appender:** Text that displays below the Tooltip Text, for as long as its indexed validator is true (example: requires an upgrade in order to appear). It is suggested to space it first, as this text is straight next to the current text.
* **Tooltip Cooldown Override Text:**
* **Tooltip Resource Name:**
* **Tooltip Supply Name:**
* **Tooltip Time Override Abil Cmd:**
* **Tooltip Vital Name:**
* **Tooltip Vital Override Text:**
* **Use Hotkey Label:** Enables/Disables hotkeys for Inventory slots.

### **Editor**

* **Editor Categories:** Used to organize buttons in several categories available: None, Creep, Critter, Neutral, Protoss, Terran, Zerg.
* **Editor Comment:** Comments used to describe the button, only seen in the editor. Mostly used to explain to other editors of the map who may not understand.
* **Editor Description:** Description of the ability in the editor, used to explain to other editors of the map who may not understand.
* **Editor Prefix:** Prefix shown only in the Editor, useful for sorting.
* **Editor Suffix:** Suffix shown only in the Editor, useful for recognition.

### **UI**

* **Alert Icon:** Icon that appears in alerts that are played from abilities that use this button
* **Alert Name:** Name that appears in the alert tooltip.
* **Alert Tooltip:** Text for the alert tooltip
* **Default Button Layout:** Sets a location on the unit's command card which by default will override the current placement of this button.
* **Hides For Simple Text:** If this is checked/true, then the button will not be shown if the same row it occupies in the unit command card is being used to display simple text, i.e., on another button located on the same row. The "Hold Position", "Patrol" buttons present on most command cards have this enabled and are hidden by the "Move" and "Attack" button's simple text displays. If disabled, the Simple text will attempt to find another row.
* **Hotkey Alias:** Often used to associate a single hotkey entry with multiple buttons. Sharing the same Hotkey Alias allows buttons to treat their hotkey customizations as one, (i.e. changing one button's hotkey, automatically changes the others). This linking can be either: Per Unit (where the button's flag "UI: Universal" is NOT set), or across all units (UI: Universal flag ENABLED). SC2hotkey files store the IDs in the following format (with their special characters stripped): [Hotkey Alias]/[Unit] ...OR....(whenever the "UI: Universal" flag is set) simply: [Hotkey Alias]
* **Hotkey Set:** Used with toggle buttons (e.g. Cloak/Decloak, Burrow/Unburrow), where each button partner shares the same "Hotkey Set" identifier (e.g. "BurrowUnburrowModes"). Tip: Hotkey Set identifiers can be reused. Useful when creating similar sets of toggle buttons that appear on completely different units.
* **Hotkey:** Key used to press the button, alternative to mouse click.
* **Icon:** The .dds file texture used as the icon of the button found on command cards and editor trees.
* **Name:** Name of the Button.
* **Simple Display Text:** In Options/Gameplay, there is a setting called "Enable Simple Command Card", which hides buttons, allowing this field to override the row with its text. This option will attempt to find a suitable row with all buttons being set to "Hides For Simple Text". If no row is found, this function will concede. Does not display if the button is being hidden by another button on the command card. The button requires to be on top (on the unit's command card) and requires to be an ability command (Passive Buttons don't seem to work). Use this knowledge in situations which new abilities should be displayed, and you want to hide the simple text (since upgrades still doesn't support this field, or it can't be shut down manually).
* **Tint By Race:** Button icon will be tinted by race regardless of icon. Terran: Green, Protoss: Blue, Zerg: Orange. This is splitting icons from similar ones, or for some of them that are only black and white, which gives them a little more coloration.
* **Tooltip Flags +:** Flags used to disable or enable certain data seen in the button's tooltip. Ex. Unchecking "Show Name" will remove the name of the button from the tooltip.
* **Tooltip Image:** Image that shows on the tooltip when the player hovers their mouse over the button.
* **Tooltip:** Tooltip of the button, used to describe the uses of the button, found when a player hovers over the button.
* **Universal:** (Unknown)