Implement additional plugin hook script.onUpdateConfig

Implements #4451
This commit is contained in:
Simone Mainardi 2020-09-20 13:19:36 +02:00
parent 402e1113fb
commit 304c5404f2
4 changed files with 70 additions and 0 deletions

View file

@ -78,6 +78,20 @@ end
-- #################################################################
-- @brief Called when the plugin containing the user script is loaded/reloaded
-- or when the user script configuration changes (e.g., is on/off toggled or
-- configuration parameters are changed).
-- When the plugin is loaded/reloaded, this method is called with all the
-- available existing configurations.
-- @param confid An integer configuration id
-- @param config A lua table with the configuration parameters for `confid`
function script.onUpdateConfig(confid, config)
print("on update:" .. script.key.. " confid: "..confid.."\n")
tprint(config)
end
-- #################################################################
-- @brief Called when the user script is loaded
-- @return true if the script should be loaded, false otherwise
-- @notes Can be used to init some script global state or to skip the script