2021-03-23 09:41:28 +00:00
|
|
|
local addonName, addon = ...
|
|
|
|
local childName = addon['childName']
|
|
|
|
local child = addon[childName]
|
|
|
|
local events = child['events']
|
|
|
|
local db
|
|
|
|
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
|
|
|
local defcolor = "ffffff"
|
|
|
|
LibStub("zzHelper"):Embed(child)
|
|
|
|
local function prepareDB()
|
|
|
|
db = addon['db']['profile'][childName]
|
|
|
|
child['db'] = db
|
|
|
|
addon['callbacks']:Fire(format("Init%s", childName))
|
|
|
|
end
|
|
|
|
child['specs'] = {
|
|
|
|
['name'] = childName,
|
|
|
|
['sv'] = true,
|
|
|
|
['cfg'] = true,
|
|
|
|
['cfgReset'] = prepareDB,
|
|
|
|
['ldb'] = child['ldb'],
|
|
|
|
['defaults'] = {
|
|
|
|
['profile'] = {
|
|
|
|
[childName] = {
|
|
|
|
["showClock"] = true,
|
|
|
|
["showLatency"] = true,
|
|
|
|
["showFPS"] = true,
|
|
|
|
["update"] = 2,
|
|
|
|
["clockstring"] = "%H:%M",
|
|
|
|
["datestring"] = "%A, %d.%B",
|
|
|
|
["latencystring"] = "%world ms",
|
|
|
|
["fpsstring"] = "%fps "..L['FPS'],
|
|
|
|
["ldbstring"] = "%clock %latency %fps",
|
|
|
|
['datecolor'] = defcolor,
|
|
|
|
['fpscolor'] = defcolor,
|
|
|
|
['clockcolor'] = defcolor,
|
|
|
|
['latencycolor'] = "ffff00",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
child:NewAddOn(...)
|