Mercurial > wow > buffalo2
diff ObjectiveTracker/AutoQuestPopups.lua @ 28:c33c17dd97e7
file renames
author | Nenue |
---|---|
date | Wed, 13 Apr 2016 20:19:37 -0400 |
parents | |
children | adcd7c328d07 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ObjectiveTracker/AutoQuestPopups.lua Wed Apr 13 20:19:37 2016 -0400 @@ -0,0 +1,34 @@ +--- ${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 _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band +local ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp = ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp +local lprint = B.print('Line') +local AutoQuest = T.AutoQuest + +--- They are not exactly quests, but the aliases used to signal that a quest was pushed into your log by the environment. +-- Once accepted they never appear again unless the quest is dropped (daily reset/abandon quest) +local CLICK_TO_COMPLETE = 'Click to Complete' +local CLICK_TO_ACCEPT = 'Click to Accept' +AutoQuest.UpdateObjectives = function(handler, block) + local print = lprint + if block.info.type == 'OFFER' then + block.status:SetText(CLICK_TO_ACCEPT) + end +end + +AutoQuest.Select = function(self) + + if self.info.popupType == 'OFFER' then + ShowQuestOffer(self.info.questIndex) + else + ShowQuestComplete(self.info.questIndex) + end + RemoveAutoQuestPopUp(self.info.questID) +end + +AutoQuest.Link = T.Quest.Link