Mercurial > wow > itemauditor
comparison Modules/Utils.lua @ 3:bbcf81868171
Code cleanup.
| author | Asa Ayers <Asa.Ayers@Gmail.com> |
|---|---|
| date | Sat, 22 May 2010 11:34:19 -0700 |
| parents | |
| children | 5dddd73b2220 |
comparison
equal
deleted
inserted
replaced
| 2:e9a1646beaa4 | 3:bbcf81868171 |
|---|---|
| 1 local addonName, addonTable = ...; | |
| 2 local addon = {} | |
| 3 | |
| 4 local AceConsole = LibStub("AceConsole-3.0") | |
| 5 AceConsole:Embed(addon) | |
| 6 | |
| 7 addonTable.utils = addon | |
| 8 | |
| 9 function addon:FormatMoney(money) | |
| 10 return Altoholic:GetMoneyString(money, WHITE, false) | |
| 11 end | |
| 12 | |
| 13 function addon:tcount(tab) | |
| 14 local n = #tab | |
| 15 if (n == 0) then | |
| 16 for _ in pairs(tab) do | |
| 17 n = n + 1 | |
| 18 end | |
| 19 end | |
| 20 return n | |
| 21 end | |
| 22 | |
| 23 | |
| 24 function addon:GetDebug(info) | |
| 25 return true | |
| 26 -- return self.db.char.debug | |
| 27 end | |
| 28 | |
| 29 function addon:SetDebug(info, input) | |
| 30 self:Print("Debugging is now: " .. value) | |
| 31 self.db.char.debug = input | |
| 32 local value = "off" | |
| 33 if input then | |
| 34 value = "on" | |
| 35 end | |
| 36 | |
| 37 end |
