Nenue@40
|
1
|
Nenue@40
|
2 local print = DEVIAN_WORKSPACE and function(...) print('ClassPlan', ...) end or nop
|
Nenue@40
|
3 local c = {
|
Nenue@40
|
4
|
Nenue@40
|
5 templateName = 'ClassPlanShipmentEntry',
|
Nenue@95
|
6 listKey = {'followers','troops'},
|
Nenue@40
|
7 listTitle = {'Followers'},
|
Nenue@40
|
8 events = {
|
Nenue@40
|
9 'GARRISON_FOLLOWER_LIST_UPDATE',
|
Nenue@40
|
10 'GARRISON_FOLLOWER_XP_CHANGED',
|
Nenue@40
|
11 'GARRISON_FOLLOWER_DURABILITY_CHANGED',
|
Nenue@40
|
12 'GARRISON_FOLLOWER_UPGRADED',
|
Nenue@40
|
13 'GARRISON_FOLLOWER_REMOVED'
|
Nenue@40
|
14 }
|
Nenue@40
|
15 }
|
Nenue@40
|
16
|
Nenue@40
|
17
|
Nenue@40
|
18 function c:OnLoad()
|
Nenue@95
|
19 print('Followers:OnLoad()')
|
Nenue@40
|
20 self.followerType = 4
|
Nenue@40
|
21 -- follower type, versus garrison_type
|
Nenue@40
|
22 end
|
Nenue@40
|
23
|
Nenue@40
|
24 function c:OnEvent(event, ...)
|
Nenue@40
|
25 print('|cFF00FF00'..self:GetName()..':OnEvent()|r', event, ...)
|
Nenue@40
|
26 self:GetPlayerData()
|
Nenue@40
|
27 end
|
Nenue@40
|
28
|
Nenue@40
|
29 function c:OnUpdate() end
|
Nenue@40
|
30
|
Nenue@40
|
31 function c:GetPlayerData()
|
Nenue@40
|
32
|
Nenue@40
|
33 print('|cFF0088FF'..self:GetName()..':GetPlayerData()|r')
|
Nenue@40
|
34 local profileList = self:GetParent().profile.followers
|
Nenue@95
|
35 local troopList = self:GetParent().profile.troops
|
Nenue@95
|
36
|
Nenue@40
|
37 local followerInfo = C_Garrison.GetFollowers(self.followerType)
|
Nenue@95
|
38
|
Nenue@95
|
39
|
Nenue@40
|
40 if followerInfo then
|
Nenue@40
|
41 table.wipe(profileList)
|
Nenue@40
|
42 for followerID, follower in pairs(followerInfo) do
|
Nenue@95
|
43 print(FOLLOWER_QUALITY_COLORS[follower.quality].hex, follower.name, follower.isTroop)
|
Nenue@95
|
44 if follower.isTroop then
|
Nenue@95
|
45 troopList[followerID] = follower
|
Nenue@95
|
46 else
|
Nenue@95
|
47 print(follower.isMaxLevel, follower.xp, follower.levelXP, follower.iLevel)
|
Nenue@95
|
48
|
Nenue@95
|
49 profileList[followerID] = follower
|
Nenue@95
|
50 end
|
Nenue@95
|
51
|
Nenue@95
|
52
|
Nenue@40
|
53 profileList[followerID] = follower
|
Nenue@40
|
54 end
|
Nenue@40
|
55 end
|
Nenue@33
|
56
|
Nenue@33
|
57 end
|
Nenue@33
|
58
|
Nenue@40
|
59 function c:UpdateItems()
|
Nenue@95
|
60
|
Nenue@95
|
61 local profileList = self:GetParent().profile.followers
|
Nenue@95
|
62
|
Nenue@95
|
63 local troopList = self:GetParent().profile.troops
|
Nenue@95
|
64
|
Nenue@95
|
65
|
Nenue@95
|
66
|
Nenue@40
|
67 end
|
Nenue@40
|
68 function c:Reanchor()
|
Nenue@40
|
69 end
|
Nenue@33
|
70
|
Nenue@33
|
71
|
Nenue@40
|
72 ClassPlanFollowerMixin = CreateFromMixins(ClassPlanHandlerBase, c) |