Mercurial > wow > worldplan
comparison ClassPlanFollowers.lua @ 40:589c444d4837
WowAce/Curseforge migration push
author | Nenue |
---|---|
date | Sun, 25 Dec 2016 13:04:57 -0500 |
parents | 26dfa661daa7 |
children | b29b35cb8539 |
comparison
equal
deleted
inserted
replaced
39:89ddef0594bc | 40:589c444d4837 |
---|---|
1 ClassPlanFollowerMixin = {} | 1 |
2 local c = ClassPlanFollowerMixin | 2 local print = DEVIAN_WORKSPACE and function(...) print('ClassPlan', ...) end or nop |
3 function c:OnEvent(event, arg) | 3 local c = { |
4 | |
5 templateName = 'ClassPlanShipmentEntry', | |
6 listKey = {'followers'}, | |
7 listTitle = {'Followers'}, | |
8 events = { | |
9 'GARRISON_FOLLOWER_LIST_UPDATE', | |
10 'GARRISON_FOLLOWER_XP_CHANGED', | |
11 'GARRISON_FOLLOWER_DURABILITY_CHANGED', | |
12 'GARRISON_FOLLOWER_UPGRADED', | |
13 'GARRISON_FOLLOWER_REMOVED' | |
14 } | |
15 } | |
16 | |
17 | |
18 function c:OnLoad() | |
19 self.followerType = 4 | |
20 -- follower type, versus garrison_type | |
21 end | |
22 | |
23 function c:OnEvent(event, ...) | |
24 print('|cFF00FF00'..self:GetName()..':OnEvent()|r', event, ...) | |
25 self:GetPlayerData() | |
26 end | |
27 | |
28 function c:OnUpdate() end | |
29 | |
30 function c:GetPlayerData() | |
31 | |
32 print('|cFF0088FF'..self:GetName()..':GetPlayerData()|r') | |
33 local profileList = self:GetParent().profile.followers | |
34 local followerInfo = C_Garrison.GetFollowers(self.followerType) | |
35 if followerInfo then | |
36 table.wipe(profileList) | |
37 for followerID, follower in pairs(followerInfo) do | |
38 profileList[followerID] = follower | |
39 end | |
40 end | |
4 | 41 |
5 end | 42 end |
6 | 43 |
7 function c:GetPlayerData(event, arg) end | 44 function c:UpdateItems() |
45 end | |
46 function c:Reanchor() | |
47 end | |
8 | 48 |
9 function c:UpdateItems() end | |
10 | 49 |
11 function c:Reanchor() end | 50 ClassPlanFollowerMixin = CreateFromMixins(ClassPlanHandlerBase, c) |