view Modules/GuildInfo.lua @ 119:0f47780a83c4

ArtifactPower: - xp bar animations work beyond concordance rank 3
author Nenue
date Sat, 20 May 2017 06:10:52 -0400
parents a41f6b74709a
children 1f68c46bc4de
line wrap: on
line source

local print = DEVIAN_WORKSPACE and function(...) print('VnRoster', ...) end or nop

VeneerRosterKunMixin = {
  addonTrigger = 'Blizzard_GuildUI',

  anchorFrame = 'GuildFrame',
  anchorPoint = 'TOPLEFT',
}


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: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