-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Kyle Buller edited this page Jul 27, 2018
·
2 revisions
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.
Either copy the LibDualSpec-1.0.lua file in your addon folder or use the Curse packager features.
externals:
libs/LibDualSpec-1.0:
url: https://repos.wowace.com/wow/libdualspec-1-0
tag: latest
# OptionalDeps: LibDualSpec-1.0
#@no-lib-strip@
libs\LibDualSpec-1.0\LibDualSpec-1.0.lua
#@end-no-lib-strip@
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