annotate ObjectiveTracker/Schema.lua @ 46:aa693607b813

Block - use Animation:IsPlaying() to determine whether a block should be ignored during cleanup; fixes abandoned quest ghosts
author Nenue
date Tue, 26 Apr 2016 15:05:38 -0400
parents dd1ae565f559
children
rev   line source
Nenue@34 1 --- ${PACKAGE_NAME}
Nenue@34 2 -- @file-author@
Nenue@34 3 -- @project-revision@ @project-hash@
Nenue@34 4 -- @file-revision@ @file-hash@
Nenue@34 5 -- Created: 4/15/2016 11:36 PM
Nenue@34 6
Nenue@34 7 local B = select(2,...).frame
Nenue@34 8 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@34 9 local setmetatable, type, rawset = setmetatable, type, rawset
Nenue@38 10 local print = B.print('Schema')
Nenue@37 11 local lprint = B.print('Layout')
Nenue@37 12 local oprint = B.print('Objectives')
Nenue@34 13 T.defaults.Schema = setmetatable({}, {
Nenue@34 14 __newindex = function(schemas,layerName, layerTable)
Nenue@34 15 -- tracker/block/line
Nenue@34 16 if type(layerTable) == 'table' then
Nenue@37 17
Nenue@37 18 print('adding layer', layerName)
Nenue@37 19 for k,v in pairs(layerTable) do
Nenue@37 20 print(' incorporated schema', k)
Nenue@37 21 if type(v) == 'table' and k ~= 'default' then
Nenue@37 22 setmetatable(v, {
Nenue@37 23 __index = function(schemaTable, key)
Nenue@37 24 print(' substituting default "'..tostring(schemas[layerName].default[key])..'" for |cFF00FFFF', layerName..'|r.|cFF0088FF'..k..'|r.'..key)
Nenue@37 25 return schemas[layerName].default[key]
Nenue@37 26 end
Nenue@37 27 })
Nenue@37 28 end
Nenue@37 29 end
Nenue@34 30 rawset(schemas, layerName, setmetatable(layerTable, {
Nenue@34 31 __newindex = function(layerTable, schemaName, schemaTable)
Nenue@34 32 -- schema table
Nenue@34 33 if type(schemaTable) == 'table' then
Nenue@37 34 print('adding schema', schemaName, 'to', layerName, 'layers')
Nenue@37 35
Nenue@37 36
Nenue@34 37 rawset(layerTable, schemaName, setmetatable(schemaTable, {
Nenue@34 38 __index = function(schemaTable, key)
Nenue@37 39 print(' substituting default "'..tostring(schemas[layerName].default[key])..'" for |cFF00FFFF', layerName..'|r.|cFF0088FF'..schemaName..'|r.'..key)
Nenue@37 40 rawset(schemaTable, key, schemas[layerName].default[key])
Nenue@37 41 return schemas[layerName].default[key]
Nenue@34 42 end
Nenue@34 43 }))
Nenue@34 44 end
Nenue@34 45 end,
Nenue@34 46 }))
Nenue@34 47 end
Nenue@34 48 end
Nenue@34 49 })
Nenue@34 50
Nenue@37 51 T.defaults.Schema.tracker = {
Nenue@37 52 default = {
Nenue@37 53 headerbg = {'VERTICAL', 1, 1, 0.5, 0.5, 1, 1, 0.5, 0},
Nenue@38 54 headerFont = {[[Interface\Addons\SharedMedia_MyMedia\font\XOIREQE.TTF]], 13, 'OUTLINE'},
Nenue@38 55 headerHeight = 16,
Nenue@38 56 headerSpacing = 0,
Nenue@38 57 headerColor = {1,1,1,1},
Nenue@37 58 blockSpacing = 1,
Nenue@37 59 }
Nenue@37 60 }
Nenue@37 61 T.defaults.Schema.block = {
Nenue@37 62 default = {
Nenue@38 63 titleColor = {1, 1, 1, 1},
Nenue@45 64 titlebg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 1, 'MOD'},
Nenue@45 65 textbg = {'HORIZONTAL', 1, 1, 1, 1, .7, .7, .7, 1, 'MOD'},
Nenue@37 66 selectionbg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 0.225},
Nenue@37 67 titleFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'OUTLINE'},
Nenue@37 68 textFont = {[[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]], 16, 'OUTLINE'},
Nenue@37 69 titleIndent = 4,
Nenue@37 70 titleSpacing = 3,
Nenue@37 71 selectionIndent = 5,
Nenue@37 72 textIndent = 3,
Nenue@37 73 textSpacing = 3,
Nenue@37 74 rewardSize = 24,
Nenue@34 75 },
Nenue@44 76 complete = {
Nenue@44 77 titleColor = {.25,1,.25},
Nenue@44 78 titlebg = {'HORIZONTAL', .25, 1, .25, .125, 0, 1, .7, .25},
Nenue@44 79 },
Nenue@37 80 achievement = {
Nenue@37 81 titleColor = {0, 0.7, 1, 1},
Nenue@34 82 },
Nenue@37 83 achievement_account = {
Nenue@37 84 titleColor = {.35, 0.7, 1, 1},
Nenue@34 85 },
Nenue@37 86 daily = {
Nenue@37 87 titleColor = {0, 0.7, 1, 1},
Nenue@38 88 titlebg = {'HORIZONTAL', 0, .7, 1, 0, 0, 1, .7, .125},
Nenue@38 89 textbg = {'HORIZONTAL', 0, .7, 1, 0, 0, 1, .7, .1},
Nenue@37 90 },
Nenue@37 91 weekly = {
Nenue@37 92 titleColor = {.25, 0.7, 1, 1},
Nenue@38 93 titlebg = {'HORIZONTAL', 0, .35, .7, 0, 0, .35, .7, .125},
Nenue@38 94 textbg = {'HORIZONTAL', 0, .35, .7, .0, 0, .35, .7, .075 },
Nenue@37 95 },
Nenue@37 96 account = {
Nenue@38 97 titlebg = {'HORIZONTAL', .1, .1, .1, 0, .1, .1, .1, .125},
Nenue@38 98 textbg = {'HORIZONTAL', .1, .1, .1, 0, .1, .1, .1, .085 },
Nenue@37 99 },
Nenue@37 100 -- alliance
Nenue@37 101 faction_1 = {
Nenue@37 102 titlebg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 },
Nenue@37 103 textbg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 },
Nenue@37 104 },
Nenue@37 105 -- horde
Nenue@37 106 faction_2 = {
Nenue@37 107 titlebg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 },
Nenue@37 108 textbg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 },
Nenue@37 109 }
Nenue@37 110 }
Nenue@37 111 T.defaults.Schema.line = {
Nenue@37 112 default = {
Nenue@38 113 textColor = {1, 1, 1},
Nenue@37 114 textSpacing = 3,
Nenue@37 115 textIndent = 3,
Nenue@37 116 },
Nenue@37 117 completed = {
Nenue@39 118 textColor = {.5, 1, .5}
Nenue@37 119 },
Nenue@37 120 failed = {
Nenue@39 121 textColor = {1,.25,.25 }
Nenue@37 122 },
Nenue@37 123 autocomplete = {
Nenue@39 124 textColor = {.5,1,1 }
Nenue@37 125 },
Nenue@39 126 object = {
Nenue@37 127 textColor = {0,1,1}
Nenue@37 128 },
Nenue@37 129 monster = {
Nenue@37 130 textColor = {1,1,0}
Nenue@37 131 },
Nenue@37 132 item = {
Nenue@39 133 textColor = {1,.75,.75}
Nenue@38 134 },
Nenue@38 135 achievement_complete = {
Nenue@38 136 textColor = {1, 1, 1, 1},
Nenue@38 137 },
Nenue@38 138 achievement = {
Nenue@39 139 textColor = {0.5, 0.85, 1, 1},
Nenue@38 140 },
Nenue@38 141 achievement_account = {
Nenue@39 142 textColor = {.4, 0.7, 1, 1},
Nenue@38 143 },
Nenue@37 144 }
Nenue@37 145 T.defaults.Schema.widget = {
Nenue@37 146 progressbar = {
Nenue@34 147
Nenue@37 148 },
Nenue@37 149 timer = {
Nenue@34 150
Nenue@37 151 }
Nenue@39 152 }
Nenue@39 153
Nenue@39 154 T.defaults.Schema.statusbar = {
Nenue@39 155 default = {
Nenue@39 156 textFont = {[[Interface\Addons\SharedMedia_MyMedia\font\XOIREQE.TTF]], 11, 'OUTLINE'},
Nenue@39 157 textColor = {1,1,1,1},
Nenue@39 158 }
Nenue@34 159 }