comparison ReAction.lua @ 36:52ac6db0c8ca

changed version print to include revision.
author Flick <flickerstreak@gmail.com>
date Thu, 03 Apr 2008 20:38:11 +0000
parents c54c481ad0ed
children 00f08528faaf
comparison
equal deleted inserted replaced
35:a4620a29a9cb 36:52ac6db0c8ca
13 ------ GLOBALS ------ 13 ------ GLOBALS ------
14 _G["ReAction"] = ReAction 14 _G["ReAction"] = ReAction
15 15
16 ------ DEBUGGING ------ 16 ------ DEBUGGING ------
17 ReAction.debug = true 17 ReAction.debug = true
18 local dbprint
18 if ReAction.debug then 19 if ReAction.debug then
19 ReAction.print = function(msg) 20 dbprint = function(msg)
20 DEFAULT_CHAT_FRAME:AddMessage(msg) 21 DEFAULT_CHAT_FRAME:AddMessage(msg)
21 end 22 end
22 --seterrorhandler(ReAction.print) 23 --seterrorhandler(dbprint)
23 else 24 else
24 ReAction.print = function() end 25 dbprint = function() end
25 end 26 end
27 ReAction.dbprint = dbprint
26 28
27 ------ LIBRARIES ------ 29 ------ LIBRARIES ------
28 local L = LibStub("AceLocale-3.0"):GetLocale("ReAction") 30 local L = LibStub("AceLocale-3.0"):GetLocale("ReAction")
29 ReAction.L = L 31 ReAction.L = L
30 32
115 local m = ReAction:GetModule("ConfigUI",true) 117 local m = ReAction:GetModule("ConfigUI",true)
116 if not m then 118 if not m then
117 LoadAddOn("ReAction_ConfigUI") 119 LoadAddOn("ReAction_ConfigUI")
118 m = ReAction:GetModule("ConfigUI") 120 m = ReAction:GetModule("ConfigUI")
119 end 121 end
120 if m and type(m) == "table" and type(m[method]) == "function" then 122 if m then
121 m[method](m,...) 123 if type(m) == "table" and type(m[method]) == "function" then
124 m[method](m,...)
125 else
126 dbprint(("Bad call '%s' to options module"):format(tostring(method)));
127 end
122 else 128 else
123 ReAction:Print("Options module not found") 129 ReAction:Print("Options module not found")
124 end 130 end
125 end 131 end
126 132
130 elseif option == "unlock" then 136 elseif option == "unlock" then
131 ReAction:SetConfigMode(true) 137 ReAction:SetConfigMode(true)
132 elseif option == "lock" then 138 elseif option == "lock" then
133 ReAction:SetConfigMode(false) 139 ReAction:SetConfigMode(false)
134 else 140 else
135 ReAction:Print(ReAction.version) 141 ReAction:Print(("%3.1f.%d"):format(ReAction.version,ReAction.revision))
136 ReAction:Print("/reaction config") 142 ReAction:Print("/reaction config")
137 ReAction:Print("/reaction unlock") 143 ReAction:Print("/reaction unlock")
138 ReAction:Print("/reaction lock") 144 ReAction:Print("/reaction lock")
139 end 145 end
140 end 146 end