Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetSocialPreferenceData

From RoR Wiki

UI Lua API · Social functions
Version: WAR 1.4.8

Returns the player's social preference flags (anonymous, hidden, always form private groups, …).

flags = GetSocialPreferenceData()

Arguments

None.

Returns

flags
table – Eight booleans keyed 0–7, one per preference bit.

Details

  • The keys start at 0, not 1, so ipairs skips the first flag. Index the table directly.
  • The stock UI uses these keys (from SocialWindowTabOptions): 0 FLAG_ANONYMOUS, 1 FLAG_HIDDEN, 7 FLAG_ALWAYSFORMPRIVATEGRP. The other bits are not used by the stock UI.
  • The flags are the client's copy; the function does not contact the server. The stock UI changes the private party flag by sending the chat command /togglealwaysformprivate with SendChatText.

Errors

None.

Example

From default/ea_socialwindow/source/socialwindowtaboptions.lua:

local socialPreferenceData = GetSocialPreferenceData()
if( socialPreferenceData ~= nil ) then
    -- Set the Anonymous Flag
    ButtonSetPressedFlag( "SocialWindowTabOptionsAnonymousPreference", socialPreferenceData[SocialWindowTabOptions.FLAG_ANONYMOUS])
    -- Set the Hidden Flag
    ButtonSetPressedFlag( "SocialWindowTabOptionsHiddenPreference", socialPreferenceData[SocialWindowTabOptions.FLAG_HIDDEN])
    -- Set the Private Party Flag
    ButtonSetPressedFlag( "SocialWindowTabOptionsPrivatePartyPreference", socialPreferenceData[SocialWindowTabOptions.FLAG_ALWAYSFORMPRIVATEGRP])
end

See also