You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
929 B
22 lines
929 B
local addonName, addon = ...
|
|
local childName = addon['childName']
|
|
local child = addon[childName]
|
|
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
|
function child:PrefChanged(...)
|
|
child['update']()
|
|
end
|
|
local init = {
|
|
Setup = function(self)
|
|
local db = child['db']
|
|
local config = LibStub:GetLibrary("zzConfig")
|
|
local options = child['options']
|
|
local main = options['args'][childName]
|
|
local menu = config:AddConfigMenu(options, L['Bagtypes'], 2, config:GetDefaultHandler(child['events']['BAG_UPDATE_DELAYED'], db['bagTypes']))
|
|
config:AddConfigEntry(main, "showFree", "toggle", L['Show free space'],L['Show free space instead of used space'], 1)
|
|
child.PrefChanged = child['events']['BAG_UPDATE_DELAYED']
|
|
for k, v in pairs(child['bagStatus']['bagTypes']) do
|
|
config:AddConfigEntry(menu, v, "toggle", v)
|
|
end
|
|
end
|
|
}
|
|
addon.RegisterCallback(init, format("Init%s", childName), 'Setup') |