Advertisement
gpearson100

TSM mod

Aug 9th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. --[[
  2. With it like this, I get an error saying Config is a nil value - I have the config loading later in .toc with same layout as yall use: modules/config.lua
  3. I notice from your modules that you have the callback in quotes - but if I try that it errors out saying I gave a string where it expected a function. What should I do?
  4.  
  5. Thanks
  6. ]]--
  7. tradeskillmaster_BargainHunter.lua:
  8.  
  9. local TSM = select(2, ...)
  10. TSM = LibStub("AceAddon-3.0"):NewAddon(TSM, "TSM_BargainHunter", "AceEvent-3.0","AceConsole-3.0")
  11. local AceGUI = LibStub("AceGUI-3.0") -- load the AceGUI libraries
  12.  
  13. local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_BargainHunter") -- loads the localization table
  14. TSM.version = GetAddOnMetadata("TradeSkillMaster_BargainHunter", "Version")
  15.  
  16. function TSM:OnInitialize()
  17.     -- load the savedDB into TSM.db
  18.     TSM.db = LibStub:GetLibrary("AceDB-3.0"):New("TradeSkillMaster_BargainHunterDB", savedDBDefaults, true)
  19.     TSM.db.factionrealm.time = 10 -- because AceDB won't save if we don't do this...
  20.     TSM:RegisterModule()
  21. end
  22.  
  23. function TSM:RegisterModule()
  24.     -- Regsiter with TSMAPI
  25.     TSM.icons = { { side = "module", desc = "Bargain Hunter", slashCommand = "bh", callback = Config:Load, icon = "Interface\\Icons\\INV_JEWELCRAFTING_GOLDENBOAR" } }
  26.     TSMAPI:NewModule(TSM)  
  27. end
  28. -------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement