diff 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
line wrap: on
line diff
--- a/Modules/GuildInfo.lua	Sun Jan 29 09:57:09 2017 -0500
+++ b/Modules/GuildInfo.lua	Sat Feb 25 11:42:07 2017 -0500
@@ -1,3 +1,6 @@
+
+local print = DEVIAN_WORKSPACE and function(...) print('VnRoster', ...) end or nop
+
 VeneerRosterKunMixin = {
   addonTrigger = 'Blizzard_GuildUI',
 
@@ -9,14 +12,52 @@
 local module = VeneerRosterKunMixin
 
 function module:OnLoad()
-
   Veneer:AddHandler(self, self.anchorPoint)
-
   self:RegisterEvent('GUILD_ROSTER_UPDATE')
   self:RegisterEvent('GUILD_TRADESKILL_UPDATE')
+
+  self:RegisterEvent('LFG_LIST_SEARCH_RESULT_UPDATED')
+  self:RegisterEvent('LFG_LIST_SEARCH_RESULTS_RECEIVED')
+  self:RegisterEvent('LFG_LIST_AVAILABILITY_UPDATE')
+  self:RegisterEvent('LFG_LIST_LOCK_INFO_RECEIVED')
 end
 
-function module:OnEvent()
+function module:Setup()
+  VeneerHandlerMixin.Setup(self)
+  self:SetParent(GuildFrame)
+  self:SetShown(true)
+end
 
+function module:SetDirty()
+  if self:IsVisible() then
+    self:Update()
+  else
+    self.GuildInfoDirty = true
+  end
+end
 
+function module:OnShow()
+  print('|cFF00FFFFOnShow()|r')
+  if self.GuildInfoDirty then
+    self:UpdateGuildInfo()
+  end
+end
+
+function module:UpdateGuildInfo()
+  local numMembers = GetNumGuildMembers()
+  print(numMembers)
+  for i = 1, numMembers do
+    print(GetGuildRosterInfo(i))
+  end
+end
+
+function module:Update() end
+
+function module:OnEvent(event, ...)
+  print('|cFFFF0088OnEvent()|r', event, ...)
+  if event == 'LFG_LIST_SEARCH_RESULTS_RECEIVED' then
+  elseif event == 'LFG_LIST_SEARCH_RESULT_UPDATED' then
+  elseif event == 'GUILD_ROSTER_UPDATE' then
+    self:SetDirty()
+  end
 end
\ No newline at end of file