API:WindowGetGameActionData
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Returns the game action attached to a window.
actionType, actionId, actionText = WindowGetGameActionData(windowName)
Arguments
- windowName
string– Name of the window.
Returns
- actionType
number– The kind of action, aGameData.PlayerActionsvalue.- actionId
number– The action's id, for example an ability id.- actionText
wstring– The action's text, for example the name of the player to target.
Details
- The values are the ones set with WindowSetGameActionData.
- If the window has no game action, nothing is returned, so all three variables are
nil. - If the window does not exist, the error is logged and nothing is returned.
- The function needs at least one argument and only reads the last one.
Errors
This is written to the UI log; the call returns normally.
Error in function call 'WindowGetGameActionData': Window %s does not exist.
Example
From ea_modifyitem/source/useitemtargeting.lua:
local actionType, actionId, actionText = WindowGetGameActionData( SystemData.MouseOverWindow.name ) if( actionType == GameData.PlayerActions.SET_TARGET ) then
