Get an Epic Experience with Premium

LibAlts-1.0

Libraries Login to Add Favorites
  • 0 Likes
  • World of Warcraft
  • 274 Monthly Downloads
  • Supports: 4.3
  • 79,439 Total Downloads
  • Updated 11/29/2011
  • Created 10/21/2008
  • 21 Favorites
  • Project Site
  • Release Type: Mature
  • License: MIT License
  • Newest File: 2.0
or

About LibAlts-1.0

Overview

LibAlts provides an API to register and retrieve alternate identity information between addons. It maintains main-alt relationships. A given character can be defined as a main with one or more alts.

Basic API

  • :SetAlt(main, alt, source) - Associate a main name with an alt name. An optional source can be specified. If no source is specified, it is added the user-defined source.
  • :GetAlts(main) - Get a list of alts for a given name.
  • :GetMain(alt) - Get the main character associated with a given name.
  • :GetAllMains() - Get a list of all main characters.
  • :IsMain(main) - Is the given name a main character.
  • :IsAlt(alt) - Is the given name an alternate character.
  • :DeleteAlt(main, alt, source) - Delete the main-alt relationship. An optional source can be specified. If no source is specified, it is deleted from the user-defined source.
  • :TitleCase(name) - Return the name in title case. The first letter is capitalized and the rest are lower case.

Sources

Sources are a way to differentiate the data entered into LibAlts. User-defined data will have no source (i.e., the source is nil). Sources provide a solution to problems such as automated guild imports. If the information pushed into LibAlts from guild notes is placed into the same area as user-defined notes, then re-importing it later is problematic. If the guild data has its own area, it is easy to wipe that data and re-import it.

When adding data from automated sources, the source name needs to be unique. As a convention, data added for a guild should have the GUILD_PREFIX constant prepended to the guild name returned from the GetGuildInfo() API call. Data from an addon should have the ADDON_PREFIX prepended to the addon name.

LibAlts will merge data from all sources when answering queries, unless you use one of the *ForSource functions that allows you to query a particular source.

  • :GetAltsForSource(main, source) - Get a list of alts for a given name for the given source.
  • :GetMainForSource(alt, source) - Get the main character associated with a given name for the given source.
  • :GetAllMains(source) - Get a list of all main characters for the given source.
  • :IsMainForSource(main, source) - Is the given name a main character.
  • :IsAltForSource(alt, source) - Is the given name an alternate character.
  • :RemoveSource(source) - Remove all data for the given source.
  • GUILD_PREFIX - A constant to prepend to source names for imported guild data.
  • ADDON_PREFIX - A constant to prepend to source names for addon automated data.

Callbacks

  • LibAlts_SetAlt - Fired after SetAlt() is called.
  • LibAlts_RemoveAlt - Fired after DelAlt() is called
  • LibAlts_RemoveSource - Fired after RemoveSource() is called.

LuaDoc: http://www.wowace.com/projects/libalts-1-0/pages/api/lib-alts-1-0/

------------------------------------------------------------------------
r47 | talryn1 | 2011-11-29 19:57:23 +0000 (Tue, 29 Nov 2011) | 1 line
Changed paths:
   A /tags/2.0 (from /trunk:46)

Tagging as 2.0.  Updated TOC for 4.3.
------------------------------------------------------------------------
r46 | talryn1 | 2011-11-29 19:42:14 +0000 (Tue, 29 Nov 2011) | 1 line
Changed paths:
   M /trunk/LibAlts-1.0.toc

Updating TOC for 4.3
------------------------------------------------------------------------

Login to Curse

Don't have an account? Create One.

Get an epic experience with Curse Premium
  • Faster addon downloads
  • Premium-Only Beta Giveaways
  • Ad-Free Curse experience
  • Premium Curse Client
  • and many More Features
  • Learn More »

Infinite Crisis NA

Get Your Preferred Access Code!