API:CharacterSettingsRenameUiProfile
From RoR Wiki
UI Lua API · CharacterSettings functions
Version: WAR 1.4.8
Renames one of the current character's UI profiles.
CharacterSettingsRenameUiProfile(oldName, newName)
Arguments
- oldName
wstring– Current name of the profile.- newName
wstring– New name.
Returns
Nothing.
Details
- The profile must exist for the current character and be owned by it. Otherwise an error below is logged and nothing is renamed.
- If another profile already uses
newName, an error is logged, but the call goes on and renames the profile anyway. Check the name first, as the stock UI does. - The profile's folder is renamed and the profile list is updated.
- If the profile is the active one, the client updates its active profile path and name and saves the character settings.
- The client then fires
SystemData.Events.CHARACTER_SETTINGS_UPDATED. - Both arguments must be wide strings. The function needs at least two arguments and only reads the last two.
Errors
Logged; the call does not raise a Lua error:
ERROR Renaming UI Profile '%s'. Profile does not exist for this character.ERROR Renaming UI Profile '%s' to '%s'. New Profile name is already in use.(the call continues)ERROR Removing UI Profile '%s'. You may not remove a profile owned by another character.(the rename uses the message of CharacterSettingsRemoveUiProfile)
Example
From ea_uiprofileswindow/source/renameuiprofilewindow.lua:
CharacterSettingsRenameUiProfile( m_selectedProfileName, profileName )
