Re: [NTG-context] callback.register
Hello,
Here a patch for luat-cbk.lua:
function callbacks.register(name,func,freeze) if frozen[name] then if trace_callbacks then frozenmessage("registering",name) end return nil, name .. " is frozen" elseif freeze then frozen[name] = (type(freeze) == "string" and freeze) or "registered" return register_callback(name,func) else return register_callback(name,func) end end
function callback.register(name,func) -- original if frozen[name] then if trace_callbacks then frozenmessage("registering",name) end return nil, name .. " is frozen" else return register_callback(name,func) end end
(Untested...)
Cheers, Peter
and function callbacks.report() local list = callback.list() for name, func in table.sortedpairs(list) do local str = frozen[name] if str then logs.report("callbacks","%s: %s -> %s",state(name),name,str) else logs.report("callbacks","%s: %s",state(name),name) end end end Wolfgang
participants (1)
-
Wolfgang Werners-Lucchini