Mercurial > wow > buffalo2
diff ObjectiveTracker.lua @ 2:a2396b03ce63
- identify action buttons by the associated QuestID instead of QuestLogIndex
- deferred button placement in general to a self-destructing OnUpdate
-- and defer self-destruct to a end of combat event if InCombatLockdown
- tracker wrapper has an experience/reputation bar; the two elements "feel" related and it's a very simple info display
author | Nenue |
---|---|
date | Thu, 31 Mar 2016 01:38:47 -0400 |
parents | b0447b382f36 |
children | 3397aae1f44d |
line wrap: on
line diff
--- a/ObjectiveTracker.lua Wed Mar 30 16:30:49 2016 -0400 +++ b/ObjectiveTracker.lua Thu Mar 31 01:38:47 2016 -0400 @@ -151,6 +151,7 @@ Tracker.BlockInfo = {} -- find by block ID Tracker.LogInfo = {} -- find by log ID (quest log mainly) Tracker.WatchBlock = {} +Tracker.WatchInfo = {} Tracker.LogBlock = {} @@ -172,11 +173,13 @@ return handler.usedBlocks[blockIndex] end local SmallEvents = { - QUEST_ACCEPTED = 'OnQuestAccepted' + QUEST_ACCEPTED = 'OnQuestAccepted', + QUEST_REMOVED = 'OnQuestRemoved' } local HandlerEvents = { QUEST_ACCEPTED = mod.Quest, + QUEST_REMOVED = mod.Quest, QUEST_WATCH_LIST_CHANGED = mod.Quest, SUPER_TRACKED_QUEST_CHANGED = mod.Quest, QUEST_LOG_UPDATE = mod.Quest, @@ -206,19 +209,25 @@ end end -function mod:OnInitialize() - self.InitializeTrackers() +mod.SetEvents = function() + for event, _ in pairs(SmallEvents) do - self:RegisterEvent(event) + mod:RegisterEvent(event) end for event, _ in pairs(HandlerEvents) do - self:RegisterEvent(event) + mod:RegisterEvent(event) end - self:SetScript('OnEvent', mod.OnEvent) + mod:SetScript('OnEvent', mod.OnEvent) +end +function mod:OnInitialize() + self.InitializeTrackers() + + mod.SetEvents() ObjectiveTrackerFrame:UnregisterAllEvents() ObjectiveTrackerFrame:Hide() + end --[[