annotate ClassPlanFollowers.lua @ 83:a611cf505278

Added tag v1.4.4 for changeset 26d736fbfe67
author Nenue
date Mon, 10 Apr 2017 17:29:46 -0400
parents 589c444d4837
children b29b35cb8539
rev   line source
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@40 6 listKey = {'followers'},
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@40 19 self.followerType = 4
Nenue@40 20 -- follower type, versus garrison_type
Nenue@40 21 end
Nenue@40 22
Nenue@40 23 function c:OnEvent(event, ...)
Nenue@40 24 print('|cFF00FF00'..self:GetName()..':OnEvent()|r', event, ...)
Nenue@40 25 self:GetPlayerData()
Nenue@40 26 end
Nenue@40 27
Nenue@40 28 function c:OnUpdate() end
Nenue@40 29
Nenue@40 30 function c:GetPlayerData()
Nenue@40 31
Nenue@40 32 print('|cFF0088FF'..self:GetName()..':GetPlayerData()|r')
Nenue@40 33 local profileList = self:GetParent().profile.followers
Nenue@40 34 local followerInfo = C_Garrison.GetFollowers(self.followerType)
Nenue@40 35 if followerInfo then
Nenue@40 36 table.wipe(profileList)
Nenue@40 37 for followerID, follower in pairs(followerInfo) do
Nenue@40 38 profileList[followerID] = follower
Nenue@40 39 end
Nenue@40 40 end
Nenue@33 41
Nenue@33 42 end
Nenue@33 43
Nenue@40 44 function c:UpdateItems()
Nenue@40 45 end
Nenue@40 46 function c:Reanchor()
Nenue@40 47 end
Nenue@33 48
Nenue@33 49
Nenue@40 50 ClassPlanFollowerMixin = CreateFromMixins(ClassPlanHandlerBase, c)