Advertisement
j311yf1sh

Untitled

Feb 1st, 2014
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. function TSM:OnInitialize()
  2.  
  3. TSM.db = LibStub:GetLibrary("AceDB-3.0"):New("TradeSkillMaster_GuildSorterDB", savedDBDefaults, true)
  4.  
  5. TSM.PlayerGuild = select(1,GetGuildInfo("player"))
  6. TSM:RegisterEvent("GUILDBANKFRAME_CLOSED")
  7.  
  8. -- make easier references to all the modules
  9. for moduleName, module in pairs(TSM.modules) do
  10. TSM[moduleName] = module
  11. end
  12.  
  13. TSM:RegisterModule()
  14.  
  15. if select(4, GetAddOnInfo("TradeSkillMaster_ItemTracker")) == 1 then
  16. for _, name in ipairs(TSMAPI:ModuleAPI("ItemTracker", "guildlist") or {}) do
  17. if not TSM.db.global["Guilds"][name]["GuildName"] then
  18. TSM.db.global["Guilds"][name]["GuildName"] = name
  19. end
  20. end
  21. end
  22. end
  23.  
  24. -- registers this module with TSM by first setting all fields and then calling TSMAPI:NewModule().
  25. function TSM:RegisterModule()
  26. TSM.slashCommands = {
  27. { key = "TestSort", label = "test", callback = "Sort:StartGbankSort" },
  28. { key = "SortToGuildBank", label = "Will sort items from bags into bank pertaining to item operation settings.", callback = "Sort:StartGbankPut" },
  29. }
  30.  
  31.  
  32. TSM.operations =
  33. {
  34. maxOperations=1,
  35. callbackOptions="Options:Load",
  36. callbackInfo="GetOperationInfo"
  37. }
  38.  
  39. TSM.moduleAPIs = {
  40. {
  41. key="GuildSorter",
  42. callback="Options:Load"
  43. },
  44. }
  45.  
  46. TSMAPI:NewModule(TSM)
  47. end
  48.  
  49. TSM.operationDefaults = {
  50. GBank = "<None>",
  51. GBankTab = 1,
  52. ignorePlayer = {},
  53. ignoreFactionrealm = {},
  54. relationships = {},
  55. }
  56.  
  57. function TSM:GetOperationInfo(operationName)
  58. local operation = TSM.operations[operationName]
  59. if not operation then return end
  60. if operation.target == "" then return end
  61.  
  62. return format("Group Sorting in guild %s for tab %d", operation.GBank, operation.GBankTab)
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement