Mercurial > wow > buffalo2
comparison 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 |
comparison
equal
deleted
inserted
replaced
1:b0447b382f36 | 2:a2396b03ce63 |
---|---|
149 Tracker.Watched = {} -- find by watchIndex | 149 Tracker.Watched = {} -- find by watchIndex |
150 Tracker.Info = {} -- find by data ID | 150 Tracker.Info = {} -- find by data ID |
151 Tracker.BlockInfo = {} -- find by block ID | 151 Tracker.BlockInfo = {} -- find by block ID |
152 Tracker.LogInfo = {} -- find by log ID (quest log mainly) | 152 Tracker.LogInfo = {} -- find by log ID (quest log mainly) |
153 Tracker.WatchBlock = {} | 153 Tracker.WatchBlock = {} |
154 Tracker.WatchInfo = {} | |
154 Tracker.LogBlock = {} | 155 Tracker.LogBlock = {} |
155 | 156 |
156 | 157 |
157 | 158 |
158 Tracker.GetBlock = function(handler, blockIndex) | 159 Tracker.GetBlock = function(handler, blockIndex) |
170 handler.usedBlocks[blockIndex] = block | 171 handler.usedBlocks[blockIndex] = block |
171 end | 172 end |
172 return handler.usedBlocks[blockIndex] | 173 return handler.usedBlocks[blockIndex] |
173 end | 174 end |
174 local SmallEvents = { | 175 local SmallEvents = { |
175 QUEST_ACCEPTED = 'OnQuestAccepted' | 176 QUEST_ACCEPTED = 'OnQuestAccepted', |
177 QUEST_REMOVED = 'OnQuestRemoved' | |
176 } | 178 } |
177 | 179 |
178 local HandlerEvents = { | 180 local HandlerEvents = { |
179 QUEST_ACCEPTED = mod.Quest, | 181 QUEST_ACCEPTED = mod.Quest, |
182 QUEST_REMOVED = mod.Quest, | |
180 QUEST_WATCH_LIST_CHANGED = mod.Quest, | 183 QUEST_WATCH_LIST_CHANGED = mod.Quest, |
181 SUPER_TRACKED_QUEST_CHANGED = mod.Quest, | 184 SUPER_TRACKED_QUEST_CHANGED = mod.Quest, |
182 QUEST_LOG_UPDATE = mod.Quest, | 185 QUEST_LOG_UPDATE = mod.Quest, |
183 TRACKED_ACHIEVEMENT_LIST_CHANGED = mod.Cheevs, | 186 TRACKED_ACHIEVEMENT_LIST_CHANGED = mod.Cheevs, |
184 TRACKED_ACHIEVEMENT_UPDATE = mod.Cheevs | 187 TRACKED_ACHIEVEMENT_UPDATE = mod.Cheevs |
204 frame_guide_init(Scroller) | 207 frame_guide_init(Scroller) |
205 frame_guide(Scroller, Scroller) | 208 frame_guide(Scroller, Scroller) |
206 end | 209 end |
207 end | 210 end |
208 | 211 |
212 mod.SetEvents = function() | |
213 | |
214 for event, _ in pairs(SmallEvents) do | |
215 mod:RegisterEvent(event) | |
216 end | |
217 | |
218 for event, _ in pairs(HandlerEvents) do | |
219 mod:RegisterEvent(event) | |
220 end | |
221 mod:SetScript('OnEvent', mod.OnEvent) | |
222 end | |
223 | |
209 function mod:OnInitialize() | 224 function mod:OnInitialize() |
210 self.InitializeTrackers() | 225 self.InitializeTrackers() |
211 for event, _ in pairs(SmallEvents) do | 226 |
212 self:RegisterEvent(event) | 227 mod.SetEvents() |
213 end | |
214 | |
215 for event, _ in pairs(HandlerEvents) do | |
216 self:RegisterEvent(event) | |
217 end | |
218 self:SetScript('OnEvent', mod.OnEvent) | |
219 | |
220 ObjectiveTrackerFrame:UnregisterAllEvents() | 228 ObjectiveTrackerFrame:UnregisterAllEvents() |
221 ObjectiveTrackerFrame:Hide() | 229 ObjectiveTrackerFrame:Hide() |
230 | |
222 end | 231 end |
223 | 232 |
224 --[[ | 233 --[[ |
225 QUESTLINE_UPDATE This event is not yet documented | 234 QUESTLINE_UPDATE This event is not yet documented |
226 QUESTTASK_UPDATE This event is not yet documented | 235 QUESTTASK_UPDATE This event is not yet documented |