API:CharacterSettingsGetOtherCharactersUsingProfile
From RoR Wiki
UI Lua API · CharacterSettings functions
Version: WAR 1.4.8
Returns the other characters that use one of the current character's shared UI profiles.
characters = CharacterSettingsGetOtherCharactersUsingProfile(profileName)
Arguments
- profileName
wstring– Name of a profile owned by the current character.
Returns
- characters
table– Array of character tables, indexed from 1. Nothing is returned when an error is logged (see below).
Each character table has these fields:
| Key | Type | Meaning |
|---|---|---|
serverName |
wstring |
Server of the character. |
characterName |
wstring |
Name of the character. |
Details
- The profile must exist for the current character and be owned by it. Otherwise an error below is logged and the function returns nothing.
- If the profile is not shared, the result is an empty table.
- For a shared profile, the client reads the other characters' settings files and lists those that use the profile.
- Passing an ordinary Lua string raises an Invalid Parameters error.
Errors
Logged; both name a different function, CharacterSettingsSetUiProfileShared:
ERROR in function call 'CharacterSettingsSetUiProfileShared': Profile name %s does not exist.ERROR in function call 'CharacterSettingsSetUiProfileShared': Profile %s is owned by another character.
Example
From ea_uiprofileswindow/source/characterdeletedhandler.lua:
-- If other characters are using this profile, we will need to export it.
local othersUsing = CharacterSettingsGetOtherCharactersUsingProfile( profileData.name )
if( othersUsing and othersUsing[1] )
then
table.insert( m_profilesToExport, { data=profileData, exportChars=othersUsing } )
end
