# HG changeset patch # User Waqas Hussain # Date 1298214712 -18000 # Node ID d899a847867e30538c59af565571d9b4170b5764 # Parent f71e66702665ad74c0dff645e1972dddfd2f608d util.pluginloader: Remove unused support for custom loaders, to simplify further refactoring. diff -r f71e66702665 -r d899a847867e util/pluginloader.lua --- a/util/pluginloader.lua Sun Feb 20 20:06:38 2011 +0500 +++ b/util/pluginloader.lua Sun Feb 20 20:11:52 2011 +0500 @@ -32,28 +32,24 @@ return content, path; end -function load_resource(plugin, resource, loader) +function load_resource(plugin, resource) local path, name = plugin:match("([^/]*)/?(.*)"); if name == "" then if not resource then resource = "mod_"..plugin..".lua"; end - loader = loader or load_file; - local content, err = loader(plugin.."/"..resource); - if not content then content, err = loader(resource); end - -- TODO add support for packed plugins + local content, err = load_file(plugin.."/"..resource); + if not content then content, err = load_file(resource); end return content, err; else if not resource then resource = "mod_"..name..".lua"; end - loader = loader or load_file; - local content, err = loader(plugin.."/"..resource); - if not content then content, err = loader(path.."/"..resource); end - -- TODO add support for packed plugins + local content, err = load_file(plugin.."/"..resource); + if not content then content, err = load_file(path.."/"..resource); end return content, err; end