From b9b33424555fd49b0c0d934992eebcd58ee513e1 Mon Sep 17 00:00:00 2001 From: pigmonkey Date: Sun, 31 Jul 2011 06:12:21 -0400 Subject: [PATCH] Fixed a problem with guild roster number counts. Hopefully fixed the problem with bottom members being cut off. --- modules/guildroster.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/guildroster.lua b/modules/guildroster.lua index d08dfa3..8deb105 100644 --- a/modules/guildroster.lua +++ b/modules/guildroster.lua @@ -148,6 +148,7 @@ function mod:RosterUpdatePostHook() end if GetTime() - lastCache > 60*5 then self:CacheRaiders() + lastCache = GetTime() end -- begin modified blizzard code @@ -168,19 +169,18 @@ function mod:RosterUpdatePostHook() local maxWeeklyXP, maxTotalXP = GetGuildRosterLargestContribution(); local maxAchievementsPoints = GetGuildRosterLargestAchievementPoints(); -- numVisible - local visibleMembers = 0; - for i=1,onlineMembers do + local visibleMembers, onlineRaiders = 0, 0 + local numMembers = GetGuildRosterShowOffline() and totalMembers or onlineMembers + for i=1,numMembers do if self:IsRaider(i) then visibleMembers = visibleMembers + 1 + if select(9, GetGuildRosterInfo(i)) then + onlineRaiders = onlineRaiders + 1 + end end end -- copy visibleMembers to local for referencing - rosterRaidersOnline = visibleMembers - - if ( GetGuildRosterShowOffline() ) then - visibleMembers = rosterRaidersCount; - end - + rosterRaidersOnline = onlineRaiders -- self:Print("Start", visibleMembers, rosterRaidersCount) local safety = 1000 @@ -313,6 +313,10 @@ function mod:RosterUpdatePostHook() GuildRosterContainer.update = function() end HybridScrollFrame_Update(scrollFrame, totalHeight, displayedHeight); GuildRosterContainer.update = guildUpdate + if rosterRaidersOnline > 0 then + -- Shouldn't need to pass a string + GuildFrameMembersCount:SetText() + end end function mod:GuildRosterButton_OnClick(this, button, ...)