Code: Select all
local display_panel = surface.create_entity{
name = "display-panel",
position = {-2, -3},
force = player.force
}
display_panel.get_or_create_control_behavior().set_message(1, {
icon = { type = "item", name = "coal" },
text = "Test",
condition = {
fulfilled = true, -- not sure why this does nothing
first_signal = {type="item", name="raw-fish"},
comparator = "=",
second_signal = {type="item", name="raw-fish"}
}
})
-- workaround: since the display panel doesn't show anything, connect it to a circuit network, and disconnect it immediately after, to give it an update
local a = some_other_required_entity_with_circuit_connection_ability.get_wire_connector(defines.wire_connector_id.circuit_red, true)
local b = display_panel.get_wire_connector(defines.wire_connector_id.circuit_red, false)
a.connect_to(b, false, defines.wire_origin.script)
a.disconnect_from(b) -- not really necessary since wire_origin.script disables drawing the wire already