API:CharacterSettingsSetActiveUiProfile
From RoR Wiki
UI Lua API · CharacterSettings functions
Version: WAR 1.4.8
Switches the current character to another UI profile.
CharacterSettingsSetActiveUiProfile(profile)
Arguments
- profile
wstring– The profile to switch to. The stock UI passes the profilenamefor profiles the character owns and the profilepathfor 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
