API:CharacterSettingsGetData
From RoR Wiki
UI Lua API · CharacterSettings functions
Version: WAR 1.4.8
Returns the current character's UI profile settings: the active profile and the list of profiles the character can use.
characterSettings = CharacterSettingsGetData()
Arguments
None.
Returns
- characterSettings
table– A table with these fields:
| Key | Type | Meaning |
|---|---|---|
activeUiProfile |
wstring |
Name of the active UI profile. L"" when no profile is active.
|
isRunningDefaultUi |
boolean |
The "running the default UI" flag. CharacterSettingsClearRunningDefaultUiFlag clears it. |
uiProfiles |
table |
Array of profile tables, indexed from 1. |
Each profile table has these fields:
| Key | Type | Meaning |
|---|---|---|
server |
wstring |
Server name of the character that owns the profile. |
character |
wstring |
Name of the character that owns the profile. |
name |
wstring |
Profile name. |
path |
wstring |
Folder of the profile's files. The stock UI passes it to CharacterSettingsImportUiProfile and CharacterSettingsSetActiveUiProfile. |
isShared |
boolean |
true if the profile is shared with other characters. See CharacterSettingsSetUiProfileShared.
|
isOwnedByActiveCharacter |
boolean |
true if the current character owns the profile. Only owned profiles can be renamed, removed, exported or imported into.
|
lastUpdated |
table |
Last update time of the profile, with the number fields year, month, day, hour and minute.
|
Details
- A new table is built on every call.
- The
uiProfileslist contains the profiles known to the current character's settings. That includes shared profiles of other characters. CharacterSettingsGetAllUiProfiles lists the profiles of all characters instead. - While a character deletion is being handled (see CharacterSettingsHandleDeletedCharacter), the data is that of the character being deleted.
Errors
None.
Example
From ea_uiprofileswindow/source/characterdeletedhandler.lua:
local characterSettings = CharacterSettingsGetData()
-- Examine the Profiles data
for _, profileData in ipairs( characterSettings.uiProfiles )
do
if( profileData.isShared )
then
-- ...
