zz_Infoclock/core.lua

52 lines
1.4 KiB
Lua
Executable File

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",
['fpshighcolor'] = defcolor,
['fpsmediumcolor'] = defcolor,
['fpslowcolor'] = defcolor,
['latencyhighcolor'] = defcolor,
['latencymediumcolor'] = defcolor,
['latencylowcolor'] = defcolor,
['fpshigh'] = 0,
['fpsmedium'] = 0,
['fpslow'] = 0,
['latencyhigh'] = 0,
['latencymedium'] = 0,
['latencylow'] = 0,
}
}
}
}
child:NewAddOn(...)