diff --git a/control.lua b/control.lua index 74988e4..af19bda 100644 --- a/control.lua +++ b/control.lua @@ -50,4 +50,46 @@ script.on_event(defines.events.on_script_trigger_effect, function (event) control.enabled=false end end -end) \ No newline at end of file +end) + + + +if script.active_mods["compaktcircuit"] then + + local function defineCompakt() + + remote.add_interface("pushbutton+compaktcircuit", { + + get_info = function(entity) + return nil -- pushbutton has no savable state + end, + + create_packed_entity = function(info, surface, position, force) + return nil + end, + + create_entity = function(info, surface, force) + local entity = surface.create_entity { + name = "pushbutton", + force = force, + position = info and info.position, + direction = info and info.direction, + } + local control = entity.get_or_create_control_behavior() + control.enabled = false + return entity + end + + }) + + remote.call("compaktcircuit", "add_combinator", { + name = "pushbutton", + packed_names = nil, + interface_name = "pushbutton+compaktcircuit" + }) + + end + script.on_load(defineCompakt) + script.on_init(defineCompakt) + +end