23 lines
810 B
Lua
Executable File
23 lines
810 B
Lua
Executable File
local addonName, addon = ...
|
|
local childName = addon['childName']
|
|
local child = addon[childName]
|
|
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
|
function child:PrefChanged()
|
|
local digit = child['db']['digits'] or 1
|
|
if(digit > 0) then
|
|
child['frm_digits'] = format("%%.%if", digit)
|
|
else
|
|
child['frm_digits'] = "%i"
|
|
end
|
|
child.events.PLAYER_AVG_ITEM_LEVEL_UPDATE()
|
|
end
|
|
local init = {
|
|
Setup = function(self)
|
|
local config = LibStub:GetLibrary("zzConfig")
|
|
local options = child['options']
|
|
local main = options['args'][childName]
|
|
-- print("setup prefs", childName)
|
|
config:AddConfigEntry(main, "digits", "range", L['Digits'], L['Number of digits after the decimal point'], 1, 0, 5, 1, false)
|
|
end
|
|
}
|
|
addon.RegisterCallback(init, format("Init%s", childName), 'Setup') |