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