annotate ObjectiveTracker/Achievements.lua @ 28:c33c17dd97e7

file renames
author Nenue
date Wed, 13 Apr 2016 20:19:37 -0400
parents
children adcd7c328d07
rev   line source
Nenue@28 1 --- ${PACKAGE_NAME}
Nenue@28 2 -- @file-author@
Nenue@28 3 -- @project-revision@ @project-hash@
Nenue@28 4 -- @file-revision@ @file-hash@
Nenue@28 5 -- Created: 4/13/2016 7:48 PM
Nenue@28 6 local B = select(2,...).frame
Nenue@28 7 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@28 8 local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band
Nenue@28 9 local GetAutoQuestPopUp, GetQuestLogCompletionText = GetAutoQuestPopUp, GetQuestLogCompletionText
Nenue@28 10 local Cheevs = T.Cheevs
Nenue@28 11 local format = format
Nenue@28 12 local print = B.print('Tracker')
Nenue@28 13 local lprint = B.print('Line')
Nenue@28 14 local iprint = B.print('Info')
Nenue@28 15
Nenue@28 16
Nenue@28 17
Nenue@28 18 Cheevs.UpdateLine = function(handler, block, line, data)
Nenue@28 19 local print = B.print('CheevsLine')
Nenue@28 20 line.progress = 0
Nenue@28 21 print(' ', data.objectiveIndex,'|cFF0088FF-|r', data.objectiveType, data.text)
Nenue@28 22 if data.flags then
Nenue@28 23 if band(data.flags, 0x00000001) > 0 then
Nenue@28 24 line.format = "%d/%d"
Nenue@28 25 line.widget = T.SetWidget(line, data, 'ProgressBar', data.criteriaID)
Nenue@28 26 line.height = line.widget.height
Nenue@28 27 elseif band(data.flags, 0x00000002) then
Nenue@28 28 line.widget = nil
Nenue@28 29 else
Nenue@28 30 line.widget = nil
Nenue@28 31 line.displayColor = 'FFFFFF'
Nenue@28 32 line.displayText = line.text
Nenue@28 33
Nenue@28 34 end
Nenue@28 35 else
Nenue@28 36
Nenue@28 37 line.displayText = data.text
Nenue@28 38 end
Nenue@28 39 print('line.type =', data.type)
Nenue@28 40 print(' ** qtyStr:', data.quantityString, 'qty:', data.quantity, 'assetID:', data.assetID)
Nenue@28 41 end
Nenue@28 42
Nenue@28 43 Cheevs.Select = function(self)
Nenue@28 44 --mod:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT)
Nenue@28 45 end
Nenue@28 46 Cheevs.Remove = function(self)
Nenue@28 47
Nenue@28 48 RemoveTrackedAchievement(self.info.cheevID)
Nenue@28 49 end
Nenue@28 50 Cheevs.OnMouseUp = function(self, button)
Nenue@28 51
Nenue@28 52 Default.OnMouseUp(self, button)
Nenue@28 53 end
Nenue@28 54 Cheevs.Link = function(self)
Nenue@28 55
Nenue@28 56 local achievementLink = GetAchievementLink(self.info.cheevID);
Nenue@28 57 if ( achievementLink ) then
Nenue@28 58 ChatEdit_InsertLink(achievementLink);
Nenue@28 59 end
Nenue@28 60 end
Nenue@28 61
Nenue@28 62 Cheevs.Open = function(self)
Nenue@28 63
Nenue@28 64 if ( not AchievementFrame ) then
Nenue@28 65 AchievementFrame_LoadUI();
Nenue@28 66 end
Nenue@28 67 if ( not AchievementFrame:IsShown() ) then
Nenue@28 68 AchievementFrame_ToggleAchievementFrame();
Nenue@28 69 end
Nenue@28 70 AchievementFrame_SelectAchievement(self.info.cheevID);
Nenue@28 71 end