From aa627d40235b05b9661e1dfe1a7d445dc122daf6 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 19 Jan 2023 10:14:45 -0500 Subject: [PATCH] Added in Config Postload (#1336) * Added in an `onload` variable to configs which is called by the plugin loader. * Used appropriate parameter. * Fixed tabbing. --- data/core/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/core/init.lua b/data/core/init.lua index 89ac7ec4..d8f77b19 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -1010,7 +1010,7 @@ function core.load_plugins() table.insert(list, plugin.file) elseif config.plugins[plugin.name] ~= false then local start = system.get_time() - local ok = core.try(require, "plugins." .. plugin.name) + local ok, loaded_plugin = core.try(require, "plugins." .. plugin.name) if ok then core.log_quiet( "Loaded plugin %q from %s in %.1fms", @@ -1021,6 +1021,8 @@ function core.load_plugins() end if not ok then no_errors = false + elseif config.plugins[plugin.name].onload then + core.try(config.plugins[plugin.name].onload, loaded_plugin) end end end