Mercurial > wow > buffalo2
view ObjectiveTracker/RewardFrame.lua @ 45:dd1ae565f559
Hooks and Handlers:
- correct argument mix-ups for AcceptQuest/QUEST_ACCEPTED handlers; fixes auto-watch
- respond to AcknowledgeAutoAcceptQuest; fixes lingering popups
- include Popup and Quest trackers in the response code for CompleteQuest; fixes content artifacts following the rollover of repeating popups seen in Ashran
- clean up wacky OnEvent header
Layout
- add alpha blend options
QuestData
- reset objectives data when a quest is in a completed state; keeps old data from ever reaching the Default.x code
author | Nenue |
---|---|
date | Tue, 26 Apr 2016 14:57:18 -0400 |
parents | 03ed70f846de |
children |
line wrap: on
line source
--- ${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