Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CharacterSettingsSetActiveUiProfile

From RoR Wiki

Switches the current character to another UI profile.

CharacterSettingsSetActiveUiProfile(profile)

Arguments

profile
wstring – The profile to switch to. The stock UI passes the profile name for profiles the character owns and the profile path for profiles owned by another character (fields from CharacterSettingsGetData).

Returns

Nothing.

Details

  • The call only stores the request. The client carries out the switch afterwards, outside the Lua call.
  • The stock UI asks the player to confirm first, with a prompt that tells them the interface will reload.
  • Passing an ordinary Lua string raises an Invalid Parameters error.

Errors

None besides the generic Invalid Parameters message when the argument is not a wide string.

Example

From ea_uiprofileswindow/source/manageuiprofileswindow.lua:

if( profileData.isOwnedByActiveCharacter )
then
    EA_Window_ManageUiProfiles.switchToProfileName = EA_Window_ManageUiProfiles.GetSelectedProfileData().name
else
    EA_Window_ManageUiProfiles.switchToProfileName = EA_Window_ManageUiProfiles.GetSelectedProfileData().path
end
-- (reload prompt) ...

function EA_Window_ManageUiProfiles.OnSwitchReloadPromptOkay()

    local name = EA_Window_ManageUiProfiles.switchToProfileName
    EA_Window_ManageUiProfiles.switchToProfileName = L""
    CharacterSettingsSetActiveUiProfile(name)

end

See also