API:CharacterSettingsCreateUiProfile
From RoR Wiki
UI Lua API · CharacterSettings functions
Version: WAR 1.4.8
Creates a new UI profile for the current character.
CharacterSettingsCreateUiProfile(profileName)
Arguments
- profileName
wstring– Name of the new profile. It must be a wide string.
Returns
Nothing.
Details
- The new profile is added to the current character's profile list, and the client fires
SystemData.Events.CHARACTER_SETTINGS_UPDATED. - If a profile with this name already exists, the error below is logged, but the call goes on and creates the profile anyway. Check the name first, as the stock UI does with its own
IsProfileNameInUsehelper. - The stock UI fills a new profile from a template with CharacterSettingsImportUiProfile right after creating it.
- Passing an ordinary Lua string raises an Invalid Parameters error.
Errors
Logged; the call does not stop:
ERROR Creating UI Profile '%s'. Profile name is already in use.
Example
From ea_uiprofileswindow/source/createuiprofilewindow.lua:
local profileName = EA_Window_UiProfileCreateEditBox.Text
-- Create the New Profile
CharacterSettingsCreateUiProfile( profileName )
-- Import if a template is specified.
if( m_template.name ~= nil )
then
CharacterSettingsImportUiProfile( profileName, m_template.path )
end
