mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
2860 lines
89 KiB
HTML
2860 lines
89 KiB
HTML
|
|
|
|
<!doctype html>
|
|
<html class="no-js" lang="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
<title>Gui core</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="../spectre.min.css" type="text/css" />
|
|
<link rel="stylesheet" href="../spectre-icons.min.css" type="text/css" />
|
|
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container grid-1280">
|
|
<div class="columns">
|
|
|
|
<!-- sidebar start -->
|
|
|
|
<div id="sidebar" class="column col-3 col-sm-12">
|
|
|
|
<div class="sidebar-custom">
|
|
|
|
<div class="project-infobox">
|
|
|
|
<!-- project title -->
|
|
|
|
<a href="../index.html"><h1>ExpGaming Scenario</h1></a>
|
|
|
|
<!-- project description -->
|
|
<p class="project-desc">Explosive Gaming's server scenario for 0.17</p>
|
|
|
|
<!-- project full description -->
|
|
</div>
|
|
|
|
|
|
<!-- sidebar navigation -->
|
|
<!-- list of items in a module -->
|
|
<ul class="nav nav-module-contents">
|
|
<li class="nav-item">
|
|
<h2>Sections</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><a href="#Dependencies"><span class="fragment-hashtag">#</span> Dependencies</a></li>
|
|
<li class="nav-item"><a href="#Tables"><span class="fragment-hashtag">#</span> Tables</a></li>
|
|
<li class="nav-item"><a href="#Fields"><span class="fragment-hashtag">#</span> Fields</a></li>
|
|
<li class="nav-item"><a href="#Element_Define"><span class="fragment-hashtag">#</span> Element Define </a></li>
|
|
<li class="nav-item"><a href="#Element_Events"><span class="fragment-hashtag">#</span> Element Events </a></li>
|
|
<li class="nav-item"><a href="#Top_Flow"><span class="fragment-hashtag">#</span> Top Flow </a></li>
|
|
<li class="nav-item"><a href="#Left_Flow"><span class="fragment-hashtag">#</span> Left Flow </a></li>
|
|
<li class="nav-item"><a href="#Helper_Functions"><span class="fragment-hashtag">#</span> Helper Functions </a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Core</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../core/Commands.html"><span class="module-name-item">Commands</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../core/Common-Library.html"><span class="module-name-item">Common-Library</span></a></div></li>
|
|
<li class="nav-item active"><div class="nav-item-block-active block"><a href="../core/Gui.html"><span class="module-name-item">Gui</span></a><i class="icon icon-arrow-left icon-arrow-left-custom"></i></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../core/Permissions-Groups.html"><span class="module-name-item">Permissions-Groups</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../core/Roles.html"><span class="module-name-item">Roles</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../core/Store.html"><span class="module-name-item">Store</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../core/Sudo.html"><span class="module-name-item">Sudo</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Control</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Jail.html"><span class="module-name-item">Jail</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Production.html"><span class="module-name-item">Production</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Reports.html"><span class="module-name-item">Reports</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Rockets.html"><span class="module-name-item">Rockets</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Tasks.html"><span class="module-name-item">Tasks</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Warnings.html"><span class="module-name-item">Warnings</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../control/Warps.html"><span class="module-name-item">Warps</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Addons</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Advanced-Start.html"><span class="module-name-item">Advanced-Start</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Chat-Popups.html"><span class="module-name-item">Chat-Popups</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Chat-Reply.html"><span class="module-name-item">Chat-Reply</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Compilatron.html"><span class="module-name-item">Compilatron</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Damage-Popups.html"><span class="module-name-item">Damage-Popups</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Death-Logger.html"><span class="module-name-item">Death-Logger</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Discord-Alerts.html"><span class="module-name-item">Discord-Alerts</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Pollution-Grading.html"><span class="module-name-item">Pollution-Grading</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Player-Colours.html"><span class="module-name-item">Player-Colours</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Scorched-Earth.html"><span class="module-name-item">Scorched-Earth</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../addons/Spawn-Area.html"><span class="module-name-item">Spawn-Area</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Guis</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../guis/Player-List.html"><span class="module-name-item">Player-List</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../guis/Rocket-Info.html"><span class="module-name-item">Rocket-Info</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../guis/Science-Info.html"><span class="module-name-item">Science-Info</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../guis/Task-List.html"><span class="module-name-item">Task-List</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../guis/Warps-List.html"><span class="module-name-item">Warps-List</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Commands</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Admin-Chat.html"><span class="module-name-item">Admin-Chat</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Bonus.html"><span class="module-name-item">Bonus</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Cheat-Mode.html"><span class="module-name-item">Cheat-Mode</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Clear-Inventory.html"><span class="module-name-item">Clear-Inventory</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Debug.html"><span class="module-name-item">Debug</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Find.html"><span class="module-name-item">Find</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Help.html"><span class="module-name-item">Help</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Home.html"><span class="module-name-item">Home</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Interface.html"><span class="module-name-item">Interface</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Jail.html"><span class="module-name-item">Jail</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Kill.html"><span class="module-name-item">Kill</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Me.html"><span class="module-name-item">Me</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Rainbow.html"><span class="module-name-item">Rainbow</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Repair.html"><span class="module-name-item">Repair</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Reports.html"><span class="module-name-item">Reports</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Roles.html"><span class="module-name-item">Roles</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Spawn.html"><span class="module-name-item">Spawn</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Tag.html"><span class="module-name-item">Tag</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Teleport.html"><span class="module-name-item">Teleport</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../commands/Warnings.html"><span class="module-name-item">Warnings</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Configs</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/File-Loader.html"><span class="module-name-item">File-Loader</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Player-List.html"><span class="module-name-item">Player-List</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Advanced-Start.html"><span class="module-name-item">Advanced-Start</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Bonuses.html"><span class="module-name-item">Bonuses</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Chat-Reply.html"><span class="module-name-item">Chat-Reply</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Compilatron.html"><span class="module-name-item">Compilatron</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Death-Logger.html"><span class="module-name-item">Death-Logger</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Discord-Alerts.html"><span class="module-name-item">Discord-Alerts</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Commands-Auth-Admin.html"><span class="module-name-item">Commands-Auth-Admin</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Commands-Auth-Roles.html"><span class="module-name-item">Commands-Auth-Roles</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Commands-Auth-Runtime-Disable.html"><span class="module-name-item">Commands-Auth-Runtime-Disable</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Commands-Parse.html"><span class="module-name-item">Commands-Parse</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Commands-Parse-Roles.html"><span class="module-name-item">Commands-Parse-Roles</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Permission-Groups.html"><span class="module-name-item">Permission-Groups</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Pollution-Grading.html"><span class="module-name-item">Pollution-Grading</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Popup-Messages.html"><span class="module-name-item">Popup-Messages</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Preset-Player-Colours.html"><span class="module-name-item">Preset-Player-Colours</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Repair.html"><span class="module-name-item">Repair</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Rockets.html"><span class="module-name-item">Rockets</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Roles.html"><span class="module-name-item">Roles</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Science.html"><span class="module-name-item">Science</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Scorched-Earth.html"><span class="module-name-item">Scorched-Earth</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Spawn-Area.html"><span class="module-name-item">Spawn-Area</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Tasks.html"><span class="module-name-item">Tasks</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Warnings.html"><span class="module-name-item">Warnings</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../configs/Warps.html"><span class="module-name-item">Warps</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Modules</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/control.html"><span class="module-name-item">control</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.alien_evolution_progress.html"><span class="module-name-item">utils.alien_evolution_progress</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.core.html"><span class="module-name-item">utils.core</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.debug.html"><span class="module-name-item">utils.debug</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.dump_env.html"><span class="module-name-item">utils.dump_env</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.event.html"><span class="module-name-item">utils.event</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.event_core.html"><span class="module-name-item">utils.event_core</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.math.html"><span class="module-name-item">utils.math</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.recipe_locker.html"><span class="module-name-item">utils.recipe_locker</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.state_machine.html"><span class="module-name-item">utils.state_machine</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.table.html"><span class="module-name-item">utils.table</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.task.html"><span class="module-name-item">utils.task</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.timestamp.html"><span class="module-name-item">utils.timestamp</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="nav nav-modules">
|
|
<li class="nav-item">
|
|
<h2>Topics</h2>
|
|
<ul class="nav">
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../topics/readme.md.html"><span class="module-name-item">readme.md</span></a></div></li>
|
|
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../topics/license.html"><span class="module-name-item">license</span></a></div></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
<div class="up-to-top">
|
|
<!-- list of items in a module -->
|
|
<ul class="nav nav-module-contents">
|
|
<li class="nav-item">
|
|
<h4>Jump to Section</h4>
|
|
<ul class="nav">
|
|
<li class="nav-item"><a href="#Dependencies"><span class="fragment-hashtag">#</span> Dependencies</a></li>
|
|
<li class="nav-item"><a href="#Tables"><span class="fragment-hashtag">#</span> Tables</a></li>
|
|
<li class="nav-item"><a href="#Fields"><span class="fragment-hashtag">#</span> Fields</a></li>
|
|
<li class="nav-item"><a href="#Element_Define"><span class="fragment-hashtag">#</span> Element Define </a></li>
|
|
<li class="nav-item"><a href="#Element_Events"><span class="fragment-hashtag">#</span> Element Events </a></li>
|
|
<li class="nav-item"><a href="#Top_Flow"><span class="fragment-hashtag">#</span> Top Flow </a></li>
|
|
<li class="nav-item"><a href="#Left_Flow"><span class="fragment-hashtag">#</span> Left Flow </a></li>
|
|
<li class="nav-item"><a href="#Helper_Functions"><span class="fragment-hashtag">#</span> Helper Functions </a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<a href="#">Top <i class="icon icon-upward"></i></a>
|
|
</div>
|
|
</div>
|
|
<!-- sidebar end -->
|
|
|
|
<!-- content body start -->
|
|
<div class="column col-9 col-sm-12">
|
|
|
|
<!-- module list on the main page start -->
|
|
<!-- module list on the main page end -->
|
|
|
|
<!-- module contents -->
|
|
|
|
<!-- module content header start -->
|
|
|
|
<h2><span class="body-module-name"><strong><em>Gui</em></strong></span> core</h2>
|
|
<p>Core Module - Gui
|
|
- Used to define new gui elements and gui event handlers</p>
|
|
<p></p>
|
|
|
|
|
|
<!-- module info start -->
|
|
<!-- module info end -->
|
|
|
|
<!-- module usage start -->
|
|
<h3>Usage</h3>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Defining a button that prints the player's name
|
|
</span><span class="keyword">local</span> example_button =
|
|
Gui.element{
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button'</span>
|
|
}
|
|
:on_click(<span class="keyword">function</span>(player,element,event)
|
|
player.<span class="global">print</span>(player.name)
|
|
<span class="keyword">end</span>)</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Defining a button with a custom style
|
|
</span><span class="keyword">local</span> example_button =
|
|
Gui.element{
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button'</span>
|
|
}
|
|
:style{
|
|
height = <span class="number">25</span>,
|
|
width = <span class="number">100</span>
|
|
}
|
|
:on_click(<span class="keyword">function</span>(player,element,event)
|
|
player.<span class="global">print</span>(player.name)
|
|
<span class="keyword">end</span>)</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Defining a button using a custom function
|
|
</span><span class="keyword">local</span> example_flow_with_button =
|
|
Gui.element(<span class="keyword">function</span>(event_trigger,parent)
|
|
<span class="comment">-- Add the flow the button is in
|
|
</span> <span class="keyword">local</span> flow =
|
|
parent.add{
|
|
name = <span class="string">'example_flow'</span>,
|
|
<span class="global">type</span> = <span class="string">'flow'</span>
|
|
}
|
|
|
|
<span class="comment">-- Get the players name
|
|
</span> <span class="keyword">local</span> player = game.players[parent.player_index]
|
|
<span class="keyword">local</span> player_name = player.name
|
|
|
|
<span class="comment">-- Add the button
|
|
</span> <span class="keyword">local</span> element =
|
|
flow.add{
|
|
name = event_trigger,
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button: '</span>..player_name
|
|
}
|
|
|
|
<span class="comment">-- Set the style of the button
|
|
</span> <span class="keyword">local</span> style = element.style
|
|
style.height = <span class="number">25</span>
|
|
style.width = <span class="number">100</span>]
|
|
style.font_color = player.color
|
|
|
|
<span class="comment">-- Return the element
|
|
</span> <span class="keyword">return</span> element
|
|
<span class="keyword">end</span>)
|
|
:on_click(<span class="keyword">function</span>(player,element,event)
|
|
player.<span class="global">print</span>(player.name)
|
|
<span class="keyword">end</span>)</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Drawing an element
|
|
</span><span class="keyword">local</span> exmple_button_element = example_button(parent)
|
|
<span class="keyword">local</span> example_flow_with_button = example_flow_with_button(parent)</code></pre>
|
|
<!-- module usage end -->
|
|
|
|
<!-- module content header end -->
|
|
|
|
<!-- module section list start -->
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Dependencies">Dependencies</a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#utils.event">utils.event</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#mod-gui">mod-gui</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Tables">Tables</a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#top_elements">top_elements</a></td>
|
|
<td class="summary">Contains the uids of the elements that will show on the top flow and the auth function</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#left_elements">left_elements</a></td>
|
|
<td class="summary">Contains the uids of the elements that will show on the left flow and the open on join function</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#defines">defines</a></td>
|
|
<td class="summary">Table of all the elements which have been registed with the draw function and event handlers</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#file_paths">file_paths</a></td>
|
|
<td class="summary">An index used for debuging to find the file where different elements where registered</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#_prototype_element">_prototype_element</a></td>
|
|
<td class="summary">The element prototype which is returned from Gui.element</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#_mt_element">_mt_element</a></td>
|
|
<td class="summary">The prototype metatable applied to new element defines</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Fields">Fields</a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#uid">uid</a></td>
|
|
<td class="summary">The current highest uid that is being used, will not increase during runtime</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Element_Define">Element Define </a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#element">element(element_define)</a></td>
|
|
<td class="summary">Base function used to define new elements, can be used with a table or with a function</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element:style">Gui._prototype_element:style(style_define)</a></td>
|
|
<td class="summary">Extension of Gui.element when using the table method, values applied after the element is drawn</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element:add_to_top_flow">Gui._prototype_element:add_to_top_flow([authenticator])</a></td>
|
|
<td class="summary">Adds an element to be drawn to the top flow when a player joins</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element:add_to_left_flow">Gui._prototype_element:add_to_left_flow([open_on_join])</a></td>
|
|
<td class="summary">Adds an element to be drawn to the left flow when a player joins</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Element_Events">Element Events </a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_opened">Gui._prototype_element.on_opened</a></td>
|
|
<td class="summary">Called when the player opens a GUI.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_closed">Gui._prototype_element.on_closed</a></td>
|
|
<td class="summary">Called when the player closes the GUI they have open.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_click">Gui._prototype_element.on_click</a></td>
|
|
<td class="summary">Called when LuaGuiElement is clicked.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_confirmed">Gui._prototype_element.on_confirmed</a></td>
|
|
<td class="summary">Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_checked_changed">Gui._prototype_element.on_checked_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_elem_changed">Gui._prototype_element.on_elem_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement element value is changed (related to choose element buttons).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_location_changed">Gui._prototype_element.on_location_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement element location is changed (related to frames in player.gui.screen).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_tab_changed">Gui._prototype_element.on_tab_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement selected tab is changed (related to tabbed-panes).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_selection_changed">Gui._prototype_element.on_selection_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement selection state is changed (related to drop-downs and listboxes).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_switch_changed">Gui._prototype_element.on_switch_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement switch state is changed (related to switches).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_text_change">Gui._prototype_element.on_text_change</a></td>
|
|
<td class="summary">Called when LuaGuiElement text is changed by the player.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#Gui._prototype_element.on_value_changed">Gui._prototype_element.on_value_changed</a></td>
|
|
<td class="summary">Called when LuaGuiElement slider value is changed (related to the slider element).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Top_Flow">Top Flow </a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#toggle_top_flow">toggle_top_flow</a></td>
|
|
<td class="summary">Button which toggles the top flow elements</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#top_flow_button_style">top_flow_button_style</a></td>
|
|
<td class="summary">The style that should be used for buttons on the top flow</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#get_top_flow">get_top_flow(player)</a></td>
|
|
<td class="summary">Gets the flow which contains the elements for the top flow</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#update_top_flow">update_top_flow(player)</a></td>
|
|
<td class="summary">Updates the visible states of all the elements on a players top flow</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#toggle_top_flow">toggle_top_flow(player[, state])</a></td>
|
|
<td class="summary">Toggles the visible states of all the elements on a players top flow</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Left_Flow">Left Flow </a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#hide_left_flow">hide_left_flow</a></td>
|
|
<td class="summary">Button which hides the elements in the left flow</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#get_left_flow">get_left_flow(player)</a></td>
|
|
<td class="summary">Gets the flow which contains the elements for the left flow</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#hide_left_flow">hide_left_flow(player)</a></td>
|
|
<td class="summary">Hides all left elements for a player</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#toggle_left_element">toggle_left_element(player, element_define[, state])</a></td>
|
|
<td class="summary">Toggles the visible state of all a left element for a player</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="section-content-list">
|
|
<thead>
|
|
<h3><a href="#Helper_Functions">Helper Functions </a></h3>
|
|
<span></span>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="name"><a href="#get_player_from_element">get_player_from_element(element)</a></td>
|
|
<td class="summary">Get the player that owns a gui element</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#toggle_enabled_state">toggle_enabled_state(element[, state])</a></td>
|
|
<td class="summary">Will toggle the enabled state of an element or set it to the one given</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#toggle_visible_state">toggle_visible_state(element[, state])</a></td>
|
|
<td class="summary">Will toggle the visible state of an element or set it to the one given</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#destroy_if_valid">destroy_if_valid(element)</a></td>
|
|
<td class="summary">Destory a gui element without causing any errors, likly if the element may have already been removed</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#alignment">alignment(parent[, horizontal_align='right'][, vertical_align='center'][, name='alignment'])</a></td>
|
|
<td class="summary">Draw a flow that has custom element alignments, default is right align</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#scroll_table">scroll_table(parent, height, column_count[, name='scroll'])</a></td>
|
|
<td class="summary">Draw a scroll pane that has a table inside of it</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name"><a href="#header">header(parent, caption[, tooltip][, add_alignment=false][, name='header'])</a></td>
|
|
<td class="summary">Used to add a header to a frame, this has the option for a custom right alignment flow for buttons</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<!-- module section list end -->
|
|
|
|
<br />
|
|
|
|
<!-- section start -->
|
|
<h3><span id="Dependencies" class="section-title"><a href="#Dependencies">Dependencies</a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#utils.event" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="utils.event">utils.event</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#mod-gui" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="mod-gui">mod-gui</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Tables" class="section-title"><a href="#Tables">Tables</a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#top_elements" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="top_elements">top_elements</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Contains the uids of the elements that will show on the top flow and the auth function</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#left_elements" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="left_elements">left_elements</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Contains the uids of the elements that will show on the left flow and the open on join function</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#defines" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="defines">defines</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Table of all the elements which have been registed with the draw function and event handlers</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#file_paths" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="file_paths">file_paths</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">An index used for debuging to find the file where different elements where registered</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#_prototype_element" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="_prototype_element">_prototype_element</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">The element prototype which is returned from Gui.element</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#_mt_element" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="_mt_element">_mt_element</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">The prototype metatable applied to new element defines</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Fields:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>__call</em></strong>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Fields" class="section-title"><a href="#Fields">Fields</a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#uid" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="uid">uid</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">The current highest uid that is being used, will not increase during runtime</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>uid</em></strong>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Element_Define" class="section-title"><a href="#Element_Define">Element Define </a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#element" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="element">element(element_define)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Base function used to define new elements, can be used with a table or with a function</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>element_define</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a> or <a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
used to define how the element is draw, using a table is the simplist way of doing this
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
|
|
<span class="return-text">the new element define that is used to register events to this element</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Defining an element with a table
|
|
</span><span class="keyword">local</span> example_button =
|
|
Gui.element{
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button'</span>
|
|
}</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Defining an element with a function
|
|
</span><span class="keyword">local</span> example_flow_with_button =
|
|
Gui.element(<span class="keyword">function</span>(event_trigger,parent,...)
|
|
<span class="comment">-- Add the flow the button is in
|
|
</span> <span class="keyword">local</span> flow =
|
|
parent.add{
|
|
name = <span class="string">'example_flow'</span>,
|
|
<span class="global">type</span> = <span class="string">'flow'</span>
|
|
}
|
|
|
|
<span class="comment">-- Add the button
|
|
</span> <span class="keyword">local</span> element =
|
|
flow.add{
|
|
name = event_trigger,
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button'</span>
|
|
}
|
|
|
|
<span class="comment">-- Set the style of the button
|
|
</span> <span class="keyword">local</span> style = element.style
|
|
style.height = <span class="number">25</span>
|
|
style.width = <span class="number">100</span>
|
|
|
|
<span class="comment">-- Return the element
|
|
</span> <span class="keyword">return</span> element
|
|
<span class="keyword">end</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element:style" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element:style">Gui._prototype_element:style(style_define)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Extension of Gui.element when using the table method, values applied after the element is drawn</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>style_define</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a> or <a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
used to define how the style is applied, using a table is the simplist way of doing this
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
|
|
<span class="return-text">the new element define that is used to register events to this element</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Setting the height and width of the example button
|
|
</span><span class="keyword">local</span> example_button =
|
|
Gui.element{
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button'</span>
|
|
}
|
|
:style{
|
|
height = <span class="number">25</span>,
|
|
width = <span class="number">100</span>
|
|
}</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Using a function to set the style
|
|
</span><span class="keyword">local</span> example_button =
|
|
Gui.element{
|
|
<span class="global">type</span> = <span class="string">'button'</span>,
|
|
caption = <span class="string">'Example Button'</span>
|
|
}
|
|
:style(<span class="keyword">function</span>(style,element,...)
|
|
<span class="keyword">local</span> player = game.players[element.player_index]
|
|
style.height = <span class="number">25</span>
|
|
style.width = <span class="number">100</span>
|
|
style.font_color = player.color
|
|
<span class="keyword">end</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element:add_to_top_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element:add_to_top_flow">Gui._prototype_element:add_to_top_flow([authenticator])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Adds an element to be drawn to the top flow when a player joins</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>authenticator</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
called during toggle or update to decide if the element should be visible
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
|
|
<span class="return-text">the new element define that is used to register events to this element</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding the example button
|
|
</span>example_button:add_to_top_flow(<span class="keyword">function</span>(player)
|
|
<span class="comment">-- example button will only show when game time is less than 1 minute
|
|
</span> <span class="keyword">return</span> player.online_time < <span class="number">3600</span>
|
|
<span class="keyword">end</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element:add_to_left_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element:add_to_left_flow">Gui._prototype_element:add_to_left_flow([open_on_join])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Adds an element to be drawn to the left flow when a player joins</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>open_on_join</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a> or <a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
called during first darw to decide if the element is visible
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
|
|
<span class="return-text">the new element define that is used to register events to this element</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding the example button
|
|
</span>example_flow_with_button:add_to_left_flow(<span class="keyword">true</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Element_Events" class="section-title"><a href="#Element_Events">Element Events </a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_opened" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_opened">Gui._prototype_element.on_opened</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when the player opens a GUI.</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_closed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_closed">Gui._prototype_element.on_closed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when the player closes the GUI they have open.</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_click" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_click">Gui._prototype_element.on_click</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement is clicked.</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_confirmed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_confirmed">Gui._prototype_element.on_confirmed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_checked_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_checked_changed">Gui._prototype_element.on_checked_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_elem_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_elem_changed">Gui._prototype_element.on_elem_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement element value is changed (related to choose element buttons).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_location_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_location_changed">Gui._prototype_element.on_location_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement element location is changed (related to frames in player.gui.screen).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_tab_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_tab_changed">Gui._prototype_element.on_tab_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement selected tab is changed (related to tabbed-panes).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_selection_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_selection_changed">Gui._prototype_element.on_selection_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement selection state is changed (related to drop-downs and listboxes).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_switch_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_switch_changed">Gui._prototype_element.on_switch_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement switch state is changed (related to switches).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_text_change" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_text_change">Gui._prototype_element.on_text_change</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement text is changed by the player.</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#Gui._prototype_element.on_value_changed" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="Gui._prototype_element.on_value_changed">Gui._prototype_element.on_value_changed</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Called when LuaGuiElement slider value is changed (related to the slider element).</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-module-field-li">
|
|
|
|
<strong><em>handler</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
|
|
|
|
the event handler which will be called
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Top_Flow" class="section-title"><a href="#Top_Flow">Top Flow </a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#toggle_top_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="toggle_top_flow">toggle_top_flow</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Button which toggles the top flow elements</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#top_flow_button_style" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="top_flow_button_style">top_flow_button_style</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">The style that should be used for buttons on the top flow</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#get_top_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="get_top_flow">get_top_flow(player)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Gets the flow which contains the elements for the top flow</p>
|
|
<p class="section-item-description">(player)</p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>player</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
|
|
the player that you want to get the flow for
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
<span class="return-text">the top element flow</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Geting your top element flow
|
|
</span><span class="keyword">local</span> top_flow = Gui.get_top_flow(game.player)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#update_top_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="update_top_flow">update_top_flow(player)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Updates the visible states of all the elements on a players top flow</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>player</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
|
|
the player that you want to update the flow for
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Update your flow
|
|
</span>Gui.update_top_flow(game.player)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#toggle_top_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="toggle_top_flow">toggle_top_flow(player[, state])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Toggles the visible states of all the elements on a players top flow</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>player</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
|
|
the player that you want to toggle the flow for
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>state</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
|
|
if given then the state will be set to this state
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
<span class="return-text">the new visible state of the top flow</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Toggle your flow
|
|
</span>Gui.toggle_top_flow(game.player)</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Open your top flow
|
|
</span>Gui.toggle_top_flow(game.player,<span class="keyword">true</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Left_Flow" class="section-title"><a href="#Left_Flow">Left Flow </a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#hide_left_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="hide_left_flow">hide_left_flow</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Button which hides the elements in the left flow</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#get_left_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="get_left_flow">get_left_flow(player)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Gets the flow which contains the elements for the left flow</p>
|
|
<p class="section-item-description">(player)</p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>player</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
|
|
the player that you want to get the flow for
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
<span class="return-text">the left element flow</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Geting your left element flow
|
|
</span><span class="keyword">local</span> left_flow = Gui.get_left_flow(game.player)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#hide_left_flow" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="hide_left_flow">hide_left_flow(player)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Hides all left elements for a player</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>player</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
|
|
the player to hide the elements for
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Hide your left elements
|
|
</span>Gui.hide_left_flow(game.player)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#toggle_left_element" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="toggle_left_element">toggle_left_element(player, element_define[, state])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Toggles the visible state of all a left element for a player</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>player</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
|
|
the player that you want to toggle the element for
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>element_define</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
|
|
|
|
the element that you want to toggle for the player
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>state</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
|
|
if given then the state will be set to this state
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
<span class="return-text">the new visible state of the element</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Toggle your example button
|
|
</span>Gui.toggle_top_flow(game.player,example_flow_with_button)</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Open your example button
|
|
</span>Gui.toggle_top_flow(game.player,example_flow_with_button,<span class="keyword">true</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
<h3><span id="Helper_Functions" class="section-title"><a href="#Helper_Functions">Helper Functions </a></span></h3>
|
|
<dl class="section-body-container">
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#get_player_from_element" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="get_player_from_element">get_player_from_element(element)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Get the player that owns a gui element</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>element</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the element that you want to get the owner of
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaPlayer.html">LuaPlayer</a></span>)
|
|
<span class="return-text">the player that owns this element</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Geting the owner of an element
|
|
</span><span class="keyword">local</span> player = Gui.get_player_from_element(element)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#toggle_enabled_state" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="toggle_enabled_state">toggle_enabled_state(element[, state])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Will toggle the enabled state of an element or set it to the one given</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>element</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the element that you want to toggle the state of
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>state</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
|
|
the state that you want to set
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
<span class="return-text">the new enabled state that the element has</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Toggling the the enabled state
|
|
</span><span class="keyword">local</span> new_enabled_state = Gui.toggle_enabled_state(element)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#toggle_visible_state" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="toggle_visible_state">toggle_visible_state(element[, state])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Will toggle the visible state of an element or set it to the one given</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>element</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the element that you want to toggle the state of
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>state</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
|
|
the state that you want to set
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
<span class="return-text">the new visible state that the element has</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Toggling the the visible state
|
|
</span><span class="keyword">local</span> new_visible_state = Gui.toggle_visible_state(element)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#destroy_if_valid" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="destroy_if_valid">destroy_if_valid(element)</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Destory a gui element without causing any errors, likly if the element may have already been removed</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>element</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the element that you want to remove
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
<span class="return-text">true if the element was valid and has been removed</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Likely use case for element not existing
|
|
</span>Gui.destroy_if_valid(element[child_name])</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#alignment" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="alignment">alignment(parent[, horizontal_align='right'][, vertical_align='center'][, name='alignment'])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Draw a flow that has custom element alignments, default is right align</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>parent</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the parent element that the alignment flow will be added to
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>horizontal_align</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
|
|
|
|
the horizontal alignment of the elements in the flow
|
|
|
|
(<em>default</em>: 'right')
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>vertical_align</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
|
|
|
|
the vertical alignment of the elements in the flow
|
|
|
|
(<em>default</em>: 'center')
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>name</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
|
|
|
|
the name of the alignment flow
|
|
|
|
(<em>default</em>: 'alignment')
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
<span class="return-text">the alignment flow that was created</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a right align flow
|
|
</span><span class="keyword">local</span> alignment = Gui.alignment(element,<span class="string">'example_right_alignment'</span>)</code></pre>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a horizontal center and top align flow
|
|
</span><span class="keyword">local</span> alignment = Gui.alignment(element,<span class="string">'example_center_top_alignment'</span>,<span class="string">'center'</span>,<span class="string">'top'</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#scroll_table" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="scroll_table">scroll_table(parent, height, column_count[, name='scroll'])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Draw a scroll pane that has a table inside of it</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>parent</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the parent element that the scroll table will be added to
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>height</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
|
|
|
|
the maximum height for the scroll pane
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>column_count</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
|
|
|
|
the number of columns that the table will have
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>name</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
|
|
|
|
the name of the scroll pane that is added, the table is always called 'table'
|
|
|
|
(<em>default</em>: 'scroll')
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
<span class="return-text">the table that was created</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a scroll table with max height of 200 and column count of 3
|
|
</span><span class="keyword">local</span> scroll_table = Gui.scroll_table(element,<span class="string">'example_scroll_table'</span>,<span class="number">200</span>,<span class="number">3</span>)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
<dt>
|
|
<div class="divider divider-custom"></div>
|
|
<div class="block section-item-header">
|
|
<a href="#header" class="fragment-hashtag">#</a>
|
|
<span class="section-item-title" id="header">header(parent, caption[, tooltip][, add_alignment=false][, name='header'])</span>
|
|
</div>
|
|
</dt>
|
|
<dd>
|
|
<div class="section-item-body">
|
|
|
|
<p class="section-item-summary">Used to add a header to a frame, this has the option for a custom right alignment flow for buttons</p>
|
|
<p class="section-item-description"></p>
|
|
|
|
<!-- parameters start -->
|
|
<strong>Parameters:</strong>
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>parent</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
|
|
the parent element that the header will be added to
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>caption</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a> or <a class="type" href="http://lua-api.factorio.com/latest/Concepts.html#LocalizedString">LocalizedString</a></span>)
|
|
|
|
the caption that will be shown on the header
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>tooltip</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a> or <a class="type" href="http://lua-api.factorio.com/latest/Concepts.html#LocalizedString">LocalizedString</a></span>)
|
|
|
|
the tooltip that will be shown on the header
|
|
|
|
(<em>optional</em>)
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>add_alignment</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>)
|
|
|
|
when true an alignment flow will be added for buttons
|
|
|
|
(<em>default</em>: false)
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="section-subitem-li">
|
|
|
|
<strong><em>name</em></strong>
|
|
|
|
<strong> : </strong>
|
|
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
|
|
|
|
the name of the header that is being added, the alignment is always called 'alignment'
|
|
|
|
(<em>default</em>: 'header')
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<!-- parameters end -->
|
|
|
|
<!-- returns start -->
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li>
|
|
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>)
|
|
<span class="return-text">either the header or the header alignment if add_alignment is true</span>
|
|
</li>
|
|
</ul>
|
|
<!-- returns end -->
|
|
|
|
|
|
<!-- see also start -->
|
|
<!-- see also end -->
|
|
|
|
<!-- usage start -->
|
|
<strong>Usage:</strong>
|
|
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a custom header
|
|
</span><span class="keyword">local</span> header_alignment = Gui.header(
|
|
element,
|
|
<span class="string">'example_header'</span>,
|
|
<span class="string">'Example Caption'</span>,
|
|
<span class="string">'Example Tooltip'</span>,
|
|
<span class="keyword">true</span>
|
|
)</code></pre>
|
|
<!-- usage end -->
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<!-- section end -->
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer container grid-1280">
|
|
<div class="divider divider-custom"></div>
|
|
<div class="footer-columns columns">
|
|
<div class="sidebar-footer column col-3 col-sm-12">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
|
</div>
|
|
<div class="content-footer column col-9 col-sm-12">
|
|
<i>Last updated 2019-10-25 23:42:24 UTC</i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|