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.
ActionButtonGroup | The ActionButtonGroup specialized window element that optimizes the draw performance on the Warhammer style action buttons. |
Implementation Details | An ActionButtonGroup is comprised of the following elements. |
XML Definition | This is the ActionButtonGroup xml definition. |
XML Tag | |
Required Attributes | |
Optional Attributes | |
numrows | The number of rows of buttons to be created. |
numcols | The number of columns of buttons to be created. |
Elements | |
ActionButtonDefs | This contains the template information for all of the button components. |
ButtonSpacing | The spacing to be used between each button |
Window Callbacks | These are the ActionButtonGroup specific callback events. |
Callbacks | |
OnActionButtonLButtonDown | Called when the user presses the left button down over a button. |
OnActionButtonLButtonUp | Called when the user releases the left button over a button. |
OnActionButtonRButtonDown | Called when the user presses the right button over a button. |
OnActionButtonRButtonUp | Called when the user releases the right button over a button. |
OnActionButtonMouseOver | Called when the user mouses over an action button. |
OnActionButtonMouseOverEnd | Called 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. |
An ActionButtonGroup is comprised of the following elements.
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.
This is the ActionButtonGroup xml definition.
XML Tag | |
Required Attributes | |
Optional Attributes | |
numrows | The number of rows of buttons to be created. |
numcols | The number of columns of buttons to be created. |
Elements | |
ActionButtonDefs | This contains the template information for all of the button components. |
ButtonSpacing | The spacing to be used between each button |
This contains the template information for all of the button components.
<ActionButtonDefs>
<ButtonDef templateName="DefaultTimerButton" />
<TextDef templateName="BackpackWindowEquipmentButtonTextTemplate" />
<TimerDef templateName="BackpackWindowEquipmentButtonTimerTemplate" />
<IconDef templateName="EquipmentIconDef" />
<CooldownDef templateName="BackpackWindow2ButtonGroupCooldownDef" />
</ActionButtonDefs>
ButtonDef | A Button Definiton for the core button artwork. |
TextDef | A Label Definition for the text of the button. |
TimerDef | A Label Definition for the timer text. |
IconDef | A DynamicImage Defintion for the Button’s Icon. |
CooldownDef | A 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.
The spacing to be used between each button
<ButtonSpacing x="0" y="0" />
x | The spacing between each column, defaults to 0 |
x | The spacing between each row, defaults to 0 |
These are the ActionButtonGroup specific callback events.
Callbacks | |
OnActionButtonLButtonDown | Called when the user presses the left button down over a button. |
OnActionButtonLButtonUp | Called when the user releases the left button over a button. |
OnActionButtonRButtonDown | Called when the user presses the right button over a button. |
OnActionButtonRButtonUp | Called when the user releases the right button over a button. |
OnActionButtonMouseOver | Called when the user mouses over an action button. |
OnActionButtonMouseOverEnd | Called when the user moves the mouse cursof off of an action button. |
Called when the user presses the left button down over a button.
SomeWindow.OnButtonLButtonDown( buttonIndex )
Called when the user releases the left button over a button.
SomeWindow.OnButtonLButtonUp( buttonIndex )
Called when the user presses the right button over a button.
SomeWindow.OnButtonRButtonDown( buttonIndex )
Called when the user releases the right button over a button.
SomeWindow.OnButtonRButtonUp( buttonIndex )
Called when the user mouses over an action button.
SomeWindow.OnButtonMouseOver( buttonIndex )
Called when the user moves the mouse cursof off of an action button.
SomeWindow.OnButtonMouseOverEnd( buttonIndex )
Functions | |
ActionButtonGroupSetIcon() | Sets the icon for the specified button index |
Sets the icon for the specified button index
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. |
nil = no return value
ActionButtonGroupSetIcon("BackpackWindowItems", itemSlot, item.iconNum )
Functions | |
ActionButtonGroupSetText() | Sets the text for the specified button index |
Sets the text for the specified button index
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. |
nil = no return value
ActionButtonGroupSetText("BackpackWindowItems", 2, L"2" )
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. |
Sets the text for the specified button index
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. |
nil = no return value
ActionButtonGroupSetTimer("BackpackWindowItems", 2, 500, 450 )
Associates a a key-bindable action to clicking a button in this group.
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. |
nil | no return value. |
none
ActionButtonGroupSetGameActionTrigger( "SomeWindow", 1, 2 )
Associates a game action (a key-bindable action) to clicking on this window.
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. |
nil | no return value. |
none
ActionButtonGroupSetGameActionData( "SomeWindow", true, 2 )
Associates a game action (a key-bindable action) to clicking on this window.
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) |
nil | no return value. |
none
ActionButtonGroupSetTintColor( "SomeWindow", buttonIndex, 255, 255, 255 )
Sets the number of rows & columns in this ActionButtonGroup.
windowName | (string) The name of the ActionButtonGroup. |
numRows | (number) The number of rows of buttons. |
numCols | (number) The number of columns of buttons. |
nil
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),
ActionButtonGroupSetNumButtons( "WindowName", 10, 1 )
Sets the time format to use for the ActionButtonGroup.
windowName | (string) The name of the ActionButtonGroup. |
timeFormat | (number) The format which the timers should appear in see the Window.TimeFormat constants. |
nil
ActionButtonGroupSetTimeFormat( "ActionButtonGroupWindowName", SystemData.ActionButtonGroupTimeFormats.TIMEFORMAT_SECONDS )
Sets the time abbreviations for the ActionButtonGroup.
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. |
nil
ActionButtonGroupSetTimeAbbreviations( "ActionButtonGroupWindowName", L"d", L"h", L"m", L"s" )