view ObjectiveTracker/Events.lua @ 32:a3afe6c3771e

- organize and display reward icons as a background hint - centralize reward data function
author Nenue
date Fri, 15 Apr 2016 07:01:40 -0400
parents 48b3e3959a0a
children 9856ebc63fa4
line wrap: on
line source
--- ${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')

-------------------------------------------------------------------
--- SecureHooked blizzard functions
-------------------------------------------------------------------
T.AddQuestWatch = function(questID)
    T:Update(0x00000003)
end

local Quest = T.Quest
T.RemoveQuestWatch = function(questIndex, ...)
  print('|cFFFF8800RemoveQuestWatch', questIndex, ...)

  local info = T.Quest.LogInfo[questIndex]

  -- remove quest refs
  local block = Quest.QuestBlock[info.questID]
  Quest.QuestBlock[info.questID] = nil
  Quest.LogBlock[questIndex] = nil

  -- remove if they still match
  if Quest.WatchInfo[info.watchIndex] == info then
    print('cleaning dead WatchInfo entry')
    Quest.WatchInfo[info.watchIndex] = nil
  end
  if Quest.itemButtons[info.questID] then
    -- hide for now, it will get cleaned up shortly
    Quest.itemButtons[info.questID]:Hide()
  end

  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST)
end

T.AddTrackedAchievement = function(cheevID)
  T.CleanWidgets()
  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT)
end


T.RemoveTrackedAchievement = function(cheevID)
  print('|cFFFF8800UntrackAchievement', cheevID)
  T.CleanWidgets()
  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT)
end

T.AcceptQuest = function()
  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST_ADDED)
end

T.AbandonQuest = function()
  QuestPOIUpdateIcons()
  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST)
end
T.TurnInQuest = function()
  QuestPOIUpdateIcons()
  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST)
end
T.AddAutoQuestPopUp = function(...)
   T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP)
end
T.RemoveAutoQuestPopUp = function(...)
  T:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP)
end



T.SetSuperTrackedQuestID = function(questID)
  --T:Update()
end