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–trueto turn the advisor preference on,falseto 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.
isAdvisormust be a real boolean. Passingnilor 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
