API:SetDesiredInteractAction
From RoR Wiki
UI Lua API · Interact functions
Version: WAR 1.4.8
Sets the "desired interact action": the special cursor mode such as repair or salvage.
SetDesiredInteractAction(action)
Arguments
- action
number– The new action, aSystemData.InteractActionsvalue. Must be 0–13.
Returns
Nothing useful. See Details.
Details
- Values outside 0–13 are ignored and the current action is kept. No error is raised.
- The client uses the value to choose the mouse cursor and when the player targets something. Read it back with GetDesiredInteractAction.
- When the value is accepted, the function reports one return value without pushing one, so the call returns the
actionargument back to the caller. When the value is rejected, it returns nothing. Do not rely on this. - Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From default/ea_craftingwindow/source/salvagingwindow.lua:
SetDesiredInteractAction( SystemData.InteractActions.SALVAGE )
From default/ea_cursor/source/cursor.lua:
if GetDesiredInteractAction() ~= SystemData.InteractActions.NONE then
SetDesiredInteractAction( SystemData.InteractActions.NONE )
