Removed outdated docs

This commit is contained in:
Cooldude2606
2019-05-29 21:33:09 +01:00
parent 922cd225e5
commit 98f6266ad1
20 changed files with 0 additions and 8632 deletions

View File

@@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="modules/FSM.html">FSM</a></li>
<li><a href="modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="modules/FSM.html">FSM</a></td>
<td class="summary">Factorio Softmod Manager</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></td>
<td class="summary">A full ranking system for factorio.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></td>
<td class="summary">Adds a objective version to custom guis.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></td>
<td class="summary">Adds a uniform preset for guis in the center of the screen which allow for different tabs to be opened</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></td>
<td class="summary">Adds a clean way of making new inputs for a gui allowing for sliders and text inputs to be hanndleded with custom events</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></td>
<td class="summary">Adds a organiser for left gui ellements which will automaticaly update there information and have open requirements</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></td>
<td class="summary">Adds a location for popups which can be dismissed by a player and created from other scripts</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></td>
<td class="summary">Used to test all gui elements and parts can be used in game via Gui.test()</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></td>
<td class="summary">Adds a toolbar to the top left of the screen</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></td>
<td class="summary">A full ranking system for factorio.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></td>
<td class="summary">Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></td>
<td class="summary">Allows syncing with an outside server and info panle.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/ExpGamingLib.html">ExpGamingLib</a></td>
<td class="summary">Adds some common functions used though out all ExpGaming modules</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/StdLib.Color.html">StdLib.Color</a></td>
<td class="summary">A defines module for retrieving colors by name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/StdLib.Game.html">StdLib.Game</a></td>
<td class="summary">The game module.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/StdLib.String.html">StdLib.String</a></td>
<td class="summary">Extends Lua 5.2 string.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/StdLib.Table.html">StdLib.Table</a></td>
<td class="summary">Extends Lua 5.2 table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/StdLib.Time.html">StdLib.Time</a></td>
<td class="summary">A defines module for retrieving the number of ticks in 1 unit of time.</td>
</tr>
</table>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,303 +0,0 @@
/* BEGIN RESET
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.2r1
*/
html {
color: #000;
background: #FFF;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0;
}
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
font-style: inherit;
font-weight: inherit;
}
del,ins {
text-decoration: none;
}
li {
margin-left: 20px;
}
caption,th {
text-align: left;
}
h1,h2,h3,h4,h5,h6 {
font-size: 100%;
font-weight: bold;
}
q:before,q:after {
content: '';
}
abbr,acronym {
border: 0;
font-variant: normal;
}
sup {
vertical-align: baseline;
}
sub {
vertical-align: baseline;
}
legend {
color: #000;
}
input,button,textarea,select,optgroup,option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
input,button,textarea,select {*font-size:100%;
}
/* END RESET */
body {
margin-left: 1em;
margin-right: 1em;
font-family: arial, helvetica, geneva, sans-serif;
background-color: #ffffff; margin: 0px;
}
code, tt { font-family: monospace; font-size: 1.1em; }
span.parameter { font-family:monospace; }
span.parameter:after { content:":"; }
span.types:before { content:"("; }
span.types:after { content:")"; }
.type { font-weight: bold; font-style:italic }
body, p, td, th { font-size: .95em; line-height: 1.2em;}
p, ul { margin: 10px 0 0 0px;}
strong { font-weight: bold;}
em { font-style: italic;}
h1 {
font-size: 1.5em;
margin: 20px 0 20px 0;
}
h2, h3, h4 { margin: 15px 0 10px 0; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.15em; }
h4 { font-size: 1.06em; }
a:link { font-weight: bold; color: #004080; text-decoration: none; }
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
a:link:hover { text-decoration: underline; }
hr {
color:#cccccc;
background: #00007f;
height: 1px;
}
blockquote { margin-left: 3em; }
ul { list-style-type: disc; }
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
}
pre {
background-color: rgb(245, 245, 245);
border: 1px solid #C0C0C0; /* silver */
padding: 10px;
margin: 10px 0 10px 0;
overflow: auto;
font-family: "Andale Mono", monospace;
}
pre.example {
font-size: .85em;
}
table.index { border: 1px #00007f; }
table.index td { text-align: left; vertical-align: top; }
#container {
margin-left: 1em;
margin-right: 1em;
background-color: #f0f0f0;
}
#product {
text-align: center;
border-bottom: 1px solid #cccccc;
background-color: #ffffff;
}
#product big {
font-size: 2em;
}
#main {
background-color: #f0f0f0;
border-left: 2px solid #cccccc;
}
#navigation {
float: left;
width: 14em;
vertical-align: top;
background-color: #f0f0f0;
overflow: visible;
}
#navigation h2 {
background-color:#e7e7e7;
font-size:1.1em;
color:#000000;
text-align: left;
padding:0.2em;
border-top:1px solid #dddddd;
border-bottom:1px solid #dddddd;
}
#navigation ul
{
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
}
#navigation li {
text-indent: -1em;
display: block;
margin: 3px 0px 0px 22px;
}
#navigation li li a {
margin: 0px 3px 0px -1em;
}
#content {
margin-left: 14em;
padding: 1em;
width: 700px;
border-left: 2px solid #cccccc;
border-right: 2px solid #cccccc;
background-color: #ffffff;
}
#about {
clear: both;
padding: 5px;
border-top: 2px solid #cccccc;
background-color: #ffffff;
}
@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a { font-weight: bold; color: #004080; text-decoration: underline; }
#main {
background-color: #ffffff;
border-left: 0px;
}
#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}
#content {
padding: 1em;
background-color: #ffffff;
}
#navigation {
display: none;
}
pre.example {
font-family: "Andale Mono", monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}
table.module_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.module_list td.name { background-color: #f0f0f0; min-width: 200px; }
table.module_list td.summary { width: 100%; }
table.function_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.function_list td.name { background-color: #f0f0f0; min-width: 200px; }
table.function_list td.summary { width: 100%; }
ul.nowrap {
overflow:auto;
white-space:nowrap;
}
dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
dl.table h3, dl.function h3 {font-size: .95em;}
/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }
/* make the target distinct; helps when we're navigating to a function */
a:target + * {
background-color: #FF9;
}
/* styles for prettification of source */
pre .comment { color: #558817; }
pre .constant { color: #a8660d; }
pre .escape { color: #844631; }
pre .keyword { color: #aa5050; font-weight: bold; }
pre .library { color: #0e7c6b; }
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
pre .string { color: #8080ff; }
pre .number { color: #f8660d; }
pre .operator { color: #2239a8; font-weight: bold; }
pre .preprocessor, pre .prepro { color: #a33243; }
pre .global { color: #800080; }
pre .user-keyword { color: #800080; }
pre .prompt { color: #558817; }
pre .url { color: #272fc2; text-decoration: underline; }

View File

@@ -1,401 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><strong>ExpGamingCore.Command</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Command</code></h1>
<p>A full ranking system for factorio.</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#format_inputs">format_inputs (command)</a></td>
<td class="summary">Returns the inputs of this command as a formated string</td>
</tr>
<tr>
<td class="name" nowrap><a href="#validate_args">validate_args (event)</a></td>
<td class="summary">Used to validate the arguments of a command, will understand strings with "" as a single param else spaces divede the params</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_commands">get_commands (player)</a></td>
<td class="summary">Used to return all the commands a player can use</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_command">add_command (name[, description='No Description'][, inputs=an infite string], callback)</a></td>
<td class="summary">Used to define commands</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#validate">validate</a></td>
<td class="summary">Collection of funcations that can be used to validate inputs</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#error">error</a></td>
<td class="summary">Used as an error constant for validation</td>
</tr>
<tr>
<td class="name" nowrap><a href="#data">data</a></td>
<td class="summary">Index of all command data</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "format_inputs"></a>
<strong>format_inputs (command)</strong>
</dt>
<dd>
Returns the inputs of this command as a formated string
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">command</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a>, <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a> or <span class="type">event</span></span>
the command to get the inputs of
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the formated string for the inputs
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">commands.format_inputs(<span class="string">'interface'</span>) <span class="comment">-- returns &lt;code&gt; (if you have ExpGamingCore.Server)</span></pre>
</ul>
</dd>
<dt>
<a name = "validate_args"></a>
<strong>validate_args (event)</strong>
</dt>
<dd>
Used to validate the arguments of a command, will understand strings with "" as a single param else spaces divede the params
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
this is the event created by add_command not on_console_command
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the error that happend while parsing the args
</ol>
<h3>Or</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the args for this command
</ol>
<h3>Or</h3>
<ol>
command.error
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">commands.validate_args(event) <span class="comment">-- returns args table</span></pre>
</ul>
</dd>
<dt>
<a name = "get_commands"></a>
<strong>get_commands (player)</strong>
</dt>
<dd>
Used to return all the commands a player can use
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">index</span>, <span class="type">name</span> or <span class="type">player</span></span>
the player to test as
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a table containg all the commands the player can use
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">get_commands(<span class="number">1</span>) <span class="comment">-- return table of command data for each command that the player can use</span></pre>
</ul>
</dd>
<dt>
<a name = "add_command"></a>
<strong>add_command (name[, description='No Description'][, inputs=an infite string], callback)</strong>
</dt>
<dd>
Used to define commands
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the command
</li>
<li><span class="parameter">description</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the description of the command
(<em>default</em> 'No Description')
</li>
<li><span class="parameter">inputs</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a table of the inputs to be used, last index being true makes the last parameter open ended (longer than one word)
(<em>default</em> an infite string)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function to call on the event
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="comment">--see examples in file</span></pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "validate"></a>
<strong>validate</strong>
</dt>
<dd>
Collection of funcations that can be used to validate inputs
<h3>Fields:</h3>
<ul>
<li><span class="parameter">__comment</span>
replace _ with - the ldoc did not like me using - in the names
</li>
<li><span class="parameter">string</span>
basicly does nothing but a type filed is required
</li>
<li><span class="parameter">string_inf</span>
same as string but is infite in length, must be last arg
</li>
<li><span class="parameter">string_len</span>
same as string but can define a max lengh
</li>
<li><span class="parameter">number</span>
converts the input into a number
</li>
<li><span class="parameter">number_int</span>
conerts the input to a number and floors it
</li>
<li><span class="parameter">number_range</span>
allows a number in a range after it has been floored min < math.floor(X) <= max
</li>
<li><span class="parameter">number_range</span>
allows a number in a range after it has been floored min < math.floor(X) <= max
</li>
<li><span class="parameter">player</span>
converts the input into a valid player
</li>
<li><span class="parameter">player_online</span>
converts the input to a player if the player is online
</li>
<li><span class="parameter">player_alive</span>
converts the input to a player if the player is online and alive
</li>
<li><span class="parameter">player_rank</span>
-online converts the input to a player if the player is a lower rank than the user and online
</li>
<li><span class="parameter">player_rank</span>
-online converts the input to a player if the player is a lower rank than the user and online
</li>
<li><span class="parameter">player_rank_alive</span>
converts the input to a player if the player is a lower rank than the user and online and alive
</li>
<li><span class="parameter">type</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the type that the value should be
</li>
<li><span class="parameter">value</span>
the value that will be tested
</li>
<li><span class="parameter">...</span>
any other data that can be passed to the function
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">commands.validate[<span class="global">type</span>](value,event,...)</pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "error"></a>
<strong>error</strong>
</dt>
<dd>
Used as an error constant for validation
<h3>Usage:</h3>
<ul>
<li><pre class="example"><span class="keyword">return</span> commands.<span class="global">error</span>, <span class="string">'err message'</span></pre></li>
<li><pre class="example"><span class="keyword">return</span> commands.<span class="global">error</span>(<span class="string">'err message'</span>)</pre></li>
</ul>
</dd>
<dt>
<a name = "data"></a>
<strong>data</strong>
</dt>
<dd>
Index of all command data
<ul>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a>, <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a> or <span class="type">event</span></span>
the command that will be returned: string is the name, table is the command data, event is event from add_command
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">commands.command_name <span class="comment">-- returns command data</span></pre></li>
<li><pre class="example">commands.data <span class="comment">-- returns all data</span></pre></li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,337 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><strong>ExpGamingCore.Gui.Center</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui.Center</code></h1>
<p>Adds a uniform preset for guis in the center of the screen which allow for different tabs to be opened</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add (obj)</a></td>
<td class="summary">Adds a new obj to the center gui</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_flow">get_flow (player)</a></td>
<td class="summary">Used to get the center frame of the player, used mainly in script</td>
</tr>
<tr>
<td class="name" nowrap><a href="#open">open (player, center)</a></td>
<td class="summary">Used to open a center frame for a player</td>
</tr>
<tr>
<td class="name" nowrap><a href="#open_tab">open_tab (player, center, tab)</a></td>
<td class="summary">Used to open a center frame for a player</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear (player)</a></td>
<td class="summary">Used to clear the center frame of the player, used mainly in script</td>
</tr>
<tr>
<td class="name" nowrap><a href="#center._center:add_tab">center._center:add_tab (name, caption[, tooltip], callback)</a></td>
<td class="summary">If deafult draw is used then you can add tabs to the gui with this function</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
</dd>
<dt>
<a name = "add"></a>
<strong>add (obj)</strong>
</dt>
<dd>
Adds a new obj to the center gui
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
contains the new object, needs name, fraw is opt and is function(root_frame)
</li>
</ul>
<h3>Returns:</h3>
<ol>
the object made, used to add tabs
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.center.add{name=<span class="string">'foo'</span>,caption=<span class="string">'Foo'</span>,tooltip=<span class="string">'Testing'</span>,draw=<span class="keyword">function</span>}</pre>
</ul>
</dd>
<dt>
<a name = "get_flow"></a>
<strong>get_flow (player)</strong>
</dt>
<dd>
Used to get the center frame of the player, used mainly in script
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
a player indifier to get the flow for
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the gui element flow
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.center.get_flow(player) <span class="comment">-- returns gui emelemt</span></pre>
</ul>
</dd>
<dt>
<a name = "open"></a>
<strong>open (player, center)</strong>
</dt>
<dd>
Used to open a center frame for a player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
a player indifier to get the flow for
</li>
<li><span class="parameter">center</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the center frame to open
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
based on if it successed or not
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.center.open(player,<span class="string">'server-info'</span>) <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "open_tab"></a>
<strong>open_tab (player, center, tab)</strong>
</dt>
<dd>
Used to open a center frame for a player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
a player indifier to get the flow for
</li>
<li><span class="parameter">center</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the center frame to open
</li>
<li><span class="parameter">tab</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the tab to open
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
based on if it successed or not
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.center.open_tab(player,<span class="string">'readme'</span>,<span class="string">'rules'</span>) <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "clear"></a>
<strong>clear (player)</strong>
</dt>
<dd>
Used to clear the center frame of the player, used mainly in script
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
a player indifier to get the flow for
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.center.clear(player)</pre>
</ul>
</dd>
<dt>
<a name = "center._center:add_tab"></a>
<strong>center._center:add_tab (name, caption[, tooltip], callback)</strong>
</dt>
<dd>
If deafult draw is used then you can add tabs to the gui with this function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
this is the name of the tab
</li>
<li><span class="parameter">caption</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
this is the words that appear on the tab button
</li>
<li><span class="parameter">tooltip</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the tooltip that is on the button
(<em>optional</em>)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
this is called when button is pressed with function(root_frame)
</li>
</ul>
<h3>Returns:</h3>
<ol>
self to allow chaining of _center:add_tab
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">_center:add_tab(<span class="string">'foo'</span>,<span class="string">'Foo'</span>,<span class="string">'Just a tab'</span>,<span class="keyword">function</span>)</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,498 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><strong>ExpGamingCore.Gui.Inputs</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui.Inputs</code></h1>
<p>Adds a clean way of making new inputs for a gui allowing for sliders and text inputs to be hanndleded with custom events</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module</td>
</tr>
<tr>
<td class="name" nowrap><a href="#inputs._input:on_event">inputs._input:on_event (event, callback)</a></td>
<td class="summary">Sets the input to trigger on an certain event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#inputs._input:draw">inputs._input:draw (root)</a></td>
<td class="summary">Draw the input into the root element</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add (obj)</a></td>
<td class="summary">Add a new input, this is the same as doing frame.add{} but returns a diffrent object</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_elem_button">add_elem_button (name, elem_type, tooltip, callback)</a></td>
<td class="summary">Used to define a choose-elem-button callback only on elem_changed</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_checkbox">add_checkbox (name, radio, display, default, callback_true, callback_false)</a></td>
<td class="summary">Used to define a checkbox callback only on state_changed</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_radio">reset_radio (elements)</a></td>
<td class="summary">Used to reset the state of radio buttons, recomened to be called on_state_change to reset any radio buttons it is ment to work with.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_text">add_text (name, box, text, callback)</a></td>
<td class="summary">Used to define a text callback only on text_changed</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_slider">add_slider (name, orientation, min, max, start_callback, callback)</a></td>
<td class="summary">Used to define a slider callback only on value_changed</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_drop_down">add_drop_down (name, items, index, callback)</a></td>
<td class="summary">Used to define a drop down callback only on value_changed</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
</dd>
<dt>
<a name = "inputs._input:on_event"></a>
<strong>inputs._input:on_event (event, callback)</strong>
</dt>
<dd>
Sets the input to trigger on an certain event
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
the event to raise callback on | can be number of the event | can be a key of inputs.events
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function you want to run on the event
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
returns self so you can chain together
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">button:on_event(defines.events.on_gui_click,player_return)</pre>
</ul>
</dd>
<dt>
<a name = "inputs._input:draw"></a>
<strong>inputs._input:draw (root)</strong>
</dt>
<dd>
Draw the input into the root element
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">root</span>
the element you want to add the input to
</li>
</ul>
<h3>Returns:</h3>
<ol>
returns the element that was added
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">button:draw(frame)</pre>
</ul>
</dd>
<dt>
<a name = "add"></a>
<strong>add (obj)</strong>
</dt>
<dd>
Add a new input, this is the same as doing frame.add{} but returns a diffrent object
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the new element to add if caption is a sprite path then sprite is used
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the custom input object
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.add{<span class="global">type</span>=<span class="string">'button'</span>,name=<span class="string">'test'</span>,caption=<span class="string">'Test'</span>}</pre>
</ul>
</dd>
<dt>
<a name = "add_elem_button"></a>
<strong>add_elem_button (name, elem_type, tooltip, callback)</strong>
</dt>
<dd>
Used to define a choose-elem-button callback only on elem_changed
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of this button
</li>
<li><span class="parameter">elem_type</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the display for this button, either text or sprite path
</li>
<li><span class="parameter">tooltip</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the tooltip to show on the button
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the callback to call on change function(player,element,elem)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the button object that was made, to allow a custom error event if wanted
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.add_elem_button(<span class="string">'test'</span>,<span class="string">'Test'</span>,<span class="string">'Just for testing'</span>,<span class="keyword">function</span>)</pre>
</ul>
</dd>
<dt>
<a name = "add_checkbox"></a>
<strong>add_checkbox (name, radio, display, default, callback_true, callback_false)</strong>
</dt>
<dd>
Used to define a checkbox callback only on state_changed
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of this button
</li>
<li><span class="parameter">radio</span>
<span class="types"><span class="type">boolean</span></span>
if this is a radio button
</li>
<li><span class="parameter">display</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the display for this button, either text or sprite path
</li>
<li><span class="parameter">default</span>
<span class="types"><span class="type">function</span></span>
the callback which choses the default check state
</li>
<li><span class="parameter">callback_true</span>
<span class="types"><span class="type">function</span></span>
the callback to call when changed to true
</li>
<li><span class="parameter">callback_false</span>
<span class="types"><span class="type">function</span></span>
the callback to call when changed to false
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the button object that was made, to allow a custom error event if wanted
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.add_checkbox(<span class="string">'test'</span>,<span class="keyword">false</span>,<span class="string">'Just for testing'</span>,<span class="keyword">function</span>,<span class="keyword">function</span>,funvtion)</pre>
</ul>
</dd>
<dt>
<a name = "reset_radio"></a>
<strong>reset_radio (elements)</strong>
</dt>
<dd>
Used to reset the state of radio buttons, recomened to be called on_state_change to reset any radio buttons it is ment to work with.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">elements</span>
can be a list of elements or a single element
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.reset_radio{radio1,radio2,...}</pre>
</ul>
</dd>
<dt>
<a name = "add_text"></a>
<strong>add_text (name, box, text, callback)</strong>
</dt>
<dd>
Used to define a text callback only on text_changed
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of this button
</li>
<li><span class="parameter">box</span>
<span class="types"><span class="type">boolean</span></span>
is it a text box rather than a text field
</li>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the starting text
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the callback to call on change function(player,text,element)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the text object that was made, to allow a custom error event if wanted
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.add_text(<span class="string">'test'</span>,<span class="keyword">false</span>,<span class="string">'Just for testing'</span>,<span class="keyword">function</span>)</pre>
</ul>
</dd>
<dt>
<a name = "add_slider"></a>
<strong>add_slider (name, orientation, min, max, start_callback, callback)</strong>
</dt>
<dd>
Used to define a slider callback only on value_changed
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of this button
</li>
<li><span class="parameter">orientation</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
direction of the slider
</li>
<li><span class="parameter">min</span>
<span class="types"><span class="type">number</span></span>
the lowest number
</li>
<li><span class="parameter">max</span>
<span class="types"><span class="type">number</span></span>
the highest number
</li>
<li><span class="parameter">start_callback</span>
<span class="types"><span class="type">function</span></span>
either a number or a function to return a number
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function to be called on value_changed function(player,value,percent,element)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the slider object that was made, to allow a custom error event if wanted
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.add_slider(<span class="string">'test'</span>,<span class="string">'horizontal'</span>,<span class="number">1</span>,<span class="number">10</span>,<span class="number">5</span>,<span class="keyword">function</span>)</pre>
</ul>
</dd>
<dt>
<a name = "add_drop_down"></a>
<strong>add_drop_down (name, items, index, callback)</strong>
</dt>
<dd>
Used to define a drop down callback only on value_changed
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
name of the drop down
</li>
<li><span class="parameter">items</span>
either a list or a function which returns a list
</li>
<li><span class="parameter">index</span>
either a number or a function which returns a number
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the callback which is called when a new index is selected function(player,selected,items,element)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the drop-down object that was made, to allow a custom error event if wanted
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.inputs.add_drop_down(<span class="string">'test'</span>,{<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>},<span class="number">1</span>,<span class="keyword">function</span>)</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,240 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><strong>ExpGamingCore.Gui.Left</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui.Left</code></h1>
<p>Adds a organiser for left gui ellements which will automaticaly update there information and have open requirements</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add (obj)</a></td>
<td class="summary">Used to add a left gui frame</td>
</tr>
<tr>
<td class="name" nowrap><a href="#update">update ([frame[, players]])</a></td>
<td class="summary">This is used to update all the guis of connected players, good idea to use our thread system as it as nested for loops</td>
</tr>
<tr>
<td class="name" nowrap><a href="#open">open (left_name)</a></td>
<td class="summary">Used to open the left gui of every player</td>
</tr>
<tr>
<td class="name" nowrap><a href="#close">close (left_name)</a></td>
<td class="summary">Used to close the left gui of every player</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
</dd>
<dt>
<a name = "add"></a>
<strong>add (obj)</strong>
</dt>
<dd>
Used to add a left gui frame
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
this is what will be made, needs a name and a draw function(root_frame), open_on_join can be used to set the deaful state true/false, can_open is a test to block it from opening but is not needed
</li>
</ul>
<h3>Returns:</h3>
<ol>
the object that is made to... well idk but for the future
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.add{name=<span class="string">'foo'</span>,caption=<span class="string">'Foo'</span>,tooltip=<span class="string">'just testing'</span>,open_on_join=<span class="keyword">true</span>,can_open=<span class="keyword">function</span>,draw=<span class="keyword">function</span>}</pre>
</ul>
</dd>
<dt>
<a name = "update"></a>
<strong>update ([frame[, players]])</strong>
</dt>
<dd>
This is used to update all the guis of connected players, good idea to use our thread system as it as nested for loops
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">frame</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
this is the name of a frame if you only want to update one
(<em>optional</em>)
</li>
<li><span class="parameter">players</span>
the player to update for, if not given all players are updated, can be one player
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.update()</pre>
</ul>
</dd>
<dt>
<a name = "open"></a>
<strong>open (left_name)</strong>
</dt>
<dd>
Used to open the left gui of every player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">left_name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
this is the gui that you want to open
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.open(<span class="string">'foo'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "close"></a>
<strong>close (left_name)</strong>
</dt>
<dd>
Used to close the left gui of every player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">left_name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
this is the gui that you want to close
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.close(<span class="string">'foo'</span>)</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,185 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><strong>ExpGamingCore.Gui.Popup</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui.Popup</code></h1>
<p>Adds a location for popups which can be dismissed by a player and created from other scripts</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add (obj)</a></td>
<td class="summary">Used to add a popup gui style</td>
</tr>
<tr>
<td class="name" nowrap><a href="#open">open (style, data[, players=game.connected_players])</a></td>
<td class="summary">Use to open a popup for these players</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
</dd>
<dt>
<a name = "add"></a>
<strong>add (obj)</strong>
</dt>
<dd>
Used to add a popup gui style
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
this is what will be made, needs a name and a draw function(root_frame,data)
</li>
</ul>
<h3>Returns:</h3>
<ol>
the object that is made to... well idk but for the future
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.add{name=<span class="string">'foo'</span>,caption=<span class="string">'Foo'</span>,draw=<span class="keyword">function</span>}</pre>
</ul>
</dd>
<dt>
<a name = "open"></a>
<strong>open (style, data[, players=game.connected_players])</strong>
</dt>
<dd>
Use to open a popup for these players
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
this is the name you gave to the popup when added
</li>
<li><span class="parameter">data</span>
this is the data that is sent to the draw function
</li>
<li><span class="parameter">players</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the players to open the popup for
(<em>default</em> game.connected_players)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.popup.open(<span class="string">'ban'</span>,<span class="keyword">nil</span>,{player=<span class="number">1</span>,reason=<span class="string">'foo'</span>})</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><strong>ExpGamingCore.Gui.Test</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui.Test</code></h1>
<p>Used to test all gui elements and parts can be used in game via Gui.test()</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Gui.test">Gui.test ([player=game.player])</a></td>
<td class="summary">The funcation that is called when calling Gui.test</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
</dd>
<dt>
<a name = "Gui.test"></a>
<strong>Gui.test ([player=game.player])</strong>
</dt>
<dd>
The funcation that is called when calling Gui.test
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
a pointer to a player to draw the test gui for
(<em>default</em> game.player)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.test() <span class="comment">-- draws test gui</span></pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,190 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><strong>ExpGamingCore.Gui.Toolbar</strong></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui.Toolbar</code></h1>
<p>Adds a toolbar to the top left of the screen</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add (name, caption, tooltip, callback)</a></td>
<td class="summary">Add a button to the toolbar, ranks need to be allowed to use these buttons if ranks is preset</td>
</tr>
<tr>
<td class="name" nowrap><a href="#draw">draw (player)</a></td>
<td class="summary">Draws the toolbar for a certain player</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
</dd>
<dt>
<a name = "add"></a>
<strong>add (name, caption, tooltip, callback)</strong>
</dt>
<dd>
Add a button to the toolbar, ranks need to be allowed to use these buttons if ranks is preset
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the button
</li>
<li><span class="parameter">caption</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
can be a sprite path or text to show
</li>
<li><span class="parameter">tooltip</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the help to show for the button
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function which is called on_click
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the button object that was made
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">toolbar.add(<span class="string">'foo'</span>,<span class="string">'Foo'</span>,<span class="string">'Test'</span>,<span class="keyword">function</span>() game.<span class="global">print</span>(<span class="string">'test'</span>) <span class="keyword">end</span>)</pre>
</ul>
</dd>
<dt>
<a name = "draw"></a>
<strong>draw (player)</strong>
</dt>
<dd>
Draws the toolbar for a certain player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
the player to draw the tool bar of
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">toolbar.draw(<span class="number">1</span>)</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,366 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
<li><a href="#modules_expgamingcore_gui_src_server_Functions">modules.expgamingcore.gui.src.server Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><strong>ExpGamingCore.Gui</strong></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Gui</code></h1>
<p>Adds a objective version to custom guis.</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#bar">bar (frame[, width=10])</a></td>
<td class="summary">Add a white bar to any gui frame</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_dropdown_index">set_dropdown_index (dropdown, _item)</a></td>
<td class="summary">Used to set the index of a drop down to a certian item</td>
</tr>
<tr>
<td class="name" nowrap><a href="#cam_link">cam_link (data)</a></td>
<td class="summary">Adds a camera that updates every tick (or less depeading on how many are opening) it will move to follow an entity</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#events">events</a></td>
<td class="summary">Stores all the on_player_joined_game event handlers for the guis</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ParametersForCamLink">ParametersForCamLink</a></td>
<td class="summary">Prams for Gui.cam_link</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#data">data</a></td>
<td class="summary">Used to set and get data about different guis</td>
</tr>
</table>
<h2><a href="#modules_expgamingcore_gui_src_server_Functions">modules.expgamingcore.gui.src.server Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This file will be loaded when ExpGamingCore.Command is present</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__comment">__comment ()</a></td>
<td class="summary">Adds a server thread that allows the camera follows to be toggled off and on</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "bar"></a>
<strong>bar (frame[, width=10])</strong>
</dt>
<dd>
Add a white bar to any gui frame
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">frame</span>
the frame to draw the line to
</li>
<li><span class="parameter">width</span>
the width of the bar
(<em>default</em> 10)
</li>
</ul>
<h3>Returns:</h3>
<ol>
the line that was made type is progressbar
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.bar(frame,<span class="number">100</span>)</pre>
</ul>
</dd>
<dt>
<a name = "set_dropdown_index"></a>
<strong>set_dropdown_index (dropdown, _item)</strong>
</dt>
<dd>
Used to set the index of a drop down to a certian item
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dropdown</span>
the dropdown that is to be effected
</li>
<li><span class="parameter">_item</span>
this is the item to look for
</li>
</ul>
<h3>Returns:</h3>
<ol>
returns the dropdown if it was successful
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.set_dropdown_index(dropdown,player.name) <span class="comment">-- will select the index with the players name as the value</span></pre>
</ul>
</dd>
<dt>
<a name = "cam_link"></a>
<strong>cam_link (data)</strong>
</dt>
<dd>
Adds a camera that updates every tick (or less depeading on how many are opening) it will move to follow an entity
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">data</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
contains all other params given below
</li>
</ul>
<h3>Returns:</h3>
<ol>
the camera that the function used be it made or given as a param
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Gui.cam_link{entity=game.player.character,frame=frame,width=<span class="number">50</span>,hight=<span class="number">50</span>,zoom=<span class="number">1</span>}</pre></li>
<li><pre class="example">Gui.cam_link{entity=game.player.character,cam=frame.camera,surface=game.surfaces[<span class="string">'testing'</span>]}</pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "events"></a>
<strong>events</strong>
</dt>
<dd>
Stores all the on_player_joined_game event handlers for the guis
</dd>
<dt>
<a name = "ParametersForCamLink"></a>
<strong>ParametersForCamLink</strong>
</dt>
<dd>
Prams for Gui.cam_link
<h3>Fields:</h3>
<ul>
<li><span class="parameter">entity</span>
this is the entity that the camera will follow
</li>
<li><span class="parameter">cam</span>
a camera that you already have in the gui
</li>
<li><span class="parameter">frame</span>
the frame to add the camera to, no effect if cam param is given
</li>
<li><span class="parameter">zoom</span>
the zoom to give the new camera
</li>
<li><span class="parameter">width</span>
the width to give the new camera
</li>
<li><span class="parameter">height</span>
the height to give the new camera
</li>
<li><span class="parameter">surface</span>
this will over ride the surface that the camera follows on, allowing for a 'ghost surface' while keeping same position
</li>
<li><span class="parameter">respawn_open</span>
if set to true then the camera will auto re link to the player after a respawn
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "data"></a>
<strong>data</strong>
</dt>
<dd>
Used to set and get data about different guis
<ul>
<li><span class="parameter">location</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the location to get/set the data, center left etc...
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the gui to set the value of
(<em>optional</em>)
</li>
<li><span class="parameter">value</span>
the data that will be set can be any value but table advised
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Gui.data[location] <span class="comment">-- returns the gui data for that gui location ex center</span></pre></li>
<li><pre class="example">Gui.data(location,gui_name,gui_data) <span class="comment">-- adds gui data for a gui at a location</span></pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="modules_expgamingcore_gui_src_server_Functions"></a>modules.expgamingcore.gui.src.server Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This file will be loaded when ExpGamingCore.Command is present
</dd>
<dt>
<a name = "__comment"></a>
<strong>__comment ()</strong>
</dt>
<dd>
Adds a server thread that allows the camera follows to be toggled off and on
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,883 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Events">Events</a></li>
<li><a href="#Class_Rank">Class Rank </a></li>
<li><a href="#Class_Group">Class Group </a></li>
<li><a href="#modules_expgamingcore_ranking_src_server_Functions">modules.expgamingcore.ranking.src.server Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><strong>ExpGamingCore.Role</strong></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Role</code></h1>
<p>A full ranking system for factorio.</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#output_ranks">output_ranks ([player=server])</a></td>
<td class="summary">Outputs as a string all the ranks and the loaded order</td>
</tr>
<tr>
<td class="name" nowrap><a href="#_base_preset">_base_preset (ranks)</a></td>
<td class="summary">Used to set the prset ranks that will be given to players</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_rank">get_rank (mixed)</a></td>
<td class="summary">Returns a rank object given a player or rank name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_group">get_group (mixed)</a></td>
<td class="summary">Returns the group object used to sort ranks given group name or rank</td>
</tr>
<tr>
<td class="name" nowrap><a href="#print">print (rank_base, rtn[, colour=defines.color.white[, below=false]])</a></td>
<td class="summary">Prints to all rank of greater/lower power of the rank given</td>
</tr>
<tr>
<td class="name" nowrap><a href="#give_rank">give_rank (player[, rank=default[, by_player='server'[, tick=game.tick]]])</a></td>
<td class="summary">Gives a user a rank</td>
</tr>
<tr>
<td class="name" nowrap><a href="#revert">revert (player[, by_player=nil])</a></td>
<td class="summary">Revert the last change to a players rank</td>
</tr>
<tr>
<td class="name" nowrap><a href="#find_preset">find_preset (player[, tick=nil])</a></td>
<td class="summary">Given that the player has a rank in the preset table it is given; also will attempt to promote players if a time requirement is met</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#global">global</a></td>
<td class="summary">Global Table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ranks">ranks</a></td>
<td class="summary">Contains the location of all the ranks, readonly during runtime</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ranks">ranks</a></td>
<td class="summary">Contains the location of all the rank groups, readonly during runtime</td>
</tr>
<tr>
<td class="name" nowrap><a href="#meta">meta</a></td>
<td class="summary">Contains some meta data about the ranks</td>
</tr>
</table>
<h2><a href="#Events">Events</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#on_rank_change">on_rank_change</a></td>
<td class="summary">Called when there is a rank change for a user</td>
</tr>
</table>
<h2><a href="#Class_Rank">Class Rank </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Ranking._rank:allowed">Ranking._rank:allowed (action)</a></td>
<td class="summary">Is this rank allowed to open this gui or use this command etc.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking._rank:get_players">Ranking._rank:get_players ([online=false])</a></td>
<td class="summary">Get all the players in this rank</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking._rank:print">Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])</a></td>
<td class="summary">Print a message to all players of this rank</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking._rank:edit">Ranking._rank:edit (key, value)</a></td>
<td class="summary">Allows for a clean way to edit rank objects</td>
</tr>
</table>
<h2><a href="#Class_Group">Class Group </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Ranking._group:create">Ranking._group:create (obj)</a></td>
<td class="summary">Creates a new group</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking._group:add_rank">Ranking._group:add_rank (obj)</a></td>
<td class="summary">Creats a new rank with this group as its group</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking._group:edit">Ranking._group:edit (key, value)</a></td>
<td class="summary">Allows for a clean way to edit rank group objects</td>
</tr>
</table>
<h2><a href="#modules_expgamingcore_ranking_src_server_Functions">modules.expgamingcore.ranking.src.server Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This file will be loaded when ExpGamingCore.Server is present</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking._rank:print">Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])</a></td>
<td class="summary">Print a message to all players of this rank</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "output_ranks"></a>
<strong>output_ranks ([player=server])</strong>
</dt>
<dd>
Outputs as a string all the ranks and the loaded order
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">player_name</span>, <span class="type">player_index</span> or <span class="type">LuaPlayer</span></span>
the player that the info will be printed to, nil will print to server
(<em>default</em> server)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking.output_ranks(player) <span class="comment">-- prints to player</span></pre>
</ul>
</dd>
<dt>
<a name = "_base_preset"></a>
<strong>_base_preset (ranks)</strong>
</dt>
<dd>
Used to set the prset ranks that will be given to players
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">ranks</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
table of player names with the player name as the key and rank name as the value
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking._base_preset{name=rank_name,nameTwo=rank_name_two} <span class="comment">-- sets player name to have rank rank_name on join</span></pre>
</ul>
</dd>
<dt>
<a name = "get_rank"></a>
<strong>get_rank (mixed)</strong>
</dt>
<dd>
Returns a rank object given a player or rank name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mixed</span>
<span class="types"><span class="type">player</span>, <span class="type">player_index</span>, <span class="type">player_name</span>, <span class="type">rank_name</span>, <span class="type">Ranking._rank</span>, <span class="type">'server'</span> or <span class="type">'root'</span></span>
what rank to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the rank that is linked to mixed
</ol>
<h3>Or</h3>
<ol>
<span class="types"><span class="type">nil</span></span>
there was no rank found
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Ranking.get_rank(game.player) <span class="comment">-- returns player's rank</span></pre></li>
<li><pre class="example">Ranking.get_rank(<span class="string">'admin'</span>) <span class="comment">-- returns rank by the name of admin</span></pre></li>
</ul>
</dd>
<dt>
<a name = "get_group"></a>
<strong>get_group (mixed)</strong>
</dt>
<dd>
Returns the group object used to sort ranks given group name or rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mixed</span>
<span class="types"><span class="type">player</span>, <span class="type">player_index</span>, <span class="type">player_name</span>, <span class="type">rank_name</span>, <span class="type">rank</span>, <span class="type">'server'</span>, <span class="type">'root'</span>, <span class="type">group_name</span> or <span class="type">group</span></span>
what group to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the group that is linked to mixed
</ol>
<h3>Or</h3>
<ol>
<span class="types"><span class="type">nil</span></span>
there was no rank group found
</ol>
<h3>See also:</h3>
<ul>
<a href="../modules/ExpGamingCore.Role.html#get_rank">Ranking.get_rank</a>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Ranking.get_group(game.player) <span class="comment">-- returns player's rank group</span></pre></li>
<li><pre class="example">Ranking.get_group(<span class="string">'root'</span>) <span class="comment">-- returns group by name of root</span></pre></li>
</ul>
</dd>
<dt>
<a name = "print"></a>
<strong>print (rank_base, rtn[, colour=defines.color.white[, below=false]])</strong>
</dt>
<dd>
Prints to all rank of greater/lower power of the rank given
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rank_base</span>
<span class="types"><span class="type">Ranking._rank</span> or <span class="type">pointerToRank</span></span>
the rank that acts as the cut off point (rank is always included)
</li>
<li><span class="parameter">rtn</span>
what do you want to return to the players
</li>
<li><span class="parameter">colour</span>
<span class="types"><span class="type">defines.color</span></span>
the colour that will be used to print
(<em>default</em> defines.color.white)
</li>
<li><span class="parameter">below</span>
<span class="types"><span class="type">boolean</span></span>
if true print to children rather than parents
(<em>default</em> false)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking.<span class="global">print</span>(<span class="string">'admin'</span>,<span class="string">'We got a grifer'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "give_rank"></a>
<strong>give_rank (player[, rank=default[, by_player='server'[, tick=game.tick]]])</strong>
</dt>
<dd>
Gives a user a rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span> or <span class="type">pointerToPlayer</span></span>
the player to give the rank to
</li>
<li><span class="parameter">rank</span>
<span class="types"><span class="type">Ranking._rank</span> or <span class="type">pointerToRank</span></span>
the rank to give to the player
(<em>default</em> default)
</li>
<li><span class="parameter">by_player</span>
<span class="types"><span class="type">LuaPlayer</span> or <span class="type">pointerToPlayer</span></span>
the player who is giving the rank
(<em>default</em> 'server')
</li>
<li><span class="parameter">tick</span>
<span class="types"><span class="type">number</span></span>
the tick that the rank is being given on, used as pass though
(<em>default</em> game.tick)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking.give_rank(<span class="number">1</span>,<span class="string">'admin'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "revert"></a>
<strong>revert (player[, by_player=nil])</strong>
</dt>
<dd>
Revert the last change to a players rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span> or <span class="type">pointerToPlayer</span></span>
the player to revert the rank of
</li>
<li><span class="parameter">by_player</span>
the player who is doing the revert
(<em>default</em> nil)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking.revert(<span class="number">1</span>) <span class="comment">-- reverts the rank of player with index 1</span></pre>
</ul>
</dd>
<dt>
<a name = "find_preset"></a>
<strong>find_preset (player[, tick=nil])</strong>
</dt>
<dd>
Given that the player has a rank in the preset table it is given; also will attempt to promote players if a time requirement is met
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span> or <span class="type">pointerToPlayer</span></span>
the player to test for an auto rank
</li>
<li><span class="parameter">tick</span>
<span class="types"><span class="type">number</span></span>
the tick it happens on
(<em>default</em> nil)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking.find_preset(<span class="number">1</span>) <span class="comment">-- attemps to find the preset for player with index 1</span></pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "global"></a>
<strong>global</strong>
</dt>
<dd>
Global Table
<h3>Fields:</h3>
<ul>
<li><span class="parameter">old</span>
contains the previous rank a use had before a rank change
</li>
<li><span class="parameter">preset</span>
contains the preset ranks that users will recive apon joining
</li>
<li><span class="parameter">last_change</span>
contains the name of the player who last had there rank chagned
</li>
</ul>
</dd>
<dt>
<a name = "ranks"></a>
<strong>ranks</strong>
</dt>
<dd>
Contains the location of all the ranks, readonly during runtime
</dd>
<dt>
<a name = "ranks"></a>
<strong>ranks</strong>
</dt>
<dd>
Contains the location of all the rank groups, readonly during runtime
</dd>
<dt>
<a name = "meta"></a>
<strong>meta</strong>
</dt>
<dd>
Contains some meta data about the ranks
<h3>Fields:</h3>
<ul>
<li><span class="parameter">default</span>
this is the name of the default rank
</li>
<li><span class="parameter">root</span>
this is the name of the root rank
</li>
<li><span class="parameter">time_ranks</span>
a list of all ranks which have a time requirement
</li>
<li><span class="parameter">time_highest</span>
the power of the highest rank that has a time requirement
</li>
<li><span class="parameter">time_lowest</span>
the lowest amount of time required for a time rank
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Events"></a>Events</h2>
<dl class="function">
<dt>
<a name = "on_rank_change"></a>
<strong>on_rank_change</strong>
</dt>
<dd>
Called when there is a rank change for a user
<h3>field:</h3>
<ul>
<li><span class="parameter">name</span>
the rank id
</li>
<li><span class="parameter">tick</span>
the tick which the event was raised on
</li>
<li><span class="parameter">player_index</span>
the player whos rank was changed
</li>
<li><span class="parameter">by_player_index</span>
the player who changed the rank, 0 means server
</li>
<li><span class="parameter">new_rank</span>
the name of the rank that was given
</li>
<li><span class="parameter">old_rank</span>
the name of the rank the player had
</li>
</ul>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Class_Rank"></a>Class Rank </h2>
<div class="section-description">
The class for the ranks
</div>
<dl class="function">
<dt>
<a name = "Ranking._rank:allowed"></a>
<strong>Ranking._rank:allowed (action)</strong>
</dt>
<dd>
Is this rank allowed to open this gui or use this command etc.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action</span>
<span class="types"><span class="type">teh</span></span>
to test for
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
is it allowed
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:allowed(<span class="string">'interface'</span>) <span class="comment">-- does the rank have permision for 'interface'</span></pre>
</ul>
</dd>
<dt>
<a name = "Ranking._rank:get_players"></a>
<strong>Ranking._rank:get_players ([online=false])</strong>
</dt>
<dd>
Get all the players in this rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">online</span>
<span class="types"><span class="type">boolean</span></span>
get only online players
(<em>default</em> false)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a table of all players in this rank
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:get_players()</pre>
</ul>
</dd>
<dt>
<a name = "Ranking._rank:print"></a>
<strong>Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])</strong>
</dt>
<dd>
Print a message to all players of this rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rtn</span>
any value you want to return
</li>
<li><span class="parameter">colour</span>
<span class="types"><span class="type">define.color</span></span>
the colour that will be used to print
(<em>default</em> defines.color.white)
</li>
<li><span class="parameter">show_default</span>
<span class="types"><span class="type">boolean</span></span>
weather to use the default rank name for the print, used as a pass though
(<em>default</em> false)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:<span class="global">print</span>(<span class="string">'foo'</span>) <span class="comment">-- prints to all members of this rank</span></pre>
</ul>
</dd>
<dt>
<a name = "Ranking._rank:edit"></a>
<strong>Ranking._rank:edit (key, value)</strong>
</dt>
<dd>
Allows for a clean way to edit rank objects
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the key to edit, often allow or disallow
</li>
<li><span class="parameter">value</span>
the new value to be set
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:edit(<span class="string">'allow'</span>,{<span class="string">'interface'</span>}) <span class="comment">-- allows this rank to use 'interface'</span></pre>
</ul>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Class_Group"></a>Class Group </h2>
<div class="section-description">
The class for the rank groups, the way to allow modules to idex a group that is always present, ranks will always look to there group as a parent
</div>
<dl class="function">
<dt>
<a name = "Ranking._group:create"></a>
<strong>Ranking._group:create (obj)</strong>
</dt>
<dd>
Creates a new group
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the fields for this object
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Ranking._group</span></span>
returns the object to allow chaining
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking._group:create{name=<span class="string">'root'</span>} <span class="comment">-- returns group with name root</span></pre>
</ul>
</dd>
<dt>
<a name = "Ranking._group:add_rank"></a>
<strong>Ranking._group:add_rank (obj)</strong>
</dt>
<dd>
Creats a new rank with this group as its group
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the fields for this object
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Ranking._group</span></span>
returns the object to allow chaining
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">group:add_rank{name=<span class="string">'root'</span>} <span class="comment">-- returns self</span></pre>
</ul>
</dd>
<dt>
<a name = "Ranking._group:edit"></a>
<strong>Ranking._group:edit (key, value)</strong>
</dt>
<dd>
Allows for a clean way to edit rank group objects
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the key to edit, often allow or disallow
</li>
<li><span class="parameter">value</span>
the new value to be set
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">group:edit(<span class="string">'allow'</span>,{<span class="string">'interface'</span>}) <span class="comment">-- allows this rank to use 'interface'</span></pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="modules_expgamingcore_ranking_src_server_Functions"></a>modules.expgamingcore.ranking.src.server Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This file will be loaded when ExpGamingCore.Server is present
</dd>
<dt>
<a name = "Ranking._rank:print"></a>
<strong>Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])</strong>
</dt>
<dd>
Print a message to all players of this rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rtn</span>
any value you want to return
</li>
<li><span class="parameter">colour</span>
<span class="types"><span class="type">define.color</span></span>
the colour that will be used to print
(<em>default</em> defines.color.white)
</li>
<li><span class="parameter">show_default</span>
<span class="types"><span class="type">boolean</span></span>
weather to use the default rank name for the print, used as a pass though
(<em>default</em> false)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:<span class="global">print</span>(<span class="string">'foo'</span>) <span class="comment">-- prints to all members of this rank</span></pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,848 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
<li><a href="#Class_Thread">Class Thread </a></li>
<li><a href="#modules_expgamingcore_server_src_commands_Functions">modules.expgamingcore.server.src.commands Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><strong>ExpGamingCore.Server</strong></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Server</code></h1>
<p>Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#new_thread">new_thread (obj)</a></td>
<td class="summary">Generates a new thread object</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_thread">get_thread (mixed)</a></td>
<td class="summary">Used to get a thread via uuid or name (if one is assied)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#queue_thread">queue_thread (thread_to_queue)</a></td>
<td class="summary">Adds a thread into the resolve queue, can be used to lower lag</td>
</tr>
<tr>
<td class="name" nowrap><a href="#close_all_threads">close_all_threads (with_force)</a></td>
<td class="summary">Closes all active threads, can use force if it causes errors</td>
</tr>
<tr>
<td class="name" nowrap><a href="#run_tick_threads">run_tick_threads ()</a></td>
<td class="summary">Runs all the theads which have opened with an on_tick event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#check_timeouts">check_timeouts ()</a></td>
<td class="summary">Checks the timeout on all active timeout threads</td>
</tr>
<tr>
<td class="name" nowrap><a href="#_thread_debuger">_thread_debuger (player, event[, state=toggle])</a></td>
<td class="summary">Used to print event info to a player</td>
</tr>
<tr>
<td class="name" nowrap><a href="#interface">interface (callback[, use_thread[, env[, ...]]])</a></td>
<td class="summary">Acts as a bypass for running functions, can accept a string</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#global">global</a></td>
<td class="summary">Global Table</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#uuid">uuid</a></td>
<td class="summary">Used to generate a new uuid for the thread system</td>
</tr>
<tr>
<td class="name" nowrap><a href="#threads">threads</a></td>
<td class="summary">Redirect to the thread index</td>
</tr>
</table>
<h2><a href="#Class_Thread">Class Thread </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Server._thread:create">Server._thread:create ([obj={}])</a></td>
<td class="summary">Returns a new thread object</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:queue">Server._thread:queue ()</a></td>
<td class="summary">Opens and queses a thread</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:valid">Server._thread:valid ([skip_location_check=false])</a></td>
<td class="summary">Test if the thread has all requied parts</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:open">Server._thread:open ()</a></td>
<td class="summary">Opens the thread; indexs this thread in the global index</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:close">Server._thread:close ()</a></td>
<td class="summary">Inverse of thread:open() - Removes all indexs to this thread, most cases this will cause it to become inassible</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:resolve">Server._thread:resolve ([...])</a></td>
<td class="summary">Trigger the on_resolve function and closes the thread - error and success called based on result of pcall (useful for async)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:check_timeout">Server._thread:check_timeout ()</a></td>
<td class="summary">Checks the timeout on a thread - if timed out then it calles on_timeout and closes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:error">Server._thread:error (err)</a></td>
<td class="summary">Used to check and raise the error handler of the thread, if not present it raises an error</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:on_event">Server._thread:on_event (event, callback)</a></td>
<td class="summary">Set function to run then an event is triggered, none of them are 'needed' but you are advised to have atleast one</td>
</tr>
</table>
<h2><a href="#modules_expgamingcore_server_src_commands_Functions">modules.expgamingcore.server.src.commands Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This file will be loaded when ExpGamingCore.Command is present</td>
</tr>
<tr>
<td class="name" nowrap><a href="#interface">interface</a></td>
<td class="summary">Runs the given input from the script</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "new_thread"></a>
<strong>new_thread (obj)</strong>
</dt>
<dd>
Generates a new thread object
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the atributes to give to the thread
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Server._thread</span></span>
the new thread created
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Server.new_thread{name=<span class="string">'foo'</span>,data={}}</pre>
</ul>
</dd>
<dt>
<a name = "get_thread"></a>
<strong>get_thread (mixed)</strong>
</dt>
<dd>
Used to get a thread via uuid or name (if one is assied)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mixed</span>
either a uuid or the name given to a thread
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Server._thread</span></span>
the thread by that name or uuid
</ol>
<h3>Or</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
if false is returned then no thread existes
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Server.get_thread(<span class="string">'decon'</span>) <span class="comment">-- return thread</span></pre>
</ul>
</dd>
<dt>
<a name = "queue_thread"></a>
<strong>queue_thread (thread_to_queue)</strong>
</dt>
<dd>
Adds a thread into the resolve queue, can be used to lower lag
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">thread_to_queue</span>
<span class="types"><span class="type">Server._thread</span></span>
the thread to be added to the queue, must be open and have a on_resolve function
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
was it added successfuly
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Server.queue_thread(thread) <span class="comment">-- return true/false</span></pre>
</ul>
</dd>
<dt>
<a name = "close_all_threads"></a>
<strong>close_all_threads (with_force)</strong>
</dt>
<dd>
Closes all active threads, can use force if it causes errors
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">with_force</span>
<span class="types"><span class="type">bolean</span></span>
use force when closing
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Server.close_all_threads() <span class="comment">-- asks all threads to close</span></pre></li>
<li><pre class="example">Server.close_all_threads(<span class="keyword">true</span>) <span class="comment">-- forcefuly close all threads</span></pre></li>
</ul>
</dd>
<dt>
<a name = "run_tick_threads"></a>
<strong>run_tick_threads ()</strong>
</dt>
<dd>
Runs all the theads which have opened with an on_tick event
<h3>Usage:</h3>
<ul>
<pre class="example">Server.run_tick_threads()</pre>
</ul>
</dd>
<dt>
<a name = "check_timeouts"></a>
<strong>check_timeouts ()</strong>
</dt>
<dd>
Checks the timeout on all active timeout threads
<h3>Usage:</h3>
<ul>
<pre class="example">Server.check_timeouts()</pre>
</ul>
</dd>
<dt>
<a name = "_thread_debuger"></a>
<strong>_thread_debuger (player, event[, state=toggle])</strong>
</dt>
<dd>
Used to print event info to a player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">name</span>, <span class="type">index</span> or <span class="type">LuaPlayer</span></span>
the player that the info will be returned to
</li>
<li><span class="parameter">event</span>
<span class="types"><span class="type">name</span> or <span class="type">index</span></span>
the event that info will be returned fo
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">boolean</span></span>
will info be returned, nil to toggle current state
(<em>default</em> toggle)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Server._thread_debuger(<span class="string">'Cooldude2606'</span>,<span class="string">'on_player_died'</span>,<span class="keyword">true</span>) <span class="comment">-- will output event info to 'Cooldude2606' for 'on_player_died'</span></pre>
</ul>
</dd>
<dt>
<a name = "interface"></a>
<strong>interface (callback[, use_thread[, env[, ...]]])</strong>
</dt>
<dd>
Acts as a bypass for running functions, can accept a string
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">function</span></span>
function to be ran
</li>
<li><span class="parameter">use_thread</span>
<span class="types"><span class="type">Server._thread</span> or <span class="type">true</span></span>
run the command on a premade thread or let it make its own
(<em>optional</em>)
</li>
<li><span class="parameter">env</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
run the env to run the command in must have _env key as true to be
(<em>optional</em>)
</li>
<li><span class="parameter">...</span>
any args you want to pass to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<li>
<span class="types"><span class="type">boolean</span></span>
if no thread then it will return a true for the success</li>
<li>
if no thread then it will return the value(s) returned by the callback</li>
</ol>
<h3>Or</h3>
<ol>
<li>
<span class="types"><span class="type">boolean</span></span>
if no thread then it will return a false for the success</li>
<li>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
if no thread then it will return a an err value</li>
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Server.interface(<span class="string">'local x = 1+1 print(x) return x'</span>) <span class="comment">-- return 2</span></pre></li>
<li><pre class="example">Server.interface(<span class="string">'local x = 1+1 print(x)'</span>,<span class="keyword">true</span>) <span class="comment">-- will creat a thread to run as root (this is the bypass)</span></pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "global"></a>
<strong>global</strong>
</dt>
<dd>
Global Table
<h3>Fields:</h3>
<ul>
<li><span class="parameter">all</span>
a list of every thread (indexed by uuid)
</li>
<li><span class="parameter">queue</span>
an index for threads which will be resolved (contains uuids)
</li>
<li><span class="parameter">tick</span>
an index for threads which will run every tick (contains uuids)
</li>
<li><span class="parameter">timeout</span>
an index for threads which will timeout (contains uuids)
</li>
<li><span class="parameter">events</span>
an index of threads based on event ids (contains uuids)
</li>
<li><span class="parameter">paused</span>
an index of pasued threads (contains uuids)
</li>
<li><span class="parameter">named</span>
a name index for thread uuids
</li>
<li><span class="parameter">print_to</span>
contains players that event details will be printed to
</li>
<li><span class="parameter">uuid</span>
contains the random number generator for the uuid system
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "uuid"></a>
<strong>uuid</strong>
</dt>
<dd>
Used to generate a new uuid for the thread system
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> uuid = <span class="global">tostring</span>(Server.uuid) <span class="comment">-- calling tostring locks the value</span></pre>
</ul>
</dd>
<dt>
<a name = "threads"></a>
<strong>threads</strong>
</dt>
<dd>
Redirect to the thread index
<h3>Usage:</h3>
<ul>
<li><pre class="example">Server.threads <span class="comment">-- return #global.all</span></pre></li>
<li><pre class="example">Server.threads <span class="comment">-- return global.all</span></pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Class_Thread"></a>Class Thread </h2>
<div class="section-description">
The class for the server threads, allows abbilty to run async function
</div>
<dl class="function">
<dt>
<a name = "Server._thread:create"></a>
<strong>Server._thread:create ([obj={}])</strong>
</dt>
<dd>
Returns a new thread object
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
all values are opt {timeout=int,name=str,data=any}
(<em>default</em> {})
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Server._thread</span></span>
the new thread object
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">new_thread = thread:create()</pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:queue"></a>
<strong>Server._thread:queue ()</strong>
</dt>
<dd>
Opens and queses a thread
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
was the thread queued successfuly
</ol>
<h3>See also:</h3>
<ul>
<a href="../modules/ExpGamingCore.Server.html#queue_thread">Server.queue_thread</a>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Server._thread:queue() <span class="comment">-- returns true/false</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:valid"></a>
<strong>Server._thread:valid ([skip_location_check=false])</strong>
</dt>
<dd>
Test if the thread has all requied parts
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">skip_location_check</span>
<span class="types"><span class="type">bolean</span></span>
true to skip the location checking
(<em>default</em> false)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
is the thread valid
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">if</span> thread:valid() <span class="keyword">then</span> <span class="keyword">end</span> <span class="comment">-- basic test for valid</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:open"></a>
<strong>Server._thread:open ()</strong>
</dt>
<dd>
Opens the thread; indexs this thread in the global index
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
if the thread was opened successfuly
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">thread:open() <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:close"></a>
<strong>Server._thread:close ()</strong>
</dt>
<dd>
Inverse of thread:open() - Removes all indexs to this thread, most cases this will cause it to become inassible
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
if the thread had a on_close function
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">thread:close() <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:resolve"></a>
<strong>Server._thread:resolve ([...])</strong>
</dt>
<dd>
Trigger the on_resolve function and closes the thread - error and success called based on result of pcall (useful for async)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
any arguments you want to pass to the resolve function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
true if the thread called on_success or on_error
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">thread:resolve(x,y,z) <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:check_timeout"></a>
<strong>Server._thread:check_timeout ()</strong>
</dt>
<dd>
Checks the timeout on a thread - if timed out then it calles on_timeout and closes
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
if the thread timed out
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">thread:check_timeout() <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:error"></a>
<strong>Server._thread:error (err)</strong>
</dt>
<dd>
Used to check and raise the error handler of the thread, if not present it raises an error
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">err</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the err to be rasied
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
did the thread have an error handler
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">thread:<span class="global">error</span>(err) <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:on_event"></a>
<strong>Server._thread:on_event (event, callback)</strong>
</dt>
<dd>
Set function to run then an event is triggered, none of them are 'needed' but you are advised to have atleast one
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">index</span></span>
the name of the event that the function should be called on
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function which is called by the event trigger
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
returns self so that they can be chained together
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">thread:on_event(<span class="string">'close'</span>,<span class="keyword">function</span>) <span class="comment">-- if event is not one below then a game event is used</span></pre></li>
<li><pre class="example">thread_only_events = [<span class="string">'close'</span>,<span class="string">'timeout'</span>,<span class="string">'tick'</span>,<span class="string">'resolve'</span>,<span class="string">'success'</span>,<span class="string">'error'</span>]</pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="modules_expgamingcore_server_src_commands_Functions"></a>modules.expgamingcore.server.src.commands Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This file will be loaded when ExpGamingCore.Command is present
</dd>
<dt>
<a name = "interface"></a>
<strong>interface</strong>
</dt>
<dd>
Runs the given input from the script
<h3>param:</h3>
<ul>
<li><span class="parameter">code</span>
The code that will be ran
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,820 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
<li><a href="#modules_expgamingcore_sync_src_gui_Functions">modules.expgamingcore.sync.src.gui Functions</a></li>
<li><a href="#modules_expgamingcore_sync_src_ranking_Functions">modules.expgamingcore.sync.src.ranking Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><strong>ExpGamingCore.Sync</strong></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingCore.Sync</code></h1>
<p>Allows syncing with an outside server and info panle.</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#tick_format">tick_format (tick)</a></td>
<td class="summary">Used to standidise the tick format for any sync info</td>
</tr>
<tr>
<td class="name" nowrap><a href="#print">print (player_message, player_name[, player_tag[, player_colour[, prefix]]])</a></td>
<td class="summary">Prints to chat as if it were a player</td>
</tr>
<tr>
<td class="name" nowrap><a href="#emit_embedded">emit_embedded (args)</a></td>
<td class="summary">Logs an embed to the json.data we use a js script to add things we cant here</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_admins">count_admins ()</a></td>
<td class="summary">Used to get the number of admins currently online</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_afk">count_afk ([time=7200])</a></td>
<td class="summary">Used to get the number of afk players defined by 2 min by default</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_ranks">count_ranks ()</a></td>
<td class="summary">Used to get the number of players in each rank and currently online; if ExpGamingCore/Ranking is present then it will give more than admin and user</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_players">count_players (online)</a></td>
<td class="summary">Used to get a list of every player name with the option to limit to only online players</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_player_times">count_player_times ()</a></td>
<td class="summary">Used to get a list of every player name with the amount of time they have played for</td>
</tr>
<tr>
<td class="name" nowrap><a href="#update">update ()</a></td>
<td class="summary">Called to update values inside of the info</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_update">add_update (key, callback)</a></td>
<td class="summary">Adds a callback to be called when the info is updated</td>
</tr>
<tr>
<td class="name" nowrap><a href="#emit_data">emit_data ()</a></td>
<td class="summary">Outputs the curent server info into a file</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#global">global</a></td>
<td class="summary">Global Table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#global.players">global.players</a></td>
<td class="summary">Player sub-table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#EmitEmbededParamaters">EmitEmbededParamaters</a></td>
<td class="summary">Outline of the paramaters accepted by Sync.emit_embedded</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#info">info</a></td>
<td class="summary">used to get the global list that has been defined, also used to set that list</td>
</tr>
<tr>
<td class="name" nowrap><a href="#time">time</a></td>
<td class="summary">Used to return and set the current IRL time; not very good need a better way to do this</td>
</tr>
</table>
<h2><a href="#modules_expgamingcore_sync_src_gui_Functions">modules.expgamingcore.sync.src.gui Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This file will be loaded when ExpGamingCore.Gui is present</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_to_gui">add_to_gui (element)</a></td>
<td class="summary">Adds a emeltent to the sever info gui</td>
</tr>
<tr>
<td class="name" nowrap><a href="#server-info">server-info</a></td>
<td class="summary">Creates a center gui that will appear on join</td>
</tr>
</table>
<h2><a href="#modules_expgamingcore_sync_src_ranking_Functions">modules.expgamingcore.sync.src.ranking Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_comment">_comment ()</a></td>
<td class="summary">This file will be loaded when ExpGamingCore.Role is present</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_ranks">set_ranks (...)</a></td>
<td class="summary">Used as a redirect to Ranking._base_preset that will set the rank given to a player apon joining</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_ranks">count_ranks ()</a></td>
<td class="summary">Used to get the number of players in each rank and currently online</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "tick_format"></a>
<strong>tick_format (tick)</strong>
</dt>
<dd>
Used to standidise the tick format for any sync info
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tick</span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">{number,string}</span></span>
table containg both the raw number and clean version of a time
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.tick_format(<span class="number">60</span>) <span class="comment">-- return {60,'1.00M'}</span></pre>
</ul>
</dd>
<dt>
<a name = "print"></a>
<strong>print (player_message, player_name[, player_tag[, player_colour[, prefix]]])</strong>
</dt>
<dd>
Prints to chat as if it were a player
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player_message</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the message to be printed in chat
</li>
<li><span class="parameter">player_name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the player sending the message
</li>
<li><span class="parameter">player_tag</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the tag apllied to the player's name
(<em>optional</em>)
</li>
<li><span class="parameter">player_colour</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the colour of the message, either hex or named colour
(<em>optional</em>)
</li>
<li><span class="parameter">prefix</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
add a prefix before the chat eg [IRC]
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.<span class="global">print</span>(<span class="string">'Test'</span>,<span class="string">'Cooldude2606'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "emit_embedded"></a>
<strong>emit_embedded (args)</strong>
</dt>
<dd>
Logs an embed to the json.data we use a js script to add things we cant here
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">args</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a table which contains everything that the embedded will use
</li>
</ul>
<h3>See also:</h3>
<ul>
<a href="../modules/ExpGamingCore.Sync.html#EmitEmbededParamaters">EmitEmbededParamaters</a>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.emit_embedded{title=<span class="string">'BAN'</span>,color=<span class="string">'0x0'</span>,description=<span class="string">'A player was banned'</span> ... }</pre>
</ul>
</dd>
<dt>
<a name = "count_admins"></a>
<strong>count_admins ()</strong>
</dt>
<dd>
Used to get the number of admins currently online
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the number of admins online
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_admins() <span class="comment">-- returns number</span></pre>
</ul>
</dd>
<dt>
<a name = "count_afk"></a>
<strong>count_afk ([time=7200])</strong>
</dt>
<dd>
Used to get the number of afk players defined by 2 min by default
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">time</span>
<span class="types"><span class="type">int</span></span>
in ticks that a player is called afk
(<em>default</em> 7200)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the number of afk players
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_afk()</pre>
</ul>
</dd>
<dt>
<a name = "count_ranks"></a>
<strong>count_ranks ()</strong>
</dt>
<dd>
Used to get the number of players in each rank and currently online; if ExpGamingCore/Ranking is present then it will give more than admin and user
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
contains the ranks and the players in that rank
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_ranks()</pre>
</ul>
</dd>
<dt>
<a name = "count_players"></a>
<strong>count_players (online)</strong>
</dt>
<dd>
Used to get a list of every player name with the option to limit to only online players
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">online</span>
<span class="types"><span class="type">boolean</span></span>
true will get only the online players
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
table of player names
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_players()</pre>
</ul>
</dd>
<dt>
<a name = "count_player_times"></a>
<strong>count_player_times ()</strong>
</dt>
<dd>
Used to get a list of every player name with the amount of time they have played for
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
table indexed by player name, each value contains the raw tick and then the clean string
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_player_times()</pre>
</ul>
</dd>
<dt>
<a name = "update"></a>
<strong>update ()</strong>
</dt>
<dd>
Called to update values inside of the info
<h3>Returns:</h3>
<ol>
all of the new info
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.update()</pre>
</ul>
</dd>
<dt>
<a name = "add_update"></a>
<strong>add_update (key, callback)</strong>
</dt>
<dd>
Adds a callback to be called when the info is updated
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the key that the value will be stored in
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function which will return this value
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.add_update(<span class="string">'players'</span>,<span class="keyword">function</span>() <span class="keyword">return</span> #game.players <span class="keyword">end</span>)</pre>
</ul>
</dd>
<dt>
<a name = "emit_data"></a>
<strong>emit_data ()</strong>
</dt>
<dd>
Outputs the curent server info into a file
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.emit_data()</pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "global"></a>
<strong>global</strong>
</dt>
<dd>
Global Table
<h3>Fields:</h3>
<ul>
<li><span class="parameter">server_name</span>
the server name
</li>
<li><span class="parameter">server_description</span>
a short description of the server
</li>
<li><span class="parameter">reset_time</span>
the reset time of the server
</li>
<li><span class="parameter">time</span>
the last knowen irl time
</li>
<li><span class="parameter">time_set</span>
the last in game time that the time was set
</li>
<li><span class="parameter">last_update</span>
the last time that this info was updated
</li>
<li><span class="parameter">time_period</span>
how often this infomation is updated
</li>
<li><span class="parameter">players</span>
a list of different player related states
</li>
<li><span class="parameter">ranks</span>
a list of player ranks
</li>
<li><span class="parameter">rockets</span>
the number of rockets launched
</li>
<li><span class="parameter">mods</span>
the mods which are loaded
</li>
</ul>
</dd>
<dt>
<a name = "global.players"></a>
<strong>global.players</strong>
</dt>
<dd>
Player sub-table
<h3>Fields:</h3>
<ul>
<li><span class="parameter">online</span>
list of all players online
</li>
<li><span class="parameter">n_online</span>
the number of players online
</li>
<li><span class="parameter">all</span>
list of all player on or offline
</li>
<li><span class="parameter">n_all</span>
the number of players who have joined the server
</li>
<li><span class="parameter">admins_online</span>
the number of admins online
</li>
<li><span class="parameter">afk_players</span>
the number of afk players
</li>
<li><span class="parameter">times</span>
the play times of every player
</li>
</ul>
</dd>
<dt>
<a name = "EmitEmbededParamaters"></a>
<strong>EmitEmbededParamaters</strong>
</dt>
<dd>
Outline of the paramaters accepted by Sync.emit_embedded
<h3>Fields:</h3>
<ul>
<li><span class="parameter">title</span>
the tile of the embed
</li>
<li><span class="parameter">color</span>
the color given in hex you can use Color.to_hex{r=0,g=0,b=0}
</li>
<li><span class="parameter">description</span>
the description of the embed
</li>
<li><span class="parameter">server_detail</span>
sting to add onto the pre-set server detail
</li>
<li><span class="parameter">fieldone</span>
the filed to add to the embed (key is name) (value is text) (start value with &lt;&lt;inline&gt;&gt; to make inline)
</li>
<li><span class="parameter">fieldtwo</span>
the filed to add to the embed (key is name) (value is text) (start value with &lt;&lt;inline&gt;&gt; to make inline)
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "info"></a>
<strong>info</strong>
</dt>
<dd>
used to get the global list that has been defined, also used to set that list
<ul>
<li><span class="parameter">set</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
keys to be replaced in the server info
(<em>default</em> nil)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Sync.info{server_name=<span class="string">'Factorio Server 2'</span>} <span class="comment">-- returns true</span></pre></li>
<li><pre class="example">Sync.info <span class="comment">-- table of info</span></pre></li>
</ul>
</dd>
<dt>
<a name = "time"></a>
<strong>time</strong>
</dt>
<dd>
Used to return and set the current IRL time; not very good need a better way to do this
<ul>
<li><span class="parameter">set</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the date time to be set
(<em>default</em> nil)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Sync.time(<span class="string">'Sun Apr 1 18:44:30 UTC 2018'</span>)</pre></li>
<li><pre class="example">Sync.time <span class="comment">-- string</span></pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="modules_expgamingcore_sync_src_gui_Functions"></a>modules.expgamingcore.sync.src.gui Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This file will be loaded when ExpGamingCore.Gui is present
</dd>
<dt>
<a name = "add_to_gui"></a>
<strong>add_to_gui (element)</strong>
</dt>
<dd>
Adds a emeltent to the sever info gui
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">element</span>
see examples before for what can be used, it can also be a return from Gui.inputs.add
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
based on weather it was successful or not
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.add_to_gui(<span class="string">'string'</span>) <span class="comment">-- return true</span></pre>
</ul>
</dd>
<dt>
<a name = "server-info"></a>
<strong>server-info</strong>
</dt>
<dd>
Creates a center gui that will appear on join
</dd>
</dl>
<h2 class="section-header "><a name="modules_expgamingcore_sync_src_ranking_Functions"></a>modules.expgamingcore.sync.src.ranking Functions</h2>
<dl class="function">
<dt>
<a name = "_comment"></a>
<strong>_comment ()</strong>
</dt>
<dd>
This file will be loaded when ExpGamingCore.Role is present
</dd>
<dt>
<a name = "set_ranks"></a>
<strong>set_ranks (...)</strong>
</dt>
<dd>
Used as a redirect to Ranking._base_preset that will set the rank given to a player apon joining
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.set_ranks{player_name=rank_name,...}</pre>
</ul>
</dd>
<dt>
<a name = "count_ranks"></a>
<strong>count_ranks ()</strong>
</dt>
<dd>
Used to get the number of players in each rank and currently online
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
contains the ranks and the players in that rank
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_ranks()</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,672 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Class_table">Class table </a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><strong>ExpGamingLib</strong></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ExpGamingLib</code></h1>
<p>Adds some common functions used though out all ExpGaming modules</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#unpack_to_G">unpack_to_G (tbl)</a></td>
<td class="summary">Loads a table into _G even when sandboxed; will not overwrite values or append to tables; will not work during runtime to avoid desyncs</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_env">get_env ()</a></td>
<td class="summary">Used to get the current ENV with all _G keys removed; useful when saving function to global</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add_metatable">add_metatable (tbl[, callback=tostring[, string=table.tostring]])</a></td>
<td class="summary">Creats a table that will act like a string and a function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_type">is_type (v[, test_type=nil])</a></td>
<td class="summary">Compear types faster for faster valadation of prams</td>
</tr>
<tr>
<td class="name" nowrap><a href="#player_return">player_return (rtn[, colour=defines.colour.white[, player=game.player]])</a></td>
<td class="summary">Will return a value of any type to the player/server console, allows colour for in-game players</td>
</tr>
<tr>
<td class="name" nowrap><a href="#tick_to_hour">tick_to_hour (tick)</a></td>
<td class="summary">Convert ticks to hours</td>
</tr>
<tr>
<td class="name" nowrap><a href="#tick_to_min">tick_to_min (tick)</a></td>
<td class="summary">Convert ticks to minutes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#tick_to_display_format">tick_to_display_format (tick)</a></td>
<td class="summary">Converts a tick into a clean format for end user</td>
</tr>
<tr>
<td class="name" nowrap><a href="#gui_tree">gui_tree (root)</a></td>
<td class="summary">Used as a way to view the structure of a gui, used for debuging</td>
</tr>
</table>
<h2><a href="#Class_table">Class table </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#table.val_to_str">table.val_to_str (v)</a></td>
<td class="summary">Returns a value in a form able to be read as a value, any value to string</td>
</tr>
<tr>
<td class="name" nowrap><a href="#table.key_to_str">table.key_to_str (k)</a></td>
<td class="summary">Returns a value in a form able to be read as a key, any key to string</td>
</tr>
<tr>
<td class="name" nowrap><a href="#table.tostring">table.tostring (tbl)</a></td>
<td class="summary">Returns a table in a form able to be read as a table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#table.json">table.json (lua_table)</a></td>
<td class="summary">Simmilar to table.tostring but converts a lua table to a json one</td>
</tr>
<tr>
<td class="name" nowrap><a href="#table.autokey">table.autokey (tbl, str)</a></td>
<td class="summary">Returns the closest match to a key</td>
</tr>
<tr>
<td class="name" nowrap><a href="#table.alphanumsort">table.alphanumsort (tbl)</a></td>
<td class="summary">Returns the list is a sorted way that would be expected by people (this is by key)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#table.keysort">table.keysort (tbl)</a></td>
<td class="summary">Returns the list is a sorted way that would be expected by people (this is by key) (faster alterative than above)</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "unpack_to_G"></a>
<strong>unpack_to_G (tbl)</strong>
</dt>
<dd>
Loads a table into _G even when sandboxed; will not overwrite values or append to tables; will not work during runtime to avoid desyncs
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
table to be unpacked
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">unpack_to_G{key1=<span class="string">'foo'</span>,key2=<span class="string">'bar'</span>}</pre>
</ul>
</dd>
<dt>
<a name = "get_env"></a>
<strong>get_env ()</strong>
</dt>
<dd>
Used to get the current ENV with all _G keys removed; useful when saving function to global
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the env table with _G keys removed
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">get_env() returns current ENV with _G keys removed</pre>
</ul>
</dd>
<dt>
<a name = "add_metatable"></a>
<strong>add_metatable (tbl[, callback=tostring[, string=table.tostring]])</strong>
</dt>
<dd>
Creats a table that will act like a string and a function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the table that will have its metatable set
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function that will be used for the call
(<em>default</em> tostring)
</li>
<li><span class="parameter">string</span>
<span class="types"><span class="type">function</span> or <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
a function that resolves to a string or a string
(<em>default</em> table.tostring)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the new table with its metatable set
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">add_metatable({},<span class="keyword">function</span>) <span class="comment">-- returns table</span></pre>
</ul>
</dd>
<dt>
<a name = "is_type"></a>
<strong>is_type (v[, test_type=nil])</strong>
</dt>
<dd>
Compear types faster for faster valadation of prams
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">v</span>
the value to be tested
</li>
<li><span class="parameter">test_type</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the type to test for if not given then it tests for nil
(<em>default</em> nil)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
is v of type test_type
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">is_type(<span class="string">'foo'</span>,<span class="string">'string'</span>) <span class="comment">-- return true</span></pre></li>
<li><pre class="example">is_type(<span class="string">'foo'</span>) <span class="comment">-- return false</span></pre></li>
</ul>
</dd>
<dt>
<a name = "player_return"></a>
<strong>player_return (rtn[, colour=defines.colour.white[, player=game.player]])</strong>
</dt>
<dd>
Will return a value of any type to the player/server console, allows colour for in-game players
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rtn</span>
any value of any type that will be returned to the player or console
</li>
<li><span class="parameter">colour</span>
<span class="types"><span class="type">defines.color</span> or <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the colour of the text for the player, ingroned when printing to console
(<em>default</em> defines.colour.white)
</li>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span></span>
the player that return will go to, if no game.player then returns to server
(<em>default</em> game.player)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">player_return(<span class="string">'Hello, World!'</span>) <span class="comment">-- returns 'Hello, World!' to game.player or server console</span></pre></li>
<li><pre class="example">player_return(<span class="string">'Hello, World!'</span>,<span class="string">'green'</span>) <span class="comment">-- returns 'Hello, World!' to game.player with colour green or server console</span></pre></li>
<li><pre class="example">player_return(<span class="string">'Hello, World!'</span>,<span class="keyword">nil</span>,player) <span class="comment">-- returns 'Hello, World!' to the given player</span></pre></li>
</ul>
</dd>
<dt>
<a name = "tick_to_hour"></a>
<strong>tick_to_hour (tick)</strong>
</dt>
<dd>
Convert ticks to hours
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tick</span>
<span class="types"><span class="type">number</span></span>
tick to convert to hours
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the number of whole hours from this tick
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">tick_to_hour(<span class="number">216001</span>) <span class="comment">-- return 1</span></pre>
</ul>
</dd>
<dt>
<a name = "tick_to_min"></a>
<strong>tick_to_min (tick)</strong>
</dt>
<dd>
Convert ticks to minutes
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tick</span>
<span class="types"><span class="type">number</span></span>
tick to convert to minutes
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the number of whole minutes from this tick
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">tick_to_hour(<span class="number">3601</span>) <span class="comment">-- return 1</span></pre>
</ul>
</dd>
<dt>
<a name = "tick_to_display_format"></a>
<strong>tick_to_display_format (tick)</strong>
</dt>
<dd>
Converts a tick into a clean format for end user
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tick</span>
<span class="types"><span class="type">number</span></span>
the tick to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the formated string
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">tick_to_display_format(<span class="number">3600</span>) <span class="comment">-- return '1.00 M'</span></pre></li>
<li><pre class="example">tick_to_display_format(<span class="number">234000</span>) <span class="comment">-- return '1 H 5 M'</span></pre></li>
</ul>
</dd>
<dt>
<a name = "gui_tree"></a>
<strong>gui_tree (root)</strong>
</dt>
<dd>
Used as a way to view the structure of a gui, used for debuging
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">root</span>
<span class="types"><span class="type">LuaGuiElement</span></span>
the root to start the tree from
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the table that describes the gui
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui_tree(root) returns all children of gui recusivly</pre>
</ul>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Class_table"></a>Class table </h2>
<div class="section-description">
Extents the table class
</div>
<dl class="function">
<dt>
<a name = "table.val_to_str"></a>
<strong>table.val_to_str (v)</strong>
</dt>
<dd>
Returns a value in a form able to be read as a value, any value to string
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">v</span>
value to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the converted value
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="global">table</span>.val_to_str{a=<span class="string">'foo'</span>} <span class="comment">-- return '"foo"'</span></pre>
</ul>
</dd>
<dt>
<a name = "table.key_to_str"></a>
<strong>table.key_to_str (k)</strong>
</dt>
<dd>
Returns a value in a form able to be read as a key, any key to string
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">k</span>
key to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the converted key
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="global">table</span>.val_to_str{a=<span class="string">'foo'</span>} <span class="comment">-- return '["a"]'</span></pre>
</ul>
</dd>
<dt>
<a name = "table.tostring"></a>
<strong>table.tostring (tbl)</strong>
</dt>
<dd>
Returns a table in a form able to be read as a table
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
table to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the converted table
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="global">table</span>.<span class="global">tostring</span>{k1=<span class="string">'foo'</span>,k2=<span class="string">'bar'</span>} <span class="comment">-- return '{["k1"]="foo",["k2"]="bar"}'</span></pre>
</ul>
</dd>
<dt>
<a name = "table.json"></a>
<strong>table.json (lua_table)</strong>
</dt>
<dd>
Simmilar to table.tostring but converts a lua table to a json one
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">lua_table</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the table to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the table in a json format
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">talbe.json{k1=<span class="string">'foo'</span>,k2=<span class="string">'bar'</span>} <span class="comment">-- return '{"k1":"foo","k2":"bar"}'</span></pre>
</ul>
</dd>
<dt>
<a name = "table.autokey"></a>
<strong>table.autokey (tbl, str)</strong>
</dt>
<dd>
Returns the closest match to a key
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the table that will be searched
</li>
<li><span class="parameter">str</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string that will be looked for in the keys
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="global">table</span>.autokey({foo=<span class="number">1</span>,bar=<span class="number">2</span>},<span class="string">'f'</span>) <span class="comment">-- return 1</span></pre>
</ul>
</dd>
<dt>
<a name = "table.alphanumsort"></a>
<strong>table.alphanumsort (tbl)</strong>
</dt>
<dd>
Returns the list is a sorted way that would be expected by people (this is by key)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the table to be sorted
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the sorted table
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">tbl = <span class="global">table</span>.alphanumsort(tbl)</pre>
</ul>
</dd>
<dt>
<a name = "table.keysort"></a>
<strong>table.keysort (tbl)</strong>
</dt>
<dd>
Returns the list is a sorted way that would be expected by people (this is by key) (faster alterative than above)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the table to be sorted
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/ExpGamingLib.html#table">table</a></span>
the sorted table
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">tbl = <span class="global">table</span>.alphanumsort(tbl)</pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,455 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>FSM</strong></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>FSM</code></h1>
<p>Factorio Softmod Manager</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Manager = require(&quot;FactorioSoftmodManager&quot;)
</pre>
</ul>
<h3>Info:</h3>
<ul>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#_verbose">_verbose (rtn)</a></td>
<td class="summary">Default output for the verbose</td>
</tr>
<tr>
<td class="name" nowrap><a href="#verbose">verbose (rtn, action)</a></td>
<td class="summary">Used to call the output of the verbose when the current state allows it</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setVerbose">setVerbose (settings)</a></td>
<td class="summary">Main logic for allowing verbose at different stages though out the script</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sandbox">sandbox (callback[, env])</a></td>
<td class="summary">Creates a sand box envorment and runs a callback in that sand box; provents global pollution</td>
</tr>
<tr>
<td class="name" nowrap><a href="#loadModules">loadModules ()</a></td>
<td class="summary">Loads the modules that are present in the index list</td>
</tr>
<tr>
<td class="name" nowrap><a href="#error">error (err, callback)</a></td>
<td class="summary">A more detailed replacement for the lua error function to allow for handlers to be added; repleaces default error so error can be used instead of Manager.error</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event">event (event_name, callback)</a></td>
<td class="summary">Event handler that modules can use, each module can register one function per event</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#verboseSettings">verboseSettings</a></td>
<td class="summary">Different verbose settings used for setVerbose</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Manager.event.names">Manager.event.names</a></td>
<td class="summary">Sub set to Manger.event and acts as a coverter between event_name and event_id</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#global">global</a></td>
<td class="summary">Used to avoid conflicts in the global table</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "_verbose"></a>
<strong>_verbose (rtn)</strong>
</dt>
<dd>
Default output for the verbose
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rtn</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the value that will be returned though verbose output
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Manager.verbose(<span class="string">'Hello, World!'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "verbose"></a>
<strong>verbose (rtn, action)</strong>
</dt>
<dd>
Used to call the output of the verbose when the current state allows it
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rtn</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the value that will be returned though verbose output
</li>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
is used to decide which verbose this is error || event etc
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Manager.verbose(<span class="string">'Hello, World!'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "setVerbose"></a>
<strong>setVerbose (settings)</strong>
</dt>
<dd>
Main logic for allowing verbose at different stages though out the script
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">settings</span>
<span class="types"><span class="type">newTbl</span></span>
the table that will be searched for settings to be updated
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Manager.setVerbose{output=log}</pre></li>
<li><pre class="example">Manager.setVerbose[setting] <span class="comment">-- returns the value of that setting</span></pre></li>
<li><pre class="example"><span class="global">tostring</span>(Manager.setVerbose) <span class="comment">-- returns a formated list of the current settings</span></pre></li>
</ul>
</dd>
<dt>
<a name = "sandbox"></a>
<strong>sandbox (callback[, env])</strong>
</dt>
<dd>
Creates a sand box envorment and runs a callback in that sand box; provents global pollution
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function that will be ran in the sandbox
</li>
<li><span class="parameter">env</span>
any other params that the function will use
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Manager.sandbox(callback) <span class="comment">-- return sandbox, success, other returns from callback</span></pre></li>
<li><pre class="example">Manager.sandbox() <span class="comment">-- returns and empty sandbox</span></pre></li>
<li><pre class="example">Manager.sandbox[key] <span class="comment">-- returns the sand box value in that key</span></pre></li>
</ul>
</dd>
<dt>
<a name = "loadModules"></a>
<strong>loadModules ()</strong>
</dt>
<dd>
Loads the modules that are present in the index list
<h3>Usage:</h3>
<ul>
<li><pre class="example">Manager.loadModules() <span class="comment">-- loads all moddules in the index list</span></pre></li>
<li><pre class="example">#Manager.loadModules <span class="comment">-- returns the number of modules loaded</span></pre></li>
<li><pre class="example"><span class="global">tostring</span>(Manager.loadModules) <span class="comment">-- returns a formatted list of all modules loaded</span></pre></li>
<li><pre class="example"><span class="global">pairs</span>(Manager.loadModules) <span class="comment">-- loops over the loaded modules moduleName, module</span></pre></li>
</ul>
</dd>
<dt>
<a name = "error"></a>
<strong>error (err, callback)</strong>
</dt>
<dd>
A more detailed replacement for the lua error function to allow for handlers to be added; repleaces default error so error can be used instead of Manager.error
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">err</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">fucntion</span></span>
the string to be passed to handlers; if a function it will register a handler
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
if given the err param will be used to given the handler a name
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Manager.<span class="global">error</span>(err) <span class="comment">-- calls all error handlers that are set or if none then prints to game and if that fails crashs game</span></pre></li>
<li><pre class="example">Manager.<span class="global">error</span>() <span class="comment">-- returns an error constant that can be used to crash game</span></pre></li>
<li><pre class="example">Manager.<span class="global">error</span>(Manager.<span class="global">error</span>()) <span class="comment">-- crashs the game</span></pre></li>
<li><pre class="example">Manager.<span class="global">error</span>.addHandler(name,callback) <span class="comment">-- adds a new handler if handler returns Manager.error() then game will crash</span></pre></li>
<li><pre class="example">Manager.<span class="global">error</span>[name] <span class="comment">-- returns the handler of that name if present</span></pre></li>
<li><pre class="example">#Manager.<span class="global">error</span> <span class="comment">-- returns the number of error handlers that are present</span></pre></li>
<li><pre class="example"><span class="global">pairs</span>(Manager.<span class="global">error</span>) <span class="comment">-- loops over only the error handlers handler_name,hander</span></pre></li>
</ul>
</dd>
<dt>
<a name = "event"></a>
<strong>event (event_name, callback)</strong>
</dt>
<dd>
Event handler that modules can use, each module can register one function per event
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event_name</span>
<span class="types"><span class="type">int</span> or <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
that referes to an event
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function that will be set for that event
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">Manager.event[event_name] = callback <span class="comment">-- sets the callback for that event</span></pre></li>
<li><pre class="example">Manager.event[event_name] = <span class="keyword">nil</span> <span class="comment">-- clears the callback for that event</span></pre></li>
<li><pre class="example">Manager.event(event_name,callback) <span class="comment">-- sets the callback for that event</span></pre></li>
<li><pre class="example">Manager.event[event_name] <span class="comment">-- returns the callback for that event or the event id if not registered</span></pre></li>
<li><pre class="example">Manager.event(event_name) <span class="comment">-- runs all the call backs for that event</span></pre></li>
<li><pre class="example">Manager.event() <span class="comment">-- returns the stop value for the event proccessor, if returned during an event will stop all other callbacks</span></pre></li>
<li><pre class="example">#Manager.event <span class="comment">-- returns the number of callbacks that are registered</span></pre></li>
<li><pre class="example"><span class="global">pairs</span>(Manager.events) <span class="comment">-- returns event_id,table of callbacks</span></pre></li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "verboseSettings"></a>
<strong>verboseSettings</strong>
</dt>
<dd>
Different verbose settings used for setVerbose
<h3>Fields:</h3>
<ul>
<li><span class="parameter">selfInit</span>
<span class="types"><span class="type">boolean</span></span>
called while the manager is being set up
</li>
<li><span class="parameter">moduleLoad</span>
<span class="types"><span class="type">boolean</span></span>
when a module is required by the manager
</li>
<li><span class="parameter">moduleInit</span>
<span class="types"><span class="type">boolean</span></span>
when and within the initation of a module
</li>
<li><span class="parameter">moduleEnv</span>
<span class="types"><span class="type">boolean</span></span>
during module runtime, this is a global option set within each module(module_verbose=true ln:1) for fine control
</li>
<li><span class="parameter">eventRegistered</span>
<span class="types"><span class="type">boolean</span></span>
when a module registers its event handlers
</li>
<li><span class="parameter">errorCaught</span>
<span class="types"><span class="type">boolean</span></span>
when an error is caught during runtime
</li>
<li><span class="parameter">output</span>
<span class="types"><span class="type">function</span></span>
can be: print || log || or other function
</li>
<li><span class="parameter">_output</span>
a constant value that can used to store output data
</li>
</ul>
</dd>
<dt>
<a name = "Manager.event.names"></a>
<strong>Manager.event.names</strong>
</dt>
<dd>
Sub set to Manger.event and acts as a coverter between event_name and event_id
<h3>Usage:</h3>
<ul>
<pre class="example">Manager.event[event_name]</pre>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "global"></a>
<strong>global</strong>
</dt>
<dd>
Used to avoid conflicts in the global table
<ul>
<li><span class="parameter">if</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a>, <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">true</span></span>
table then the default for the global, if a string then the module to get the global of, if true then reset the global to default
(<em>default</em> {})
</li>
</ul>
<h3>Usage:</h3>
<ul>
<li><pre class="example">global[key] <span class="comment">-- used like the normal global table</span></pre></li>
<li><pre class="example">global{<span class="string">'foo'</span>,<span class="string">'bar'</span>} <span class="comment">-- sets the default value</span></pre></li>
<li><pre class="example">global(<span class="keyword">true</span>) <span class="comment">-- restores global to default</span></pre></li>
<li><pre class="example">global(mopdule_name) <span class="comment">-- returns that module's global</span></pre></li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,561 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><strong>StdLib.Color</strong></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>StdLib.Color</code></h1>
<p>A defines module for retrieving colors by name.</p>
<p>
Extends the Factorio defines table.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set">set ([color=white[, alpha=1]])</a></td>
<td class="summary">Set a value for the alpha channel in the given color table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to_table">to_table (c_arr)</a></td>
<td class="summary">Converts a color in the array format to a color in the table format.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#from_rgb">from_rgb ([r=0[, g=0[, b=0[, a=255]]]])</a></td>
<td class="summary">Converts a color in the rgb format to a color table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#from_hex">from_hex (hex[, alpha=1])</a></td>
<td class="summary">Get a color table with a hexadecimal string.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to_rgb">to_rgb (color)</a></td>
<td class="summary">Converts a color in the color table format to rgb</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to_hex">to_hex (color)</a></td>
<td class="summary">Converts a color in the color table format to hex</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#defines.color">defines.color</a></td>
<td class="summary">A table of colors allowing retrieval by color name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#defines.anticolor">defines.anticolor</a></td>
<td class="summary">Returns white for dark colors or black for lighter colors.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#defines.lightcolor">defines.lightcolor</a></td>
<td class="summary">Returns a lighter color of a named color</td>
</tr>
<tr>
<td class="name" nowrap><a href="#defines.textcolor">defines.textcolor</a></td>
<td class="summary">Returns a lighter color of a named color.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "set"></a>
<strong>set ([color=white[, alpha=1]])</strong>
</dt>
<dd>
Set a value for the alpha channel in the given color table.
`color.a` represents the alpha channel in the given color table.
<ul>
<li>If ***alpha*** is given, set `color.a` to it.
<li>If ***alpha*** is not given, and if the given color table does not have a value for `color.a`, set `color.a` to 1.
<li>If ***alpha*** is not given, and if the given color table already has a value for `color.a`, then leave `color.a` alone.
</ul>
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">color</span>
<span class="types"><a class="type" href="../modules/StdLib.Color.html#defines.color">defines.color</a> or <span class="type">Concepts.Color</span></span>
the color to configure
(<em>default</em> white)
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">float</span></span>
the alpha value (*[0 - 1]*) to set for the given color
(<em>default</em> 1)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">a</span></span>
color table that has the specified value for the alpha channel
</ol>
</dd>
<dt>
<a name = "to_table"></a>
<strong>to_table (c_arr)</strong>
</dt>
<dd>
Converts a color in the array format to a color in the table format.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">c_arr</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the color to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">a</span></span>
converted color &mdash; { r = c\_arr[1], g = c\_arr[2], b = c\_arr[3], a = c\_arr[4] }
</ol>
</dd>
<dt>
<a name = "from_rgb"></a>
<strong>from_rgb ([r=0[, g=0[, b=0[, a=255]]]])</strong>
</dt>
<dd>
Converts a color in the rgb format to a color table
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">r</span>
<span class="types"><span class="type">int</span></span>
0-255 red
(<em>default</em> 0)
</li>
<li><span class="parameter">g</span>
<span class="types"><span class="type">int</span></span>
0-255 green
(<em>default</em> 0)
</li>
<li><span class="parameter">b</span>
<span class="types"><span class="type">int</span></span>
0-255 blue
(<em>default</em> 0)
</li>
<li><span class="parameter">a</span>
<span class="types"><span class="type">int</span></span>
0-255 alpha
(<em>default</em> 255)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Concepts.Color</span></span>
</ol>
</dd>
<dt>
<a name = "from_hex"></a>
<strong>from_hex (hex[, alpha=1])</strong>
</dt>
<dd>
Get a color table with a hexadecimal string.
Optionally provide the value for the alpha channel.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">hex</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
hexadecimal color string (#ffffff, not #fff)
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">float</span></span>
the alpha value to set; such that ***[ 0 &#8924; value &#8924; 1 ]***
(<em>default</em> 1)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">a</span></span>
color table with RGB converted from Hex and with alpha
</ol>
</dd>
<dt>
<a name = "to_rgb"></a>
<strong>to_rgb (color)</strong>
</dt>
<dd>
Converts a color in the color table format to rgb
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">color</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the color to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the color as rgb
</ol>
</dd>
<dt>
<a name = "to_hex"></a>
<strong>to_hex (color)</strong>
</dt>
<dd>
Converts a color in the color table format to hex
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">color</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the color to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the color as hex
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "defines.color"></a>
<strong>defines.color</strong>
</dt>
<dd>
A table of colors allowing retrieval by color name.
<h3>Fields:</h3>
<ul>
<li><span class="parameter">white</span>
{r=1.00,g=1.00,b=1.00}
</li>
<li><span class="parameter">black</span>
{r=0.00,g=0.00,b=0.00}
</li>
<li><span class="parameter">darkgrey</span>
{r=0.25,g=0.25,b=0.25}
</li>
<li><span class="parameter">grey</span>
{r=0.50,g=0.50,b=0.50}
</li>
<li><span class="parameter">lightgrey</span>
{r=0.75,g=0.75,b=0.75}
</li>
<li><span class="parameter">red</span>
{r=1.00,g=0.00,b=0.00}
</li>
<li><span class="parameter">darkred</span>
{r=0.50,g=0.00,b=0.00}
</li>
<li><span class="parameter">lightred</span>
{r=1.00,g=0.50,b=0.50}
</li>
<li><span class="parameter">green</span>
{r=0.00,g=1.00,b=0.00}
</li>
<li><span class="parameter">darkgreen</span>
{r=0.00,g=0.50,b=0.00}
</li>
<li><span class="parameter">lightgreen</span>
{r=0.50,g=1.00,b=0.50}
</li>
<li><span class="parameter">blue</span>
{r=0.00,g=0.00,b=1.00}
</li>
<li><span class="parameter">darkblue</span>
{r=0.00,g=0.00,b=0.50}
</li>
<li><span class="parameter">lightblue</span>
{r=0.50,g=0.50,b=1.00}
</li>
<li><span class="parameter">orange</span>
{r=1.00,g=0.55,b=0.10}
</li>
<li><span class="parameter">yellow</span>
{r=1.00,g=1.00,b=0.00}
</li>
<li><span class="parameter">pink</span>
{r=1.00,g=0.00,b=1.00}
</li>
<li><span class="parameter">purple</span>
{r=0.60,g=0.10,b=0.60}
</li>
<li><span class="parameter">brown</span>
{r=0.60,g=0.40,b=0.10}
</li>
</ul>
</dd>
<dt>
<a name = "defines.anticolor"></a>
<strong>defines.anticolor</strong>
</dt>
<dd>
Returns white for dark colors or black for lighter colors.
<h3>Fields:</h3>
<ul>
<li><span class="parameter">green</span>
defines.color.black
</li>
<li><span class="parameter">grey</span>
defines.color.black
</li>
<li><span class="parameter">lightblue</span>
defines.color.black
</li>
<li><span class="parameter">lightgreen</span>
defines.color.black
</li>
<li><span class="parameter">lightgrey</span>
defines.color.black
</li>
<li><span class="parameter">lightred</span>
defines.color.black
</li>
<li><span class="parameter">orange</span>
defines.color.black
</li>
<li><span class="parameter">white</span>
defines.color.black
</li>
<li><span class="parameter">yellow</span>
defines.color.black
</li>
<li><span class="parameter">black</span>
defines.color.white
</li>
<li><span class="parameter">blue</span>
defines.color.white
</li>
<li><span class="parameter">brown</span>
defines.color.white
</li>
<li><span class="parameter">darkblue</span>
defines.color.white
</li>
<li><span class="parameter">darkgreen</span>
defines.color.white
</li>
<li><span class="parameter">darkgrey</span>
defines.color.white
</li>
<li><span class="parameter">darkred</span>
defines.color.white
</li>
<li><span class="parameter">pink</span>
defines.color.white
</li>
<li><span class="parameter">purple</span>
defines.color.white
</li>
<li><span class="parameter">red</span>
defines.color.white
</li>
</ul>
</dd>
<dt>
<a name = "defines.lightcolor"></a>
<strong>defines.lightcolor</strong>
</dt>
<dd>
Returns a lighter color of a named color
<h3>Fields:</h3>
<ul>
<li><span class="parameter">white</span>
defines.color.lightgrey
</li>
<li><span class="parameter">grey</span>
defines.color.darkgrey
</li>
<li><span class="parameter">lightgrey</span>
defines.color.grey
</li>
<li><span class="parameter">red</span>
defines.color.lightred
</li>
<li><span class="parameter">green</span>
defines.color.lightgreen
</li>
<li><span class="parameter">blue</span>
defines.color.lightblue
</li>
<li><span class="parameter">yellow</span>
defines.color.orange
</li>
<li><span class="parameter">pink</span>
defines.color.purple
</li>
</ul>
</dd>
<dt>
<a name = "defines.textcolor"></a>
<strong>defines.textcolor</strong>
</dt>
<dd>
Returns a lighter color of a named color.
<h3>Fields:</h3>
<ul>
<li><span class="parameter">info</span>
{r=0.21,g=0.95,b=1.00}
</li>
<li><span class="parameter">bg</span>
{r=0.00,g=0.00,b=0.00}
</li>
<li><span class="parameter">low</span>
{r=0.18,g=0.77,b=0.18}
</li>
<li><span class="parameter">med</span>
{r=1.00,g=0.89,b=0.26}
</li>
<li><span class="parameter">high</span>
{r=1.00,g=0.33,b=0.00}
</li>
<li><span class="parameter">crit</span>
{r=1.00,g=0.00,b=0.00}
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,222 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><strong>StdLib.Game</strong></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>StdLib.Game</code></h1>
<p>The game module.</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#fail_if_missing">fail_if_missing (var[, msg="missing value"])</a></td>
<td class="summary">Print msg if specified var evaluates to false.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_player">get_player (mixed)</a></td>
<td class="summary">Return a valid player object from event, index, string, or userdata</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_force">get_force (mixed)</a></td>
<td class="summary">Return a valid force object from event, string, or userdata</td>
</tr>
<tr>
<td class="name" nowrap><a href="#print_all">print_all (msg[, condition])</a></td>
<td class="summary">Messages all players currently connected to the game.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "fail_if_missing"></a>
<strong>fail_if_missing (var[, msg="missing value"])</strong>
</dt>
<dd>
Print msg if specified var evaluates to false.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">var</span>
<span class="types"><span class="type">Mixed</span></span>
variable to evaluate
</li>
<li><span class="parameter">msg</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
message
(<em>default</em> "missing value")
</li>
</ul>
</dd>
<dt>
<a name = "get_player"></a>
<strong>get_player (mixed)</strong>
</dt>
<dd>
Return a valid player object from event, index, string, or userdata
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mixed</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a>, <span class="type">number</span>, <span class="type">LuaPlayer</span> or <span class="type">event</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">LuaPlayer</span></span>
a valid player or nil
</ol>
</dd>
<dt>
<a name = "get_force"></a>
<strong>get_force (mixed)</strong>
</dt>
<dd>
Return a valid force object from event, string, or userdata
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mixed</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a>, <span class="type">LuaForce</span> or <span class="type">event</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">LuaForce</span></span>
a valid force or nil
</ol>
</dd>
<dt>
<a name = "print_all"></a>
<strong>print_all (msg[, condition])</strong>
</dt>
<dd>
Messages all players currently connected to the game.
> Offline players are not counted as having received the message.
If no players exist msg is stored in the `global._print_queue` table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">msg</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the message to send to players
</li>
<li><span class="parameter">condition</span>
<span class="types"><span class="type">nil</span> or <span class="type">boolean</span></span>
the condition to be true for a player to be messaged
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">uint</span></span>
the number of players who received the message.
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,302 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><strong>StdLib.String</strong></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>StdLib.String</code></h1>
<p>Extends Lua 5.2 string.</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#trim">trim (s)</a></td>
<td class="summary">Returns a copy of the string with any leading or trailing whitespace from the string removed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#starts_with">starts_with (s, start)</a></td>
<td class="summary">Tests if a string starts with a given substring.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ends_with">ends_with (s, ends)</a></td>
<td class="summary">Tests if a string ends with a given substring.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#contains">contains (s, contains)</a></td>
<td class="summary">Tests if a string contains a given substring.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_empty">is_empty (s)</a></td>
<td class="summary">Tests whether a string is empty.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#split">split (s[, sep="."[, pattern=false]])</a></td>
<td class="summary">Splits a string into an array.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "trim"></a>
<strong>trim (s)</strong>
</dt>
<dd>
Returns a copy of the string with any leading or trailing whitespace from the string removed.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">s</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string to remove leading or trailing whitespace from
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
a copy of the string without leading or trailing whitespace
</ol>
</dd>
<dt>
<a name = "starts_with"></a>
<strong>starts_with (s, start)</strong>
</dt>
<dd>
Tests if a string starts with a given substring.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">s</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string to check for the start substring
</li>
<li><span class="parameter">start</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the substring to test for
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the start substring was found in the string
</ol>
</dd>
<dt>
<a name = "ends_with"></a>
<strong>ends_with (s, ends)</strong>
</dt>
<dd>
Tests if a string ends with a given substring.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">s</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string to check for the end substring
</li>
<li><span class="parameter">ends</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the substring to test for
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the end substring was found in the string
</ol>
</dd>
<dt>
<a name = "contains"></a>
<strong>contains (s, contains)</strong>
</dt>
<dd>
Tests if a string contains a given substring.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">s</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string to check for the substring
</li>
<li><span class="parameter">contains</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the substring to test for
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the substring was found in the string
</ol>
</dd>
<dt>
<a name = "is_empty"></a>
<strong>is_empty (s)</strong>
</dt>
<dd>
Tests whether a string is empty.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">s</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string to test
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the string is empty
</ol>
</dd>
<dt>
<a name = "split"></a>
<strong>split (s[, sep="."[, pattern=false]])</strong>
</dt>
<dd>
Splits a string into an array.
*Note:* Empty split substrings are not included in the resulting table.
<p>For example, `string.split("foo.bar...", ".", false)` results in the table `{"foo", "bar"}`.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">s</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the string to split
</li>
<li><span class="parameter">sep</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the separator to use.
(<em>default</em> ".")
</li>
<li><span class="parameter">pattern</span>
<span class="types"><span class="type">boolean</span></span>
whether to interpret the separator as a lua pattern or plaintext for the string split
(<em>default</em> false)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">{string,...}</a></span>
an array of strings
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,922 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><strong>StdLib.Table</strong></li>
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>StdLib.Table</code></h1>
<p>Extends Lua 5.2 table.</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#map">map (tbl, func[, ...])</a></td>
<td class="summary">Given a mapping function, creates a transformed copy of the table
by calling the function for each element in the table, and using
the result as the new value for the key.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#filter">filter (tbl, func[, ...])</a></td>
<td class="summary">Given a filter function, creates a filtered copy of the table
by calling the function for each element in the table, and
filtering out any key-value pairs for non-true results.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#find">find (tbl, func[, ...])</a></td>
<td class="summary">Given a candidate search function, iterates over the table, calling the function
for each element in the table, and returns the first element the search function returned true.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#any">any (tbl, func[, ...])</a></td>
<td class="summary">Given a candidate search function, iterates over the table, calling the function
for each element in the table, and returns true if search function returned true.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#each">each (tbl, func[, ...])</a></td>
<td class="summary">Given a function, apply it to each element in the table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#flatten">flatten (tbl[, level])</a></td>
<td class="summary">Returns a new array that is a one-dimensional recursive flattening of the given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#first">first (tbl)</a></td>
<td class="summary">Given an array, returns the first element or nil if no element exists.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#last">last (tbl)</a></td>
<td class="summary">Given an array, returns the last element or nil if no elements exist.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#min">min (tbl)</a></td>
<td class="summary">Given an array of only numeric values, returns the minimum or nil if no element exists.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#max">max (tbl)</a></td>
<td class="summary">Given an array of only numeric values, returns the maximum or nil if no element exists.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sum">sum (tbl)</a></td>
<td class="summary">Given an array of only numeric values, return the sum of all values, or 0 for empty arrays.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#avg">avg (tbl)</a></td>
<td class="summary">Given an array of only numeric values, returns the average or nil if no element exists.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#merge">merge (tblA, tblB[, array_merge=false])</a></td>
<td class="summary">Merges two tables &mdash; values from first get overwritten by the second.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#deepcopy">deepcopy (object)</a></td>
<td class="summary">Creates a deep copy of table without copying Factorio objects.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#values">values (tbl[, sorted[, as_string]])</a></td>
<td class="summary">Returns a copy of all of the values in the table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#keys">keys (tbl[, sorted[, as_string]])</a></td>
<td class="summary">Returns a copy of all of the keys in the table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#remove_keys">remove_keys (tbl, keys)</a></td>
<td class="summary">Removes keys from a table by setting the values associated with the keys to nil.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count_keys">count_keys (tbl[, func[, ...]])</a></td>
<td class="summary">Returns the number of keys in a table, if func is passed only count keys when the function is true.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#invert">invert (tbl)</a></td>
<td class="summary">Returns an inverted (***{[value] = key,...}***) copy of the given table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#size">size (table)</a></td>
<td class="summary">Return the size of a table using built in table_size function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#arr_to_bool">arr_to_bool (tbl)</a></td>
<td class="summary">For all string or number values in an array map them to a key = true table</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "map"></a>
<strong>map (tbl, func[, ...])</strong>
</dt>
<dd>
Given a mapping function, creates a transformed copy of the table
by calling the function for each element in the table, and using
the result as the new value for the key. Passes the index as second argument to the function.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to be mapped to the transform
</li>
<li><span class="parameter">func</span>
<span class="types"><span class="type">function</span></span>
the function to transform values
</li>
<li><span class="parameter">...</span>
additional arguments passed to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a new table containing the keys and mapped values
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">a= { <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.map(a, <span class="keyword">function</span>(v) <span class="keyword">return</span> v * <span class="number">10</span> <span class="keyword">end</span>) <span class="comment">--produces: { 10, 20, 30, 40, 50 }</span></pre></li>
<li><pre class="example">a = {<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.map(a, <span class="keyword">function</span>(v, k, x) <span class="keyword">return</span> v * k + x <span class="keyword">end</span>, <span class="number">100</span>) <span class="comment">--produces { 101, 104, 109, 116, 125}</span></pre></li>
</ul>
</dd>
<dt>
<a name = "filter"></a>
<strong>filter (tbl, func[, ...])</strong>
</dt>
<dd>
Given a filter function, creates a filtered copy of the table
by calling the function for each element in the table, and
filtering out any key-value pairs for non-true results. Passes the index as second argument to the function.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to be filtered
</li>
<li><span class="parameter">func</span>
<span class="types"><span class="type">function</span></span>
the function to filter values
</li>
<li><span class="parameter">...</span>
additional arguments passed to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a new table containing the filtered key-value pairs
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">a= { <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.filter(a, <span class="keyword">function</span>(v) <span class="keyword">return</span> v % <span class="number">2</span> == <span class="number">0</span> <span class="keyword">end</span>) <span class="comment">--produces: { 2, 4 }</span></pre></li>
<li><pre class="example">a = {<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.filter(a, <span class="keyword">function</span>(v, k, x) <span class="keyword">return</span> k % <span class="number">2</span> == <span class="number">1</span> <span class="keyword">end</span>) <span class="comment">--produces: { 1, 3, 5 }</span></pre></li>
</ul>
</dd>
<dt>
<a name = "find"></a>
<strong>find (tbl, func[, ...])</strong>
</dt>
<dd>
Given a candidate search function, iterates over the table, calling the function
for each element in the table, and returns the first element the search function returned true.
Passes the index as second argument to the function.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to be searched
</li>
<li><span class="parameter">func</span>
<span class="types"><span class="type">function</span></span>
the function to use to search for any matching element
</li>
<li><span class="parameter">...</span>
additional arguments passed to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">nil</span> or <span class="type">Mixed</span></span>
the first found value, or nil if none was found
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">a= { <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.find(a, <span class="keyword">function</span>(v) <span class="keyword">return</span> v % <span class="number">2</span> == <span class="number">0</span> <span class="keyword">end</span>) <span class="comment">--produces: 2</span></pre></li>
<li><pre class="example">a = {<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.find(a, <span class="keyword">function</span>(v, k, x) <span class="keyword">return</span> k % <span class="number">2</span> == <span class="number">1</span> <span class="keyword">end</span>) <span class="comment">--produces: 1</span></pre></li>
</ul>
</dd>
<dt>
<a name = "any"></a>
<strong>any (tbl, func[, ...])</strong>
</dt>
<dd>
Given a candidate search function, iterates over the table, calling the function
for each element in the table, and returns true if search function returned true.
Passes the index as second argument to the function.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to be searched
</li>
<li><span class="parameter">func</span>
<span class="types"><span class="type">function</span></span>
the function to use to search for any matching element
</li>
<li><span class="parameter">...</span>
additional arguments passed to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if an element was found, false if none was found
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example">a= { <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>} <span class="global">table</span>.any(a, <span class="keyword">function</span>(v) <span class="keyword">return</span> v % <span class="number">2</span> == <span class="number">0</span> <span class="keyword">end</span>) <span class="comment">--produces: true</span></pre></li>
<li><pre class="example">a = {<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>} <span class="global">table</span>.any(a, <span class="keyword">function</span>(v, k, x) <span class="keyword">return</span> k % <span class="number">2</span> == <span class="number">1</span> <span class="keyword">end</span>) <span class="comment">--produces: true</span></pre></li>
</ul>
</dd>
<dt>
<a name = "each"></a>
<strong>each (tbl, func[, ...])</strong>
</dt>
<dd>
Given a function, apply it to each element in the table.
Passes the index as the second argument to the function.
<p>Iteration is aborted if the applied function returns true for any element during iteration.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to be iterated
</li>
<li><span class="parameter">func</span>
<span class="types"><span class="type">function</span></span>
the function to apply to elements
</li>
<li><span class="parameter">...</span>
additional arguments passed to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table where the given function has been applied to its elements
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">a = {<span class="number">10</span>, <span class="number">20</span>, <span class="number">30</span>, <span class="number">40</span>}
<span class="global">table</span>.each(a, <span class="keyword">function</span>(v) game.<span class="global">print</span>(v) <span class="keyword">end</span>) <span class="comment">--prints 10, 20, 30, 40, 50</span></pre>
</ul>
</dd>
<dt>
<a name = "flatten"></a>
<strong>flatten (tbl[, level])</strong>
</dt>
<dd>
Returns a new array that is a one-dimensional recursive flattening of the given array.
For every element that is an array, extract its elements into the new array.
<p>The optional level argument determines the level of recursion to flatten.
> This function flattens an integer-indexed array, but not an associative array.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">array</span></span>
the array to be flattened
</li>
<li><span class="parameter">level</span>
<span class="types"><span class="type">uint</span></span>
recursive levels, or no limit to recursion if not supplied
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">array</span></span>
a new array that represents the flattened contents of the given array
</ol>
</dd>
<dt>
<a name = "first"></a>
<strong>first (tbl)</strong>
</dt>
<dd>
Given an array, returns the first element or nil if no element exists.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">array</span></span>
the array
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">nil</span> or <span class="type">Mixed</span></span>
the first element
</ol>
</dd>
<dt>
<a name = "last"></a>
<strong>last (tbl)</strong>
</dt>
<dd>
Given an array, returns the last element or nil if no elements exist.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">array</span></span>
the array
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">nil</span> or <span class="type">Mixed</span></span>
the last element or nil
</ol>
</dd>
<dt>
<a name = "min"></a>
<strong>min (tbl)</strong>
</dt>
<dd>
Given an array of only numeric values, returns the minimum or nil if no element exists.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">{number,...}</span></span>
the array with only numeric values
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">nil</span> or <span class="type">number</span></span>
the minimum value
</ol>
</dd>
<dt>
<a name = "max"></a>
<strong>max (tbl)</strong>
</dt>
<dd>
Given an array of only numeric values, returns the maximum or nil if no element exists.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">{number,...}</span></span>
the array with only numeric values
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">nil</span> or <span class="type">number</span></span>
the maximum value
</ol>
</dd>
<dt>
<a name = "sum"></a>
<strong>sum (tbl)</strong>
</dt>
<dd>
Given an array of only numeric values, return the sum of all values, or 0 for empty arrays.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">{number,...}</span></span>
the array with only numeric values
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the sum of the numbers or zero if the given array was empty
</ol>
</dd>
<dt>
<a name = "avg"></a>
<strong>avg (tbl)</strong>
</dt>
<dd>
Given an array of only numeric values, returns the average or nil if no element exists.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><span class="type">{number,...}</span></span>
the array with only numeric values
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">nil</span> or <span class="type">number</span></span>
the average value
</ol>
</dd>
<dt>
<a name = "merge"></a>
<strong>merge (tblA, tblB[, array_merge=false])</strong>
</dt>
<dd>
Merges two tables &mdash; values from first get overwritten by the second.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tblA</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
first table
</li>
<li><span class="parameter">tblB</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
second table
</li>
<li><span class="parameter">array_merge</span>
<span class="types"><span class="type">boolean</span></span>
set to true to merge the tables as an array or false for an associative array
(<em>default</em> false)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">array</span> or <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
an array or an associated array where tblA and tblB have been merged
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">function</span> some_func(x, y, args)
args = <span class="global">table</span>.merge({option1=<span class="keyword">false</span>}, args)
<span class="keyword">if</span> opts.option1 == <span class="keyword">true</span> <span class="keyword">then</span> <span class="keyword">return</span> x <span class="keyword">else</span> <span class="keyword">return</span> y <span class="keyword">end</span>
<span class="keyword">end</span>
some_func(<span class="number">1</span>,<span class="number">2</span>) <span class="comment">-- returns 2
</span>some_func(<span class="number">1</span>,<span class="number">2</span>,{option1=<span class="keyword">true</span>}) <span class="comment">-- returns 1</span></pre>
</ul>
</dd>
<dt>
<a name = "deepcopy"></a>
<strong>deepcopy (object)</strong>
</dt>
<dd>
Creates a deep copy of table without copying Factorio objects.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">object</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to copy
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a copy of the table
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> copy = <span class="global">table</span>.deepcopy[data.raw.[<span class="string">"stone-furnace"</span>][<span class="string">"stone-furnace"</span>]] <span class="comment">-- returns a copy of the stone furnace entity</span></pre>
</ul>
</dd>
<dt>
<a name = "values"></a>
<strong>values (tbl[, sorted[, as_string]])</strong>
</dt>
<dd>
Returns a copy of all of the values in the table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to copy the keys from, or an empty table if tbl is nil
</li>
<li><span class="parameter">sorted</span>
<span class="types"><span class="type">boolean</span></span>
whether to sort the keys (slower) or keep the random order from pairs()
(<em>optional</em>)
</li>
<li><span class="parameter">as_string</span>
<span class="types"><span class="type">boolean</span></span>
whether to try and parse the values as strings, or leave them as their existing type
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">array</span></span>
an array with a copy of all the values in the table
</ol>
</dd>
<dt>
<a name = "keys"></a>
<strong>keys (tbl[, sorted[, as_string]])</strong>
</dt>
<dd>
Returns a copy of all of the keys in the table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to copy the keys from, or an empty table if tbl is nil
</li>
<li><span class="parameter">sorted</span>
<span class="types"><span class="type">boolean</span></span>
whether to sort the keys (slower) or keep the random order from pairs()
(<em>optional</em>)
</li>
<li><span class="parameter">as_string</span>
<span class="types"><span class="type">boolean</span></span>
whether to try and parse the keys as strings, or leave them as their existing type
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">array</span></span>
an array with a copy of all the keys in the table
</ol>
</dd>
<dt>
<a name = "remove_keys"></a>
<strong>remove_keys (tbl, keys)</strong>
</dt>
<dd>
Removes keys from a table by setting the values associated with the keys to nil.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to remove the keys from
</li>
<li><span class="parameter">keys</span>
<span class="types"><span class="type">{Mixed,...}</span></span>
an array of keys that exist in the given table
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
tbl without the specified keys
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example"><span class="keyword">local</span> a = {<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>}
<span class="global">table</span>.remove_keys(a, {<span class="number">1</span>,<span class="number">3</span>}) <span class="comment">--returns {nil, 2, nil, 4}</span></pre></li>
<li><pre class="example"><span class="keyword">local</span> b = {k1 = <span class="number">1</span>, k2 = <span class="string">'foo'</span>, old_key = <span class="string">'bar'</span>}
<span class="global">table</span>.remove_keys(b, {<span class="string">'old_key'</span>}) <span class="comment">--returns {k1 = 1, k2 = 'foo'}</span></pre></li>
</ul>
</dd>
<dt>
<a name = "count_keys"></a>
<strong>count_keys (tbl[, func[, ...]])</strong>
</dt>
<dd>
Returns the number of keys in a table, if func is passed only count keys when the function is true.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
to count keys
</li>
<li><span class="parameter">func</span>
<span class="types"><span class="type">function</span></span>
to incremement counter
(<em>optional</em>)
</li>
<li><span class="parameter">...</span>
additional arguments passed to the function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<li>
<span class="types"><span class="type">number</span></span>
The number of keys matching the function or the number of all keys if func isn't passed</li>
<li>
<span class="types"><span class="type">number</span></span>
The total number of keys</li>
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example"><span class="keyword">local</span> a = { <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.count_keys(a) <span class="comment">-- produces: 5, 5</span></pre></li>
<li><pre class="example"><span class="keyword">local</span> a = {<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>}
<span class="global">table</span>.count_keys(a, <span class="keyword">function</span>(v, k) <span class="keyword">return</span> k % <span class="number">2</span> == <span class="number">1</span> <span class="keyword">end</span>) <span class="comment">-- produces: 3, 5</span></pre></li>
</ul>
</dd>
<dt>
<a name = "invert"></a>
<strong>invert (tbl)</strong>
</dt>
<dd>
Returns an inverted (***{[value] = key,...}***) copy of the given table. If the values are not unique, the assigned key depends on the order of pairs().
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to invert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a new table with inverted mapping
</ol>
<h3>Usage:</h3>
<ul>
<li><pre class="example"><span class="keyword">local</span> a = {k1 = <span class="string">'foo'</span>, k2 = <span class="string">'bar'</span>}
<span class="global">table</span>.invert(a) <span class="comment">--returns {'foo' = k1, 'bar' = k2}</span></pre></li>
<li><pre class="example"><span class="keyword">local</span> b = {k1 = <span class="string">'foo'</span>, k2 = <span class="string">'bar'</span>, k3 = <span class="string">'bar'</span>}
<span class="global">table</span>.invert(b) <span class="comment">--returns {'foo' = k1, 'bar' = ?}</span></pre></li>
</ul>
</dd>
<dt>
<a name = "size"></a>
<strong>size (table)</strong>
</dt>
<dd>
Return the size of a table using built in table_size function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
to use
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
size of the table
</ol>
</dd>
<dt>
<a name = "arr_to_bool"></a>
<strong>arr_to_bool (tbl)</strong>
</dt>
<dd>
For all string or number values in an array map them to a key = true table
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the table to convert
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the converted table
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> a = {<span class="string">"v1"</span>, <span class="string">"v2"</span>}
<span class="global">table</span>.array_to_dict_bool(a) <span class="comment">-- return {["v1"] = true, ["v2"]= true}</span></pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -1,139 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/ExpGamingCore.Command.html">ExpGamingCore.Command</a></li>
<li><a href="../modules/ExpGamingCore.Gui.html">ExpGamingCore.Gui</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Center.html">ExpGamingCore.Gui.Center</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Inputs.html">ExpGamingCore.Gui.Inputs</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Left.html">ExpGamingCore.Gui.Left</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Popup.html">ExpGamingCore.Gui.Popup</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Test.html">ExpGamingCore.Gui.Test</a></li>
<li><a href="../modules/ExpGamingCore.Gui.Toolbar.html">ExpGamingCore.Gui.Toolbar</a></li>
<li><a href="../modules/ExpGamingCore.Role.html">ExpGamingCore.Role</a></li>
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
<li><strong>StdLib.Time</strong></li>
</ul>
</div>
<div id="content">
<h1>Module <code>StdLib.Time</code></h1>
<p>A defines module for retrieving the number of ticks in 1 unit of time.</p>
<p>
Extends the Factorio defines table.</p>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#defines.time">defines.time</a></td>
<td class="summary">Returns the number of ticks in a second, minute, hour, day, week, month, or year.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "defines.time"></a>
<strong>defines.time</strong>
</dt>
<dd>
Returns the number of ticks in a second, minute, hour, day, week, month, or year.
<h3>Fields:</h3>
<ul>
<li><span class="parameter">second</span>
the number of Factorio ticks in a second
</li>
<li><span class="parameter">minute</span>
the number of Factorio ticks in a second
</li>
<li><span class="parameter">hour</span>
the number of Factorio ticks in an hour
</li>
<li><span class="parameter">day</span>
the number of Factorio ticks in an day
</li>
<li><span class="parameter">week</span>
the number of Factorio ticks in a week
</li>
<li><span class="parameter">month</span>
the number of Factorio ticks in a month (30 days)
</li>
<li><span class="parameter">year</span>
the number of Factorio ticks in a year (365 days)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> ten_seconds = defines.time.second * <span class="number">10</span></pre>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2018-06-07 12:58:23 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>