Nenue@40: Nenue@40: local print = DEVIAN_WORKSPACE and function(...) print('ClassPlan', ...) end or nop Nenue@40: local c = { Nenue@40: Nenue@40: templateName = 'ClassPlanShipmentEntry', Nenue@95: listKey = {'followers','troops'}, Nenue@40: listTitle = {'Followers'}, Nenue@40: events = { Nenue@40: 'GARRISON_FOLLOWER_LIST_UPDATE', Nenue@40: 'GARRISON_FOLLOWER_XP_CHANGED', Nenue@40: 'GARRISON_FOLLOWER_DURABILITY_CHANGED', Nenue@40: 'GARRISON_FOLLOWER_UPGRADED', Nenue@40: 'GARRISON_FOLLOWER_REMOVED' Nenue@40: } Nenue@40: } Nenue@40: Nenue@40: Nenue@40: function c:OnLoad() Nenue@95: print('Followers:OnLoad()') Nenue@40: self.followerType = 4 Nenue@40: -- follower type, versus garrison_type Nenue@40: end Nenue@40: Nenue@40: function c:OnEvent(event, ...) Nenue@40: print('|cFF00FF00'..self:GetName()..':OnEvent()|r', event, ...) Nenue@40: self:GetPlayerData() Nenue@40: end Nenue@40: Nenue@40: function c:OnUpdate() end Nenue@40: Nenue@40: function c:GetPlayerData() Nenue@40: Nenue@40: print('|cFF0088FF'..self:GetName()..':GetPlayerData()|r') Nenue@40: local profileList = self:GetParent().profile.followers Nenue@95: local troopList = self:GetParent().profile.troops Nenue@95: Nenue@40: local followerInfo = C_Garrison.GetFollowers(self.followerType) Nenue@95: Nenue@95: Nenue@40: if followerInfo then Nenue@40: table.wipe(profileList) Nenue@40: for followerID, follower in pairs(followerInfo) do Nenue@95: print(FOLLOWER_QUALITY_COLORS[follower.quality].hex, follower.name, follower.isTroop) Nenue@95: if follower.isTroop then Nenue@95: troopList[followerID] = follower Nenue@95: else Nenue@95: print(follower.isMaxLevel, follower.xp, follower.levelXP, follower.iLevel) Nenue@95: Nenue@95: profileList[followerID] = follower Nenue@95: end Nenue@95: Nenue@95: Nenue@40: profileList[followerID] = follower Nenue@40: end Nenue@40: end Nenue@33: Nenue@33: end Nenue@33: Nenue@40: function c:UpdateItems() Nenue@95: Nenue@95: local profileList = self:GetParent().profile.followers Nenue@95: Nenue@95: local troopList = self:GetParent().profile.troops Nenue@95: Nenue@95: Nenue@95: Nenue@40: end Nenue@40: function c:Reanchor() Nenue@40: end Nenue@33: Nenue@33: Nenue@40: ClassPlanFollowerMixin = CreateFromMixins(ClassPlanHandlerBase, c)