# HG changeset patch # User Nenue # Date 1460380060 14400 # Node ID 66b927b467767e83bdaad1e1b3edb541838a9cb7 # Parent e837384ac3635da9f29106a47d6e5bfe96a71166 Refine the XML data logic, and sort out some EnableMouse inconsistencies. diff -r e837384ac363 -r 66b927b46776 BuffAnchors.lua --- a/BuffAnchors.lua Sun Apr 10 04:35:32 2016 -0400 +++ b/BuffAnchors.lua Mon Apr 11 09:07:40 2016 -0400 @@ -79,6 +79,7 @@ end end + frame:EnableMouse(B.Conf.ConfigMode and B.Conf.ConfigMode or false) frame:SetScript('OnMouseDown', Anchor_OnMouseDown) frame:SetScript("OnMouseUp", Anchor_OnMouseUp) -- table addition diff -r e837384ac363 -r 66b927b46776 Config.lua --- a/Config.lua Sun Apr 10 04:35:32 2016 -0400 +++ b/Config.lua Mon Apr 11 09:07:40 2016 -0400 @@ -19,6 +19,10 @@ return (("%%.%df"):format(decimals)):format(number) end +M.defaults = { + enable = true +} + --- STATE VARIABLES local configInit --- Dummies for addon table upvalues @@ -377,6 +381,7 @@ end M.OnEnable = function() + print('|cFFFF0088config module', B.Conf.ConfigMode) M.Command(B.Conf.ConfigMode) end diff -r e837384ac363 -r 66b927b46776 Init.lua --- a/Init.lua Sun Apr 10 04:35:32 2016 -0400 +++ b/Init.lua Mon Apr 11 09:07:40 2016 -0400 @@ -125,7 +125,7 @@ --- localize for speed local layers, refs, displays = B.configLayers, B.configLayersRef, B.displays -local ModulesCall = function(func) +local ModulesCall = function(func, flag) local n = 0 for i = 1, #moduleStack do @@ -134,11 +134,19 @@ for name, module in pairs(stackset) do n = n + 1 - print(n..' '..name..'.'..func..'()') if module[func] then - module[func](module) + -- nil = pass + if not flag or module.Conf[flag] then + if (flag) then + print(' check', flag, '=', module.Conf[flag]) + end + + print(' ',n..' '..name..'.'..func..'()') + module[func](module, module.Conf) + end + end end end @@ -161,6 +169,8 @@ if not VeneerData then VeneerData = {} for k,v in pairs(defaults) do + + VeneerData[k] = v end print('Veneer defaults being used.') @@ -238,6 +248,10 @@ for level, batch in ipairs(moduleStack) do print('config level', level) for name, module in pairs(batch) do + if not VeneerData[name] then + VeneerData[name] = {} + end + if module.defaults then print('setting defaults for module', name) --[===[@non-debug@ @@ -253,6 +267,10 @@ module.Conf = VeneerData[name] end + if VeneerData[name].enabled == nil then + VeneerData[name].enabled = true + end + end end @@ -272,7 +290,7 @@ local lastUpdate function B.UpdateAll(...) lastUpdate = GetTime() - ModulesCall('OnUpdate', lastUpdate) + ModulesCall('OnUpdate') end B:RegisterEvent('PLAYER_ENTERING_WORLD') @@ -285,16 +303,20 @@ C_Timer.After(1, function() if GetSpecialization() then print(GetSpecialization(), 'enabling') - ModulesCall('OnEnable') + + ModulesCall('OnEnable', 'enabled') B:SetScript('OnUpdate', nil) end - end) end - end B.UpdateAll() + + if event == 'PLAYER_ENTERING_WORLD' then + B.UpdateConfigLayers() + end + end) --- Modulizer method @@ -333,10 +355,10 @@ B.SetConfigLayers = function(frame) local print = B.fprint() if not frame.config then - print(frame:GetName(), 'has no config layers') + --print(frame:GetName(), 'has no config layers') return end - print('Registering config layers from', frame:GetName()) + --print('Registering config layers from', frame:GetName()) for i, subframe in ipairs(frame.config) do -- make sure there are no duplicates @@ -345,7 +367,7 @@ layers[key] = subframe refs[subframe] = key end - print(' ', i, subframe:GetName()) + --print(' ', i, subframe:GetName()) end end @@ -380,7 +402,8 @@ end end - + print(B.Conf.ConfigMode) + display.anchor:EnableMouse(B.Conf.ConfigMode) end for id, region in pairs(layers) do print(id, region:GetName(), func) @@ -390,24 +413,66 @@ print('['..func..'] updated', #layers, 'regions,', numAnchors, 'frames') end +local XMLFrame_SetEnabled = function(self, value) + local name = self:GetName() + + + if not B.Conf[name] then + B.Conf[name] = { + enabled = true + } + end + + print() + local enabled + if value == nil then + if B.Conf[name].enabled == nil then + print('toggle based on visibility') + enabled = (not self:IsVisible()) and true or false + else + print('toggle a config value =', B.Conf[name].enabled) + enabled = B.Conf[name].enabled + end + + enabled = (enabled ~= true) and true or false + else + print('use argument value', value) + enabled = value + end + + print('arg =', value, 'conf =', B.Conf[name].enabled, 'result=', enabled) + + B.Conf[name].enabled = enabled + + local stateFunc = enabled and 'Show' or 'Hide' + local eventFunc = enabled and 'OnToggle' or 'OnToggle' + for i, region in pairs(self.toggled) do + region[stateFunc](region) + end + if self.OnToggle then + self:OnToggle(B.Conf[name].enabled) + end + if B.Conf[name].enabled then + if self.OnEnable then + self:OnEnable() + end + else + if self.OnDisable then + self:OnDisable() + end + end + + +end --- Generic handlers for keeping track of XML-defined frames B.OnLoad = function(self) tinsert(checkForConfig, self) - self.Minimize = function(self, forceDown) - if not self:IsVisible() then - return - end - local state = (forceDown and 1 or (B.Conf.FrameState[self:GetName()] == 1 and 2 or 1)) - local stateFunc = (state == 1) and 'Hide' or 'Show' - for i, region in pairs(self.minimizeFrames) do - region[stateFunc](region) - end - B.Conf.FrameState[self:GetName()] = state - end + self.SetEnabled = XMLFrame_SetEnabled end B.InitXMLFrame = function(self) - print('|cFF00FF00hello from '..self:GetName()) + local name = self:GetName() + print('|cFF00FF00hello from '.. name) if self.drag then self:RegisterForDrag('LeftButton') @@ -415,28 +480,25 @@ self:EnableMouse(false) end - if not B.Conf.FramePosition then - B.Conf.FramePosition = {} + if not B.Conf[name] then + B.Conf[name] = { + enabled = true, + } end - if not B.Conf.FrameState then - B.Conf.FrameState = {} + local c = B.Conf[name] + + if c.position then + print('restoring frame position', unpack(c.position)) + self:ClearAllPoints() + local anchorTo, relativePoint, x, y = unpack(c.position) + self:SetPoint(anchorTo, UIParent, relativePoint, x, y) + else + local a, _, b, c, d = self:GetPoint(1) + print('seeding default position', a, b, c, d) + c.position = {a, b, c, d} end - - if B.Conf.FramePosition[self:GetName()] then - print('restoring frame position', unpack(B.Conf.FramePosition[self:GetName()])) - self:ClearAllPoints() - local anchorTo, relativePoint, x, y = unpack(B.Conf.FramePosition[self:GetName()]) - self:SetPoint(anchorTo, UIParent, relativePoint, x, y) - end - local state = B.Conf.FrameState[self:GetName()] and B.Conf.FrameState[self:GetName()] or 2 - if state == 0 then - self:Hide() - elseif state == 1 then - self.Minimize(self, true) - elseif state == 2 then - self:Show() - end - B.Conf.FrameState[self:GetName()] = state + local state = c.enabled + self:SetEnabled(state) end B.OnDragStart = function(self) @@ -449,13 +511,13 @@ end B.OnDragStop = function(self) - print(self:GetName(), 'stop moving ('..self:GetLeft()..', '..self:GetBottom()..')') + local name = self:GetName() + print(name, 'stop moving ('..self:GetLeft()..', '..self:GetBottom()..')') local xB = self:GetLeft() - self.xA local yB = self:GetBottom() - self.yA print('storing anchor point', self.anchorTo, self.relativePoint, self.x + xB, self.y + yB) self:StopMovingOrSizing() - B.Conf.FramePosition[self:GetName()] = {self.anchorTo, self.relativePoint, self.x + xB, self.y + yB} + B.Conf[name].position = {self.anchorTo, self.relativePoint, self.x + xB, self.y + yB} B.InitXMLFrame(self) - end \ No newline at end of file diff -r e837384ac363 -r 66b927b46776 ObjectiveTracker/ObjectiveCore.lua --- a/ObjectiveTracker/ObjectiveCore.lua Sun Apr 10 04:35:32 2016 -0400 +++ b/ObjectiveTracker/ObjectiveCore.lua Mon Apr 11 09:07:40 2016 -0400 @@ -10,7 +10,7 @@ local AddQuestWatch, SetSuperTrackedQuestID, GetNumQuestWatches, AUTO_QUEST_WATCH, MAX_WATCHABLE_QUESTS = AddQuestWatch, SetSuperTrackedQuestID, GetNumQuestWatches, AUTO_QUEST_WATCH, MAX_WATCHABLE_QUESTS local QuestPOIUpdateIcons, GetCVar, IsPlayerInMicroDungeon, WorldMapFrame, GetCVarBool, SetMapToCurrentZone = QuestPOIUpdateIcons, GetCVar, IsPlayerInMicroDungeon, WorldMapFrame, GetCVarBool, SetMapToCurrentZone local AddAutoQuestPopUp = AddAutoQuestPopUp -local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') +local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') local print = B.print('Objectives') local ObjectiveTrackerFrame, VeneerObjectiveScroll, CreateFrame = _G.ObjectiveTrackerFrame, _G.VeneerObjectiveScroll, _G.CreateFrame local Wrapper = _G.VeneerObjectiveWrapper @@ -61,21 +61,56 @@ local OBJECTIVE_TRACKER_UPDATE_REASON = OBJECTIVE_TRACKER_UPDATE_ALL -- default --- Used to determine which trackers are listening for money events -mod.watchMoneyReasons = 0 + +T.strings = {} +T.strings.CLICK_TO_ACCCEPT = 'Click to Accept' +T.strings.CLICK_TO_COMPLETE = 'Click to complete' +T.colors ={ + enable = true, + 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}, + }, + 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 }, + } +} + +T.watchMoneyReasons = 0 --- Baseline defaults table; values defined in the files that they pertain to -mod.defaults = {} +T.defaults = {} --- Tracker display order -mod.orderedNames = {'Bonus', 'AutoQuest', 'Quest', 'Cheevs'} +T.orderedNames = {'Bonus', 'AutoQuest', 'Quest', 'Cheevs'} --- ipairs() argument tables -mod.orderedHandlers = setmetatable({}, {__mode = "k"}) -mod.orderedTrackers = setmetatable({}, {__mode = "k"}) -mod.indexedTrackers = setmetatable({}, {__mode = "k"}) +T.orderedHandlers = setmetatable({}, {__mode = "k"}) +T.orderedTrackers = setmetatable({}, {__mode = "k"}) +T.indexedTrackers = setmetatable({}, {__mode = "k"}) --- pairs() argument tables -mod.namedTrackers = setmetatable({}, {__mode = "k"}) +T.namedTrackers = setmetatable({}, {__mode = "k"}) local WRAPPER_ANCHOR_POINT = 'TOPRIGHT' local WRAPPER_OFFSET_X = 0 @@ -84,7 +119,7 @@ local WRAPPER_WIDTH = 280 local WRAPPER_HEADER_HEIGHT = 24 -mod.defaults.Wrapper = { +T.defaults.Wrapper = { AnchorPoint = WRAPPER_ANCHOR_POINT, OffsetX = WRAPPER_OFFSET_X, OffsetY = WRAPPER_OFFSET_Y, @@ -98,7 +133,7 @@ --- Tracker module definitions begin here; innards dealing with data retreival and output are defined further in -mod.DefaultHandler = { +T.DefaultHandler = { previousHeight = 0, name = "temp", @@ -120,28 +155,30 @@ WatchBlock = {}, -- find block by watch index } -mod.AutoQuest = { +T.AutoQuest = { name = "AutoQuest", displayName = "Notice", updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST, updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_QUEST + OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, } -mod.Quest = { +T.Quest = { name = "Quest", displayName = "Quests", updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST, updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_QUEST + OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, + itemButtons = {}, + freeButtons = {}, } -mod.Cheevs = { +T.Cheevs = { name = "Cheevs", displayName = "Achievements", updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT, updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT + OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED, } -mod.Bonus = { +T.Bonus = { name = "Bonus", displayName = "Bonus Objectives", updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE, @@ -157,12 +194,12 @@ local Handler_Initialize = function (self, name, index) print('Initializing |cFF00FFFF'..name..'|r module...') - local handler = setmetatable(mod[name] or {}, { + local handler = setmetatable(T[name] or {}, { __tostring = Tracker_string, __call = Tracker_call }) - if type(mod.orderedHandlers[index]) == 'table' then - return mod.orderedHandlers[index] + if type(T.orderedHandlers[index]) == 'table' then + return T.orderedHandlers[index] end print('|cFFFFFF00Acquiring locals') @@ -189,22 +226,22 @@ print(format("%32s %8s %s", (preset[k] and '|cFFFFFFFF' or '|cFFFFFF00') .. k .. '|r', type(v), tostring(v))) end - mod[name] = handler + T[name] = handler local trackerName = 'Veneer'..name..'Tracker' - local handler = mod[name] + local handler = T[name] local frame = CreateFrame('Frame', trackerName, _G.VeneerObjectiveScroll, 'VeneerTrackerTemplate') frame.title:SetText(handler.displayName) - mod.SetBlockStyle(frame, 'Tracker', 'Normal') + T.SetBlockStyle(frame, 'Tracker', 'Normal') handler.frame = frame handler.trackerName = trackerName handler.lines = {} - mod.orderedTrackers[index] = frame - mod.namedTrackers[name] = frame - mod.indexedTrackers[handler] = frame + T.orderedTrackers[index] = frame + T.namedTrackers[name] = frame + T.indexedTrackers[handler] = frame print('|cFFFF0088' .. trackerName .. '|r created for |cFF00FFFF' .. handler.displayName .. '|r module') - mod.orderedHandlers[index] = handler + T.orderedHandlers[index] = handler return true end @@ -247,12 +284,12 @@ Event.ZONE_CHANGED = function() local inMicroDungeon = IsPlayerInMicroDungeon(); - if ( inMicroDungeon ~= mod.inMicroDungeon ) then + if ( inMicroDungeon ~= T.inMicroDungeon ) then if ( not WorldMapFrame:IsShown() and GetCVarBool("questPOI") ) then SetMapToCurrentZone(); -- update the zone to get the right POI numbers for the tracker end --SortQuestWatches(); - mod.inMicroDungeon = inMicroDungeon; + T.inMicroDungeon = inMicroDungeon; end end Event.QUEST_AUTOCOMPLETE = function(questId) @@ -284,8 +321,8 @@ SetMapToCurrentZone(); -- update the zone to get the right POI numbers for the tracker end SortQuestWatches(); - mod.currentZoneArea = GetCurrentMapAreaID() - print('Updating zone ID to', mod.currentZoneArea, '=', GetZoneText(), GetMinimapZoneText()) + T.currentZoneArea = GetCurrentMapAreaID() + print('Updating zone ID to', T.currentZoneArea, '=', GetZoneText(), GetMinimapZoneText()) return OBJECTIVE_TRACKER_UPDATE_TASK_ADDED @@ -293,8 +330,8 @@ Event.PLAYER_MONEY = function() - if mod.watchMoneyReasons > 0 then - return mod.watchMoneyReasons + if T.watchMoneyReasons > 0 then + return T.watchMoneyReasons end end Event.CRITERIA_COMPLETE = function() @@ -302,14 +339,14 @@ end Event.QUEST_TURN_IN = function(questID, xp, money) if ( IsQuestTask(questID) ) then - mod.Bonus:OnTurnIn(questID, xp, money) + T.Bonus:OnTurnIn(questID, xp, money) print('updating bonus modules (code', OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE, ',', questID, xp, money) return OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE, questID, xp, money else return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST, questID, xp, money end end -mod.Event = Event +T.Event = Event --- Done once per ui load local BlizzHooks = { @@ -325,67 +362,33 @@ } local VeneerData -mod.SetWatchMoney = function(watchMoney, reason) +T.SetWatchMoney = function(watchMoney, reason) if watchMoney then - if band(mod.watchMoneyReasons, reason) == 0 then - mod.watchMoneyReasons = mod.watchMoneyReasons + reason; + if band(T.watchMoneyReasons, reason) == 0 then + T.watchMoneyReasons = T.watchMoneyReasons + reason; end else - if band(mod.watchMoneyReasons, reason) > 0 then - mod.watchMoneyReasons = mod.watchMoneyReasons - reason; + if band(T.watchMoneyReasons, reason) > 0 then + T.watchMoneyReasons = T.watchMoneyReasons - reason; end end end -mod.animateReasons = 0 -mod.SetAnimate = function(animate, reason) +T.animateReasons = 0 +T.SetAnimate = function(animate, reason) if animate then - if band(mod.animateReasons, reason) == 0 then - mod.animateReasons = mod.animateReasons + reason + if band(T.animateReasons, reason) == 0 then + T.animateReasons = T.animateReasons + reason end else - if band(mod.animateReasons, reason) > 0 then - mod.animateReasons = mod.animateReasons - reason + if band(T.animateReasons, reason) > 0 then + T.animateReasons = T.animateReasons - reason end end end - -function mod:OnInitialize() - local c = mod.Conf.Wrapper - VeneerData = _G.VeneerData - VeneerData.CallLog = VeneerData.CallLog or {} - if not mod.isHooked then - mod.isHooked = true - for blizzFunc, veneerFunc in pairs(BlizzHooks) do - if mod[veneerFunc] then - hooksecurefunc(blizzFunc, mod[veneerFunc]) - else - hooksecurefunc(blizzFunc, function(...) - print('|cFFFF0088securehook('..tostring(blizzFunc)..')|r args:', ...) - tinsert(VeneerData.CallLog, {blizzFunc, ...}) - end) - end - end - end - - mod.Conf.TasksLog = mod.Conf.TasksLog or {} - - Scroller:SetScrollChild(Scroll) - Scroller:SetWidth(c.Width) - Scroll:SetWidth(c.Width) - Scroll:ClearAllPoints() - Scroll:SetPoint('TOP', Scroller, 'TOP') - ObjectiveTrackerFrame:UnregisterAllEvents() - ObjectiveTrackerFrame:Hide() - - if B.Conf.FrameState[Wrapper:GetName()] == 0 then - Scroller:Hide() - end -end - local Play = function(file) if Devian and Devian.InWorkspace() then PlaySoundFile(file) end end -function mod:OnEvent (event, ...) +function T:OnEvent (event, ...) local isHandled print('OnEvent(|cFF00FF00'.. event ..'|r):', ...) local reason, arg1, arg2, arg3 @@ -403,7 +406,7 @@ end if reason then - mod:Update(reason, arg1, arg2, arg3) + T:Update(reason, arg1, arg2, arg3) end end else @@ -414,19 +417,54 @@ Play([[Interface\Addons\SharedMedia_MyMedia\sound\Quack.ogg]]) end if reason then - mod:Update(reason, arg1, arg2, arg3) + T:Update(reason, arg1, arg2, arg3) else print('no reason value returned') Play([[Interface\Addons\SharedMedia_MyMedia\sound\Quack.ogg]]) end + +end + + +function T:OnInitialize() + local c = T.Conf.Wrapper + VeneerData = _G.VeneerData + VeneerData.CallLog = VeneerData.CallLog or {} + if not T.isHooked then + T.isHooked = true + for blizzFunc, veneerFunc in pairs(BlizzHooks) do + if T[veneerFunc] then + hooksecurefunc(blizzFunc, T[veneerFunc]) + else + hooksecurefunc(blizzFunc, function(...) + print('|cFFFF0088securehook('..tostring(blizzFunc)..')|r args:', ...) + tinsert(VeneerData.CallLog, {blizzFunc, ...}) + end) + end + end + end + + T.Conf.TasksLog = T.Conf.TasksLog or {} + + ObjectiveTrackerFrame:UnregisterAllEvents() + ObjectiveTrackerFrame:Hide() + + + for id, name in ipairs(T.orderedNames) do + if not T.orderedHandlers[id] then + Handler_Initialize(T.DefaultHandler, name, id) + end + end + self:SetSize(c.Width, 40) + T.InitializeWidgets() end --- Done any time the the minimize button is toggled up -function mod:OnEnable() - for id, name in ipairs(mod.orderedNames) do - if not mod.orderedHandlers[id] then - Handler_Initialize(mod.DefaultHandler, name, id) - end +function T:OnEnable() + + print(B.Conf.VeneerObjectiveWrapper.enabled) + if not B.Conf.VeneerObjectiveWrapper.enabled then + return end for event, action in pairs(Event) do @@ -434,18 +472,28 @@ Wrapper:RegisterEvent(event) end - Wrapper:SetScript('OnEvent', mod.OnEvent) - local c = mod.Conf.Wrapper - Wrapper:SetWidth(c.Width) + local c = T.Conf.Wrapper - mod.InitializeWidgets() - mod:Update() + Scroller:SetScrollChild(Scroll) + Scroller:SetWidth(c.Width) + Scroll:SetWidth(c.Width) + Scroll:ClearAllPoints() + Scroll:SetPoint('TOP', Scroller, 'TOP') + self:SetScript('OnEvent', T.OnEvent) + Scroller:Show() + local from, target, to, x, y = Wrapper:GetPoint(1) + print(from, target:GetName(), to, x,y) + + T:Update() + + -- run once to prime the data structure + T.UpdateActionButtons() end -function mod:OnDisable() - Wrapper:UnregisterAllEvents() +function T:OnDisable() + self:UnregisterAllEvents() + Scroller:Hide() end - diff -r e837384ac363 -r 66b927b46776 ObjectiveTracker/ObjectiveFrame.lua --- a/ObjectiveTracker/ObjectiveFrame.lua Sun Apr 10 04:35:32 2016 -0400 +++ b/ObjectiveTracker/ObjectiveFrame.lua Mon Apr 11 09:07:40 2016 -0400 @@ -56,35 +56,7 @@ local currentPosition, anchorFrame, anchorPoint -T.colors ={ - 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}, - }, - 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 }, - } -} + T.AddBlock = function(handler, block) local print = bprint @@ -178,7 +150,7 @@ block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing) block.titlebg:SetTexture(1,1,1,1) - block.titlebg:SetGradientAlpha(unpack(colors.default.titlebg)) + block.titlebg:SetGradientAlpha(unpack(T.colors.default.titlebg)) block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0) block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing) @@ -189,9 +161,9 @@ block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0) block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0) block.statusbg:SetTexture(1,1,1,1) - block.statusbg:SetGradientAlpha(unpack(colors.default.textbg)) + block.statusbg:SetGradientAlpha(unpack(T.colors.default.textbg)) - block.SelectionOverlay:SetGradientAlpha(unpack(colors.default.selectionbg)) + block.SelectionOverlay:SetGradientAlpha(unpack(T.colors.default.selectionbg)) block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0) block.SelectionOverlay:SetPoint('BOTTOMRIGHT') @@ -751,11 +723,13 @@ Scroll:Show() end Quest.GetClosest() - + --T.UpdateActionButtons(reason) end --- Queue any active item buttons for update for that frame +local iprint = B.print('ItemButton') T.UpdateActionButtons = function(updateReason) + local print = iprint Scroller.snap_upper = 0 Scroller.snap_lower = 0 local print = B.print('ItemButton') @@ -764,7 +738,7 @@ end local previousItem - for questID, itemButton in pairs(usedButtons) do + for questID, itemButton in pairs(Quest.itemButtons) do local info= T.Quest.Info[questID] print('|cFF00FFFF'.. questID .. '|r', itemButton:GetName()) @@ -799,6 +773,7 @@ end T.UpdateBlockAction = function (block, itemButton) + local print = iprint print('**|cFF0088FF'..itemButton:GetName(), '|r:Update()') if itemButton.questID ~= block.info.questID then print('** |cFFFF0088mismatched block assignment', itemButton.questID,'<~>', block.info.questID) diff -r e837384ac363 -r 66b927b46776 ObjectiveTracker/ObjectiveTracker.xml --- a/ObjectiveTracker/ObjectiveTracker.xml Sun Apr 10 04:35:32 2016 -0400 +++ b/ObjectiveTracker/ObjectiveTracker.xml Mon Apr 11 09:07:40 2016 -0400 @@ -1,6 +1,6 @@ - + @@ -86,7 +86,7 @@ - + -