Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TSM:OnInitialize()
- TSM.db = LibStub:GetLibrary("AceDB-3.0"):New("TradeSkillMaster_GuildSorterDB", savedDBDefaults, true)
- TSM.PlayerGuild = select(1,GetGuildInfo("player"))
- TSM:RegisterEvent("GUILDBANKFRAME_CLOSED")
- -- make easier references to all the modules
- for moduleName, module in pairs(TSM.modules) do
- TSM[moduleName] = module
- end
- TSM:RegisterModule()
- if select(4, GetAddOnInfo("TradeSkillMaster_ItemTracker")) == 1 then
- for _, name in ipairs(TSMAPI:ModuleAPI("ItemTracker", "guildlist") or {}) do
- if not TSM.db.global["Guilds"][name]["GuildName"] then
- TSM.db.global["Guilds"][name]["GuildName"] = name
- end
- end
- end
- end
- -- registers this module with TSM by first setting all fields and then calling TSMAPI:NewModule().
- function TSM:RegisterModule()
- TSM.slashCommands = {
- { key = "TestSort", label = "test", callback = "Sort:StartGbankSort" },
- { key = "SortToGuildBank", label = "Will sort items from bags into bank pertaining to item operation settings.", callback = "Sort:StartGbankPut" },
- }
- TSM.operations =
- {
- maxOperations=1,
- callbackOptions="Options:Load",
- callbackInfo="GetOperationInfo"
- }
- TSM.moduleAPIs = {
- {
- key="GuildSorter",
- callback="Options:Load"
- },
- }
- TSMAPI:NewModule(TSM)
- end
- TSM.operationDefaults = {
- GBank = "<None>",
- GBankTab = 1,
- ignorePlayer = {},
- ignoreFactionrealm = {},
- relationships = {},
- }
- function TSM:GetOperationInfo(operationName)
- local operation = TSM.operations[operationName]
- if not operation then return end
- if operation.target == "" then return end
- return format("Group Sorting in guild %s for tab %d", operation.GBank, operation.GBankTab)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement