Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowSetGameActionData

From RoR Wiki

UI Lua API · Window functions
Version: WAR 1.4.8

Attaches a game action, such as targeting a player or using an ability, to a window.

WindowSetGameActionData(windowName, actionType, actionId, actionText)

Arguments

windowName
string – Name of the window.
actionType
number – The kind of action, a GameData.PlayerActions.* value. 0 removes the action.
actionId
number – The action's id, for example an ability id. Use 0 if the action does not need one.
actionText
wstring – Text for the action, for example the name of the player to target. Use L"" if not needed. It must be a wide string.

Returns

Nothing.

Details

  • Any action the window already has is removed first. If actionType is 0, no new action is attached, so WindowSetGameActionData(name, 0, 0, L"") clears the window.
  • actionType and actionId are truncated to whole numbers.
  • The stock UI relies on the client to carry out the action when the window is clicked. Its comments say so, for example "Targeting is handled by the WindowSetGameActionData() call." in ea_battlegrouphud/source/battlegrouphud.lua.
  • WindowGetGameActionData reads the values back.
  • Passing a plain Lua string as actionText raises an Invalid Parameters error.
  • The No window specified error exists in the client but cannot be raised: a missing name is replaced by an empty string first, which gives the does not exist error.

Errors

  • Error in function call 'WindowSetGameActionData': Window %s does not exist.
  • Error in function call 'WindowSetGameActionData': Window %s is currently locked and may not be modified from lua. ...
    This check never triggers in the current client. See WindowSetShowing.

Example

Clicking a group member's row targets that player, from eatemplate_unitframes/source/groupmemberunitframe.lua:

WindowSetGameActionData( self:GetName(), GameData.PlayerActions.SET_TARGET, 0, groupMemberName )

Setting and clearing an action button, from ea_actionbars/source/actionbutton.lua:

WindowSetGameActionData (actionName, actionType, actionId, L"")

if (actionType == 0 and actionId == 0)
then
    WindowSetGameActionData (actionName, 0, 0, L"")
    -- ...

See also