ActionButtonGroup

The ActionButtonGroup specialized window element that optimizes the draw performance on the Warhammer style action buttons.  This window element takes a number of templates that comprise a single action button and combines can generate any number or rows/cols of that button that draw with a constant number of draw calls.

Summary
ActionButtonGroupThe ActionButtonGroup specialized window element that optimizes the draw performance on the Warhammer style action buttons.
Implementation DetailsAn ActionButtonGroup is comprised of the following elements.
XML DefinitionThis is the ActionButtonGroup xml definition.
XML Tag
Required Attributes
Optional Attributes
numrowsThe number of rows of buttons to be created.
numcolsThe number of columns of buttons to be created.
Elements
ActionButtonDefsThis contains the template information for all of the button components.
ButtonSpacingThe spacing to be used between each button
Window CallbacksThese are the ActionButtonGroup specific callback events.
Callbacks
OnActionButtonLButtonDownCalled when the user presses the left button down over a button.
OnActionButtonLButtonUpCalled when the user releases the left button over a button.
OnActionButtonRButtonDownCalled when the user presses the right button over a button.
OnActionButtonRButtonUpCalled when the user releases the right button over a button.
OnActionButtonMouseOverCalled when the user mouses over an action button.
OnActionButtonMouseOverEndCalled when the user moves the mouse cursof off of an action button.
Constants
Constants
Time Formats
Functions
Functions
ActionButtonGroupSetIcon()Sets the icon for the specified button index
Functions
Functions
ActionButtonGroupSetText()Sets the text for the specified button index
Functions
Functions
ActionButtonGroupSetTimer()Sets the text for the specified button index
ActionButtonGroupSetGameActionTrigger()Associates a a key-bindable action to clicking a button in this group.
ActionButtonGroupSetGameActionData()Associates a game action (a key-bindable action) to clicking on this window.
ActionButtonGroupSetTintColor()Associates a game action (a key-bindable action) to clicking on this window.
ActionButtonGroupSetNumButtons()Sets the number of rows & columns in this ActionButtonGroup.
ActionButtonGroupSetTimeFormat()Sets the time format to use for the ActionButtonGroup.
ActionButtonGroupSetTimeAbbreviations()Sets the time abbreviations for the ActionButtonGroup.

Implementation Details

Elements

An ActionButtonGroup is comprised of the following elements.

  • A Button Definiton for the core button artwork.  The Size of each button is determined by the size of the definition.
  • A Label Definition for the text of the button.  The ActionButtonGroup use the label’s anchors to calcuate its position relative to the Button.
  • A Label Definition for a countdownTimer.  The ActionButtonGroup use the label’s anchors to calcuate its position relative to the Button.
  • A DynamicImage definition that provides the size, location, and coordinate information for the icon.
  • A DynamicImage or AnimatedImage definition that provides the size, location, and coordinate information for the cooldown.

The ActionButtonGroup creates a dummy window for each button that can be used for tooltip anchoring.  These dummy windows are named in the format of “ActionButtonGroupWindowButtonX”, where X is the button index.

XML Definition

This is the ActionButtonGroup xml definition.

Summary
XML Tag
Required Attributes
Optional Attributes
numrowsThe number of rows of buttons to be created.
numcolsThe number of columns of buttons to be created.
Elements
ActionButtonDefsThis contains the template information for all of the button components.
ButtonSpacingThe spacing to be used between each button

XML Tag

<ActionButtonGroup>
....
</ActionButtonGroup>

Required Attributes

  • none

Optional Attributes

numrows

The number of rows of buttons to be created.

Expects

A number value.

Default Value

  • 0

Notes

  • none

numcols

The number of columns of buttons to be created.

Expects

A number value.

Default Value

  • 0

Notes

  • none

Elements

ActionButtonDefs

This contains the template information for all of the button components.

Syntax

<ActionButtonDefs>
<ButtonDef templateName="DefaultTimerButton" />
<TextDef templateName="BackpackWindowEquipmentButtonTextTemplate" />
<TimerDef templateName="BackpackWindowEquipmentButtonTimerTemplate" />
<IconDef templateName="EquipmentIconDef" />
<CooldownDef templateName="BackpackWindow2ButtonGroupCooldownDef" />
</ActionButtonDefs>
ButtonDefA Button Definiton for the core button artwork.
TextDefA Label Definition for the text of the button.
TimerDefA Label Definition for the timer text.
IconDefA DynamicImage Defintion for the Button’s Icon.
CooldownDefA DynamicImage Definition for the button’s cooldown image.

The size of each button is determined by the size of the button defintion.  The anchors of all of the other elements are used to position them relative to the button.  For example, anchoring the Text field to the topright of topright will anchor it to the topright corner of the button.

When a DynamicImage is used for the cooldown, it’s alpha faded over time.  The AnimatedImage has not yet been implemented.

Notes

  • none

ButtonSpacing

The spacing to be used between each button

Syntax

<ButtonSpacing x="0" y="0" />
xThe spacing between each column, defaults to 0
xThe spacing between each row, defaults to 0

Window Callbacks

These are the ActionButtonGroup specific callback events.

Summary
Callbacks
OnActionButtonLButtonDownCalled when the user presses the left button down over a button.
OnActionButtonLButtonUpCalled when the user releases the left button over a button.
OnActionButtonRButtonDownCalled when the user presses the right button over a button.
OnActionButtonRButtonUpCalled when the user releases the right button over a button.
OnActionButtonMouseOverCalled when the user mouses over an action button.
OnActionButtonMouseOverEndCalled when the user moves the mouse cursof off of an action button.

Callbacks

OnActionButtonLButtonDown

Called when the user presses the left button down over a button.

Syntax

SomeWindow.OnButtonLButtonDown( buttonIndex )

OnActionButtonLButtonUp

Called when the user releases the left button over a button.

Syntax

SomeWindow.OnButtonLButtonUp( buttonIndex )

OnActionButtonRButtonDown

Called when the user presses the right button over a button.

Syntax

SomeWindow.OnButtonRButtonDown( buttonIndex )

OnActionButtonRButtonUp

Called when the user releases the right button over a button.

Syntax

SomeWindow.OnButtonRButtonUp( buttonIndex )

OnActionButtonMouseOver

Called when the user mouses over an action button.

Syntax

SomeWindow.OnButtonMouseOver( buttonIndex )

OnActionButtonMouseOverEnd

Called when the user moves the mouse cursof off of an action button.

Syntax

SomeWindow.OnButtonMouseOverEnd( buttonIndex )

Constants

Constants

Time Formats

Window.TimeFormat.SECONDSDisplay the time in seconds.
Window.TimeFormat.LARGEST_UNIT_ROUNDUPDisplay the time in the highest tiem unit and round up.
Window.TimeFormat.LARGEST_UNIT_TRUNCATEDisplay the time in the highest tiem unit and truncate.
Window.TimeFormat.NUM_FORMATSThe number of time formats.

Functions

Summary
Functions
ActionButtonGroupSetIcon()Sets the icon for the specified button index

Functions

ActionButtonGroupSetIcon()

Sets the icon for the specified button index

Parameters

actionButtonGroupName(string) The name of the ActionButtonGroup.
buttonIndex(number) The index of the button you wish to set.
iconNum(number) The icon number you wish to use.

Returns

nil = no return value

Notes

  • none

Example

ActionButtonGroupSetIcon("BackpackWindowItems", itemSlot, item.iconNum )

Functions

Summary
Functions
ActionButtonGroupSetText()Sets the text for the specified button index

Functions

ActionButtonGroupSetText()

Sets the text for the specified button index

Parameters

actionButtonGroupName(string) The name of the ActionButtonGroup.
buttonIndex(number) The index of the button you wish to set.
text(wstring) The text you wish displayed on the button.

Returns

nil = no return value

Notes

  • none

Example

ActionButtonGroupSetText("BackpackWindowItems", 2, L"2" )

Functions

Summary
Functions
ActionButtonGroupSetTimer()Sets the text for the specified button index
ActionButtonGroupSetGameActionTrigger()Associates a a key-bindable action to clicking a button in this group.
ActionButtonGroupSetGameActionData()Associates a game action (a key-bindable action) to clicking on this window.
ActionButtonGroupSetTintColor()Associates a game action (a key-bindable action) to clicking on this window.
ActionButtonGroupSetNumButtons()Sets the number of rows & columns in this ActionButtonGroup.
ActionButtonGroupSetTimeFormat()Sets the time format to use for the ActionButtonGroup.
ActionButtonGroupSetTimeAbbreviations()Sets the time abbreviations for the ActionButtonGroup.

Functions

ActionButtonGroupSetTimer()

Sets the text for the specified button index

Parameters

actionButtonGroupName(string) The name of the ActionButtonGroup.
buttonIndex(number) The index of the button you wish to set.
maxTimer(number) The full duration of the timer.
remainingTimer(number) The time remaining on this timer.

Returns

nil = no return value

Notes

  • none

Example

ActionButtonGroupSetTimer("BackpackWindowItems", 2, 500, 450 )

ActionButtonGroupSetGameActionTrigger()

Associates a a key-bindable action to clicking a button in this group.

Parameters

windowName(string) Name of the window
buttonIndex(number) The index of the button you wish to set.
gameActionId(number) The keybinding action id to trigger when the window is clicked.

Returns

nilno return value.

Notes

none

Example

ActionButtonGroupSetGameActionTrigger( "SomeWindow", 1, 2 )

ActionButtonGroupSetGameActionData()

Associates a game action (a key-bindable action) to clicking on this window.

Parameters

windowName(string) Name of the window
buttonIndex(number) The index of the button you wish to set.
gameActionType(number) The Type of the action.
gameActionId(number) The id number of the action.
gameActionText(number) The text associated with the action.

Returns

nilno return value.

Notes

none

Example

ActionButtonGroupSetGameActionData( "SomeWindow", true, 2 )

ActionButtonGroupSetTintColor()

Associates a game action (a key-bindable action) to clicking on this window.

Parameters

windowName(string) Name of the window
buttonIndex(number) The index of the button you wish to set.
red(number) The red color value (0-255)
green(number) The green color value (0-255)
blue(number) The blue color value (0-255)

Returns

nilno return value.

Notes

none

Example

ActionButtonGroupSetTintColor( "SomeWindow", buttonIndex, 255, 255, 255 )

ActionButtonGroupSetNumButtons()

Sets the number of rows & columns in this ActionButtonGroup.

Parameters

windowName(string) The name of the ActionButtonGroup.
numRows(number) The number of rows of buttons.
numCols(number) The number of columns of buttons.

Returns

nil

Notes

If you change the total number of buttons (rows*cols), you must re-initialize all of your button data.  If the layout changes without changing the total number of buttons ( 10x1 to 1x10),

Example

ActionButtonGroupSetNumButtons( "WindowName", 10, 1 )

ActionButtonGroupSetTimeFormat()

Sets the time format to use for the ActionButtonGroup.

Parameters

windowName(string) The name of the ActionButtonGroup.
timeFormat(number) The format which the timers should appear in see the Window.TimeFormat constants.

Returns

nil

Example

ActionButtonGroupSetTimeFormat( "ActionButtonGroupWindowName", SystemData.ActionButtonGroupTimeFormats.TIMEFORMAT_SECONDS )

ActionButtonGroupSetTimeAbbreviations()

Sets the time abbreviations for the ActionButtonGroup.

Parameters

windowName(string) The name of the ActionButtonGroup.
days(wstring) The abbreviation to use for days.
hours(wstring) The abbreviation to use for hours.
minutes(wstring) The abbreviation to use for minutes.
seconds(wstring) The abbreviation to use for seconds.

Returns

nil

Example

ActionButtonGroupSetTimeAbbreviations( "ActionButtonGroupWindowName", L"d", L"h", L"m", L"s" )
The button element automates generic button functionality, such as swapping texture and font colors automatically according to mouse over and state.
The Label window element is the primary text-drawing element for the Interface.
The DynamicImage provides a rectangular shaped display for a texture.
The AnimatedImage automates flip-book style animations.