[CLOSED] prevent UI dialog from base entity?
Posted: Sun Nov 10, 2019 7:27 am
Hi all,
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
but how I combined a set of combinators and wanted to create a settings UI.
e.g.
but I had to set entity.operable =true and now the base dialogs appear.
1) How do I prevent the base dialog? Or how do I close it immedialty.
does not work.
2) Currently I have to manual close the dialog. I prefer to close the dialog with ESC? How do I achieve this?
Thx
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