diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-08 17:38:28 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-08 17:38:28 +0100 |
commit | d5e3f1cf68a15d7e14cc44eb8e58e49dbb6aa087 (patch) | |
tree | e478f8600024075e3ef786c03a74d454d01d5396 /new_flow_logic/flowable_node_registry_install.lua | |
parent | ce0983d239c4c855b7f6fd9d96d352c03c5d88b0 (diff) |
new flow logic: implement post-transition hook with mesecons support, add mesecons transition rules for flow sensor
Diffstat (limited to 'new_flow_logic/flowable_node_registry_install.lua')
-rw-r--r-- | new_flow_logic/flowable_node_registry_install.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/new_flow_logic/flowable_node_registry_install.lua b/new_flow_logic/flowable_node_registry_install.lua index e4a5744..c8f6889 100644 --- a/new_flow_logic/flowable_node_registry_install.lua +++ b/new_flow_logic/flowable_node_registry_install.lua @@ -145,8 +145,9 @@ local simpleseterror = function(msg) end local simple_transitions = pipeworks.flowables.transitions.simple -register.transition_simple_set = function(nodeset) +register.transition_simple_set = function(nodeset, extras) local set = {} + if extras == nil then extras = {} end local length = #nodeset if length < 2 then simpleseterror("nodeset needs at least two elements!") end @@ -175,4 +176,13 @@ register.transition_simple_set = function(nodeset) --pipeworks.logger("register.transition_simple_set() after sort: nodename "..element.nodename.." value "..tostring(element.threshold)) simple_transitions[element.nodename] = set end + + -- handle extra options + -- if mesecons rules table was passed, set for each node + if extras.mesecons then + local mesecons_rules = pipeworks.flowables.transitions.mesecons + for _, element in ipairs(set) do + mesecons_rules[element.nodename] = extras.mesecons + end + end end |