Module Gui

Description

Module Status: Work in progress.

Usage:

    local Gui = require('__eradicators-library__/erlib/factorio/Gui')()
    

Generic

destroy([elm]) Destroys a gui element or does nothing.
find_child(parent, name) Recursively find a named element.
get_ancestors(elm) Gets all elements above an element.

Screen

move(elm, w, h[, x=0.5[, y=0.5]]) Moves a LuaGuiElement inside LuaGui.screen.
create_title_bar(opts) Creates a draggable title-bar with close button.
set_minimize_button_sprite(elm, state) Updates the sprite on a min-max button.

AutoStyler

set_slider_auto_tooltip(elm, postfix) Automatically updates this sliders tooltip when it's value changes.

Constructor

constructioneer([theme], layout, root, return_last_first) Makes Guis.
RuntimeTheme Constructioneer theme.
GuiLayout Constructioneer layout.
ElementSpec Constructioneer Element.
RuntimeStyle Constructioneer style.


Generic

destroy([elm])
Destroys a gui element or does nothing.

Parameters:

find_child(parent, name)
Recursively find a named element. Depth-first search.

Parameters:

Returns:

    nil or LuaGuiElement The first element with a matching name, if any.
get_ancestors(elm)
Gets all elements above an element. Most useful to get the anchor element or the name of the root.

Parameters:

Returns:

    DenseArray Starts at the root element (screen, relative, etc.) and ends at the input element.

Screen

move(elm, w, h[, x=0.5[, y=0.5]])
Moves a LuaGuiElement inside LuaGui.screen.

Parameters:

Returns:

    LuaGuiElement The given element.
create_title_bar(opts)
Creates a draggable title-bar with close button. Mimics vanilla style in accordance with Raiguards Style Guide

Parameters:

Returns:

    table A table containing the created LuaGuiElements. {title_flow=, title_label=, drag_widget=, minimize_button=, close_button=}
set_minimize_button_sprite(elm, state)
Updates the sprite on a min-max button.

Parameters:

  • elm LuaGuiElement This must be a sprite-button!
  • state boolean True is a downwards arrow, false is a rightwards arrow.

AutoStyler

These functions will silently do nothing unless activated.

Usage:

-- settings.lua
erlib_enable_plugin('gui-auto-styler')
set_slider_auto_tooltip(elm, postfix)
Automatically updates this sliders tooltip when it's value changes.

Parameters:

Returns:

    LuaGuiElement The given element.

Constructor

constructioneer([theme], layout, root, return_last_first)
Makes Guis. Curried function. Unsupported draft.

Parameters:

Returns:

    table

Usage:

    Gui.constructioneer(theme)(layout)(root, return_last_first)
RuntimeTheme
Constructioneer theme.

Fields:

GuiLayout
Constructioneer layout. Recursively specifies a Guis layout. Each ElementSpec creates a new relative root element for the subsequent GuiLayouts.

Fields:

  • ... DenseArray An array of ElementSpec or GuiLayout.
ElementSpec
Constructioneer Element.

Fields:

  • 1 string ThemedType
  • type string ThemedType
  • styler RuntimeStyle
RuntimeStyle
Constructioneer style. A table of LuaStyle (key -> value) pairs.
generated by LDoc 1.4.6 Last updated 2021-09-10 19:51:19