api/Registering your namespace

If you want to register your custom achievements with LibCustomAchievement, the first think you'll need to do is register a namespace for your achievements.

local achievementNamespace = LibStub("LibCustomAchievement-1.0"):RegisterNamespace(namespaceLabel, namespaceTable)

Arguments

namespaceLabel string

Unique label for the namespace. This will also be the name of the category of your achievements in the achievements panel and used in the achievementIDs for your achievements. Try not to use too many special characters (_ followed by a number is forbidden since that's the form achievement IDs use, the pipe character (|) and dollar sign ($) might break stuff with inter-library communications. Spaces should be fine, periods and commas too.

namespaceTable table

This table will be used to store all achievement information for your achievements. Storing this table is the responsibility of the addon registering the achievements - pass the same table on every call to RegisterNamespace. The type of savedVar used here also determines whether LCA achievements are per-character or per-account (SavedVariables make them per-account, while SavedVariablesPerCharacter make the per-character for obvious reasons).

Return values

namespace table The namespace table you will call the rest of the library's methods on. Try not to mess around with it's sub-tables and use the provided API instead.


Comments

Posts Quoted:
Reply
Clear All Quotes