comparison 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
comparison
equal deleted inserted replaced
33:64f2a9bbea79 34:9856ebc63fa4
1 --- ${PACKAGE_NAME}
2 -- @file-author@
3 -- @project-revision@ @project-hash@
4 -- @file-revision@ @file-hash@
5 -- Created: 4/15/2016 11:36 PM
6
7 local B = select(2,...).frame
8 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
9 local setmetatable, type, rawset = setmetatable, type, rawset
10 local print = B.print('Schema')
11 T.defaults.Schema = setmetatable({}, {
12 __newindex = function(schemas,layerName, layerTable)
13 -- tracker/block/line
14 if type(layerTable) == 'table' then
15 rawset(schemas, layerName, setmetatable(layerTable, {
16 __index = function(layerTable, schemaName)
17
18 end,
19 __newindex = function(layerTable, schemaName, schemaTable)
20 -- schema table
21 if type(schemaTable) == 'table' then
22 rawset(layerTable, schemaName, setmetatable(schemaTable, {
23 __index = function(schemaTable, key)
24 print('substituting a default value for |cFF00FFFF', layerName..'|r.|cFF0088FF'..schemaName..'|r.'..key)
25 return layerTable.default[key]
26 end
27 }))
28 end
29 end,
30 }))
31 end
32 end
33 })
34
35 T.defaults.Schema = {
36 tracker = {
37 default = {
38 headerbg = {'VERTICAL', 1, 1, 0.5, 0.5, 1, 1, 0.5, 0},
39 headerFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 14, 'OUTLINE'},
40 blockSpacing = 1,
41 }
42 },
43 block = {
44 default = {
45 titlebg = {'HORIZONTAL', 1, 0, .7, .25, 1, 0, .7, .125},
46 textbg = {'HORIZONTAL', 0, 0, 0, 0.4, 0, 0, 0, 0 },
47 selectionbg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 0.225},
48 titleFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'OUTLINE'},
49 textFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]], 16, 'OUTLINE'},
50 titleIndent = 4,
51 titleSpacing = 3,
52 textIndent = 3,
53 textSpacing = 3,
54 rewardSize = 24,
55 },
56 daily = {
57 titlebg = {'HORIZONTAL', 0, .7, 1, .25, 0, 1, .7, .125},
58 textbg = {'HORIZONTAL', 0, .7, 1, .1, 0, 1, .7, .075 },
59 },
60 weekly = {
61 titlebg = {'HORIZONTAL', 0, .35, .7, .25, 0, .35, .7, .125},
62 textbg = {'HORIZONTAL', 0, .35, .7, .1, 0, .35, .7, .075 },
63 },
64 account = {
65 titlebg = {'HORIZONTAL', .1, .1, .1, .25, .1, .1, .1, .125},
66 textbg = {'HORIZONTAL', .1, .1, .1, 0.4, .1, .1, .1, .085 },
67 },
68 -- alliance
69 faction_1 = {
70 titlebg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 },
71 textbg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 },
72 },
73 -- horde
74 faction_2 = {
75 titlebg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 },
76 textbg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 },
77 }
78 },
79 line = {
80 default = {
81 textColor = {.5,.75,1},
82 textSpacing = 3,
83 textIndent = 3,
84 },
85 completed = {
86 textColor = {0, 1, 0}
87 },
88 failed = {
89 textColor = {1,0,0 }
90 },
91 autocomplete = {
92 textColor = {0,1,0 }
93 },
94 objectColor = {
95 textColor = {0,1,1}
96 },
97 monster = {
98 textColor = {1,1,0}
99 },
100 item = {
101 textColor = {1,.25,.5}
102 }
103 },
104 widget = {
105 progressbar = {
106
107 },
108 timer = {
109
110 }
111 },
112 }