Makes monolithic Factorio GUI events more manageable.
local Gui = require('stdlib/event/gui')
dispatch (event) | Calls the registered handlers. |
on_checked_state_changed (gui_element_pattern, handler) | Registers a function for a given GUI element name or pattern when the element checked state changes. |
on_click (gui_element_pattern, handler) | Registers a function for a given gui element name or pattern when the element is clicked. |
on_elem_changed (gui_element_pattern, handler) | Registers a function for a given GUI element name or pattern when the element selection changes. |
on_selection_state_changed (gui_element_pattern, handler) | Registers a function for a given GUI element name or pattern when the element state changes (dropdown). |
on_text_changed (gui_element_pattern, handler) | Registers a function for a given GUI element name or pattern when the element text changes. |
register (event_id, gui_element_pattern, handler) | Registers a function for a given event and matching gui element pattern. |
remove (event_id, gui_element_pattern) | Removes the handler with matching gui element pattern from the event. |
Calls the registered handlers.
Parameters:
Registers a function for a given GUI element name or pattern when the element checked state changes.
Parameters:
Registers a function for a given gui element name or pattern when the element is clicked.
Parameters:
Registers a function for a given GUI element name or pattern when the element selection changes.
Parameters:
Registers a function for a given GUI element name or pattern when the element state changes (dropdown).
Parameters:
Registers a function for a given GUI element name or pattern when the element text changes.
Parameters:
Registers a function for a given event and matching gui element pattern.
Parameters:
defines.events.on_gui_*
from defines.events
Removes the handler with matching gui element pattern from the event.
Parameters:
defines.events.on_gui_*
from defines.events