rework plugin management

This commit is contained in:
kepler155c@gmail.com
2019-01-14 10:03:53 -05:00
parent 1cc9829eed
commit b674c6ab90
14 changed files with 80 additions and 76 deletions

View File

@@ -20,6 +20,16 @@ function Milo:getContext()
return self.context
end
function Milo:registerPlugin(plugin)
for pluginType, value in pairs(plugin) do
if not self.context.plugins[pluginType] then
self.context.plugins[pluginType] = { value }
else
table.insert(self.context.plugins[pluginType], value)
end
end
end
function Milo:pauseCrafting(reason)
local _, key = Util.find(self.context.state, 'key', reason.key)
if not key then