WoWInterface SVN SliceCommander

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/Libs/AceConfig-3.0
    from Rev 229 to Rev 235
    Reverse comparison

Rev 229 → Rev 235

AceConfigDialog-3.0/AceConfigDialog-3.0.lua
1,7 → 1,7
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
-- @class file
-- @name AceConfigDialog-3.0
-- @release $Id: AceConfigDialog-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $
-- @release $Id: AceConfigDialog-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $
 
local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
45,39 → 45,10
return geterrorhandler()(err)
end
 
local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ...
local method, ARGS
local function call() return method(ARGS) end
 
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
 
return dispatch
]]
 
local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end
 
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end
 
local function safecall(func, ...)
return Dispatchers[select("#", ...)](func, ...)
if func then
return xpcall(func, errorhandler, ...)
end
end
 
local width_multiplier = 170