comparison ObjectiveTracker/QuestData.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 756e8aeb040b
children aa693607b813
comparison
equal deleted inserted replaced
44:756e8aeb040b 45:dd1ae565f559
51 elseif info.isWeekly then 51 elseif info.isWeekly then
52 print(' weekly', info.frequency) 52 print(' weekly', info.frequency)
53 block_schema = 'weekly' 53 block_schema = 'weekly'
54 end 54 end
55 local completionText 55 local completionText
56 if info.isComplete then 56
57 if info.isAutoComplete and info.isComplete then
58 displayObjectives = false
59 info.numObjectives = 1
60 self:AddLine(block, info.completionText, nil, 'complete')
61 elseif info.isComplete then
57 if T.Conf.ShowCompletionText then 62 if T.Conf.ShowCompletionText then
58 self:AddLine(block, info.completionText, nil, 'complete') 63 self:AddLine(block, info.completionText, nil, 'complete')
64 displayObjectives = false
59 end 65 end
60 if not T.Conf.ShowObjectivesWhenComplete then 66 if not T.Conf.ShowObjectivesWhenComplete then
61 displayObjectives = false 67 displayObjectives = false
62 end 68 end
63 print('|cFF'..self.internalColor..' :: complete quest :: show instruction: "'.. tostring(info.completionText) .. '"') 69 print('|cFF'..self.internalColor..' :: complete quest :: show instruction: "'.. tostring(info.completionText) .. '"')
64 block_schema = 'complete' 70 block_schema = 'complete'
65 end 71 end
72
66 73
67 Default.UpdateObjectives(self, block, block_schema, displayObjectives) 74 Default.UpdateObjectives(self, block, block_schema, displayObjectives)
68 return 0, block_schema 75 return 0, block_schema
69 end 76 end
70 77
164 171
165 --- After GetInfo pass, look for any non-conformant blocks and deal with them 172 --- After GetInfo pass, look for any non-conformant blocks and deal with them
166 for index, block in ipairs(self.usedBlocks) do 173 for index, block in ipairs(self.usedBlocks) do
167 174
168 local logIndex = GetQuestLogIndexByID(block.info.questID, 'player') 175 local logIndex = GetQuestLogIndexByID(block.info.questID, 'player')
169 print('GetNumWatched', '|cFFFF4400'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex or '|cFF444444-|r')
170 -- animating blocks have been evaluated 176 -- animating blocks have been evaluated
171 if not block.isAnimating then 177 if not block.isAnimating then
172 if not logIndex then 178 if not logIndex then
173 self:ClearBlock(block) 179 self:ClearBlock(block)
174 print('GetNumWatched', 'trim dropped quest', block:GetName()) 180 print('GetNumWatched', '|cFF44FF00'.. index, (block and block:GetName() or '|cFFFF0000-|r'), '(trim not active)')
175 elseif not IsQuestWatched(block.info.logIndex) then 181 elseif not IsQuestWatched(block.info.logIndex) then
176 self:ClearBlock(block) 182 self:ClearBlock(block)
177 print('GetNumWatched', 'trim untracked quest', block:GetName()) 183 print('GetNumWatched', '|cFFFF4400'.. index, (block and block:GetName() or '|cFFFF0000-|r'), '(trim non-watched)')
178 end 184 else
185 print('GetNumWatched', '|cFF0088FF'.. index, (block and block:GetName() or '|cFFFF0000-|r'), logIndex or '|cFF444444-|r')
186 end
187 else
188
189 print('GetNumWatched', '|cFF00FFFF'.. index, (block and block:GetName() or '|cFFFF0000-|r'), ' (animating)')
179 end 190 end
180 end 191 end
181 192
182 self.numWatched = numWatched 193 self.numWatched = numWatched
183 self.numAll = numAll 194 self.numAll = numAll
264 local isSequenced = IsQuestSequenced(questID) 275 local isSequenced = IsQuestSequenced(questID)
265 local temp_status = '' 276 local temp_status = ''
266 if ( isComplete ) then 277 if ( isComplete ) then
267 temp_status = 'COMPLETED_OBJECTIVES' 278 temp_status = 'COMPLETED_OBJECTIVES'
268 --objectives = Quest.GetObjectives(logIndex, numObjectives, true, isSequenced, isStory) 279 --objectives = Quest.GetObjectives(logIndex, numObjectives, true, isSequenced, isStory)
269 q.objectives = objectives
270 if ( isAutoComplete ) then 280 if ( isAutoComplete ) then
271 temp_status = 'AUTOCOMPLETE_OBJECTIVES' 281 temp_status = 'AUTOCOMPLETE_OBJECTIVES'
272 completionText = _G.QUEST_WATCH_CLICK_TO_COMPLETE 282 completionText = _G.QUEST_WATCH_CLICK_TO_COMPLETE
273 else 283 else
274 if ( isBreadcrumb ) then 284 if ( isBreadcrumb ) then
276 completionText = GetQuestLogCompletionText(logIndex) 286 completionText = GetQuestLogCompletionText(logIndex)
277 else 287 else
278 temp_status = 'COMPLETE_READY_FOR_TURN_IN' 288 temp_status = 'COMPLETE_READY_FOR_TURN_IN'
279 completionText = _G.QUEST_WATCH_QUEST_READY 289 completionText = _G.QUEST_WATCH_QUEST_READY
280 end 290 end
291 end
292 if not T.Conf.ShowObjectivesWhenComplete then
293 q.objectives = {}
281 end 294 end
282 elseif ( questFailed ) then 295 elseif ( questFailed ) then
283 temp_status = 'FAILED' 296 temp_status = 'FAILED'
284 -- Case 2: failed quest 297 -- Case 2: failed quest
285 -- * 1 status line; hide other info 298 -- * 1 status line; hide other info