Mercurial > wow > buffalo2
diff ObjectiveTracker/Schema.lua @ 34:9856ebc63fa4
- half solution to Update being fired multiple times during load
- change securefunc handlers to dispense a reason code; catch that reason code in the enclosure passed to hooksecurefunc, and decide whether to update or not from there.
author | Nenue |
---|---|
date | Sun, 17 Apr 2016 00:21:45 -0400 |
parents | |
children | 69d03f8e293e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ObjectiveTracker/Schema.lua Sun Apr 17 00:21:45 2016 -0400 @@ -0,0 +1,112 @@ +--- ${PACKAGE_NAME} +-- @file-author@ +-- @project-revision@ @project-hash@ +-- @file-revision@ @file-hash@ +-- Created: 4/15/2016 11:36 PM + +local B = select(2,...).frame +local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') +local setmetatable, type, rawset = setmetatable, type, rawset +local print = B.print('Schema') +T.defaults.Schema = setmetatable({}, { + __newindex = function(schemas,layerName, layerTable) + -- tracker/block/line + if type(layerTable) == 'table' then + rawset(schemas, layerName, setmetatable(layerTable, { + __index = function(layerTable, schemaName) + + end, + __newindex = function(layerTable, schemaName, schemaTable) + -- schema table + if type(schemaTable) == 'table' then + rawset(layerTable, schemaName, setmetatable(schemaTable, { + __index = function(schemaTable, key) + print('substituting a default value for |cFF00FFFF', layerName..'|r.|cFF0088FF'..schemaName..'|r.'..key) + return layerTable.default[key] + end + })) + end + end, + })) + end + end +}) + +T.defaults.Schema = { + tracker = { + default = { + headerbg = {'VERTICAL', 1, 1, 0.5, 0.5, 1, 1, 0.5, 0}, + headerFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 14, 'OUTLINE'}, + blockSpacing = 1, + } + }, + block = { + default = { + titlebg = {'HORIZONTAL', 1, 0, .7, .25, 1, 0, .7, .125}, + textbg = {'HORIZONTAL', 0, 0, 0, 0.4, 0, 0, 0, 0 }, + selectionbg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 0.225}, + titleFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'OUTLINE'}, + textFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]], 16, 'OUTLINE'}, + titleIndent = 4, + titleSpacing = 3, + textIndent = 3, + textSpacing = 3, + rewardSize = 24, + }, + daily = { + titlebg = {'HORIZONTAL', 0, .7, 1, .25, 0, 1, .7, .125}, + textbg = {'HORIZONTAL', 0, .7, 1, .1, 0, 1, .7, .075 }, + }, + weekly = { + titlebg = {'HORIZONTAL', 0, .35, .7, .25, 0, .35, .7, .125}, + textbg = {'HORIZONTAL', 0, .35, .7, .1, 0, .35, .7, .075 }, + }, + account = { + titlebg = {'HORIZONTAL', .1, .1, .1, .25, .1, .1, .1, .125}, + textbg = {'HORIZONTAL', .1, .1, .1, 0.4, .1, .1, .1, .085 }, + }, + -- alliance + faction_1 = { + titlebg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 }, + textbg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 }, + }, + -- horde + faction_2 = { + titlebg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 }, + textbg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 }, + } + }, + line = { + default = { + textColor = {.5,.75,1}, + textSpacing = 3, + textIndent = 3, + }, + completed = { + textColor = {0, 1, 0} + }, + failed = { + textColor = {1,0,0 } + }, + autocomplete = { + textColor = {0,1,0 } + }, + objectColor = { + textColor = {0,1,1} + }, + monster = { + textColor = {1,1,0} + }, + item = { + textColor = {1,.25,.5} + } + }, + widget = { + progressbar = { + + }, + timer = { + + } + }, +} \ No newline at end of file