LibGuildHistory is a library to facilitate and coordinate the requesting of guild history information.
Usage
LibGuildHistory:RequestHistory(category, completionFunc)
Categories
GUILD_HISTORY_GENERAL
GUILD_HISTORY_BANK
GUILD_HISTORY_STORE
GUILD_HISTORY_COMBAT (currently unused by game, but supported for any future use)
GUILD_HISTORY_ALLIANCE_WAR
Notes- LibGuildHistory will disable the Guild Menu's History tab while history requests are pending. This is to prevent the game from interfering with the library.
- Set LibGuildHistory.Debug to true to enable debug text.
Example Code
Code:
local LGH = LibStub("LibGuildHistory")
local function OnGuildHistoryGeneralCompleted(guildId)
d("General history for " .. GetGuildName(guildId) .. " is complete!")
if (guildId == GetGuildId(GetNumGuilds())) then d("General history ready for all guilds") end
end
local function onAddOnLoaded(eventCode, addonName)
if (addonName ~= "LibGuildHistory") then return end
LGH:RequestHistory(GUILD_HISTORY_GENERAL, OnGuildHistoryGeneralCompleted)
EVENT_MANAGER:UnregisterForEvent("LibGuildHistoryExample", EVENT_ADD_ON_LOADED)
end
EVENT_MANAGER:RegisterForEvent("LibGuildHistoryExample", EVENT_ADD_ON_LOADED, onAddOnLoaded)