Mercurial > wow > buffalo2
changeset 62:ef4116179e2f v7.0.3-1
- cleaned up old file structure remnants
author | Nenue |
---|---|
date | Tue, 16 Aug 2016 08:37:07 -0400 |
parents | 3f083d389c18 |
children | 619dc10924af |
files | BuffFrame/BuffAnchors.lua BuffFrame/BuffButton.lua BuffFrame/BuffFrame.lua BuffFrame/BuffFrame.xml BuffFrame/Constants.lua BuffFrame/RaidBuffTray.lua Config/Config.lua Config/Config.xml Modules/BuffFrame.lua Modules/ObjectiveTracker.lua Modules/PaperDoll.lua ObjectiveTracker/APIHooks.lua ObjectiveTracker/AchievementData.lua ObjectiveTracker/AutoQuestPopupData.lua ObjectiveTracker/Block.lua ObjectiveTracker/BonusObjectiveData.lua ObjectiveTracker/Default.lua ObjectiveTracker/ExperienceBar.lua ObjectiveTracker/Layout.lua ObjectiveTracker/ObjectiveStyle.lua ObjectiveTracker/ObjectiveTracker.lua ObjectiveTracker/ObjectiveTracker.xml ObjectiveTracker/QuestData.lua ObjectiveTracker/RewardFrame.lua ObjectiveTracker/ScenarioData.lua ObjectiveTracker/Schema.lua ObjectiveTracker/SecureButton.xml ObjectiveTracker/Widgets.lua ObjectiveTracker/Widgets.xml TimeManager/TimeManager.lua TimeManager/TimeManager.xml Veneer.lua Veneer.toc Veneer.xml |
diffstat | 34 files changed, 67 insertions(+), 7222 deletions(-) [+] |
line wrap: on
line diff
--- a/BuffFrame/BuffAnchors.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/22/2016 3:10 AM - -local MODULE = 'BuffFrame' -local _, A = ... -local B, _G = A.frame, _G -local Aura = B:RegisterModule(MODULE) -local type, unpack, select, pairs, ipairs, wipe = type, unpack, select, pairs, ipairs, table.wipe -local min, ceil, mod, tonumber, tostring = min, ceil, mod, tonumber, tostring -local CreateFrame = CreateFrame -local print = B.print('Anchor') -local fprint = B.fprint -local bprint = B.print('AnchorFrame') - -local GetAnchorFrame = function(name) - local c = Aura.displays[name].conf - local anchors = Aura.anchors - local anchorFrom, anchorParent, anchorTo, offsetX, offsetY = unpack(c.Anchor) - local print = bprint - if anchors[name] and anchors[name].GetName then - print('get', Aura.anchors[name]:GetName()) - return Aura.anchors[name], anchorFrom, anchorParent, anchorTo, offsetX, offsetY - end - print('new frame', name) - local frame = CreateFrame('Frame', name..'Anchor', UIParent, Aura.displays[name].anchorTemplate) - frame.conf = c - - local x, dx, y, dy - local Anchor_OnMouseDown = function() - if c['Parent'] then - return - end - - x = frame:GetLeft() - y = frame:GetTop() - frame:StartMoving() - frame.isMoving = true - end - - local Anchor_OnMouseUp = function() - if c['Parent'] then - return - end - - frame:StopMovingOrSizing() - dx = frame:GetLeft() - x - dy = frame:GetTop() - y - -- update config - print('|cFFFFFF00**changing', name, 'anchor by', dx, dy) - offsetX = offsetX + dx - offsetY = offsetY + dy - Aura.Conf[name .. 'Anchor'] = {anchorFrom, anchorParent, anchorTo, offsetX, offsetY } - frame:SetPoint(anchorFrom, _G[anchorParent], anchorTo, offsetX, offsetY) - frame.isMoving = nil - end - - local AnchorButton_OnClick = function(self, anchor) - local point, parent, relative = anchor:GetPoint(1) - print('resetting anchors', point, parent:GetName(), relative) - Aura.Conf[name..'Point'] = {point, relative} - Aura.Conf[name..'RelativeX'] = (point:match('RIGHT')) and -1 or 1 - Aura.Conf[name..'RelativeY'] = (point:match('TOP')) and -1 or 1 - wipe(Aura.drawn[name]) - Aura.UpdateBuffs(name) - end - - frame.OnUpdate = function(self, elapsed) - print(self:GetName(), elapsed) - if self:IsMouseOver() then - for i, anchorButton in ipairs(frame.anchorButton) do - anchorButton:Show() - end - else - for i, anchorButton in ipairs(frame.anchorButton) do - anchorButton:Hide() - end - 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 - for i, anchorButton in ipairs(frame.anchorButton) do - anchorButton:SetScript('OnClick', AnchorButton_OnClick) - end - - Aura.displays[name].anchor = frame - print('displays[name].anchor', Aura.displays[name].anchor:GetName()) - print('anchors[name]', Aura.anchors[name]:GetName()) - return frame, anchorFrom, anchorParent, anchorTo, offsetX, offsetY -end - ---- Handles the preliminary positioning calculation for buff guide anchors -Aura.UpdateAnchorFrames = function(name) - local print = fprint(name) - local c = Aura.displays[name].conf - local frame, anchorFrom, anchorParent, anchorTo, offsetX, offsetY = GetAnchorFrame(name) - print('got', frame:GetName()) - frame.buffs = Aura.guides[name] - frame.heading:SetText(name) - B.SetConfigLayers(frame) - - local buffMax = c['Max'] or 3 - local perRow = c['PerRow'] or 2 - local buffSpacing = c['Spacing'] - local buffSize = c['Size'] - local buffDurationSize = c['DurationSize'] - - if not frame.isMoving then - if not B.Conf[name .. 'Parent'] then - frame:SetPoint(anchorFrom, _G[anchorParent], anchorTo, offsetX, offsetY) - end - end - - if frame.contains then buffMax = buffMax + 1 end - local cols, rows = min(perRow, buffMax), ceil(buffMax/perRow) - local spaces, breaks = (cols - 1), (rows - 1) - frame.columns = cols - frame.rows = rows - frame.spaces = cols - 1 - frame.breaks = rows - 1 - - local width = cols*buffSize + spaces*buffSpacing - local height = rows * (buffSize + buffDurationSize) + (breaks * (buffSpacing)) - - frame:SetSize(width, height) - frame:Show() - print(frame:GetName(), frame:GetSize()) - print(frame:GetPoint(1)) -end - ---- Handles placement of anchors embedded within anchors (consolidated buffs, maybe temp enchant) - --- if facing key direction, anchor point [1] to parent's point [2] -local childFacing = { - ['TOP'] = {'TOP', 'BOTTOM'}, - ['BOTTOM'] = {'BOTTOM', 'TOP'}, - ['RIGHT'] = {'LEFT', 'RIGHT'}, - ['LEFT'] = {'RIGHT', 'LEFT'}, -} --- if align in key position, concatenate value with facing point -local childAlign = { - ['TOP'] = 'TOP%s', - ['BOTTOM'] = 'BOTTOM%s', - ['MIDDLE'] = '%s', - ['LEFT'] = '%sLEFT', - ['RIGHT'] = '%sRIGHT', - ['CENTER'] = '%s', -} - ---- dep handlers -B.UpdateAnchorChild = function (frame, child, c) - if frame.attached ~= child then - B.SetAnchorChild(frame, child, c) - end - - print('positioning|cFFFF0088', child, '|r of |cFF00FF00', frame, '|r') - - local frameAnchor = unpack(B.Conf[c.Parent.. 'Anchor']) - local childAnchor, childPoint = 'BOTTOMRIGHT', 'TOPRIGHT' - local direction, position = unpack(c.Anchor) - if direction and position then - childAnchor = childAlign[position]:format(childFacing[direction][2]) - childPoint = childAlign[position]:format(childFacing[direction][1]) - print('align toward', position,'on', direction, 'edge') - end - - print(frameAnchor, direction, position) - local lX, lY, cX, cY = frame.outer_X, frame.outer_Y, frame.cutout_X, frame.cutout_Y - local mX, mY = 0, 0 -- alignment modifiers - local pX, pY = 0, 0 -- position value - print('|cFFFF0088PUSHOUTS|r:', lX, lY, '|cFFFF8800PULL-IN|r:', cX, cY) - - -- if attachment is on a moving edge - if not frameAnchor:match(direction) then - print(' child anchors to a growing edge |cFFFF8800', direction,'|r') - if direction == 'BOTTOM' then - -- horizontal edge - - else - -- vertical edge - pX = lX - end - - if frameAnchor:match(position) then - - print('close alignment', lX, cX) - if position == 'RIGHT' then - -- and far X val - pX = 0 - lX = -lX - cX = -cX - pY = lY - else - end - else - print('far alignment', position) - end - else - print(' child anchors to a static edge |cFF0088FF', direction,'|r') - -- use no Y offset, position doesn't interfere - if direction == 'BOTTOM' or direction == 'TOP' then - pY = 0 - else - pX = 0 - end - end - - local frameWidth = frame:GetWidth() - local frameHeight = frame:GetHeight() - - local overlapY, overlapX - - -- right and bottom anchors offsets need to be inverted - if direction == 'BOTTOM' then - print('inverting Y values for anchor on BOTTOM edge, options:', cY, lY, 'actual:', pY) - pY = frameHeight - pY - cY = frameHeight - cY - lY = frameHeight - lY - print(' new values:', cY, lY, pY) - elseif direction == 'RIGHT' then - pX = frameWidth -pX - cX = frameWidth-cX - lX = frameWidth-lX - end - - - print(child, '|cFFFFFF00', childAnchor, '|r', frame, '|cFFFF0088', childPoint, '|r', pX, pY) - child:ClearAllPoints() - child:SetPoint(childAnchor, frame, childPoint, pX, pY) - frame.attachPoint = {childAnchor, childPoint } - - if Devian and Devian.InWorkspace() then - frame.alignedJoint:ClearAllPoints() - frame.poppingJointX:ClearAllPoints() - frame.poppingJointY:ClearAllPoints() - frame.cuttingJointX:ClearAllPoints() - frame.cuttingJointY:ClearAllPoints() - frame.childSpace:ClearAllPoints() - - frame.alignedJoint:SetPoint(childAnchor, frame, childPoint, pX, pY) - frame.poppingJointY:SetPoint(childAnchor, frame, childPoint, lX, lY) -- should really only differ when rows exceed 1 - frame.poppingJointX:SetPoint(childAnchor, frame, childPoint, lX, lY) - frame.cuttingJointY:SetPoint(childAnchor, frame, childPoint, cX, cY) -- should really only differ when rows exceed 1 - frame.cuttingJointX:SetPoint(childAnchor, frame, childPoint, cX, cY) - frame.childSpace:SetAllPoints(child) - - frame.alignedJoint:Show() - frame.poppingJointX:Show() - frame.poppingJointY:Show() - frame.cuttingJointX:Show() - frame.cuttingJointY:Show() - frame.childSpace:Show() - - print('|cFFFF0000MIN |r', childAnchor, childPoint, pX, pY) - print('|cFF00FFFFFAR |r', childAnchor, childPoint, cX, cY) - print('|cFFFFFF00CLOSE|r', childAnchor, childPoint, lX, lY) - - end -end - -B.SetAnchorChild = function(frame, child, c) - print('linking', child) - frame.attached = child - frame.attachmentConf = c -end \ No newline at end of file
--- a/BuffFrame/BuffButton.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,415 +0,0 @@ ---- Actual BlizzUI modifications are applied here --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/12/2016 12:47 AM -local MODULE = 'BuffFrame' - -local _ -local B, _G = select(2,...).frame, _G -local type, unpack, select, pairs, ipairs = _G.type, _G.unpack, _G.select, _G.pairs, _G.ipairs -local min, ceil, mod, tonumber, tostring = _G.min, _G.ceil, _G.mod, _G.tonumber, _G.tostring -local floor, wipe, max = _G.math.floor, _G.table.wipe, _G.math.max -local CreateFrame, IsInGroup, GetCVarBool = _G.CreateFrame, _G.IsInGroup, _G.GetCVarBool -local BuffFrame, ConsolidatedBuffs = _G.BuffFrame, _G.ConsolidatedBuffs -local UnitAura, UnitName, RegisterStateDriver = _G.UnitAura, _G.UnitName, _G.RegisterStateDriver - -local Aura = B:RegisterModule(MODULE) -local displays = Aura.displays -local print, gprint, aprint, fprint = B.print('Buff'), B.print('SetGuides'), B.print('SetAnchors'), B.fprint - -Aura.GetBuffZoom = function(buffName) - local zoom = tonumber(Aura.displays[buffName].conf['Zoom']) / 100 / 2 - local zoomL, zoomU, zoomR, zoomD = zoom, zoom, 1-zoom, 1-zoom - print(buffName, zoom) - return function(self, ...) - if select('#',...) == 4 then - zoomL, zoomR, zoomU, zoomD = ... - end - self:SetTexCoord(zoomL, zoomR, zoomU, zoomD) - return zoomL, zoomR, zoomU, zoomD - end -end - - - -Aura.UpdateButtonAlpha = function(self) - if not self.parent.timeLeft or not self:IsVisible() then - self:SetScript('OnUpdate', nil) - return - end - - if self.parent.timeLeft < _G.BUFF_WARNING_TIME then - self:SetAlpha(BuffFrame.BuffAlphaValue) - else - self:SetAlpha(1) - end -end - ---- Called infrequently to align stencil frames -local refreshCount = 0 -Aura.UpdateGuideFrames = function(buffName) - refreshCount = refreshCount + 1 - local print = fprint() - print(buffName) - local displays, anchors = Aura.displays, Aura.anchors - local guides, decors = Aura.guides, Aura.decors - - local anchor = anchors[buffName] - local c, g, d = displays[buffName].conf, guides[buffName], decors[buffName] - local perRow = c['PerRow'] - local buffSpacing, buffSize, buffBorder, buffDurationSize, buffCountSize, relativeX, relativeY = c['Spacing'], c['Size'], c['Border'], c['DurationSize'], c['CountSize'], c['RelativeX'], c['RelativeY'] - local consolidated = (anchors[buffName].contains and IsInGroup()) - local consolidatedPosition = (consolidated and anchors[buffName].containPosition or 0) - - - print('|cFF00FF00Setting Guides ('..refreshCount..'):|r', buffName, 'user max:',c['Max'], 'hard max:', displays[buffName].maxIcons) - - local buffMax = min(c['Max'], displays[buffName].maxIcons) - local anchorFrom, anchorTo = c.Point[1], c.Point[2] - anchor.Zoom = Aura.GetBuffZoom(buffName) - - - - if consolidated then - buffMax = buffMax + 1 - end - - local legend = {} - legend.r, legend.g, legend.b, legend.a = unpack(displays[buffName].legendColor) - local horizFrom = (relativeX < 0) and 'RIGHT' or 'LEFT' - local horizTo = (relativeX < 0) and 'LEFT' or 'RIGHT' - local vertFrom = (relativeY < 0) and 'TOP' or 'BOTTOM' - local vertTo = (relativeY < 0) and 'BOTTOM' or 'TOP' - local previous, up - local bottom_extent = 0 - for i = 1, buffMax do - print('update idx', i) - if not g[i] then - g[i] = CreateFrame('Frame', buffName..'Guide'..i, anchor, displays[buffName].template or 'VeneerGuideTemplate') - RegisterStateDriver(g[i], "visibility", "[petbattle] [vehicleui] hide; show") - end - - local guide = g[i] - - local row = ceil(i / perRow) - local col = mod(i, perRow) - if col == 0 then - col = perRow - end - - guide.previous = previous - guide.up = up - local x, y, parent = 0, 0, anchor - if i == 1 then - parent = anchor - up = guide - elseif col == 1 then - parent = g[i-perRow] - y = (buffSpacing + bottom_extent) * relativeY - up = guide - anchorFrom = vertFrom .. horizFrom - anchorTo = vertFrom .. horizFrom - bottom_extent = 0 - else - parent = g[i-1] - x = buffSpacing * relativeX - anchorFrom = vertFrom .. horizFrom - anchorTo = vertFrom .. horizTo - end - previous = guide - guide.parent = parent - - --------------------------------- - -- Positioning layer - if i ~= consolidatedPosition or not consolidated then - guide:SetSize(buffSize, buffSize + buffDurationSize) - -- RaidBuffTray will fix the sizing - end - bottom_extent = max(bottom_extent, guide:GetHeight()) - - guide.info = {} -- UnitAura cache - - if i == consolidatedPosition then - guide.legend:SetColorTexture(1,1,0,0.5) - else - guide.legend:SetColorTexture(legend.r, legend.g, legend.b, legend.a) - end - - guide.idText:SetText(i) -- needs to reflect the current position - - guide:ClearAllPoints() - guide:SetPoint(anchorFrom, parent, anchorTo, x, y) - print(anchorFrom, parent, anchorTo, x, y) - - guide.icon:SetSize(buffSize - buffBorder * 2, buffSize - buffBorder * 2) - guide.icon:ClearAllPoints() - guide.icon:SetPoint('TOPLEFT', guide, 'TOPLEFT', buffBorder, -buffBorder ) - - local anchorTo, anchorFrom, x, y = unpack(c.DurationPoint) - guide.duration:ClearAllPoints() - guide.duration:SetPoint(anchorTo, guide, anchorFrom, x, y) - --guide.duration:SetSize(buffSize, buffDurationSize) - print(' duration ->', anchorFrom, anchorTo, x, y) - - local anchorTo, anchorFrom, x, y = unpack(c.CountPoint) - guide.count:ClearAllPoints() - guide.count:SetPoint(anchorTo, guide.icon, anchorFrom, x, y) - --guide.count:SetSize(buffSize, c.CountSize) - print(' count ->', anchorFrom, anchorTo, x, y) - - ----------------------------------- - -- Background decorations layer - if not d[i] then - d[i] = CreateFrame('Frame', buffName..i..'Decor', _G.UIParent, 'VeneerDecorTemplate') - -- todo: sort out a way to fix this without creating taint issues - RegisterStateDriver(d[i], "visibility", "[petbattle] [vehicleui] hide") - end - - d[i]:SetPoint('BOTTOMLEFT', guide.icon, 'BOTTOMLEFT', -buffBorder, -buffBorder) - d[i]:SetPoint('TOPRIGHT', guide.icon, 'TOPRIGHT', buffBorder, buffBorder) - - - guide:Show() - B.SetConfigLayers(guide) - end - - - if #guides[buffName] > buffMax then - local lim = #guides[buffName] - for i = buffMax+1, lim do - - local g = guides[buffName][i] - if g:IsVisible() then - print('cleaning up #', i, buffName) - g:Hide() - B.RemoveConfigLayers(g) - end - - end - end - - anchor.last = previous - anchor.up = up - - print(anchor:GetName(), anchor:GetSize()) -end - -Aura.UpdateButtonPositions = function(buffName, auraType) - local print = fprint() - local c = auraType.conf - local numBuffs = 0 - local actualIcons = auraType.actualIcons() - local maxIcons = auraType.maxIcons - local guides, decors, anchors, drawn = Aura.guides, Aura.decors, Aura.anchors, Aura.drawn - - local anchor = anchors[buffName] - local buffMax = c['Max'] - local consolidated = (anchor.contains and IsInGroup()) - local consolidatedPosition = (consolidated and anchor.containPosition or 0) - - for k,v in pairs(decors[buffName]) do - print(v) - end - - if consolidated then - decors[buffName][1]:Hide() - numBuffs = numBuffs + 1 - buffMax = buffMax + 1 - end - - print(' ', 'frame count:', auraType.actualIcons(), 'hardmax:', maxIcons) - if auraType.actualIcons() > 0 then - for i = 1, actualIcons do - - - local buff = _G[buffName .. i] - local buffIcon = _G[buffName .. i .. 'Icon'] - local buffBorder = c['Border'] - local buffDuration = _G[buffName .. i .. 'Duration'] - local buffCount = _G[buffName .. i .. 'Count'] - local buffDurationSize = c['DurationSize'] - local debuffBorder = _G[buffName .. i .. 'Border'] - - - if buff and not buff.consolidated then - numBuffs = numBuffs + 1 - local guide = guides[buffName][numBuffs] - local deco = decors[buffName][numBuffs] - if numBuffs > buffMax then - -- if a limit is reached, start hiding - if guide then - guide.info = nil - end - if deco then - deco:Hide() - end - buff:Hide() - else - local buffData = guide.info - buffData.name, buffData.rank, buffData.icon, buffData.count, buffData.dispelType, buffData.duration, buffData.expires, buffData.caster, buffData.isStealable, buffData.shouldConsolidate, buffData.spellID, buffData.canApplyAura, buffData.isBossDebuff, buffData.value1, buffData.value2, buffData.value3 - = UnitAura(buff.unit, buff:GetID(), nil, buff.filters) - - if guide.caster and buffData.caster then - if (buffData.caster ~= 'player' or c.ShowSelfCast) then - guide.caster:SetText(UnitName(buffData.caster)) - else - guide.caster:SetText(nil) - end - end - - - print(numBuffs, i, buff:GetName(), buff:GetID(), decors[buffName][numBuffs]:GetName()) - - buff:SetAllPoints(guide) - buffIcon:ClearAllPoints() - buffIcon:SetPoint('TOPLEFT', guide.icon, 'TOPLEFT', 0, 0) - buffIcon:SetPoint('BOTTOMRIGHT', guide.icon, 'BOTTOMRIGHT', 0, 0) - - deco.parent = buff - -- make sure so they aren't re-shown in pet battle - if not C_PetBattles.IsInBattle() then - deco:Show() - deco:SetAlpha(1) - end - - if debuffBorder then - deco.background:SetColorTexture(debuffBorder:GetVertexColor()) - debuffBorder:Hide() - else - if guide.info.caster == 'player' then - print(guide.info.caster) - deco.background:SetColorTexture(unpack(c.PlayerColor)) - elseif buffData.isBossDebuff then - print(guide.info.isBossDebuff) - deco.background:SetColorTexture(unpack(c.BossColor)) - else - print(guide.info.caster) - deco.background:SetColorTexture(unpack(c.Color)) - end - end - - - buffDuration:ClearAllPoints() - local from, to = unpack(c.DurationPoint) - buffDuration:SetPoint(from, guide.duration, to) - buffDuration:SetText('WHAT') - - if buff.timeLeft and c.WarningFade then - deco:SetScript('OnUpdate', Aura.UpdateButtonAlpha) - else - deco:SetScript('OnUpdate', nil) - deco:SetAlpha(1.0) - end - - buffCount:ClearAllPoints() - local from, to = unpack(c.CountPoint) - buffCount:SetPoint(from, guide.count, to) - - if not drawn[buffName][numBuffs] then - anchors[buffName].Zoom(buffIcon) - - if buffDuration then - local font = buffDuration:GetFont() - buffDuration:SetFont(font, c.DurationSize, 'OUTLINE') - - end - - if buffCount then - local font = buffCount:GetFont() - buffCount:SetFont(font, c.CountSize, 'OUTLINE') - end - drawn[buffName][numBuffs] = true - end - end - end - - end - end - -- clear any outliers - for i = numBuffs+1, buffMax do - if guides[buffName][i].caster then - guides[buffName][i].caster:SetText(nil) - end - --if not decors[buffName][i].parent or - - decors[buffName][i].parent = nil - decors[buffName][i]:SetAlpha(1.0) - decors[buffName][i]:SetScript('OnUpdate', nil) - decors[buffName][i]:Hide() - end - - -- parametric occlusion data for compacted anchor points - if numBuffs == 0 then - anchor.cutout_X = 0 - anchor.cutout_Y = 0 - anchor.outer_X = 0 - anchor.outer_Y = 0 - elseif numBuffs <= buffMax then - local sX, sY = guides[buffName][numBuffs]:GetWidth(), guides[buffName][numBuffs]:GetHeight() - local p = c.PerRow - local lX = mod(numBuffs, p) - local lY = floor(numBuffs / p) - local oX = min(numBuffs, c.PerRow) - local oY = ceil(numBuffs / p) - anchor.cutout_X = lX * sX + lX * c.Spacing -- max clearance to fit alongside the row - anchor.cutout_Y = lY * sY + lY * c.Spacing - anchor.outer_Y = oY * sY + oY * c.Spacing -- distance of farthest row - anchor.outer_X = oX * sX + oX * c.Spacing - - - print('|cFF0088FF', 'inner corner', lX, lY, 'outer corners', oX, oY) - print('cutout delta =', anchor.cutout_X, anchor.cutout_Y, 'out of', floor(anchor:GetWidth()), floor(anchor:GetHeight())) - print('extent delta =', anchor.outer_X, anchor.outer_Y) - else - anchor.cutout_X = 0 - anchor.cutout_Y = 0 - anchor.outer_X = 0 - anchor.outer_Y = 0 - end - - if anchor.attached then - Aura.UpdateAnchorChild(anchor, anchor.attached, anchor.attachmentConf) - end - -end - -Aura.PostBuffAnchors = function() - local print = fprint() - local anchors = Aura.anchors - if Aura.ShowConsolidatedBuffs then - Aura.UpdateRaidBuffs() - end - for buttonName, auraType in pairs(displays) do - print('sending', buttonName, auraType) - -- if waiting for anchors - if not anchors[buttonName] then - return - end - - --if positioned[buttonName] == 0 then - print('possibly reloaded UI, check positions') - Aura.UpdateGuideFrames(buttonName) - --end - - Aura.UpdateButtonPositions(buttonName, auraType) - end -end - -Aura.UpdateBuffs = function(buttonName, forced) - local displays, drawn = Aura.displays, Aura.drawn - local print = B.fprint(buttonName) - local c = displays[buttonName].conf - if drawn[buttonName] then - wipe(drawn[buttonName]) - else - drawn[buttonName] = {} - end - - Aura.UpdateAnchorFrames(buttonName) - Aura.UpdateGuideFrames(buttonName) - Aura.UpdateButtonPositions(buttonName, displays[buttonName]) -end - ---- should only be called from user input -print('init def') \ No newline at end of file
--- a/BuffFrame/BuffFrame.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ --------------------------------------------- --- Veneer --- Nick --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/28/2016 5:58 AM --------------------------------------------- - -local B = select(2,...).frame -local Aura = B:RegisterModule('BuffFrame') - -Aura.PlayerBuffsActive = {} -function Aura:OnInitialize() - local displays = Aura.displays - - -- suffix tables - Aura.drawn = B.Abstract(displays, 'drawn', Aura.drawn ) - -- Lesser extent of guide frames that have been positioned - Aura.positioned = B.Abstract(displays, 'positioned', Aura.positioned) - -- Backdrop style frame - Aura.decors = B.Abstract(displays, 'decorator', Aura.decors) - -- Static positioning frames - Aura.guides = B.Abstract(displays, 'guides', Aura.guides) - -- Anchor points for guides - Aura.anchors = B.Abstract(displays, 'anchor', Aura.anchors) - -- Stored functions for doing icon texture adjustments - Aura.zoom = B.Abstract(displays, 'zoom', Aura.zoom ) - - - for name, display in pairs(displays) do - display.conf = setmetatable({}, { - __index = function(_, k) - --print('config check '.. name .. k) - return Aura.Conf[name .. k] or Aura.Conf['BuffButton' .. k] - end, - __newindex = function(_, k , v) - Aura.Conf[name..k] = v - end, - }) - end - - Aura:RegisterUnitEvent("UNIT_AURA", "player", "vehicle") - Aura:RegisterEvent("GROUP_ROSTER_UPDATE") - Aura:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") - hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", Aura.PostBuffAnchors) - --hooksecurefunc("RaidBuffTray_Update", Aura.UpdateRaidBuffs) -end - -function Aura:OnUpdate () - local displays = Aura.displays - Aura.ShowConsolidated = (IsInGroup() and GetCVarBool("consolidateBuffs")) - Aura.ShowMissingBuffs = (IsInGroup() and Aura.Conf.RaidShowMissing) - - for name, auraType in pairs(displays) do - - Aura.UpdateBuffs(auraType.buffName, true) - --print(name, auraType) - _G[name..'Anchor']:EnableMouse(B.Conf.ConfigMode) - end - - Aura.UpdateRaidBuffs() - Aura.UpdateBuffsTodo() -end \ No newline at end of file
--- a/BuffFrame/BuffFrame.xml Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -<Ui> - <!-- - Veneer - BuffFrame module - --> - - - <!-- Buff-button underlay --> - <Frame name="VeneerDecorTemplate" virtual="true" enableMouse="true" movable="true" frameStrata="BACKGROUND" hidden="true"> - <Size x="30" y="30" /> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentButtonArea" setAllPoints="true" parentKey="background" alphaMode="BLEND"> - <Color r="1" g="1" b="1" a="1" /> - </Texture> - <Texture name="$parentButtonBackdrop" parentKey="backgroundFill" alphaMode="BLEND"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="1" y="1" relativeKey="$parent.background" /> - <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-1" y="-1" relativeKey="$parent.background" /> - </Anchors> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <!-- Buff button overlay, and positioning anchor --> - <Frame name="VeneerGuideTemplate" virtual="true" movable="true" frameStrata="LOW"> - <Scripts> - <OnShow> - self.mouseover = self:IsMouseOver() - </OnShow> - <OnUpdate> - if self:IsMouseOver() and not self.contains then - self.caster:Show() - else - self.caster:Hide() - end - </OnUpdate> - </Scripts> - <Layers> - <Layer level="ARTWORK"> - <Texture name="$parentLegend" parentKey="legend" parentArray="config" setAllPoints="true" hidden="true"> - <Color a="0.5" r="0" g="1" b="0" /> - </Texture> - <Texture name="$parentCountLegend" parentKey="count" parentArray="config" hidden="true"> - <Color a="0.75" r="1" g=".5" b="0" /> - </Texture> - - - <Texture name="$parentIconArea" parentKey="icon" alphaMode="ADD"> - <Color r="0" g="0" b="0" a="0" /> - </Texture> - <Texture name="$parentTextLegend" parentKey="duration" parentArray="config" hidden="true" alphaMode="BLEND"> - <Color a="0.25" r="1" g="1" b="1" /> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString inherits="VeneerFontNormal" parentArray="config" name="$parentID" parentKey="idText" hidden="true" outline="NORMAL"> - <Anchors> - <Anchor point="CENTER" /> - </Anchors> - </FontString> - <FontString inherits="VeneerFontNormal" parentKey="caster" outline="NORMAL"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeKey="$parent.icon" /> - </Anchors> - </FontString> - </Layer> - <Layer level="HIGHLIGHT"> - - </Layer> - </Layers> - </Frame> - - - <!-- Anchor frame orientation-setting widget; click handler copies frame anchors over to buff buttons --> - <Button name="VeneerAnchorButton" virtual="true" parentArray="anchorButton" hidden="true"> - <Scripts> - <OnClick> - self:GetParent():SetChildAnchors(self) - </OnClick> - </Scripts> - <Size x="15" y="15" /> - <Layers> - <Layer level="BACKGROUND"> - <Texture setAllPoints="true"> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <Texture> - <Color r="0" g="1" b="0.5" a="1" /> - <Anchors> - <Anchor point="BOTTOMLEFT" x="1" y="1" /> - <Anchor point="TOPRIGHT" x="-1" y="-1" /> - </Anchors> - </Texture> - </Layer> - </Layers> - </Button> - - <Frame name="VeneerAnchorTemplate" virtual="true" enableMouse="false" movable="true" sizable="true" clampedToScreen="true"> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBackground" setAllPoints="true" parentArray="config" hidden="true"> - <Color r="0" g="0.2" b="1" a="0.2" /> - </Texture> - <FontString name="$parentHeading" inherits="VeneerFontHighlight" parentArray="config" parentKey="heading" hidden="true"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" /> - </Anchors> - </FontString> - <FontString name="$parentDebug" inherits="VeneerFontNormal" parentArray="debug" parentKey="debug"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" /> - </Anchors> - </FontString> - </Layer> - <Layer level="OVERLAY"> - - <Texture name="$parentCutJoint" parentKey="alignedJoint" hidden="true"> - <Size x="4" y="4" /> - <Color r="1" g="0" b="0" a="1" /> - </Texture> - <Texture name="$parentCutY" parentKey="cuttingJointX" hidden="true"> - <Size x="4" y="48" /> - <Color r="1" g="1" b="0" a="1" /> - </Texture> - <Texture name="$parentCutX" parentKey="cuttingJointY" hidden="true"> - <Size x="48" y="4" /> - <Color r="1" g="1" b="0" a="1" /> - </Texture> - <Texture name="$parentPoppedY" parentKey="poppingJointX" hidden="true"> - <Size x="4" y="48" /> - <Color r="0" g="1" b="1" a="1" /> - </Texture> - <Texture name="$parentPoppedX" parentKey="poppingJointY" hidden="true"> - <Size x="48" y="4" /> - <Color r="0" g="1" b="1" a="1" /> - </Texture> - <Texture name="$parentChildSpace" parentKey="childSpace" hidden="true"> - <Color r="0" g=".5" b="1" a="0.5" /> - </Texture> - </Layer> - <Layer level="HIGHLIGHT"> - <Texture name="$parentHighlight" setAllPoints="true" parentArray="config" hidden="true"> - <Color r="1" g="1" b="0" a="0.2" /> - </Texture> - </Layer> - </Layers> - <Frames> - <Button name="$parentAnchorUL" inherits="VeneerAnchorButton"> - <Anchors> - <Anchor point="TOPLEFT" /> - </Anchors> - </Button> - <Button name="$parentAnchorUR" inherits="VeneerAnchorButton"> - <Anchors> - <Anchor point="TOPRIGHT" /> - </Anchors> - </Button> - <Button name="$parentAnchorUR" inherits="VeneerAnchorButton"> - <Anchors> - <Anchor point="BOTTOMRIGHT" /> - </Anchors> - </Button> - <Button name="$parentAnchorUR" inherits="VeneerAnchorButton"> - <Anchors> - <Anchor point="BOTTOMLEFT" /> - </Anchors> - </Button> - </Frames> - </Frame> - - <Frame name="VeneerConsolidatedBuffsAnchor" inherits="VeneerAnchorTemplate" virtual="true"> - <Layers> - <Layer level="OVERLAY"> - <!-- need to make our own number label since the original is buried under secure layer --> - <FontString inherits="VeneerFontNormal" name="$parentLabel" parentKey="label"> - <Anchors> - <Anchor point="TOP" relativePoint="BOTTOM" x="0" y="-2" /> - </Anchors> - </FontString> - <!-- - <Texture name="$parentBackdrop" parentKey="background" setAllPoints="true" alphaMode="BLEND"> - <Color r="0" g="0" b="0" a="1" /> - <Anchors> - <Anchor point="BOTTOMLEFT" x="1" y="1" /> - <Anchor point="TOPRIGHT" x="-1" y="-1" /> - </Anchors> - </Texture> - <Texture name="$parentIcon" parentKey="border" setAllPoints="true" alphaMode="BLEND"> - <Color r="1" g="1" b="1" a="1" /> - </Texture> - --> - </Layer> - </Layers> - </Frame> - - <Frame name="VeneerRaidBuffTemplate" virtual="true" enableMouse="false"> - <Layers> - <Layer level="ARTWORK"> - <Texture name="$parentLegend" parentKey="legend" parentArray="config" setAllPoints="true" hidden="true"> - <Color a="0.5" r="0" g="1" b="0" /> - </Texture> - <Texture name="$parentCountLegend" parentKey="count" parentArray="config" hidden="true"> - <Color a="0.75" r="1" g=".5" b="0" /> - </Texture> - - - <Texture name="$parentIconArea" parentKey="icon" alphaMode="ADD"> - <Color r="0" g="0" b="0" a="0" /> - </Texture> - <Texture name="$parentTextLegend" parentKey="duration" parentArray="config" hidden="true" alphaMode="BLEND"> - <Color a="0.25" r="1" g="1" b="1" /> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString inherits="VeneerFontNormal" parentArray="config" name="$parentSymbol" parentKey="symbol"> - <Anchors> - <Anchor point="TOP" /> - </Anchors> - </FontString> - <FontString inherits="VeneerFontNormal" parentArray="config" name="$parentID" parentKey="idText" hidden="true"> - <Anchors> - <Anchor point="BOTTOM" /> - </Anchors> - </FontString> - </Layer> - </Layers> - </Frame> - - <Button name="VeneerMissingBuffTemplate" virtual="true"> - <Scripts> - <OnClick> - if self.spell and not InCombatLockdown() then - CastSpellByID(self.spell) - end - </OnClick> - </Scripts> - <Layers> - <Layer level="BORDER"> - <Texture setAllPoints="true"> - <Color r="1" g="1" b="1" a="0.25" /> - </Texture> - </Layer> - <Layer level="ARTWORK"> - <Texture name="$parentIcon" parentKey="icon"> - <Size x="20" y="20" /> - <Anchors> - <Anchor point="LEFT" /> - </Anchors> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString name="$parentLabel" parentKey="label" inherits="VeneerFontNormal" justifyH="LEFT"> - <Anchors> - <Anchor point="LEFT" relativePoint="RIGHT" relativeKey="icon" /> - </Anchors> - </FontString> - </Layer> - </Layers> - </Button> - - <Script file="Constants.lua" /> - <Script file="BuffAnchors.lua" /> - <Script file="RaidBuffTray.lua" /> - <Script file="BuffButton.lua" /> - <Script file="BuffFrame.lua" /> -</Ui> \ No newline at end of file
--- a/BuffFrame/Constants.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,344 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/22/2016 3:14 PM -local _, A = ... -local B = A.frame -local Aura = B:RegisterModule('BuffFrame') ------------------------ --- Buff frames metadata ------------------------ -local legendAlpha = 0.5 -Aura.guides = {} -Aura.decors = {} -Aura.anchors = {} -Aura.drawn = {} -Aura.positioned = {} - -Aura.displays = {} -Aura.displays.BuffButton = { - legendColor = {0, 1, 0, legendAlpha}, - maxIcons = BUFF_MAX_DISPLAY, - actualIcons = function () return _G.BUFF_ACTUAL_DISPLAY end, - buffName = 'BuffButton', - drawCount = {}, - filters = 'HELPFUL', - anchorTemplate = 'VeneerAnchorTemplate', -} -Aura.displays.DebuffButton = { - legendColor = {1, 0, 0, legendAlpha}, - maxIcons = DEBUFF_MAX_DISPLAY, - actualIcons = function () return _G.DEBUFF_ACTUAL_DISPLAY end, - buffName = 'DebuffButton', - drawCount = {}, - filters = 'HARMFUL', - anchorTemplate = 'VeneerAnchorTemplate', -} -Aura.displays.TempEnchant = { - legendColor = {1, 0, 0.5, legendAlpha}, - maxIcons = NUM_TEMP_ENCHANT_FRAMES, - actualIcons = function () return BuffFrame.numEnchants end, - buffName = 'TempEnchant', - drawCount = {}, - anchorTemplate = 'VeneerAnchorTemplate', -} - ------------------------ --- RaidBuff visual args ------------------------ -Aura.BuffStyles = { - ["active"] = { - SetDesaturated = false, - Color = {1, 1, 1, 1}, - SetBlendMode = 'BLEND', - TextColor = {1,1,1,1}, - }, - ["missing"] = { - SetDesaturated = false, - Color = {1, 0, 0, 0.5}, - SetBlendMode = 'ADD', - TextColor = {1,0,0,1}, - }, - ["available"] = { - SetDesaturated = true, - Color = {0.35, 1, 0.35, 0.5}, - SetBlendMode = 'ADD', - TextColor = {1, 1, 0, 1}, - }, -} - ---- RaidBuff availability criteria --- @field spellID - UnitAura() == true --- @field spec - test for spec choice --- @field auraType - UnitAura() == true, and no other tests of the same value have returned true prior --- @field talent - test for talent selection --- @field petFamily - test pet family --- @field [true] - passive group aura -Aura.ClassRaidBuffs = { - -- stats - [1] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 160206, spellName = 'Lone Wolf: Power of the Primates', auraType = 'lonewolf'}, - {petFamily = 'Dog'}, -- active pet family - {petFamily = 'Gorilla'}, - {petFamily = 'Shale Spider'}, - {petFamily = 'Worm'}, - }, - ['DRUID'] = { - {spellID = 1126, spellName = 'Mark of the Wild'}, - }, - ['MONK'] = { - {spellID = 115921, spellName = 'Legacy of the Emperor'}, - {spellID = 116781, spellName = 'Legacy of the White Tiger'} -- windwalker, replaces emperor internally - }, - ['PALADIN'] = {spellID = 20217, spellName = 'Blessing of Kings', auraType = 'blessing'}, - }, - - -- stamina - [2] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 160199, spellName = 'Lone Wolf: Fortitude of the Bear', auraType = 'lonewolf'}, - {petFamily = 'Bear'}, -- active pet family - {petFamily = 'Goat'}, - {petFamily = 'Rylak'}, - {petFamily = 'Silithid'}, - }, - ['PRIEST'] = { - {spellID = 21562, 'Power Word: Fortitude'} - }, - ['WARRIOR'] = { - {spellID = 469, spellName = 'Commanding Shout', auraType = 'shout'} - }, - ['WARLOCK'] = { - {true} - } - }, - - -- attack power - [3] = { - ['HUNTER'] = { - {true}, - }, - ['DEATHKNIGHT'] = { - {spec = 2}, - {spec = 3}, - }, - ['WARRIOR'] = { - {spellName = 'Battle Shout', auraType = 'shout'} - } - }, - - -- HASTE - [4] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 160203, spellName = 'Lone Wolf: Haste of the Hyena', auraType = 'lonewolf'}, - {petFamily = 'Hyena'}, -- active pet family - {petFamily = 'Sporebat'}, - {petFamily = 'Rylak'}, - {petFamily = 'Wasp'}, - }, - ['DEATHKNIGHT'] = { - {spec = 2}, -- unholy aura - {spec = 3}, - }, - ['PRIEST'] = { - {spec = 3}, -- mind quickening - }, - ['ROGUE'] = { - true -- swiftblade's - }, - ['SHAMAN'] = { - true -- grace of air - }, - }, - - -- SPELL POWER - [5] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 160205, spellName = 'Lone Wolf: Wisdom of the Serpent', auraType = 'lonewolf'}, - {petFamily = 'Waterstrider'}, -- active pet family - {petFamily = 'Serpent'}, - {petFamily = 'Silithid'}, - }, - ['MAGE'] = { - {spellID = 1459, spellName = 'Arcane Brilliance'}, -- arcane brilliance - {spellID = 61316, spellName = 'Dalaran Brilliance'}, -- dalaran brilliance - }, - ['WARLOCK'] = { - {spellID = 109773,spellName = 'Dark Intent' } - }, - }, - - -- CRITICAL STRIKE - [6] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 160200, spellName = 'Lone Wolf: Ferocity of the Raptor', auraType = 'lonewolf'}, - {petFamily = 'Devilsaur'}, -- active pet family - {petFamily = 'Quilen'}, - {petFamily = 'Raptor'}, - {petFamily = 'Shale Spider'}, - {petFamily = 'Waterstrider'}, - {petFamily = 'Wolf'}, - }, - ['DRUID'] = { - {spec = 2, spellID = 17007, auraType = 'druidform'} - }, - ['MAGE'] = { - {spellID = 1459, spellName = 'Arcane Brilliance'}, -- arcane brilliance - {spellID = 61316, spellName = 'Dalaran Brilliance'}, -- dalaran brilliance - }, - ['MONK'] = { - {spellID = 116781, spellName = 'Legacy of the White Tiger', spec = 2} -- windwalker - } - }, - - -- MASTERY - [7] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 160198, spellName = 'Lone Wolf: Grace of the Cat', auraType = 'lonewolf'}, - {petFamily = 'Cat'}, -- active pet family - {petFamily = 'Hydra'}, - {petFamily = 'Spirit Beast'}, - {petFamily = 'Tallstrider'}, - }, - ['DEATHKNIGHT'] = { - {spec = 1} - }, - ['DRUID'] = { - {spec = 1, spellID = 24907, auraType = 'druidform'}, - }, - ['PALADIN'] = { - {spec = 1, spellID = 19740, spellName = 'Blessing of Might', auraType = 'blessing'} - }, - ['SHAMAN'] = {true}, - }, - - -- MULTISTRIKE - [8] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 172968, spellName = 'Lone Wolf: Quickness of the Dragonhawk', auraType = 'lonewolf'}, - {petFamily = 'Bat'}, -- active pet family - {petFamily = 'Clefthoof'}, - {petFamily = 'Corehound'}, - {petFamily = 'Dragonhawk'}, - {petFamily = 'Wind Serpent'}, - }, - ['MONK'] = { - {spec = 2 } - }, -- Windflurry, - ['PRIEST'] = { - {spec = 3 } - }, -- quickening, - ['ROGUE'] = {true}, -- swiftblade's - ['WARLOCK'] = { - {spellID = 109773,spellName = 'Dark Intent' } - }, - }, - - -- VERSATILITY - [9] = { - ['HUNTER'] = { - {talent = {155228}, spellID = 172967, spellName = 'Lone Wolf: Versatility of the Ravager', auraType = 'lonewolf'}, - {petFamily = 'Ravager'}, -- active pet family - {petFamily = 'Boar'}, - {petFamily = 'Porcupine'}, - {petFamily = 'Clefthoof'}, - {petFamily = 'Stag'}, - {petFamily = 'Worm'}, - {petFamily = 'Bird of Prey'}, - }, - ['DEATH KNIGHT'] = { - {spec = 2}, -- unholy aura - {spec = 3}, - }, - ['DRUID'] = { - {spellID = 1126, spellName = 'Mark of the Wild'}, - }, - ['PALADIN'] = { - {spec = 2}, -- retribution - }, - ['WARRIOR'] = { - {spec = 2}, -- arms or fury - {spec = 3}, - }, - } -} - -------------------------- --- Default config values -------------------------- -Aura.defaults = { - -- defaulted to on for first-time setup - ConfigMode = true, - GuidesMode = true, - - BuffButtonAnchor = {'TOPRIGHT', 'UIParent', 'TOPRIGHT', -300, -5}, - BuffButtonMax = 24, - BuffButtonPerRow = 10, - BuffButtonSize = 50, - BuffButtonSpacing = 4, - BuffButtonZoom = 15, - BuffButtonVertexColor = {}, - BuffButtonPoint = {'TOPRIGHT', 'TOPRIGHT'}, - BuffButtonDurationSize = 16, - BuffButtonDurationPoint = {'BOTTOM', 'BOTTOM', 0, -1}, - BuffButtonCountSize = 18, - BuffButtonCountPoint = {'TOPRIGHT', 'TOPRIGHT', -3, -3}, - BuffButtonRelativeX = -1, - BuffButtonRelativeY = -1, - - BuffButtonColor = {1, 1, 1, 1}, - BuffButtonPlayerColor = {1,1,1,1}, - BuffButtonRaidColor = {0.25,1,0.25,1}, - BuffButtonBossColor = {1,0.5,0,1}, - BuffButtonBorder = 1, - - BuffButtonWarningFade = true, - BuffButtonShowSelfCast = true, - - DebuffButtonAnchor = {'TOPRIGHT', 'UIParent', 'TOPRIGHT', -300, -200}, - DebuffButtonMax = 12, - DebuffButtonPerRow = 10, - DebuffButtonSize = 50, - DebuffButtonSpacing = 4, - DebuffButtonDurationSize = 16, - DebuffButtonZoom = 15, - DebuffButtonVertexColor = {}, - DebuffButtonPoint = {'TOPRIGHT','TOPRIGHT'}, - DebuffButtonRelativeX = -1, - DebuffButtonRelativeY = -1, - - - TempEnchantAnchor = {'TOPRIGHT', 'UIParent', 'TOPRIGHT', -200, -300}, - TempEnchantMax = 2, - TempEnchantPerRow = 10, - TempEnchantSize = 50, - TempEnchantSpacing = 4, - TempEnchantDurationSize = 16, - TempEnchantZoom = 15, - TempEnchantVertexColor = {}, - TempEnchantPoint = {'TOPRIGHT', 'TOPRIGHT'}, - TempEnchantRelativeX = -1, - TempEnchantRelativeY = -1, - TempEnchantColor = {1,0,0.5,1}, - - ConsolidatedBuffAnchor = {'TOPRIGHT', 'UIParent', 'TOPRIGHT', 0, 0}, - ConsolidatedBuffIcon = false, - ConsolidatedBuffMax = 9, - ConsolidatedBuffSize = 16, - ConsolidatedBuffParent = 'BuffButton', - ConsolidatedBuffPosition = 1, - ConsolidatedBuffSpacing = 1, - ConsolidatedBuffBorder = 0, - ConsolidatedBuffPerRow = 3, - ConsolidatedBuffPoint = {'TOPRIGHT', 'TOPRIGHT'}, - ConsolidatedBuffRelativeX = -1, - ConsolidatedBuffRelativeY = -1, - ConsolidatedBuffDurationSize = 0, - ConsolidatedBuffDurationPoint = {'BOTTOM', 'BOTTOM', 0, 0}, - ConsolidatedBuffCountPoint = {'BOTTOM', 'BOTTOM', 0, 0}, - - RaidShowMissing = true, - -} \ No newline at end of file
--- a/BuffFrame/RaidBuffTray.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,378 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/20/2016 10:00 PM - -local _, A = ... -local vn = A.frame -local MODULE = 'BuffFrame' -local Aura = vn:RegisterModule(MODULE) -local parentAnchor, parentFrame, raidbuffsFrame -local unpack, band, lshift, CreateFrame = unpack,bit.band, bit.lshift, CreateFrame -local raidBuffs = {} -local raidBuffSymbols = {'St', 'HP', 'AP', 'Ha', 'SP', 'Cr', 'Ma', 'MS', 'V' } -local missingBuffs = {} -local playerBuffing, playerCurrentBuff -local playerBuffs = {} -local c, ac, frameSize, frameSpacing, framePosition -local fprint = vn.fprint -local xprint = vn.print('XML') -local NUM_LE_MISSING_RAID_BUFFS = 0 -local missingBuffsAnchor - - ---- Takes a given icon texture and calls the pre-defined function set -Aura.UpdateBuffStyle = function(buff, style, path) - local print = fprint() - local icon = buff.icon - local symbol = buff.symbol - path = path or icon.iconPath - --print(style, icon.iconStyle) - - if style ~= buff.iconStyle or path ~= buff.iconPath then - print('|cFF0088FFUpdateBuffStyle(|r', icon:GetName(), style, path) - icon.iconStyle = style - icon.iconPath = path - else - --print('|cFF00FF88UpdateBuffStyle(|r', icon:GetName(), style, path, ') same values, ignore') - return - end - local styleset = Aura.BuffStyles[style] - if not path or path == '' then - print('path is nil/empty') - icon:SetColorTexture(1, 1, 1, 1) - icon:SetVertexColor(unpack(styleset.Color)) - else - icon:SetTexture(path or icon:GetTexture()) - icon:SetVertexColor(unpack(styleset.Color)) - end - - if symbol and symbol.GetText then - symbol:SetTextColor(unpack(styleset.TextColor)) - symbol:SetText(buff.symbolName or 'NaW') - end - - icon:SetBlendMode(styleset.SetBlendMode) - icon:SetDesaturated(styleset.SetDesaturated) -end - ---- Populates a list of targets needing a buff, fired by a handler -local PlayerBuffTodo ={} -local PlayerBuffStatus = {} -local UnitClass, IsInGroup, GetNumGroupMembers, UnitAura = UnitClass, IsInGroup, GetNumGroupMembers, UnitAura -local GetTalentInfoByID, GetActiveSpecGroup, GetStablePetInfo, GetSpecialization = GetTalentInfoByID, GetActiveSpecGroup, GetStablePetInfo, GetSpecialization -Aura.UpdateBuffStatus = function(aura, filters) - local print = xprint - if not PlayerBuffStatus[aura] then - PlayerBuffStatus[aura] = {} - end - print(UnitClass('player')) - if IsInGroup() then - local numBuffed = 0 - local partySize = GetNumGroupMembers() - local missing = {} - for i = 1, partySize do - local unit = 'raid'..i - if UnitAura(unit, aura, nil, filters) then - numBuffed = numBuffed + 1 - else - tinsert(missing, unit) - end - end - - PlayerBuffTodo[aura] = missing - - end -end - ---- Evaluates buff availability criteria --- Uses hard returns to avoid over-iterating conditionals, particularly pet family -local function IsBuffAvailable(criteria) - local available, active = false, false - local result - for _, test in ipairs(criteria) do - if test == true then - -- it's a passive effect that is always on - return true, true - else - if c.spec then - if not (result and c.spec == vn.PlayerSpec) then - return false - end - end - - if c.talent then - local talentID, name, texture, selected, available = GetTalentInfoByID(c.talent, GetActiveSpecGroup()) - if not (result and selected) then - return false - end - end - - if c.petFamily then - local lim = min(5, NUM_PET_STABLE_SLOTS) -- to avoid volatile loop condition - for p = 1, lim do - local hasPet = false - local icon, name, level, family, talent = GetStablePetInfo(p) - if family == c.petFamily then - hasPet = true - end - if not (result and hasPet) then - return false - end - end - end - - end - end - return true, false -end - ---- events: PLAYER_SPECIALIZATION_CHANGED -function Aura:UpdateBuffsTodo (unit) - -- buffs vs. auras - if unit ~= 'player' then - -- look for changes in the GIST manifest and sort them out - return - end - - local class = UnitClass('player') - local spec = GetSpecialization() - if not class or - not spec or - not IsInGroup() or - not Aura.PlayerBuffStatus[class] then - -- if just logging in, info won't be available for several seconds - -- if not grouped, don't calc - -- hide frame - Aura.PlayerBuffsActive = function() return false end - return - end - - -- verify change - if vn.PlayerCurrentSpec == spec or vn.PlayerClass == class then - return - end - vn.PlayerCurrentSpec = spec - vn.PlayerClass = class - - local test = vn.ClassRaidBuffs - local buffTypes = {} - local auraTypes = {} - for i = 1, NUM_LE_RAID_BUFF_TYPES do - local name, filters - if test[i] and test[i][class] then - playerBuffs[i], name, filters = IsBuffAvailable(test[i][class]) - else - playerBuffs[i] = nil - end - - if name then - vn.UpdateBuffStatus(name, filters) - end - end -end - --- Called once to setup the ConsolidatedBuffs stencil -local consolidatedBuffsLoaded, displays -Aura.SetConsolidatedBuffs = function() - local print = fprint() - displays = Aura.displays - c = displays.ConsolidatedBuff.conf - parentFrame = Aura.guides[c.Parent][c.Position] - raidbuffsFrame = Aura.anchors.ConsolidatedBuff - - vn.SetConfigLayers(raidbuffsFrame) - consolidatedBuffsLoaded = true - ConsolidatedBuffs:ClearAllPoints() - ConsolidatedBuffs:SetAllPoints(parentFrame.icon) - if c.Icon then - ConsolidatedBuffsIcon:SetAllPoints(parentFrame.icon) - ConsolidatedBuffsIcon:SetTexCoord(0.609,0.89,0.215,0.78) - else - ConsolidatedBuffsIcon:Hide() - end - - ConsolidatedBuffsCount:Hide() -end - -local CanShowConsolidated = function() - return IsInGroup() and GetCVarBool("consolidateBuffs") -end - -local missingTypes = {} -local raidBuffsInitialized -Aura.UpdateRaidBuffs = function() - --[[ - - - local c = Aura.displays.ConsolidatedBuff.conf - local anchor = _G[c.Parent..'Anchor'] - local print = xprint - if not consolidatedBuffsLoaded then - Aura.SetConsolidatedBuffs() - end - - if not CanShowConsolidated() then - - if parentFrame.contains then - print((CanShowConsolidated() and '|cFF88FF88' or '|cFF444444')..'showConsolidated|r', (parentFrame.contains and '|cFF88FF88' or '|cFF444444') .. 'parent.contains|r') - if raidBuffsInitialized then - for i = 1, 9 do - if raidBuffs[i] then - raidBuffs[i]:Hide() - end - end - raidBuffsInitialized = nil - end - if parentFrame then - print(c.Parent, c.Position) - print('de-flagging parent') - parentFrame.contains = nil - anchor.contains = nil - end - end - - raidbuffsFrame:Hide() - return - --- ENDS HERE IF NOT SHOWING CONSOLIDATED FRAME - end - - if CanShowConsolidated() then - - if not parentFrame.contains then - raidBuffsInitialized = true - print('re-flagging parent', parentFrame:GetName()) - parentFrame.contains = raidbuffsFrame - anchor.contains = raidbuffsFrame - Aura.decors[c.Parent][c.Position]:Hide() - - -- make sure parent icon is updated - local w = c.Size*c.PerRow+c.Spacing*(c.PerRow-1)+c.Border*2 - parentFrame:SetSize(w, w) - parentFrame.icon:SetSize(w - c.Border*2, w - c.Border*2) - parentFrame.contains = raidbuffsFrame - end - - raidbuffsFrame:SetPoint('TOPRIGHT', parentFrame, 'TOPRIGHT') - raidbuffsFrame:Show() - - Aura.UpdateBuffs(c.Parent) - end - - -- have to loop again due to tainting restrictions - -- could compare the tooltip font object pointers, but that may change - local buffStack = GetRaidBuffInfo() - print(GetRaidBuffInfo()) - local guides = vn.guides.ConsolidatedBuff - local numBuffs = 0 - local numAvailable = 0 - local mask = 1 - if buffStack == nil then - return -- discard - end - - - for i = 1, NUM_LE_RAID_BUFF_TYPES do - local available = (band(buffStack, mask) > 0) - local name, _, icon, start, duration, spellID, slot = GetRaidBuffTrayAuraInfo(i) - print(i, name, icon, available) - - raidBuffs[i] = raidBuffs[i] or CreateFrame('Frame', 'VeneerRaidBuff' .. i, raidbuffsFrame, 'VeneerRaidBuffTemplate') - local buff = raidBuffs[i] - if not raidBuffs[i].stylized then - print(' setting style', i) - buff.stylized = true - buff.symbol:SetText(raidBuffSymbols[i]) - buff.symbol:SetFont("Fonts\\FRIZQT__.TTF", 10, 'OUTLINE') - buff:SetSize(parentFrame.icon:GetWidth()/c.PerRow,parentFrame.icon:GetWidth()/c.PerRow) - buff.symbolName = raidBuffSymbols[i] - - buff.icon:SetAllPoints(guides[i].icon) - buff:SetAllPoints(guides[i]) - raidbuffsFrame.Zoom(buff.icon) - end - - buff:Show() - local buffStyle = 'missing' - if name then - buff:Show() - buff.symbol:Hide() - missingTypes[i] = nil - numBuffs = numBuffs + 1 - numAvailable = numAvailable + 1 - buffStyle = 'active' - else - buff.symbol:Show() - if band(buffStack, mask) > 0 then - buffStyle = 'available' - numAvailable = numAvailable + 1 - else - buffStyle = 'missing' - icon = '' - end - end - mask = lshift(mask, 1) - - Aura.UpdateBuffStyle(buff, buffStyle, icon) - end - - -- todo: filter by castable and suppress for non-overlapping auras - - raidbuffsFrame.label:SetText(numBuffs..'/'..numAvailable) - print(parentFrame:GetName(), parentFrame:GetSize()) - - if vn.ShowMissingBuffs then - vn.UpdateMissingBuffs() - elseif missingBuffsAnchor and missingBuffsAnchor:IsVisible() then - for i = 1, NUM_LE_MISSING_RAID_BUFFS do - missingBuffs[i]:Hide() - end - end - - ]] -end - -vn.UpdateMissingBuffs = function() - local print = vn.fprint() - local numMissing = 0 - - local firstMissing, lastMissing - for i = 1, NUM_LE_RAID_BUFF_TYPES do - local name, _, icon, start, duration, spellID, slot = GetRaidBuffTrayAuraInfo(i) - - if not name then - numMissing = numMissing + 1 - - print('missing buff', i, numMissing) - vn.UpdateBuffStyle(raidBuffs[i].icon, 'missing', "") - - missingBuffs[numMissing] = missingBuffs[numMissing] or CreateFrame('Button', 'VeneerMissingBuff' .. numMissing, raidbuffsFrame, 'VeneerMissingBuffTemplate') - - local missing = missingBuffs[numMissing] - - missing:Show() - missing:SetSize(c.Size*c.PerRow, c.Size) - if numMissing == 1 then - firstMissing = missing - else - missing:SetPoint('TOP', lastMissing, 'BOTTOM', 0, -c.Spacing) - end - - missing.label:SetText(_G['RAID_BUFF_'.. i]) - lastMissing = missing - - end - end - - if firstMissing then - print(firstMissing:GetName(), raidbuffsFrame) - firstMissing:SetPoint('TOPRIGHT', raidbuffsFrame.label, 'BOTTOMRIGHT', 0, c.Spacing) - missingBuffsAnchor = firstMissing - end - - for i = numMissing +1, NUM_LE_MISSING_RAID_BUFFS do - missingBuffs[i]:Hide() - end - NUM_LE_MISSING_RAID_BUFFS = numMissing -end \ No newline at end of file
--- a/Config/Config.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,418 +0,0 @@ ---- All the control GUI stuff, including chat command functions --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/12/2016 12:49 AM -local vn, _G = select(2,...).frame, _G -local M = vn:RegisterModule("Options") -local tostring, tonumber, floor, max, assert = tostring, tonumber, floor, math.max, assert -local unpack, setmetatable, pairs, ipairs, type, wipe = unpack, setmetatable, pairs, ipairs, type, table.wipe -local CreateFrame, IsControlKeyDown = _G.CreateFrame, _G.IsControlKeyDown -local OpacitySliderFrame, ColorPickerFrame = _G.OpacitySliderFrame, _G.ColorPickerFrame -local print = vn.print('Cfgl') -local function round(number, decimals) - if floor(number) == number then - return ('%d'):format(number) - end - - return (("%%.%df"):format(decimals)):format(number) -end - ---- Set up this way to ensure that all the necessary data exists before things domino into something inscrutable -M.prototypes = { - value = setmetatable({}, {__call = function(self, frame) - assert(frame, 'Expected table (received '..type(frame.OptInfo)..')') - assert(frame.OptRoot, 'Invalid config table for frame '.. frame:GetName().. '') - return self[frame.ValueType](frame.OptTab, frame.OptKey, frame.OptRoot) - end}), - reset = setmetatable({}, {__call = function(self, frame) - assert(frame.GetName, 'Invalid frame reference (received '..type(frame.OptInfo)..')') - assert(frame.OptInfo, 'Expecting a table (received '..type(frame.OptInfo)..')') - return self[frame.OptType](frame, frame.OptInfo) - end}) -} -M.config = {} -M.defaults = { - enable = true -} -local GetValue = M.prototypes.value -local ResetField = M.prototypes.reset ---- STATE VARIABLES -local configInit ---- Dummies for addon table upvalues -local configFrames = {} -- actual frame objects -local displays = vn.displays -- anchor objects dummy - - ---- Returns a value retreival function and the current value stored in config --- @paramsig value, previousValue = configInteger(key) --- @param key Name of the config field being represented. -local defaultGroup = 'BuffButton' - -GetValue.Integer = function(group, key, parent) - return function(self) - return floor(tonumber(self:GetValue()) + 0.5) - end, (parent[group ..key] or parent[defaultGroup..key]) -end -GetValue.Percent = function(group, key, parent) - return function(self, display) - local value = self:GetValue() - if display then - return tostring(floor(value*100+0.5))..' %' - else - return floor((value*100+0.5))/100 - end - end, (parent[group ..key] or parent[defaultGroup..key]) -end -GetValue.Color = function(group, key, parent) - -- table for config, color value list for text - return function(self, display) - if display then - return "|cFFFF4444" .. round(self.rgba[1], 1) .. "|r, |cFF44FF44" .. round(self.rgba[2], 1) .. "|r, |cFF4488FF" .. - round(self.rgba[3], 1) .. "|r, " .. round(self.rgba[4], 1) - else - return self.rgba - end - end, (parent[group ..key] or parent[defaultGroup..key]) -end -GetValue.Check = function(group, key, parent) - return function(self) return self:GetChecked() end, parent[group ..key] or vn.Conf[defaultGroup..key] -end --- initializes the corresponding type of config field -local frameTypeConv = { - Color = 'Button', - Font = 'Frame', -} - - -ResetField.Slider = function(frame, optionInfo) - frame:SetMinMaxValues(optionInfo[5], optionInfo[6]) - frame:SetValueStep(optionInfo[7]) - frame:SetStepsPerPage(optionInfo[8]) - print(frame.OptName, '\n {', optionInfo[5], optionInfo[6], optionInfo[7], optionInfo[8], '}') - end -ResetField.CheckButton = function(frame, optionInfo) - frame.SetValue = function(self, ...) - self:SetChecked(...) - self.OptRoot[self.OptName] = self:GetChecked() - print(self.OptTab) - vn.UpdateAll() - end - frame:SetScript("OnClick",function(self) - self.OptRoot[self.OptName] = self:GetChecked() - print(self.OptRoot[self.OptName], self:GetChecked()) - vn.UpdateAll() - end) - end -ResetField.Color = function(frame, optionInfo) - frame.rgba = { frame.current:GetVertexColor() } - local colorPickerCallback = function(restore) - local newR, newG, newB, newA - if restore then - newR, newG, newB, newA = unpack(restore) - else - newA, newR, newG, newB = OpacitySliderFrame:GetValue(), ColorPickerFrame:GetColorRGB() - print('not cancel', newA, newR, newB, newG) - end - frame:SetValue({newR, newG, newB, newA}) - vn.UpdateBuffs(frame.OptTab) - end - frame:SetScript("OnClick", function(self) - print('got a click') - local r, g, b, a = frame.current:GetVertexColor() - ColorPickerFrame:SetColorRGB(r, g, b) - ColorPickerFrame.hasOpacity = (a ~= nil) - ColorPickerFrame.opacity = a - ColorPickerFrame.previousValues = {r,g,b,a} - ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc = - colorPickerCallback, colorPickerCallback,colorPickerCallback - ColorPickerFrame:Hide() - ColorPickerFrame:Show() - end) - frame.SetValue = function(self, rgba) - print(rgba) - frame.rgba = rgba - self.OptRoot[self.OptName] = rgba - frame.current:SetVertexColor(unpack(rgba)) - frame.fieldvalue:SetText(frame.OptValue(frame, true)) - end -end - ---- configDialog --- @usage tinsert(configDialog, {prefix, row, [...] }) --- Each top level member defines a group of config value handlers, structured as an iterative table where the --- first member is a key prefix, the second member is an integer row value, and all following members are treated --- as a widget resource, defined initially as a complete sub-table, which can be re-used further down by passing --- the string literal widget suffix. --- widget table: ... {'suffix', 'description', valueCallback, 'template', [widget parameters]} --- widget copy: ... 'suffix', ... -M.config.BuffFrame = { - {'BuffButton', 1, - - {'Max', 'Max', 'Integer', 'Slider', - 1, _G.BUFF_MAX_DISPLAY, 1, 1}, -- valueMin, valueMax, valueStep, stepsPerPage - {'PerRow', 'Per Row', 'Integer', 'Slider', - 1, _G.BUFF_MAX_DISPLAY, 1, 1}, -- valueMin, valueMax, valueStep, stepsPerPage, - {'Size', 'Icon Size', 'Integer', 'Slider', - 1, 256, 1, 1}, - {'Spacing', 'Icon Spacing', 'Integer', 'Slider', - 1, 50, 1, 1}, - {'DurationSize', 'Duration Text Height', 'Integer', 'Slider', - 1, 72, 1, 1}, - {'Zoom', 'Icon Zoom', 'Integer', 'Slider', - 0, 100, 1, 1}, - {'Border', 'Border', 'Integer', 'Slider', - 1, 16, 1, 1}, - {'Color', 'Default Border', 'Color', 'Color'}, - {'RaidColor', 'RaidBuff Border', 'Color', 'Color'}, - {'PlayerColor', 'Player Buffs', 'Color', 'Color'}, - {'BossColor', 'Encounter Buffs', 'Color', 'Color'}, - {'ShowSelfCast', 'Show name for self-casts', 'Check', 'CheckButton'} - }, - { 'DebuffButton', 1, - {'Max', 'Max', 'Integer', 'Slider', - 1, _G.DEBUFF_MAX_DISPLAY, 1, 1 } - , - {'PerRow', 'Per Row', 'Integer', 'Slider', - 1, _G.DEBUFF_MAX_DISPLAY, 1, 1 }, - 'Size', 'Spacing', 'DurationSize', 'Zoom', 'Border', - 'Color', 'RaidColor', 'PlayerColor', 'BossColor', - }, - { 'TempEnchant', 1, - {'Max', 'Max', 'Integer', 'Slider', - 1, _G.NUM_TEMP_ENCHANT_FRAMES, 1, 1 }, - {'PerRow', 'Per Row', 'Integer', 'Slider', - 1, _G.NUM_TEMP_ENCHANT_FRAMES, 1, 1}, - 'Size', 'Spacing', 'DurationSize', 'Zoom', 'Border', - 'Color', 'RaidColor', 'PlayerColor', 'BossColor', - }, - { 'ConsolidatedBuff', 2, - {'Position', 'Slot Position', 'Integer', 'Slider', - 1, _G.BUFF_MAX_DISPLAY, 1, 1 } - - }, - { 'ConsolidatedBuff', 2, - 'Size' - }, - { 'Raid', 3, - {'ShowMissing', 'Verbose missing raid buffs', 'Check', 'CheckButton'} - } -} - - - - -local configFrame -local optionTemplates = {} -local configPadding, configSpacing = 3, 3 - ---- Walks the structure table to generate a pretty config panel -local InitConfig = function() - configInit = true - local configWidth = vn:GetWidth() - local optionWidth = (configWidth - configPadding) / 3 - configSpacing - local configHeight = 0 - local bottom_extent = 0 - local clusterHeight = 0 - local clusterOffset = 0 - local lastCluster - local cluster = 1 - local col = 0 - for moduleName, moduleOpts in pairs(M.config) do - for t, taboptions in ipairs(moduleOpts) do - local group = taboptions[1] - cluster = taboptions[2] - col = col + 1 - - - if not configFrames[t] then - configFrames[t] = {} - end - - - if cluster ~= lastCluster then - configHeight = configHeight + clusterHeight - print('|cFFFF8800## new cluster|r, advancing offset from', clusterOffset, 'to', clusterOffset + clusterHeight) - clusterOffset = clusterOffset + clusterHeight - col = 1 - clusterHeight = 0 - lastCluster = cluster - end - - print('processing tab', group) - local row = 0 - for i = 3, #taboptions do - row = row + 1 - local optionInfo = taboptions[i] - if type(optionInfo) == 'string' then - optionInfo = optionTemplates[optionInfo] - end - local key, fieldname, valueType, configType = unpack(optionInfo) - assert(GetValue[valueType], 'Invalid valueType \''..tostring(valueType)..'\' ('..type(valueType)..')') - assert(ResetField[configType], 'Invalid fieldType \''..tostring(configType)..'\' ('..type(configType)..')') - - if not optionTemplates[key] then - optionTemplates[key] = optionInfo - end - - local fullkey = group .. key - print(fullkey, fieldname) - - if not configFrames[t][row] then - print('building frame', t, group, row) - local frameTemplate = 'VeneerConfig'..configType - local frameType = frameTypeConv[configType] or configType - configFrames[t][row] = CreateFrame(frameType, 'Vn_'.. moduleName ..'_'.. fullkey, vn, frameTemplate) - local f = configFrames[t][row] - f.ValueType = valueType - f.OptType = configType - f.FrameType = frameType - f.OptKey = key - f.OptRoot = vn.Conf[moduleName] - f.OptTab = group - f.OptName = fullkey - f.OptInfo = optionInfo - local valueFunc, initialValue = GetValue(f) - print(' value getter', '|cFFFFFF00'..moduleName..'|r.|cFF00FFFF'.. tostring(fullkey),'|r->', valueFunc,initialValue) - ResetField(f) - f.OptValue = valueFunc - - --- Enclosing these to - -- a) make the panel easy to bring up externally - -- b) limit gameplay risk from config frame errors - -- c) milk the iterator scope for all its worth - f.OnChange = function(self) - - -- holding control; mirror this setting in other categories - if IsControlKeyDown() and not (configInit) then - configInit = true - for optTab, opts in pairs(configFrames) do - for _, opt in ipairs(opts) do - if opt.OptKey == key then - if optTab ~= group then - print('mapping to', optTab, opt.OptKey) - opt:SetValue(self:GetValue()) - end - - end - end - end - configInit = nil - end - local newValue = valueFunc(self) - if newValue ~= self.OptRoot[fullkey] then - print(newValue, fullkey) - f.fieldvalue:SetText(valueFunc(self, true)) - self.OptRoot[fullkey] = valueFunc(self) - -- prepare to update - vn[moduleName]:OnUpdate() - vn.UpdateConfigLayers() - end - - end - - f:SetValue(initialValue) - local yBuffer = configPadding - if f.fieldname then - f.fieldname:SetText(fieldname) - yBuffer = yBuffer + f.fieldname:GetHeight() - end - if f.fieldvalue then - f.fieldvalue:SetText(f:OptValue(true)) - end - - local point, relative, x, y = 'TOPLEFT', 'BOTTOMLEFT', 0, -3 - - local base - if (row == 1) then - bottom_extent = 0 - base = vn.header - x = (col-1) * (optionWidth+configSpacing) - y = -configPadding - else - base = configFrames[t][row-1] - end - - print('|cFFFF0088'..cluster..'|r |cFF00FF00'.. row..'|r', col, base:GetName(), x, y - clusterOffset) - - if frameType ~= 'CheckButton' then - f:SetWidth(optionWidth) - end - - f:SetPoint(point, base, relative, x, y-yBuffer-clusterOffset) - --print('creating', frameType, fieldname) - f:Show() - - bottom_extent = bottom_extent + f:GetHeight() + yBuffer + configSpacing - - - - clusterHeight = max(clusterHeight, bottom_extent) - --print('y', floor(yBuffer+0.5), 'f:H', floor(f:GetHeight()+0.5), 'hTally', floor(bottom_extent+0.5), 'hMax', floor(configHeight+0.5)) - end - end - end - end - - - -- grab the last cluster - if lastCluster == cluster then - print('|cFF00FF00##scooping up last cluster info') - configHeight = configHeight + clusterHeight - end - - if not vn.configFramesCreated then - vn.configFramesCreated = true - vn:SetHeight(vn.header:GetStringHeight() + configSpacing*3 + configHeight) - end - if configInit then configInit = nil end -end - -M.Command = function(enable, editbox) - displays = vn.displays - if type(enable) == 'boolean' then - vn.Conf.ConfigMode = enable - else - vn.Conf.ConfigMode = (vn.Conf.ConfigMode == false) and true or false - end - - print('/BUFF', vn.Conf.ConfigMode, type(vn.Conf.ConfigMode)) - if vn.Conf.ConfigMode then - if not vn.configFramesCreated then - InitConfig() - end - print('Veneer config') - vn:Show() - else - vn:Hide() - end - vn.UpdateAll() - vn.UpdateConfigLayers() -end - -vn.Close = function () - M.Command() -end - -vn.ToggleGuides = function(_, self) - vn.Conf.GuidesMode = (not vn.Conf.GuidesMode) - if vn.Conf.GuidesMode then - self:GetNormalTexture():SetColorTexture(0.94, 0.21, 0.21, 1) - else - self:GetNormalTexture():SetColorTexture(0, 0, 0, 1) - end - - vn.UpdateConfigLayers() -end - -M.OnEnable = function() - print('|cFFFF0088config module', vn.Conf.ConfigMode) - M.Command(vn.Conf.ConfigMode) -end - -M.OnInitialize = function() - DEFAULT_CHAT_FRAME:AddMessage("|cFF22D822Veneer|r confogulator loaded. Type |cFF00FFFF/vn|r to begin.") - SLASH_VENEER1, SLASH_VENEER2 = "/veneer", "/vn" - SlashCmdList.VENEER = M.Command - -end \ No newline at end of file
--- a/Config/Config.xml Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - - <FontString virtual="true" name="VeneerFieldName" parentKey="fieldname" inherits="VeneerFontHighlight" justifyV="TOP" justifyH="LEFT" /> - <FontString virtual="true" name="VeneerFieldValue" parentKey="fieldvalue" inherits="VeneerFontNormal" justifyV="TOP" justifyH="LEFT" /> - <Slider virtual="true" orientation="HORIZONTAL" name="VeneerConfigSlider"> - <Size x="250" y="18" /> - <Thumbtexture name="$parentThumb" alphaMode="BLEND" parentKey="thumb"> - <Size x="12" y="18" /> - <Color r="0.25" g="0.25" b="0.25" a="1" /> - </Thumbtexture> - <Layers> - <Layer level="BACKGROUND"> - <Texture> - <Anchors> - <Anchor point="LEFT" /> - <Anchor point="RIGHT" /> - </Anchors> - <Size y="7" /> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - - </Layer> - <Layer level="OVERLAY"> - - - <FontString name="$parentOptText" inherits="VeneerFieldName"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" /> - </Anchors> - </FontString> - - <FontString name="$parentOptText" inherits="VeneerFieldValue"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" /> - </Anchors> - </FontString> - </Layer> - </Layers> - <Scripts> - <OnValueChanged> - self:OnChange() - </OnValueChanged> - </Scripts> - </Slider> - - <CheckButton virtual="true" orientation="HORIZONTAL" name="VeneerConfigCheckButton"> - <Size x="24" y="24" /> - <NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/> - <PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/> - <HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/> - <CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/> - <Layers> - <Layer level="BACKGROUND"> - <Texture setAllPoints="true"> - <Size y="24" /> - <Color r="0" g="0.7" b="1" a="1" /> - </Texture> - - <FontString name="$parentOptText" inherits="VeneerFieldName" > - <Anchors> - <Anchor point="LEFT" relativePoint="LEFT" x="24" y="0" /> - </Anchors> - </FontString> - - </Layer> - </Layers> - <Scripts> - <OnValueChanged> - self:OnChange() - </OnValueChanged> - </Scripts> - </CheckButton> - - - <Button virtual="true" name="VeneerConfigColor"> - <Size x="400" y="20" /> - <Layers> - <Layer level="BACKGROUND"> - <Texture setAllPoints="true"> - <Color r="0.15" g="0.15" b="0.15" a="0.5" /> - </Texture> - <Texture> - <Anchors> - <Anchor point="BOTTOMLEFT" x="0" y="0" /> - </Anchors> - <Size x="18" y="18" /> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - <Layer level="ARTWORK"> - <Texture name="$parentCurrentColor" parentKey="current"> - <Anchors> - <Anchor point="BOTTOMLEFT" x="1" y="1" /> - </Anchors> - <Size x="16" y="16" /> - <Color r="1" g="1" b="1" a="1" /> - </Texture> - </Layer> - <Layer level="OVERLAY"> - - <FontString name="$parentOptText" inherits="VeneerFieldName"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="0" y="0" /> - </Anchors> - </FontString> - - <FontString parentKey="fieldvalue" name="$parentOptText" inherits="VeneerFontNormal" text=""> - <Anchors> - <Anchor point="CENTER" relativePoint="CENTER" relativeKey="$thumb" x="0" y="0" /> - </Anchors> - </FontString> - - </Layer> - </Layers> - </Button> - - <Script file="Config.lua" /> -</Ui> \ No newline at end of file
--- a/Modules/BuffFrame.lua Mon Aug 15 09:35:46 2016 -0400 +++ b/Modules/BuffFrame.lua Tue Aug 16 08:37:07 2016 -0400 @@ -2,10 +2,17 @@ -- BuffFrame.lua -- Created: 7/27/2016 8:08 PM -- %file-revision% --- Adds progress bars and cooldown swirls to buffbutton frames +--[[ + Adds progress bars and cooldown swirls to buffbutton frames -local PLUGIN_NAME = 'BuffFrame' -local plugin = {} + Known Limitations: + - Individual BuffButton frames are created upon use, making it difficult to do any sort of securestate priming + - TempEnchant info returns relative values only, and they don't synchronize with aura events + - BuffButtons can only be hidden/shown by blizzcode, so functions doing that have to be accounted for +--]] + + +local plugin = CreateFrame('Frame', 'VeneerBuffFrame', UIParent) local vn, print = LibStub("LibKraken").register(VeneerController, plugin)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Modules/ObjectiveTracker.lua Tue Aug 16 08:37:07 2016 -0400 @@ -0,0 +1,8 @@ +-- Veneer +-- ObjectiveTracker.lua +-- Created: 8/16/2016 8:19 AM +-- %file-revision% +-- Fixes objective tracker positioning in relation to buff frame alterations + +local plugin = CreateFrame('Frame', 'VeneerObjectives', UIParent) +local vn, print = LibStub("LibKraken").register(VeneerController, plugin) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Modules/PaperDoll.lua Tue Aug 16 08:37:07 2016 -0400 @@ -0,0 +1,44 @@ +-- Veneer +-- PaperDoll.lua +-- Created: 8/16/2016 8:18 AM +-- %file-revision% +-- + +local plugin = CreateFrame('Frame', 'VeneerPaper', UIParent) +local vn, print = LibStub("LibKraken").register(VeneerController, plugin) + +-- PaperDollFrame is separate from InspectUI handlers +local PaperDollItemSlotButton_Update = function(self) + local name = self:GetName() + local slot = self:GetID() + local frame = _G[name .. 'Veneer'] + if not frame then + frame = CreateFrame('Frame', name..'Veneer', self) + frame.label = frame:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') + frame.gemslot = {} + frame:SetPoint('LEFT', self, 'RIGHT') + end + + if self.hasItem then + frame.link = GetInventoryItemLink('player', slot) + frame.gem1, frame.gem2, frame.gem3 = GetInventoryItemGems('player', slot) + frame.label:SetText(GetInventoryItemLink('player', slot)) + -- todo: test GetExtendedItemInfo() + + for i = 1, 3 do + local gname = 'gem'..i + if frame[gname] then + frame.gemslot[i] = frame.gemslot[i] or frame:CreateTexture(nil, 'ARTWORK') + print(frame[gname]) + end + end + frame:Show() + else + frame:Hide() + end +end + +plugin.init = function() + hooksecurefunc("PaperDollItemSlotButton_Update", PaperDollItemSlotButton_Update) +end +
--- a/ObjectiveTracker/APIHooks.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/30/2016 1:23 AM -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local print = B.print('Objectives') -local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST -local OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP = OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP -local GetQuestID = GetQuestID -local QuestPOIUpdateIcons = QuestPOIUpdateIcons - ---- Module updates triggered by user events -T.AcknowledgeAutoAcceptQuest = function(...) - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST + OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP -end - -T.AddQuestWatch = function(questID) - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST -end -T.AbandonQuest = function() - QuestPOIUpdateIcons() - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST -end -T.CompleteQuest = function() - QuestPOIUpdateIcons() - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST -end -T.AddAutoQuestPopUp = function(...) - return OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP -end -T.RemoveAutoQuestPopUp = function(questID) - AddQuestWatch(GetQuestLogIndexByID(questID)) - return OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP -end ---- SUPER_TRACKED_QUEST_CHANGED will fires -local tprint = B.print('Tracker') -T.SetSuperTrackedQuestID = function(questID) - tprint('SetSuperTrackedQuestID', questID) - for index, block in ipairs(T.Quest.usedBlocks) do - if block:IsVisible() then - if block.info.id == questID then - block.SelectionOverlay:Show() - else - block.SelectionOverlay:Hide() - end - end - end -end - - - -local previousSelection ---@debug@ -local tprint = B.print('Tracker') -- @debug@ -T.SelectQuestLogEntry = function(logIndex) - --@debug@ - if previousSelection and previousSelection ~= logIndex then - print('swapping selection from', previousSelection, 'to', logIndex) - end--@end-debug@ - previousSelection = logIndex -end - ---- Dummies for future ideas -T.RemoveQuestWatch = function(questIndex, ...) end -T.AddTrackedAchievement = function(cheevID) end -T.RemoveTrackedAchievement = function(cheevID) end -T.AcceptQuest = function() end \ No newline at end of file
--- a/ObjectiveTracker/AchievementData.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,206 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/13/2016 7:48 PM -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local band = bit.band -local RemoveTrackedAchievement, GetAchievementLink = RemoveTrackedAchievement, GetAchievementLink -local AchievementFrame_ToggleAchievementFrame, AchievementFrame_SelectAchievement = AchievementFrame_ToggleAchievementFrame, AchievementFrame_SelectAchievement -local GetTime, GetAchievementNumCriteria, GetAchievementCriteriaInfo = GetTime, GetAchievementNumCriteria, GetAchievementCriteriaInfo -local GetNumTrackedAchievements, GetTrackedAchievements, GetAchievementInfo = GetNumTrackedAchievements, GetTrackedAchievements, GetAchievementInfo -local Default, Cheevs = T.DefaultHandler, T.Cheevs -local wipe = table.wipe -local print, bprint, lprint, iprint = B.print('Tracker'), B.print('Block'), B.print('Line'), B.print('iprint') - ---- Frame data -Cheevs.UpdateObjectives = function(handler, block, block_schema) - -- if completed on another character, only show the heading for CHATLINK - if block.info.completed then - return 0, block_schema - end - - if block.info.description then - handler:AddLine(block, block.info.description, nil, 'defalut') - end - local attachments = Default.UpdateObjectives(handler, block, block_schema) - - return attachments, block_schema -end - -Cheevs.UpdateLine = function(handler, block, data) - local print = lprint - local attachment - local text - local lineSchema = 'default' - print(' ', data.objectiveIndex,'|cFF'..handler.internalColor..'-|r', data.objectiveType, data.text) - if data.type == CRITERIA_TYPE_ACHIEVEMENT then - if data.value == 1 then - return nil, nil - end - - text = data.text - lineSchema = (data.quantity == 1) and 'achievement_complete' or 'achievement' - elseif band(data.flags, 0x00000001) > 0 then - attachment = T.GetWidget(data, 'StatusBar', data.criteriaID) - attachment.format = "%d/%d" - attachment.value = data.value - attachment.maxValue = data.maxValue - attachment:SetParent(block) - - print(attachment:GetNumPoints()) - for i = 1, attachment:GetNumPoints() do - print(' ',attachment:GetPoint(i)) - end - attachment.status:SetFormattedText("%d/%d", data.value, data.maxValue) - attachment:SetPoint('TOP', line, 'TOP') - lineSchema = 'progressbar' - else - - text = format("%d/%d %s", data.value, data.maxValue, data.text) - lineSchema = 'default' - end - print(' |cFF'..handler.internalColor..'UpdateLine:|r', data.type, data.quantityString, 'qty:', data.quantity, 'assetID:', data.assetID) - return text, attachment, lineSchema -end - -Cheevs.Select = function(self, block) - Cheevs.Link(self, block) - T:Update(self.updateReasonModule, block.info.cheevID) -end - -Cheevs.Remove = function(self, block) - - RemoveTrackedAchievement(block.info.cheevID) -end -Cheevs.OnMouseUp = function(self, button) - - Default.OnMouseUp(self, button) -end -Cheevs.Link = function(self, block) - local achievementLink = GetAchievementLink(block.info.cheevID); - if ( achievementLink ) then - _G.ChatEdit_InsertLink(achievementLink); - end -end - ---- Data accessors -Cheevs.GetNumWatched = function(self, targetID, isNew) - local trackedList = {GetTrackedAchievements() } - local numWatched, numAll = #trackedList, #self.WatchList - print(' |cFF'..self.internalColor..'GetNumWatched:|r',self.name, numWatched, ' ('..numAll..' recorded)') - local start = 1 - local limit = max(numAll, #trackedList) - if targetID then - if not isNew and self.Info[targetID] then - -- if it's only an update, we can limit the scope - start = self.Info[targetID].watchIndex - print(' |cFF'..self.internalColor..'GetNumWatched: limit selection to['..start..'-'..limit..']') - if self.InfoBlock[targetID] then - self.InfoBlock[targetID]:Hide() - end - - end - end - - for index = start, limit do - if index > numWatched then - self.WatchList[index] = nil - print(' % dropping watch entry #'..index) - else - local cheevID = trackedList[index] - if not self.Info[cheevID] then - self.Info[cheevID] = self:GetInfo(cheevID, index) - else - print(' |cFF'..self.internalColor..'GetInfo:', cheevID, 'already pulled') - end - self:GetObjectives(cheevID) - - local info = self.Info[cheevID] - local watchBlock = self.WatchBlock[cheevID] - - self.Info[cheevID].watchIndex = index - self.WatchList[index] = info - end - end - - numAll = #self.WatchList - return numWatched, numAll, self.WatchList -end -Cheevs.GetInfo = function(self, cheevID, watchIndex) - --- step 1: confirm primary data and begin an entry if needed - local id, name, points, completed, month, day, year, description, flags, icon, rewardText, isGuildAch, wasEarnedByMe, earnedBy = GetAchievementInfo(cheevID) - if not id then return nil end - - print(' |cFF'..self.internalColor..'GetInfo: pulling', id..',', name, earnedBy) - - - self.Info[cheevID] = self.Info[cheevID] or {} - local c = self.Info[cheevID] - local rewards = {} - - c.schema = 'achievement' - c.rewardInfo = rewards - c.type = 'Cheevs' - c.title = name - c.points = points - c.completed = completed - c.month = month - c.day = day - c.year = year - c.description = description - c.flags = flags - c.icon = icon - c.rewardText = rewardText - c.isGuildAch = isGuildAch - c.wasEarnedByMe = wasEarnedByMe - c.earnedBy = earnedBy - - local tagInfo = {} - c.tagInfo = tagInfo - c.watchIndex = watchIndex - c.id = cheevID - c.cheevID = cheevID - - self.Info[cheevID] = c - self.WatchInfo[watchIndex] = c - return c -end - -Cheevs.GetObjectives = function(self, cheevID) - local c = self.Info[cheevID] - c.numObjectives = GetAchievementNumCriteria(cheevID) - c.objectives = c.objectives or {} - for i = 1, c.numObjectives do - local description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(cheevID, i) - local line = c.objectives[i] or {} - line.objectiveIndex = i - line.cheevID = cheevID - line.text = description - line.type = type - line.finished = completed - line.value = quantity - line.maxValue = requiredQuantity - line.characterName = characterName - line.flags = flags - line.assetID = assetID - line.quantityString = quantityString - line.criteriaID = criteriaID - c.objectives[i] = line - - print(' |cFF'..self.internalColor..'GetObjectives:|r', i, format('|cFF0088FF%02X|r(%d)', type, type), format('|cFF88FF00%01X|r', flags or 0), '|cFF00FF00'..tostring(quantity)..'|r/|cFF00FF00'.. tostring(requiredQuantity)..'|r', '"|cFF88FF00'..tostring(description)..'|r"') - end -end - - -Cheevs.Open = function(self, block) - - if ( not _G.AchievementFrame ) then - _G.AchievementFrame_LoadUI(); - end - if ( not _G.AchievementFrame:IsShown() ) then - _G.AchievementFrame_ToggleAchievementFrame(); - end - _G.AchievementFrame_SelectAchievement(block.info.cheevID); -end
--- a/ObjectiveTracker/AutoQuestPopupData.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/13/2016 7:49 PM -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local print = B.print('Info') -local lprint = B.print('Line') -local AutoQuest, Quest = T.AutoQuest, T.Quest -local ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp = ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp -local GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle = GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle ---- Data retrieval -function AutoQuest:GetNumWatched () - local numWatched = GetNumAutoQuestPopUps() - local numAll = numWatched - - self.print('GetNumWatched', numWatched, 'popups detected') - for i = 1, numWatched do - self:GetInfo(i) - end - - for i, block in ipairs(self.usedBlocks) do - if not GetAutoQuestPopUp(block.info.id) then - self:FreeBlock(block) - end - end - - self.numWatched = numWatched - self.WatchList = self.Info - return numWatched -end -AutoQuest.GetInfo = function(self, index) - - - local questID, type = GetAutoQuestPopUp(index) - local questLogIndex = GetQuestLogIndexByID(questID) - local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) - - self.Info[index] = self.Info[index] or {} - local popup = self.Info[index] - popup.questID = questID - popup.id = index - popup.title = title - popup.description = type - popup.popupType = type - popup.logIndex = questLogIndex - - self.Info[questID] = popup - self.WatchInfo[index] = popup - - - return self.Info[questID] -end - -AutoQuest.UpdateObjectives = function(handler, block) - local print = lprint - if block.info.type == 'OFFER' then - block.status:SetText(T.strings.CLICK_TO_ACCEPT) - end -end - -AutoQuest.Select = function(handler, block) - - if block.info.popupType == 'OFFER' then - ShowQuestOffer(block.info.logIndex) - else - ShowQuestComplete(block.info.logIndex) - end - RemoveAutoQuestPopUp(block.info.questID) -end - -AutoQuest.Link = T.Quest.Link
--- a/ObjectiveTracker/Block.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/24/2016 11:30 AM ---- These functions deal with propagating and managing block/line templates -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local _G, ipairs, max, tostring = _G, ipairs, max, tostring -local tinsert, tremove, tContains = table.insert, table.remove, tContains -local Default = T.DefaultHandler -local CreateFrame = CreateFrame -local print = B.print('Layout') -local bprint = B.print('Block') -local lprint = B.print('Layout') -local fprint = B.print('Frame') -local used, free - -local blockFadeOut_OnPlay = function(self) - fprint(self:GetName(), '|cFF00FF00PLAY|r', debugstack(1,3,1)) -end -local blockFadeOut_OnFinished = function(self) - fprint(self:GetName(), '|cFF00FF00FINISHED|r', debugstack(1,3, 1)) -end - -local tMove = function(source, dest, frame) - -- if it's already in the stack, sanity check source stack - local removed - if tContains(dest, frame) then - for i, entry in ipairs(source) do - if entry == frame then - removed = i - tremove(source, i) - break - end - end - -- still need to resolve position - for i, entry in ipairs(dest) do - if entry == frame then - bprint('tMove result:', (removed and ('|cFFFF4400a|r['..removed .. '] is now ') or '') .. '|cFF00FF00b|r[' .. i..']') - return i - end - end - else - -- if it's not, then pull from source stack - for i, entry in ipairs(source) do - if entry == frame then - removed = i - tremove(source, i) - break - end - end - tinsert(dest, frame) - bprint('tMove result:', (removed and ('|cFFFF4400a|r['..removed .. '] is now ') or '') .. '|cFF00FF00b|r[' .. #dest..']') - return #dest - end -end - - ---- Creates or retrieves a complete line data object -function Default:GetLine (block, lineIndex) - local print = lprint - local blockIndex = block.index - local lines = block.lines - if not lineIndex then - lineIndex = block.currentLine + 1 - print(' |cFFFFFF00generating a frame') - end - - block.numLines = max(block.numLines, lineIndex) - - if not lines[lineIndex] then - print(' |cFF00FF88created line #'..lineIndex..' from for '..self.name..' block #'..blockIndex) - lines[lineIndex] = CreateFrame('Frame', 'Vn'..self.name .. blockIndex..'ObjectiveLine'..lineIndex, block, 'VeneerTrackerObjective') - local line = lines[lineIndex] - line.index = lineIndex - line.height = 0 - line.schema = '' - B.SetConfigLayers(line) - - if debug then - for _, region in ipairs(lines[lineIndex].debug) do - region:Show() - end - end - - end - return lines[lineIndex] -end - - - ---- Creates or retrieves a complete block frame object ---- todo: make it use data index to avoid re-coloring every block -function Default:GetBlock (index) - local print = bprint - print('|cFF0088FF'..self.name..':GetBlock', index) - local block = self.InfoBlock[index] - local used = self.usedBlocks - local free = self.freeBlocks - - if block and block.isAnimating then - return block - end - - -- if the frame entry is still good, sort heaps - if block and block.info.id == index then - block.posIndex = tMove(free, used, block) - print(' |cFFFFFF00using '..self.name..'|r.|cFF00FFBBusedBlocks['..tostring(block.posIndex)..'] ('.. block:GetName()..', "'..tostring(block.info.title)..'")') - else - local source = 'cache' - if #self.freeBlocks >= 1 then - block = tremove(self.freeBlocks) - print(' |cFF00FF00 assigning from free heap', block:GetName()) - else - - local blockIndex = (#self.usedBlocks + #self.freeBlocks) + 1 - block = CreateFrame('Frame', 'Veneer'..tostring(self)..'Block'..blockIndex, self.frame, 'VeneerTrackerBlock') - --block:SetParent() - block.schema = '' - block.lines = {} - block.numLines = 0 - block.currentLine = 0 - block.attachmentHeight = 0 - block.offset = 0 - B.SetConfigLayers(block) - --- methods for event handlers - block.Select = self.Select - block.Open = self.Open - block.Remove = self.Remove - block.Link = self.Link - block.clickZone:SetScript('OnMouseUp', function(frame, ...) self.OnMouseUp(block, ...) end) - block.clickZone:SetScript('OnMouseDown', function(frame, ...) self.OnMouseDown(block, ...) end) - block:ClearAllPoints() - block.index = blockIndex - block.blockFadeOut:SetScript('OnPlay', blockFadeOut_OnPlay) - source = 'new' - end - self.InfoBlock[index] = block - block.posIndex = tMove(free, used, block) - print(' |cFF00FF00('..source..')|r |cFF0088FF'..self.name..'|r.|cFF00FFBBusedBlocks['..block.posIndex..'] =|r', block:GetName()) - end - - block.blockFadeOut:SetScript('OnFinished', blockFadeOut_OnFinished) - block:SetScript('OnHide', function(self) - fprint(self:GetName(), '|cFF00FF00HIDE|r', debugstack(1,3,1)) - if(self.DebugTab:IsShown()) then - self.DebugTab:Hide() - end - self.blockFadeOut:SetScript('OnFinished', blockFadeOut_OnFinished) - end) - print(' used/free: |cFFFFFF00' .. #self.usedBlocks .. '|r/|cFF00FFFF'..#self.freeBlocks ..'|r') - return block -end - ---- begins a blockFadeOut animation and fires FreeBlock when that's done -function Default:ClearBlock (block) - if block.blockFadeOut:IsPlaying() then return end - - block.blockFadeOut:SetScript('OnFinished', nil) - block.blockFadeOut:SetScript('OnFinished', function(anim) - --@debug@ - fprint(anim:GetName(), '|cFFFFFF00FINISHED|r', debugstack())--@end-debug@ - anim:SetScript('OnFinished', blockFadeOut_OnFinished) - self:FreeBlock(block) - end) - block.blockFadeOut:Play() -end - ---- fired by OnFinished scripts; does the actual table swapping -function Default:FreeBlock(block) - bprint('|cFFFF4400FreeBlock|r', block:GetName()) - local used = self.usedBlocks - local free = self.freeBlocks - tMove(used, free, block) - - bprint(' |cFFFF4444used/free:|r |cFFFFFF00' .. #used .. '|r/|cFF00FFFF'..#free ..'|r') - - block:Hide() - local animations = {block:GetAnimationGroups() } - for i, animGroup in ipairs(animations) do - bprint(' animGroup', i, animGroup:GetName()) - animGroup:Stop() - end -end
--- a/ObjectiveTracker/BonusObjectiveData.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,311 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/13/2016 7:48 PM -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local Default, Quest = T.DefaultHandler, T.Quest -local print = B.print('Tracker') -local lprint = B.print('Line') -local iprint = B.print('Info') -local Bonus = T.Bonus - -local UnitName, GetRealmName, GetQuestObjectiveInfo, GetTasksTable, GetTaskInfo = UnitName, GetRealmName, GetQuestObjectiveInfo, GetTasksTable, GetTaskInfo -local GetMapNameByID, GetCurrentMapAreaID = GetMapNameByID, GetCurrentMapAreaID -local tinsert, ipairs, pairs, tostring, wipe = tinsert, ipairs, pairs, tostring, table.wipe -local GetQuestProgressBarPercent, PERCENTAGE_STRING, GetTime = GetQuestProgressBarPercent, PERCENTAGE_STRING, GetTime -local TASK_DISPLAY_TEST = 1 -- 1: normal (is nearby or on the map) 2: strict (is nearby) 3: data exists - ---- Holds data for recently completed tasks -local completedTasks = {} - ---- Returns a tasks table modified to include recently completed objectives -local InternalGetTasksTable = function() - local print = Bonus.print - local char = UnitName("player") - local realm = GetRealmName() - local tasks = GetTasksTable() - - for questID, data in pairs(Bonus.Info) do - print('GetTasksTable', questID, #data.objectives) - for i, o in ipairs(data.objectives) do - print('GetTasksTable', questID, i, o.text) - end - end - - for questID, data in pairs(completedTasks) do - if questID > 0 then - local found = false - for i = 1, #tasks do - if tasks[i] == questID then - found = true - break - end - end - -- if it's not part of the current table, then try to insert it where it was last found - if not found then - if data.watchIndex < #tasks then - tinsert(tasks, data.watchIndex, data) - else - tinsert(tasks, data) - end - end - end - end - return tasks -end - ---- Returns an entry from the composed tasks table if possible, otherwise makes an API pull - -local InternalGetTaskInfo = function(questID) - if completedTasks[questID] then - -- if it's a recently completed task, use the information stored for it - return true, true, #completedTasks[questID].objectives - else - return GetTaskInfo(questID) - end -end - ---- Same as above but for the objective entries -local InternalGetQuestObjectiveInfo = function(questID, objectiveIndex) - if ( completedTasks[questID] ) then - print('using internal data') - return completedTasks[questID].objectives[objectiveIndex], completedTasks[questID].objectiveType, true; - else - return GetQuestObjectiveInfo(questID, objectiveIndex, false); - end -end - ---- end redundant copy of silliness ------------------------------------------------------------------------------------------- - -Bonus.Completed = {} -Bonus.POI = {} -Bonus.Scenario = {} -Bonus.QuestBlock = {} -Bonus.WatchInfo = {} - -local function CanShowTask(isInArea, isOnMap, existingTask, numObjectives) - if TASK_DISPLAY_TEST == 1 then - return (isInArea) - elseif TASK_DISPLAY_TEST == 2 then - return (isInArea and(isOnMap and existingTask)) - elseif TASK_DISPLAY_TEST == 3 then - return true - end -end - -function Bonus:GetNumWatched () - - local print = self.print - print(self.name, self) - - local tasks = InternalGetTasksTable() - local numWatched = 0 - local numAll = 0 - local existingTasks = {} - wipe(self.WatchList) - print('|cFF'..self.internalColor..'Bonus.GetNumWatched()|r', #tasks) - print('InternalGetTaskInfo') - - for i, questID in ipairs(tasks) do - local isInArea, isOnMap, numObjectives = InternalGetTaskInfo(questID) - local existingTask = self.InfoBlock[questID] - local displayObjectiveHeader = false; - local displayTask = CanShowTask(isInArea, isOnMap, existingTask) - if displayTask then - print('TaskInfo', '|cFF00FF00showable objective list', questID) - self.Info[questID] = self.Info[questID] or {} - - local t = self.Info[questID] - if (isOnMap or isInArea) and existingTask then - t.areaID = GetCurrentMapAreaID() - local _ - t.mapName, _, _, t.isMicroDungeon, t.microDungeonMapName = GetMapInfo() - print('InternalGetTaskInfo', 'map data', t.areaID, t.mapName) - end - - local taskTitle - t.id = questID - t.objectives = {} - local isComplete = true; - for objectiveIndex = 1, numObjectives do - local text, objectiveType, finished, displayAsObjective = InternalGetQuestObjectiveInfo(questID, objectiveIndex, false); - displayObjectiveHeader = displayObjectiveHeader or displayAsObjective; - if not taskTitle then - if objectiveType == 'progressbar' and not text:match('^%d%+\\%d+') then - taskTitle = text - text = '' - end - end - - - print('TaskObjective', text, objectiveType, finished, displayAsObjective) - t.objectives[objectiveIndex] = t.objectives[objectiveIndex] or {} - local o = t.objectives[objectiveIndex] - - o.index = objectiveIndex - o.text = text - o.type = objectiveType - o.finished = finished - o.displayAsObjective = displayAsObjective - isComplete = (isComplete and finished) - end - - T.SetRewards(t, questID) - - -- didn't get a name from progress bar? what about area name - if not taskTitle then - if isInArea then - taskTitle = GetMapNameByID(GetCurrentMapAreaID()) - end - end - t.numObjectives = numObjectives - t.isInArea = isInArea - t.isOnMap = isOnMap - t.existingTask = existingTask - t.questID = questID - t.id = questID - t.taskIndex = i - t.title = taskTitle - t.isComplete = isComplete - self.WatchList[i] = t - elseif existingTask then - print('TaskInfo', '|cFFFF4400hideable task', questID) - existingTask:Hide() - end - - - print ('TaskInfo', i, '|cFFFFFF00'.. questID..'|r', '('..(isInArea and '|cFF88FF88' or '|cFF666666') .. 'isInArea|r', 'AND', (isOnMap and '|cFF88FF88' or '|cFF666666') .. 'isOnMap|r)', 'OR', (existingTask and '|cFF88FF88' or '|cFF666666') .. 'existingTask|r', (displayTask and '|cFF00FF00show|r' or '|cFFFF4400hide|r')) - end - - - self.numWatched = #self.WatchList - self.numAll = #existingTasks - return self.numWatched, self.numWatched, self.WatchList -end - -Bonus.OnEvent = function(block, event, ...) - if event == 'QUEST_LOG_UPDATE' then - local info = block.info - - local isInArea, isOnMap, numObjectives = InternalGetTaskInfo(info.questID) - if not CanShowTask(isInArea, isOnMap, block, numObjectives) then - block:Hide() - end - end -end - -Bonus.GetBlock = function(self, index) - local block = Default.GetBlock(self, index) - block:SetScript('OnEvent', self.OnEvent) - block:RegisterEvent('QUEST_LOG_UPDATE') - return block -end - ---- info cleanup done when turn-ins are detected -Bonus.OnTurnIn = function(self, block, questID, xp, money) - --[=[ - local info = self.Info[questID] - if info.rewardInfo and #info.rewardInfo >= 1 then - for i, reward in ipairs(info.rewardInfo) do - --[[ - type = 'item', - index = i , - name = name, - texture = texture, - count = count, - quality = quality, - isUsable = isUsable - ]] - print(' reward ', i, ' ', reward.type, reward.name, reward.count) - - end - end - - print('|cFFFF8800'..block:GetName()..':OnTurnIn call', questID, xp, money) - local savedTasks = B.Conf.TasksLog or {} - - info.completedTime = GetTime() - info.animate = true - T.SetAnimate(self.updateReasonModule) - savedTasks[questID] = { - id = questID, - title = info.title, - finished = true, - numObjectives = info.numObjectives, - objectives = info.objectives, - rewardInfo = info.rewardInfo, - } - B.Conf.TasksLog = savedTasks - - print(' ## CONF TASKLOG ##') - for i, t in pairs(savedTasks[questID]) do - print(' |cFFFFFF00'.. tostring(i)..'|r', t) - - end - for o, j in ipairs(savedTasks[questID].objectives) do - print(' |cFF00FFFF#'.. o ..'|r', j.type, j.finished) - end - - print('adding', info.title, 'to cache') - --]=] -end - -Bonus.GetInfo = function(self, taskIndex) - print(self.name, self) - return self.WatchInfo[taskIndex] -end - - - ---- Update hooks -Bonus.UpdateObjectives = function(handler, block, blockSchema) - block.schema = blockSchema or 'default' - local info = block.info - block.title:SetText(info.title) - - - Default.UpdateObjectives(handler, block) - return blockSchema -end - -Bonus.UpdateLine = function(handler, block, data) - local info = block.info - local print = lprint - local text, attachment = '', nil - if data.type == 'progressbar' then - print(' |cFFFF44DDpercent='..tostring(GetQuestProgressBarPercent(info.questID))) - local percent = 100 - if not data.finished then - percent = GetQuestProgressBarPercent(info.questID) - end - data.value = percent - data.maxValue = 100 - - attachment = T.GetWidget(data, 'StatusBar', info.questID..'-'..data.index) - attachment:SetParent(block) - print(attachment:GetNumPoints()) - for i = 1, attachment:GetNumPoints() do - print(' ',attachment:GetPoint(i)) - end - - attachment.value = percent - attachment.maxValue = 100 - attachment.status:SetFormattedText(PERCENTAGE_STRING, percent) - --attachment:SetParent(handler.frame) - --print(attachment.status:GetText()) - print(' |cFFFF0022** text:|r', data.text, '|cFFFF0022value:|r', data.value, '|cFFFF0022max:|r', data.maxValue) - end - text = data.text - return text, attachment, 'default' -end - -Bonus.Select = function(handler, block) - print(handler, block) - handler:OnTurnIn(block, block.info.questID) -end -Bonus.Remove = function(self) - -end \ No newline at end of file
--- a/ObjectiveTracker/Default.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,287 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/17/2016 7:33 AM ---- These are the first layer of methods invoked by event handlers - -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local Devian = Devian -local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band -local IsResting, UnitXP, UnitXPMax, GetXPExhaustion, tinsert, tremove = IsResting, UnitXP, UnitXPMax, GetXPExhaustion, table.insert, table.remove -local UnitLevel, IsQuestWatched, UIParent = UnitLevel, IsQuestWatched, UIParent -local GetAutoQuestPopUp, GetQuestLogCompletionText = GetAutoQuestPopUp, GetQuestLogCompletionText -local PERCENTAGE_STRING, GetQuestProgressBarPercent = PERCENTAGE_STRING, GetQuestProgressBarPercent -local Default, AutoQuest, Quest, Bonus, Cheevs = T.DefaultHandler, T.AutoQuest, T.Quest, T.Bonus, T.Cheevs -local InCombatLockdown, format, lshift, CreateFrame = InCombatLockdown, format, bit.lshift, CreateFrame -local IsModifiedClick, ChatEdit_GetActiveWindow = IsModifiedClick, ChatEdit_GetActiveWindow -local print = B.print('Tracker') -local oprint = B.print('Objectives') -local bprint = B.print('Block') -local tprint = B.print('Tracker') -local lprint = B.print('Line') -local unitLevel = 1 -local OBJECTIVE_TRACKER_UPDATE_REASON = OBJECTIVE_TRACKER_UPDATE_REASON -local debug = false - ---- FRAMES -local Wrapper = _G.VeneerObjectiveWrapper -local Scroller = Wrapper.scrollArea -local Scroll = _G.VeneerObjectiveScroll -local orderedHandlers = T.orderedHandlers -local orderedNames = T.orderedNames - - ---- Placing the Update functions here since they shouldn't be messing with schema stuff -local currentPosition, anchorFrame, anchorPoint ---- Positioning and stuff -local tick = 0 -local initReason = OBJECTIVE_TRACKER_UPDATE_ALL -local requiresInit -function T:Update (reason, ...) - if not B.Conf.VeneerObjectiveWrapper.enabled then - return - end - tick = tick + 1 - local print = tprint - local hasStuff = false - local insertingStuff = false - - if initReason then - reason = initReason - initReason = nil - elseif not reason then - reason = OBJECTIVE_TRACKER_UPDATE_ALL - end - print(format('|cFFBB0066Update:|r %d |cFFFF%04X%d|r ', tick, lshift(reason, 4)), reason, ...) - currentPosition = 0 - - for id, handler in pairs(T.orderedHandlers) do - local frame = handler.frame - - print('') - if band(reason, handler.updateReasonModule + handler.updateReasonEvents) > 0 then - insertingStuff = handler:UpdateTracker(reason, ...) - else - print(' |cFFFF4400Update:|r skipping',handler.name) - end - - if handler.numWatched >= 1 then - hasStuff = true - currentPosition = currentPosition + 1 - Default.AddTracker(handler, frame, currentPosition) - frame.wasEmpty = nil - else - frame.destinationOffset = 0 - if not frame.wasEmpty and not frame.fadeOut:IsPlaying() then - frame.fadeOut:Play() - end - frame.wasEmpty = true - end - end - - -- do these whenever there is content or content is being added - if hasStuff or insertingStuff then - T:FinishWrapper() - end - Quest.GetClosest() - T.UpdateActionButtons(reason) -end - -Default.UpdateTracker = function (handler, reason, id, isNew) - local print = handler.print - local frame = handler.frame - local blockIndex = 0 - print('MODULE:'..handler.name, 'message:', reason, 'id:', id, (isNew and '|cFF88FF88' or '|cFF555555')..'isNew|r') - handler.updateReason = reason - local numWatched, numAll, watchTable = handler:GetNumWatched(id, isNew) - - if numWatched >= 1 then - if watchTable then - print(' WatchList', ' n ID Obj wID Log Blk') - for i, w in ipairs(watchTable) do - print(' WatchList', format('%2d => %6d %3d %3d %3s %s', i, w.id, w.numObjectives, w.watchIndex, (w.logIndex or ''), (handler.InfoBlock[w.id] and handler.InfoBlock[w.id]:GetName() or ''))) - end - end - end - - handler.numWatched = numWatched - handler.numAll = numAll - handler.numBlocks = 0 - handler.currentBlock = 0 - handler.currentAnchor = frame.titlebg - for blockIndex = 1, numWatched do - local currentBlock = handler:UpdateBlock(blockIndex, id, isNew) - if currentBlock then - handler:AddBlock(currentBlock) - else - print(' |cFF'..handler.internalColor..'finished|r @', blockIndex) - break -- done with quest stuff - end - end - - local numBlocks = handler.numBlocks - local used = handler.usedBlocks - local free = handler.freeBlocks - print(format('#### %s ## |cFFFF8800%04X|r --- blocks |cFFFF8800%d|r, (used/free: |cFFFF8800%d|r/|cFFFF8800%d|r)', handler.name, band(reason, handler.updateReasonModule + handler.updateReasonEvents, reason), numBlocks, #used, #free)) - - return numWatched, numAll -end - -Default.UpdateBlock = function (handler, index) - --@debug@ - local print = bprint -- @end-debug@ - if not index then - return - end - local info = handler.WatchList[index] -- should match corresponding internal watch lists if they exist - if not info then - return - end - local frame = handler.frame - local block = handler:GetBlock(info.id) - - --@debug@ - handler.print('UpdateBlock', '|cFF00FFFF'..index..'|r|cFF0099FF', info.id ,'|r', (block.isAnimating and 'animating' or 'static'))--@end-debug@ - if block.isAnimating then - -- Nothing to do, leave it as is - return block - end - - block.handler = handler - block.info = info - info.blockIndex = index - --@debug@ - local keyInfo--@end-debug@ - if info.id then - handler.InfoBlock[info.id] = block - --@debug@ - keyInfo = (keyInfo and (keyInfo..', ') or '') .. 'InfoBlock[' .. info.id .. '] = *' .. block:GetName():gsub('%D', '') --@end-debug@ - end - if info.logIndex then - handler.LogBlock[info.logIndex] = block - --@debug@ - keyInfo = (keyInfo and (keyInfo..', ') or '') .. 'LogBlock[' .. info.logIndex .. '] = ' .. block:GetName():gsub('%D', '')--@end-debug@ - end - if info.watchIndex then - handler.WatchBlock[info.watchIndex] = block - --@debug@ - keyInfo = (keyInfo and (keyInfo..', ') or '') .. 'WatchBlock[' .. info.watchIndex .. '] = ' .. block:GetName():gsub('%D', '')--@end-debug@ - end - --@debug@ - if keyInfo then print(' assigned', keyInfo) end--@end-debug@ - handler.BlockInfo[index] = info - block.endPoint = block.titlebg - block.attachmentHeight = 0 - block.currentLine = 0 - local attachments, override_schema = handler:UpdateObjectives(block, block.schema) - - - block.title:SetText(info.title) - - if info.specialItem and not info.itemButton then - --@debug@ - print(' - |cFF00FFFFgenerating item button for info set')--@end-debug@ - info.itemButton = T.SetItemButton(block, info) - end - - - if info.selected then - block.SelectionOverlay:Show() - else - block.SelectionOverlay:Hide() - end - - if info.tagInfo then - handler:AddTags(block, info.tagInfo, info.tagCoords) - end - - if override_schema then - block.schema = override_schema - elseif info.schema then - block.schema = info.schema - end - return block -end - -Default.UpdateObjectives = function(handler, block, block_schema, displayObjectives) - local print = lprint - displayObjectives = displayObjectives or true - block_schema = block_schema or block.schema - local info = block.info - print(' |cFF00FF00default.objectives', block:GetName()) - -- reset the starting positions - local text, attachment, template - local numAttachments = 0 - - if info.objectives and displayObjectives then - for i, data in ipairs(info.objectives) do - text, attachment, template = handler:UpdateLine(block, data) - if text or attachment then - local line = handler:GetLine(block) - line.height = 0 - print(' |cFF88FF00#', i, data.type, text, attachment) - handler:AddLine(block, text, attachment, template) - end - if attachment then - numAttachments = numAttachments + 1 - end - end - end - - if block.currentLine < block.numLines then - print(' - cull', block.currentLine, block.numLines) - for i = block.currentLine + 1, block.numLines do - print(' - hide |cFFFF0088'..i..'|r', block.lines[i]) - block.lines[i]:ClearAllPoints() - block.lines[i]:Hide() - end - end - - if block.currentLine > 0 then - block.attachmentHeight = block.attachmentHeight - print(' |cFF00FF00attachment:', block.attachmentHeight) - end - return numAttachments, block_schema -end - -Default.UpdateLine = function(handler, block, data) - return block.info.description, nil, 'default' -end - -Default.Select = function(handler, block) - T:Update() -end -Default.Open = function(handler, block) - T:Update(handler.updateReasonModule) -end -Default.Remove = function(handler, block) - T:Update(handler.updateReasonModule) -end -Default.Report = function(handler, block) - print('Stats:', handler.numWatched,'items tracked,', handler.numBlocks,'blocks assigned.') -end - -function Default:OnMouseUp (button) - print(self.handler.name, button, IsModifiedClick('CHATLINK'), IsModifiedClick("QUESTWATCHTOGGLE")) - if button == 'LeftButton' then - if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then - self.Link(self.handler, self) - elseif IsModifiedClick("QUESTWATCHTOGGLE") then - self.Remove(self.handler, self) - else - self.Select(self.handler, self) - end - elseif button == 'RightButton' then - self.Open(self.handler, self) - end - self.initialButton = nil - self.modChatLink = nil - self.modQuestWatch = nil - --T:Update(self.handler.updateReasonModule) - print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r') -end -function Default:OnMouseDown (button) - --print(self.info.title) -end
--- a/ObjectiveTracker/ExperienceBar.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/6/2016 4:44 AM - -local B = select(2,...).frame -local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local tostring = tostring -local UnitLevel, IsResting, UnitXP, UnitXPMax, GetXPExhaustion, IsXPUserDisabled = UnitLevel, IsResting, UnitXP, UnitXPMax, GetXPExhaustion, IsXPUserDisabled -local Wrapper = _G.VeneerObjectiveWrapper -local print = B.print('XPTracker') - -mod.InitializeXPTracker = function() - local XPBar = Wrapper.XPBar - if UnitLevel('player') == 100 then - XPBar:Hide() - return - end - - --- xp bar - XPBar:SetWidth(mod.Conf.Wrapper.WrapperWidth - Wrapper.CloseButton:GetWidth()) - XPBar.statusbg:SetAllPoints(XPBar) - XPBar:RegisterEvent('DISABLE_XP_GAIN') - XPBar:RegisterEvent('ENABLE_XP_GAIN') - XPBar:SetScript('OnEvent', mod.UpdateXP) - - if not IsXPUserDisabled() then - mod.EnableXP(XPBar) - else - mod.DisableXP(XPBar) - end - - mod.UpdateXP(XPBar) -end - -mod.EnableXP = function(self) - self:RegisterEvent('PLAYER_XP_UPDATE') - self:RegisterEvent('PLAYER_LEVEL_UP') - self:RegisterEvent('PLAYER_UPDATE_RESTING') - self.statusbg::SetColorTexture(0,0,0,.25) - self:Show() -end - -mod.DisableXP = function(self) - self:UnregisterEvent('PLAYER_XP_UPDATE') - self:UnregisterEvent('PLAYER_LEVEL_UP') - self:UnregisterEvent('PLAYER_UPDATE_RESTING') - self.statusbg::SetColorTexture(0.5,0.5,0.5,0.5) - self:Hide() -end - -mod.UpdateXP = function(self, event) - if event == 'DISABLE_XP_GAIN' then - mod.DisableXP(self) - elseif event == 'ENABLE_XP_GAIN' then - mod.EnableXP(self) - end - - if not IsXPUserDisabled() then - - local xp = UnitXP('player') - local xpmax = UnitXPMax('player') - local rest = GetXPExhaustion() - self.foreground:SetWidth((xp/xpmax) * self:GetWidth()) - if rest then - self.rested:ClearAllPoints() - if xp == 0 then - self.rested:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0) - else - self.rested:SetPoint('TOPLEFT', self.fg, 'TOPRIGHT', 0, 0) - end - - if (xp + rest) > xpmax then - self.rested:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, 0) - else - self.rested:SetWidth((rest/xpmax) * self:GetWidth()) - end - self.rested:SetPoint('BOTTOM', self, 'BOTTOM') - self.rested:Show() - else - self.rested:Hide() - end - - if IsResting() then - self.statusbg::SetColorTexture(.2,.8,.2,.5) - else - self.statusbg::SetColorTexture(0,0,0,.25) - end - self.xpText:SetText(xp .. '/'.. xpmax .. (rest and (' ('..tostring(rest)..')') or '')) - end -end \ No newline at end of file
--- a/ObjectiveTracker/Layout.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,702 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/30/2016 12:49 AM ---- Everything that involves directly placing elements on the screen goes here. Sizing, spacing, tiling, etc. -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band -local IsResting, UnitXP, UnitXPMax, GetXPExhaustion, tinsert, tremove = IsResting, UnitXP, UnitXPMax, GetXPExhaustion, table.insert, table.remove -local UnitLevel, IsQuestWatched, UIParent = UnitLevel, IsQuestWatched, UIParent -local GetAutoQuestPopUp, GetQuestLogCompletionText = GetAutoQuestPopUp, GetQuestLogCompletionText -local PERCENTAGE_STRING, GetQuestProgressBarPercent = PERCENTAGE_STRING, GetQuestProgressBarPercent -local Default, AutoQuest, Quest, Bonus, Cheevs = T.DefaultHandler, T.AutoQuest, T.Quest, T.Bonus, T.Cheevs -local InCombatLockdown, format, lshift, CreateFrame = InCombatLockdown, format, bit.lshift, CreateFrame -local IsModifiedClick, ChatEdit_GetActiveWindow = IsModifiedClick, ChatEdit_GetActiveWindow -local band, bor = bit.band, bit.bor -local print = B.print('Layout') -local oprint = B.print('Objectives') -local bprint = B.print('Block') -local tprint = B.print('Tracker') -local lprint = B.print('Layout') -local unitLevel = 1 - -local REWARD_POPUP = _G.VeneerRewardsPopOut -local ANIM_STATE = 'Animation: %04X' -local INIT_STATE = 'Init: %04X' - ---- Bitfields of import ---- control value for everything -local OBJECTIVE_TRACKER_UPDATE_REASON = _G.OBJECTIVE_TRACKER_UPDATE_REASON ---- flags reason categories where frame layout requires initializing (starts high) -local initReason = 0xFFFF ---- flags reason categories where frame anchor updates must be delayed because of an ongoing animation (starts low) -local animateReason = 0x0000 - ---- FRAMES -local Wrapper = _G.VeneerObjectiveWrapper -local Scroller = Wrapper.scrollArea -local Scroll = _G.VeneerObjectiveScroll -local orderedHandlers = T.orderedHandlers -- ['module'].frame -local orderedNames = T.orderedNames -- ['module'].frame - ---- FRAME TEMP VARIABLES -local wrapperWidth, wrapperHeight = 0, 0 -local scrollWidth, scrollHeight -local blockPosition - ---- SCHEMA VARIABLES -local schemaName, lastSchema = { - tracker = '', - block = '', - line = '' -}, {} -local trackerSchema, blockSchema, lineSchema - -local itemButtonSize, itemButtonSpacing = 36, 1 -local wrapperMaxWidth, wrapperMaxHeight = 270, 490 -- these are the hard bounds, actual *Height variables are changed -local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE' -local wrapperPosition = {'RIGHT', UIParent, 'RIGHT', -84, 0 } -local rewardSize = 24 - -local headerHeight, headerColor, headerSpacing = 16, {1,.75,0,1}, 2 -local headerbg = {'VERTICAL', 1, 1, 0.5, 0.5, 1, 1, 0.5, 0} -local headerFont, headerSize, headerOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 14, 'OUTLINE' - -local titlebg = {'HORIZONTAL', 1, 0, .7, 0, 1, 0, .7, .2} -local titleFont, titleSize, titleOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'OUTLINE' -local titleColor = {0,.7,1,1 } -local titleBlend = 'BLEND' - -local textbg = {'HORIZONTAL', 0, 0, 0, 0.4, 0, 0, 0, 0 } -local textFont, textSize, textOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]], 16, 'OUTLINE' -local textColor = {1,1,1,1 } -local textBlend = 'BLEND' - -local widgetTextFont, widgetTextSize, widgetTextOutline = [[Interface\Addons\SharedMedia_MyMedia\font\XOIREQE.TTF]], 11, 'OUTLINE' -local widgetTextColor = {1,1,1,1 } -local widgetHeight, widgetBorder = 17, 1 -local widgetWidth = 250 - -local selectionbg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 0.225} -local titleSpacing, textSpacing, blockSpacing = 3, 3, 1 -local titleIndent, textIndent,selectionIndent = 2, 5, 50 ---- END SCHEMA - - -local SetAnimate = function(reason, animate) - print('comparing', animateReason, reason) - if animate then - if band(animateReason, reason) == 0 then - animateReason = animateReason + reason - end - else - if band(animateReason, reason) > 0 then - animateReason = animateReason - reason - end - end - Wrapper.AnimState:SetFormattedText(ANIM_STATE, animateReason) -end - - ---- schema swapper -T.UpdateSchema = function(layer, newSchema) - if not (T.Conf.Schema[layer] and T.Conf.Schema[layer][newSchema]) then - return - elseif schemaName[layer] == newSchema then - return - end - lastSchema[layer] = schemaName[layer] - schemaName[layer] = newSchema - local c = T.Conf.Schema[layer][newSchema] - - if layer == 'tracker' then - headerHeight, headerSpacing = c.headerHeight, c.headerSpacing - headerColor = c.headerColor - headerbg = c.headerbg - headerFont, headerSize, headerOutline = unpack(c.headerFont) - trackerSchema = newSchema - elseif layer == 'block' then - titlebg = c.titlebg - titleFont, titleSize, titleOutline = unpack(c.titleFont) - selectionbg = c.selectionbg - titleSpacing, textSpacing, blockSpacing = c.titleSpacing, c.textSpacing, c.blockSpacing - titleIndent, textIndent,selectionIndent = c.titleIndex, c.textIndex, c.selectionIndent - titleColor = c.titleColor - titleBlend = c.titlebg[10] or 'BLEND' - textBlend = c.textbg[10] or 'BLEND' - print(unpack(c.titleColor)) - rewardSize = 24 - textFont, textSize, textOutline = unpack(c.textFont) - textbg = c.textbg - textIndent = c.textIndent - rewardSize = c.rewardSize - blockSchema = newSchema - elseif layer == 'line' then - textColor = c.textColor - lineSchema = newSchema - elseif layer == 'widget' then - widgetTextColor = c.textSpacing - widgetTextFont, widgetTextSize, widgetTextOutline = unpack(c.textFont) - end - tprint('|cFFFF0088 Schema:|r', layer, lastSchema[layer], '->', newSchema) -end --- todo: figure out why objectives go invisible -local anchorPoint, anchorFrame -local abs, GetTime = math.abs, GetTime -Default.AddTracker = function(handler, frame, index) - local isInitialized = true - if initReason and (band(initReason, handler.updateReason) > 0 ) then - isInitialized = false - initReason = initReason - handler.updateReason - print('|cFF00FF00%%% initialization status update:', format('%04X', initReason)) - - frame.SlideIn:SetScript('OnPlay', function() - SetAnimate(handler.updateReasonModule, true) - end) - - frame.SlideIn:SetScript('OnFinished', function() - SetAnimate(handler.updateReasonModule, false) - end) - - if initReason == 0 then - initReason = nil - end - end - - if index == 1 then - print('|cFF00FF00### beginning wrapper layout -----------------') - anchorPoint, anchorFrame = 'TOP', Scroll - wrapperHeight = 18 - end - - frame.destinationOffset = -wrapperHeight - print(frame.destinationOffset, frame.previousOffset) - if isInitialized and (abs(frame.previousOffset - frame.destinationOffset) > 0.9) and frame:IsVisible() then - if frame.wasEmpty then - frame.previousOffset = -Wrapper:GetHeight() - end - - local postFrame, postPoint = anchorFrame, anchorPoint - local delta = frame.destinationOffset - frame.previousOffset - local _, _, _, _, offset = frame:GetPoint(1) - print(' |cFF00FFBBpushing', frame:GetName(), delta, 'pixels, from', frame.previousOffset, '(', offset, ')') - frame.SlideIn.translation:SetTarget(frame) - frame.SlideIn.translation:SetOffset(0, delta) - frame.SlideIn:Play() - --for i, b in ipairs(handler.usedBlocks) do - --b.SlideIn.translation:SetOffset(0, delta) - -- b.SlideIn:Play() - --end - local start = GetTime() - frame.SlideIn:SetScript('OnFinished', function() - print(' |cFF00BBFF'..frame:GetName(), 'moved', delta, 'over duration of ', GetTime()-start) - frame:SetParent(Scroll) - frame:SetPoint('TOP', Scroll, 'TOP', 0, frame.destinationOffset) - frame.previousOffset = frame.destinationOffset - frame.SlideIn:SetScript('OnFinished', nil) - if Wrapper.destinationHeight then - Wrapper:SetHeight(Wrapper.destinationHeight) - Scroller:SetHeight(Wrapper.destinationHeight) - Scroll:SetHeight(Wrapper.destinationHeight) - Wrapper.previousHeight = Wrapper.destinationHeight - Wrapper.destinationHeight = nil - end - - end) - else - print(' |cFF00BBFFpinning '..handler.name..' to', anchorFrame:GetName(), anchorPoint, '|rcurrent frame height:', frame.height) - print(' |cFFFF0088total height:', wrapperHeight) - frame:ClearAllPoints() - frame:Show() - frame:SetParent(Scroll) - frame:SetPoint('TOP', Scroll, 'TOP', 0, frame.destinationOffset) - frame:SetPoint('LEFT', Scroll, 'LEFT') - frame:SetPoint('RIGHT', Scroll, 'RIGHT') - frame.previousOffset = frame.destinationOffset - handler.initialized = true - end - - frame.title:SetFont(headerFont, headerSize, headerOutline) - frame.titlebg:SetHeight(headerHeight) - frame.title:SetTextColor(unpack(headerColor)) - - if frame.height ~= frame.previousHeight then - frame:SetHeight(frame.height) - end - - if frame.wasEmpty then - frame.headerFade:Play() - frame.wasEmpty = nil - end - - wrapperHeight = wrapperHeight + frame.height - anchorFrame = handler.frame - anchorPoint = 'BOTTOM' - -end - -Default.AddBlock = function(self, block, blockIndex) - local blockIndex = blockIndex or (self.currentBlock + 1) - local print = bprint - local tracker = self.frame - local info = block.info - - block.index = blockIndex - print('blockschema', blockSchema, block.schema) - if blockSchema ~= block.schema then - T.UpdateSchema('block', block.schema) - print(' ### activating block schema:|cFF0088FF', block.schema) - end - - block:SetWidth(T.Conf.Wrapper.Width) - block.title:SetSpacing(titleSpacing) - block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing) - block.title:SetPoint('LEFT', block, 'LEFT', titleIndent, 0) - block.title:SetTextColor(unpack(titleColor)) - block.titlebg:SetColorTexture(1,1,1,1) - block.titlebg:SetGradientAlpha(unpack(titlebg)) - block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0) - block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing) - block.titlebg:SetBlendMode(titleBlend) - block.status:SetSpacing(textSpacing) - block.status:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, -textSpacing) - block.status:SetPoint('LEFT', block.titlebg, 'LEFT', textIndent, 0) - block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0) - block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0) - block.statusbg:SetColorTexture(1,1,1,1) - block.statusbg:SetGradientAlpha(unpack(textbg)) - block.statusbg:SetBlendMode(textBlend) - block.SelectionOverlay:SetGradientAlpha(unpack(selectionbg)) - block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0) - block.SelectionOverlay:SetPoint('BOTTOMRIGHT') - - - local titleHeight = floor(block.title:GetHeight()+.5) - local titlebgHeight = titleHeight + titleSpacing*2 - block.titlebg:SetHeight(titlebgHeight) - - local statusHeight = floor(block.status:GetHeight()+.5) - local statusbgHeight = statusHeight + textSpacing*2 - local attachmentHeight =floor(block.attachmentHeight + .5) - - if attachmentHeight > 0 then - attachmentHeight = attachmentHeight + textSpacing - end - - block.height = titlebgHeight + attachmentHeight - block:SetHeight(block.height) - - local anchor, target, point, x, y = 'TOPRIGHT', block, 'TOPRIGHT', -2, -2 - for i, tile in ipairs(block.rewardTile) do - --print(rewardSize) - tile:SetSize(rewardSize, rewardSize) - tile:ClearAllPoints() - tile:SetPoint(anchor, target, point, x, y) - block.rewardLabel[i]:SetPoint('TOP', tile, 'TOP', 0, 0) - anchor, target, point, x, y = 'TOPRIGHT', tile, 'TOPLEFT', -2, 0 - end - - self.print('AddBlock', 'anchor to|cFF0088FF', self.currentAnchor:GetName()) - self.print('AddBlock', 'attachment:|cFF00FF00', attachmentHeight, '|rtitle:|cFF00FF00', titlebgHeight, '|r('.. titleHeight..')') - if block.debug then - local func = (B.Conf.GuidesMode == true) and 'Show' or 'Hide' - for _, region in ipairs(block.debug) do - region[func]() - end - end - - --- Handler vars - if blockIndex == 1 then - tracker.previousHeight = tracker.height - tracker.height = headerHeight - blockPosition = -headerHeight - self.print('AddBlock', 'new layout: headerHeight:|cFF00FF00', headerHeight, '|rpreviousHeight:|cFF00FF00', tracker.previousHeight) - else - blockPosition = blockPosition - self.print('AddBlock', 'advancing: height:|cFF8888FF', tracker.height) - end - self.currentBlock = blockIndex - self.currentAnchor = block - - block:SetPoint('TOPLEFT', self.frame, 'TOPLEFT', 0, blockPosition) - block:SetPoint('RIGHT', tracker,'RIGHT', 0, 0) - self.numBlocks = self.numBlocks + 1 - print(' |cFFFFFF00'..tracker.height..'|r', '|cFF00FF00'..block:GetName()..'|r', block.height, tracker.height) - tracker.height = tracker.height + block.height - blockPosition = blockPosition - block.height - - block:Show() - - - if Devian and Devian.InWorkspace() then - block.DebugTab:SetParent(UIParent) - block.DebugTab:SetPoint('RIGHT', block.titlebg, 'LEFT', 0, 0) - block.DebugTab.status:SetText(tostring(block.schema) .. ' @|cFF00FF00' .. tostring(block.posIndex) .. '|r #|cFFFFFF00'.. tostring(info.logIndex or info.id) .. '|r'.. - ' H|cFFFFFF00' .. tostring(block.height) .. ' L|cFF00FFFF' .. tostring(block.numLines) ..'|r ' .. (info.statusKey or '')) - block.DebugTab:Show() - end -end - - -local tagOrder = {'completion', 'frequency', 'type'} ---- Used as an iterator of sorts for cascaded tag icon placements (the daily/faction/account icons) -Default.AddTags = function (handler, block, tagInfo, tagCoords) - local print = bprint - - local tagPoint, tagAnchor, tagRelative = 'TOPRIGHT', block, 'TOPRIGHT' - handler.print('AddTag', block:GetName(), tagInfo, tagCoords) - for order, key in ipairs(tagOrder) do - local tag = block[key .. 'Tag'] - if tag and tagInfo[key] then - tag:SetTexCoord(unpack(tagInfo[key])) - tag:Show() - tag:SetPoint(tagPoint, tagAnchor, tagRelative, 0, 0) - tagPoint, tagAnchor, tagRelative = 'TOPRIGHT', tag, 'TOPLEFT' - else - block[key .. 'Tag']:Hide() - end - end - - return tagPoint, tagAnchor, tagRelative -end - - ---- Adds the given line to the current content and advances the anchor pointer to that new line for the following call. -Default.AddLine = function(handler, block, text, attachment, template) - local print = lprint - local lineIndex = block.currentLine + 1 - local line = handler:GetLine(block, lineIndex) - - line.index = lineIndex - template = template or 'default' - if template and lineSchema ~= template then - print(' |cFF00FF00change schema', template) - T.UpdateSchema('line', template) - end - line.status:SetSpacing(textSpacing) - line.status:SetPoint('LEFT', line, 'LEFT', textIndent, 0) - line.status:SetPoint('RIGHT', line, 'RIGHT',0, 0) - line.status:SetTextColor(unpack(textColor)) - line:SetPoint('TOP', block.endPoint, 'BOTTOM', 0, -textSpacing) - line.status:SetPoint('LEFT', line, 'LEFT', textIndent, 0) - line:SetPoint('LEFT', block, 'LEFT') - line:SetPoint('RIGHT', block, 'RIGHT') - line:Show() - line:SetScript('OnMouseUp', function(self, button) - handler.OnMouseUp(block, button) - end) - - - handler.print('AddLine', '|cFF00FFFF'..tostring(line.schema)..'|r', line:GetName()) - --[[ - for i = 1, line:GetNumPoints() do - tprint(' - ', line:GetPoint(i)) - end - tprint(' - ', line:GetSize()) - tprint(' - ', line:GetParent(), line:GetParent():IsVisible()) - tprint(' - ', line:IsVisible()) - --]] - - - - - -- fill in the text, then derive pixel-rounded height - line.status:SetText(text) - line.height = floor(line.status:GetStringHeight()+.5) - - -- For progressbar and timer lines, status text may be used as the title heading - if attachment then - attachment:SetPoint('TOP', line, 'TOP') - attachment:SetPoint('LEFT', line, 'LEFT', textIndent, 0) - attachment:SetPoint('RIGHT', line, 'RIGHT') - print(' |cFFFF0088doing things with a widget', attachment:GetSize()) - line.height = attachment:GetHeight() - if text then - line.height = max(line.height, line.status:GetStringHeight()) - end - if attachment.status:GetText() then - line.height = max(line.height, attachment.status:GetStringHeight()) - end - attachment:Show() - end - - line:SetHeight(line.height) - block.attachmentHeight = block.attachmentHeight + line.height + textSpacing - - local debug_points = '' - for i = 1, line:GetNumPoints() do - local point, parent, anchor = line:GetPoint(i) - debug_points = debug_points .. tostring(parent:GetName()) .. ', ' .. anchor .. ' ' - end - - print(' |cFF0088FFsetting line #'..lineIndex..' for|r', block.info.title, "\n |cFF0088FFsize:|r", line.height, - "|cFF0088FFpoint:|r", debug_points, "|cFF0088FFwidget:|r", (line.widget and 'Y' or 'N')) - block.currentLine = lineIndex - block.endPoint = line -- edge used for the next block - - return lineIndex -end - --- Resets blocks to hidden if the tracker framescript gets disrupted -Default.OnHide = function(self) - for i, block in pairs(self.handler.usedBlocks) do - block:Hide() - end -end - ----------- ---- Top level methods - - -T.UpdateItemButtonAnchor = function (block, itemButton) - local print = bprint - print('**|cFF0088FF'..itemButton:GetName(), '|r:Update()') - if itemButton.questID ~= block.info.questID then - print('** |cFFFF0088mismatched block assignment', itemButton.questID,'<~>', block.info.questID) - -- something happened between this and last frame, go back and set new probes - return T.UpdateActionButtons() - end - - local previousItem = itemButton.previousItem - local upper_bound = Scroller:GetTop() + Scroller.snap_upper - local lower_bound = Scroller:GetBottom() + Scroller.snap_lower + itemButtonSize - local point, anchor, relative - - if block:GetBottom() < lower_bound then - print('** ',block:GetName() ,'|cFFFFFF00bottom =', floor(block:GetBottom()+.5), 'threschold =', floor(lower_bound+.5)) - if previousItem then - print('adjusting', previousItem:GetName()) - previousItem:ClearAllPoints() - previousItem:SetPoint('BOTTOM', itemButton, 'TOP', 0, itemButtonSpacing) - end - itemButton:ClearAllPoints() - itemButton.x = Wrapper:GetLeft() -4 - itemButton.y = Wrapper:GetBottom() - point, anchor, relative = 'BOTTOMRIGHT', UIParent, 'BOTTOMLEFT' - Scroller.snap_lower = Scroller.snap_lower + itemButtonSize + itemButtonSpacing - - elseif block:GetTop() > upper_bound then - print('** ',block:GetName() ,'|cFFFFFF00top =', floor(block:GetTop()+.5), 'threschold =', floor(upper_bound+.5)) - itemButton:ClearAllPoints() - if previousItem then - print('latch onto another piece') - point, anchor, relative ='TOP', previousItem, 'BOTTOM' - itemButton.x = 0 - itemButton.y = -itemButtonSpacing - else - print('latch at corner', Scroller:GetLeft() -itemButtonSpacing, Scroller:GetTop()) - point, anchor, relative = 'TOPRIGHT', UIParent, 'BOTTOMLEFT' - itemButton.x = Scroller:GetLeft() -4 - itemButton.y = Scroller:GetTop() - end - itemButton:Show() - Scroller.snap_upper = Scroller.snap_upper - (itemButtonSize + itemButtonSpacing) - else - print('** ',block:GetName() ,'|cFF00FF00span =', floor(block:GetBottom()+.5), floor(block:GetTop()+.5), 'threschold =', floor(lower_bound+.5)) - itemButton:ClearAllPoints() - itemButton.x = block:GetLeft() - itemButtonSpacing - itemButton.y = block:GetTop() - point, anchor, relative = 'TOPRIGHT', UIParent, 'BOTTOMLEFT' - end - - itemButton:SetPoint(point, anchor, relative, itemButton.x, itemButton.y) - itemButton:Show() -end - -T.UpdateItemButtonCooldown = function(button) - -end - -function T:FinishWrapper () - if wrapperHeight > Wrapper.previousHeight then - Wrapper:SetHeight(wrapperHeight) - Scroller:SetHeight(wrapperHeight*3) - Scroll:SetHeight(wrapperHeight) - Wrapper.previousHeight = wrapperHeight - Wrapper.destinationHeight = wrapperHeight - end - Scroller:SetVerticalScroll(B.Conf.ObjectiveScroll or 0) - print('|cFF00FF00### end of wrapper layout', Wrapper:GetSize()) - print(' |cFF00FF00Scroller:', Scroller:GetSize()) - print(' |cFF00FF00Scroll:', Scroll:GetSize()) - for i = 1, Wrapper:GetNumPoints() do - print('|cFF00FF00 ', Wrapper:GetPoint(i)) - end - for i = 1, Scroller:GetNumPoints() do - print('|cFF00FF00 ', Scroller:GetPoint(i)) - end - for i = 1, Scroll:GetNumPoints() do - print('|cFF00FF00 ', Scroll:GetPoint(i)) - end - - if Devian and Devian.InWorkspace() then - Wrapper.AnimState:SetFormattedText(ANIM_STATE, animateReason) - Wrapper.AnimState:Show() - end - - Wrapper:Show() - Scroller:Show() - Scroll:Show() -end - - ------------------------------------------ --- Criteria frames - ---[[ - text = description, - type = type, - finished = completed, - quantity = quantity, - requiredQuantity = requiredQuantity, - characterName = characterName, - flags = flags, - assetID = assetID, - quantityString = quantityString, - criteriaID = criteriaID, -]] -T.WidgetRegistry = {} -local wr = T.WidgetRegistry - ---- WidgetTemplate 'OnShow' -local wrapperWidth, textIndent -T.InitializeWidget = setmetatable({}, { - __call = function(t, frame, isNew, ...) - -- todo: config pull - if not wrapperWidth then - wrapperWidth = T.Conf.Wrapper.Width - textIndent = T.Conf.Wrapper.TextIndent - end - - tprint('Initialize', frame:GetName(), isNew, ...) - frame:SetWidth(wrapperWidth - textIndent * 2) - frame:SetScript('OnEvent', T.UpdateWidget[frame.widgetType]) - frame:RegisterEvent('QUEST_LOG_UPDATE') - frame:RegisterEvent('TRACKED_ACHIEVEMENT_UPDATE') - frame:RegisterEvent('TRACKED_ACHIEVEMENT_LIST_CHANGED') - frame:RegisterEvent('CRITERIA_UPDATE') - frame:RegisterEvent('CRITERIA_COMPLETE') - frame:RegisterEvent('CRITERIA_EARNED') - t[frame.widgetType](frame, isNew) - T.UpdateWidget[frame.widgetType](frame, isNew) - end, -}) - ---- WidgetTemplate 'OnEvent' -T.UpdateWidget = setmetatable({}, { - __call = function(t, frame, isNew, ...) - tprint('Update', frame:GetName(), isNew, ...) - if not frame.widgetType then - return - end - - return t[frame.widgetType](frame, isNew) - end -}) - - -local progressHeight = 17 -local progressBorder = 1 -local progressFont = _G.VeneerCriteriaFontNormal - -local lprint = B.print('Line') -T.InitializeWidget.StatusBar = function(self, isNew) - local print = lprint - local c = T.Conf.Wrapper - - tprint(self:GetName(), isNew) - if isNew then - self:SetMinMaxValues(0, self.maxValue) - - self:SetHeight(widgetHeight) - self:SetWidth(widgetWidth) - self.height = widgetHeight - - self.status:SetFont(widgetTextFont, widgetTextSize, widgetTextOutline) - self.status:SetTextColor(unpack(widgetTextColor)) - end - self:SetValue(self.value) - - self.status:SetText(self.objective.quantityString) -end - -T.UpdateWidget.StatusBar = function (self) - local value, maxValue = self.value, self.maxValue - print('update vals:') - for k,v in pairs(self) do - print(k, v) - end - self.width = self.width or self:GetWidth() - self:SetValue(self.value) - local format = self.format or '%d/%d' - self.status:SetFormattedText(format, value, maxValue) - local progress = (value / maxValue) - if progress > 0 then - print('color:', 1-progress*2 , progress*2 - 1,0,1) - print('width:', (self.width -progressBorder * 2) * progress) - self:SetStatusBarColor(1-progress*2 , progress*2,0,1) - end -end - - -T.InitializeWidget.Hidden = function (self) - self.height = 0 -end -T.UpdateWidget.Hidden = function (self) - self.height= 0 -end - - ---- Queue any active item buttons for update for that frame -local iprint = B.print('ItemButton') -local Quest = T.Quest -local IsQuestWatched, InCombatLockdown = IsQuestWatched, InCombatLockdown -T.UpdateActionButtons = function(updateReason) - local print = iprint - Scroller.snap_upper = 0 - Scroller.snap_lower = 0 - local print = B.print('ItemButton') - if updateReason then - print = B.print('IB_'..updateReason) - end - - local previousItem - for questID, itemButton in pairs(Quest.itemButtons) do - local info= T.Quest.Info[questID] - - print('|cFF00FFFF'.. questID .. '|r', itemButton:GetName()) - local block = T.Quest.QuestBlock[questID] - if block then - -- Dispatch the probe - if IsQuestWatched(info.logIndex) then - itemButton.previousItem = previousItem - print(' |cFFFFFF00probing', block:GetName()) - block:SetScript('OnUpdate', function() - if block:GetBottom() and not InCombatLockdown() then - print(' '..block:GetName()..' |cFF00FF00probe hit!') - T.UpdateItemButtonAnchor(block, itemButton, itemButton.previousItem) -- needs to be previousItem from this scope - block:SetScript('OnUpdate', nil) - - end - end) - previousItem = itemButton - else - print('hidden block or unwatched quest') - itemButton.previousItem = nil - itemButton:Hide() - end - elseif itemButton:IsVisible() then - print(' |cFFFF0088hiding unwatched quest button', itemButton:GetName()) - itemButton.previousItem = nil - itemButton:Hide() - else - print(' |cFFBBBBBBignoring hidden log quest button', itemButton:GetName()) - end - end -end - -Default.FadeOutBlock = function (handler, blockIndex) - -end \ No newline at end of file
--- a/ObjectiveTracker/ObjectiveStyle.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,506 +0,0 @@ -local B = select(2,...).frame -local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local print = B.print('SetStyle') -------------------------------------------------------------- ---- Deals with swapping between different color palettes ---- - -local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]] -local titleSize, textSize = 16, 15 -local titleOutline, textOutline = "OUTLINE", "OUTLINE" -local titleSpacing, textSpacing = 3, 3 -local unpack, type, pairs, tconcat = unpack, type, pairs, table.concat -local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE' -local headerFont, headerSize = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 24 -local headerOutline, headerSpacing = 'OUTLINE', 2 - - -mod.defaults.Style = { - Format = { - Frame = { - Width = 270, - }, - title = { - Indent = 0, - Spacing = 0, - }, - status = { - Indent = 5, - Spacing = 0, - } - }, - FontBank = { - ['Normal'] = _G.VeneerCriteriaFontNormal, - ['Progress'] = _G.VeneerCriteriaFontProgress, - ['Complete'] = _G.VeneerCriteriaFontComplete, - ['Failed'] = _G.VeneerCriteriaFontFailed, - }, - Normal = { - title = { - TextColor = {1, 1, 1, 1}, - Width = 270, - Spacing = 0, - Indent = 2, - }, - titlebg = { - }, - status = { - Width = 270, - Spacing = 0, - }, - statusbg = { - }, - Frame = { - } - }, - Tracker = { - Normal = { - title = { - Font = {headerFont, headerSize, headerOutline}, Spacing = headerSpacing, - Indent = 2, - TextColor = {1, .9, .2, 1}, - }, - titlebg = { - Gradient = {'VERTICAL', MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}}, - } - } - }, - TrackerBlock = { - Normal = { - titlebg = { - Indent = 2, - Gradient = { 'HORIZONTAL', MinColor = {0.7, 0, 0.9, 1}, MaxColor = {.7, 0, 0.9, .1}}, - }, - title = { - TextColor = {1,1,1,1}, - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, - }, - status = { - TextColor = {1,1,1,1}, - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - statusbg = { - Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, .1}}, - } - }, - Daily = { - titlebg = { - Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 1}, MaxColor = {0, 0.4, 1, .1}, }, - }, - statusbg = { - Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 1}, MaxColor = {0, 0.35, .90, .1}, }, - }, - title = { - TextColor = {0.7,1,1,1}, - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, - }, - status = { - TextColor = {1,1,1,1}, - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - }, - Super = { - title = { - TextColor = {1,1,1,1}, - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, BackgroundFullWidth = true - }, - titlebg = { - Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 1}, MaxColor = {0, .7, .6, 1}}, - }, - status = { - TextColor = {1,1,1,1}, - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - statusbg = { - Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 1}, MaxColor = {0, .7, .6, 1} }, - }, - }, - MouseDown = { - title = { - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, - }, - titlebg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, 1}, }, - }, - status = { - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - statusbg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, 1}, }, - } - }, - Complete = { - title = { - TextColor = {1,1,1,1}, - Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing, - }, - titlebg = { - Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 1}, MaxColor = {0, 1, 0, 1}, }, - }, - status = { - TextColor = {1,1,1,1}, - Font = {textFont, textSize, textOutline}, Spacing = textSpacing, - }, - statusbg = { - Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 1}, MaxColor = {0, 1, 0, 1}, }, - } - }, - AutoQuest = { - Normal = { - titlebg = { - Indent = 2, - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, - }, - title = { - TextColor = {1,1,1,1}, - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, - }, - status = { - TextColor = {0,1,0,1}, - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - statusbg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, - } - }, - }, - Cheevs = { - Normal = { - - title = { - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, - }, - titlebg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, - - }, - status = { - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - statusbg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, - }, - }, - Complete = { - title = { - Font = {titleFont, titleSize, titleOutline}, - Spacing = titleSpacing, - }, - titlebg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, - }, - status = { - Font = {textFont, textSize, textOutline}, - Spacing = textSpacing, - }, - statusbg = { - Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, - }, - }, - } - } -} - -local style_cache_func = {} -local block_vars = { - ['titleSize'] = {'titleWidth', 'titleHeight'}, - ['FrameSize'] = {'width', 'height'} -} -local attrib_vars = { - ['Font'] = {'height'}, -} - -mod.BlockStyleCache = {} -local style_cache = mod.BlockStyleCache -mod.regions = {} -mod.regionStyles = {} -mod.SetBlockStyle = function(frame, frameType, ...) - -- var names intended to reflect argument order - print('|cFFFFFF00'..frame:GetName()..'|r', frameType, ...) - --@debug@ - local c = mod.defaults.Normal - local style_list = {... } - local styleName = frameType .. '-' .. table.concat(style_list,'') - local previousClass = {mod.Conf.Style[frameType] } - local previousClassString = {'frame' } - local parentName - - if not style_cache[styleName] then - local style = {} - - --[[ - if mod.defaults.Style[frameType] then - print(' setting style class |cFF00FFFF'..frameType) - else - print(' resorting to class Normal (missing |cFFFF8800'.. frameType..'|r)') - end - --]] - local normal = mod.defaults.Style.Normal - local root = mod.defaults.Style[frameType] or normal - for i, className in ipairs(style_list) do - print('|cFF00FF00'..i..'|r', className) - local class = normal - local childClass - if previousClass then - for i = #previousClass, 1, -1 do - print('checking if '..className..' child of '.. previousClassString[i]) - if previousClass[i][className] then - print(' it is!') - childClass = previousClass[i][className] - parentName = previousClassString[i] - break - end - end - end - if childClass then - class = childClass - print(' ChildClass '..parentName..'.|cFFFF0088'.. className .. '|r') - elseif root[className] then - class = root[className] - print(' SubClass |cFF0088FF'.. className .. '|r') - elseif normal[className] then - class = normal[className] - print(' SubClass Normal.|cFFFF0088'..className..'|r') - else - --print(' SubClass not found '..className..'') - end - tinsert(previousClass, class) - tinsert(previousClassString, className) - - for elementName, element in pairs(class) do - if not elementName:match('^%u') then - --print(' scanning Element |cFF8800FF'.. elementName ..'|r') - if not style[elementName] then - style[elementName] = {} - end - for key, value in pairs(element) do - if mod.SetBlockAttribute[key] then - --print(' |cFF00FF00'..elementName..'|r.|cFF00FFFF'..key..' =', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value))) - style[elementName][key] = value - end - - end - end - - end - end - - for k, elements in pairs(mod.defaults.Style.Normal) do - if not style[k] and type(elements) ~= 'table' then - style[k] = elements - end - end - - - --[[print('result for: ', frame:GetName()) - for k,v in pairs(style) do - if type(v) == 'table' and not k:match('^%u') then - for kk, vv in pairs(v) do - --print(' |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', (type(vv) == 'table' and ('{'..table.concat(vv,', ')..'}') or tostring(vv))) - end - else - --print(' |cFFFFFFFF' .. k ..'|r =', tostring(v)) - end - end - --]] - print('saving |cFFFFFF00'..styleName) - style_cache[styleName] = style - else - - print('using |cFFFF00FF'..styleName) - end - - local style = style_cache[styleName] - - if not style_cache_func[styleName] then - local code = - "return function (frame)\n".. - " local func = Veneer.ObjectiveTracker.SetBlockAttribute\n".. - " local cache = Veneer.ObjectiveTracker.BlockStyleCache" - --.. " print('CacheFunc', '|cFFFFFF00SET|r "..styleName.." |cFFFFFF00ON|r', frame:GetName()) " - - for elementName, styleset in pairs(style) do - code = code .. - "\n if frame['"..elementName.."'] then" - - for attributeName, value in pairs(styleset) do - if mod.SetBlockAttribute[attributeName] then - --print(' add function '..elementName..':'.. attributeName ..'(', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)), ')') - - - --mod.SetBlockAttribute[attributeName](region, value) - code = code - --.. "\n print('CacheFunc', ' applying', '|cFF00FFFF" .. attributeName .. "|r to', '|cFF0088FF"..elementName.."|r', cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])" - .. "\n\n func['" .. attributeName .. "'](frame['"..elementName.."'],".. - " cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])" - - --- Set any frame.blah variables used in Updates - if block_vars[elementName .. attributeName] then - --print('|cFF008800BVar|r', elementName..attributeName) - for i, blockKey in ipairs(block_vars[elementName .. attributeName]) do - --print(' assigning |cFF008800'..blockKey..'|r') - frame[blockKey] = (type(value) == 'table') and value[i] or value - end - end - - end - end - code = code .. - "\n else".. - --"\n print('CacheFunc', ' |cFFFF4400missing', frame:GetName()..'."..elementName.."')".. - "\n end" - end - code = code .. "\nend" - local result = assert(loadstring(code)) - --print('storing style func', styleName, result()) - style_cache_func[styleName] = result() - - end - style_cache_func[styleName](frame) - - --- Hardcoding the sizing vars for sanity - local defaultWidth = mod.Conf.Wrapper.Width - local normalSettings = mod.defaults.Style.Format - frame.width = defaultWidth - frame.statusWidth = defaultWidth - normalSettings.status.Indent - frame.titleWidth = defaultWidth - normalSettings.title.Indent - frame.attachmentHeight = frame.attachmentHeight or 0 - - if frame.title then - frame.titleHeight = frame.title and frame.title:GetStringHeight() or 0 - if frame.titleHeight > 0 then - print('add spacing to', frame.titleHeight) - frame.titleHeight = frame.titleHeight + (frame.title.spacing or 0)*2 - end - - frame.title.spacing = frame.title.spacing or frame.title:GetSpacing() - frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent) - frame.title:SetPoint('TOP', frame, 'TOP', 0, -frame.title.spacing) - frame.title:SetWidth(frame.width) - if frame.titlebg then - frame.titlebg:SetHeight(frame.titleHeight) - frame.titlebg:SetWidth(frame.width) - end - print(' titleHeight', frame.titleHeight, 'indent', normalSettings.title.Indent, 'spacing', frame.title.spacing) - print(' -- text:', frame.title:GetSize()) - print(' -- bg:', frame.titlebg:GetSize()) - - else - frame.titleHeight = 0 - end - - - if frame.status and (frame.status:GetText() or frame.attachmentHeight > 0) then - frame.statusHeight = frame.status and frame.status:GetStringHeight() or 0 - if frame.statusHeight > 0 then - frame.statusHeight = frame.statusHeight + (frame.status.spacing or 0)*2 - end - - frame.status.spacing = frame.status.spacing or frame.status:GetSpacing() - - frame.status:SetWidth(frame.width) - frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0) - frame.status:SetPoint('TOP', frame.titlebg, 'BOTTOM', 0, 0) - --frame.status:SetHeight(frame.statusHeight) - if frame.statusbg then - - --frame.statusbg:SetHeight(frame.statusHeight + (frame.attachmentHeight or 0)) - --frame.statusbg:SetPoint('BOTTOM', frame, 'BOTTOM', 0, 0) - frame.statusbg:SetWidth(frame.width) - end - print(' status tHeight', frame.statusHeight, 'indent', normalSettings.status.Indent, 'spacing', frame.status.spacing) - else - if frame.status then - frame.status:Hide() - end - if frame.statusbg then - frame.statusbg:Hide() - end - frame.statusHeight = 0 - end - - frame.height = frame.titleHeight + frame.statusHeight + (frame.attachmentHeight or 0) - frame:SetSize(frame.width, frame.height) - print(' |cFF0088FFsizing frame', frame.width, frame.height) -end - ---- Argument containers -local o -- text flag -local a1, a2, a3, a4, b1, b2, b3, b4 -- color1, color2 -local f1, f2, f3 -- font -local w1, w2 -- size -local p1, p2, p3, x, y -- path/point args -mod.SetBlockAttribute = {} -local sb = mod.SetBlockAttribute -local print = B.print('Attribute') -sb.Gradient = function(region, value) - print('|cFF8844FFGradient|r', region:GetName(), unpack(value)) - o = value[1] - a1, a2, a3, a4 = unpack(value.MinColor) - b1, b2, b3, b4 = unpack(value.MaxColor) - region:SetVertexColor(1,1,1) - region::SetColorTexture(1,1,1,1) - region:SetGradientAlpha(o, a1, a2, a3, a4, b1, b2, b3, b4) -end - -sb.Background = function(region, value) - print('|cFF0088FFBackground|r', unpack(value)) - region:SetVertexColor(1,1,1) -- reset - region::SetColorTexture(unpack(value)) -end -sb.BackgroundComplex = function (region, value) - local left, tile, right = value.Left, value.Tile, value.Right - -end -sb.Font = function(region, value) - f1, f2, f3 = unpack(value) - print('|cFFFFFF00Font|r', f1, f2, f3) - region:SetFont(f1, f2, f3) -end - -sb.Spacing = function(region, value) - print('FontSpacing', region:GetName(), value) - region:SetSpacing(value) - region.spacing = value -end - -sb.TextColor = function(region, value) - a1, a2, a3, a4 = unpack(value) - print('TextColor', a1, a2, a3, a4) - region:SetTextColor(a1, a2, a3, a4) -end -sb.Texture = function(region, value) - - p1, a1, a2, a3, a4 = unpack(value) - print('Texture', p1, a1, a2, a3, a4) - region:SetTexture(p1) - if a1 then - region:SetTexCoord(a1, a2, a3, a4) - end -end -sb.Width = function(region, value) - w1 = value - region:SetWidth(w1) -end - -sb.Height = function(region, value) - w2 = value - region:SetHeight(w2) -end -sb.Size = function(region, value) - w1, w2 = unpack(value) - region:SetSize(w1, w2) -end -
--- a/ObjectiveTracker/ObjectiveTracker.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,569 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 3/26/2016 1:51 AM -local B, _G = select(2,...).frame, _G -local pairs, setmetatable, type, tostring, band, format = _G.pairs, _G.setmetatable, _G.type, _G.tostring, bit.band, string.format -local ipairs, tinsert, hooksecurefunc = _G.ipairs, _G.tinsert, _G.hooksecurefunc -local PlaySoundFile, IsQuestTask, SortQuestWatches, GetCurrentMapAreaID, GetZoneText, GetMinimapZoneText = PlaySoundFile, IsQuestTask, SortQuestWatches, GetCurrentMapAreaID, GetZoneText, GetMinimapZoneText -local QuestPOIUpdateIcons, GetCVar, IsPlayerInMicroDungeon, WorldMapFrame, GetCVarBool, SetMapToCurrentZone = QuestPOIUpdateIcons, GetCVar, IsPlayerInMicroDungeon, WorldMapFrame, GetCVarBool, SetMapToCurrentZone -local AddAutoQuestPopUp = AddAutoQuestPopUp -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 -local Scroller = VeneerObjectiveWrapper.scrollArea -local Scroll = _G.VeneerObjectiveScroll -local unitLevel = UnitLevel('player') - ---- Performance values - ---- Done once per ui load -local BlizzHooks = { - 'AcceptQuest', - 'AddQuestWatch', - 'CompleteQuest', - 'RemoveQuestWatch', - 'AbandonQuest', - 'AcknowledgeAutoAcceptQuest', - 'AddAutoQuestPopUp', - 'RemoveAutoQuestPopUp', - 'AddTrackedAchievement', - 'RemoveTrackedAchievement', - 'SetSuperTrackedQuestID', - 'SelectQuestLogEntry', -} -local enabledOnly = { - ['AddQuestWatch'] = true, -} - ---- These are the bitfields used by Blizzard_ObjectiveTracker to determine which segments get parsed. ---- They are replicated here so that plugins can make use of any securehook args involving this info. -local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST -- 0x0100 -local OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP = OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP -- 0x0200 -local OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE = OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE -- 0x0400 -local OBJECTIVE_TRACKER_UPDATE_MODULE_SCENARIO = OBJECTIVE_TRACKER_UPDATE_MODULE_SCENARIO -- 0x0800 -local OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT = OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT -- 0x1000 - - -local OBJECTIVE_TRACKER_UPDATE_STATIC = OBJECTIVE_TRACKER_UPDATE_STATIC -- 0x0000 -local OBJECTIVE_TRACKER_UPDATE_ALL = OBJECTIVE_TRACKER_UPDATE_ALL -- 0xFFFF -local OBJECTIVE_TRACKER_UPDATE_ID = OBJECTIVE_TRACKER_UPDATE_ID -- 0 - -local OBJECTIVE_TRACKER_UPDATE_QUEST = OBJECTIVE_TRACKER_UPDATE_QUEST -- 0x0001 -local OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED = OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED -- 0x0002 -local OBJECTIVE_TRACKER_UPDATE_TASK_ADDED = OBJECTIVE_TRACKER_UPDATE_TASK_ADDED -- 0x0004 -local OBJECTIVE_TRACKER_UPDATE_SCENARIO = OBJECTIVE_TRACKER_UPDATE_SCENARIO -- 0x0008 -local OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE = OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE -- 0x0010 -local OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT = OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT -- 0x0020 -local OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED = OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED -- 0x0040 -local OBJECTIVE_TRACKER_UPDATE_SCENARIO_BONUS_DELAYED = OBJECTIVE_TRACKER_UPDATE_SCENARIO_BONUS_DELAYED -- 0x0080 - -local OBJECTIVE_TRACKER_UPDATE_REASON = OBJECTIVE_TRACKER_UPDATE_ALL -- default ---- Used to determine which trackers are listening for money events - -T.strings = {} -T.strings.CLICK_TO_ACCCEPT = 'Click to Accept' -T.strings.CLICK_TO_COMPLETE = 'Click to complete' -T.colors ={ - enable = true, -} - -T.watchMoneyReasons = 0 - ---- Baseline defaults table; values defined in the files that they pertain to -T.defaults = {} - - ---- Tracker display order -T.orderedNames = {'Bonus', 'AutoQuest', 'Quest', 'Cheevs'} - ---- ipairs() argument tables -T.orderedHandlers = setmetatable({}, {__mode = "k"}) -T.orderedTrackers = setmetatable({}, {__mode = "k"}) -T.indexedTrackers = setmetatable({}, {__mode = "k"}) - ---- pairs() argument tables -T.namedTrackers = setmetatable({}, {__mode = "k"}) - -local WRAPPER_ANCHOR_POINT = 'TOPRIGHT' -local WRAPPER_OFFSET_X = 0 -local WRAPPER_OFFSET_Y = -200 -local WRAPPER_MAX_HEIGHT = 670 -local WRAPPER_WIDTH = 280 -local WRAPPER_HEADER_HEIGHT = 24 - -T.defaults.Wrapper = { - AnchorPoint = WRAPPER_ANCHOR_POINT, - OffsetX = WRAPPER_OFFSET_X, - OffsetY = WRAPPER_OFFSET_Y, - Height = WRAPPER_MAX_HEIGHT, - Width = WRAPPER_WIDTH, - HeaderHeight = WRAPPER_HEADER_HEIGHT, - TextSpacing = 3, - TextIndent = 4, - TitleSpacing = 3, - TitleIndent = 4, -} - - - ---- Tracker module definitions begin here; innards dealing with data retreival and output are defined further in -T.DefaultHandler = { - previousHeight = 0, - - name = "temp", - displayName = "temp", - updateReasonModule = 0xFF00, - updateReasonEvent = 0x00FF, - - numWatched = 0, --- number of entries being handled - numBlocks = 0, --- number of blocks created - actualBlocks = 0, --- number of blocks in use - Info = {}, --- stored watch list information, keyed by whatever unique ID is involved for that tracker - Watched = {}, --- stores whether the given unique ID is tracked - - freeBlocks = {}, --- blocks hidden due to list shrinkage - usedBlocks = {}, --- block in use - BlockInfo = {}, --- by block creation offset, used by framescript - WatchList = {}, --- ordered manifest of watched items - - --- Indexes - InfoBlock = {}, --- by unique ID - LogBlock = {}, --- by API log offset, used by GetBlock if possible - WatchBlock = {}, --- block by internal offset, used in GetBlock scope - WatchInfo = {}, --- info by internal offset, used in Update scope -} - -T.AutoQuest = { - name = "AutoQuest", - displayName = "Notice", - updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST, - updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_QUEST + OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, - internalColor = '00FFFF', - LogInfo = {}, - QuestBlock = {}, -} -T.Quest = { - name = "Quest", - displayName = "Quests", - updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST, - updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_QUEST + OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, - internalColor = '0088FF', - itemButtons = {}, - freeButtons = {}, - LogInfo = {}, - QuestBlock = {}, -} -T.Cheevs = { - name = "Cheevs", - displayName = "Achievements", - schema = 'achievement', - updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT, - updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT + - OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED, - internalColor = '00FF88', -} -T.Bonus = { - name = "Bonus", - displayName = "Bonus Objectives", - updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE, - updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_QUEST + OBJECTIVE_TRACKER_UPDATE_TASK_ADDED, - internalColor = '00FF00', - QuestBlock = {}, -} - -T.Scenario = { - name = 'Scenario', - displayName = 'Scenario Objectives', - updateReasonModule = OBJECTIVE_TRACKER_UPDATE_MODULE_SCENARIO, - updateReasonEvents = OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE + OBJECTIVE_TRACKER_UPDATE_SCENARIO_BONUS_DELAYED, - internalColor = '88FF00', -} -local lastLabel -local Tracker_debug = function(handler, channel) - local func = B.print(channel) - local color = handler.internalColor - return function(label, ...) - if lastLabel == label then - label = label:gsub('%a', ' ').. ' ' - else - lastLabel = label - label = '|cFF'..color..label..':|r' - end - func(label, ...) - end -end -local Tracker_string = function (self) - return self.name -end -local Tracker_call = function (self, reason) - self:Update(reason) -end -local Handler_Initialize = function (self, name, index) - local c = T.Conf.Wrapper - print('Initializing |cFF00FFFF'..name..'|r module...') - - local handler = setmetatable(T[name] or {}, { - __tostring = Tracker_string, - __call = Tracker_call - }) - if type(T.orderedHandlers[index]) == 'table' then - return T.orderedHandlers[index] - end - - print('|cFFFFFF00Acquiring locals') - local preset = {} - for k, _ in pairs(handler) do - preset[k] = true - end - - - print('|cFFFF8800Inheriting') - for k, v in pairs(self) do - if not handler[k] then - if type(v) == 'table' then - -- assume all tables to be local data; don't inherit or ref - handler[k] = {} - else - handler[k] = self[k] - end - print('copying', k) - end - end - print('|cFFFF4400'..tostring(name)..'|r:') - for k, v in pairs(handler) do - print(format("%32s %8s %s", (preset[k] and '|cFFFFFFFF' or '|cFFFFFF00') .. k .. '|r', type(v), tostring(v))) - end - - T[name] = handler - - local trackerName = 'Veneer'..name..'Tracker' - local handler = T[name] - local frame = CreateFrame('Frame', trackerName, _G.VeneerObjectiveScroll, 'VeneerTrackerTemplate') - frame.title:SetText(handler.displayName) - frame:SetWidth(c.Width) - frame.previousOffset = 0 - frame:SetScript('OnHide', T.DefaultHandler.OnHide) - frame.handler = handler - - handler.frame = frame - handler.numBlocks = 0 - handler.actualBlocks = 0 - handler.trackerName = trackerName - handler.lines = {} - T.orderedTrackers[index] = frame - T.namedTrackers[name] = frame - T.indexedTrackers[handler] = frame - print('|cFFFF0088' .. trackerName .. '|r created for |cFF00FFFF' .. handler.displayName .. '|r module') - - handler.print = Tracker_debug(handler, 'Tracker') - handler.lprint = Tracker_debug(handler, 'Line') - handler.bprint = Tracker_debug(handler, 'Block') - - T.orderedHandlers[index] = handler - return true -end - -local Event = {} - -Event.QUEST_LOG_UPDATE = function() - return OBJECTIVE_TRACKER_UPDATE_QUEST -end -local GetNumQuestWatches, AddQuestWatch, SetSuperTrackedQuestID = GetNumQuestWatches, AddQuestWatch, SetSuperTrackedQuestID -Event.QUEST_ACCEPTED = function(questLogIndex, questID, added) - - --todo: stall non-confirmed autoquests - AddQuestWatch(questLogIndex) - if ( IsQuestTask(questID) ) then - return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED + OBJECTIVE_TRACKER_UPDATE_TASK_ADDED, questID, added - else - return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID, added - end -end - -Event.QUEST_WATCH_LIST_CHANGED = function(questID, added) - if ( added == true ) then - if ( not IsQuestTask(questID) ) then - return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID, added - end - elseif questID then - return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID, added - else - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST - end -end - -Event.QUEST_POI_UPDATE = function() - QuestPOIUpdateIcons(); - if ( GetCVar("trackQuestSorting") == "proximity" ) then - SortQuestWatches(); - end - return OBJECTIVE_TRACKER_UPDATE_ALL -end -Event.SUPER_TRACKED_QUEST_CHANGED = function(questID) - --return OBJECTIVE_TRACKER_UPDATE_QUEST, questID -end -Event.ZONE_CHANGED = function() - local inMicroDungeon = IsPlayerInMicroDungeon(); - 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(); - T.inMicroDungeon = inMicroDungeon; - end - return OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE + OBJECTIVE_TRACKER_UPDATE_MODULE_SCENARIO -end -Event.QUEST_AUTOCOMPLETE = function(questId) - AddAutoQuestPopUp(questId, "COMPLETE"); - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST + OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP -end -Event.SCENARIO_CRITERIA_UPDATE = function() - return OBJECTIVE_TRACKER_UPDATE_SCENARIO -end -Event.SCENARIO_UPDATE = function(newStage) - if ( newStage ) then - return OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE - else - return OBJECTIVE_TRACKER_UPDATE_SCENARIO - end -end -Event.TRACKED_ACHIEVEMENT_UPDATE = function() - return OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT -end -Event.TRACKED_ACHIEVEMENT_LIST_CHANGED = function(achievementID, added) - return OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED, achievementID, added -end -Event.ZONE_CHANGED_NEW_AREA = function () - if ( not WorldMapFrame:IsShown() and GetCVarBool("questPOI") ) then - SetMapToCurrentZone(); -- update the zone to get the right POI numbers for the tracker - end - SortQuestWatches(); - T.currentZoneArea = GetCurrentMapAreaID() - print('Updating zone ID to', T.currentZoneArea, '=', GetZoneText(), GetMinimapZoneText()) - - - return OBJECTIVE_TRACKER_UPDATE_TASK_ADDED -end - - -Event.PLAYER_MONEY = function() - if T.watchMoneyReasons > 0 then - return T.watchMoneyReasons - end -end -Event.CRITERIA_COMPLETE = function() - return OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE -end -Event.QUEST_TURN_IN = function(questID, xp, money) - if ( IsQuestTask(questID) ) then - 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 -T.Event = Event - -local VeneerData - -T.SetWatchMoney = function(watchMoney, reason) - if watchMoney then - if band(T.watchMoneyReasons, reason) == 0 then - T.watchMoneyReasons = T.watchMoneyReasons + reason; - end - else - if band(T.watchMoneyReasons, reason) > 0 then - T.watchMoneyReasons = T.watchMoneyReasons - reason; - end - end -end - -local iprint = B.print('Info') -T.SetRewards = function(t, questID) - local previousSelection = GetQuestLogSelection() - - SelectQuestLogEntry(GetQuestLogIndexByID(questID)) - local numQuestChoices = GetNumQuestLogChoices(); - local skillName, skillIcon, skillPoints = GetQuestLogRewardSkillPoints(); - local xp = GetQuestLogRewardXP(); - local playerTitle = GetQuestLogRewardTitle(); - ProcessQuestLogRewardFactions(); - - local rewards = {} - local texture, name, isTradeskillSpell, isSpellLearned, hideSpellLearnText, isBoostSpell, garrFollowerID = GetQuestLogRewardSpell(questID) - if name then - tinsert(rewards,{ - type = 'spell', - name = name, - texture = texture, - }) - end - if previousSelection then - SelectQuestLogEntry(previousSelection) - end - - t.numCurrencies = GetNumQuestLogRewardCurrencies(questID) - for i = 1, t.numCurrencies do - local name, texture, count = GetQuestLogRewardCurrencyInfo(i, questID) - tinsert(rewards,{ - type = 'currency', - index = i, - name = name, - texture = texture, - count = count - }); - end - -- items - t.numItems = GetNumQuestLogRewards(questID) - for i = 1, t.numItems do - local name, texture, count, quality, isUsable = GetQuestLogRewardInfo(i, questID) - tinsert(rewards, { - type = 'item', - index = i , - name = name, - texture = texture, - count = count, - quality = quality, - isUsable = isUsable - }); - end - -- money - - local money = GetQuestLogRewardMoney(questID) - if ( money > 0 ) then - tinsert(rewards, { - type = 'money', - name = GetMoneyString(money), - texture = "Interface\\Icons\\inv_misc_coin_01", - count = 0, - }); - end - - if #rewards >= 1 then - t.rewardInfo = rewards - end -end - -local Play = function(file) if Devian and Devian.InWorkspace() then PlaySoundFile(file) end end - -local tprint = B.print('Tracker') -local ignoredNames = { - ['SelectQuestLogEntry'] = true -} -T.OnHookedFunc = function(name, ...) - --tprint('|cFFFF8800securehook:|r', name, '|cFF00FFFFargs:|r', ...) - local updateReason, arg1, arg2, arg3 = T[name](...) - if updateReason then - tprint('OnHookedFunc(|cFF00FFFF'..name..'|r):', ...) - T:Update(updateReason, arg1, arg2, arg3) - elseif not ignoredNames[name] then - tprint('OnHookedFunc(|cFFFF4400'..name..'|r):', ...) - end -end - -function T:OnEvent (event, ...) - local isHandled - local reason, arg1, arg2, arg3 - if Event[event] then - if type(Event[event]) == 'function' then - Play([[Interface\Addons\SharedMedia_MyMedia\sound\Info.ogg]]) - reason, arg1, arg2, arg3 = Event[event](...) - else - Play([[Interface\Addons\SharedMedia_MyMedia\sound\Heart.ogg]]) - reason = Event[event] - end - else - print('no event handler set for', event) - tprint('no event handler set for', event) - Play([[Interface\Addons\SharedMedia_MyMedia\sound\IM.ogg]]) - end - if reason then - local args = (reason or '0') - if arg1 then args = args .. ', ' .. tostring(arg1) end - if arg2 then args = args .. ', ' .. tostring(arg2) end - if arg3 then args = args .. ', ' .. tostring(arg3) end - print('OnEvent(|cFF00FF00'.. event ..'|r):', ..., '|cFFFFFF00=> Update (|r', args,'|cFFFFFF00)|r') - tprint('OnEvent(|cFF00FF00'.. event ..'|r):', ..., '|cFFFFFF00=> Update (|r', args,'|cFFFFFF00)|r') - T:Update(reason, arg1, arg2, arg3) - else - tprint('OnEvent(|cFFFF4400'.. event ..'|r):', ...) - print('no detected reason') - --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 _, func in ipairs(BlizzHooks) do - if T[func] then - hooksecurefunc(func, function(...) return T.OnHookedFunc(func, ...) end) - else - hooksecurefunc(func, function(...) - print('|cFFFF0088securehook('..tostring(func)..')|r args:', ...) - tinsert(VeneerData.CallLog, {func, ...}) - end) - end - end - end - - - - ObjectiveTrackerFrame:UnregisterAllEvents() - ObjectiveTrackerFrame:Hide() - _G.MinimapCluster: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 T:OnEnable() - - print(B.Conf.VeneerObjectiveWrapper.enabled) - - - for event, action in pairs(Event) do - print('|cFFFF0088listen to', event, 'for action|r', tostring(action)) - Wrapper:RegisterEvent(event) - end - - local c = T.Conf.Wrapper - Wrapper.previousHeight = 0 - 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, to, x,y) - - - T.UpdateSchema('tracker', 'default') - -- run once to prime the data structure - T.UpdateActionButtons() -end - -function T:OnDisable() - self:UnregisterAllEvents() - Scroller:Hide() -end -
--- a/ObjectiveTracker/ObjectiveTracker.xml Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,656 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - - - - - <FontString name="VeneerRewardText" virtual="true" inherits="VeneerNumberFontSmall" parentArray="rewardLabel" /> - <Texture file="Interface\ICONS\INV_Misc_QuestionMark" name="VeneerRewardTile" parentArray="rewardTile" alpha="0.5" hidden="true" virtual="true"> - <Color r="1" g="1" b="1" a="1" /> - <Anchors> - <Anchor point="BOTTOM" x="0" y="5" /> - </Anchors> - <TexCoords top="0.15" bottom="0.85" left="0.15" right="0.85" /> - </Texture> - - <Frame name="VeneerRewardsPopOut" parent="UIParent" frameStrata="LOW"> - <Size x="200" y="350" /> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" x="-4" /> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - - </Layer> - <Layer level="ARTWORK"> - <Texture inherits="VeneerRewardTile" /> - <Texture inherits="VeneerRewardTile" /> - <Texture inherits="VeneerRewardTile" /> - </Layer> - <Layer level="OVERLAY"> - <FontString inherits="VeneerRewardText" /> - <FontString inherits="VeneerRewardText" /> - <FontString inherits="VeneerRewardText" /> - </Layer> - </Layers> - <Animations> - <AnimationGroup parentKey="rewardFadeIn"> - <Translation offsetX="-200" offsetY="0" smoothing="OUT" duration="0.15" order="1" /> - <Alpha change="1" duration=".15" order="1" /> - </AnimationGroup> - </Animations> - </Frame> - - <Frame name="VeneerObjectiveWrapper" parent="UIParent" movable="true" enableMouse="true" frameStrata="LOW" clampedToScreen="true"> - <Scripts> - <OnLoad> - self.toggle = true - self.drag = true - self.OnDragStop = function() - Veneer.ObjectiveTracker.UpdateActionButtons() - end - Veneer.RegisterModuleFrame(self, 'ObjectiveTracker') - </OnLoad> - </Scripts> - <Anchors> - <Anchor point="TOPRIGHT" x="-60" y="-240" /> - </Anchors> - <Layers> - - <Layer level="ARTWORK"> - <Texture parentKey="BackgroundLeft" parentArray="headerComplex" /> - <Texture parentKey="BackgroundRight" parentArray="headerComplex" /> - <Texture parentKey="BackgroundTile" parentArray="headerComplex" /> - <Texture parentKey="headerComplexBounds" parentArray="config" alphaMode="ADD" hidden="true"> - <Color r="0" g="0" b="1" a="0.5" /> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.BackgroundLeft" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.BackgroundRight" /> - </Anchors> - </Texture> - <Texture parentKey="FrameBounds" parentArray="config" alphaMode="ADD" hidden="true"> - <Color r="1" g="0" b="1" a="0.25" /> - <Anchors> - <Anchor point="TOPLEFT" /> - <Anchor point="BOTTOMRIGHT" /> - </Anchors> - </Texture> - </Layer> - <Layer level="OVERLAY"> - - <FontString name="$parentAnimState" inherits="VeneerStatusFont" parentKey="AnimState" hidden="true"> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="-5" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - </FontString> - <FontString name="$parentInitState" inherits="VeneerStatusFont" parentKey="InitState"> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="-5" relativeKey="$parent.AnimState" /> - </Anchors> - </FontString> - </Layer> - </Layers> - <Frames> - - <ScrollFrame name="$parentScrollFrame" enableMouseWheel="true" parentKey="scrollArea" parentArray="toggled" hidden="true"> - <Anchors> - <Anchor point="TOP" /> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture setAllPoints="true" parentKey="bg"> - <Color r="0.15" g=".3" b=".3" a="0" /> - </Texture> - </Layer> - </Layers> - <Frames> - - - <Frame name="VeneerObjectiveScroll"> - <Anchors> - <Anchor point="TOP" /> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture setAllPoints="true" parentKey="bg"> - <Color r="1" g="1" b="1" a="1" /> - <Gradient orientation="HORIZONTAL"> - <MinColor r="0" g="0.5" b="0.5" a="0" /> - <MaxColor r="0" g="0.5" b="0.5" a="0" /> - </Gradient> - </Texture> - </Layer> - </Layers> - </Frame> - </Frames> - </ScrollFrame> - - <Frame name="$parentStatusHeader" parentKey="header" frameStrata="MEDIUM"> - <Layers> - <Layer level="OVERLAY"> - <FontString name="$parentTitle" parentKey="status" inherits="VeneerStatusFont" text="status test" justifyH="RIGHT"> - <Anchors> - <Anchor point="TOPRIGHT" x="-64" y="0" /> - </Anchors> - </FontString> - </Layer> - </Layers> - </Frame> - - - - - <Button name="$parentCloseButton" parentKey="CloseButton" enableMouse="true" frameStrata="MEDIUM"> - <Size x="16" y="16" /> - <HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-2" y="0" /> - </Anchors> - </Button> - - <Button name="$parentQuestMapButton" parentArray="toggled" parentKey="QuestMapButton" frameStrata="MEDIUM"> - <Size x="42" y="16" /> - <HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeKey="$parent.CloseButton" x="0" y="0" /> - </Anchors> - </Button> - - - - <Frame name="$parentQuestDetailsPane" parentKey="QuestDetails" hidden="true"> - <Anchors> - <Anchor point="TOP" /> - <Anchor point="LEFT" /> - <Anchor point="RIGHT" /> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture parentKey="titlebg" /> - <Texture parentKey="statusbg" /> - </Layer> - <Layer level="OVERLAY"> - <Texture parentKey="title" /> - <Texture parentKey="status" /> - - <Texture inherits="VeneerRewardTile" /> - </Layer> - </Layers> - </Frame> - - </Frames> - </Frame> - - - - <Frame name="$parentXP" parent="VeneerObjectiveWrapper" parentKey="XPBar" hidden="true"> - <Size x="250" y="24" /> - <Anchors> - <Anchor point="TOPLEFT" /> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBackground" parentKey="statusbg" setAllPoints="true"/> - </Layer> - <Layer level="ARTWORK"> - - <Texture name="$parentForeground" parentKey="foreground"> - <Anchors> - <Anchor point="TOPLEFT" /> - <Anchor point="BOTTOMLEFT" /> - </Anchors> - </Texture> - <Texture name="$parentRested" parentKey="rested" > - <Anchors> - <Anchor point="TOPLEFT" /> - <Anchor point="BOTTOMLEFT" /> - </Anchors> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString inherits="VeneerFontNormal" parentKey="title"> - <Anchors> - <Anchor point="CENTER" /> - </Anchors> - </FontString> - </Layer> - </Layers> - </Frame> - - <!-- Header Panel --> - - <!-- Background panels --> - - <Frame name="VeneerTrackerTemplate" parent="UIParent" virtual="true" hidden="true"> - <Scripts> - <OnHide> - self.headerFade:Stop() - </OnHide> - </Scripts> - <Animations> - <AnimationGroup name="$parentSlideIn" parentKey="SlideIn" ignoreFramerateThrottle="true"> - <Translation parentKey="translation" offsetX="0" offsetY="0" smoothing="OUT" order="1" duration=".25" /> - </AnimationGroup> - <AnimationGroup name="$parentHeaderFade" parentKey="headerFade" setToFinalAlpha="true" ignoreFramerateThrottle="true"> - <Alpha childKey="LineGlow" duration="0.15" order="1" fromAlpha="0" toAlpha="1"/> - <Alpha childKey="LineGlow" startDelay="0.25" duration="0.65" order="1" fromAlpha="1" toAlpha="0"/> - <Scale childKey="LineGlow" duration="0.15" order="1" fromScaleX="0.1" fromScaleY="1.5" toScaleX="2" toScaleY="1.5"> - <Origin point="CENTER"> - <Offset x="-50" y="0"/> - </Origin> - </Scale> - <Translation childKey="LineGlow" duration="0.75" order="1" offsetX="65" offsetY="0"/> - <Alpha childKey="SoftGlow" duration="0.25" order="1" fromAlpha="0" toAlpha="1"/> - <Alpha childKey="SoftGlow" startDelay="0.25" duration="0.5" order="1" fromAlpha="1" toAlpha="0"/> - <Scale childKey="SoftGlow" duration="0.25" order="1" fromScaleX="0.5" fromScaleY="0.5" toScaleX="0.8" toScaleY="0.8"/> - <Alpha childKey="StarBurst" duration="0.25" order="1" fromAlpha="0" toAlpha="1"/> - <Alpha childKey="StarBurst" startDelay="0.25" duration="0.5" order="1" fromAlpha="1" toAlpha="0"/> - <Scale childKey="StarBurst" duration="0.25" order="1" fromScaleX="0.5" fromScaleY="0.5" toScaleX="1" toScaleY="1"/> - <Alpha childKey="LineSheen" startDelay="0.15" duration="0.5" order="1" fromAlpha="0" toAlpha="0.75"/> - <Alpha childKey="LineSheen" startDelay="0.75" duration="0.5" order="1" fromAlpha="0.75" toAlpha="0"/> - <Translation childKey="LineSheen" startDelay="0.15" duration="1.5" order="1" offsetX="280" offsetY="0"/> - <Scripts> - <OnPlay> - self:GetParent().fadeOut:Stop() - </OnPlay> - </Scripts> - </AnimationGroup> - <AnimationGroup parentKey="fadeOut" ignoreFramerateThrottle="true"> - <Alpha duration="0.25" fromAlpha="1" toAlpha="0" order="1" /> - <Scripts> - <OnPlay> - self:GetParent().headerFade:Stop() - </OnPlay> - <OnFinished> - self:GetParent():Hide() - </OnFinished> - </Scripts> - </AnimationGroup> - </Animations> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentTitleBackground" parentKey="titlebg"> - <Anchors> - <Anchor point="TOPLEFT" /> - <Anchor point="RIGHT" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - <Gradient orientation="HORIZONTAL"> - <MinColor r="0" g="0" b="0" a="0.1" /> - <MaxColor r="0" g="0" b="0" a="0" /> - </Gradient> - </Texture> - </Layer> - <Layer level="ARTWORK"> - <Texture parentKey="StarBurst" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_StarBurst" useAtlasSize="true"> - <Anchors> - <Anchor point="LEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.titlebg"/> - </Anchors> - </Texture> - <Texture parentKey="LineSheen" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineBurst"> - <Size x="60" y="15"/> - <Anchors> - <Anchor point="LEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.titlebg" x="0" y="0"/> - </Anchors> - </Texture> - <Texture parentKey="LineGlow" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineGlow" useAtlasSize="true"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.titlebg" x="-50" y="18"/> - </Anchors> - </Texture> - <Texture parentKey="SoftGlow" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_Glow" useAtlasSize="true"> - <Anchors> - <Anchor point="CENTER" relativeKey="$parent.titlebg" relativePoint="BOTTOMLEFT" x="20" y="20"/> - </Anchors> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString name="$parentTitle" inherits="VeneerFontHighlight" text="OBJ" parentKey="title" justifyH="LEFT"> - <Anchors> - <Anchor point="TOP" relativeKey="$parent.titlebg" /> - <Anchor point="BOTTOM" relativeKey="$parent.titlebg" /> - <Anchor point="LEFT" relativeKey="$parent.titlebg" /> - <Anchor point="RIGHT" relativeKey="$parent" /> - </Anchors> - </FontString> - <FontString name="$parentStatus" inherits="VeneerStatusFont" parentKey="status" justifyH="RIGHT"> - <Anchors> - <Anchor point="TOP" relativeKey="$parent.titlebg" /> - <Anchor point="BOTTOM" relativeKey="$parent.titlebg" /> - <Anchor point="LEFT" relativeKey="$parent.titlebg" /> - <Anchor point="RIGHT" relativeKey="$parent" /> - </Anchors> - </FontString> - </Layer> - </Layers> - </Frame> - - - <Frame name="VeneerTrackerBlock" virtual="true"> - <Scripts> - <OnShow> - Veneer.print('Frame')(self:GetName(), '|cFF00FF00SHOW|r', debugstack(1,3,1)) - if(self.DebugTab:IsShown()) then - self.DebugTab:Show() - end - self.blockFadeOut:Stop() - </OnShow> - </Scripts> - <Animations> - <AnimationGroup name="$parent_BlockSlide" parentKey="blockShift" ignoreFramerateThrottle="true"> - <Translation parentKey="translation" offsetX="0" offsetY="0" smoothing="OUT" order="1" duration=".25" /> - </AnimationGroup> - <AnimationGroup name="$parent_BlockFadeIn" setToFinalAlpha="true" parentKey="questFadeIn" ignoreFramerateThrottle="true"> - </AnimationGroup> - <AnimationGroup name="$parent_BlockFade" parentKey="blockFadeOut" ignoreFramerateThrottle="true" looping="NONE"> - <Alpha duration="0.25" order="1" fromAlpha="1" toAlpha="0" /> - <Translation duration="0.25" order="1" offsetX="-260" offsetY="0" smoothing="OUT" /> - <Scale order="1" duration="0.25" scaleX="0.1" scaleY="0.1"> - <Origin point="CENTER"> - <Offset x="0" y="0" /> - </Origin> - </Scale> - </AnimationGroup> - </Animations> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentTitleBackground" parentKey="titlebg" alphaMode="MOD"> - <Color r="1" g="1" b="1" a="1" /> - <Anchors> - <Anchor point="TOPLEFT" x="0" y="0" /> - <Anchor point="RIGHT" /> - </Anchors> - </Texture> - <Texture name="$parentStatusBackground" parentKey="statusbg" alphaMode="MOD"> - <Anchors> - <Anchor point="LEFT" /> - <Anchor point="RIGHT" /> - <Anchor point="TOP" relativePoint="BOTTOM" relativeKey="$parent.titlebg" /> - <Anchor point="BOTTOM" x="0" y="0" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - <Gradient orientation="HORIZONTAL"> - <MinColor r="0" g="0" b="0" a=".15" /> - <MaxColor r="0" g="0" b="0" a=".35" /> - </Gradient> - </Texture> - </Layer> - <Layer level="BORDER"> - - <Texture parentKey="SelectionOverlay" alphaMode="ADD" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" /> - <Anchor point="BOTTOMRIGHT" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - <Gradient orientation="HORIZONTAL"> - <MaxColor r="1" g="0" b="0" a="0.7" /> - <MinColor r="1" g="0" b="0" a="0.7" /> - </Gradient> - </Texture> - </Layer> - <Layer level="ARTWORK"> - - - <Texture parentKey="typeTag" file="Interface\QuestFrame\QuestTypeIcons" alphaMode="ADD" hidden="true"> - <Size x="18" y="18"/> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeKey="$parent.FrequencyTag" x="-3" y="-3"/> - </Anchors> - </Texture> - - <Texture parentKey="frequencyTag" file="Interface\QuestFrame\QuestTypeIcons" alphaMode="ADD" hidden="true"> - <Size x="18" y="18"/> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeKey="$parent.CompletionTag" x="-3" y="-3"/> - - </Anchors> - </Texture> - <Texture parentKey="completionTag" file="Interface\QuestFrame\QuestTypeIcons" alphaMode="ADD" hidden="true"> - <Size x="18" y="18"/> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeKey="$parent.icon" x="-3" y="-3"/> - - </Anchors> - </Texture> - <Texture name="$parentMoneyTile" parentKey="money" hidden="true"> - <Size x="16" y="16" /> - - </Texture> - - - - <Texture inherits="VeneerRewardTile" /> - <Texture inherits="VeneerRewardTile" /> - <Texture inherits="VeneerRewardTile" /> - </Layer> - <Layer level="OVERLAY"> - <FontString name="$parentTitle" parentKey="title" inherits="VeneerTitleFont" justifyH="LEFT" justifyV="TOP"> - <Anchors> - <Anchor point="TOP" relativeKey="$parent.titlebg" /> - <Anchor point="LEFT" relativeKey="$parent" /> - <Anchor point="RIGHT" relativeKey="$parent" /> - </Anchors> - </FontString> - <FontString name="$parentStatus" parentKey="status" inherits="VeneerCriteriaFontNormal" justifyH="LEFT" justifyV="TOP" wordwrap="true" > - <Anchors> - <Anchor point="TOP" relativeKey="$parent.statusbg" /> - <Anchor point="LEFT" relativeKey="$parent" /> - <Anchor point="RIGHT" relativeKey="$parent" /> - </Anchors> - </FontString> - <FontString inherits="VeneerRewardText" /> - <FontString inherits="VeneerRewardText" /> - <FontString inherits="VeneerRewardText" /> - - - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.status" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" relativePoint="BOTTOMLEFT" x="1" y="0" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - </Texture> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.status" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" relativePoint="TOPRIGHT" x="0" y="-1" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - </Texture> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.status" relativePoint="BOTTOMLEFT" x="0" y="1" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - </Texture> - - <Texture alphaMode="ADD" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.statusbg" x="-30" y="0" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" relativePoint="TOPRIGHT" x="30" y="0" /> - </Anchors> - <Color r="0" g="1" b="0" a="0.5" /> - </Texture> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" x="-35" y="0" /> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="-1" /> - </Anchors> - <Color r="1" g="0" b="0" a="1" /> - </Texture> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="1" /> - <Anchor point="BOTTOMRIGHT" x="35" y="0" /> - </Anchors> - <Color r="1" g=".5" b="0" a="1" /> - </Texture> - - </Layer> - <Layer level="HIGHLIGHT"> - <Texture name="$parentHighLight" parentKey="highlight"> - <Anchors> - <Anchor point="TOPLEFT" /> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="-4"/> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - <Gradient orientation="VERTICAL"> - <MaxColor r="1" g="1" b="1" a=".5" /> - <MinColor r="1" g="1" b="1" a="0" /> - </Gradient> - </Texture> - <Texture name="$parentLowLight" parentKey="lowlight"> - <Anchors> - <Anchor point="TOP" relativePoint="BOTTOM" x="0" y="14" /> - <Anchor point="BOTTOM" x="0" y="0"/> - <Anchor point="RIGHT" /> - <Anchor point="LEFT" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - <Gradient orientation="VERTICAL"> - <MaxColor r="1" g="1" b="1" a="0" /> - <MinColor r="1" g="1" b="1" a=".5" /> - </Gradient> - </Texture> - </Layer> - </Layers> - <Frames> - <Frame name="$parentHeaderBox" parentKey="clickZone" enableMouse="true"> - <Anchors> - <Anchor point="TOP" relativeKey="$parent.title" /> - <Anchor point="RIGHT" relativeKey="$parent.title" /> - <Anchor point="LEFT" relativeKey="$parent.title" /> - <Anchor point="BOTTOM" relativeKey="$parent.title" /> - </Anchors> - <Layers> - <Layer level="HIGHLIGHT"> - <Texture setAllPoints="true"> - <Color r="1" g="1" b="0.5" a="0.5" /> - </Texture> - </Layer> - </Layers> - </Frame> - <Frame name="$parentDebugInfo" parentKey="DebugTab" hidden="true"> - <Size x="200" y="30" /> - <Layers> - <Layer level="OVERLAY"> - - <FontString name="$parentStatus" parentKey="status" inherits="VeneerNumberFont" justifyH="RIGHT" justifyV="TOP"> - <Color r="1" g="1" b="1" a="1" /> - <Anchors> - <Anchor point="RIGHT" /> - </Anchors> - </FontString> - </Layer> - <Layer level="BACKGROUND"> - <Texture> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeKey="$parent.status" /> - <Anchor point="TOPRIGHT" relativeKey="$parent.status" /> - </Anchors> - <Color r="0" g="0" b="0" a="0.5" /> - </Texture> - </Layer> - </Layers> - </Frame> - </Frames> - </Frame> - - <Frame name="VeneerTrackerObjective" virtual="true" hidden="true" enableMouse="true"> - <Anchors> - <Anchor point="TOP" /> - <Anchor point="LEFT" /> - <Anchor point="RIGHT" /> - </Anchors> - <Layers> - <Layer level="OVERLAY"> - <FontString inherits="VeneerCriteriaFontNormal" parentKey="status" wordwrap="true" justifyH="LEFT" justifyV="TOP"> - <Anchors> - <Anchor point="TOP" /> - <Anchor point="LEFT" /> - <Anchor point="RIGHT" /> - </Anchors> - </FontString> - - <!-- debugging guides --> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" x="0" y="600" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" x="1" y="-600" /> - </Anchors> - <Color r="0" g="1" b="0" a="1" /> - </Texture> - <Texture alphaMode="ADD" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent" x="0" y="600" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" relativePoint="BOTTOMLEFT" x="0" y="-600" /> - </Anchors> - <Color r="0" g=".4" b="1" a=".25" /> - </Texture> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.status" relativePoint="TOPRIGHT" x="-1" y="200" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" x="0" y="-600" /> - </Anchors> - <Color r="0" g="1" b="0" a=".5" /> - </Texture> - - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.status" x="-30" y="0" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" relativePoint="TOPRIGHT" x="0" y="-1" /> - </Anchors> - <Color r="1" g="0" b="0" a="0.5" /> - </Texture> - <Texture alphaMode="BLEND" parentArray="config" hidden="true"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.status" x="0" y="1" /> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.status" relativePoint="BOTTOMRIGHT" x="30" y="0" /> - </Anchors> - <Color r="1" g="0" b="0" a="0.5" /> - </Texture> - - <!-- end debugging guides --> - - </Layer> - <Layer level="BACKGROUND"> - <Texture parentKey="statusbg"> - <Anchors> - <Anchor point="TOP" /> - <Anchor point="LEFT" /> - <Anchor point="RIGHT" /> - <Anchor point="BOTTOM" /> - </Anchors> - </Texture> - </Layer> - <Layer level="HIGHLIGHT"> - <Texture setAllPoints="true"> - <Color r="1" g="1" b="1" a="0.2" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Include file="SecureButton.xml" /> - <Include file="Widgets.xml" /> - - <Script file="ObjectiveTracker.lua" /> - <Script file="Schema.lua" /> - <Script file="QuestData.lua" /> - <Script file="AchievementData.lua" /> - <Script file="AutoQuestPopupData.lua" /> - <Script file="BonusObjectiveData.lua" /> - <Script file="ScenarioData.lua" /> - <Script file="ExerienceBar.lua" /> - <Script file="Layout.lua" /> - <Script file="Block.lua" /> - <Script file="RewardFrame.lua" /> - <Script file="Default.lua" /> - <Script file="APIHooks.lua" /> - <Script file="Widgets.lua" /> - <!-- <Script file="ObjectiveStyle.lua" /> --> - <!-- <Script file="ObjectiveInfo.lua" /> --> -</Ui> \ No newline at end of file
--- a/ObjectiveTracker/QuestData.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,576 +0,0 @@ -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band -local GetQuestWatchInfo, GetQuestLogCompletionText = GetQuestWatchInfo, GetQuestLogCompletionText -local GetQuestLogLeaderBoard, GetNumQuestLogEntries, GetQuestLogTitle = GetQuestLogLeaderBoard, GetNumQuestLogEntries, GetQuestLogTitle -local GetQuestLogSpecialItemInfo, GetQuestLogSpecialItemCooldown = GetQuestLogSpecialItemInfo, GetQuestLogSpecialItemCooldown -local GetSuperTrackedQuestID, GetMoney, C_Scenario, GetCVarBool, GetNumQuestWatches = GetSuperTrackedQuestID, GetMoney, C_Scenario, GetCVarBool, GetNumQuestWatches -local GetQuestTagInfo, GetMoneyString, GetDistanceSqToQuest, GetQuestFactionGroup = GetQuestTagInfo, GetMoneyString, GetDistanceSqToQuest, GetQuestFactionGroup -local QUEST_TAG_ACCOUNT, LE_QUEST_FACTION_HORDE, LE_QUEST_FREQUENCY_DAILY, LE_QUEST_FREQUENCY_WEEKLY = QUEST_TAG_ACCOUNT, LE_QUEST_FACTION_HORDE, LE_QUEST_FREQUENCY_DAILY, LE_QUEST_FREQUENCY_WEEKLY -local QUEST_TAG_TCOORDS, IsQuestSequenced = QUEST_TAG_TCOORDS, IsQuestSequenced -local Default, Quest = T.DefaultHandler, T.Quest -local format, wipe, select = format, table.wipe, select -local wipeall = B.wipeall -local lprint, iprint, tprint = B.print('Line'), B.print('Info'), B.print('Tracker') -local print = tprint -local fprint = B.print('Frame') - - -local superTrackQuestID, playerMoney, inScenario, showPOIs -Quest.Update = function(self, reason, ...) - local print = self.print - print('QuestTracker:Update() received') - T.UpdateActionButtons() - Default.Update(self, reason, ...) -end - -T.Quest.numButtons = 0 -local usedButtons = T.Quest.itemButtons -local freeButtons = T.Quest.freeButtons - -Quest.UpdateObjectives = function(self, block) - local print = lprint - print('|cFF'..self.internalColor..'UpdateObjectives()') - local info = block.info - - print((info.isAccount and 'isAccount' or ''), (info.isFaction and 'isFaction' or ''), (info.isDaily and 'isDaily' or ''), (info.isWeekly and 'isWeekly' or ''), info.tagID, info.tagName) - - local displayObjectives = true - local block_schema = 'default' - if info.isAccount then - if info.isFaction then - print(' faction', info.tagID) - block_schema = 'faction_'..info.tagID - else - print(' account', info.isAccount, info.isFaction) - block_schema = 'account' - end - elseif info.isDaily then - print(' daily', info.frequency) - block_schema = 'daily' - elseif info.isWeekly then - print(' weekly', info.frequency) - block_schema = 'weekly' - end - local completionText - - if info.isAutoComplete and info.isComplete then - displayObjectives = false - info.numObjectives = 1 - self:AddLine(block, info.completionText, nil, 'complete') - elseif info.isComplete then - if T.Conf.ShowCompletionText then - self:AddLine(block, info.completionText, nil, 'complete') - displayObjectives = false - end - if not T.Conf.ShowObjectivesWhenComplete then - displayObjectives = false - end - print('|cFF'..self.internalColor..' :: complete quest :: show instruction: "'.. tostring(info.completionText) .. '"') - block_schema = 'complete' - end - - - Default.UpdateObjectives(self, block, block_schema, displayObjectives) - return 0, block_schema -end - -Quest.UpdateLine = function(handler, block, data) - local objectiveType = data.type - return data.text, nil, objectiveType -end - ------------------------------ ---- QUEST -local tremove, tinsert = tremove, tinsert -local GetQuestLogIndexByID, IsQuestWatched = GetQuestLogIndexByID, IsQuestWatched -Quest.QuestBlock = {} -Quest.LogBlock = {} -Quest.LogInfo = {} - -Quest.OnRemoved = function(block) - -end - -Quest.GetBlock = function(self, index) - local block = Default.GetBlock(self, index) - block:SetScript('OnEvent', Quest.OnRemoved) - block:RegisterEvent('QUEST_REMOVED') - return block -end - -local GetQuestWatchIndex = GetQuestWatchIndex -local numAnimating = 0 - ---- Get a total of things to show, and straighten out the index while we're at it ---- Return the number shown, total in log, and the info table to parse -Quest.GetNumWatched = function (self, id, added) - local print = self.print - B.print('Block')('########') - B.print('Block')('########') - superTrackQuestID = GetSuperTrackedQuestID() - playerMoney = GetMoney(); - inScenario = C_Scenario.IsInScenario(); - showPOIs = GetCVarBool("questPOI"); - local numAll = GetNumQuestLogEntries() - local numWatched = GetNumQuestWatches() - local bottomIndex = 1 - local start, limit = 1, numAll - - - --- Update the index tables - numAnimating = 0 - local numEntries = 0 - for logIndex = start, limit do - local reason1, reason2 = '', '' - local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(logIndex) - local watchIndex = GetQuestWatchIndex(logIndex) - - - if watchIndex and watchIndex >= bottomIndex then - -- do watch data pointers match? - local watchInfo, watchBlock = self.WatchInfo[watchIndex], self.WatchBlock[watchIndex] - - if watchInfo and watchInfo.questID ~= questID then - print('GetNumWatched', 'trimming WatchInfo ['..watchIndex..'] =/=', questID) - self.WatchInfo[watchIndex] = nil - end - if watchBlock and watchBlock.info.questID ~= questID then - print('GetNumWatched', 'trimming WatchBlock ['..watchIndex..'] =/=', watchBlock:GetName()) - self.WatchBlock[watchIndex] = nil - end - end - - -- check log-block pointer - local logBlock = self.LogBlock[logIndex] - if logBlock then - -- check later that the block isn't for a dropped quest - if logBlock.info.questID ~= questID then - print('GetQuests', 'replace info', logBlock.info.questID, '->', questID) - self.LogBlock[logIndex] = nil - end - end - --- end of crazy audit flagging - - -- add to watch index if: the questID is non-zero - if questID ~= 0 then - self:GetInfo(logIndex, watchIndex) - print('GetQuests', format('request info |cFF00FF00%2d|r |cFFFFFF00%6d|r |cFFFF4400%3s|r |cFF00FFFF%3s|r', logIndex, questID, tostring(watchIndex or ''), numEntries)) - end - end - - - - --- Clean up blocks that got cut off for some reason - for index, block in ipairs(self.usedBlocks) do - -- animating blocks have been evaluated - if not block.blockFadeOut:IsPlaying() then - - local logIndex = GetQuestLogIndexByID(block.info.questID, 'player') - print('GetNumWatched', GetQuestLogTitle(logIndex)) - local questID = select(8,GetQuestLogTitle(logIndex)) - print('GetNumWatched', questID) - - if questID == 0 then - self:ClearBlock(block) - print('GetNumWatched', '|cFF44FF00'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex, questID, '(unresolved)', block.info.title) - elseif not IsQuestWatched(block.info.logIndex) then - self:ClearBlock(block) - print('GetNumWatched', '|cFFFF4400'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex, questID, '(unwatched)', block.info.title) - else - print('GetNumWatched', '|cFF0088FF'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex or '|cFF444444-|r', block.info.title) - end - else - - print('GetNumWatched', '|cFF00FFFF'.. index, (block and block:GetName() or '|cFFFF0000-|r'), ' (animating)') - end - end - - self.numWatched = numWatched - self.numAll = numAll - - print('GetNumWatched', 'RESULT', numWatched, 'of', numAll) - return numWatched, numAll, self.WatchList -end - - ---- Returns an iterable table from which tracker blocks can be filled out. Data includes: --- All entry-layer GetXInfo return values --- Manifest of line data to be displayed in relation to the tracked object -Quest.GetInfo = function (self, logIndex, watchIndex) - local print = iprint - print('') - local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(logIndex) - if ( not questID ) then - tprint('GetNumWatched', logIndex, watchIndex, '|cFFFF2299no data|r') - return 0 - end - - Quest.Info[questID] = Quest.Info[questID] or {} - local numEntries = 0 - local q = Quest.Info[questID] - q.questID = questID - q.id = questID - q.logIndex = logIndex - q.watchIndex = watchIndex - - local numObjectives, requiredMoney, isAutoComplete, failureTime, timeElapsed, questType - = 0, 0, nil, false, false, 0 - if watchIndex then - self.print('WatchIndex', watchIndex) - local _ - _, _, _, numObjectives, requiredMoney, _, _, isAutoComplete, - failureTime, timeElapsed, questType = GetQuestWatchInfo(watchIndex) - self.WatchList[watchIndex] = q - --tprint(' |cFF88FF00GetInfo:|r set watch entry', watchIndex) - self.print('WatchIndex', logIndex, watchIndex + numAnimating, '|cFFFF2299'..title..'|r') - end - self.LogInfo[logIndex] = q - - q.numObjectives = numObjectives - q.requiredMoney = requiredMoney - q.failureTime = failureTime - q.timeElapsed = timeElapsed - - - - q.type = 'Quest' - q.title = title - q.level = level - q.displayQuestID = displayQuestID - q.suggestedGroup = suggestedGroup - - -- re-use Blizzard logic for consistency - local showQuest = true - if isTask then showQuest = false end - local watchMoney = false; - local tagID, typeTag, frequencyTag, completionTag, completionText - local isAccount, isFaction, isWeekly, isDaily = false, false, false, false - local isBreadcrumb = false - local questFailed = false - local watchMoney = false - local timerInfo, moneyInfo = false, false - local objectives = q.objectives or {} - - - -- Case 1: completed quest or "go to thing" breadcrumb - -- * 1 line containing the completion text - if ( isComplete and isComplete < 0 ) then - isComplete = false - questFailed = true - elseif ( numObjectives == 0 and playerMoney >= requiredMoney and not startEvent ) then - isComplete = true; - questFailed = false - if ( requiredMoney == 0 ) then - isBreadcrumb = true; - end - end - print('QuestFlags', (isComplete and 'isComplete' or ''), (questFailed and 'questFailed' or ''), (isBreadcrumb and 'isBreadcrumb' or ''), numObjectives) - - -- completion message? - local isSequenced = IsQuestSequenced(questID) - local temp_status = '' - if ( isComplete ) then - temp_status = 'COMPLETED_OBJECTIVES' - --objectives = Quest.GetObjectives(logIndex, numObjectives, true, isSequenced, isStory) - if ( isAutoComplete ) then - temp_status = 'AUTOCOMPLETE_OBJECTIVES' - completionText = _G.QUEST_WATCH_CLICK_TO_COMPLETE - else - if ( isBreadcrumb ) then - temp_status = 'COMPLETE_BREADCRUMB' - completionText = GetQuestLogCompletionText(logIndex) - else - temp_status = 'COMPLETE_READY_FOR_TURN_IN' - completionText = _G.QUEST_WATCH_QUEST_READY - end - end - if not T.Conf.ShowObjectivesWhenComplete then - q.objectives = {} - end - elseif ( questFailed ) then - temp_status = 'FAILED' - -- Case 2: failed quest - -- * 1 status line; hide other info - completionText = _G.FAILED - else - - temp_status = 'PROGRESS_OBJECTIVES' - -- Case 3: quest in progress - -- * Multiple objective lines - -- * Possible extra lines for money and timer data respectively - self.print(' QuestInfo', title, questType, isAutoComplete) - objectives = Quest.GetObjectives(logIndex, numObjectives, false, isSequenced, isStory) - q.objectives = objectives - - --- anything past here gets appended to existing objectives - - -- money - if ( requiredMoney > playerMoney ) then - - temp_status = temp_status .. '_MONEY' - local text = GetMoneyString(playerMoney).." / "..GetMoneyString(requiredMoney); - moneyInfo = { - type = 'money', - text = text, - finished = false, - requiredMoney = requiredMoney, - playerMoney = playerMoney, - } - tinsert(objectives, moneyInfo) - end - - -- time limit - if ( failureTime ) then - temp_status = temp_status .. '_TIMED' - if ( timeElapsed and timeElapsed <= failureTime ) then - timerInfo = { - type = 'timer', - finished = false, - timeElapsed = timeElapsed, - failureTime = failureTime, - } - tinsert(objectives, timerInfo) - end - end - end - q.moneyInfo = moneyInfo - q.timerInfo = timerInfo - q.completionText = completionText - - -- POI data - local POI = false - if ( showPOIs ) then - POI = { - questID = questID, - logIndex = logIndex, - watchIndex = watchIndex - } - local poiButton; - if ( hasLocalPOI ) then - - if ( isComplete ) then - POI.type = 'normal' - else - POI.type = 'numeric' - end - elseif ( isComplete ) then - POI.type = 'remote' - end - - local distance, onContinent = GetDistanceSqToQuest(logIndex) - if distance ~= nil and distance > 0 then - POI.distance = distance - POI.onContinent = onContinent - end - end - q.POI = POI - - --- Block Tags - -- completionTag - in progres, complete, failed, autocomplete - -- typeTag - account, faction, pvp, dungeon, group - -- frequencyTag - daily/weekly - local schema = 'default' - local questTagID, tagName = GetQuestTagInfo(questID) - local tagInfo = {} - local tagCoords = {} - local factionGroup = GetQuestFactionGroup(questID); - if( questTagID and questTagID == QUEST_TAG_ACCOUNT ) then - if( factionGroup ) then - tagID = "ALLIANCE" - schema = 'alliance' - if ( factionGroup == LE_QUEST_FACTION_HORDE ) then - tagID = "HORDE" - schema = 'horde' - end - isFaction = true - else - tagID = QUEST_TAG_ACCOUNT - isAccount = true - end - tagInfo['type'] = QUEST_TAG_TCOORDS[tagID] - elseif ( factionGroup) then - tagID = "ALLIANCE" - if ( factionGroup == LE_QUEST_FACTION_HORDE ) then - tagID = "HORDE" - end - isFaction = true - tagInfo['type'] = QUEST_TAG_TCOORDS[tagID] - end - - if( frequency == LE_QUEST_FREQUENCY_DAILY and (not isComplete or isComplete == 0) ) then - tagID = 'DAILY' - tagInfo['frequency'] = QUEST_TAG_TCOORDS[tagID] - isDaily = true - schema = 'daily' - elseif( frequency == LE_QUEST_FREQUENCY_WEEKLY and (not isComplete or isComplete == 0) )then - tagID = 'WEEKLY' - tagInfo['frequency'] = QUEST_TAG_TCOORDS[tagID] - isWeekly = true - schema = 'weekly' - elseif( questTagID ) then - tagID = questTagID - end - - if( isComplete ) then - tagInfo['completion'] = QUEST_TAG_TCOORDS['COMPLETED'] - elseif ( questFailed ) then - tagInfo['completion'] = QUEST_TAG_TCOORDS['FAILED'] - end - - q.tagInfo = tagInfo - q.tagID = tagID -- defining primary tags for compact view - q.tagName = tagName - - -- action button information - local link, icon, charges = GetQuestLogSpecialItemInfo(logIndex) - local start, duration, enable = GetQuestLogSpecialItemCooldown(logIndex) - if link or icon or charges then - q.specialItem = { - questID = questID, - logIndex = questLogIndex, - link = link, - charges = charges, - icon = icon, - start = start, - duration = duration, - enable = enable, - } - end - - if moneyInfo or timerInfo then - numObjectives = #objectives - end - - -- raw data - q.isComplete = isComplete - q.startEvent = startEvent - q.isAutoComplete = isAutoComplete - q.questType = questType - q.isTask = isTask - q.isStory = isStory - q.isOnMap = isOnMap - q.hasLocalPOI = hasLocalPOI - q.frequency = frequency - q.isComplete = isComplete - q.isStory = isStory - q.isTask = isTask - q.statusKey = temp_status - q.selected = (questID == superTrackQuestID) - - T.SetRewards(q, questID) - - q.questID = questID - q.logIndex = logIndex - q.watchIndex = watchIndex - q.id = questID - q.schema = schema - - if Devian and Devian.InWorkspace() then - print('QuestStatus', temp_status, '|cFF00FF00questLogIndex|r:', logIndex, title) - local temp ={} - local data_txt = '|cFF'..self.internalColor..'values:|r' - for k,v in pairs(q) do - if type(v) =='number' then - data_txt = data_txt .. ' |cFFFFFF00'..k..'|r: ' .. tostring(v) - elseif type(v) == 'table' then - tinsert(temp, k) - end - end - print('DataStatus',data_txt) - sort(temp, function(a,b) return a < b end) - for i, k in ipairs(temp) do - iprint('GetInfo', questID, ''..k..'|r') - for kk,v in pairs(q[k]) do - iprint('GetInfo', questID, kk, '=', v) - end - end - end - - return numEntries -end - -Quest.GetObjectives = function(logIndex, numObjectives, isComplete, isSequenced, isStory) - local print = Quest.print - local objectives = {} - if not logIndex then - return - end - - for i = 1, numObjectives do - local text, type, finished = GetQuestLogLeaderBoard(i, logIndex) - - local progress = 0 - if finished then - progress = 1 - elseif text then - local quantity, maxQuantity = text:match('^(%d+)/(%d+)') - if quantity and maxQuantity then - progress = quantity / maxQuantity - --print('GetObjectives', 'calculated objective progress:', quantity, '/', maxQuantity, '=', progress) - end - end - - print('GetObjectives', format('|cFF88FF88#%d %s %s %s', i, tostring(type), tostring(text), tostring(finished)), '('.. tostring(progress)..')') - - - objectives[i] = { - index = i, - type = type, - text = text, - finished = finished, - progress = progress - } - end - return objectives -end - -local huge, sqrt = math.huge, math.sqrt -Quest.GetClosest = function() - local minID, minTitle - local minDist = huge - local numQuests = GetNumQuestLogEntries() - for questIndex = 1, numQuests do - local distance, onContinent = GetDistanceSqToQuest(questIndex) - local title, level, _, _, _, _, _, _, questID = GetQuestLogTitle(questIndex) - if onContinent and distance < minDist then - minDist = distance - minTitle = title - minID = questID - end - end - - print('nearest quest is', minTitle, 'by', sqrt(minDist)) - return minID, minTitle, minDist -end - -Quest.OnTurnIn = function(self, questID, xp, money) -end - -Quest.Select = function (handler, block) - if block.info.isAutoComplete and block.info.isComplete then - ShowQuestComplete(block.info.logIndex) - else - SetSuperTrackedQuestID(block.info.questID) - end -end - -Quest.Link = function(handler, block) - local questLink = GetQuestLink(block.info.logIndex); - if ( questLink ) then - ChatEdit_InsertLink(questLink); - end -end - -Quest.Open = function(handler, block) - QuestMapFrame_OpenToQuestDetails(block.info.questID) -end - -Quest.Remove = function(handler, block) - print('removing', block.info.logIndex, 'from watcher') - RemoveQuestWatch(block.info.logIndex) -end - -Quest.OnRemoved = function(block) - print('OnRemoved', block:GetID()) -end \ No newline at end of file
--- a/ObjectiveTracker/RewardFrame.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/22/2016 5:38 PM -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local ipairs = ipairs -local bprint = B.print('Block') -local Default, AutoQuest, Quest, Bonus, Cheevs = T.DefaultHandler, T.AutoQuest, T.Quest, T.Bonus, T.Cheevs ---- displays a reward popout and starts its animation chain -local tagPoint, tagAnchor, tagRelative, x, y -local REWARD_POPUP_FRAME = _G.VeneerRewardsPopOut - -function REWARD_POPUP_FRAME:StartRewards() - tagPoint, tagAnchor, tagRelative, x, y = 'TOPLEFT', self, 'TOPLEFT', 0, 0 - -end -function REWARD_POPUP_FRAME:AddReward(handler, rewardInfo, id) - local totalHeight = 0 - REWARD_POPUP_FRAME:SetID(id) - REWARD_POPUP_FRAME.handler = handler - - for i, rewardTile in ipairs(REWARD_POPUP_FRAME.rewardTile) do - if rewardInfo[i] then - local reward = rewardInfo[i] - rewardTile:SetPoint(tagPoint, tagAnchor, tagRelative, -2, -2) - rewardTile:SetTexture(reward.texture) - rewardTile:Show() - if reward.count and reward.count > 1 then - self.rewardLabel[i]:SetText(reward.count) - self.rewardLabel[i]:Show() - end - - rewardTile:ClearAllPoints() - rewardTile:SetPoint(tagPoint, tagAnchor, tagRelative, x, y) - tagPoint, tagAnchor, tagRelative, x, y = 'TOPRIGHT', rewardTile, 'TOPLEFT', -2, 0 - - totalHeight = totalHeight + rewardTile:GetHeight() - else - rewardTile:Hide() - self.rewardLabel[i]:Hide() - end - end - - REWARD_POPUP_FRAME.rewardsFadeIn:Play() -end - -function REWARD_POPUP_FRAME:OnFinished () -end -
--- a/ObjectiveTracker/ScenarioData.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ ---- ${PACKAGE_NAME} --- @file-author@ --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/13/2016 8:17 PM -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') - -local Scenario = T.Scenario - -Scenario.GetNumWatched = function() - if true then return 0, 0, nil end -end -
--- a/ObjectiveTracker/Schema.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ ---- ${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') -local lprint = B.print('Layout') -local oprint = B.print('Objectives') -T.defaults.Schema = setmetatable({}, { - __newindex = function(schemas,layerName, layerTable) - -- tracker/block/line - if type(layerTable) == 'table' then - - print('adding layer', layerName) - for k,v in pairs(layerTable) do - print(' incorporated schema', k) - if type(v) == 'table' and k ~= 'default' then - setmetatable(v, { - __index = function(schemaTable, key) - print(' substituting default "'..tostring(schemas[layerName].default[key])..'" for |cFF00FFFF', layerName..'|r.|cFF0088FF'..k..'|r.'..key) - return schemas[layerName].default[key] - end - }) - end - end - rawset(schemas, layerName, setmetatable(layerTable, { - __newindex = function(layerTable, schemaName, schemaTable) - -- schema table - if type(schemaTable) == 'table' then - print('adding schema', schemaName, 'to', layerName, 'layers') - - - rawset(layerTable, schemaName, setmetatable(schemaTable, { - __index = function(schemaTable, key) - print(' substituting default "'..tostring(schemas[layerName].default[key])..'" for |cFF00FFFF', layerName..'|r.|cFF0088FF'..schemaName..'|r.'..key) - rawset(schemaTable, key, schemas[layerName].default[key]) - return schemas[layerName].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\XOIREQE.TTF]], 13, 'OUTLINE'}, - headerHeight = 16, - headerSpacing = 0, - headerColor = {1,1,1,1}, - blockSpacing = 1, - } -} -T.defaults.Schema.block = { - default = { - titleColor = {1, 1, 1, 1}, - titlebg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 1, 'MOD'}, - textbg = {'HORIZONTAL', 1, 1, 1, 1, .7, .7, .7, 1, 'MOD'}, - 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, - selectionIndent = 5, - textIndent = 3, - textSpacing = 3, - rewardSize = 24, - }, - complete = { - titleColor = {.25,1,.25}, - titlebg = {'HORIZONTAL', .25, 1, .25, .125, 0, 1, .7, .25}, - }, - achievement = { - titleColor = {0, 0.7, 1, 1}, - }, - achievement_account = { - titleColor = {.35, 0.7, 1, 1}, - }, - daily = { - titleColor = {0, 0.7, 1, 1}, - titlebg = {'HORIZONTAL', 0, .7, 1, 0, 0, 1, .7, .125}, - textbg = {'HORIZONTAL', 0, .7, 1, 0, 0, 1, .7, .1}, - }, - weekly = { - titleColor = {.25, 0.7, 1, 1}, - titlebg = {'HORIZONTAL', 0, .35, .7, 0, 0, .35, .7, .125}, - textbg = {'HORIZONTAL', 0, .35, .7, .0, 0, .35, .7, .075 }, - }, - account = { - titlebg = {'HORIZONTAL', .1, .1, .1, 0, .1, .1, .1, .125}, - textbg = {'HORIZONTAL', .1, .1, .1, 0, .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.defaults.Schema.line = { - default = { - textColor = {1, 1, 1}, - textSpacing = 3, - textIndent = 3, - }, - completed = { - textColor = {.5, 1, .5} - }, - failed = { - textColor = {1,.25,.25 } - }, - autocomplete = { - textColor = {.5,1,1 } - }, - object = { - textColor = {0,1,1} - }, - monster = { - textColor = {1,1,0} - }, - item = { - textColor = {1,.75,.75} - }, - achievement_complete = { - textColor = {1, 1, 1, 1}, - }, - achievement = { - textColor = {0.5, 0.85, 1, 1}, - }, - achievement_account = { - textColor = {.4, 0.7, 1, 1}, - }, -} -T.defaults.Schema.widget = { - progressbar = { - - }, - timer = { - - } -} - -T.defaults.Schema.statusbar = { - default = { - textFont = {[[Interface\Addons\SharedMedia_MyMedia\font\XOIREQE.TTF]], 11, 'OUTLINE'}, - textColor = {1,1,1,1}, - } -} \ No newline at end of file
--- a/ObjectiveTracker/SecureButton.xml Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -<Ui> - <!-- - The following was lifted from QuestKing, mainly to spare the horrors of writing a global space frame script - --> - <Button name="VeneerItemButtonTemplate" inherits="SecureActionButtonTemplate" virtual="true"> - <Attributes> - <Attribute name="type" value="item" /> - </Attributes> - <Layers> - <Layer level="ARTWORK"> - <FontString parentKey="HotKey" inherits="NumberFontNormalSmallGray" justifyH="LEFT" text="RANGE_INDICATOR"> - <Size x="29" y="10"/> - <Anchors> - <Anchor point="TOPRIGHT" x="16" y="-2"/> - </Anchors> - </FontString> - </Layer> - <Layer level="BORDER"> - <Texture parentKey="icon"/> - <FontString parentKey="Count" inherits="NumberFontNormal" justifyH="RIGHT" hidden="true"> - <Anchors> - <Anchor point="BOTTOMRIGHT" x="-3" y="2"/> - </Anchors> - </FontString> - </Layer> - </Layers> - <Frames> - <Cooldown parentKey="Cooldown" inherits="CooldownFrameTemplate"/> - </Frames> - <Scripts> - <OnLoad> - self:RegisterForClicks("AnyUp"); - </OnLoad> - <OnEvent> - if (event == "PLAYER_TARGET_CHANGED") then - self.rangeTimer = -1; - elseif (event == "BAG_UPDATE_COOLDOWN") then - Veneer_QuestObjectiveItem_UpdateCooldown(self) - end - </OnEvent> - <OnUpdate function="Veneer_QuestObjectiveItem_OnUpdate" /> - <OnShow> - self:RegisterEvent("PLAYER_TARGET_CHANGED"); - self:RegisterEvent("BAG_UPDATE_COOLDOWN"); - </OnShow> - <OnHide> - self:UnregisterEvent("PLAYER_TARGET_CHANGED"); - self:UnregisterEvent("BAG_UPDATE_COOLDOWN"); - </OnHide> - <OnEnter> - GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); - GameTooltip:SetQuestLogSpecialItem(self.logIndex); - </OnEnter> - <OnLeave> - GameTooltip:Hide(); - </OnLeave> - </Scripts> - <NormalTexture parentKey="NormalTexture" file="Interface\Buttons\UI-Quickslot2"> - <Anchors> - <Anchor point="CENTER"/> - </Anchors> - </NormalTexture> - <PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/> - <HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/> - </Button> -</Ui> \ No newline at end of file
--- a/ObjectiveTracker/Widgets.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,309 +0,0 @@ -local B = select(2,...).frame -local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local print = B.print('WidgetFactory') -local tprint = B.print('Tracker') -local _G, UIParent = _G, UIParent -local GetQuestLogSpecialItemInfo, IsQuestLogSpecialItemInRange, GetQuestLogSpecialItemCooldown = GetQuestLogSpecialItemInfo, IsQuestLogSpecialItemInRange, GetQuestLogSpecialItemCooldown -local CooldownFrame_SetTimer, SetItemButtonTextureVertexColor, CreateFrame = CooldownFrame_SetTimer, SetItemButtonTextureVertexColor, CreateFrame -local pairs, ipairs, floor = pairs, ipairs, floor -local SetItemButtonTexture, SetItemButtonCount = SetItemButtonTexture, SetItemButtonCount -local ToggleWorldMap = ToggleWorldMap --- GLOBALS: Veneer_QuestObjectiveItem_UpdateCooldown, Veneer_QuestObjectiveItem_OnUpdate - ---- Functions for generating and recycling the miscellaneous interface widgets specified by quests -local Wrapper = _G.VeneerObjectiveWrapper -local Scroller = Wrapper.scrollArea -local CloseButton = Wrapper.CloseButton -local QuestMapButton = Wrapper.QuestMapButton -local Scroll = _G.VeneerObjectiveScroll -local usedButtons = T.Quest.itemButtons -local freeButtons = T.Quest.freeButtons - -T.buttons = { - CloseButton = { - closedSwatch = { - [[Interface\Buttons\UI-Panel-QuestHideButton]], - [[Interface\Buttons\UI-Panel-QuestHideButton]], - 0, 0.5, 0.5, 1, - 0.5, 1, 0.5, 1, - }, - openSwatch = { - [[Interface\Buttons\UI-Panel-QuestHideButton]], - [[Interface\Buttons\UI-Panel-QuestHideButton]], - 0.5, 1, 0.5, 1, - 0, 0.5, 0.5, 1, - }, - parent = 'VeneerObjectiveWrapper' - }, - QuestMapButton = { - closedSwatch = { - [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]], - [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]], - 0, 1, 0.5, 1, - 0, 1, 0, 0.5, - }, - openSwatch = { - [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]], - [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]], - 0, 1, 0, 0.5, - 0, 1, 0.5, 1, - } - } -} - -local Scroller_OnShow = function() - Wrapper.watchMoneyReasons = 0; - --T:Update() - --T:OnInitialize() - for i, region in ipairs(Wrapper.headerComplex) do - region:Show() - end -end - -local Scroller_OnHide = function() - local self = Wrapper - Wrapper:UnregisterAllEvents() - Wrapper:SetScript('OnEvent', nil) - for i, region in ipairs(Wrapper.headerComplex) do - region:Hide() - end -end - -local Scroller_OnMouseWheel = function(self, delta) - local r = Scroll:GetHeight() - Scroller:GetHeight() - local s = B.Conf.ObjectiveScroll - delta * floor(r/5+.5) - local from = self:GetVerticalScroll() - print('|cFF00FF00OnMouseWheel', 'scroll =', s) - if s >= r then - s = r - elseif s < 1 then - s = 0 - end - self:SetVerticalScroll(s) - B.Conf.ObjectiveScroll = s - print('|cFF00FF00OnMouseWheel', 'from = ', from, 'scroll =', s, ' range =', r, 'current =', self:GetVerticalScroll()) - - T.UpdateActionButtons('SCROLLING') -end - -local UpdatePanelButton = function (self, state) - state = state or true - local swatch = (state == true) and self.openSwatch or self.closedSwatch - print((state ~= true) and 'closedSwatch' or 'openSwatch') - self:SetNormalTexture(swatch[1]) - self:SetPushedTexture(swatch[2]) - if #swatch >= 6 then - self:GetNormalTexture():SetTexCoord(swatch[3], swatch[4], swatch[5], swatch[6]) - end - if #swatch == 10 then - self:GetPushedTexture():SetTexCoord(swatch[7], swatch[8], swatch[9], swatch[10]) - end - -end - -local OnClick = {} -OnClick.CloseButton = function(self) - T:Enable() - if T.Conf.enabled then - T:Update() - end - - UpdatePanelButton(self, T.Conf.enabled) -end - -OnClick.QuestMapButton = function() - ToggleWorldMap() -end - ---- Get a usable widget for the given achievement criteria set. --- Returns a frame object with dimensioning parameters needed to size the receiving tracker block -local wr = T.WidgetRegistry -T.GetWidget = function(data, objectiveType, objectiveKey) - local print = B.print('ObjectiveWidgets') - local widgetType = objectiveType - local widget - local isNew - if wr[widgetType] and wr[widgetType].used[objectiveKey] then - widget = wr[widgetType].used[objectiveKey] - print('|cFF00FF00Updating ('..objectiveKey..')', widget) - elseif not wr[widgetType] or #wr[widgetType].free == 0 then - -- creating a new frame - isNew = true - widget = CreateFrame(widgetType, 'VeneerObjective' .. widgetType .. (wr[widgetType] and (wr[widgetType].lastn+1) or (1)), VeneerObjectiveScroll, 'VeneerObjectiveCriteria' .. widgetType) - print('|cFFFF0088Creating `'..widget:GetName()..'` id', wr[widgetType].lastn) - T.UpdateSchema(widgetType, data.schema or 'default') - else - -- recycling for a different criteria set - isNew = true - widget = tremove(wr[widgetType].free) - print('|cFFFFFF00Acquiring released widget', widget:GetName()) - end - - for k,v in pairs(data) do - if not widget[k] then - widget[k] = v - tprint('widget', widget:GetName(), k, v) - end - end - - wr[widgetType].used[objectiveKey] = widget - widget.objective = data - widget.key = objectiveKey - T.InitializeWidget(widget, isNew) - return widget -end - -local wr = T.WidgetRegistry ---- WidgetTemplate 'OnLoad' -T.RegisterWidget = function(frame) - local print = B.print('ObjectiveWidgets') - local widgetType = frame.widgetType - if not wr[frame.widgetType] then - print('|cFFFF4400[[WidgetTemplate]]|r', widgetType) - wr[widgetType] = { lastn = 1, free = {}, used = {}, usedIndex = {}, freeIndex = {} } - else - print('|cFF0088FF+ [[WidgetTemplate]]r', widgetType, wr[widgetType].lastn) - wr[widgetType].lastn = wr[widgetType].lastn + 1 - end -end - -T.InitializeWidgets = function() - local panelButtons = T.buttons - --- tracker scroll - Scroller:SetScript('OnMouseWheel', Scroller_OnMouseWheel) - Scroller:SetScript('OnShow', Scroller_OnShow) - Scroller:SetScript('OnHide', Scroller_OnHide) - for name, swatch in pairs(panelButtons) do - local source = swatch and swatch or panelButtons.CloseButton - local button = Wrapper[name] - button.parent = swatch.parent - button.openSwatch = source.openSwatch - button.closedSwatch = source.closedSwatch - if OnClick[name] then - button:SetScript('OnClick', OnClick[name]) - end - UpdatePanelButton(button, T.Conf.enabled) - end -end - ----------------------------------------------------------------------------------------- ---- modified version of the itemButton initializer used by Barjack's 'QuestKing 2' addon, ---- url: http://mods.curse.com/addons/wow/questking ----------------------------------------------------------------------------------------- -T.SetItemButton = function(block, info) - local itemInfo = info.specialItem - if not itemInfo then - return - end - - local itemButton - if not info.itemButton then - if #freeButtons >= 1 then - print(' |cFF00FFFFfound a free button') - itemButton = freeButtons[#freeButtons] - freeButtons[#freeButtons] = nil - if itemButton.block then - itemButton.block.itemButton = nil - itemButton.block = nil - end - else - local buttonIndex = T.Quest.numButtons + #freeButtons + 1 - itemButton = CreateFrame('Button', 'VeneerQuestItemButton' .. buttonIndex, UIParent, 'VeneerItemButtonTemplate') - itemButton.buttonIndex = buttonIndex - itemButton:SetSize(36, 36) - itemButton:GetNormalTexture():SetSize(36 * (5/3), 36 * (5/3)) - print(' |cFFFF4400starting new button', itemButton:GetName()) - end - T.Quest.numButtons = T.Quest.numButtons + 1 - else - itemButton = info.itemButton - print(' |cFF00FF00found assigned button', itemButton:GetName()) - - end - -- set values - - info.itemButton = itemButton - usedButtons[info.questID] = itemButton - print(' |cFF8800FFassigning|r', itemButton:GetName(), 'to quest|cFF00FF00', info.questID, '|rat|cFFFFFF00', block:GetName(),'|r') - - for k,v in pairs(usedButtons) do - print('|cFFFF44DD'..k..'|r', v:GetName()) - end - - itemButton:SetAttribute("type", "item") - itemButton:SetAttribute("item", itemInfo.link) - - itemButton.questID = info.questID - itemButton.logIndex = info.logIndex - itemButton.charges = itemInfo.charges - itemButton.rangeTimer = -1 - itemButton.block = block - - SetItemButtonTexture(itemButton, itemInfo.icon) - SetItemButtonCount(itemButton, itemInfo.charges) - Veneer_QuestObjectiveItem_UpdateCooldown(itemButton); - - return itemButton -end ---- Clear an itemButton from the given block -T.FreeItemButtons = function(block) - - if block.itemButton then - local itemButton = block.itemButton - if itemButton.questID ~= block.info.questID then - block.itemButton = nil - itemButton.block = T.Quest.InfoBlock[itemButton.questID] - else - itemButton.block = nil - itemButton:Hide() - - usedButtons[itemButton.questID] = nil - freeButtons[#freeButtons + 1] = itemButton - T.Quest.numButtons = T.Quest.numButtons - 1 - print('|cFFFF0088released', itemButton:GetName(),'and', block:GetName()) - end - end -end - -function Veneer_QuestObjectiveItem_OnUpdate (self, elapsed) - -- Handle range indicator - local rangeTimer = self.rangeTimer - if (rangeTimer) then - rangeTimer = rangeTimer - elapsed - if (rangeTimer <= 0) then - local link, item, charges, showItemWhenComplete = GetQuestLogSpecialItemInfo(self.logIndex) - if ((not charges) or (charges ~= self.charges)) then - T:Update() - return - end - - local count = self.HotKey - local valid = IsQuestLogSpecialItemInRange(self.logIndex) - if (valid == 0) then - count:Show() - count:SetVertexColor(1.0, 0.1, 0.1) - elseif (valid == 1) then - count:Show() - count:SetVertexColor(0.6, 0.6, 0.6) - else - count:Hide() - end - rangeTimer = TOOLTIP_UPDATE_TIME - end - - self.rangeTimer = rangeTimer - end -end - -function Veneer_QuestObjectiveItem_UpdateCooldown (itemButton) - local start, duration, enable = GetQuestLogSpecialItemCooldown(itemButton.logIndex) - if (start) then - CooldownFrame_SetTimer(itemButton.Cooldown, start, duration, enable) - if (duration > 0 and enable == 0) then - SetItemButtonTextureVertexColor(itemButton, 0.4, 0.4, 0.4) - else - SetItemButtonTextureVertexColor(itemButton, 1, 1, 1) - end - end -end -
--- a/ObjectiveTracker/Widgets.xml Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -<Ui> - <!-- houses objective widget templates --> - - <StatusBar name="VeneerObjectiveCriteriaStatusBar" drawLayer="BACKGROUND" virtual="true" hidden="true" minValue="0" maxValue="100" defaultValue="0"> - <Size x="100" y="30" /> - <Scripts> - <OnLoad> - self.widgetType = 'StatusBar' - Veneer.ObjectiveTracker.RegisterWidget(self) - </OnLoad> - <OnShow> - Veneer.ObjectiveTracker.InitializeWidget(self) - </OnShow> - <OnEvent> - - </OnEvent> - </Scripts> - <Layers> - <Layer level="ARTWORK"> - - <Texture parentKey="BorderLeft" file="Interface\PaperDollInfoFrame\UI-Character-Skills-BarBorder"> - <Size x="9" y="22"/> - <TexCoords left="0.007843" right="0.043137" top="0.193548" bottom="0.774193"/> - <Anchors> - <Anchor point="LEFT" x="-3" y="0" relativeKey="$parent.bg" /> - </Anchors> - </Texture> - <Texture parentKey="BorderRight" file="Interface\PaperDollInfoFrame\UI-Character-Skills-BarBorder"> - <Size x="9" y="22"/> - <TexCoords left="0.043137" right="0.007843" top="0.193548" bottom="0.774193"/> - <Anchors> - <Anchor point="RIGHT" x="3" y="0" relativeKey="$parent.bg"/> - </Anchors> - </Texture> - <Texture parentKey="BorderMid" file="Interface\PaperDollInfoFrame\UI-Character-Skills-BarBorder"> - <TexCoords left="0.113726" right="0.1490196" top="0.193548" bottom="0.774193"/> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent.BorderLeft" relativePoint="TOPRIGHT"/> - <Anchor point="BOTTOMRIGHT" relativeKey="$parent.BorderRight" relativePoint="BOTTOMLEFT"/> - </Anchors> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString name="$parentStatus" parentKey="status" inherits="VeneerActionNumberFont"> - <Anchors> - <Anchor point="CENTER" /> - </Anchors> - </FontString> - </Layer> - </Layers> - <BarTexture file="Interface\TargetingFrame\UI-StatusBar"/> - <BarColor r="0.26" g="0.42" b="1"/> - </StatusBar> - - <Frame name="VeneerObjectiveCriteriaEvent" virtual="true" hidden="true"> - <Size x="250" y="24" /> - <Scripts> - <OnLoad> - self.widgetType = 'Event' - self.lines = 1 - Veneer.ObjectiveTracker.RegisterWidget(self) - </OnLoad> - <OnShow> - Veneer.ObjectiveTracker.InitializeWidget(self) - </OnShow> - </Scripts> - <Layers> - <Layer level="OVERLAY"> - <FontString name="$parentStatusText" parentKey="status" inherits="VeneerCriteriaFont"> - - </FontString> - </Layer> - </Layers> - </Frame> - - <Frame name="VeneerObjectiveCriteriaHidden" virtual="true" hidden="true"> - <Size x="250" y="24" /> - <Scripts> - <OnLoad> - self.widgetType = 'Hidden' - self.lines = 0 - Veneer.ObjectiveTracker.RegisterWidget(self) - </OnLoad> - <OnShow> - Veneer.ObjectiveTracker.InitializeWidget(self) - </OnShow> - </Scripts> - <Layers> - <Layer level="OVERLAY"> - <FontString name="$parentStatusText" parentKey="status" inherits="VeneerCriteriaFont"> - - </FontString> - </Layer> - </Layers> - </Frame> -</Ui> \ No newline at end of file
--- a/TimeManager/TimeManager.lua Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ --------------------------------------------- --- Veneer --- Clock/Coordinate multi-tool --- mouseover reveals coordinates by map yards, right-click toggles display --- Krakyn --- @project-revision@ @project-hash@ --- @file-revision@ @file-hash@ --- Created: 4/27/2016 1:02 AM --------------------------------------------- - -local B = select(2,...).frame -local _G = _G -local clock = B:RegisterModule("Clock", _G.VeneerClock) -local print = B.print('XML') -- debug hook --- weekday abbreviations used in display -local weekDays = {'Su', 'M', 'T', 'W', 'R' ,'F', 'Sa' } -local months = {'JA', 'FB', 'MR', 'AP', 'MY', 'JN', 'JL', 'AG', 'SP', 'OC', 'NV', 'DC'} - --- runs when visible -clock.OnUpdate = function(self) - local weekday, month, day, year = _G.CalendarGetDate() - local hour, min = _G.GetGameTime() - if hour > 12 then - hour = hour - 12 - end - local posFunc, posF = _G.GetPlayerMapPosition, 100 - local posFormat = "|cFF00FFFF%0.1f %0.1f|r" - if self:IsMouseOver() then - posFunc = _G.UnitPosition - posFormat = "yds |cFFFFFF00%d %d|r" - posF = 1 - end - - local posX, posY = posFunc('player') - self.coords:SetFormattedText(posFormat, posX * posF, posY * posF) - self.time:SetFormattedText("%s |cFF44FFFF%s|r|c88FFFFFF%s|r %d:%02d", weekDays[weekday], day, months[month], hour, min) -end - --- hide/show toggler -clock.OnMouseUp = function(self, button) - if button == 'RightButton' then - if self:IsVisible() then - self:Hide() - else - self:Show() - end - end -end - --- runs once per login -function clock:OnInitialize() - print('clock thing') - self:Show() -end - --- runs once per ui load -clock.OnEnable = function(self) - self:SetParent(_G.UIParent) - self:SetScript('OnUpdate', clock.OnUpdate) - self:Show() - self.time:SetText('Clock stuff') -end - -clock.Open = function(self) -end -clock.Close = function(self) -end \ No newline at end of file
--- a/TimeManager/TimeManager.xml Mon Aug 15 09:35:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - - - <Frame name="VeneerClock" parent="UIParent" hidden="false" clampedToScreen="true"> - <Scripts> - <OnLoad> - self.drag = true - self.toggle = true - Veneer.RegisterModuleFrame(self, 'Clock') - </OnLoad> - </Scripts> - <Size x="280" y="16" /> - <Layers> - <Layer level="OVERLAY"> - <FontString font="Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf" parentKey="time" text="GAME_TIME" outline="NORMAL"> - <FontHeight> - <AbsValue val="14" /> - </FontHeight> - - <Anchors> - <Anchor point="RIGHT" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - </FontString> - <FontString font="Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf" parentKey="coords" text="MAP_COORDS" outline="NORMAL"> - <FontHeight> - <AbsValue val="14" /> - </FontHeight> - - <Anchors> - <Anchor point="RIGHT" relativePoint="LEFT" relativeKey="$parent.time" /> - </Anchors> - <Color r="1" g="1" b="1" a="1" /> - </FontString> - </Layer> - </Layers> - </Frame> - - <Script file="TimeManager.lua" /> - - </Ui> \ No newline at end of file
--- a/Veneer.lua Mon Aug 15 09:35:46 2016 -0400 +++ b/Veneer.lua Tue Aug 16 08:37:07 2016 -0400 @@ -24,4 +24,5 @@ VeneerData = defaults end vn.db = VeneerData + end \ No newline at end of file
--- a/Veneer.toc Mon Aug 15 09:35:46 2016 -0400 +++ b/Veneer.toc Tue Aug 16 08:37:07 2016 -0400 @@ -10,4 +10,6 @@ ## OptionalDeps: Devian Veneer.xml -Modules\BuffFrame.lua \ No newline at end of file +Modules\BuffFrame.lua +Modules\PaperDoll.lua +Modules\ObjectiveTracker.lua \ No newline at end of file
--- a/Veneer.xml Mon Aug 15 09:35:46 2016 -0400 +++ b/Veneer.xml Tue Aug 16 08:37:07 2016 -0400 @@ -15,6 +15,7 @@ </Anchors> <Scripts> <OnLoad> + self.DEVIAN_PNAME = 'Veneer' self:RegisterForDrag('LeftButton') </OnLoad> <OnDragStart> @@ -84,26 +85,6 @@ </Frames> </Frame> - <Button name="VeneerAuraButton" inherits="SecureActionButtonTemplate" virtual="true"> - <Size x="32" y="32" /> - <Layers> - <Layer level="ARTWORK"> - <FontString inherits="VeneerFont_Small" parentKey="label"> - <Anchors> - <Anchor point="LEFT" /> - </Anchors> - </FontString> - </Layer> - </Layers> - <NormalTexture setAllPoints="true"> - - <Color a="1" r="1" g="1" b="1" /> - </NormalTexture> - <PushedTexture setAllPoints="true"> - - <Color a="1" r="1" g="0" b="0" /> - </PushedTexture> - </Button> <Script file="Veneer.lua" />