Permalink
Browse files

and so it begins...

  • Loading branch information...
0 parents commit eac21c7b9f0ddfa1d858e2a79cb47dcd3d9c2b5d @tekkub tekkub committed Nov 21, 2011
Showing with 47 additions and 0 deletions.
  1. +35 −0 GuildFinderSorter.lua
  2. +12 −0 GuildFinderSorter.toc
@@ -0,0 +1,35 @@
+
+local o = GetRecruitingGuildInfo
+
+local indexmap
+local function guildsort(a, b)
+ if a.lvl == b.lvl then
+ if a.mem == b.mem then return a.ach > b.ach end
+ return a.mem > b.mem
+ end
+ return a.lvl > b.lvl
+end
+function GetRecruitingGuildInfo(index, ...)
+ if not indexmap then
+ indexmap = {}
+
+ for i=1,GetNumRecruitingGuilds() do
+ local _, level, numMembers, achPoints = o(i)
+ indexmap[i] = {
+ index = i,
+ mem = numMembers,
+ lvl = level,
+ ach = achPoints
+ }
+ end
+
+ table.sort(indexmap, guildsort)
+ end
+
+ return o(indexmap[index].index, ...)
+end
+
+
+local f = CreateFrame("Frame")
+f:RegisterEvent("LF_GUILD_BROWSE_UPDATED")
+f:SetScript("OnEvent", function() indexmap = nil end)
@@ -0,0 +1,12 @@
+## Interface: 40200
+
+## Title: GuildFinderSorter
+## Notes: Sorts the guild finder list
+## Author: Tekkub
+## Version: Alpha
+## X-Website: http://tekkub.net/
+## X-Category: Interface Enhancements
+
+## LoadWith: Blizzard_LookingForGuildUI
+
+GuildFinderSorter.lua

0 comments on commit eac21c7

Please sign in to comment.