I have a entity derived from constant combinator.
In the past the entity has a behavior based on its type and I just disabled the UI dialog by diabling any dialogs
Code: Select all
entity.operable =false
data:extend({entity})
e.g.
Code: Select all
player.gui.left.add {type = "frame", name = "mathProcessorUi", caption = "Select operation", direction = "vertical"}
1) How do I prevent the base dialog? Or how do I close it immedialty.
Code: Select all
player.gui.center.clear()
2) Currently I have to manual close the dialog. I prefer to close the dialog with ESC? How do I achieve this?
Code: Select all
local function on_gui_click(event)
if event.element and event.element.name == "closemathProcessorUi" then
if player.gui.left.mathProcessorUi ~= nil then
player.gui.left.mathProcessorUi.destroy()
end
end
end
Thx