Mercurial > wow > reaction
comparison ReAction.lua @ 286:77609bfa804e stable
Merge 1.1 beta 8 to stable
| author | Flick |
|---|---|
| date | Sat, 11 Jun 2011 10:57:00 -0700 |
| parents | 5b9c0164a491 |
| children | 0cb6a9944497 |
comparison
equal
deleted
inserted
replaced
| 272:71d1a5e47e72 | 286:77609bfa804e |
|---|---|
| 1 local addonName, addonTable = ... | 1 local _, ns = ... |
| 2 local pcall = pcall | 2 local pcall = pcall |
| 3 local pairs = pairs | 3 local pairs = pairs |
| 4 local type = type | 4 local type = type |
| 5 local geterrorhandler = geterrorhandler | 5 local geterrorhandler = geterrorhandler |
| 6 local GetTime = GetTime | |
| 6 local L = LibStub("AceLocale-3.0"):GetLocale("ReAction") | 7 local L = LibStub("AceLocale-3.0"):GetLocale("ReAction") |
| 7 local LKB = LibStub("LibKeyBound-1.0",true) | 8 local LKB = LibStub("LibKeyBound-1.0",true) |
| 8 if not LKB then | 9 if not LKB then |
| 9 LoadAddOn("LibKeyBound-1.0") | 10 LoadAddOn("LibKeyBound-1.0") |
| 10 LKB = LibStub("LibKeyBound-1.0") | 11 LKB = LibStub("LibKeyBound-1.0") |
| 56 end) | 57 end) |
| 57 return r | 58 return r |
| 58 end | 59 end |
| 59 | 60 |
| 60 -- store in the addon table | 61 -- store in the addon table |
| 61 addonTable.tcopy = tcopy | 62 ns.tcopy = tcopy |
| 62 addonTable.tfetch = tfetch | 63 ns.tfetch = tfetch |
| 63 addonTable.tbuild = tbuild | 64 ns.tbuild = tbuild |
| 64 addonTable.fieldsort = fieldsort | 65 ns.fieldsort = fieldsort |
| 65 | 66 |
| 66 ------ Core ------ | 67 ------ Core ------ |
| 67 local ReAction = LibStub("AceAddon-3.0"):NewAddon( "ReAction", | 68 local ReAction = LibStub("AceAddon-3.0"):NewAddon( "ReAction", |
| 68 "AceEvent-3.0" | 69 "AceEvent-3.0" |
| 69 ) | 70 ) |
| 70 addonTable.ReAction = ReAction | 71 ns.ReAction = ReAction |
| 71 ReAction.version = GetAddOnMetadata("ReAction","Version") | 72 ReAction.version = GetAddOnMetadata("ReAction","Version") |
| 72 ReAction.L = L | 73 ReAction.L = L |
| 73 ReAction.LKB = LKB | 74 ReAction.LKB = LKB |
| 74 | 75 |
| 75 | 76 |
| 169 end | 170 end |
| 170 | 171 |
| 171 | 172 |
| 172 ------ Methods ------ | 173 ------ Methods ------ |
| 173 | 174 |
| 174 function ReAction:UserError(msg) | 175 do |
| 175 UIErrorsFrame:AddMessage(msg) | 176 local lastErrorMessage |
| 177 local lastErrorTime | |
| 178 function ReAction:UserError(msg) | |
| 179 local t = GetTime() | |
| 180 if msg ~= lastErrorMessage or lastErrorTime == nil or (t - lastErrorTime > 10) then -- prevent spam | |
| 181 UIErrorsFrame:AddMessage(msg) | |
| 182 lastErrorMessage = msg | |
| 183 lastErrorTime = t | |
| 184 end | |
| 185 end | |
| 176 end | 186 end |
| 177 | 187 |
| 178 function ReAction:GetBar(arg) | 188 function ReAction:GetBar(arg) |
| 179 if type(arg) == "string" then | 189 if type(arg) == "string" then |
| 180 return self.bars[arg], arg | 190 return self.bars[arg], arg |
