okay, I know this is not possible, as mentioned here. But I still got stuck.
I have a interface to popup a confirmation dialog, like this
It dynamically create gui nodes and compose into a window.
when used in gui_scripte,
popup_confirm_dialog(self.background, 0, "Sell", "Are you sure to sell Scroll of Knowledge?", { on_confirmed = ... })
,
feels natural like normal lua.
But I also need to call this in logical script (say, when our player want to eat a potion at full health), how can I reuse this?
How do we usually handle this situation? Is there a idiom to handle this?
Thanks for your help! Thanks in advance!