Kryzeth Standard Library

StdLib.Event.Gui

supers: StdLib.Core

Makes monolithic Factorio GUI events more manageable.

@usage local Gui = require('kry_stdlib/stdlib/event/gui')

Methods7

function Gui.on_click(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given gui element name or pattern when the element is clicked.

Parameters
gui_element_patternstring

the name or string regular expression to match the gui element

handlerfunction

the function to call when gui element is clicked

function Gui.on_checked_state_changed(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given GUI element name or pattern when the element checked state changes.

Parameters
gui_element_patternstring

the name or string regular expression to match the GUI element

handlerfunction

the function to call when GUI element checked state changes

function Gui.on_text_changed(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given GUI element name or pattern when the element text changes.

Parameters
gui_element_patternstring

the name or string regular expression to match the GUI element

handlerfunction

the function to call when GUI element text changes

function Gui.on_elem_changed(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given GUI element name or pattern when the element selection changes.

Parameters
gui_element_patternstring

the name or string regular expression to match the GUI element

handlerfunction

the function to call when GUI element selection changes

function Gui.on_selection_state_changed(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given GUI element name or pattern when the element state changes (drop down).

Parameters
gui_element_patternstring

the name or string regular expression to match the GUI element

handlerfunction

the function to call when GUI element state changes

function Gui.on_value_changed(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given GUI element name or pattern when the element value changes (slider).

Parameters
gui_element_patternstring

the name or string regular expression to match the GUI element

handlerfunction

the function to call when GUI element state changes

function Gui.on_confirmed(gui_element_pattern: string, handler: function) -> StdLib.Event.Gui

Registers a function for a given GUI element name or pattern when the element is confirmed.

Parameters
gui_element_patternstring

the name or string regular expression to match the GUI element

handlerfunction

the function to call when GUI element state changes

Fields2

Gui.__class: string = "Gui"
Gui.__index : unknown