Mercurial > wow > buffalo2
comparison Modules/GuildInfo.lua @ 108:a41f6b74709a
- Handler number and boolean cluster arguments as positioning priority layer and "always top" respectively
- Use SetShown and IsShown instead of IsVisible in doing full re-anchor checks
author | Nick@Zahhak |
---|---|
date | Sat, 25 Feb 2017 11:42:07 -0500 |
parents | 1e511e9aaca5 |
children | 1f68c46bc4de |
comparison
equal
deleted
inserted
replaced
107:ff00679a7817 | 108:a41f6b74709a |
---|---|
1 | |
2 local print = DEVIAN_WORKSPACE and function(...) print('VnRoster', ...) end or nop | |
3 | |
1 VeneerRosterKunMixin = { | 4 VeneerRosterKunMixin = { |
2 addonTrigger = 'Blizzard_GuildUI', | 5 addonTrigger = 'Blizzard_GuildUI', |
3 | 6 |
4 anchorFrame = 'GuildFrame', | 7 anchorFrame = 'GuildFrame', |
5 anchorPoint = 'TOPLEFT', | 8 anchorPoint = 'TOPLEFT', |
7 | 10 |
8 | 11 |
9 local module = VeneerRosterKunMixin | 12 local module = VeneerRosterKunMixin |
10 | 13 |
11 function module:OnLoad() | 14 function module:OnLoad() |
12 | |
13 Veneer:AddHandler(self, self.anchorPoint) | 15 Veneer:AddHandler(self, self.anchorPoint) |
14 | |
15 self:RegisterEvent('GUILD_ROSTER_UPDATE') | 16 self:RegisterEvent('GUILD_ROSTER_UPDATE') |
16 self:RegisterEvent('GUILD_TRADESKILL_UPDATE') | 17 self:RegisterEvent('GUILD_TRADESKILL_UPDATE') |
18 | |
19 self:RegisterEvent('LFG_LIST_SEARCH_RESULT_UPDATED') | |
20 self:RegisterEvent('LFG_LIST_SEARCH_RESULTS_RECEIVED') | |
21 self:RegisterEvent('LFG_LIST_AVAILABILITY_UPDATE') | |
22 self:RegisterEvent('LFG_LIST_LOCK_INFO_RECEIVED') | |
17 end | 23 end |
18 | 24 |
19 function module:OnEvent() | 25 function module:Setup() |
26 VeneerHandlerMixin.Setup(self) | |
27 self:SetParent(GuildFrame) | |
28 self:SetShown(true) | |
29 end | |
20 | 30 |
31 function module:SetDirty() | |
32 if self:IsVisible() then | |
33 self:Update() | |
34 else | |
35 self.GuildInfoDirty = true | |
36 end | |
37 end | |
21 | 38 |
39 function module:OnShow() | |
40 print('|cFF00FFFFOnShow()|r') | |
41 if self.GuildInfoDirty then | |
42 self:UpdateGuildInfo() | |
43 end | |
22 end | 44 end |
45 | |
46 function module:UpdateGuildInfo() | |
47 local numMembers = GetNumGuildMembers() | |
48 print(numMembers) | |
49 for i = 1, numMembers do | |
50 print(GetGuildRosterInfo(i)) | |
51 end | |
52 end | |
53 | |
54 function module:Update() end | |
55 | |
56 function module:OnEvent(event, ...) | |
57 print('|cFFFF0088OnEvent()|r', event, ...) | |
58 if event == 'LFG_LIST_SEARCH_RESULTS_RECEIVED' then | |
59 elseif event == 'LFG_LIST_SEARCH_RESULT_UPDATED' then | |
60 elseif event == 'GUILD_ROSTER_UPDATE' then | |
61 self:SetDirty() | |
62 end | |
63 end |