Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SetAdvisorFlag

From RoR Wiki

UI Lua API · Interface functions
Version: WAR 1.4.8

Sends the player's "advisor" preference to the server.

SetAdvisorFlag(isAdvisor)

Arguments

isAdvisor
boolean – true to turn the advisor preference on, false to turn it off.

Returns

Nothing.

Details

  • The client sends a social-network request with the new value to the server. Nothing is sent if the client's network connection is not ready.
  • The value returned by GetAdvisorFlag is not changed by this call itself; the function only sends the request.
  • isAdvisor must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least one argument and only reads the last one.
  • The stock UI calls it from the "advisor" check box on the Options tab of the social window.

Errors

None besides the Invalid Parameters argument check.

Example

From ea_socialwindow/source/socialwindowtaboptions.lua:

function SocialWindowTabOptions.OnPressAdvisorButton()
    local buttonState = ButtonGetPressedFlag( "SocialWindowTabOptionsAdvisorPreference" )
    SetAdvisorFlag(buttonState)
end

See also