Quick tutorial
Profile support
LibDualSpec-1.0 relies on AceDB-3.0 profile switching feature. Thus, before using this library, you should ensure your addon gracefully handles "online" profile switching. This often means handling AceDB-3.0 profile callbacks.
Embedding LibDualSpec-1.0
Either copy the LibDualSpec-1.0.lua file in your addon folder or use the wowace packager features:
- reference the library in
.pkgmeta
file:
externals: libs/LibDualSpec-1.0: url: git://git.wowace.com/wow/libdualspec-1-0/mainline.git tag: latest
- reference the library the TOC file:
# OptionalDeps: LibDualSpec-1.0 #@no-lib-strip@ libs\LibDualSpec-1.0\LibDualSpec-1.0.lua #@end-no-lib-strip@
Enabling LibDualSpec-1.0
And finally, in your addon, enhance your AceDB-3.0 database and optionally the profile options created by AceDBOptions-3.0:
function myAddon:OnInitialize() -- Initialize the AceDB-3.0 database self.db = LibStub('AceDB-3.0'):New("myAddonDB", myDefaults) -- Create the profile options and add them to our option table self.options.args.profiles = LibStub('AceDBOptions-3.0'):GetOptionsTable(self.db) -- Add dual-spec support local LibDualSpec = LibStub('LibDualSpec-1.0') LibDualSpec:EnhanceDatabase(self.db, "myAddon") LibDualSpec:EnhanceOptions(self.options.args.profiles, self.db) end
Comments