main/api/LibAlts-1.0
:DeleteAlt(main, alt, source)
Remove a Main-Alt relationship and fire a callback for the disassociation.
Parameters
- main
- Name of the Main character.
- alt
- Name of the Alt being removed.
- source
- Source of the main-alt relationship. Nil if used-defined.
:GetAllMains(mains)
Return a table of all main characters.
Parameters
- mains
- The table to fill with the mains.
:GetAllMainsForSource(mains, source)
Return a table of all main characters for a given data source.
Parameters
- mains
- The table to fill with the mains.
- source
- The data source to limit the mains for. Nil for user-defined.
:GetAlts(main)
Get a list of alts for a given character.
Parameters
- main
- Name of the main character.
Return value
list list of alts.
:GetAltsForSource(main, source)
Get a list of alts for a given character for a given data source.
Parameters
- main
- Name of the main character.
- source
- The data source to use. Nil for user-defined.
Return value
list list of alts.
:GetMain (alt)
Get the main for a given alt character.
Parameters
- alt
- Name of the alt character.
Return value
string the main character.
:GetMainForRealId (realid)
Get the main for a given Real Id name.
Parameters
- realid
- The Real Id name.
Return value
string The main character name, if a mapping exists.
:GetMainForSource (alt, source)
Get the main for a given alt character for a given data source.
Parameters
- alt
- Name of the alt character.
- source
- The data source to use.
Return value
string the main character.
:GetRealIdForMain (main)
Get the Real ID name for a given main character.
Parameters
- main
- Name of the main character.
Return value
string The Real Id name for the main, if a mapping exists.
:IsAlt(alt)
Test if a character is an alt.
Parameters
- alt
- Name of the character.
Return value
boolean is this a alt character.
:IsAltForSource(alt, source)
Test if a character is an alt for a given data source.
Parameters
- alt
- Name of the character.
- source
- The data source to use. Nil for user-defined.
Return value
boolean is this a alt character.
:IsMain(main)
Test if a character is a main.
Parameters
- main
- Name of the character.
Return value
boolean is this a main character.
:IsMainForSource(main, source)
Test if a character is a main for a given data source.
Parameters
- main
- Name of the character.
- source
- The data source to use. Nil for user-defined.
Return value
boolean is this a main character.
:IsRealId(realid)
Test if a Real Id-Main relationship exists for a given Real Id name.
Parameters
- realid
- The Real Id name.
Return value
boolean Does the Real Id-Main relationship exist.
:RemoveSource(source)
Remove a data source, including all main-alt relationships, and fire a callback.
Parameters
- source
- Data source to be removed.
:SetAlt (main, alt, source)
Register a Main-Alt relationship.
User-entered data should not have a source (i.e, source = nil). For guild data,
prepend "guild:" to the guild name returned from the API. Addons
wishing to add their own separate data should prepend "addon:". Any data not
directly entered by a user should be added as a source.
Parameters
- main
- Name of the main character.
- alt
- Name of the alt character.
- source
- Source of the main-alt relationship. Nil if used-defined.
:SetRealIdForMain (realid, main)
Register a Real Id-Main relationship.
Parameters
- realid
- The Real Id name.
- main
- Name of the main character.
:TitleCase(name)
Returns a name formatted in title case (i.e., first character upper case, the rest lower).
Parameters
- name
- The name to be converted.
Return value
string The converted name.
Comments