Doc Added

This commit is contained in:
Cooldude2606
2018-05-29 20:15:20 +01:00
parent 7dafb4ea7f
commit f5153f3686
43 changed files with 6979 additions and 241 deletions

View File

@@ -38,7 +38,7 @@ end
--- Used to open a center frame for a player
-- @usage Gui.center.open(player,'server-info') -- return true
-- @param player a player indifier to get the flow for
-- @tparam center string the name of the center frame to open
-- @tparam string center the name of the center frame to open
-- @treturn boelon based on if it successed or not
function center.open(player,center)
local player = Game.get_player(player)
@@ -54,8 +54,8 @@ end
--- Used to open a center frame for a player
-- @usage Gui.center.open_tab(player,'readme','rules') -- return true
-- @param player a player indifier to get the flow for
-- @tparam center string the name of the center frame to open
-- @tparam tab string the name of the tab to open
-- @tparam string center the name of the center frame to open
-- @tparam string tab the name of the tab to open
-- @treturn boelon based on if it successed or not
function center.open_tab(player,center,tab)
local player = Game.get_player(player)

View File

@@ -182,9 +182,9 @@ end
--- Used to define a choose-elem-button callback only on elem_changed
-- @usage Gui.inputs.add_elem_button('test','Test','Just for testing',function)
-- @tparam string name the name of this button
-- @tparam string the display for this button, either text or sprite path
-- @tparam string elem_type the display for this button, either text or sprite path
-- @tparam string tooltip the tooltip to show on the button
-- @tparam function the callback to call on change function(player,element,elem)
-- @tparam function callback the callback to call on change function(player,element,elem)
-- @treturn table the button object that was made, to allow a custom error event if wanted
function inputs.add_elem_button(name,elem_type,tooltip,callback)
local button = inputs.add{
@@ -210,9 +210,11 @@ end
--- Used to define a checkbox callback only on state_changed
-- @usage Gui.inputs.add_checkbox('test',false,'Just for testing',function,function,funvtion)
-- @tparam string name the name of this button
-- @tparam string the display for this button, either text or sprite path
-- @tparam string tooltip the tooltip to show on the button
-- @tparam function the callback to call on change function(player,element,elem)
-- @tparam boolean radio if this is a radio button
-- @tparam string display the display for this button, either text or sprite path
-- @tparam function default the callback which choses the default check state
-- @tparam function callback_true the callback to call when changed to true
-- @tparam function callback_false the callback to call when changed to false
-- @treturn table the button object that was made, to allow a custom error event if wanted
function inputs.add_checkbox(name,radio,display,default,callback_true,callback_false)
local type = 'checkbox'; if radio then type='radiobutton' end
@@ -279,7 +281,7 @@ end
-- @tparam string name the name of this button
-- @tparam boolean box is it a text box rather than a text field
-- @tparam string text the starting text
-- @tparam function the callback to call on change function(player,text,element)
-- @tparam function callback the callback to call on change function(player,text,element)
-- @treturn table the text object that was made, to allow a custom error event if wanted
function inputs.add_text(name,box,text,callback)
local type = 'textfield'; if box then type='text-box' end
@@ -305,10 +307,10 @@ end
--- Used to define a slider callback only on value_changed
-- @usage Gui.inputs.add_slider('test','horizontal',1,10,5,function)
-- @tparam string name the name of this button
-- @tapram string text the caption to go with the slider
-- @tparam string orientation direction of the slider
-- @tparam number min the lowest number
-- @tparam number max the highest number
-- @param start_callback either a number or a function to return a number
-- @tparam function start_callback either a number or a function to return a number
-- @tparam function callback the function to be called on value_changed function(player,value,percent,element)
-- @treturn table the slider object that was made, to allow a custom error event if wanted
function inputs.add_slider(name,orientation,min,max,start_callback,callback)
@@ -338,6 +340,7 @@ end
--- Used to define a drop down callback only on value_changed
-- @usage Gui.inputs.add_drop_down('test',{1,2,3},1,function)
-- @tparam string name name of the drop down
-- @param items either a list or a function which returns a list
-- @param index either a number or a function which returns a number
-- @tparam function callback the callback which is called when a new index is selected function(player,selected,items,element)

View File

@@ -13,7 +13,7 @@ local toolbar = {}
-- @usage toolbar.add('foo','Foo','Test',function() game.print('test') end)
-- @tparam string name the name of the button
-- @tparam string caption can be a sprite path or text to show
-- @tparma string tooltip the help to show for the button
-- @tparam string tooltip the help to show for the button
-- @tparam function callback the function which is called on_click
-- @treturn table the button object that was made
function toolbar.add(name,caption,tooltip,callback)

View File

@@ -76,7 +76,7 @@ end
--- Used to call the custom commands
-- @usage You dont its an internal command
-- @tparam defines.events.on_console_command event the event rasied by the command=
-- @tparam defines.events.on_console_command command the event rasied by the command
local function run_custom_command(command)
local command_data = command_data[command.name]
local player_name = Game.get_player(command) and Game.get_player(command).name or 'server'

View File

@@ -97,14 +97,15 @@ end)
--- Adds a camera that updates every tick (or less depeading on how many are opening) it will move to follow an entity
-- @usage Gui.cam_link{entity=game.player.character,frame=frame,width=50,hight=50,zoom=1}
-- @usage Gui.cam_link{entity=game.player.character,cam=frame.camera,surface=game.surfaces['testing']}
-- @param entity this is the entity that the camera will follow
-- @param[opt] cam a camera that you already have in the gui
-- @param[opt] frame the frame to add the camera to, no effect if cam param is given
-- @param[chain=frame] zoom the zoom to give the new camera
-- @param[chain=frame] width the width to give the new camera
-- @param[chain=frame] height the height to give the new camera
-- @param[opt] surface this will over ride the surface that the camera follows on, allowing for a 'ghost surface' while keeping same position
-- @param[opt] respawn_open if set to true then the camera will auto re link to the player after a respawn
-- @tparam table data contains all other params given below
-- @field entity this is the entity that the camera will follow
-- @field cam a camera that you already have in the gui
-- @field frame the frame to add the camera to, no effect if cam param is given
-- @field zoom the zoom to give the new camera
-- @field width the width to give the new camera
-- @field height the height to give the new camera
-- @field surface this will over ride the surface that the camera follows on, allowing for a 'ghost surface' while keeping same position
-- @field respawn_open if set to true then the camera will auto re link to the player after a respawn
-- @return the camera that the function used be it made or given as a param
function Gui.cam_link(data)
if not data.entity or not data.entity.valid then return end

View File

@@ -97,6 +97,7 @@ end
-- @usage Ranking.print('admin','We got a grifer')
-- @param rank_base the rank that acts as the cut off point (rank is always included)
-- @param rtn what do you want to return to the players
-- @tparam defines.color colour the colour that will be used to print
-- @tparam bolean below if true rank below base are printed to
function Ranking.print(rank_base,rtn,colour,below)
local colour = colour or defines.color.white
@@ -185,7 +186,7 @@ end
--- Given the player has a rank in the preset table it is given
-- @usage Ranking.find_preset(1)
-- @param player the player to test for an auto rank
-- @tparam[opt=nil] tick the tick it happens on
-- @tparam[opt=nil] number tick the tick it happens on
function Ranking.find_preset(player,tick)
local presets = Ranking._presets().current
local meta_data = Ranking._presets().meta
@@ -250,6 +251,8 @@ end
--- Print a message to all players of this rank
-- @usage rank:print('foo')
-- @param rtn any value you want to return
-- @tparam define.color colour the colour that will be used to print
-- @tparam boolean show_default weather to use the default rank name for the print
function Ranking._rank:print(rtn,colour,show_default)
local colour = colour or defines.color.white
local meta_data = Ranking._presets().meta

View File

@@ -63,8 +63,8 @@ end
--- Adds a thread into the resolve queue, can be used to lower lag
-- @usage Server.queue_thread(thread) -- return true/false
-- @tparam table the thread to add to the queue must have a resolve function (must be open)
-- @treturn bolean was the thread added
-- @tparam table thread_to_queue the thread to add to the queue must have a resolve function (must be open)
-- @treturn boolean was the thread added
function Server.queue_thread(thread_to_queue)
if not thread_to_queue and not thread_to_queue.valid and not thread_to_queue:valid() then return false end
if not thread_to_queue._resolve then return false end
@@ -87,7 +87,7 @@ function Server.close_all_threads(with_force)
end
--- Runs all the theads which have opened with an on_tick event
-- @ussage Server.run_tick_threads()
-- @usage Server.run_tick_threads()
function Server.run_tick_threads()
table.each(Server._threads().tick,function(uuid)
local next_thread = Server.get_thread(uuid)
@@ -99,7 +99,7 @@ function Server.run_tick_threads()
end
--- Checks the timeout on all active timeout threads
-- @ussage Server.check_timeouts()
-- @usage Server.check_timeouts()
function Server.check_timeouts()
table.each(Server._threads().timeout,function(uuid)
local next_thread = Server.get_thread(uuid)

View File

@@ -29,7 +29,7 @@ end
-- @param player_message the message to be printed in chat
-- @param player_name the name of the player sending the message
-- @param[opt] player_tag the tag apllied to the player's name
-- @param[opt] plyaer_colour the colour of the message
-- @param[opt] player_colour the colour of the message
-- @param[opt] prefix add a prefix before the chat eg [IRC]
function Sync.print(player_message,player_name,player_tag,player_colour,prefix)
if not player_message then return 'No Message Found' end
@@ -53,13 +53,13 @@ end
--- Logs an embed to the json.data we use a js script to add things we cant here
-- @usage Sync.emit_embeded{title='BAN',color='0x0',description='A player was banned' ... }
-- @tparam table arg a table which contains everything that the embeded will use
-- @param[opt=''] title the tile of the embed
-- @param[opt='0x0'] color the color given in hex you can use Color.to_hex{r=0,g=0,b=0}
-- @param[opt=''] description the description of the embed
-- @param[opt=''] server_detail sting to add onto the pre-set server detail
-- @param[opt] fieldone the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline)
-- @param[optchain] fieldtwo
-- @tparam table args a table which contains everything that the embeded will use
-- @field title the tile of the embed
-- @field color the color given in hex you can use Color.to_hex{r=0,g=0,b=0}
-- @field description the description of the embed
-- @field server_detail sting to add onto the pre-set server detail
-- @field fieldone the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline)
-- @field fieldtwo the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline)
function Sync.emit_embeded(args)
if not is_type(args,'table') then return end
local title = is_type(args.title,'string') and args.title or ''
@@ -166,7 +166,7 @@ end
--- used to return the global list and set values in it
-- @usage Sync.info{server_name='Factorio Server 2'}
-- @tparam[opt=nil] table keys to be replaced in the server info
-- @tparam[opt=nil] table set keys to be replaced in the server info
-- @return either returns success when setting or the info when not setting
function Sync.info(set)
if not global.exp_core then global.exp_core = {} end
@@ -203,7 +203,7 @@ end
--- used to return the global time and set its value
-- @usage Sync.time('Sun Apr 1 18:44:30 UTC 2018')
-- @tparam[opt=nil] string the date time to be set
-- @tparam[opt=nil] string set the date time to be set
-- @return either true false if setting or the date time and tick off set
function Sync.time(set)
local info = Sync.info()
@@ -242,8 +242,8 @@ end
--- Adds a callback to be called when the info is updated
-- @usage Sync.add_update('players',function() return #game.players end)
-- @tparam key string the key that the value will be stored in
-- @tparam callback function the function which will return this value
-- @tparam string key the key that the value will be stored in
-- @tparam function callback the function which will return this value
function Sync.add_update(key,callback)
if game then return end
if not is_type(callback,'function') then return end

View File

@@ -1,3 +1,8 @@
--- Factorio Softmod Manager
-- @module FSM
-- @alias Manager
-- @author Cooldude2606
-- @usage Manager = require("FactorioSoftmodManager")
-- Used to load all other modules that are indexed in index.lua
local moduleIndex = require("/modules/index")
local Manager = {}
@@ -46,7 +51,7 @@ Manager.currentState = 'selfInit'
--- Default output for the verbose
-- @usage Manager.verbose('Hello, World!')
-- @tparm rtn string the value that will be returned though verbose output
-- @tparam string rtn the value that will be returned though verbose output
Manager._verbose = function(rtn)
-- creates one file per game, ie clears file on reset
if game and Manager.setVerbose._output ~= true then Manager.setVerbose._output=true game.write_file('verbose.log',rtn)
@@ -58,8 +63,8 @@ end
--- Used to call the output of the verbose when the current state allows it
-- @usage Manager.verbose('Hello, World!')
-- @tparm rtn string the value that will be returned though verbose output
-- @tparm action string is used to decide which verbose this is error || event etc
-- @tparam string rtn the value that will be returned though verbose output
-- @tparam string action is used to decide which verbose this is error || event etc
Manager.verbose = function(rtn,action)
local settings = Manager.setVerbose
local state = Manager.currentState
@@ -428,7 +433,9 @@ Manager.event = setmetatable({
end
})
--- Sub set to Manger.event and acts as a coverter between event_name and event_id
-- @field names
-- @usage Manager.event[event_name] -- see above, can not be accessed via Manager.event.names
-- @see Manager.event
rawset(Manager.event,'names',setmetatable({},{
__index=function(tbl,key)
if type(key) == 'number' or tonumber(key) then

View File

@@ -1,172 +0,0 @@
--- Makes working with events in factorio a lot more simple.
-- <p>Factorio can only have one handler registered per event. This module
-- allows you to easily register multiple handlers for each event.
-- Using this module is as simple as replacing script.on_event(...) with Event.register(...)</p>
-- @module Event
-- @usage require('stdlib/event/event')
local Event = { --luacheck: allow defined top
_registry = {},
core_events = {
init = -1,
load = -2,
configuration_changed = -3,
_register = function(id)
if id == Event.core_events.init then
script.on_init(
function()
Event.dispatch({name = Event.core_events.init, tick = game.tick})
end
)
elseif id == Event.core_events.load then
script.on_load(
function()
Event.dispatch({name = Event.core_events.load, tick = -1})
end
)
elseif id == Event.core_events.configuration_changed then
script.on_configuration_changed(
function(event)
event.name = Event.core_events.configuration_changed
event.data = event -- for backwards compatibilty
Event.dispatch(event)
end
)
end
end
}
}
--[[ edit by cooldude2606 to allow change during run-time without desyncs -- still going to use this but FACTORIO NO LIKE
Event.__registry = Event._registry
Event._registry = function()
if game and global then
if not global.event_registry then global.event_registry = Event.__registry end
return global.event_registry
end
return Event.__registry
end]]
--- Registers a function for a given event. If a nil handler is passed remove all events and stop listening for that event.
-- Events are dispatched in the order they are registered.
-- @usage Event.register(defines.events.on_tick, function(event) print event.tick end)
-- -- creates an event that prints the current tick every tick.
-- @tparam defines.events|{defines.events,...} event events to register
-- @tparam function handler Function to call when event is triggered
-- @treturn Event
function Event.register(event, handler)
if not _G.Game then error('StdLib/Game not loaded') end
_G.Game.fail_if_missing(event, "missing event argument")
event = (type(event) == "table" and event) or {event}
for _, event_id in pairs(event) do
if not (type(event_id) == "number" or type(event_id) == "string") then
error("Invalid Event Id, Must be string or int, or array of strings and/or ints", 2)
end
if handler == nil then
Event._registry[event_id] = nil
script.on_event(event_id, nil)
else
if not Event._registry[event_id] then
Event._registry[event_id] = {}
if type(event_id) == "string" or event_id >= 0 then
script.on_event(event_id, Event.dispatch)
elseif event_id < 0 then
Event.core_events._register(event_id)
end
end
table.insert(Event._registry[event_id], handler)
end
end
return Event
end
--- Calls the registerd handlers
-- Will stop dispatching remaning handlers if any handler passes invalid event userdata.
-- Handlers are dispatched in the order they were created
-- @tparam table event LuaEvent as created by script.raise_event
-- @see https://forums.factorio.com/viewtopic.php?t=32039#p202158 Invalid Event Objects
function Event.dispatch(event)
if event then
local _registry = event.name and Event._registry[event.name] or event.input_name and Event._registry[event.input_name]
if _registry then
local force_crc = Event.force_crc
for idx, handler in ipairs(_registry) do
-- Check for userdata and stop processing further handlers if not valid
for _, val in pairs(event) do
if type(val) == "table" and val.__self == "userdata" and not val.valid then
return
end
end
setmetatable(event, { __index = { _handler = handler } })
-- Call the handler
local success, err = pcall(handler, event)
-- If the handler errors lets make sure someone notices
if not success then
if _G.game then -- may be nil in on_load
-- edit by cooldude2606 custom error haddle
--if Game.print_all(err) == 0 then
--error(err) -- no players received the message, force a real error so someone notices
--end
error(err)
else
error(err) -- no way to handle errors cleanly when the game is not up
end
-- continue processing the remaning handlers. In most cases they won't be related to the failed code.
end
-- force a crc check if option is enabled. This is a debug option and will hamper perfomance if enabled
if (force_crc or event.force_crc) and _G.game then
local msg = 'CRC check called for event '..event.name..' handler #'..idx
log(msg) -- log the message to factorio-current.log
game.force_crc()
end
-- if present stop further handlers for this event
if event.stop_processing then
return
end
end
end
else
error('missing event argument')
end
end
--- Removes the handler from the event. If it removes the last handler for an event stop listening for that event.
-- @tparam defines.events|{defines.events,...} event events to remove the handler for
-- @tparam function handler to remove
-- @return Event
function Event.remove(event, handler)
if not _G.Game then error('StdLib/Game not loaded') end
_G.Game.fail_if_missing(event, "missing event argument")
_G.Game.fail_if_missing(handler, "missing handler argument")
event = (type(event) == "table" and event) or {event}
for _, event_id in pairs(event) do
if not (type(event_id) == "number" or type(event_id) == "string") then
error("Invalid Event Id, Must be string or int, or array of strings and/or ints", 2)
end
if Event._registry[event_id] then
for i=#Event._registry[event_id], 1, -1 do
if Event._registry[event_id][i] == handler then
table.remove(Event._registry[event_id], i)
end
end
if #Event._registry[event_id] == 0 then
Event._registry[event_id] = nil
script.on_event(event_id, nil)
end
end
end
return Event
end
return Event

View File

@@ -1,3 +1,5 @@
--- Root Script File
-- @script control.lua
function _log(...) log(...) end
--[[
Explosive Gaming
@@ -8,8 +10,6 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
-- File Which Factorio Will Call
Manager = require("FactorioSoftmodManager")
Manager.setVerbose{
selfInit=true, -- called while the manager is being set up

155
doc/index.html Normal file
View File

@@ -0,0 +1,155 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="modules/expcore.server.html">expcore.server</a></li>
<li><a href="modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="modules/FSM.html">FSM</a></li>
<li><a href="modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="modules/defines.color.html">defines.color</a></li>
<li><a href="modules/Game.html">Game</a></li>
<li><a href="modules/string.html">string</a></li>
<li><a href="modules/table.html">table</a></li>
<li><a href="modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="scripts/control.lua.html">control.lua</a></li>
<li><a href="scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="modules/expcore.guiparts.center.html">expcore.guiparts.center</a></td>
<td class="summary">Adds a new obj to the center gui</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></td>
<td class="summary">Sets the input to trigger on an certain event</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.guiparts.left.html">expcore.guiparts.left</a></td>
<td class="summary">Used to add a left gui frame</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></td>
<td class="summary">Used to add a popup gui style</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</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="modules/expcore.commands.html">expcore.commands</a></td>
<td class="summary">Uses a commands data to return the inputs as a string</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.gui.html">expcore.gui</a></td>
<td class="summary">Add a white bar to any gui frame</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.ranking.html">expcore.ranking</a></td>
<td class="summary">Returns a rank object given a player or rank name</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.server.html">expcore.server</a></td>
<td class="summary">Returns a un-used uuid (better system needed)</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/expcore.sync.html">expcore.sync</a></td>
<td class="summary">Used as a faster way to get to the ranking function, overrides previous</td>
</tr>
<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/modules.expgaminglib.control.html">modules.expgaminglib.control</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="modules/defines.color.html">defines.color</a></td>
<td class="summary">A defines module for retrieving colors by name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/Game.html">Game</a></td>
<td class="summary">The game module.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/string.html">string</a></td>
<td class="summary">Extends Lua 5.2 string.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/table.html">table</a></td>
<td class="summary">Extends Lua 5.2 table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/defines.time.html">defines.time</a></td>
<td class="summary">A defines module for retrieving the number of ticks in 1 unit of time.</td>
</tr>
</table>
<h2>Scripts</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="scripts/control.lua.html">control.lua</a></td>
<td class="summary">Root Script File</td>
</tr>
<tr>
<td class="name" nowrap><a href="scripts/index.lua.html">index.lua</a></td>
<td class="summary">Used to index the files to be loaded</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

303
doc/ldoc.css Normal file
View File

@@ -0,0 +1,303 @@
/* 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; }

210
doc/modules/Event.html Normal file
View File

@@ -0,0 +1,210 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><strong>Event</strong></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Event</code></h1>
<p>Makes working with events in factorio a lot more simple.</p>
<p>
<p>Factorio can only have one handler registered per event. This module
allows you to easily register multiple handlers for each event.
Using this module is as simple as replacing script.on_event(...) with Event.register(...)</p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">require(&apos;stdlib/event/event&apos;)
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#register">register (event, handler)</a></td>
<td class="summary">Registers a function for a given event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#dispatch">dispatch (event)</a></td>
<td class="summary">Calls the registerd handlers
Will stop dispatching remaning handlers if any handler passes invalid event userdata.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#remove">remove (event, handler)</a></td>
<td class="summary">Removes the handler from the event.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "register"></a>
<strong>register (event, handler)</strong>
</dt>
<dd>
Registers a function for a given event. If a nil handler is passed remove all events and stop listening for that event.
Events are dispatched in the order they are registered.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><span class="type">defines.events</span> or <span class="type">{defines.events,...}</span></span>
events to register
</li>
<li><span class="parameter">handler</span>
<span class="types"><span class="type">function</span></span>
Function to call when event is triggered
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Event</span></span>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Event.register(defines.events.on_tick, <span class="keyword">function</span>(event) <span class="global">print</span> event.tick <span class="keyword">end</span>)
<span class="comment">-- creates an event that prints the current tick every tick.</span></pre>
</ul>
</dd>
<dt>
<a name = "dispatch"></a>
<strong>dispatch (event)</strong>
</dt>
<dd>
Calls the registerd handlers
Will stop dispatching remaning handlers if any handler passes invalid event userdata.
Handlers are dispatched in the order they were created
<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>
LuaEvent as created by script.raise_event
</li>
</ul>
<h3>See also:</h3>
<ul>
</ul>
</dd>
<dt>
<a name = "remove"></a>
<strong>remove (event, handler)</strong>
</dt>
<dd>
Removes the handler from the event. If it removes the last handler for an event stop listening for that event.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><span class="type">defines.events</span> or <span class="type">{defines.events,...}</span></span>
events to remove the handler for
</li>
<li><span class="parameter">handler</span>
<span class="types"><span class="type">function</span></span>
to remove
</li>
</ul>
<h3>Returns:</h3>
<ol>
Event
</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-05-29 20:06:55 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

337
doc/modules/FSM.html Normal file
View File

@@ -0,0 +1,337 @@
<!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="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><strong>FSM</strong></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</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;)
Used to load all other modules that are indexed in index.lua
</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>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#setVerbose">setVerbose</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</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</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="#names">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>
<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>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "setVerbose"></a>
<strong>setVerbose</strong>
</dt>
<dd>
Main logic for allowing verbose at different stages though out the script
<ul>
<li><span class="parameter">table</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</strong>
</dt>
<dd>
Creates a sand box envorment and runs a callback in that sand box; provents global pollution
<ul>
<li><span class="parameter">function</span>
<span class="types"><span class="type">callback</span></span>
the function that will be ran in the sandbox
</li>
<li><span class="parameter">any</span>
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</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
<ul>
<li><span class="parameter">string</span>
<span class="types"><span class="type">name</span></span>
|| fucntion the name that is given to the callback || the callback that will be used
</li>
<li><span class="parameter">string</span>
<span class="types"><span class="type">name</span></span>
|| fucntion the name that is given to the callback || the callback that will be used
</li>
<li><span class="parameter">function</span>
<span class="types"><span class="type">callback</span></span>
if name is given as a string this will be the callback used
</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 = "names"></a>
<strong>names</strong>
</dt>
<dd>
Sub set to Manger.event and acts as a coverter between event_name and event_id
<ul>
<li><span class="parameter">names</span>
</li>
</ul>
<h3>See also:</h3>
<ul>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Manager.event[event_name] <span class="comment">-- see above, can not be accessed via Manager.event.names</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

231
doc/modules/Game.html Normal file
View File

@@ -0,0 +1,231 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><strong>Game</strong></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Game</code></h1>
<p>The game module.</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">local Game = require(&apos;stdlib/game&apos;)
</pre>
</ul>
<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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,519 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><strong>defines.color</strong></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>defines.color</code></h1>
<p>A defines module for retrieving colors by name.</p>
<p>
Extends the Factorio defines table.</p>
<h3>Usage:</h3>
<ul>
<pre class="example">require(&apos;stdlib/defines/color&apos;)
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Color.set">Color.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="#Color.to_table">Color.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="#Color.from_rgb">Color.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="#Color.from_hex">Color.from_hex (hex[, alpha=1])</a></td>
<td class="summary">Get a color table with a hexadecimal string.</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>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Color.set"></a>
<strong>Color.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/defines.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">Concepts.Color</span></span>
a color table that has the specified value for the alpha channel
</ol>
</dd>
<dt>
<a name = "Color.to_table"></a>
<strong>Color.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">Concepts.Color</span></span>
a converted color &mdash; { r = c\_arr[1], g = c\_arr[2], b = c\_arr[3], a = c\_arr[4] }
</ol>
</dd>
<dt>
<a name = "Color.from_rgb"></a>
<strong>Color.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 = "Color.from_hex"></a>
<strong>Color.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">Concepts.Color</span></span>
a color table with RGB converted from Hex and with alpha
</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>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">black</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">darkgrey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">grey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">lightgrey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">red</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">darkred</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">lightred</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">green</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">darkgreen</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">lightgreen</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">blue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">darkblue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">lightblue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">orange</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">yellow</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">pink</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">purple</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
<li><span class="parameter">brown</span>
<span class="types"><span class="type">Concepts.Color</span></span>
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">color = defines.color.red</pre>
</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>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">grey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">lightblue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">lightgreen</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">lightgrey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">lightred</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">orange</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">white</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">yellow</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.black
</li>
<li><span class="parameter">black</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">blue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">brown</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">darkblue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">darkgreen</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">darkgrey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">darkred</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">pink</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">purple</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.white
</li>
<li><span class="parameter">red</span>
<span class="types"><span class="type">Concepts.Color</span></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>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.lightgrey
</li>
<li><span class="parameter">grey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.darkgrey
</li>
<li><span class="parameter">lightgrey</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.grey
</li>
<li><span class="parameter">red</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.lightred
</li>
<li><span class="parameter">green</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.lightgreen
</li>
<li><span class="parameter">blue</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.lightblue
</li>
<li><span class="parameter">yellow</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.orange
</li>
<li><span class="parameter">pink</span>
<span class="types"><span class="type">Concepts.Color</span></span>
defines.color.purple
</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,148 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><strong>defines.time</strong></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>defines.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>
<h3>Usage:</h3>
<ul>
<pre class="example">require(&apos;stdlib/defines/time&apos;)
</pre>
</ul>
<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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,136 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><strong>expcore.commands</strong></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.commands</code></h1>
<p>Uses a commands data to return the inputs as a string</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">command = command_data[command_name]
command_inputs(command) -- returns &quot;&lt;input1&gt; &lt;input2&gt; &quot;
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<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>
the player refreced by string|number|LuaPlayer|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>
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 {{command data},{command data}}</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,172 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><strong>expcore.gui</strong></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.gui</code></h1>
<p>Add a white bar to any gui frame</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.bar(frame,100)
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Gui.set_dropdown_index">Gui.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="#Gui.cam_link">Gui.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>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Gui.set_dropdown_index"></a>
<strong>Gui.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)</pre>
</ul>
</dd>
<dt>
<a name = "Gui.cam_link"></a>
<strong>Gui.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>
</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,290 @@
<!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><strong>expcore.guiparts.center</strong></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.guiparts.center</code></h1>
<p>Adds a new obj to the center gui</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.center.add{name=&apos;foo&apos;,caption=&apos;Foo&apos;,tooltip=&apos;Testing&apos;,draw=function}
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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 = "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">boelon</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">boelon</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,446 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><strong>expcore.guiparts.inputs</strong></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.guiparts.inputs</code></h1>
<p>Sets the input to trigger on an certain event</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">button:on_event(defines.events.on_gui_click,player_return)
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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 = "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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,193 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><strong>expcore.guiparts.left</strong></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.guiparts.left</code></h1>
<p>Used to add a left gui frame</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.add{name=&apos;foo&apos;,caption=&apos;Foo&apos;,tooltip=&apos;just testing&apos;,open_on_join=true,can_open=function,draw=function}
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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 conected 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 = "update"></a>
<strong>update ([frame[, players]])</strong>
</dt>
<dd>
This is used to update all the guis of conected 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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,138 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><strong>expcore.guiparts.popup</strong></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.guiparts.popup</code></h1>
<p>Used to add a popup gui style</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Gui.left.add{name=&apos;foo&apos;,caption=&apos;Foo&apos;,draw=function}
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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 = "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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,129 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><strong>expcore.guiparts.toolbar</strong></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.guiparts.toolbar</code></h1>
<p>Add a button to the toolbar, ranks need to be allowed to use these buttons if ranks is preset</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">toolbar.add(&apos;foo&apos;,&apos;Foo&apos;,&apos;Test&apos;,function() game.print(&apos;test&apos;) end)
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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 = "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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,386 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><strong>expcore.ranking</strong></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.ranking</code></h1>
<p>Returns a rank object given a player or rank name</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Ranking.get_rank(game.player)
Ranking.get_rank(&apos;admin&apos;)
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Ranking.get_group">Ranking.get_group (mixed)</a></td>
<td class="summary">Returns the group object used to sort ranks given group name or see Ranking.get_rank</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Ranking.print">Ranking.print (rank_base, rtn, colour, below)</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="#Ranking.give_rank">Ranking.give_rank (player, rank[, 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="#Ranking.revert">Ranking.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="#Ranking.find_preset">Ranking.find_preset (player[, tick=nil])</a></td>
<td class="summary">Given the player has a rank in the preset table it is given</td>
</tr>
<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)</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, show_default)</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 = "Ranking.get_group"></a>
<strong>Ranking.get_group (mixed)</strong>
</dt>
<dd>
Returns the group object used to sort ranks given group name or see Ranking.get_rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mixed</span>
player|player index|player name|rank name|rank|'server'|'root'|group name|group 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>Usage:</h3>
<ul>
<pre class="example">Ranking.get_group(game.player)
Ranking.get_group(<span class="string">'root'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "Ranking.print"></a>
<strong>Ranking.print (rank_base, rtn, colour, below)</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>
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
</li>
<li><span class="parameter">below</span>
<span class="types"><span class="type">bolean</span></span>
if true rank below base are printed to
</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 = "Ranking.give_rank"></a>
<strong>Ranking.give_rank (player, rank[, by_player='server'[, tick=game.tick]])</strong>
</dt>
<dd>
Gives a user a rank
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
the player to give the rank to
</li>
<li><span class="parameter">rank</span>
the rank to give to the player
</li>
<li><span class="parameter">by_player</span>
the player who is giving the rank
(<em>default</em> 'server')
</li>
<li><span class="parameter">tick</span>
the tick that the rank is being given on
(<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 = "Ranking.revert"></a>
<strong>Ranking.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>
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>)</pre>
</ul>
</dd>
<dt>
<a name = "Ranking.find_preset"></a>
<strong>Ranking.find_preset (player[, tick=nil])</strong>
</dt>
<dd>
Given the player has a rank in the preset table it is given
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</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>)</pre>
</ul>
</dd>
<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">bolean</span></span>
is it allowed
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:allowed(<span class="string">'server-interface'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "Ranking._rank:get_players"></a>
<strong>Ranking._rank:get_players (online)</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">bolean</span></span>
get only 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>
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, show_default)</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
</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
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">rank:<span class="global">print</span>(<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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,571 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><strong>expcore.server</strong></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.server</code></h1>
<p>Returns a un-used uuid (better system needed)</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">obj.uuid = Server.new_uuid()
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Server.threads">Server.threads ([count=nil])</a></td>
<td class="summary">Returns either the number of threads or a able of threads</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server.get_thread">Server.get_thread (mixed)</a></td>
<td class="summary">Used to get a thread via it's uuid or by name if one is given</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server.queue_thread">Server.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="#Server.close_all_threads">Server.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="#Server.run_tick_threads">Server.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="#Server.check_timeouts">Server.check_timeouts ()</a></td>
<td class="summary">Checks the timeout on all active timeout threads</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread_handler">Server._thread_handler (event)</a></td>
<td class="summary">Calles all threads on a certain game event (used with script.on_event)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server.interface">Server.interface (callback[, use_thread[, ...]])</a></td>
<td class="summary">Given a string or function it will run that function and return any values</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:valid">Server._thread:valid (skip_location_check)</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 by storing it in a place the server object can find it</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Server._thread:close">Server._thread:close ()</a></td>
<td class="summary">Inverse of thread:open() - it removes the thread and calles on_close</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 timedout 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">Rasies an error on this thread</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 called on a thread, none of them are 'needed' but you are advised to have atleast one</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Server.threads"></a>
<strong>Server.threads ([count=nil])</strong>
</dt>
<dd>
Returns either the number of threads or a able of threads
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">count</span>
<span class="types"><span class="type">bolean</span></span>
true to return the number of threads
(<em>default</em> nil)
</li>
</ul>
<h3>Returns:</h3>
<ol>
either a list of threads or a number
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Server.threads() <span class="comment">-- return {...}
</span> Server.threads(<span class="keyword">true</span>) <span class="comment">-- return int</span></pre>
</ul>
</dd>
<dt>
<a name = "Server.get_thread"></a>
<strong>Server.get_thread (mixed)</strong>
</dt>
<dd>
Used to get a thread via it's uuid or by name if one is given
<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"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the thread by that name or uuid
</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 = "Server.queue_thread"></a>
<strong>Server.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"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
the thread to add to the queue must have a resolve function (must be open)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
was the thread added
</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 = "Server.close_all_threads"></a>
<strong>Server.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>
<pre class="example">Server.close_all_threads()
Server.close_all_threads(<span class="keyword">true</span>) <span class="comment">-- use if no force makes errors</span></pre>
</ul>
</dd>
<dt>
<a name = "Server.run_tick_threads"></a>
<strong>Server.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 = "Server.check_timeouts"></a>
<strong>Server.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 = "Server._thread_handler"></a>
<strong>Server._thread_handler (event)</strong>
</dt>
<dd>
Calles all threads on a certain game event (used with script.on_event)
<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>
the event that is called
</li>
</ul>
</dd>
<dt>
<a name = "Server.interface"></a>
<strong>Server.interface (callback[, use_thread[, ...]])</strong>
</dt>
<dd>
Given a string or function it will run that function and return any values
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
either a function or string which will be ran via pcall
</li>
<li><span class="parameter">use_thread</span>
give a thread for the interface to run on (does not need to be open, but cant use on_resolve)
(<em>optional</em>)
</li>
<li><span class="parameter">...</span>
any args you want to pass to the function
(<em>optional</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Server.interface(<span class="string">'local x = 1+1 print(x) return x'</span>) <span class="comment">-- return 2
</span> Server.interface(<span class="string">'local x = 1+1 print(x)'</span>,thread) <span class="comment">-- no return</span></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:valid"></a>
<strong>Server._thread:valid (skip_location_check)</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 check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</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></pre>
</ul>
</dd>
<dt>
<a name = "Server._thread:open"></a>
<strong>Server._thread:open ()</strong>
</dt>
<dd>
Opens the thread by storing it in a place the server object can find it
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
if the thread was opened
</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() - it removes the thread and calles on_close
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</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 timedout then it calles on_timeout and closes
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
if the thread timedout
</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>
Rasies an error on this thread
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">err</span>
the err to be rasied
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bolean</span></span>
did the thread handdle the error
</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 called on a thread, 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></span>
the name of the event that it is called on
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
the function which is called 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 that there can be chained
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">thread:on_event(<span class="string">'close'</span>,<span class="keyword">function</span>) <span class="comment">-- return true
</span>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>]
<span class="keyword">if</span> event is a number <span class="keyword">then</span> it is asumed to be a game event</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,542 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><strong>expcore.sync</strong></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.sync</code></h1>
<p>Used as a faster way to get to the ranking function, overrides previous</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.set_ranks{name=rank_name}
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Sync.tick_format">Sync.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="#Sync.print">Sync.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="#Sync.emit_embeded">Sync.emit_embeded (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="#Sync.count_admins">Sync.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="#Sync.count_afk">Sync.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="#Sync.count_ranks">Sync.count_ranks ()</a></td>
<td class="summary">used to get the number of players in each rank and currently online</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.count_players">Sync.count_players (online)</a></td>
<td class="summary">used to get the number of players either online or all</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.count_player_times">Sync.count_player_times ()</a></td>
<td class="summary">used to get the number of players resulting in there play times</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.info">Sync.info ([set=nil])</a></td>
<td class="summary">used to return the global list and set values in it</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.time">Sync.time ([set=nil])</a></td>
<td class="summary">used to return the global time and set its value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.update">Sync.update ()</a></td>
<td class="summary">called to update values inside of the info</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.add_update">Sync.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="#Sync.emit_data">Sync.emit_data ()</a></td>
<td class="summary">outputs the curent server info into a file</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Sync.add_to_gui">Sync.add_to_gui (element)</a></td>
<td class="summary">Adds a emeltent to the sever info gui</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Sync.tick_format"></a>
<strong>Sync.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>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 = "Sync.print"></a>
<strong>Sync.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>
the message to be printed in chat
</li>
<li><span class="parameter">player_name</span>
the name of the player sending the message
</li>
<li><span class="parameter">player_tag</span>
the tag apllied to the player's name
(<em>optional</em>)
</li>
<li><span class="parameter">player_colour</span>
the colour of the message
(<em>optional</em>)
</li>
<li><span class="parameter">prefix</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 = "Sync.emit_embeded"></a>
<strong>Sync.emit_embeded (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 embeded will use
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.emit_embeded{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 = "Sync.count_admins"></a>
<strong>Sync.count_admins ()</strong>
</dt>
<dd>
used to get the number of admins currently online
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
the number of admins online
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_admins()</pre>
</ul>
</dd>
<dt>
<a name = "Sync.count_afk"></a>
<strong>Sync.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">int</span></span>
the number of afk players
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_afk()</pre>
</ul>
</dd>
<dt>
<a name = "Sync.count_ranks"></a>
<strong>Sync.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>
<dt>
<a name = "Sync.count_players"></a>
<strong>Sync.count_players (online)</strong>
</dt>
<dd>
used to get the number of players either online or all
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">online</span>
<span class="types"><span class="type">bolean</span></span>
if true only get 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>
contains player names
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_players()</pre>
</ul>
</dd>
<dt>
<a name = "Sync.count_player_times"></a>
<strong>Sync.count_player_times ()</strong>
</dt>
<dd>
used to get the number of players resulting in there play times
<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 players and each player is given a tick amount and a formated string
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.count_player_times()</pre>
</ul>
</dd>
<dt>
<a name = "Sync.info"></a>
<strong>Sync.info ([set=nil])</strong>
</dt>
<dd>
used to return the global list and set values in it
<h3>Parameters:</h3>
<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>Returns:</h3>
<ol>
either returns success when setting or the info when not setting
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.info{server_name=<span class="string">'Factorio Server 2'</span>}</pre>
</ul>
</dd>
<dt>
<a name = "Sync.time"></a>
<strong>Sync.time ([set=nil])</strong>
</dt>
<dd>
used to return the global time and set its value
<h3>Parameters:</h3>
<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>Returns:</h3>
<ol>
either true false if setting or the date time and tick off set
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">Sync.time(<span class="string">'Sun Apr 1 18:44:30 UTC 2018'</span>)</pre>
</ul>
</dd>
<dt>
<a name = "Sync.update"></a>
<strong>Sync.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 = "Sync.add_update"></a>
<strong>Sync.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 = "Sync.emit_data"></a>
<strong>Sync.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>
<dt>
<a name = "Sync.add_to_gui"></a>
<strong>Sync.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 trues</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,350 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><strong>modules.expgaminglib.control</strong></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>modules.expgaminglib.control</code></h1>
<p>Loads a table into _G even when sandboxed; will not overwrite values or append to tables; will not work during runtime to avoid desyncs</p>
<p></p>
<h3>Usage:</h3>
<ul>
<pre class="example">unpack_to_G{key1=&apos;foo&apos;,key2=&apos;bar&apos;}
</pre>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#ExpLib.get_env">ExpLib.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="#ExpLib.is_type">ExpLib.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="#ExpLib.player_return">ExpLib.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="#ExpLib.tick_to_hour">ExpLib.tick_to_hour (tick)</a></td>
<td class="summary">Convert ticks to hours</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ExpLib.tick_to_min">ExpLib.tick_to_min (tick)</a></td>
<td class="summary">Convert ticks to minutes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ExpLib.tick_to_display_format">ExpLib.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="#ExpLib.gui_tree">ExpLib.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>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "ExpLib.get_env"></a>
<strong>ExpLib.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="https://www.lua.org/manual/5.2/manual.html#6.5">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 = "ExpLib.is_type"></a>
<strong>ExpLib.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 = "ExpLib.player_return"></a>
<strong>ExpLib.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 = "ExpLib.tick_to_hour"></a>
<strong>ExpLib.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 = "ExpLib.tick_to_min"></a>
<strong>ExpLib.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 = "ExpLib.tick_to_display_format"></a>
<strong>ExpLib.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 = "ExpLib.gui_tree"></a>
<strong>ExpLib.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="https://www.lua.org/manual/5.2/manual.html#6.5">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>
</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

310
doc/modules/string.html Normal file
View File

@@ -0,0 +1,310 @@
<!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/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><strong>string</strong></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>string</code></h1>
<p>Extends Lua 5.2 string.</p>
<p></p>
<h3>See also:</h3>
<ul>
<a href="../modules/string.html#">string</a>
</ul>
<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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

1145
doc/modules/table.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,85 @@
<!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>Scripts</h2>
<ul class="nowrap">
<li><strong>control.lua</strong></li>
<li><a href="../scripts/index.lua.html">index.lua</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
</div>
<div id="content">
<h1>Script <code>control.lua</code></h1>
<p>Root Script File</p>
<p></p>
<br/>
<br/>
</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -0,0 +1,85 @@
<!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>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/control.lua.html">control.lua</a></li>
<li><strong>index.lua</strong></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
<li><a href="../modules/FSM.html">FSM</a></li>
<li><a href="../modules/modules.expgaminglib.control.html">modules.expgaminglib.control</a></li>
<li><a href="../modules/defines.color.html">defines.color</a></li>
<li><a href="../modules/Game.html">Game</a></li>
<li><a href="../modules/string.html">string</a></li>
<li><a href="../modules/table.html">table</a></li>
<li><a href="../modules/defines.time.html">defines.time</a></li>
</ul>
</div>
<div id="content">
<h1>Script <code>index.lua</code></h1>
<p>Used to index the files to be loaded</p>
<p></p>
<br/>
<br/>
</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-05-29 20:15:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@@ -7,12 +7,16 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
--- Adds some common functions used though out all ExpGaming modules
-- @module ExpGamingLib
-- @alias ExpLib
-- @author Cooldude2606
local module_verbose = false -- there is no verbose in this file so true will do nothing
local ExpLib = {}
--- Loads a table into _G even when sandboxed; will not overwrite values or append to tables; will not work during runtime to avoid desyncs
-- @usage unpack_to_G{key1='foo',key2='bar'}
-- @tparam table tbl -- table to be unpacked
-- @tparam table tbl table to be unpacked
function ExpLib.unpack_to_G(tbl)
if not type(tbl) == 'table' or game then return end
for key,value in pairs(tbl) do
@@ -21,8 +25,8 @@ function ExpLib.unpack_to_G(tbl)
end
--- Used to get the current ENV with all _G keys removed; useful when saving function to global
-- @usage get_env() -- returns current ENV with _G keys removed
-- @treturn table -- the env table with _G keys removed
-- @usage get_env() returns current ENV with _G keys removed
-- @treturn table the env table with _G keys removed
function ExpLib.get_env()
local level = 2
local env = setmetatable({},{__index=_G})
@@ -43,9 +47,9 @@ end
--- Compear types faster for faster valadation of prams
-- @usage is_type('foo','string') -- return true
-- @usage is_type('foo') -- return false
-- @param v -- the value to be tested
-- @tparam[opt=nil] string test_type -- the type to test for if not given then it tests for nil
-- @treturn bolean -- is v of type test_type
-- @param v the value to be tested
-- @tparam[opt=nil] string test_type the type to test for if not given then it tests for nil
-- @treturn bolean is v of type test_type
function ExpLib.is_type(v,test_type)
return test_type and v and type(v) == test_type or not test_type and not v or false
end
@@ -54,9 +58,9 @@ end
-- @usage player_return('Hello, World!') -- returns 'Hello, World!' to game.player or server console
-- @usage player_return('Hello, World!','green') -- returns 'Hello, World!' to game.player with colour green or server console
-- @usage player_return('Hello, World!',nil,player) -- returns 'Hello, World!' to the given player
-- @param rtn -- any value of any type that will be returned to the player or console
-- @tparam[opt=defines.colour.white] defines.color || string colour -- the colour of the text for the player, ingroned when printing to console
-- @tparam[opt=game.player] LuaPlayer player -- the player that return will go to, if no game.player then returns to server
-- @param rtn any value of any type that will be returned to the player or console
-- @tparam[opt=defines.colour.white] ?defines.color|string colour the colour of the text for the player, ingroned when printing to console
-- @tparam[opt=game.player] LuaPlayer player the player that return will go to, if no game.player then returns to server
function ExpLib.player_return(rtn,colour,player)
local colour = ExpLib.is_type(colour) == 'table' and colour or defines.color[colour]
local player = player or game.player
@@ -84,8 +88,8 @@ end
--- Convert ticks to hours
-- @usage tick_to_hour(216001) -- return 1
-- @tparam number tick -- tick to convert to hours
-- @treturn number -- the number of whole hours from this tick
-- @tparam number tick tick to convert to hours
-- @treturn number the number of whole hours from this tick
function ExpLib.tick_to_hour(tick)
if not ExpLib.is_type(tick,'number') then return 0 end
return math.floor(tick/(216000*game.speed))
@@ -93,8 +97,8 @@ end
--- Convert ticks to minutes
-- @usage tick_to_hour(3601) -- return 1
-- @tparam number tick -- tick to convert to minutes
-- @treturn number -- the number of whole minutes from this tick
-- @tparam number tick tick to convert to minutes
-- @treturn number the number of whole minutes from this tick
function ExpLib.tick_to_min (tick)
if not ExpLib.is_type(tick,'number') then return 0 end
return math.floor(tick/(3600*game.speed))
@@ -103,8 +107,8 @@ end
--- Converts a tick into a clean format for end user
-- @usage tick_to_display_format(3600) -- return '1.00 M'
-- @usage tick_to_display_format(234000) -- return '1 H 5 M'
-- @tparam number tick -- the tick to convert
-- @treturn string -- the formated string
-- @tparam number tick the tick to convert
-- @treturn string the formated string
function ExpLib.tick_to_display_format(tick)
if not ExpLib.is_type(tick,'number') then return '0H 0M' end
if ExpLib.tick_to_min(tick) < 10 then
@@ -118,9 +122,9 @@ function ExpLib.tick_to_display_format(tick)
end
--- Used as a way to view the structure of a gui, used for debuging
-- @usage Gui_tree(root) -- returns all children of gui recusivly
-- @tparam LuaGuiElement root -- the root to start the tree from
-- @treturn table -- the table that describes the gui
-- @usage Gui_tree(root) returns all children of gui recusivly
-- @tparam LuaGuiElement root the root to start the tree from
-- @treturn table the table that describes the gui
function ExpLib.gui_tree(root)
if not ExpLib.is_type(root,'table') or not root.valid then error('Invalid Gui Element given to gui_tree',2) end
local tree = {}

View File

@@ -2,7 +2,6 @@
-- Extends the Factorio defines table.
-- @usage require('stdlib/defines/color')
-- @module defines.color
-- @see Concepts.Color
-- defines table is automatically required in all mod loading stages.
-- luacheck: ignore 122/defines
@@ -210,10 +209,6 @@ setmetatable(defines.anticolor, _mt.anticolor)
setmetatable(defines.text_color, _mt.text_color)
setmetatable(defines.lightcolor, _mt.lightcolor)
--- For playing with colors.
-- @module Color
-- @usage local Color = require('stdlib/color/color')
local Color = {} --luacheck: allow defined top
--- Set a value for the alpha channel in the given color table.
@@ -234,7 +229,7 @@ function Color.set(color, alpha)
end
--- Converts a color in the array format to a color in the table format.
-- @tparam array c_arr the color to convert &mdash; { [1] = @{float}, [2] = @{float}, [3] = @{float}, [4] = @{float} }
-- @tparam table c_arr the color to convert
-- @treturn Concepts.Color a converted color &mdash; { r = c\_arr[1], g = c\_arr[2], b = c\_arr[3], a = c\_arr[4] }
function Color.to_table(c_arr)
if #c_arr > 0 then

View File

@@ -0,0 +1,14 @@
{
"name": "FactorioStdLib",
"module": "StdLib",
"description": "Factorio Standard Library Projects",
"keywords": ["Standard Library","Lib","StdLib"],
"version": "0.8.0",
"location": "nil",
"submodules": {
},
"author": "Afforess",
"contact": "https://github.com/Afforess/Factorio-Stdlib/issues",
"license": "https://github.com/Afforess/Factorio-Stdlib/blob/master/LICENSE"
}

View File

@@ -498,7 +498,7 @@ end
--- Returns the list is a sorted way that would be expected by people (this is by key)
-- @usage tbl = table.alphanumsort(tbl)
-- @tparam tbl table the table to be sorted
-- @tparam table tbl the table to be sorted
-- @treturn table the sorted table
function table.alphanumsort(tbl)
local o = table.keys(tbl)
@@ -514,7 +514,7 @@ end
--- Returns the list is a sorted way that would be expected by people (this is by key) (faster alterative than above)
-- @usage tbl = table.alphanumsort(tbl)
-- @tparam tbl table the table to be sorted
-- @tparam table tbl the table to be sorted
-- @treturn table the sorted table
function table.keysort(tbl)
local o = table.keys(tbl,true)

View File

@@ -1,3 +1,5 @@
--- Used to index the files to be loaded
-- @script index.lua
return {
['ExpLib']='/modules/ExpGamingLib/control',
}