From fec4f0c184cf7d463152e7839b5a9923572c6199 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Fri, 21 Jun 2019 22:00:15 +0100 Subject: [PATCH 01/93] Moved reports to control --- config/action_buttons.lua | 6 +- doc/config.ld | 88 + doc/index.html | 704 ++-- doc/ldoc.css | 509 ++- doc/ldoc.ltp | 402 +++ doc/modules/Reports.html | 935 +++++ doc/modules/addons.advanced-start.html | 71 + doc/modules/addons.chat-popups.html | 72 + doc/modules/addons.damage-popups.html | 72 + doc/modules/config._file_loader.html | 258 +- doc/modules/config.action_buttons.html | 260 +- doc/modules/config.advanced_start.html | 258 +- doc/modules/config.bonuses.html | 176 + doc/modules/config.chat_reply.html | 176 + doc/modules/config.death_logger.html | 258 +- doc/modules/config.discord_alerts.html | 176 + .../config.expcore-commands.auth_admin.html | 258 +- .../config.expcore-commands.auth_roles.html | 258 +- ...expcore-commands.auth_runtime_disable.html | 258 +- ...config.expcore-commands.parse_general.html | 258 +- .../config.expcore-commands.parse_roles.html | 258 +- doc/modules/config.permission_groups.html | 258 +- doc/modules/config.popup_messages.html | 258 +- doc/modules/config.rockets.html | 354 +- doc/modules/config.roles.html | 258 +- doc/modules/config.scorched_earth.html | 258 +- doc/modules/config.spawn_area.html | 258 +- doc/modules/config.warnings.html | 258 +- doc/modules/config.warps.html | 176 + doc/modules/control.html | 258 +- doc/modules/control.reports.html | 341 ++ doc/modules/expcore.commands.html | 277 +- doc/modules/expcore.common.html | 2707 ++++++++++---- doc/modules/expcore.gui.concepts.center.html | 913 +++++ doc/modules/expcore.gui.concepts.left.html | 1179 +++++++ doc/modules/expcore.gui.concepts.popups.html | 658 ++++ doc/modules/expcore.gui.concepts.toolbar.html | 366 ++ doc/modules/expcore.gui.core.html | 258 +- doc/modules/expcore.gui.elements.buttons.html | 509 +++ .../expcore.gui.elements.checkboxs.html | 827 +++++ .../expcore.gui.elements.dropdown.html | 689 ++++ .../expcore.gui.elements.elem-button.html | 384 ++ .../expcore.gui.elements.progress-bar.html | 1130 ++++++ doc/modules/expcore.gui.elements.slider.html | 460 +++ doc/modules/expcore.gui.elements.text.html | 506 +++ doc/modules/expcore.gui.html | 258 +- doc/modules/expcore.gui.instances.html | 258 +- doc/modules/expcore.gui.prototype.html | 1399 ++++++++ doc/modules/expcore.gui.test.html | 258 +- doc/modules/expcore.permission_groups.html | 1550 +++++--- doc/modules/expcore.roles.html | 3131 ++++++++++++----- doc/modules/expcore.store.html | 1021 ++++-- doc/modules/expcore.sudo.html | 177 + doc/modules/gui.player-list.html | 71 + doc/modules/gui.rocket-info.html | 100 + doc/modules/gui.science-info.html | 71 + doc/modules/gui.task-list.html | 71 + .../modules.addons.advanced-start.html | 258 +- doc/modules/modules.addons.chat-popups.html | 258 +- doc/modules/modules.addons.damage-popups.html | 258 +- doc/modules/modules.gui.player-list.html | 258 +- doc/modules/modules.gui.rocket-info.html | 308 +- doc/modules/modules.gui.science-info.html | 258 +- doc/modules/modules.gui.task-list.html | 258 +- .../utils.alien_evolution_progress.html | 385 +- doc/modules/utils.core.html | 1297 ++++--- doc/modules/utils.debug.html | 763 ++-- doc/modules/utils.event.html | 1358 ++++--- doc/modules/utils.event_core.html | 489 ++- doc/modules/utils.math.html | 402 ++- doc/modules/utils.recipe_locker.html | 379 +- doc/modules/utils.state_machine.html | 752 ++-- doc/modules/utils.table.html | 1464 ++++++-- doc/modules/utils.task.html | 490 ++- doc/modules/utils.timestamp.html | 468 ++- doc/spectre-icons.min.css | 568 +++ doc/spectre.min.css | 2778 +++++++++++++++ doc/topics/license.html | 729 ++++ doc/topics/readme.md.html | 269 ++ modules/addons/discord-alerts.lua | 8 +- modules/addons/reports-control.lua | 141 - modules/commands/reports.lua | 14 +- modules/control/reports.lua | 212 ++ 83 files changed, 33670 insertions(+), 8768 deletions(-) create mode 100644 doc/config.ld create mode 100644 doc/ldoc.ltp create mode 100644 doc/modules/Reports.html create mode 100644 doc/modules/addons.advanced-start.html create mode 100644 doc/modules/addons.chat-popups.html create mode 100644 doc/modules/addons.damage-popups.html create mode 100644 doc/modules/config.bonuses.html create mode 100644 doc/modules/config.chat_reply.html create mode 100644 doc/modules/config.discord_alerts.html create mode 100644 doc/modules/config.warps.html create mode 100644 doc/modules/control.reports.html create mode 100644 doc/modules/expcore.gui.concepts.center.html create mode 100644 doc/modules/expcore.gui.concepts.left.html create mode 100644 doc/modules/expcore.gui.concepts.popups.html create mode 100644 doc/modules/expcore.gui.concepts.toolbar.html create mode 100644 doc/modules/expcore.gui.elements.buttons.html create mode 100644 doc/modules/expcore.gui.elements.checkboxs.html create mode 100644 doc/modules/expcore.gui.elements.dropdown.html create mode 100644 doc/modules/expcore.gui.elements.elem-button.html create mode 100644 doc/modules/expcore.gui.elements.progress-bar.html create mode 100644 doc/modules/expcore.gui.elements.slider.html create mode 100644 doc/modules/expcore.gui.elements.text.html create mode 100644 doc/modules/expcore.gui.prototype.html create mode 100644 doc/modules/expcore.sudo.html create mode 100644 doc/modules/gui.player-list.html create mode 100644 doc/modules/gui.rocket-info.html create mode 100644 doc/modules/gui.science-info.html create mode 100644 doc/modules/gui.task-list.html create mode 100644 doc/spectre-icons.min.css create mode 100644 doc/spectre.min.css create mode 100644 doc/topics/license.html create mode 100644 doc/topics/readme.md.html delete mode 100644 modules/addons/reports-control.lua create mode 100644 modules/control/reports.lua diff --git a/config/action_buttons.lua b/config/action_buttons.lua index d1f6846d..9bf8de57 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -7,7 +7,7 @@ local Gui = require 'expcore.gui' local Roles = require 'expcore.roles' local Store = require 'expcore.store' local Game = require 'utils.game' -local Reports = require 'modules.addons.reports-control' +local Reports = require 'modules.control.reports' local Warnings = require 'modules.addons.warnings-control' local Jail = require 'modules.addons.jail-control' local Colors = require 'resources.color_presets' @@ -106,7 +106,7 @@ Gui.new_button() :set_style('tool_button',tool_button_style) :on_click(function(player,element) local action_player_name = get_action_player_name(player) - if Reports.player_is_reported_by(action_player_name,player.name) then + if Reports.is_reported(action_player_name,player.name) then player.print({'expcom-report.already-reported'},Colors.orange_red) else Store.set(action_name_store,player.name,'command/report') @@ -118,7 +118,7 @@ local function report_player_callback(player,reason) local by_player_name_color = format_chat_player_name(player) game.print{'expcom-report.non-admin',action_player_name_color,reason} Roles.print_to_roles_higher('Trainee',{'expcom-report.admin',action_player_name_color,by_player_name_color,reason}) - Reports.report_player(action_player_name,reason,player.name) + Reports.report_player(action_player_name,player.name,reason) end -- gives the action player a warning, requires a reason diff --git a/doc/config.ld b/doc/config.ld new file mode 100644 index 00000000..fdaec597 --- /dev/null +++ b/doc/config.ld @@ -0,0 +1,88 @@ +file = '../' +dir = '../doc' +project = 'ExpGaming Scenario' +title = 'ExpGaming Scenario' +description = 'Explosive Gaming\'s server scenario for 0.17' + +convert_opt = true +sort = true +not_luadoc = true +no_lua_ref = true +template_escape = ">" +topics = {"../README.md", "../LICENSE"} +style = '../doc' +template = '../doc' + +new_type("event", "Events", false, "Event Parameters") + +local api_url = "http://lua-api.factorio.com/latest/%s.html%s" + +custom_see_handler("^Lua([%w_]*)%.?([%.?[%w_]*]*)$", + function(name, section) + local link_txt = "Lua" .. name .. (#section > 0 and "." .. section or "") + local link_url = api_url:format("Lua" .. name, #section > 0 and "#" .. link_txt or "") + return link_txt, link_url + end +) + +custom_see_handler("^Concepts%.([%.?[%w_]*]*)$", + function(section) + local link_txt = "Concepts." .. section + local link_url = api_url:format("Concepts", #section > 0 and "#" .. section or "") + return link_txt, link_url + end +) + +custom_see_handler("^defines%.?([%.?[%w_]*]*)$", + function(section) + local link_txt = "defines." .. section + local link_url + if section == "color" or section == "time" then + link_url = "../modules/"..link_txt..".html" + else + link_url = api_url:format("defines", #section > 0 and "#" .. link_txt or "") + end + return link_txt, link_url + end +) + +custom_see_handler("^Common%.([%.?[%w_]*]*)$", + function(section) + local link_txt = "Common." .. section + local link_url = api_url:format("Common", #section > 0 and "#" .. link_txt or "") + return link_txt, link_url + end +) + +local wikipat = "https://en.wikipedia.org/wiki/%s" +custom_see_handler("^wiki (.+)", + function(name) + local url = wikipat:format(name) + return name, url + end +) + +-- https://forums.factorio.com/viewtopic.php?t=32039#p202158 +custom_see_handler("^(http[s]?%:%/%/.-) (.+)$", + function(url, name) + return name, url + end +) + +local lua_url = "https://www.lua.org/pil/%s.html%s" + +custom_see_handler("^boolean$", function() return "boolean", api_url:format("Builtin-Types", "#boolean") end) +custom_see_handler("^int$", function() return "int", api_url:format("Builtin-Types", "#int") end) +custom_see_handler("^uint$", function() return "uint", api_url:format("Builtin-Types", "#uint") end) +custom_see_handler("^uint8$", function() return "uint8", api_url:format("Builtin-Types", "#uint8") end) +custom_see_handler("^uint64$", function() return "uint64", api_url:format("Builtin-Types", "#uint64") end) +custom_see_handler("^string$", function() return "string", api_url:format("Builtin-Types", "#string") end) +custom_see_handler("^float$", function() return "float", api_url:format("Builtin-Types", "#float") end) +custom_see_handler("^double$", function() return "double", api_url:format("Builtin-Types", "#double") end) +custom_see_handler("^nil$", function() return "nil", lua_url:format("2.1", "") end) +custom_see_handler("^number$", function() return "number", lua_url:format("2.3", "") end) +custom_see_handler("^table$", function() return "table", lua_url:format("2.5", "") end) +custom_see_handler("^function$", function() return "function", lua_url:format("2.6", "") end) +custom_see_handler("^userdata$", function() return "userdata", lua_url:format("2.7", "") end) +custom_see_handler("^thread$", function() return "thread", lua_url:format("9", "#CoroutineSec") end) +custom_see_handler("^array$", function() return "array", lua_url:format("11.1", "") end) \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 45c80e3f..36d76e1a 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,376 +1,378 @@ - - - - - Reference + + + + + + + + ExpGaming Scenario + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/ldoc.css b/doc/ldoc.css index 7d74ca23..809ab237 100644 --- a/doc/ldoc.css +++ b/doc/ldoc.css @@ -1,307 +1,244 @@ -/* BEGIN RESET +/* universal */ -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 { - list-style: disc; - 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: 0 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.example { - background-color: rgb(245, 245, 245); - border: 1px solid silver; - padding: 10px; - margin: 10px 0 10px 0; - font-family: "Andale Mono", monospace; - font-size: .85em; -} - -pre { - background-color: rgb(245, 245, 245); - border: 1px solid silver; - padding: 10px; - margin: 10px 0 10px 0; - overflow: auto; - font-family: "Andale Mono", monospace; -} +body{background-color:#0F0F0F;color:#C8C8C8;font-family:'Lucida Grande',Arial,sans-serif} +a{text-decoration:none;border-style:none;outline:none!important} +a:link{color:#FF7200;text-decoration:none} +a:visited{color:#FF7200;text-decoration:none} +a:hover{color:#C8C8C8;text-decoration:none} +a:active{color:#C8C8C8;text-decoration:none} +h1{font-size:2.5rem} +h2{font-size:2.3rem} +h3{font-size:2rem} +h4{font-size:1.8rem} +h5{font-size:1.6rem} -table.index { border: 1px #00007f; } -table.index td { text-align: left; vertical-align: top; } +/* table */ -#container { - margin-left: 1em; - margin-right: 1em; - background-color: #f0f0f0; +table,thead{text-align:left} +table,th,td{padding:2px} + + +/* sidebar */ + +.sidebar {height: 100%} + +.sidebar-custom { + border-right: 1px solid #2C2C2C; + padding-right: 1.4rem; + bottom: 0rem; } -#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; +@supports (-ms-ime-align:auto) { + .sidebar-custom { + height: 99%; } } +.up-to-top { + top: 1.5rem; + position: -webkit-sticky; + position: sticky; + text-align: right; + margin-right: 0.2rem; +} + +.up-to-top a{padding:20px} +.up-to-top a:link{color:#FF7200} +.up-to-top a:hover{color:#C8C8C8} +.icon-arrow-right-custom{margin-bottom:3px} +.project-infobox{text-align:right} +.project-infobox .project-desc{font-style:italic} +.nav-modules{text-align:right} +.nav-module-contents{text-align:right} + + +/* navigation */ + +.nav .nav a{color:#FF7200} +.nav .nav a:link{color:#FF7200} +.nav .nav a:visited{color:#FF7200} +.nav .nav a:hover{color:#C8C8C8;text-decoration:none} +.nav .nav-item.active>a:hover{color:#C8C8C8;text-decoration:none} +.nav .nav-item.active{margin-left:0} +.nav .nav a:active{color:#C8C8C8} + + +/* main page module list */ + +.body-module-name {font-weight: 500} + table.module_list { - border-width: 1px; - border-style: solid; - border-color: #cccccc; + border-spacing: 0; + display: table; border-collapse: collapse; + margin-bottom: 2.0rem; } + table.module_list td { - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; + border-top: 1px solid #2C2C2C; + border-bottom: 1px solid #2C2C2C; + padding: 3px 7px 3px 7px; } -table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } -table.module_list td.summary { width: 100%; } +table.module_list td.name { + vertical-align: top; + min-width: 125px; + background-color: #0D0D0D; +} -table.function_list { - border-width: 1px; - border-style: solid; - border-color: #cccccc; +table.module_list td.summary {vertical-align: top} + +.module_list p {margin:0px} + +/* section */ + +.module-see-also li { + margin-top: 0.5rem; +} + +.section-title a:link{color:#C8C8C8} +.section-title a:visited{color:#C8C8C8} +.section-title a:hover{color:#FF7200} +.section-title a:active{color:#FF7200} + +.section-body-container dd { + margin: 1.0rem 0 1.5rem 0; +} + +table.section-content-list { + border-spacing: 0; + display: table; 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; + margin-bottom: 1.5rem; } -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; +table.section-content-list td { + border-top: 1px solid #2C2C2C; + border-bottom: 1px solid #2C2C2C; + padding: 3px 7px 3px 7px; } -/* 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 .prompt { color: #558817; } -pre .url { color: #272fc2; text-decoration: underline; } +table.section-content-list td.name { + background-color: #0D0D0D; + vertical-align: top; + white-space: nowrap; +} + +table.section-content-list td.summary { + min-width: 200px; + vertical-align: top; +} + +.section-content-list p {margin: 0px} + +div.section-item-header .section-item-title { + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-size: 1.5rem; + margin-left: 3px; +} + +.section-title:target { + padding-left: 7px; + border-left: 5px solid #FF7200; + text-decoration: none; +} + +.section-item-title:target { + padding: 3px 5px 3px 5px; + background-color: #FF7200; + color: #000000; + text-decoration: none; +} + +.section-item-body {margin-left: 4rem} + +/*.section-subitem-li { + padding-left: 1.28571429em; + text-indent: -1.28571429em; +}*/ + +/*.section-subitem-module-field-li { + margin-left: -1.28571429em; + padding-left: 1.28571429em; + text-indent: -1.28571429em; +}*/ + +/* example pages */ + +pre.code.example{margin:0 0 1em} +pre.code.example code h2{display:none} +pre.code.example code pre{margin:0} + + +/* usage code */ + +code{background-color:#181818;color:#C8C8C8;font-size:1.3rem} +pre.code code{background-color:#282828;color:#C8C8C8;font-size:1.3rem} +pre.code .comment{color:#998d70} +pre.code .constant{color:#a8660d} +pre.code .escape{color:#844631} +pre.code .keyword{color:#c43724;font-weight:700} +pre.code .library{color:#0e7c6b} +pre.code .marker{color:#512b1e;background:#fedc56;font-weight:700} +pre.code .string{color:#99ca3c} +pre.code .number{color:#f8660d} +pre.code .operator{color:#2239a8;font-weight:700} +pre.code .preprocessor,pre .prepro{color:#a33243} +pre.code .global{color:#5798da} +pre.code .user-keyword{color:purple} +pre.code .prompt{color:#998d70} +pre.code .url{color:#272fc2;text-decoration:underline} + + +/* footer */ + +.footer{height:65px} +.sidebar-footer{text-align:left;padding-right:33px} +.content-footer{text-align:right} + + +/* misc */ + +.types {font-weight:bold;font-style:italic} + +.divider[data-content]::after,.divider-vert[data-content]::after{background:#262626;color:#C8C8C8} +.divider-custom{border-width:1px;border-color:#585959} + + +/* fragment hashtag */ + +.fragment-hashtag{color:#3C3C3C} +a.fragment-hashtag{color:#3C3C3C} +a.fragment-hashtag:hover{color:#FF7200} + + +/* mobile */ + +@media screen and (max-width: 540px) { + .up-to-top {display: none} + .sidebar-custom { + border-right: 1px solid #2C2C2C; + padding-right: 1.4rem; + bottom: 0rem; + margin-right: 0px; + } + .sidebar-footer { + text-align: right; + padding-right: 10px; + white-space: nowrap; + } + table.function_list td.name { + background-color: #0D0D0D; + vertical-align: top; + white-space: normal; + } + .function-item-spec-body-wrap {margin-left: 1.5rem} +} + + +/* tablets */ + +@media screen and (min-width: 540px) and (max-width: 780px) { + .sidebar-footer {white-space: nowrap} +} diff --git a/doc/ldoc.ltp b/doc/ldoc.ltp new file mode 100644 index 00000000..ca3fc3d2 --- /dev/null +++ b/doc/ldoc.ltp @@ -0,0 +1,402 @@ +> local iter = ldoc.modules.iter +> local M = ldoc.markup +> local use_li = ldoc.use_li +> local no_spaces = ldoc.no_spaces +> local display_name = ldoc.display_name + +> local function remove_parent_obj(obj) +> obj = obj:gsub(">Concepts%.(.*)<", ">%1<"):gsub(">Common%.(.*)<", ">%1<") +> obj = obj:gsub(">{Concepts%.(.*)}<", ">{%1}<"):gsub(">{Common%.(.*)}<", ">{%1}<") +> return obj +> end + + + + + + +> if module then + $(module.name) $(module.type) +> else + $(ldoc.title) +> end + +> if module then + + +> else + + +> end + + + + +
+
+ + + + + + + +
+ + +> if not module then +> for kind, mods in ldoc.kinds() do +

$(kind)

+> kind = kind:lower() + +> for m in mods() do + + +> if M(ldoc.strip_header(m.summary),m) ~= "" then + +> end + +> end -- for modules +
$(m.name)$(M(ldoc.strip_header(m.summary),m))
+> end -- for kinds +> end + + + +> if module then + + + +

$(module.name) $(module.type)

+

$(M(module.summary))

+

$(M(module.description))

+ +> if ldoc.body and module.type == "example" then +
$(ldoc.body:gsub("^

(.*%.lua)

(.*)$", "%2"):gsub("
(.*)
", "%1"):gsub("^%s*(.-)%s*$", "%1"))
+> elseif ldoc.body and module.type == "topic" then + $(M(ldoc.body)) +> end + + +> if module.info then +
    +> for tag, value in module.info:iter() do +
  • $(tag): $(M(value,module))
  • +> end +
+> end + + + +> if module.see then +

See also

+ +> end +> if module.usage then +

Usage

+> for usage in iter(module.usage) do +
$(ldoc.prettify(usage))
+> end +> end + + + + + +> if module and module.type ~= "topic" then +> for kind, items in module.kinds() do + + +

$(kind)

+ $(M(module.kinds:get_section_description(kind))) + + +> for item in items() do + + +> if item.summary ~= "" then + +> end + +> end + +
$(display_name(item))$(M(item.summary,item))
+> end +> end + + +
+ + +> if module and module.type ~= "topic" then +> for kind, items in module.kinds() do +

$(kind)

+
+> for item in items() do +
+
+
+ # + $(display_name(item)) +
+
+
+
+ +> if item.summary ~= "" or item.description ~= "" then +

$(M(item.summary))

+

$(M(item.description))

+> end + + +> if not ldoc.no_return_or_parms and item.params and #item.params > 0 then +> local module_item_subnames = module.kinds:type_of(item).subnames +> if module_item_subnames then + $(module_item_subnames): +> end + +
    + +> for param in iter(item.params) do +> local param, sublist = item:subparam(param) + +> if sublist then +
  • + $(sublist) : $(M(item.params.map[sublist], item)) +
      +> end + +> for p in iter(param) do + +> local name, tp, def = item:display_name_of(p), ldoc.typename(item:type_of_param(p)), item:default_of_param(p) + +> if not module_item_subnames then +
    • +> else +
    • +> end + + $(name) + +> if tp ~= "" or item.params.map[p] ~= "" then + : +> end + +> if tp ~= "" then + ($(remove_parent_obj(tp))) +> end + + $(remove_parent_obj(M(item.params.map[p], item))) + +> if def == true then + (optional) +> elseif def then + (default: $(def)) +> end +> if item:readonly(p) then + (readonly) +> end +
    • +> end + +> if sublist then +
    +
  • +> end +> end + +
+ +> end + + + +> if item.retgroups then +> local groups = item.retgroups + Returns: +> for i, group in ldoc.ipairs(groups) do +
    +> for r in group:iter() do +> local type, ctypes = item:return_type(r) +> local rt = ldoc.typename(type) +
  • +> if rt ~= '' then + ($(remove_parent_obj(rt))) +> end +> if r.text ~= '' then + $(remove_parent_obj(M(r.text, item))) +> end +> if ctypes then +
      +> for c in ctypes:iter() do +
    • + $(c.name) + ($(ldoc.typename(c.type))) + : $(M(c.comment, item)) +
    • +> end +
    +> end +
  • +> end +
+> if i < #groups then +
Or
+> end +> end +> end + + +> if item.raise then +
Raises
$(M(item.raise, item)) +> end + + +> if item.see then + See also: + +> end + + + +> if item.usage then + Usage: +> for usage in iter(item.usage) do +
$(ldoc.prettify(usage))
+> end +> end + + +
+> end +
+> end +> else + +
+> end +> end + + + +
+
+ + + + + diff --git a/doc/modules/Reports.html b/doc/modules/Reports.html new file mode 100644 index 00000000..f22beb2f --- /dev/null +++ b/doc/modules/Reports.html @@ -0,0 +1,935 @@ + + + + + + + + Reports module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Reports module

+

Control Module - Reports + Adds a way to report players and store report messages.

+

+ + + + + + +

Usage

+

+    -- This will place a report on "MrBiter" (must be a valid player) the report will have been made
+    -- by "Cooldude2606" (must be the player name) with the reason 'Liking biters too much' this can be
+    -- seen by using Reports.get_report.
+    Reports.report_player('MrBiter','Cooldude2606','Liking biters too much') -- true
+
+    -- The other get methods can be used to get all the reports on a player or to test if a player is reported.
+    Reports.get_report('MrBiter','Cooldude2606') -- 'Liking biters too much'
+
+    -- This will remove the warning on 'MrBiter' (must be a valid player) which was made by 'Cooldude2606'.
+    Reports.remove_report('MrBiter','Cooldude2606') -- true
+
+    -- This will remove all the report that have been made against 'MrBiter'. Note that the remove event will
+    -- be triggered once per report issused.
+    Reports.remove_all('MrBiter') -- true
+
+ + + + + + + +

Events

+ + + + + + + + + + + + +
on_player_reportedWhen a player is reported
on_report_removedWhen a report is removed from a player
+ + +

Get functions

+ + + + + + + + + + + + + + + + + + + + +
count_reports (player[, custom_count])Counts the number of reports that a player has aganist them
get_report (player, by_player_name)Gets a single report against a player given the name of the player who made the report
get_reports (player)Gets a list of all reports that a player has against them
is_reported (player[, by_player_name])Checks if a player is reported, option to get if reported by a certain player
+ + +

Set functions

+ + + + + + + + + + + + + + + + +
remove_all (player)Removes all reports from a player
remove_report (player, reported_by_name)Removes a report from a player
report_player (player, by_player_name[, reason='Non Given.'])Adds a report to a player, each player can only report another player once
+ + +
+ + +

Events

+
+
+
+
+ # + on_player_reported +
+
+
+
+ +

When a player is reported

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the player index of the player who got reported + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who made the report + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason given for the report + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_report_removed +
+
+
+
+ +

When a report is removed from a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the player index of the player who has the report removed + +
  • + + + + + +
  • + + reported_by_name + + : + + (string) + + the name of the player who made the removed report + +
  • + + + + + +
  • + + removed_by_name + + : + + (string) + + the name of the player who removed the report + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Get functions

+
+
+
+
+ # + count_reports (player[, custom_count]) +
+
+
+
+ +

Counts the number of reports that a player has aganist them

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to count the reports for + +
  • + + + + + +
  • + + custom_count + + : + + (function) + + when given this function will be used to count the reports + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of reports that the user has +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_report (player, by_player_name) +
+
+
+
+ +

Gets a single report against a player given the name of the player who made the report

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the report for + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who made the report + +
  • + + +
+ + + + + Returns: +
    +
  • + (string or nil) + string is the reason that the player was reported, if the player is not reported +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_reports (player) +
+
+
+
+ +

Gets a list of all reports that a player has against them

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the report for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + a list of all reports, key is by player name, value is reason +
  • +
+ + + + + + + + + +
+
+
+
+ # + is_reported (player[, by_player_name]) +
+
+
+
+ +

Checks if a player is reported, option to get if reported by a certain player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to check if reported + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + when given will check if reported by this player + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + if the player has been reported +
  • +
+ + + + + + + + + +
+
+

Set functions

+
+
+
+
+ # + remove_all (player) +
+
+
+
+ +

Removes all reports from a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to remove the reports from + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the reports were removed successfully +
  • +
+ + + + + + + + + +
+
+
+
+ # + remove_report (player, reported_by_name) +
+
+
+
+ +

Removes a report from a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to remove the report from + +
  • + + + + + +
  • + + reported_by_name + + : + + (string) + + the name of the player that made the report + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the report was removed successfully +
  • +
+ + + + + + + + + +
+
+
+
+ # + report_player (player, by_player_name[, reason='Non Given.']) +
+
+
+
+ +

Adds a report to a player, each player can only report another player once

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to add the report to + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player that is making the report + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being reported + + (default: 'Non Given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the report was added successfully +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/addons.advanced-start.html b/doc/modules/addons.advanced-start.html new file mode 100644 index 00000000..71ef2c75 --- /dev/null +++ b/doc/modules/addons.advanced-start.html @@ -0,0 +1,71 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module addons.advanced-start

+

Adds a better method of player starting items based on production levels.

+

+ + + +
+
+ + + + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/addons.chat-popups.html b/doc/modules/addons.chat-popups.html new file mode 100644 index 00000000..df8efb1e --- /dev/null +++ b/doc/modules/addons.chat-popups.html @@ -0,0 +1,72 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module addons.chat-popups

+

Creates flying text entities when a player sends a message in chat + also displays a ping above users who are named in the message

+

+ + + +
+
+ + + + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/addons.damage-popups.html b/doc/modules/addons.damage-popups.html new file mode 100644 index 00000000..89bc2255 --- /dev/null +++ b/doc/modules/addons.damage-popups.html @@ -0,0 +1,72 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module addons.damage-popups

+

Displays the amount of dmg that is done by players to entities + also shows player health when a player is attacked

+

+ + + +
+
+ + + + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/config._file_loader.html b/doc/modules/config._file_loader.html index 2b4403f7..21cb995d 100644 --- a/doc/modules/config._file_loader.html +++ b/doc/modules/config._file_loader.html @@ -1,121 +1,179 @@ - - - - - Reference + + + + + + + + config._file_loader module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.action_buttons.html b/doc/modules/config.action_buttons.html index ae1730dc..d04dd7ff 100644 --- a/doc/modules/config.action_buttons.html +++ b/doc/modules/config.action_buttons.html @@ -1,122 +1,180 @@ - - - - - Reference + + + + + + + + config.action_buttons module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.advanced_start.html b/doc/modules/config.advanced_start.html index e1826c7e..be131271 100644 --- a/doc/modules/config.advanced_start.html +++ b/doc/modules/config.advanced_start.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.advanced_start module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.bonuses.html b/doc/modules/config.bonuses.html new file mode 100644 index 00000000..9389a5dd --- /dev/null +++ b/doc/modules/config.bonuses.html @@ -0,0 +1,176 @@ + + + + + + + + config.bonuses module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

config.bonuses module

+

Lists all bonuses which can be used, name followed by min max

+

+ + + + + + + + + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/config.chat_reply.html b/doc/modules/config.chat_reply.html new file mode 100644 index 00000000..69221be0 --- /dev/null +++ b/doc/modules/config.chat_reply.html @@ -0,0 +1,176 @@ + + + + + + + + config.chat_reply module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

config.chat_reply module

+

This file defines the different triggers for the chat bot

+

+ + + + + + + + + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/config.death_logger.html b/doc/modules/config.death_logger.html index 98437177..203ad3f9 100644 --- a/doc/modules/config.death_logger.html +++ b/doc/modules/config.death_logger.html @@ -1,120 +1,178 @@ - - - - - Reference + + + + + + + + config.death_logger module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.discord_alerts.html b/doc/modules/config.discord_alerts.html new file mode 100644 index 00000000..f3e462a9 --- /dev/null +++ b/doc/modules/config.discord_alerts.html @@ -0,0 +1,176 @@ + + + + + + + + config.discord_alerts module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

config.discord_alerts module

+

Config file used to enable and disable different push messages for discord

+

+ + + + + + + + + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/config.expcore-commands.auth_admin.html b/doc/modules/config.expcore-commands.auth_admin.html index 3a780c6b..3e050d1b 100644 --- a/doc/modules/config.expcore-commands.auth_admin.html +++ b/doc/modules/config.expcore-commands.auth_admin.html @@ -1,120 +1,178 @@ - - - - - Reference + + + + + + + + config.expcore-commands.auth_admin module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.expcore-commands.auth_roles.html b/doc/modules/config.expcore-commands.auth_roles.html index 328cf7df..01997b9b 100644 --- a/doc/modules/config.expcore-commands.auth_roles.html +++ b/doc/modules/config.expcore-commands.auth_roles.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.expcore-commands.auth_roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.expcore-commands.auth_runtime_disable.html b/doc/modules/config.expcore-commands.auth_runtime_disable.html index f8f18960..126d7311 100644 --- a/doc/modules/config.expcore-commands.auth_runtime_disable.html +++ b/doc/modules/config.expcore-commands.auth_runtime_disable.html @@ -1,119 +1,177 @@ - - - - - Reference + + + + + + + + config.expcore-commands.auth_runtime_disable module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.expcore-commands.parse_general.html b/doc/modules/config.expcore-commands.parse_general.html index 3b6006bd..9a908bba 100644 --- a/doc/modules/config.expcore-commands.parse_general.html +++ b/doc/modules/config.expcore-commands.parse_general.html @@ -1,122 +1,180 @@ - - - - - Reference + + + + + + + + config.expcore-commands.parse_general module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.expcore-commands.parse_roles.html b/doc/modules/config.expcore-commands.parse_roles.html index 45f17c50..7f85c2c5 100644 --- a/doc/modules/config.expcore-commands.parse_roles.html +++ b/doc/modules/config.expcore-commands.parse_roles.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.expcore-commands.parse_roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.permission_groups.html b/doc/modules/config.permission_groups.html index c9572f7f..35e8a99f 100644 --- a/doc/modules/config.permission_groups.html +++ b/doc/modules/config.permission_groups.html @@ -1,121 +1,179 @@ - - - - - Reference + + + + + + + + config.permission_groups module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.popup_messages.html b/doc/modules/config.popup_messages.html index 93daa302..d1abfb31 100644 --- a/doc/modules/config.popup_messages.html +++ b/doc/modules/config.popup_messages.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.popup_messages module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.rockets.html b/doc/modules/config.rockets.html index 93c35073..bcc93126 100644 --- a/doc/modules/config.rockets.html +++ b/doc/modules/config.rockets.html @@ -1,165 +1,257 @@ - - - - - Reference + + + + + + + + config.rockets module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.roles.html b/doc/modules/config.roles.html index 62b973ec..6a21bf0f 100644 --- a/doc/modules/config.roles.html +++ b/doc/modules/config.roles.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.scorched_earth.html b/doc/modules/config.scorched_earth.html index 22741e11..72c4958f 100644 --- a/doc/modules/config.scorched_earth.html +++ b/doc/modules/config.scorched_earth.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.scorched_earth module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.spawn_area.html b/doc/modules/config.spawn_area.html index e25138fb..b849bd5b 100644 --- a/doc/modules/config.spawn_area.html +++ b/doc/modules/config.spawn_area.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.spawn_area module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.warnings.html b/doc/modules/config.warnings.html index d087da36..d6ef9bfd 100644 --- a/doc/modules/config.warnings.html +++ b/doc/modules/config.warnings.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + config.warnings module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.warps.html b/doc/modules/config.warps.html new file mode 100644 index 00000000..895cbacb --- /dev/null +++ b/doc/modules/config.warps.html @@ -0,0 +1,176 @@ + + + + + + + + config.warps module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

config.warps module

+

This file contains all the different settings for the warp system and gui

+

+ + + + + + + + + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/control.html b/doc/modules/control.html index 73a8a5b4..7f8c0a32 100644 --- a/doc/modules/control.html +++ b/doc/modules/control.html @@ -1,121 +1,179 @@ - - - - - Reference + + + + + + + + control module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/control.reports.html b/doc/modules/control.reports.html new file mode 100644 index 00000000..eee1ba64 --- /dev/null +++ b/doc/modules/control.reports.html @@ -0,0 +1,341 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module control.reports

+

Gets a list of all reports that a player has against them

+

+ + +

Get functions

+ + + + + + + + + + + + + + + + + +
Reports.get_reports (player)Gets a list of all reports that a player has against them
Reports.get_report (player[, by_player_name='server'])Gets a single report against a player given the name of the player who made the report
Reports.is_reported (player[, by_player_name])Checks if a player is reported, option to get if reported by a certain player
Reports.count (player[, custom_count])Counts the number of reports that a player has aganist them
+

Set functions

+ + + + + + + + + + + + + +
Reports.report_player (player[, by_player_name='server'[, reason='Non Given.']])Adds a report to a player, each player can only report another player once
Reports.remove_report (player[, by_player_name='server'])Removes a report from a player
Reports.remove_all (player)Removes all reports from a player
+ +
+
+ + +

Get functions

+ + + Functions used to get information from reports +
+
+ + Reports.get_reports (player) +
+
+ Gets a list of all reports that a player has against them + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to get the report for +
  • +
+ +

Returns:

+
    + + table + a list of all reports, key is by player name, value is reason +
+ + + + +
+
+ + Reports.get_report (player[, by_player_name='server']) +
+
+ Gets a single report against a player given the name of the player who made the report + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to get the report for +
  • +
  • by_player_name + string + the name of the player who made the report + (default 'server') +
  • +
+ +

Returns:

+
    + + string or nil + string is the reason that the player was reported, if the player is not reported +
+ + + + +
+
+ + Reports.is_reported (player[, by_player_name]) +
+
+ Checks if a player is reported, option to get if reported by a certain player + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to check if reported +
  • +
  • by_player_name + string + when given will check if reported by this player + (optional) +
  • +
+ +

Returns:

+
    + + boolean + if the player has been reported +
+ + + + +
+
+ + Reports.count (player[, custom_count]) +
+
+ Counts the number of reports that a player has aganist them + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to count the reports for +
  • +
  • custom_count + function + when given this function will be used to count the reports + (optional) +
  • +
+ +

Returns:

+
    + + number + the number of reports that the user has +
+ + + + +
+
+

Set functions

+ + + Functions used to get information from reports +
+
+ + Reports.report_player (player[, by_player_name='server'[, reason='Non Given.']]) +
+
+ Adds a report to a player, each player can only report another player once + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to add the report to +
  • +
  • by_player_name + string + the name of the player that is making the report + (default 'server') +
  • +
  • reason + string + the reason that the player is being reported + (default 'Non Given.') +
  • +
+ +

Returns:

+
    + + boolean + whether the report was added successfully +
+ + + + +
+
+ + Reports.remove_report (player[, by_player_name='server']) +
+
+ Removes a report from a player + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to remove the report from +
  • +
  • by_player_name + string + the name of the player that made the report + (default 'server') +
  • +
+ +

Returns:

+
    + + boolean + whether the report was removed successfully +
+ + + + +
+
+ + Reports.remove_all (player) +
+
+ Removes all reports from a player + + +

Parameters:

+
    +
  • player + LuaPlayer + the player to remove the reports from +
  • +
+ +

Returns:

+
    + + boolean + whether the reports were removed successfully +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 18:40:35 +
+
+ + diff --git a/doc/modules/expcore.commands.html b/doc/modules/expcore.commands.html index a41d8db7..2fd66000 100644 --- a/doc/modules/expcore.commands.html +++ b/doc/modules/expcore.commands.html @@ -1,123 +1,180 @@ - - - - - Reference + + + + + + + + expcore.commands module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.common.html b/doc/modules/expcore.common.html index 83fc1ed4..91328755 100644 --- a/doc/modules/expcore.common.html +++ b/doc/modules/expcore.common.html @@ -1,996 +1,2255 @@ - - - - - Reference + + + + + + + + expcore.common module + + + - - + + -
+
+
-
- -
-
-
+ + + -
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/expcore.gui.concepts.center.html b/doc/modules/expcore.gui.concepts.center.html new file mode 100644 index 00000000..6e16dce5 --- /dev/null +++ b/doc/modules/expcore.gui.concepts.center.html @@ -0,0 +1,913 @@ + + + + + + + + expcore.gui.concepts.center module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.center module

+

Gui structure define for center gui frames +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CenterFrames._prototype:draw_frame (player)Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)
CenterFrames._prototype:event_handler ([action=update])Creates an event handler that will trigger one of its functions, use with Event.add
CenterFrames._prototype:redraw_frame (player)Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)
CenterFrames._prototype:set_auto_focus ([state=true])Sets the frame to be the current active gui when opened and closes all other frames
CenterFrames._prototype:toggle_frame (player)Toggles if the frame is open, if open it will close it and if closed it will open it
CenterFrames.clear_flow (player)Clears the center flow for a player
CenterFrames.draw_frame (player, name)Draws the center frame for a player, if already open then will do nothing
CenterFrames.get_flow (player)Gets the center flow for a player
CenterFrames.new_frame (permision_name)Creates a new center frame define
CenterFrames.redraw_frame (player, name)Draws the center frame for a player, if already open then will destroy it and redraw
CenterFrames.toggle_frame (player, name[, state])Toggles if the frame is currently open or not, will open if closed and close if open
+ + +
+ + +

Functions

+
+
+
+
+ # + CenterFrames._prototype:draw_frame (player) +
+
+
+
+ +

Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to draw the frame for + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + CenterFrames._prototype:event_handler ([action=update]) +
+
+
+
+ +

Creates an event handler that will trigger one of its functions, use with Event.add

+

+ + + Parameters: + +
    + + + + + +
  • + + action + + : + + (string) + + the action to take on this event + + (default: update) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + CenterFrames._prototype:redraw_frame (player) +
+
+
+
+ +

Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to draw the frame for + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + CenterFrames._prototype:set_auto_focus ([state=true]) +
+
+
+
+ +

Sets the frame to be the current active gui when opened and closes all other frames

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean) + + when true will auto close other frames and set this frame as player.opened + + (default: true) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + CenterFrames._prototype:toggle_frame (player) +
+
+
+
+ +

Toggles if the frame is open, if open it will close it and if closed it will open it

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to draw the frame for + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + with the gui frame is now open +
  • +
+ + + + + + + + + +
+
+
+
+ # + CenterFrames.clear_flow (player) +
+
+
+
+ +

Clears the center flow for a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to clear the flow for + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + CenterFrames.draw_frame (player, name) +
+
+
+
+ +

Draws the center frame for a player, if already open then will do nothing

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will have the frame drawn + +
  • + + + + + +
  • + + name + + : + + (string) + + the name of the hui that will drawn + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + CenterFrames.get_flow (player) +
+
+
+
+ +

Gets the center flow for a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the flow for + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + CenterFrames.new_frame (permision_name) +
+
+
+
+ +

Creates a new center frame define

+

+ + + Parameters: + +
    + + + + + +
  • + + permision_name + + : + + (string) + + the name that can be used with the permision system + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new center frame define +
  • +
+ + + + + + + + + +
+
+
+
+ # + CenterFrames.redraw_frame (player, name) +
+
+
+
+ +

Draws the center frame for a player, if already open then will destroy it and redraw

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will have the frame drawn + +
  • + + + + + +
  • + + name + + : + + (string) + + the name of the hui that will drawn + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + CenterFrames.toggle_frame (player, name[, state]) +
+
+
+
+ +

Toggles if the frame is currently open or not, will open if closed and close if open

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will have the frame toggled + +
  • + + + + + +
  • + + name + + : + + (string) + + the name of the hui that will be toggled + +
  • + + + + + +
  • + + state + + : + + (boolean) + + when set will force a state for the frame + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + if the frame if no open or closed +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.concepts.left.html b/doc/modules/expcore.gui.concepts.left.html new file mode 100644 index 00000000..72bac7b3 --- /dev/null +++ b/doc/modules/expcore.gui.concepts.left.html @@ -0,0 +1,1179 @@ + + + + + + + + expcore.gui.concepts.left module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.left module

+

Gui structure define for left frames +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LeftFrames._prototype:_internal_draw (player)Creates the gui for the first time, used internally
LeftFrames._prototype:event_handler ([action=update])Creates an event handler that will trigger one of its functions, use with Event.add
LeftFrames._prototype:get_frame (player)Gets the frame for this define from the left frame flow
LeftFrames._prototype:is_open (player)Returns if the player currently has this define visible
LeftFrames._prototype:redraw (player)Redraws the frame by calling on_draw, will always clear the frame
LeftFrames._prototype:redraw_all ([update_offline=false])Redraws the frame for all players, see redraw
LeftFrames._prototype:set_direction (direction)Sets the direction of the frame, either vertical or horizontal
LeftFrames._prototype:set_open_by_default ([state=true])Sets if the frame is visible when a player joins, can also be a function to return a boolean
LeftFrames._prototype:toggle (player)Toggles the visiblty of the left frame
LeftFrames._prototype:update (player)Updates the contents of the left frame, first tries update callback, oter wise will clear and redraw
LeftFrames._prototype:update_all ([update_offline=false])Updates the frame for all players, see update
LeftFrames.get_flow (player)Gets the left frame flow for a player
LeftFrames.get_frame (name, player)Gets one frame from the left flow by its name
LeftFrames.get_open (player)Gets all open frames for a player, if non are open it will remove the close all button
LeftFrames.new_frame (permision_name)Creates a new left frame define
LeftFrames.toggle_frame (name, player[, state])Toggles the visiblty of a left frame, or sets its visiblty state
+ + +
+ + +

Functions

+
+
+
+
+ # + LeftFrames._prototype:_internal_draw (player) +
+
+
+
+ +

Creates the gui for the first time, used internally

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to draw the frame to + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:event_handler ([action=update]) +
+
+
+
+ +

Creates an event handler that will trigger one of its functions, use with Event.add

+

+ + + Parameters: + +
    + + + + + +
  • + + action + + : + + (string) + + the action to take on this event + + (default: update) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:get_frame (player) +
+
+
+
+ +

Gets the frame for this define from the left frame flow

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the frame of + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the frame in the left frame flow for this define +
  • +
+ + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:is_open (player) +
+
+
+
+ +

Returns if the player currently has this define visible

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the frame of + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if it is open/visible +
  • +
+ + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:redraw (player) +
+
+
+
+ +

Redraws the frame by calling on_draw, will always clear the frame

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to update the frame of + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:redraw_all ([update_offline=false]) +
+
+
+
+ +

Redraws the frame for all players, see redraw

+

+ + + Parameters: + +
    + + + + + +
  • + + update_offline + + : + + (boolean) + + when true will update the frame for offline players + + (default: false) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:set_direction (direction) +
+
+
+
+ +

Sets the direction of the frame, either vertical or horizontal

+

+ + + Parameters: + +
    + + + + + +
  • + + direction + + : + + (string) + + the direction to have the elements be added to thef frame + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:set_open_by_default ([state=true]) +
+
+
+
+ +

Sets if the frame is visible when a player joins, can also be a function to return a boolean

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean or function) + + the default state of the visiblty, can be a function + state param - player LuaPlayer - the player that has joined the game + state param - define_name string - the define name for the frame + state return - boolean - false will hide the frame + + (default: true) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:toggle (player) +
+
+
+
+ +

Toggles the visiblty of the left frame

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to toggle the frame of + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + the new state of the visiblity +
  • +
+ + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:update (player) +
+
+
+
+ +

Updates the contents of the left frame, first tries update callback, oter wise will clear and redraw

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to update the frame of + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames._prototype:update_all ([update_offline=false]) +
+
+
+
+ +

Updates the frame for all players, see update

+

+ + + Parameters: + +
    + + + + + +
  • + + update_offline + + : + + (boolean) + + when true will update the frame for offline players + + (default: false) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + LeftFrames.get_flow (player) +
+
+
+
+ +

Gets the left frame flow for a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the flow of + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + LeftFrames.get_frame (name, player) +
+
+
+
+ +

Gets one frame from the left flow by its name

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the name of the gui frame to get + +
  • + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the frame of + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the frame in the left frame flow with that name +
  • +
+ + + + + + + + + +
+
+
+
+ # + LeftFrames.get_open (player) +
+
+
+
+ +

Gets all open frames for a player, if non are open it will remove the close all button

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the flow of + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains all the open (and registered) frames for the player +
  • +
+ + + + + + + + + +
+
+
+
+ # + LeftFrames.new_frame (permision_name) +
+
+
+
+ +

Creates a new left frame define

+

+ + + Parameters: + +
    + + + + + +
  • + + permision_name + + : + + (string) + + the name that can be used with the permision system + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new left frame define +
  • +
+ + + + + + + + + +
+
+
+
+ # + LeftFrames.toggle_frame (name, player[, state]) +
+
+
+
+ +

Toggles the visiblty of a left frame, or sets its visiblty state

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the name of the gui frame to toggle + +
  • + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the frame of + +
  • + + + + + +
  • + + state + + : + + (boolean) + + when given will be the state that the visiblty is set to + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + the new state of the visiblity +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.concepts.popups.html b/doc/modules/expcore.gui.concepts.popups.html new file mode 100644 index 00000000..65be91b4 --- /dev/null +++ b/doc/modules/expcore.gui.concepts.popups.html @@ -0,0 +1,658 @@ + + + + + + + + expcore.gui.concepts.popups module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.popups module

+

Gui structure define for popup gui +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + +
PopupFrames._prototype:open (player[, open_time], ...)Opens this define for a player, can be given open time and any other params for the draw function
PopupFrames._prototype:set_default_open_time (amount)Sets the default open time for the popup, will be used if non is provided with open
PopupFrames.get_flow (player)Gets the left flow that contains the popup frames
PopupFrames.new_popup ([name])Creates a new popup frame define
PopupFrames.open (define_name, player[, open_time], ...)Opens a popup for the player, can give the amount of time it is open as well as params for the draw function
+ + +

Fields

+ + + + + + + + + + + + +
PopupFrames.close_buttonA button which can be used to close the gui before the timer runs out
PopupFrames.close_progressProgress bar which when depleaded will close the popup frame
+ + +
+ + +

Functions

+
+
+
+
+ # + PopupFrames._prototype:open (player[, open_time], ...) +
+
+
+
+ +

Opens this define for a player, can be given open time and any other params for the draw function

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to open the popup for + +
  • + + + + + +
  • + + open_time + + : + + (number) + + the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default + + (optional) +
  • + + + + + +
  • + + ... + + : + + (any) + + the other params that you want to pass to your on_draw event + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the frame that was drawn, the inner gui flow which contains the content +
  • +
+ + + + + + + + + +
+
+
+
+ # + PopupFrames._prototype:set_default_open_time (amount) +
+
+
+
+ +

Sets the default open time for the popup, will be used if non is provided with open

+

+ + + Parameters: + +
    + + + + + +
  • + + amount + + : + + (number) + + the number of ticks, by default, the popup will be open for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the define to allow for chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + PopupFrames.get_flow (player) +
+
+
+
+ +

Gets the left flow that contains the popup frames

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the flow for + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the left flow that contains the popup frames +
  • +
+ + + + + + + + + +
+
+
+
+ # + PopupFrames.new_popup ([name]) +
+
+
+
+ +

Creates a new popup frame define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new popup frame define +
  • +
+ + + + + + + + + +
+
+
+
+ # + PopupFrames.open (define_name, player[, open_time], ...) +
+
+
+
+ +

Opens a popup for the player, can give the amount of time it is open as well as params for the draw function

+

+ + + Parameters: + +
    + + + + + +
  • + + define_name + + : + + (string) + + the name of the define that you want to open for the player + +
  • + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to open the popup for + +
  • + + + + + +
  • + + open_time + + : + + (number) + + the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default + + (optional) +
  • + + + + + +
  • + + ... + + : + + (any) + + the other params that you want to pass to your on_draw event + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the frame that was drawn, the inner gui flow which contains the content +
  • +
+ + + + + + + + + +
+
+

Fields

+
+
+
+
+ # + PopupFrames.close_button +
+
+
+
+ +

A button which can be used to close the gui before the timer runs out

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + PopupFrames.close_progress +
+
+
+
+ +

Progress bar which when depleaded will close the popup frame

+

+ + + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.concepts.toolbar.html b/doc/modules/expcore.gui.concepts.toolbar.html new file mode 100644 index 00000000..feb16ea8 --- /dev/null +++ b/doc/modules/expcore.gui.concepts.toolbar.html @@ -0,0 +1,366 @@ + + + + + + + + expcore.gui.concepts.toolbar module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.toolbar module

+

Gui structure for the toolbar (top left) +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + +
Toolbar.add_button (button)Adds an existing buttton to the toolbar
Toolbar.new_button ([name])Adds a new button to the toolbar
Toolbar.update (player)Updates the player's toolbar with an new buttons or expected change in auth return
+ + +
+ + +

Functions

+
+
+
+
+ # + Toolbar.add_button (button) +
+
+
+
+ +

Adds an existing buttton to the toolbar

+

+ + + Parameters: + +
    + + + + + +
  • + + button + + : + + (table) + + the button define for the button to be added + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Toolbar.new_button ([name]) +
+
+
+
+ +

Adds a new button to the toolbar

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + when given allows an alias to the button for the permission system + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the button define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Toolbar.update (player) +
+
+
+
+ +

Updates the player's toolbar with an new buttons or expected change in auth return

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to update the toolbar for + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.core.html b/doc/modules/expcore.gui.core.html index 523bda7b..808fc3be 100644 --- a/doc/modules/expcore.gui.core.html +++ b/doc/modules/expcore.gui.core.html @@ -1,121 +1,179 @@ - - - - - Reference + + + + + + + + expcore.gui.core module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.buttons.html b/doc/modules/expcore.gui.elements.buttons.html new file mode 100644 index 00000000..56c026f6 --- /dev/null +++ b/doc/modules/expcore.gui.elements.buttons.html @@ -0,0 +1,509 @@ + + + + + + + + expcore.gui.elements.buttons module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.buttons module

+

Gui class define for buttons and sprite buttons +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + +
Button._prototype:set_click_filter (filter[, ...])Adds a click / mouse button filter to the button
Button._prototype:set_key_filter (filter[, ...])Adds a control key filter to the button
Button._prototype:set_sprites (sprite[, hovered_sprite][, clicked_sprite])Adds sprites to a button making it a spirte button
Button.new_button ([name])Creates a new button element define
+ + +
+ + +

Functions

+
+
+
+
+ # + Button._prototype:set_click_filter (filter[, ...]) +
+
+
+
+ +

Adds a click / mouse button filter to the button

+

+ + + Parameters: + +
    + + + + + +
  • + + filter + + : + + (table) + + ?string|table either a of mouse buttons or the first mouse button to filter, with a table true means allowed + +
  • + + + + + +
  • + + ... + + : + + (table) + + when filter is not a you can add the mouse buttons one after each other + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + returns the button define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Button._prototype:set_key_filter (filter[, ...]) +
+
+
+
+ +

Adds a control key filter to the button

+

+ + + Parameters: + +
    + + + + + +
  • + + filter + + : + + (table) + + ?string|table either a of control keys or the first control keys to filter, with a table true means allowed + +
  • + + + + + +
  • + + ... + + : + + (table) + + when filter is not a you can add the control keyss one after each other + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + returns the button define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Button._prototype:set_sprites (sprite[, hovered_sprite][, clicked_sprite]) +
+
+
+
+ +

Adds sprites to a button making it a spirte button

+

+ + + Parameters: + +
    + + + + + +
  • + + sprite + + : + + (SpritePath) + + the sprite path for the default sprite for the button + +
  • + + + + + +
  • + + hovered_sprite + + : + + (SpritePath) + + the sprite path for the sprite when the player hovers over the button + + (optional) +
  • + + + + + +
  • + + clicked_sprite + + : + + (SpritePath) + + the sprite path for the sprite when the player clicks the button + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + returns the button define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Button.new_button ([name]) +
+
+
+
+ +

Creates a new button element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new button element define +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.checkboxs.html b/doc/modules/expcore.gui.elements.checkboxs.html new file mode 100644 index 00000000..65b59b2d --- /dev/null +++ b/doc/modules/expcore.gui.elements.checkboxs.html @@ -0,0 +1,827 @@ + + + + + + + + expcore.gui.elements.checkboxs module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.checkboxs module

+

Gui class define for checkboxs and radiobuttons +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Checkbox._prototype_radiobutton:add_as_option (option_set, option_name)Adds this radiobutton to be an option in the given option set (only one can be true at a time)
Checkbox._prototype_radiobutton:get_store (category, internal)Gets the stored value of the radiobutton or the option set if present
Checkbox._prototype_radiobutton:set_store (category, value, internal)Sets the stored value of the radiobutton or the option set if present
Checkbox.draw_option_set (name, element)Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)
Checkbox.new_checkbox ([name])Creates a new checkbox element define
Checkbox.new_option_set (name, callback, categorize)Registers a new option set that can be linked to radiobutotns (only one can be true at a time)
Checkbox.new_radiobutton ([name])Creates a new radiobutton element define, has all functions checkbox has
Checkbox.reset_radiobuttons (element[, exclude][, recursive=false])Sets all radiobutotn in a element to false (unless excluded) and can act recursivly
+ + +
+ + +

Functions

+
+
+
+
+ # + Checkbox._prototype_radiobutton:add_as_option (option_set, option_name) +
+
+
+
+ +

Adds this radiobutton to be an option in the given option set (only one can be true at a time)

+

+ + + Parameters: + +
    + + + + + +
  • + + option_set + + : + + (string) + + the name of the option set to add this element to + +
  • + + + + + +
  • + + option_name + + : + + (string) + + the name of this option that will be used to idenitife it + +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Checkbox._prototype_radiobutton:get_store (category, internal) +
+
+
+
+ +

Gets the stored value of the radiobutton or the option set if present

+

+ + + Parameters: + +
    + + + + + +
  • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
  • + + + + + +
  • + + internal + + : + + (boolean) + + used to prevent stackover flow + +
  • + + +
+ + + + + Returns: +
    +
  • + (any) + the value that is stored for this define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Checkbox._prototype_radiobutton:set_store (category, value, internal) +
+
+
+
+ +

Sets the stored value of the radiobutton or the option set if present

+

+ + + Parameters: + +
    + + + + + +
  • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
  • + + + + + +
  • + + value + + : + + (boolean) + + the value to set for this define, must be valid for its type ie for checkbox etc + +
  • + + + + + +
  • + + internal + + : + + (boolean) + + used to prevent stackover flow + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if the value was set +
  • +
+ + + + + + + + + +
+
+
+
+ # + Checkbox.draw_option_set (name, element) +
+
+
+
+ +

Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the name of the option set to draw the radiobuttons of + +
  • + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the parent element that the radiobuttons will be drawn to + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Checkbox.new_checkbox ([name]) +
+
+
+
+ +

Creates a new checkbox element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new checkbox element define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Checkbox.new_option_set (name, callback, categorize) +
+
+
+
+ +

Registers a new option set that can be linked to radiobutotns (only one can be true at a time)

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the name of the option set, must be unique + +
  • + + + + + +
  • + + callback + + : + + (function) + + the update callback when the value of the option set chagnes + callback param - value string - the new selected option for this option set + callback param - category string - the category that updated if categorize was used + +
  • + + + + + +
  • + + categorize + + : + + (function) + + the function used to convert an element into a string + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the name of this option set to be passed to add_as_option +
  • +
+ + + + + + + + + +
+
+
+
+ # + Checkbox.new_radiobutton ([name]) +
+
+
+
+ +

Creates a new radiobutton element define, has all functions checkbox has

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new button element define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Checkbox.reset_radiobuttons (element[, exclude][, recursive=false]) +
+
+
+
+ +

Sets all radiobutotn in a element to false (unless excluded) and can act recursivly

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the root gui element to start setting radio buttons from + +
  • + + + + + +
  • + + exclude + + : + + (table) + + ?string|table the name of the radiobutton to exclude or a of radiobuttons where true will set the state true + + (optional) +
  • + + + + + +
  • + + recursive + + : + + (number or boolean) + + if true will recur as much as possible, if a will recur that number of times + + (default: false) +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if successful +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.dropdown.html b/doc/modules/expcore.gui.elements.dropdown.html new file mode 100644 index 00000000..bfc37a2d --- /dev/null +++ b/doc/modules/expcore.gui.elements.dropdown.html @@ -0,0 +1,689 @@ + + + + + + + + expcore.gui.elements.dropdown module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.dropdown module

+

Gui class define for dropdowns and list boxs +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Dropdown._prototype:add_option_callback (option, callback)Adds a case specific callback which will only run when that option is selected (general case still triggered)
Dropdown._prototype:new_dynamic_options (callback)Adds a callback which should return a table of values to be added as options for the dropdown (appended after static options)
Dropdown._prototype:new_static_options (options[, ...], the)Adds new static options to the dropdown which will trigger the general callback
Dropdown.get_selected_value (element)Returns the currently selected value rather than index
Dropdown.new_dropdown ([name])Creates a new dropdown element define
Dropdown.new_list_box ([name])Creates a new list box element define
Dropdown.select_value (element, value)Selects the option from a dropdown or list box given the value rather than key
+ + +
+ + +

Functions

+
+
+
+
+ # + Dropdown._prototype:add_option_callback (option, callback) +
+
+
+
+ +

Adds a case specific callback which will only run when that option is selected (general case still triggered)

+

+ + + Parameters: + +
    + + + + + +
  • + + option + + : + + (string) + + the name of the option to trigger the callback on; if not already added then will be added as an option + +
  • + + + + + +
  • + + callback + + : + + (function) + + the function that will be called when that option is selected + callback param - player LuaPlayer - the player who owns the gui element + callback param - element LuaGuiElement - the element which is being effected + callback param - value string - the new option that has been selected + +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Dropdown._prototype:new_dynamic_options (callback) +
+
+
+
+ +

Adds a callback which should return a table of values to be added as options for the dropdown (appended after static options)

+

+ + + Parameters: + +
    + + + + + +
  • + + callback + + : + + (function) + + the function that will run to get the options for the dropdown + callback param - player LuaPlayer - the player that the element is being drawn to + callback param - element LuaGuiElement - the element that is being drawn + callback return - table - the values of this table will be appended to the static options of the dropdown + +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Dropdown._prototype:new_static_options (options[, ...], the) +
+
+
+
+ +

Adds new static options to the dropdown which will trigger the general callback

+

+ + + Parameters: + +
    + + + + + +
  • + + options + + : + + (table) + + ?string|table either a of option strings or the first option string, with a table values are the options + +
  • + + + + + +
  • + + ... + + : + + (table) + + when options is not a you can add the options one after each other + + (optional) +
  • + + + + + +
  • + + the + + : + + (self) + + define to allow chaining + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Dropdown.get_selected_value (element) +
+
+
+
+ +

Returns the currently selected value rather than index

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the gui element that you want to get the value of + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the value that is currently selected +
  • +
+ + + + + + + + + +
+
+
+
+ # + Dropdown.new_dropdown ([name]) +
+
+
+
+ +

Creates a new dropdown element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new dropdown element define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Dropdown.new_list_box ([name]) +
+
+
+
+ +

Creates a new list box element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new list box element define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Dropdown.select_value (element, value) +
+
+
+
+ +

Selects the option from a dropdown or list box given the value rather than key

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the element that contains the option + +
  • + + + + + +
  • + + value + + : + + (string) + + the option to select from the dropdown + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the key where the value was +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.elem-button.html b/doc/modules/expcore.gui.elements.elem-button.html new file mode 100644 index 00000000..a692d110 --- /dev/null +++ b/doc/modules/expcore.gui.elements.elem-button.html @@ -0,0 +1,384 @@ + + + + + + + + expcore.gui.elements.elem-button module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.elem-button module

+

Gui class defines for elem buttons +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + +
ElemButton._prototype:set_default (value)Sets the default value for the elem button, this may be a function or a string
ElemButton.new_elem_button ([name])Creates a new elem button element define
+ + +

Fields

+ + + + + + + + +
ElemButton._prototype.set_typeSets the type of the elem button, the type is required so this must be called at least once
+ + +
+ + +

Functions

+
+
+
+
+ # + ElemButton._prototype:set_default (value) +
+
+
+
+ +

Sets the default value for the elem button, this may be a function or a string

+

+ + + Parameters: + +
    + + + + + +
  • + + value + + : + + (string or function) + + string a will be a static default and a function will be called when drawn to get the default + +
  • + + +
+ + + + + Returns: +
    +
  • + (the) + element define to allow for chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + ElemButton.new_elem_button ([name]) +
+
+
+
+ +

Creates a new elem button element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new elem button element define +
  • +
+ + + + + + + + + +
+
+

Fields

+
+
+
+
+ # + ElemButton._prototype.set_type +
+
+
+
+ +

Sets the type of the elem button, the type is required so this must be called at least once

+

+ + + +
    + + + + + +
  • + + type + + : + + (string) + + the type that this elem button is see factorio api + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.progress-bar.html b/doc/modules/expcore.gui.elements.progress-bar.html new file mode 100644 index 00000000..757af586 --- /dev/null +++ b/doc/modules/expcore.gui.elements.progress-bar.html @@ -0,0 +1,1130 @@ + + + + + + + + expcore.gui.elements.progress-bar module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.progress-bar module

+

Gui element define for progess bars +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProgressBar._prototype:add_element (element[, maximum])Adds an element into the list of instances that will are waiting to complete, does not work with store + note use store if you want persistent data, this only stores the elements not the values which they have
ProgressBar._prototype:decrement ([amount=1][, category])Decreases the value of the progressbar
ProgressBar._prototype:decrement_filtered ([amount=1], filter)Decreases the value of the progressbar, if the filter condition is met, does not work with store
ProgressBar._prototype:event_countdown ([filter])Event handler factory that counts down by 1 every time the event triggeres, can filter which elements are decremented
ProgressBar._prototype:event_counter ([filter])Event handler factory that counts up by 1 every time the event triggeres, can filter which elements are incremented
ProgressBar._prototype:increment ([amount=1][, category])Increases the value of the progressbar
ProgressBar._prototype:increment_filtered ([amount=1], filter)Increases the value of the progressbar, if the filter condition is met, does not work with store
ProgressBar._prototype:reset_element (element)Resets an element, or its store, to be back at the start, either 1 or 0
ProgressBar._prototype:set_default_maximum (amount)Sets the maximum value that represents the end value of the progress bar
ProgressBar._prototype:use_count_down ([state=true])Will set the progress bar to start at 1 and trigger when it hits 0
ProgressBar.decrement (element[, amount=1])Decreases the value of the progressbar, if a define is given all of its instances are decresed
ProgressBar.increment (element[, amount=1])Increases the value of the progressbar, if a define is given all of its instances are incremented
ProgressBar.new_progressbar ([name])Creates a new progressbar element define
ProgressBar.set_maximum (element, amount)Sets the maximum value that represents the end value of the progress bar
+ + +
+ + +

Functions

+
+
+
+
+ # + ProgressBar._prototype:add_element (element[, maximum]) +
+
+
+
+ +

Adds an element into the list of instances that will are waiting to complete, does not work with store + note use store if you want persistent data, this only stores the elements not the values which they have

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the element that you want to add into the waiting to complete list + +
  • + + + + + +
  • + + maximum + + : + + (number) + + the maximum for this element if not given the default for this define is used + + (optional) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:decrement ([amount=1][, category]) +
+
+
+
+ +

Decreases the value of the progressbar

+

+ + + Parameters: + +
    + + + + + +
  • + + amount + + : + + (number) + + the amount to decrease the progressbar by + + (default: 1) +
  • + + + + + +
  • + + category + + : + + (string) + + the category that is used with a store + + (optional) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:decrement_filtered ([amount=1], filter) +
+
+
+
+ +

Decreases the value of the progressbar, if the filter condition is met, does not work with store

+

+ + + Parameters: + +
    + + + + + +
  • + + amount + + : + + (number) + + the amount to decrease the progressbar by + + (default: 1) +
  • + + + + + +
  • + + filter + + : + + (function) + + the filter to be used + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:event_countdown ([filter]) +
+
+
+
+ +

Event handler factory that counts down by 1 every time the event triggeres, can filter which elements are decremented

+

+ + + Parameters: + +
    + + + + + +
  • + + filter + + : + + (function) + + when given will use filtered decerement + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (function) + the event handler +
  • +
+ + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:event_counter ([filter]) +
+
+
+
+ +

Event handler factory that counts up by 1 every time the event triggeres, can filter which elements are incremented

+

+ + + Parameters: + +
    + + + + + +
  • + + filter + + : + + (function) + + when given will use filtered incerement + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (function) + the event handler +
  • +
+ + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:increment ([amount=1][, category]) +
+
+
+
+ +

Increases the value of the progressbar

+

+ + + Parameters: + +
    + + + + + +
  • + + amount + + : + + (number) + + the amount to increase the progressbar by + + (default: 1) +
  • + + + + + +
  • + + category + + : + + (string) + + the category that is used with a store + + (optional) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:increment_filtered ([amount=1], filter) +
+
+
+
+ +

Increases the value of the progressbar, if the filter condition is met, does not work with store

+

+ + + Parameters: + +
    + + + + + +
  • + + amount + + : + + (number) + + the amount to increase the progressbar by + + (default: 1) +
  • + + + + + +
  • + + filter + + : + + (function) + + the filter to be used + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:reset_element (element) +
+
+
+
+ +

Resets an element, or its store, to be back at the start, either 1 or 0

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the element that you want to reset the progress of + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:set_default_maximum (amount) +
+
+
+
+ +

Sets the maximum value that represents the end value of the progress bar

+

+ + + Parameters: + +
    + + + + + +
  • + + amount + + : + + (number) + + the amount to have set as the maximum + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + ProgressBar._prototype:use_count_down ([state=true]) +
+
+
+
+ +

Will set the progress bar to start at 1 and trigger when it hits 0

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean) + + when true the bar will start filled, to be used with decrease + + (default: true) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + ProgressBar.decrement (element[, amount=1]) +
+
+
+
+ +

Decreases the value of the progressbar, if a define is given all of its instances are decresed

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement or string) + + either a gui element or a registered define + +
  • + + + + + +
  • + + amount + + : + + (number) + + the amount to decrease the progressbar by + + (default: 1) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar.increment (element[, amount=1]) +
+
+
+
+ +

Increases the value of the progressbar, if a define is given all of its instances are incremented

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement or string) + + either a gui element or a registered define + +
  • + + + + + +
  • + + amount + + : + + (number) + + the amount to increase the progressbar by + + (default: 1) +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + ProgressBar.new_progressbar ([name]) +
+
+
+
+ +

Creates a new progressbar element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new progressbar elemente define +
  • +
+ + + + + + + + + +
+
+
+
+ # + ProgressBar.set_maximum (element, amount) +
+
+
+
+ +

Sets the maximum value that represents the end value of the progress bar

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement or string) + + either a gui element or a registered define + +
  • + + + + + +
  • + + amount + + : + + (number) + + the amount to have set as the maximum + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.slider.html b/doc/modules/expcore.gui.elements.slider.html new file mode 100644 index 00000000..81c07eb9 --- /dev/null +++ b/doc/modules/expcore.gui.elements.slider.html @@ -0,0 +1,460 @@ + + + + + + + + expcore.gui.elements.slider module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.slider module

+

Gui class define for silders +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + +
Slider._prototype:draw_label (element)Draws a new label and links its value to the value of this slider, if no store then it will only show one value per player
Slider._prototype:enable_auto_draw_label ([state=true])Enables auto draw of the label, the label will share the same parent element as the slider
Slider._prototype:set_range ([min][, max])Sets the range of a slider, if not used will use default values for a slider
Slider.new_slider ([name])Creates a new slider element define
+ + +
+ + +

Functions

+
+
+
+
+ # + Slider._prototype:draw_label (element) +
+
+
+
+ +

Draws a new label and links its value to the value of this slider, if no store then it will only show one value per player

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the parent element that the lable will be drawn to + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the new label element so that styles can be applied +
  • +
+ + + + + + + + + +
+
+
+
+ # + Slider._prototype:enable_auto_draw_label ([state=true]) +
+
+
+
+ +

Enables auto draw of the label, the label will share the same parent element as the slider

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean) + + when false will disable the auto draw of the label + + (default: true) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Slider._prototype:set_range ([min][, max]) +
+
+
+
+ +

Sets the range of a slider, if not used will use default values for a slider

+

+ + + Parameters: + +
    + + + + + +
  • + + min + + : + + (number) + + the minimum value that the slider can take + + (optional) +
  • + + + + + +
  • + + max + + : + + (number) + + the maximum value that the slider can take + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Slider.new_slider ([name]) +
+
+
+
+ +

Creates a new slider element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new slider element define +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.text.html b/doc/modules/expcore.gui.elements.text.html new file mode 100644 index 00000000..caead90f --- /dev/null +++ b/doc/modules/expcore.gui.elements.text.html @@ -0,0 +1,506 @@ + + + + + + + + expcore.gui.elements.text module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.text module

+

Gui class define for text fields and text boxs +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + +
Text._prototype_box:set_read_only ([state=true])Sets the text box to be read only
Text._prototype_box:set_selectable ([state=true])Sets the text box to be selectable
Text._prototype_box:set_word_wrap ([state=true])Sets the text box to have word wrap
Text.new_text_box ([name])Creates a new text box element define
Text.new_text_field ([name])Creates a new text field element define
+ + +
+ + +

Functions

+
+
+
+
+ # + Text._prototype_box:set_read_only ([state=true]) +
+
+
+
+ +

Sets the text box to be read only

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean) + + when false will set the state to false + + (default: true) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + table the define to allow for chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Text._prototype_box:set_selectable ([state=true]) +
+
+
+
+ +

Sets the text box to be selectable

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean) + + when false will set the state to false + + (default: true) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + table the define to allow for chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Text._prototype_box:set_word_wrap ([state=true]) +
+
+
+
+ +

Sets the text box to have word wrap

+

+ + + Parameters: + +
    + + + + + +
  • + + state + + : + + (boolean) + + when false will set the state to false + + (default: true) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + table the define to allow for chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Text.new_text_box ([name]) +
+
+
+
+ +

Creates a new text box element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new text box element define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Text.new_text_field ([name]) +
+
+
+
+ +

Creates a new text field element define

+

+ + + Parameters: + +
    + + + + + +
  • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the new text field element define +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.html b/doc/modules/expcore.gui.html index 810d6e38..0f532f46 100644 --- a/doc/modules/expcore.gui.html +++ b/doc/modules/expcore.gui.html @@ -1,119 +1,177 @@ - - - - - Reference + + + + + + + + expcore.gui module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.instances.html b/doc/modules/expcore.gui.instances.html index b379c6a8..f59a14e3 100644 --- a/doc/modules/expcore.gui.instances.html +++ b/doc/modules/expcore.gui.instances.html @@ -1,119 +1,177 @@ - - - - - Reference + + + + + + + + expcore.gui.instances module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.prototype.html b/doc/modules/expcore.gui.prototype.html new file mode 100644 index 00000000..764f364c --- /dev/null +++ b/doc/modules/expcore.gui.prototype.html @@ -0,0 +1,1399 @@ + + + + + + + + expcore.gui.prototype module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.prototype module

+

Used to create new gui prototypes see elements and concepts +[[

+

+ + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Constructor.event (event_name)Creates a new function to add functions to an event handler
Constructor.extend (new_prototype)Extents a prototype with the base functions of all gui prototypes, no metatables
Constructor.setter (value_type, key[, second_key])Creates a setter function that checks the type when a value is set
Constructor.store (sync, callback)Creates a new function which adds a store to a gui define
Prototype:clear_store ([category])Sets the value in this elements store to nil, category needed if categorize function used
Prototype:draw_to (element)The main function for defines, when called will draw an instance of this define to the given element + what is drawn is based on the data in draw_data which is set using other functions
Prototype:get_store (category)Gets the value in this elements store, category needed if categorize function used
Prototype:raise_event (event_name, ...)Raises a custom event for this define, any number of params can be given
Prototype:set_embeded_flow (boolean)Sets the element to be drawn inside a nameless flow, can be given a name using a function
Prototype:set_store (category, value)Sets the value in this elements store, category needed if categorize function used
Prototype:set_style (style[, function])Sets the style for the element define
Prototype:uid ()Gets the uid for the element define
+ + +

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Prototype.debug_nameSets a debug alias for the define
Prototype.on_drawRegisters a callback to the on_draw event
Prototype.on_style_updateRegisters a callback to the on_style_update event
Prototype.set_captionSets the caption for the element define
Prototype.set_post_authenticatorSets an authenticator that disables the element if check fails
Prototype.set_pre_authenticatorSets an authenticator that blocks the draw function if check fails
Prototype.set_tooltipSets the tooltip for the element define
+ + +
+ + +

Functions

+
+
+
+
+ # + Constructor.event (event_name) +
+
+
+
+ +

Creates a new function to add functions to an event handler

+

+ + + Parameters: + +
    + + + + + +
  • + + event_name + + : + + (string) + + the name of the event that callbacks will be added to + +
  • + + +
+ + + + + Returns: +
    +
  • + (function) + the function used to register handlers +
  • +
+ + + + + + + + + +
+
+
+
+ # + Constructor.extend (new_prototype) +
+
+
+
+ +

Extents a prototype with the base functions of all gui prototypes, no metatables

+

+ + + Parameters: + +
    + + + + + +
  • + + new_prototype + + : + + (table) + + the prototype that you want to add the functions to + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the same prototype but with the new functions added +
  • +
+ + + + + + + + + +
+
+
+
+ # + Constructor.setter (value_type, key[, second_key]) +
+
+
+
+ +

Creates a setter function that checks the type when a value is set

+

+ + + Parameters: + +
    + + + + + +
  • + + value_type + + : + + (string) + + the type that the value should be when it is set + +
  • + + + + + +
  • + + key + + : + + (string) + + the key of the define that will be set + +
  • + + + + + +
  • + + second_key + + : + + (string) + + allows for setting of a key in a sub table + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (function) + the function that will check the type and set the value +
  • +
+ + + + + + + + + +
+
+
+
+ # + Constructor.store (sync, callback) +
+
+
+
+ +

Creates a new function which adds a store to a gui define

+

+ + + Parameters: + +
    + + + + + +
  • + + sync + + : + + (boolean) + + if the function should create a synced store + +
  • + + + + + +
  • + + callback + + : + + (function) + + the function called when needing to update the value of an element + +
  • + + +
+ + + + + Returns: +
    +
  • + (function) + the function that will add a store for this define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:clear_store ([category]) +
+
+
+
+ +

Sets the value in this elements store to nil, category needed if categorize function used

+

+ + + Parameters: + +
    + + + + + +
  • + + category + + : + + (string) + + the category to get such as player name or force name + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if the value was set +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:draw_to (element) +
+
+
+
+ +

The main function for defines, when called will draw an instance of this define to the given element + what is drawn is based on the data in draw_data which is set using other functions

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the element that the define will draw a instance of its self onto + +
  • + + +
+ + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + Prototype:get_store (category) +
+
+
+
+ +

Gets the value in this elements store, category needed if categorize function used

+

+ + + Parameters: + +
    + + + + + +
  • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
  • + + +
+ + + + + Returns: +
    +
  • + (any) + the value that is stored for this define +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:raise_event (event_name, ...) +
+
+
+
+ +

Raises a custom event for this define, any number of params can be given

+

+ + + Parameters: + +
    + + + + + +
  • + + event_name + + : + + (string) + + the name of the event that you want to raise + +
  • + + + + + +
  • + + ... + + : + + (any) + + any params that you want to pass to the event + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of handlers that were registered +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:set_embeded_flow (boolean) +
+
+
+
+ +

Sets the element to be drawn inside a nameless flow, can be given a name using a function

+

+ + + Parameters: + +
    + + + + + +
  • + + boolean + + : + + (state) + + |function when true a padless flow is created to contain the element + +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the element define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:set_store (category, value) +
+
+
+
+ +

Sets the value in this elements store, category needed if categorize function used

+

+ + + Parameters: + +
    + + + + + +
  • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
  • + + + + + +
  • + + value + + : + + (any) + + the value to set for this define, must be valid for its type ie for checkbox etc + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if the value was set +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:set_style (style[, function]) +
+
+
+
+ +

Sets the style for the element define

+

+ + + Parameters: + +
    + + + + + +
  • + + style + + : + + (string) + + the style that will be used for this element when drawn + +
  • + + + + + +
  • + + function + + : + + (callback) + + function is called when element is drawn to alter its style + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (self) + the element define to allow chaining +
  • +
+ + + + + + + + + +
+
+
+
+ # + Prototype:uid () +
+
+
+
+ +

Gets the uid for the element define

+

+ + + + + + Returns: +
    +
  • + (string) + the uid of this element define +
  • +
+ + + + + + + + + +
+
+

Fields

+
+
+
+
+ # + Prototype.debug_name +
+
+
+
+ +

Sets a debug alias for the define

+

+ + + +
    + + + + + +
  • + + name + + : + + (string) + + the debug name for the element define that can be used to get this element define + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Prototype.on_draw +
+
+
+
+ +

Registers a callback to the on_draw event

+

+ + + +
    + + + + + +
  • + + callback + + : + + (function) + + + callback param - LuaPlayer player - the player that the element was drawn to + callback param - LuaGuiElement element - the element that was drawn + callback param - any ... - any other params passed by the draw_to function + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Prototype.on_style_update +
+
+
+
+ +

Registers a callback to the on_style_update event

+

+ + + +
    + + + + + +
  • + + callback + + : + + (function) + + + callback param - LuaStyle style - the style that was changed and/or needs changing + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Prototype.set_caption +
+
+
+
+ +

Sets the caption for the element define

+

+ + + +
    + + + + + +
  • + + caption + + : + + (string) + + the caption that will be drawn with the element + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Prototype.set_post_authenticator +
+
+
+
+ +

Sets an authenticator that disables the element if check fails

+

+ + + +
    + + + + + +
  • + + callback + + : + + (function) + + the function that will be ran to test if the element should be enabled or not + callback param - LuaPlayer player - the player that the element is being drawn to + callback param - string define_name - the name of the define that is being drawn + callback return - boolean - false will disable the element + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Prototype.set_pre_authenticator +
+
+
+
+ +

Sets an authenticator that blocks the draw function if check fails

+

+ + + +
    + + + + + +
  • + + callback + + : + + (function) + + the function that will be ran to test if the element should be drawn or not + callback param - LuaPlayer player - the player that the element is being drawn to + callback param - string define_name - the name of the define that is being drawn + callback return - boolean - false will stop the element from being drawn + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Prototype.set_tooltip +
+
+
+
+ +

Sets the tooltip for the element define

+

+ + + +
    + + + + + +
  • + + tooltip + + : + + (string) + + the tooltip that will be displayed for this element when drawn + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.test.html b/doc/modules/expcore.gui.test.html index be35af41..ed70b478 100644 --- a/doc/modules/expcore.gui.test.html +++ b/doc/modules/expcore.gui.test.html @@ -1,120 +1,178 @@ - - - - - Reference + + + + + + + + expcore.gui.test module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.permission_groups.html b/doc/modules/expcore.permission_groups.html index 33781f3f..8cd698de 100644 --- a/doc/modules/expcore.permission_groups.html +++ b/doc/modules/expcore.permission_groups.html @@ -1,660 +1,1208 @@ - - - - - Reference + + + + + + + + expcore.permission_groups module + + + - - + + -
+
+
-
- -
-
-
+ + + - - +
+
+
+ + + + diff --git a/doc/modules/expcore.roles.html b/doc/modules/expcore.roles.html index 493741d1..62196b24 100644 --- a/doc/modules/expcore.roles.html +++ b/doc/modules/expcore.roles.html @@ -1,1307 +1,2680 @@ - - - - - Reference + + + + + + + + expcore.roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + + + + + + + + + + + + +
+
+
+ # + Roles.unassign_player (player, roles[, by_player_name=][, silent=false]) +
+
+
+
+ +

Removes a player from the given role(s) with an option to pass a by player name used in the log

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will have the roles removed + +
  • + + + + + +
  • + + roles + + : + + (table) + + table a of roles to be removed from the player, can be one role and can be role names + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player that will be shown in the logs + + (default: ) +
  • + + + + + +
  • + + silent + + : + + (boolean) + + when true there will be no game message printed + + (default: false) +
  • + + +
+ + + + + + + + + + + + + +
+ + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.store.html b/doc/modules/expcore.store.html index 57e11bed..2da3fcf5 100644 --- a/doc/modules/expcore.store.html +++ b/doc/modules/expcore.store.html @@ -1,464 +1,755 @@ - - - - - Reference + + + + + + + + expcore.store module + + + - - + + -
+
+
-
- -
-
-
+ + + -

Returns:

-
    - - any - the value which was stored at that location -
- - - - - -
- - Store.set_child (location, child, value) -
-
- Sets the value of the chlid to a location, children can be added and removed during runtime - when a child is set it will call the update handler of the parent allowing children be to added at runtime - this may be used when a player joins the game and the child is the players name - - -

Parameters:

-
    -
  • location - string - the location of which the child is located -
  • -
  • child - string - the child element to set the value of -
  • -
  • value - any - the value to set at this location -
  • -
- -

Returns:

-
    - - boolean - true if it was successful -
- - - - -
- - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/expcore.sudo.html b/doc/modules/expcore.sudo.html new file mode 100644 index 00000000..3ad76193 --- /dev/null +++ b/doc/modules/expcore.sudo.html @@ -0,0 +1,177 @@ + + + + + + + + expcore.sudo module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.sudo module

+

An extention of task and token to allow a single require to register and run functions bypassing all permissions +[[

+

+ + + + + + + + + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/gui.player-list.html b/doc/modules/gui.player-list.html new file mode 100644 index 00000000..496ec30a --- /dev/null +++ b/doc/modules/gui.player-list.html @@ -0,0 +1,71 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module gui.player-list

+

Gui left frame define for a player list

+

+ + + +
+
+ + + + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/gui.rocket-info.html b/doc/modules/gui.rocket-info.html new file mode 100644 index 00000000..70702c2a --- /dev/null +++ b/doc/modules/gui.rocket-info.html @@ -0,0 +1,100 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module gui.rocket-info

+

Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets

+

+ + +

Fields

+ + + + + +
header_area.captionRight aligned button to toggle the section
+ +
+
+ + +

Fields

+ +
+
+ + header_area.caption +
+
+ Right aligned button to toggle the section + + + + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/gui.science-info.html b/doc/modules/gui.science-info.html new file mode 100644 index 00000000..105102cd --- /dev/null +++ b/doc/modules/gui.science-info.html @@ -0,0 +1,71 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module gui.science-info

+

Adds a science info gui that shows production usage and net for the different science packs as well as an eta

+

+ + + +
+
+ + + + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/gui.task-list.html b/doc/modules/gui.task-list.html new file mode 100644 index 00000000..8af36bc8 --- /dev/null +++ b/doc/modules/gui.task-list.html @@ -0,0 +1,71 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module gui.task-list

+

Adds a task list to the game which players can add remove and edit items on

+

+ + + +
+
+ + + + +
+
+
+generated by LDoc 1.4.3 +Last updated 2019-06-21 19:36:35 +
+
+ + diff --git a/doc/modules/modules.addons.advanced-start.html b/doc/modules/modules.addons.advanced-start.html index 771f4611..7ec422f5 100644 --- a/doc/modules/modules.addons.advanced-start.html +++ b/doc/modules/modules.addons.advanced-start.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + modules.addons.advanced-start module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/modules.addons.chat-popups.html b/doc/modules/modules.addons.chat-popups.html index b7f53d32..43d9bc83 100644 --- a/doc/modules/modules.addons.chat-popups.html +++ b/doc/modules/modules.addons.chat-popups.html @@ -1,119 +1,177 @@ - - - - - Reference + + + + + + + + modules.addons.chat-popups module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/modules.addons.damage-popups.html b/doc/modules/modules.addons.damage-popups.html index 7789ebd5..a3b0e92f 100644 --- a/doc/modules/modules.addons.damage-popups.html +++ b/doc/modules/modules.addons.damage-popups.html @@ -1,119 +1,177 @@ - - - - - Reference + + + + + + + + modules.addons.damage-popups module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/modules.gui.player-list.html b/doc/modules/modules.gui.player-list.html index 7fc8957c..adb53e5d 100644 --- a/doc/modules/modules.gui.player-list.html +++ b/doc/modules/modules.gui.player-list.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + modules.gui.player-list module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/modules.gui.rocket-info.html b/doc/modules/modules.gui.rocket-info.html index 310b86a0..36b05936 100644 --- a/doc/modules/modules.gui.rocket-info.html +++ b/doc/modules/modules.gui.rocket-info.html @@ -1,118 +1,226 @@ - - - - - Reference + + + + + + + + modules.gui.rocket-info module + + + - - + + -
+
+
-
- -
-
-
+ + + +
+
+ + + + diff --git a/doc/modules/modules.gui.science-info.html b/doc/modules/modules.gui.science-info.html index 8df96f38..6b35c790 100644 --- a/doc/modules/modules.gui.science-info.html +++ b/doc/modules/modules.gui.science-info.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + modules.gui.science-info module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/modules.gui.task-list.html b/doc/modules/modules.gui.task-list.html index a14412da..ff536f07 100644 --- a/doc/modules/modules.gui.task-list.html +++ b/doc/modules/modules.gui.task-list.html @@ -1,118 +1,176 @@ - - - - - Reference + + + + + + + + modules.gui.task-list module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/utils.alien_evolution_progress.html b/doc/modules/utils.alien_evolution_progress.html index a26633ee..debefdec 100644 --- a/doc/modules/utils.alien_evolution_progress.html +++ b/doc/modules/utils.alien_evolution_progress.html @@ -1,158 +1,253 @@ - - - - - Reference + + + + + + + + utils.alien_evolution_progress module + + + - - + + -
+
+
-
- -
-
-
+ + + +
+
+ + + + diff --git a/doc/modules/utils.core.html b/doc/modules/utils.core.html index 41b857d2..4283726e 100644 --- a/doc/modules/utils.core.html +++ b/doc/modules/utils.core.html @@ -1,452 +1,959 @@ - - - - - Reference + + + + + + + + utils.core module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + + + + + + + + + + + + + + + + + +
+
+
+ # + Event.on_nth_tick (tick, handler) +
+
+
+
+ +

Register a handler for the nth_tick event.

+

+ This function must be called in the control stage or in Event.on_init or Event.on_load. + See documentation at top of file for details on using events.

+ + + Parameters: + +
    + + + + + +
  • + + tick + + : + + + The handler will be called every nth tick + +
  • + + + + + +
  • + + handler + + : + + + + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Event.remove_removable (event_name, token) +
+
+
+
+ +

Removes a token handler for the given event_name.

+

+ Do NOT call this method during on_load. + See documentation at top of file for details on using events.

+ + + Parameters: + +
    + + + + + +
  • + + event_name + + : + + + + +
  • + + + + + +
  • + + token + + : + + + + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Event.remove_removable_function (event_name, func) +
+
+
+
+ +

Removes a handler for the given event_name.

+

+ Do NOT call this method during on_load. + See documentation at top of file for details on using events.

+ + + Parameters: + +
    + + + + + +
  • + + event_name + + : + + + + +
  • + + + + + +
  • + + func + + : + + + + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Event.remove_removable_nth_tick (tick, token) +
+
+
+
+ +

Removes a token handler for the nth tick.

+

+ Do NOT call this method during on_load. + See documentation at top of file for details on using events.

+ + + Parameters: + +
    + + + + + +
  • + + tick + + : + + + + +
  • + + + + + +
  • + + token + + : + + + + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + Event.remove_removable_nth_tick_function (tick, func) +
+
+
+
+ +

Removes a handler for the nth tick.

+

+ Do NOT call this method during on_load. + See documentation at top of file for details on using events.

+ + + Parameters: + +
    + + + + + +
  • + + tick + + : + + + + +
  • + + + + + +
  • + + func + + : + + + + +
  • + + +
+ + + + + + + + + + + + + +
+ + + + +
+
+
+ + + + diff --git a/doc/modules/utils.event_core.html b/doc/modules/utils.event_core.html index c0f45322..014b67d4 100644 --- a/doc/modules/utils.event_core.html +++ b/doc/modules/utils.event_core.html @@ -1,204 +1,365 @@ - - - - - Reference + + + + + + + + utils.event_core module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + + + + + + +
  • + + handler + + + + + +
  • + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + diff --git a/doc/modules/utils.math.html b/doc/modules/utils.math.html index 2760964b..9344ce7a 100644 --- a/doc/modules/utils.math.html +++ b/doc/modules/utils.math.html @@ -1,161 +1,269 @@ - - - - - Reference + + + + + + + + utils.math module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - + , y numbers - coordinates of point on line + + + + + + + +
  • + + slope + + : + + + number - the slope of a line + +
  • + + + + + + + + Returns: +
      +
    • + number - the y-intercept of a line +
    • +
    + + + + + + + + + + + + + + +
    +
    +
    + + + + diff --git a/doc/modules/utils.recipe_locker.html b/doc/modules/utils.recipe_locker.html index 756989d6..8ab1a079 100644 --- a/doc/modules/utils.recipe_locker.html +++ b/doc/modules/utils.recipe_locker.html @@ -1,155 +1,250 @@ - - - - - Reference + + + + + + + + utils.recipe_locker module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + -
    -generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
    -
    - - +
    +
    +
    + + + + diff --git a/doc/modules/utils.table.html b/doc/modules/utils.table.html index cfe0c528..40a68aee 100644 --- a/doc/modules/utils.table.html +++ b/doc/modules/utils.table.html @@ -1,583 +1,1271 @@ - - - - - Reference + + + + + + + + utils.table module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + +
    +
    + + + + diff --git a/doc/modules/utils.timestamp.html b/doc/modules/utils.timestamp.html index e2b2a781..c8029390 100644 --- a/doc/modules/utils.timestamp.html +++ b/doc/modules/utils.timestamp.html @@ -1,217 +1,373 @@ - - - - - Reference + + + + + + + + utils.timestamp module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + +
    diff --git a/doc/modules/config._file_loader.html b/doc/modules/config._file_loader.html index 21cb995d..28a9566a 100644 --- a/doc/modules/config._file_loader.html +++ b/doc/modules/config._file_loader.html @@ -40,6 +40,7 @@
    diff --git a/doc/modules/config.action_buttons.html b/doc/modules/config.action_buttons.html index d04dd7ff..2146ea2a 100644 --- a/doc/modules/config.action_buttons.html +++ b/doc/modules/config.action_buttons.html @@ -40,6 +40,7 @@
    diff --git a/doc/modules/config.advanced_start.html b/doc/modules/config.advanced_start.html index be131271..2574c559 100644 --- a/doc/modules/config.advanced_start.html +++ b/doc/modules/config.advanced_start.html @@ -40,6 +40,7 @@ - - @@ -351,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html index 461b1085..227a2701 100644 --- a/docs/addons/Chat-Reply.html +++ b/docs/addons/Chat-Reply.html @@ -70,12 +70,10 @@ - - @@ -378,7 +376,7 @@ generated by LDoc diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html index 69e05991..dc49b78b 100644 --- a/docs/addons/Compilatron.html +++ b/docs/addons/Compilatron.html @@ -71,12 +71,10 @@ - - @@ -587,7 +585,7 @@ generated by LDoc diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html index b23f36ff..c5d5f078 100644 --- a/docs/addons/Damage-Popups.html +++ b/docs/addons/Damage-Popups.html @@ -70,12 +70,10 @@ - - @@ -351,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html index 970986a7..71cc9bde 100644 --- a/docs/addons/Death-Logger.html +++ b/docs/addons/Death-Logger.html @@ -70,12 +70,10 @@ - - @@ -406,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html index ce786d86..27d0af48 100644 --- a/docs/addons/Discord-Alerts.html +++ b/docs/addons/Discord-Alerts.html @@ -70,12 +70,10 @@ - - @@ -462,7 +460,7 @@ generated by LDoc diff --git a/docs/addons/Player-Colours.html b/docs/addons/Player-Colours.html index be4036df..7d67adeb 100644 --- a/docs/addons/Player-Colours.html +++ b/docs/addons/Player-Colours.html @@ -70,12 +70,10 @@ - - @@ -406,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html index 9c0a334d..d488a111 100644 --- a/docs/addons/Pollution-Grading.html +++ b/docs/addons/Pollution-Grading.html @@ -70,12 +70,10 @@ - - @@ -322,7 +320,7 @@ generated by LDoc diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html index 69be957b..55bea826 100644 --- a/docs/addons/Scorched-Earth.html +++ b/docs/addons/Scorched-Earth.html @@ -70,12 +70,10 @@ - - @@ -406,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html index 7be892ff..13dfba39 100644 --- a/docs/addons/Spawn-Area.html +++ b/docs/addons/Spawn-Area.html @@ -70,12 +70,10 @@ - - @@ -378,7 +376,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html index 59344610..731be00d 100644 --- a/docs/commands/Admin-Chat.html +++ b/docs/commands/Admin-Chat.html @@ -80,12 +80,10 @@ - - @@ -390,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Bonus.html b/docs/commands/Bonus.html index fc584a2e..d49279c2 100644 --- a/docs/commands/Bonus.html +++ b/docs/commands/Bonus.html @@ -80,12 +80,10 @@ - - @@ -502,7 +500,7 @@ generated by LDoc diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html index 7bafc60e..accc40eb 100644 --- a/docs/commands/Cheat-Mode.html +++ b/docs/commands/Cheat-Mode.html @@ -80,12 +80,10 @@ - - @@ -363,7 +361,7 @@ generated by LDoc diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html index bf601ad5..e20883e3 100644 --- a/docs/commands/Clear-Inventory.html +++ b/docs/commands/Clear-Inventory.html @@ -80,12 +80,10 @@ - - @@ -390,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html index 532efa99..af847b74 100644 --- a/docs/commands/Debug.html +++ b/docs/commands/Debug.html @@ -80,12 +80,10 @@ - - @@ -367,7 +365,7 @@ generated by LDoc diff --git a/docs/commands/Find.html b/docs/commands/Find.html index 17fec9b6..fc61f8cf 100644 --- a/docs/commands/Find.html +++ b/docs/commands/Find.html @@ -80,12 +80,10 @@ - - @@ -362,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Help.html b/docs/commands/Help.html index 0122b470..c5d73042 100644 --- a/docs/commands/Help.html +++ b/docs/commands/Help.html @@ -80,12 +80,10 @@ - - @@ -406,7 +404,7 @@ generated by LDoc diff --git a/docs/commands/Home.html b/docs/commands/Home.html index 793b64f4..05da9559 100644 --- a/docs/commands/Home.html +++ b/docs/commands/Home.html @@ -80,12 +80,10 @@ - - @@ -460,7 +458,7 @@ generated by LDoc diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html index 1e467b7b..bc2e0590 100644 --- a/docs/commands/Interface.html +++ b/docs/commands/Interface.html @@ -80,12 +80,10 @@ - - @@ -418,7 +416,7 @@ generated by LDoc diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html index 238e0248..6ff4802e 100644 --- a/docs/commands/Jail.html +++ b/docs/commands/Jail.html @@ -80,12 +80,10 @@ - - @@ -613,7 +611,7 @@ generated by LDoc diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html index 2f3a42d3..a16c18b0 100644 --- a/docs/commands/Kill.html +++ b/docs/commands/Kill.html @@ -80,12 +80,10 @@ - - @@ -391,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Me.html b/docs/commands/Me.html index 24b64a87..2f8cb3f4 100644 --- a/docs/commands/Me.html +++ b/docs/commands/Me.html @@ -80,12 +80,10 @@ - - @@ -362,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html index d921f1ef..83127954 100644 --- a/docs/commands/Rainbow.html +++ b/docs/commands/Rainbow.html @@ -80,12 +80,10 @@ - - @@ -390,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html index b6f8113b..dfc8fde0 100644 --- a/docs/commands/Repair.html +++ b/docs/commands/Repair.html @@ -79,12 +79,10 @@ - - @@ -323,7 +321,7 @@ generated by LDoc diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html index d51b8af1..bb852d95 100644 --- a/docs/commands/Reports.html +++ b/docs/commands/Reports.html @@ -80,12 +80,10 @@ - - @@ -587,7 +585,7 @@ generated by LDoc diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html index acf6971f..338a0c5e 100644 --- a/docs/commands/Roles.html +++ b/docs/commands/Roles.html @@ -80,12 +80,10 @@ - - @@ -559,7 +557,7 @@ generated by LDoc diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html index a940c112..9eba8a8f 100644 --- a/docs/commands/Spawn.html +++ b/docs/commands/Spawn.html @@ -80,12 +80,10 @@ - - @@ -391,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Tag.html b/docs/commands/Tag.html index bafc6f14..b8609e4a 100644 --- a/docs/commands/Tag.html +++ b/docs/commands/Tag.html @@ -80,12 +80,10 @@ - - @@ -445,7 +443,7 @@ generated by LDoc diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html index 2afdbc08..eeed3aa0 100644 --- a/docs/commands/Teleport.html +++ b/docs/commands/Teleport.html @@ -80,12 +80,10 @@ - - @@ -486,7 +484,7 @@ generated by LDoc diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html index adabade7..337f8b93 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -80,12 +80,10 @@ - - @@ -571,7 +569,7 @@ generated by LDoc diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index 3f5c06a8..72c02f54 100644 --- a/docs/configs/Advanced-Start.html +++ b/docs/configs/Advanced-Start.html @@ -85,12 +85,10 @@ - - @@ -508,7 +506,7 @@ generated by LDoc diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html index e04bc9e6..31d8e33c 100644 --- a/docs/configs/Bonuses.html +++ b/docs/configs/Bonuses.html @@ -77,12 +77,10 @@ - - @@ -239,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html index 17898132..da119978 100644 --- a/docs/configs/Chat-Reply.html +++ b/docs/configs/Chat-Reply.html @@ -86,12 +86,10 @@ - - @@ -487,7 +485,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html index e9d41e16..fa578e05 100644 --- a/docs/configs/Commands-Auth-Admin.html +++ b/docs/configs/Commands-Auth-Admin.html @@ -85,12 +85,10 @@ - - @@ -296,7 +294,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html index ed8de360..2e83f8aa 100644 --- a/docs/configs/Commands-Auth-Roles.html +++ b/docs/configs/Commands-Auth-Roles.html @@ -85,12 +85,10 @@ - - @@ -322,7 +320,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html index b74be123..e908fa8c 100644 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ b/docs/configs/Commands-Auth-Runtime-Disable.html @@ -86,12 +86,10 @@ - - @@ -444,7 +442,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html index 3cd75126..3206b122 100644 --- a/docs/configs/Commands-Parse-Roles.html +++ b/docs/configs/Commands-Parse-Roles.html @@ -85,12 +85,10 @@ - - @@ -356,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html index 454432dc..14f65272 100644 --- a/docs/configs/Commands-Parse.html +++ b/docs/configs/Commands-Parse.html @@ -85,12 +85,10 @@ - - @@ -340,7 +338,7 @@ see ./expcore/commands.lua for more details

    generated by LDoc diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html index 7f9f5bae..2d0f47b4 100644 --- a/docs/configs/Compilatron.html +++ b/docs/configs/Compilatron.html @@ -85,12 +85,10 @@ - - @@ -356,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html index 3df18979..f03d13cd 100644 --- a/docs/configs/Death-Logger.html +++ b/docs/configs/Death-Logger.html @@ -85,12 +85,10 @@ - - @@ -418,7 +416,7 @@ generated by LDoc diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html index 307fba0d..e7cc6d8b 100644 --- a/docs/configs/Discord-Alerts.html +++ b/docs/configs/Discord-Alerts.html @@ -77,12 +77,10 @@ - - @@ -239,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html index 8dd2e4d2..25d76c3b 100644 --- a/docs/configs/File-Loader.html +++ b/docs/configs/File-Loader.html @@ -77,12 +77,10 @@ - - @@ -242,7 +240,7 @@ generated by LDoc diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html index c748144f..5798d322 100644 --- a/docs/configs/Permission-Groups.html +++ b/docs/configs/Permission-Groups.html @@ -85,12 +85,10 @@ - - @@ -297,7 +295,7 @@ generated by LDoc diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html index f416997b..28764dd5 100644 --- a/docs/configs/Player-List.html +++ b/docs/configs/Player-List.html @@ -86,12 +86,10 @@ - - @@ -814,7 +812,7 @@ generated by LDoc diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html index bd47979f..3f407af5 100644 --- a/docs/configs/Pollution-Grading.html +++ b/docs/configs/Pollution-Grading.html @@ -85,12 +85,10 @@ - - @@ -386,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html index 8f84f684..e217cb89 100644 --- a/docs/configs/Popup-Messages.html +++ b/docs/configs/Popup-Messages.html @@ -85,12 +85,10 @@ - - @@ -416,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html index e49269ee..6ded0dd1 100644 --- a/docs/configs/Preset-Player-Colours.html +++ b/docs/configs/Preset-Player-Colours.html @@ -85,12 +85,10 @@ - - @@ -326,7 +324,7 @@ generated by LDoc diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html index ff7b2189..04430dd7 100644 --- a/docs/configs/Repair.html +++ b/docs/configs/Repair.html @@ -85,12 +85,10 @@ - - @@ -416,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html index 15088476..2a142796 100644 --- a/docs/configs/Rockets.html +++ b/docs/configs/Rockets.html @@ -85,12 +85,10 @@ - - @@ -836,7 +834,7 @@ generated by LDoc diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html index 6cc0063b..3fbacb0e 100644 --- a/docs/configs/Roles.html +++ b/docs/configs/Roles.html @@ -85,12 +85,10 @@ - - @@ -294,7 +292,7 @@ generated by LDoc diff --git a/docs/configs/Science.html b/docs/configs/Science.html index a85612a6..873dbf53 100644 --- a/docs/configs/Science.html +++ b/docs/configs/Science.html @@ -85,12 +85,10 @@ - - @@ -356,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html index f9888961..5f2f2131 100644 --- a/docs/configs/Scorched-Earth.html +++ b/docs/configs/Scorched-Earth.html @@ -85,12 +85,10 @@ - - @@ -390,7 +388,7 @@ generated by LDoc diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html index fec2403b..ebefadb6 100644 --- a/docs/configs/Spawn-Area.html +++ b/docs/configs/Spawn-Area.html @@ -85,12 +85,10 @@ - - @@ -746,7 +744,7 @@ generated by LDoc diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html index 43bdb919..2ea51a33 100644 --- a/docs/configs/Tasks.html +++ b/docs/configs/Tasks.html @@ -85,12 +85,10 @@ - - @@ -386,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html index d5b14073..1971da7d 100644 --- a/docs/configs/Warnings.html +++ b/docs/configs/Warnings.html @@ -85,12 +85,10 @@ - - @@ -357,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html index 3fb7f77f..c90c3b4f 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -85,12 +85,10 @@ - - @@ -686,7 +684,7 @@ generated by LDoc diff --git a/docs/control/Jail.html b/docs/control/Jail.html index a6acc5ce..8b2073fa 100644 --- a/docs/control/Jail.html +++ b/docs/control/Jail.html @@ -69,12 +69,10 @@ - - @@ -1210,7 +1208,7 @@ generated by LDoc diff --git a/docs/control/Production.html b/docs/control/Production.html index 53874e4d..cfc5135f 100644 --- a/docs/control/Production.html +++ b/docs/control/Production.html @@ -69,12 +69,10 @@ - - @@ -1331,7 +1329,7 @@ generated by LDoc diff --git a/docs/control/Reports.html b/docs/control/Reports.html index 67fb2864..02a29320 100644 --- a/docs/control/Reports.html +++ b/docs/control/Reports.html @@ -69,12 +69,10 @@ - - @@ -1112,7 +1110,7 @@ generated by LDoc diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html index 4d560f6f..4cd079d7 100644 --- a/docs/control/Rockets.html +++ b/docs/control/Rockets.html @@ -68,12 +68,10 @@ - - @@ -986,7 +984,7 @@ generated by LDoc diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html index f37fc0d6..0a82275c 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -68,12 +68,10 @@ - - @@ -1041,7 +1039,7 @@ generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index 38998a09..cca92779 100644 --- a/docs/control/Warnings.html +++ b/docs/control/Warnings.html @@ -68,12 +68,10 @@ - - @@ -1467,7 +1465,7 @@ generated by LDoc diff --git a/docs/control/Warps.html b/docs/control/Warps.html index fca4cb74..4af6171d 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -69,12 +69,10 @@ - - @@ -1415,7 +1413,7 @@ generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index 590f6080..b6e82a2c 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -57,12 +57,10 @@ - - @@ -1974,7 +1972,7 @@ generated by LDoc diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html index 6f6e5c02..ee9e8780 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -53,12 +53,10 @@ - - @@ -2748,7 +2746,7 @@ Common.table_insert(tbl,50,tbl2) generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index 9524e47e..6533ff0e 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -41,17 +41,22 @@ @@ -62,12 +67,10 @@ - - @@ -213,17 +216,22 @@ @@ -243,7 +251,11 @@

    Gui core

    -

    Core Module - Gui

    +

    Core Module - Gui + - This file is used to require all the different elements of the gui module + - each module has an outline here but for more details see their separate files in ./gui + - please read the files for more documentation that cant be shown here + - please note there is a rework planned but not started

    @@ -251,69 +263,6 @@ -

    Usage

    -
    -- Making the base button concept
    -local button =
    -Gui.new_concept() -- Make a new empty concept
    -:save_as('button') -- Save it as Gui.concepts.button so it can be used in other files
    -:new_event('on_click',defines.events.on_gui_click) -- Add an on click event for this concept
    -:new_property('tooltip') -- Add a property with the default setter method called tooltip
    -:new_property('caption',function(properties,value) -- Add a property with a custom setter method called caption
    -    properties.caption = value
    -    properties.sprite = nil
    -    properties.type = 'button'
    -end)
    -:new_property('sprite',function(properties,value) -- Add a property with a custom setter method called sprite
    -    properties.image = value
    -    properties.caption = nil
    -    properties.type = 'sprite-button'
    -end)
    -:define_draw(function(properties,parent,element) -- Add the draw function to create the element from the concept
    -    -- Properties will include all the information that you need to draw the element
    -    -- Parent is the parent element for the element, this may have been altered by previous draw functions
    -    -- Element is the current element being made, this may have a nil value, if it is nil then this is the first draw function
    -    if properties.type == 'button' then
    -        element = parent.add{
    -            type = properties.type,
    -            name = properties.name,
    -            caption = properties.caption,
    -            tooltip = properties.tooltip
    -        }
    -
    -    else
    -        element = parent.add{
    -            type = properties.type,
    -            name = properties.name,
    -            sprite = properties.sprite,
    -            tooltip = properties.tooltip
    -        }
    -
    -    end
    -
    -    -- If you return element or parent then their values will be updated for the next draw function in the chain
    -    -- It is best practice to always return the values if you have made any changes to them
    -    return element, parent
    -end)
    -
    -- Making a new button which has a custom style
    -local custom_button =
    -Gui.new_concept('button') -- We can use button here since we used save as on the concept
    --- button:clone() -- If we had not used save as then this is how we would use it as a base
    -:set_caption('Custom Button') -- Set the caption of the concept, this is possible as we added caption as a property
    -:set_tooltip('Only admins can press this button') -- Set the tooltip of the concept, this is possible as we added tooltip as a property
    -:on_click(function(event) -- Register a handler to the click event we added with new event
    -    if not event.player.admin then
    -        event.player.print('You must be admin to use this button')
    -    end
    -end)
    -:new_event('on_admin_clicked',defines.events.on_gui_click,function(event) -- Add a click event which has a filter function
    -    return event.player.admin -- Check if the player is admin
    -end)
    -:on_admin_clicked(function(event) -- Register a handler to the admin click event we have just created
    -    -- The admin click event is only an example, because of how sinmple the filter is we could have just used an if else statement
    -    game.print(event.player.name..' pressed my admin button')
    -end)
    -
    -- Drawing a concept
    -custom_button:draw(game.player.gui.left)
    @@ -321,69 +270,461 @@ Gui.new_concept('button') -- W -

    Elements

    +

    Dependencies

    - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + + + +
    buttonClickable elements that fire on_gui_click when clicked.expcore.gui.core
    checkboxClickable elements with a cross in the middle that can be turned off or on.expcore.gui.instances
    dropdownA drop down list of other elements.expcore.gui.elements.buttons
    elem_buttonA button that lets the player pick one of an: item, entity, tile, or signal similar to the filter-select window.expcore.gui.elements.checkbox
    emptyA empty widget that just exists.expcore.gui.elements.dropdown
    flowInvisible containers that lay out children either horizontally or vertically.expcore.gui.elements.slider
    frameGrey semi-transparent boxes that contain other elements.expcore.gui.elements.text
    labelA piece of text.expcore.gui.elements.elem-button
    lineA vertical or horizontal line.expcore.gui.elements.progress-bar
    progress_barIndicate progress by displaying a partially filled bar.expcore.gui.concepts.toolbar
    scrollSimilar to a flow but includes the ability to show and use scroll bars.expcore.gui.concepts.left
    sliderA number picker.expcore.gui.concepts.center
    tableAn invisible container that lays out children in a specific number of columns.expcore.gui.concepts.popups
    + + +

    Center Guis

    + + + + + - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    expcore.gui.core
    text_boxA multi-line text box that supports selection and copy-paste.expcore.gui.prototype
    text_fieldBoxes of text the user can type in.expcore.gui.concepts.toolbar
    utils.game
    CenterFrames.get_flow(player)Gets the center flow for a player
    CenterFrames.clear_flow(player)Clears the center flow for a player
    CenterFrames.draw_frame(player, name)Draws the center frame for a player, if already open then will do nothing
    CenterFrames.redraw_frame(player, name)Draws the center frame for a player, if already open then will destroy it and redraw
    CenterFrames.toggle_frame(player, name[, state])Toggles if the frame is currently open or not, will open if closed and close if open
    CenterFrames.new_frame(permission_name)Creates a new center frame define
    CenterFrames._prototype:set_auto_focus([state=true])Sets the frame to be the current active gui when opened and closes all other frames
    CenterFrames._prototype:draw_frame(player)Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)
    CenterFrames._prototype:redraw_frame(player)Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)
    CenterFrames._prototype:toggle_frame(player)Toggles if the frame is open, if open it will close it and if closed it will open it
    CenterFrames._prototype:event_handler([action=update])Creates an event handler that will trigger one of its functions, use with Event.add
    + + +

    Left Guis

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    expcore.gui.core
    expcore.gui.prototype
    expcore.gui.concepts.toolbar
    expcore.gui.elements.buttons
    mod-gui
    utils.game
    utils.event
    LeftFrames.get_flow(player)Gets the left frame flow for a player
    LeftFrames.get_frame(name, player)Gets one frame from the left flow by its name
    LeftFrames.get_open(player)Gets all open frames for a player, if non are open it will remove the close all button
    LeftFrames.toggle_frame(name, player[, state])Toggles the visibility of a left frame, or sets its visibility state
    LeftFrames.new_frame(permission_name)Creates a new left frame define
    LeftFrames._prototype:set_open_by_default([state=true])Sets if the frame is visible when a player joins, can also be a function to return a boolean
    LeftFrames._prototype:set_direction(direction)Sets the direction of the frame, either vertical or horizontal
    LeftFrames._prototype:_internal_draw(player)Creates the gui for the first time, used internally
    LeftFrames._prototype:get_frame(player)Gets the frame for this define from the left frame flow
    LeftFrames._prototype:is_open(player)Returns if the player currently has this define visible
    LeftFrames._prototype:toggle(player)Toggles the visibility of the left frame
    LeftFrames._prototype:update(player)Updates the contents of the left frame, first tries update callback, other wise will clear and redraw
    LeftFrames._prototype:update_all([update_offline=false])Updates the frame for all players, see update
    LeftFrames._prototype:redraw(player)Redraws the frame by calling on_draw, will always clear the frame
    LeftFrames._prototype:redraw_all([update_offline=false])Redraws the frame for all players, see redraw
    LeftFrames._prototype:event_handler([action=update])Creates an event handler that will trigger one of its functions, use with Event.add
    + + +

    Popups

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    expcore.gui.core
    expcore.gui.prototype
    utils.game
    utils.event
    expcore.gui.elements.progress-bar
    expcore.gui.elements.buttons
    mod-gui
    resources.color_presets
    utils.global
    PopupFrames.get_flow(player)Gets the left flow that contains the popup frames
    PopupFrames.open(define_name, player[, open_time], ...)Opens a popup for the player, can give the amount of time it is open as well as params for the draw function
    PopupFrames.close_progressProgress bar which when depleted will close the popup frame
    PopupFrames.close_buttonA button which can be used to close the gui before the timer runs out
    PopupFrames.new_popup([name])Creates a new popup frame define
    PopupFrames._prototype:set_default_open_time(amount)Sets the default open time for the popup, will be used if non is provided with open
    PopupFrames._prototype:open(player[, open_time], ...)Opens this define for a player, can be given open time and any other params for the draw function
    + + +

    Toolbar

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    expcore.gui.core
    expcore.gui.elements.buttons
    expcore.roles
    utils.event
    utils.game
    mod-gui
    Toolbar.new_button([name])Adds a new button to the toolbar
    Toolbar.add_button(button)Adds an existing buttton to the toolbar
    Toolbar.update(player)Updates the player's toolbar with an new buttons or expected change in auth return
    + + +

    Core

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    utils.gui
    utils.game
    new_define(prototype[, debug_name])Used to create new element defines from a class prototype, please use the own given by the class
    get_define(name[, internal])Gets an element define give the uid, debug name or a copy of the element define
    categorize_by_player(element)A categorize function to be used with add_store, each player has their own value
    categorize_by_force(element)A categorize function to be used with add_store, each force has its own value
    categorize_by_surface(element)A categorize function to be used with add_store, each surface has its own value
    draw(name, element)Draws a copy of the element define to the parent element, see draw_to
    toggle_enabled(element)Will toggle the enabled state of an element
    toggle_visible(element)Will toggle the visiblity of an element
    set_padding(element[, up=0][, down=0][, left=0][, right=0])Sets the padding for a gui element
    set_padding_style(style[, up=0][, down=0][, left=0][, right=0])Sets the padding for a gui style
    create_alignment(element[, name][, horizontal_align='right'][, vertical_align='center'])Allows the creation of an alignment flow to place elements into
    destroy_if_valid(element)Destroies an element but tests for it being present and valid first
    create_scroll_table(element, table_size, maximal_height[, name='scroll'])Creates a scroll area with a table inside, table can be any size
    create_header(element, caption[, tooltip][, right_align][, name='header'])Creates a header section with a label and button area
    + + +

    Buttons

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    mod-gui
    expcore.gui.core
    expcore.gui.prototype
    Button.new_button([name])Creates a new button element define
    Button._prototype:set_sprites(sprite[, hovered_sprite][, clicked_sprite])Adds sprites to a button making it a sprite button
    Button._prototype:set_click_filter(filter[, ...])Adds a click / mouse button filter to the button
    Button._prototype:set_key_filter(filter[, ...])Adds a control key filter to the button
    + + +

    Checkboxs

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    expcore.gui.core
    expcore.gui.prototype
    expcore.store
    utils.game
    Checkbox.new_checkbox([name])Creates a new checkbox element define
    Checkbox.new_radiobutton([name])Creates a new radiobutton element define, has all functions checkbox has
    Checkbox._prototype_radiobutton:add_as_option(option_set, option_name)Adds this radiobutton to be an option in the given option set (only one can be true at a time)
    Checkbox._prototype_radiobutton:get_store(category, internal)Gets the stored value of the radiobutton or the option set if present
    Checkbox._prototype_radiobutton:set_store(category, value, internal)Sets the stored value of the radiobutton or the option set if present
    Checkbox.new_option_set(name, callback, categorize)Registers a new option set that can be linked to radiobuttons (only one can be true at a time)
    Checkbox.draw_option_set(name, element)Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)
    Checkbox.reset_radiobuttons(element[, exclude][, recursive=false])Sets all radiobutton in a element to false (unless excluded) and can act recursively
    @@ -394,16 +735,70 @@ Gui.new_concept('button') -- W - set_dropdown_value(element, value) - Selects the index of a dropdown with this value + expcore.gui.core - get_dropdown_value(element) - Gets the selected item value of a dropdown + expcore.gui.prototype - add_dropdown_items(element[, start_index], new_items) - Adds the given items into the list of items for this dropdown + utils.game + + + Dropdown.new_dropdown([name]) + Creates a new dropdown element define + + + Dropdown.new_list_box([name]) + Creates a new list box element define + + + Dropdown._prototype:new_static_options(options[, ...], the) + Adds new static options to the dropdown which will trigger the general callback + + + Dropdown._prototype:new_dynamic_options(callback) + Adds a callback which should return a table of values to be added as options for the dropdown (appended after static options) + + + Dropdown._prototype:add_option_callback(option, callback) + Adds a case specific callback which will only run when that option is selected (general case still triggered) + + + Dropdown.select_value(element, value) + Selects the option from a dropdown or list box given the value rather than key + + + Dropdown.get_selected_value(element) + Returns the currently selected value rather than index + + + + + +

    Elem Buttons

    + + + + + + + + + + + + + + + + + + + + + + +
    expcore.gui.core
    expcore.gui.prototype
    utils.game
    ElemButton.new_elem_button([name])Creates a new elem button element define
    ElemButton._prototype.set_typeSets the type of the elem button, the type is required so this must be called at least once
    ElemButton._prototype:set_default(value)Sets the default value for the elem button, this may be a function or a string
    @@ -414,248 +809,306 @@ Gui.new_concept('button') -- W - progress_bar:increment(element[, amount=1]) - Will increase the progress of a progress bar based on this concept, if the concept has an instance store then element acts as the category, if you have a combined store it will NOT update all instances + expcore.gui.core - progress_bar:decrement(element[, amount=1]) - Will decrease the progress of a progress bar based on this concept, if the concept has an instance store then element acts as the category, if you have a combined store it will NOT update all instances + expcore.gui.prototype - progress_bar:reset(element) - Resets the progress back to 0% for this element, if the concept has an instance store then element acts as the category, if you have a combined store it will NOT update all instances + utils.global - increment_progress_bar(element[, amount=0.01]) - Increment any progress bar by the given percentage + utils.game - decrement_progress_bar(element[, amount=0.01]) - Decrement any progress bar by the given percentage + ProgressBar.set_maximum(element, amount) + Sets the maximum value that represents the end value of the progress bar + + + ProgressBar.increment(element[, amount=1]) + Increases the value of the progressbar, if a define is given all of its instances have incremented + + + ProgressBar.decrement(element[, amount=1]) + Decreases the value of the progressbar, if a define is given all of its instances have decremented + + + ProgressBar.new_progressbar([name]) + Creates a new progressbar element define + + + ProgressBar._prototype:set_default_maximum(amount) + Sets the maximum value that represents the end value of the progress bar + + + ProgressBar._prototype:use_count_down([state=true]) + Will set the progress bar to start at 1 and trigger when it hits 0 + + + ProgressBar._prototype:increment([amount=1][, category]) + Increases the value of the progressbar + + + ProgressBar._prototype:increment_filtered([amount=1], filter) + Increases the value of the progressbar, if the filter condition is met, does not work with store + + + ProgressBar._prototype:decrement([amount=1][, category]) + Decreases the value of the progressbar + + + ProgressBar._prototype:decrement_filtered([amount=1], filter) + Decreases the value of the progressbar, if the filter condition is met, does not work with store + + + ProgressBar._prototype:add_element(element[, maximum]) + Adds an element into the list of instances that will are waiting to complete, does not work with store + note use store if you want persistent data, this only stores the elements not the values which they have + + + ProgressBar._prototype:reset_element(element) + Resets an element, or its store, to be back at the start, either 1 or 0 + + + ProgressBar._prototype:event_counter([filter]) + Event handler factory that counts up by 1 every time the event triggers, can filter which elements have incremented + + + ProgressBar._prototype:event_countdown([filter]) + Event handler factory that counts down by 1 every time the event triggers, can filter which elements have decremented -

    Concept Control

    +

    Sliders

    - - + - - + - - + - - + - - + + - - + + + + + + + + + +
    require_concept(concept_name)Loads a concept from the concepts fileexpcore.gui.core
    require_style(style_name)Loads a set of concepts from the styles fileexpcore.gui.prototype
    get_concept(name)Gets a gui concept from name, id, or its selfexpcore.gui.instances
    Prototype:save_as(save_name)Used to save the concept to the main gui module to allow access from other filesutils.game
    new_concept([base_concept])Returns a new gui concept, option to provide a base concept to copy properties and draw functions fromSlider.new_slider([name])Creates a new slider element define
    draw_concept(concept, parent)Used to draw a concept to a parent elementSlider._prototype:set_range([min][, max])Sets the range of a slider, if not used will use default values for a slider
    Slider._prototype:draw_label(element)Draws a new label and links its value to the value of this slider, if no store then it will only show one value per player
    Slider._prototype:enable_auto_draw_label([state=true])Enables auto draw of the label, the label will share the same parent element as the slider
    -

    Element Control

    +

    Text

    - - + - - + - - + - - + + - - + + - - + + - - + + - - + +
    get_player_from_element(element)Gets the player who owns this elementexpcore.gui.core
    valid(element)Simple check for if an element is validexpcore.gui.prototype
    destroy(element)Destroies and element if it is validutils.game
    find(element, ...)Finds and returns a gui element if it is valid from a long chain of element names or conceptsText.new_text_field([name])Creates a new text field element define
    existsChecks if a gui element exists or not, returns it if found else the path where it failedText.new_text_box([name])Creates a new text box element define
    toggle_enabled(element)Toggles the enabled state of an elementText._prototype_box:set_selectable([state=true])Sets the text box to be selectable
    toggle_visible(element)Toggles the visible state of an elementText._prototype_box:set_word_wrap([state=true])Sets the text box to have word wrap
    set_padding(element[, up=0][, down=0][, left=0][, right=0])Sets the padding for a gui elementText._prototype_box:set_read_only([state=true])Sets the text box to be read only
    -

    Store Categories

    +

    Instances

    - - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
    categorize_by_player(element)A categorize function to be used with add_store, each player has their own categoryutils.global
    categorize_by_force(element)A categorize function to be used with add_store, each force has its own categoryInstances.has_categories(name)Returns if a instance group has a categorise function; must be registered
    categorize_by_surface(element)A categorize function to be used with add_store, each surface has its own categoryInstances.is_registered(name)Returns if the given name is a registered instance group
    Instances.register(name[, categorise])Registers the name of an instance group to allow for storing element instances
    Instances.add_element(name, element)Adds an element to the instance group under the correct category; must be registered
    Instances.get_elements_raw(name[, category])Gets all element instances without first removing any invalid ones; used internally and must be registered
    Instances.get_valid_elements(name[, category][, callback])Gets all valid element instances and has the option of running a callback on those that are valid
    Instances.unregistered_add_element(name, category, element)A version of add_element that does not require the group to be registered
    Instances.unregistered_get_elements(name, category[, callback])A version of get_elements that does not require the group to be registered
    -

    Concept Base

    +

    Prototype

    - - + - - + - - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Prototype:clone(concept_name)Used to copy all the settings from one concept to another and removing links to the orginalutils.game
    Prototype:define_clone(clone_callback)Use to add your own callbacks to the clone function, for example adding to a local tableexpcore.store
    Prototype:save_as(save_name)Used to save the concept to the main gui module to allow access from other filesexpcore.gui.instances
    Prototype:debug(name)Sets a debug name that can be used with error handlersConstructor.event(event_name)Creates a new function to add functions to an event handler
    Prototype:new_event(event_name[, factorio_event][, event_condition])Adds a new event trigger to the concept which can be linked to a factorio eventConstructor.extend(new_prototype)Extents a prototype with the base functions of all gui prototypes, no metatables
    Prototype:on_custom_event(handler)Adds a custom event handler, replace with the name of the eventConstructor.store(sync, callback)Creates a new function which adds a store to a gui define
    Prototype:raise_event(event_name[, event={}][, from_factorio=false])Raises a custom event, folowing keys included automaticlly: concept, event name, game tick, player from player_index, element if validConstructor.setter(value_type, key[, second_key])Creates a setter function that checks the type when a value is set
    Prototype:new_property(property_name[, setter_callback][, default])Adds a new property to the concept, such as caption, tooltip, or some custom property you want to controlPrototype:uid()Gets the uid for the element define
    Prototype:set_custom_property(value)Sets a new value for a property, triggers setter method if provided, replace with property namePrototype.debug_nameSets a debug alias for the define
    Prototype:define_draw(draw_callback)Used to define how the concept is turned into an ingame element or "instance" as we may refer to themPrototype.set_captionSets the caption for the element define
    Prototype:draw(parent_element[, override_name])Calls all the draw functions in order to create this concept in game; will also store and sync the instance if stores are usedPrototype.set_tooltipSets the tooltip for the element define
    Prototype.set_pre_authenticatorSets an authenticator that blocks the draw function if check fails
    Prototype.set_post_authenticatorSets an authenticator that disables the element if check fails
    Prototype.on_drawRegisters a callback to the on_draw event
    Prototype.on_style_updateRegisters a callback to the on_style_update event
    Prototype:set_style(style[, callback])Sets the style for the element define
    Prototype:set_embedded_flow(state)Sets the element to be drawn inside a nameless flow, can be given a name using a function
    Prototype:raise_event(event_name, ...)Raises a custom event for this define, any number of params can be given
    Prototype:draw_to(element)The main function for defines, when called will draw an instance of this define to the given element + what is drawn is based on the data in draw_data which is set using other functions
    Prototype:get_store(category)Gets the value in this elements store, category needed if categorize function used
    Prototype:set_store(category, value)Sets the value in this elements store, category needed if categorize function used
    Prototype:clear_store([category])Sets the value in this elements store to nil, category needed if categorize function used
    -

    Concept Instances

    +

    Test

    - - + - - + - - + - - - - -
    Prototype:define_instance_store([category_callback])Adds an instance store to the concept; when a new instance is made it is stored so you can access it laterexpcore.gui
    Prototype.get_instances([category])Gets all insatnces in a category, category may be nil to return allexpcore.common
    Prototype.add_instance(element[, category])Adds an instance to this concept, used automatically during concept:drawresources.color_presets
    Prototype.update_instances([category], update_callback)Applies an update function to all instances, simialr use to what table.forEach would be
    - - -

    Concept Data

    - - - - - - + - - - - - - - - - - - - - - - - -
    Prototype:define_data_store([category_callback])Adds a data store to this concept which allows you to store synced/percistent data between instancesutils.event
    Prototype.get_data([category])Gets the data that is stored for this category
    Prototype.set_data([category], value)Sets the data that is stored for this category
    Prototype.clear_data([category])Clears the data that is stored for this category
    Prototype.update_data([category], update_callback)Updates the data that is stored for this category
    - - -

    Concept Combined Instances

    - - - - - - - - - - - - -
    Prototype:define_combined_store([category_callback], sync_callback)Used to add a both instance and data store which are linked together, new instances are synced to the current value, changing the stored value will change all instances
    Prototype.sync_instance(element)Will sync an instance to match the stored value based on the given sync callback
    - - -

    Tests

    - - - - - - +
    run_tests(player[, category])Runs a set of gui tests to ensure that the system is workingexpcore.store
    @@ -664,122 +1117,20 @@ Gui.new_concept('button') -- W
    -

    Elements

    +

    Dependencies

    - # - button + # + expcore.gui.core
    -

    Clickable elements that fire on_gui_click when clicked.

    -

    - Properties / Events: - -
      - - - - - -
    • - - on_click - - : - - - fired when the player clicks the button - -
    • - - - - - -
    • - - on_left_click - - : - - - fired when the player clicks with the right mouse button - -
    • - - - - - -
    • - - on_left_click - - : - - - fired when the player clicks with the right mouse button - -
    • - - - - - -
    • - - caption - - : - - (string or LocalisedString) - - the message that is shown on the button - -
    • - - - - - -
    • - - tooltip - - : - - (string or LocalisedString) - - the tooltip that shows when a player hovers over the button - -
    • - - - - - -
    • - - sprite - - : - - (SpritePath) - - upto three sprites in the order: default, hovered, clicked - -
    • - - -
    - @@ -790,126 +1141,21 @@ Gui.new_concept('button') -- W - Usage: -
    -- Making a basic button
    -local basic_button =
    -Gui.new_concept('button')
    -:set_caption('Basic Button')
    -:set_tooltip('Basic button')
    -:on_click(function(event)
    -    event.player.print('You pressed basic button!')
    -end)
    -
    -- Making a sprite button
    -local sprite_button =
    -Gui.new_concept('button')
    -:set_sprite('utility/warning_icon')
    -:set_tooltip('Sprite button')
    -:on_click(function(event)
    -    event.player.print('You pressed sprite button!')
    -end)
    - # - checkbox + # + expcore.gui.instances
    -

    Clickable elements with a cross in the middle that can be turned off or on.

    -

    - Properties / Events: - -
      - - - - - -
    • - - on_state_changed - - : - - - fired when the state of the element is changed - -
    • - - - - - -
    • - - caption - - : - - (string or LocalisedString) - - the message that is shown next to the checkbox - -
    • - - - - - -
    • - - tooltip - - : - - (string or LocalisedString) - - the tooltip that shows when a player hovers over the checkbox - -
    • - - - - - -
    • - - default - - : - - (boolean or function) - - the default state of this checkbox, or a function which returns the default state - -
    • - - - - - -
    • - - use_radio - - : - - (boolean) - - setting to true will use radio buttons rather than checkboxs - -
    • - - -
    - @@ -920,118 +1166,21 @@ Gui.new_concept('button') - Usage: -
    -- Making a basic checkbox
    -local basic_checkbox =
    -Gui.new_concept('checkbox')
    -:set_caption('Basic Checkbox')
    -:set_tooltip('Basic checkbox')
    -:on_state_changed(function(event)
    -    event.player.print('Basic checkbox is now: '..tostring(event.element.state))
    -end)
    - # - dropdown + # + expcore.gui.elements.buttons
    -

    A drop down list of other elements.

    -

    - Properties / Events: - -
      - - - - - -
    • - - on_selection_changed - - : - - - fired when the selected value is changed - -
    • - - - - - -
    • - - default - - : - - (string, LocalisedString or function) - - the option which is selected by default, or a function which returns the default - -
    • - - - - - -
    • - - use_list_box - - : - - (boolean) - - when true a list box will be used rather than a dropdown menu - -
    • - - - - - -
    • - - static_items - - : - - (nil or table) - - when called with a table the values will be added as items for the dropdown, if called with nil then all items are cleared - -
    • - - - - - -
    • - - dynamic_items - - : - - (function) - - the given function will be called to return a list of items and optional start index to add items to the dropdown when it is first drawn - -
    • - - -
    - @@ -1042,100 +1191,21 @@ Gui.new_concept('checkbox') - Usage: -
    -- Making a basic dropdown
    -local static_dropdown =
    -Gui.new_concept('dropdown')
    -:set_static_items{'Option 1','Option 2','Option 3'}
    -:on_selection_changed(function(event)
    -    local value = Gui.get_dropdown_value(event.element)
    -    event.player.print('Static dropdown is now: '..value)
    -end)
    -
    -- Making a dropdown with dynamic items, example is name of online players
    -local dynamic_dropdown =
    -Gui.new_concept('dropdown')
    -:set_dynamic_items(function(element)
    -    local items = {}
    -    for _,player in pairs(game.connected_players) do
    -        items[#items+1] = player.name
    -    end
    -    return items
    -end)
    -:on_selection_changed(function(event)
    -    local value = Gui.get_dropdown_value(event.element)
    -    event.player.print('Dynamic dropdown is now: '..value)
    -end)
    - # - elem_button + # + expcore.gui.elements.checkbox
    -

    A button that lets the player pick one of an: item, entity, tile, or signal similar to the filter-select window.

    -

    - Properties / Events: - -
      - - - - - -
    • - - on_selection_changed - - : - - - fired when the selected value is changed - -
    • - - - - - -
    • - - default - - : - - (string, SignalID or function) - - the option which is selected by default, or a function which returns the default - -
    • - - - - - -
    • - - elem_type - - : - - (string) - - the type of elem selection that this is, default is item selection - -
    • - - -
    - @@ -1146,53 +1216,21 @@ Gui.new_concept('dropdown') - Usage: -
    -- Making a basic elem button
    -local basic_elem_button =
    -Gui.new_concept('elem_button')
    -:on_selection_changed(function(event)
    -    event.player.print('Basic elem button is now: '..event.element.elem_value)
    -end)
    - # - empty + # + expcore.gui.elements.dropdown
    -

    A empty widget that just exists.

    -

    The root GUI element screen is an empty-widget.

    - Properties / Events: - -
      - - - - - -
    • - - style - - : - - (string) - - the style that the element will have - -
    • - - -
    - @@ -1203,51 +1241,21 @@ Gui.new_concept('elem_button') - Usage: -
    -- Making a draggable space styled widget
    -local draggable_space =
    -Gui.new_concept('empty')
    -:set_style('draggable_space')
    - # - flow + # + expcore.gui.elements.slider
    -

    Invisible containers that lay out children either horizontally or vertically.

    -

    The root GUI elements (top, left and center; see LuaGui) are flows.

    - Properties / Events: - -
      - - - - - -
    • - - direction - - : - - (string) - - the direction that children will be added - -
    • - - -
    - @@ -1258,72 +1266,21 @@ Gui.new_concept('empty') - Usage: -
    -- Making a basic flow, contains a label with hello world
    -local basic_flow =
    -Gui.new_concept('flow')
    -:define_draw(function(properties,parent,element)
    -    element.add{
    -        type = 'label',
    -        caption = 'Hello, World!'
    -    }
    -end)
    - # - frame + # + expcore.gui.elements.text
    -

    Grey semi-transparent boxes that contain other elements.

    -

    They have a caption, and, just like flows, they lay out children either horizontally or vertically.

    - Properties / Events: - -
      - - - - - -
    • - - title - - : - - (string or LocalisedString) - - the title that will show in the frame - -
    • - - - - - -
    • - - direction - - : - - (string) - - the direction that children will be added - -
    • - - -
    - @@ -1334,89 +1291,21 @@ Gui.new_concept('flow') - Usage: -
    -- Making a basic frame, contains a label with hello world
    -local basic_frame =
    -Gui.new_concept('frame')
    -:set_title('Basic Frame')
    -:define_draw(function(properties,parent,element)
    -    element.add{
    -        type = 'label',
    -        caption = 'Hello, World!'
    -    }
    -end)
    - # - label + # + expcore.gui.elements.elem-button
    -

    A piece of text.

    -

    - Properties / Events: - -
      - - - - - -
    • - - caption - - : - - (string or LocalisedString) - - the caption that will show in the label - -
    • - - - - - -
    • - - description - - : - - (string or LocalisedString) - - the description that will show on the label - -
    • - - - - - -
    • - - rich_text - - : - - (defines.rich_text_setting) - - how this element handles rich text - -
    • - - -
    - @@ -1427,51 +1316,21 @@ Gui.new_concept('frame') - Usage: -
    -- Making a basic label
    -local basic_label =
    -Gui.new_concept('label')
    -:set_caption('Hello, World!')
    - # - line + # + expcore.gui.elements.progress-bar
    -

    A vertical or horizontal line.

    -

    - Properties / Events: - -
      - - - - - -
    • - - direction - - : - - (string) - - the direction that children will be added - -
    • - - -
    - @@ -1482,113 +1341,21 @@ Gui.new_concept('label') - Usage: -
    -- Making a basic frame, contains a label with hello world
    -local basic_line =
    -Gui.new_concept('line')
    - # - progress_bar + # + expcore.gui.concepts.toolbar
    -

    Indicate progress by displaying a partially filled bar.

    -

    - Properties / Events: - -
      - - - - - -
    • - - on_completion - - : - - - fired when increment reaches the maxium value set by set_maximum - -
    • - - - - - -
    • - - tooltip - - : - - (string or LocalisedString) - - the tooltip that will show for this element - -
    • - - - - - -
    • - - maximum - - : - - (number) - - the maxium amount an instance can be increased, default 100 - -
    • - - - - - -
    • - - delay_completion - - : - - (boolean) - - when true the progress will be completed untill after the maximum rather than at the maximum - -
    • - - - - - -
    • - - inverted - - : - - (boolean) - - although this will NOT effect how you use the functions it will make the element start full and reduce as you call increase, note issues with 0 detections - -
    • - - -
    - @@ -1599,76 +1366,21 @@ Gui.new_concept('line') - Usage: -
    -- Making a basic progress bar, will increase when pressed then will reset when full
    -local basic_progress_bar =
    -Gui.new_concept('progress_bar')
    -:set_tooltip('Basic progress bar')
    -:set_maximum(5)
    -:new_event('on_click',defines.events.on_gui_click)
    -:on_click(function(event)
    -    event.concept:increment(event.element)
    -end)
    -:set_delay_completion(true)
    -:on_completion(function(event)
    -    event.concept:reset(event.element)
    -end)
    - # - scroll + # + expcore.gui.concepts.left
    -

    Similar to a flow but includes the ability to show and use scroll bars.

    -

    - Properties / Events: - -
      - - - - - -
    • - - horizontal_scroll - - : - - (string) - - the horizontal scroll policy for this scroll pane - -
    • - - - - - -
    • - - vertical_scroll - - : - - (string) - - the vertical scroll policy for this scroll pane - -
    • - - -
    - @@ -1679,122 +1391,21 @@ Gui.new_concept('progress_bar') - Usage: -
    -- Making a basic flow, contains a label with hello world
    -local basic_scroll =
    -Gui.new_concept('scroll')
    -:define_draw(function(properties,parent,element)
    -    element.style.hieght = 50
    -    for i = 1,10 do
    -        element.add{
    -            type = 'label',
    -            caption = i
    -        }
    -    end
    -end)
    - # - slider + # + expcore.gui.concepts.center
    -

    A number picker.

    -

    - Properties / Events: - -
      - - - - - -
    • - - on_value_changed - - : - - - fired when the value of the slider is changed - -
    • - - - - - -
    • - - value_step - - : - - (number) - - the minimum amount by which the value of the slider can be changed - -
    • - - - - - -
    • - - default - - : - - (number or function) - - the default value of the slider or a function which returns the default value - -
    • - - - - - -
    • - - discrete_slider - - : - - (boolean) - - makes this slider a discrete slider, this means that the slider button will stop at the same interval as the values do - -
    • - - - - - -
    • - - range - - : - - (number or function) - - accepts two params the minimum and the maximum for this slider, or a single function to return both - -
    • - - -
    - @@ -1805,127 +1416,21 @@ Gui.new_concept('scroll') - Usage: -
    -- Making a basic slider
    -local basic_slider =
    -Gui.new_concept('slider')
    -:set_range(1,10)
    -:on_value_changed(function(event)
    -    event.player.print('Basic slider is now: '..event.element.slider_value)
    -end)
    -
    -- Making a discrete_slider
    -local discrete_slider =
    -Gui.new_concept('slider')
    -:set_range(1,10)
    -:set_value_step(1)
    -:set_discrete_slider(true)
    -:on_value_changed(function(event)
    -    event.player.print('Interval slider is now: '..event.element.slider_value)
    -end)
    - # - table + # + expcore.gui.concepts.popups
    -

    An invisible container that lays out children in a specific number of columns.

    -

    Column width is given by the largest element contained in that row.

    - Properties / Events: - -
      - - - - - -
    • - - column_count - - : - - (number or function) - - the column count of the table or a function that returns the count being given then parent element - -
    • - - - - - -
    • - - vertical_lines - - : - - (boolean) - - when true vertical lines will be drawn on the table - -
    • - - - - - -
    • - - horizontal_lines - - : - - (boolean) - - when true horizontal lines will be drawn on the table - -
    • - - - - - -
    • - - header_lines - - : - - (boolean) - - when true horizontal lines will be drawn under the first row - -
    • - - - - - -
    • - - vertical_centering - - : - - (boolean) - - when true element will be vertically centered with in the table - -
    • - - -
    - @@ -1936,440 +1441,123 @@ Gui.new_concept('slider') - Usage: -
    -- Making a basic table, contains 25 labels
    -local basic_table =
    -Gui.new_concept('table')
    -:set_column_count(5)
    -:define_draw(function(properties,parent,element)
    -    for i = 1,25 do
    -        element.add{
    -            type = 'lable',
    -            caption = i
    -        }
    -    end
    -end)
    - - -
    -
    -
    -
    - # - text_box -
    -
    -
    -
    - -

    A multi-line text box that supports selection and copy-paste.

    -

    - - - Properties / Events: - -
      - - - - - -
    • - - on_text_changed - - : - - - fired when the text within the text box is changed - -
    • - - - - - -
    • - - tooltip - - : - - (string or LocalisedString) - - the tooltip that shows when a player hovers over the text box - -
    • - - - - - -
    • - - default - - : - - (string or function) - - the default text that will appear in the text box, or a function that returns it - -
    • - - - - - -
    • - - rich_text - - : - - (defines.rich_text_setting) - - how this element handles rich text - -
    • - - - - - -
    • - - clear_on_rmb - - : - - (boolean) - - if the text box will be cleared and forcused on a right click - -
    • - - - - - -
    • - - is_selectable - - : - - (boolean) - - when true the text inside the box can be selected - -
    • - - - - - -
    • - - has_word_wrap - - : - - (boolean) - - when true the text will wrap onto the next line if it reachs the end - -
    • - - - - - -
    • - - is_read_only - - : - - (boolean) - - when true the text inside the box can not be edited by the player - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Making a text box
    -local basic_text_box =
    -Gui.new_concept('text_box')
    -:set_default('I am the text that will show in the text box')
    -
    -- Making a text box which can be edited
    -local editible_text_box =
    -Gui.new_concept('text_box')
    -:set_is_read_only(false)
    -:set_default('I am the text that will show in the text box')
    -:on_confirmation(function(event)
    -    event.player.print('Editible text box is now: '..event.element.text)
    -end)
    - - -
    -
    -
    -
    - # - text_field -
    -
    -
    -
    - -

    Boxes of text the user can type in.

    -

    - - - Properties / Events: - -
      - - - - - -
    • - - on_text_changed - - : - - - fired when the text within the text field is changed - -
    • - - - - - -
    • - - on_confirmation - - : - - - fired when the player presses enter with the text field forcused - -
    • - - - - - -
    • - - tooltip - - : - - (string or LocalisedString) - - the tooltip that shows when a player hovers over the text field - -
    • - - - - - -
    • - - default - - : - - (string or function) - - the default text that will appear in the text field, or a function that returns it - -
    • - - - - - -
    • - - rich_text - - : - - (defines.rich_text_setting) - - how this element handles rich text - -
    • - - - - - -
    • - - clear_on_rmb - - : - - (boolean) - - if the text field will be cleared and forcused on a right click - -
    • - - - - - -
    • - - lose_forcus - - : - - (boolean) - - if the text field will lose forcus after the confirmation event - -
    • - - - - - -
    • - - is_number - - : - - (boolean) - - if this text field contains a number value, can be ignored if is_decimal or is_negitive is used - -
    • - - - - - -
    • - - is_decimal - - : - - (boolean) - - if this text field contains a decimal value - -
    • - - - - - -
    • - - is_negative - - : - - (boolean) - - if this text field contains a negative value - -
    • - - - - - -
    • - - is_password - - : - - (boolean) - - if this text field contains a password value - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Making a text field
    -local basic_text_field =
    -Gui.new_concept('text_field')
    -:on_confirmation(function(event)
    -    event.player.print('Basic text field is now: '..event.element.text)
    -end)
    -
    -- Making a text field which will clear on right click and un forcus on confirmation
    -local better_text_field =
    -Gui.new_concept('text_field')
    -:set_clear_on_rmb(true)
    -:set_lose_forcus(true)
    -:on_confirmation(function(event)
    -    event.player.print('Better text field is now: '..event.element.text)
    -end)
    -
    -- Making a decimal input
    -local decimal_text_field =
    -Gui.new_concept('text_field')
    -:set_is_decimal(true)
    -:on_confirmation(function(event)
    -    event.player.print('Decimal text field is now: '..event.element.text)
    -end)
    -

    Dropdowns

    +

    Center Guis

    - # - set_dropdown_value(element, value) + # + expcore.gui.core
    -

    Selects the index of a dropdown with this value

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.concepts.toolbar +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames.get_flow(player) +
    +
    +
    +
    + +

    Gets the center flow for a player

    @@ -2383,29 +1571,13 @@ Gui.new_concept('text_field')
  • - element + player : - (LuaGuiElement) + (LuaPlayer) - the dropdown that you want to set the selection for - -
  • - - - - - -
  • - - value - - : - - (string or LocalisedString) - - the value that you want selected + the player to get the flow for
  • @@ -2418,147 +1590,337 @@ Gui.new_concept('text_field') Returns: + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames.clear_flow(player) +
    +
    +
    +
    + +

    Clears the center flow for a player

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to clear the flow for + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames.draw_frame(player, name) +
    +
    +
    +
    + +

    Draws the center frame for a player, if already open then will do nothing

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player that will have the frame drawn + +
    • + + + + + +
    • + + name + + : + + (string) + + the name of the hui that will drawn + +
    • + + +
    + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames.redraw_frame(player, name) +
    +
    +
    +
    + +

    Draws the center frame for a player, if already open then will destroy it and redraw

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player that will have the frame drawn + +
    • + + + + + +
    • + + name + + : + + (string) + + the name of the hui that will drawn + +
    • + + +
    + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames.toggle_frame(player, name[, state]) +
    +
    +
    +
    + +

    Toggles if the frame is currently open or not, will open if closed and close if open

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player that will have the frame toggled + +
    • + + + + + +
    • + + name + + : + + (string) + + the name of the hui that will be toggled + +
    • + + + + + +
    • + + state + + : + (boolean) - if an item with this value was found -
    • -
    - - - - - - - Usage: -
    -- Selecting the item with the value 'foo'
    -Gui.set_dropdown_value(element,'foo')
    - - -
    -
    -
    -
    - # - get_dropdown_value(element) -
    -
    -
    -
    - -

    Gets the selected item value of a dropdown

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the dropdown that you want the selected value of - -
    • - - -
    - - - - - Returns: - - - - - - - - - Usage: -
    -- Getting the selected value
    -local selected_value = Gui.get_dropdown_value(element)
    - - -
    -
    -
    -
    - # - add_dropdown_items(element[, start_index], new_items) -
    -
    -
    -
    - -

    Adds the given items into the list of items for this dropdown

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the dropdown that you want to add the items to - -
    • - - - - - -
    • - - start_index - - : - - (number) - - the index at which the items will be added, if not given appened to the end + when set will force a state for the frame (optional)
    • +
    + + + + + Returns: +
      +
    • + (boolean) + if the frame if no open or closed +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames.new_frame(permission_name) +
    +
    +
    +
    + +

    Creates a new center frame define

    +

    + + + Parameters: + +
      + +
    • - new_items + permission_name : - (table) + (string) - the list of new items that you want to add + the name that can be used with the permission system
    • @@ -2572,7 +1934,7 @@ Gui.new_concept('text_field')
      • (table) - the list of items that the element now has + the new center frame define
      @@ -2582,28 +1944,20 @@ Gui.new_concept('text_field') - Usage: -
      -- Add the items 'foo' and 'bar' to the end
      -Gui.add_dropdown_items(element,{'foo','bar'})
      -
      -- Add the items 'foo' and 'bar' to the start
      -Gui.add_dropdown_items(element,1,{'foo','bar'})
    -
    -

    Progress Bars

    -
    - # - progress_bar:increment(element[, amount=1]) + # + CenterFrames._prototype:set_auto_focus([state=true])
    -

    Will increase the progress of a progress bar based on this concept, if the concept has an instance store then element acts as the category, if you have a combined store it will NOT update all instances

    +

    Sets the frame to be the current active gui when opened and closes all other frames

    @@ -2617,31 +1971,15 @@ Gui.new_concept('text_field')
  • - element + state : - (LuaGuiElement or string) + (boolean) - either the element that is changed or the category that is being changed (only if an instance store is defined) + when true will auto close other frames and set this frame as player.opened -
  • - - - - - -
  • - - amount - - : - - (number) - - the amount that will bar will increase, note that this amount must be less than the max - - (default: 1) + (default: true)
  • @@ -2650,13 +1988,6 @@ Gui.new_concept('text_field') - Returns: -
      -
    • - (number or nil) - the new value of the element, use this to sync a data store, if the return is nil then either a instance store was used or the new value may have changed -
    • -
    @@ -2664,25 +1995,20 @@ Gui.new_concept('text_field') - Usage: -
    -- Incrementing progress bar with no instance store
    -local new_value = progress_bar:increment(element)
    -
    -- Incrementing progress bar with an instance store
    -progress_bar:increment(category)
    - # - progress_bar:decrement(element[, amount=1]) + # + CenterFrames._prototype:draw_frame(player)
    -

    Will decrease the progress of a progress bar based on this concept, if the concept has an instance store then element acts as the category, if you have a combined store it will NOT update all instances

    +

    Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)

    @@ -2696,92 +2022,13 @@ Gui.new_concept('text_field')
  • - element + player : - (LuaGuiElement or string) + (LuaPlayer) - either the element that is changed or the category that is being changed (only if an instance store is defined) - -
  • - - - - - -
  • - - amount - - : - - (number) - - the amount that will bar will decrease, note that this amount must be less than the max - - (default: 1) -
  • - - - - - - - - Returns: -
      -
    • - (number) - the new value of the element, use this to sync a data store, if the return is nil then either a instance store was used or the new value may have changed -
    • -
    - - - - - - - - Usage: -
    -- Decrementing progress bar with no instance store
    -local new_value = progress_bar:decrement(element)
    -
    -- Decrementing progress bar with an instance store
    -progress_bar:decrement(category)
    - - -
    -
    -
    -
    - # - progress_bar:reset(element) -
    -
    -
    -
    - -

    Resets the progress back to 0% for this element, if the concept has an instance store then element acts as the category, if you have a combined store it will NOT update all instances

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement or string) - - either the element that is changed or the category that is being changed (only if an instance store is defined) + the player to draw the frame for
    • @@ -2794,58 +2041,37 @@ Gui.new_concept('text_field') Returns:
      • - (number or nil) - the new value of the element, use this to sync a data store, if the return is nil then either a instance store was used or the new value may have changed -
      • -
      - - - - - - - - Usage: -
      -- Reseting a progress bar with no instance store
      -local new_value = progress_bar:reset(element)
      -
      -- Reseting a progress bar with an instance store
      -progress_bar:reset(category)
      - - -
    -
    -
    -
    - # - increment_progress_bar(element[, amount=0.01]) -
    -
    -
    -
    - -

    Increment any progress bar by the given percentage

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - (LuaGuiElement) - - the progress bar that you want to update - + the new frame that was drawn
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames._prototype:redraw_frame(player) +
    +
    +
    +
    + +

    Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)

    +

    + + + Parameters: + +
      @@ -2853,15 +2079,71 @@ Gui.new_concept('text_field')
    • - amount + player : - (number) + (LuaPlayer) - the percentage that you want to increment the progress bar by + the player to draw the frame for + +
    • + + +
    + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + CenterFrames._prototype:toggle_frame(player) +
    +
    +
    +
    + +

    Toggles if the frame is open, if open it will close it and if closed it will open it

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to draw the frame for - (default: 0.01)
    • @@ -2874,7 +2156,7 @@ Gui.new_concept('text_field')
      • (boolean) - true if the bar is now full + with the gui frame is now open
      @@ -2884,23 +2166,20 @@ Gui.new_concept('text_field') - Usage: -
      -- Increment any progress bar by 10%
      -Gui.increment_progress_bar(element,0.1)
    - # - decrement_progress_bar(element[, amount=0.01]) + # + CenterFrames._prototype:event_handler([action=update])
    -

    Decrement any progress bar by the given percentage

    +

    Creates an event handler that will trigger one of its functions, use with Event.add

    @@ -2914,31 +2193,243 @@ Gui.new_concept('text_field')
  • - element + action : - (LuaGuiElement) + (string) - the progress bar that you want to update + the action to take on this event + (default: update)
  • + + + + + + + + + + + + + + +
    +
    +

    Left Guis

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.concepts.toolbar +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.elements.buttons +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + mod-gui +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.event +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames.get_flow(player) +
    +
    +
    +
    + +

    Gets the left frame flow for a player

    +

    + + + Parameters: + +
      + +
    • - amount + player : - (number) + (LuaPlayer) - the percentage that you want to decrement the progress bar by + the player to get the flow of - (default: 0.01)
    • @@ -2950,8 +2441,8 @@ Gui.new_concept('text_field') Returns: @@ -2961,132 +2452,20 @@ Gui.new_concept('text_field') - Usage: -
      -- Decrement any progress bar by 10%
      -Gui.decrement_progress_bar(element,0.1)
      - - -
    -
    -

    Concept Control

    -
    -
    -
    -
    - # - require_concept(concept_name) -
    -
    -
    -
    - -

    Loads a concept from the concepts file

    -

    - - - Parameters: - -
      - - - - - -
    • - - concept_name - - : - - (string) - - the name of the concept to require - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Load a base concept
    -Gui.require_concept('frame') --- @dep Gui.concept.frame
    - # - require_style(style_name) + # + LeftFrames.get_frame(name, player)
    -

    Loads a set of concepts from the styles file

    -

    - - - Parameters: - -
      - - - - - -
    • - - style_name - - : - - (string) - - the name of the style to require - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Load a base style
    -Gui.require_concept('expgaming') --- @dep Gui.style.frame
    - - -
    -
    -
    -
    - # - get_concept(name) -
    -
    -
    -
    - -

    Gets a gui concept from name, id, or its self

    +

    Gets one frame from the left flow by its name

    @@ -3104,9 +2483,25 @@ Gui.new_concept('text_field') : - (string, number or table) + (string) - the name, id, or the concept you want to get + the name of the gui frame to get + + + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the frame of
  • @@ -3116,6 +2511,13 @@ Gui.new_concept('text_field') + Returns: +
      +
    • + (LuaGuiElement) + the frame in the left frame flow with that name +
    • +
    @@ -3123,23 +2525,20 @@ Gui.new_concept('text_field') - Usage: -
    -- Getting a gui concept
    -local button = Gui.get_concept('Button')
    - # - Prototype:save_as(save_name) + # + LeftFrames.get_open(player)
    -

    Used to save the concept to the main gui module to allow access from other files

    +

    Gets all open frames for a player, if non are open it will remove the close all button

    @@ -3153,69 +2552,102 @@ Gui.new_concept('text_field')
  • - save_name + player + + : + + (LuaPlayer) + + the player to get the flow of + +
  • + + + + + + + + Returns: +
      +
    • + (table) + contains all the open (and registered) frames for the player +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames.toggle_frame(name, player[, state]) +
    +
    +
    +
    + +

    Toggles the visibility of a left frame, or sets its visibility state

    +

    + + + Parameters: + +
      + + + + + +
    • + + name : (string) - the new name of the concept + the name of the gui frame to toggle
    • -
    - - - - - - - - - - - - Usage: -
    -- Save a concept to allow access in another file
    -button:save_as('button')
    -
    -- Access concept after being saved
    -Gui.concepts.button
    -Gui.get_concept('button')
    - - -
    -
    -
    -
    - # - new_concept([base_concept]) -
    -
    -
    -
    - -

    Returns a new gui concept, option to provide a base concept to copy properties and draw functions from

    -

    - - - Parameters: - -
      - -
    • - base_concept + player : - (string, number or table) + (LuaPlayer) - the concept that you want to copy the details of + the player to get the frame of + +
    • + + + + + +
    • + + state + + : + + (boolean) + + when given will be the state that the visibility is set to (optional)
    • @@ -3226,6 +2658,13 @@ Gui.get_concept('button') + Returns: +
        +
      • + (boolean) + the new state of the visibility +
      • +
      @@ -3233,23 +2672,20 @@ Gui.get_concept('button') - Usage: -
      -- Making a new button, see module usage
      -local button = Gui.new_concept('Button')
    - # - draw_concept(concept, parent) + # + LeftFrames.new_frame(permission_name)
    -

    Used to draw a concept to a parent element

    +

    Creates a new left frame define

    @@ -3263,29 +2699,174 @@ Gui.get_concept('button')
  • - concept + permission_name : - (string, number or table) + (string) - the name of the concept that you want to draw + the name that can be used with the permission system
  • + + + + + + Returns: +
      +
    • + (table) + the new left frame define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:set_open_by_default([state=true]) +
    +
    +
    +
    + +

    Sets if the frame is visible when a player joins, can also be a function to return a boolean

    +

    + + + Parameters: + +
      + +
    • - parent + state : - (LuaGuiElement) + (boolean or function) - the element that will act as a parent for the new element + the default state of the visibility, can be a function + state param - player LuaPlayer - the player that has joined the game + state param - define_name string - the define name for the frame + state return - boolean - false will hide the frame + + (default: true) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:set_direction(direction) +
    +
    +
    +
    + +

    Sets the direction of the frame, either vertical or horizontal

    +

    + + + Parameters: + +
      + + + + + +
    • + + direction + + : + + (string) + + the direction to have the elements be added to the frame + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:_internal_draw(player) +
    +
    +
    +
    + +

    Creates the gui for the first time, used internally

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to draw the frame to
    • @@ -3299,7 +2880,7 @@ Gui.get_concept('button')
      • (LuaGuiElement) - the element that was created + the frame that was made
      @@ -3309,26 +2890,672 @@ Gui.get_concept('button') - Usage: -
      -- Drawing a new element
      -Gui.draw_concept('Button',element)
      + + +
    +
    +
    +
    + # + LeftFrames._prototype:get_frame(player) +
    +
    +
    +
    + +

    Gets the frame for this define from the left frame flow

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to get the frame of + +
    • + + +
    + + + + + Returns: +
      +
    • + (LuaGuiElement) + the frame in the left frame flow for this define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:is_open(player) +
    +
    +
    +
    + +

    Returns if the player currently has this define visible

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to get the frame of + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if it is open/visible +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:toggle(player) +
    +
    +
    +
    + +

    Toggles the visibility of the left frame

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to toggle the frame of + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + the new state of the visibility +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:update(player) +
    +
    +
    +
    + +

    Updates the contents of the left frame, first tries update callback, other wise will clear and redraw

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to update the frame of + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:update_all([update_offline=false]) +
    +
    +
    +
    + +

    Updates the frame for all players, see update

    +

    + + + Parameters: + +
      + + + + + +
    • + + update_offline + + : + + (boolean) + + when true will update the frame for offline players + + (default: false) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:redraw(player) +
    +
    +
    +
    + +

    Redraws the frame by calling on_draw, will always clear the frame

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to update the frame of + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:redraw_all([update_offline=false]) +
    +
    +
    +
    + +

    Redraws the frame for all players, see redraw

    +

    + + + Parameters: + +
      + + + + + +
    • + + update_offline + + : + + (boolean) + + when true will update the frame for offline players + + (default: false) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + LeftFrames._prototype:event_handler([action=update]) +
    +
    +
    +
    + +

    Creates an event handler that will trigger one of its functions, use with Event.add

    +

    + + + Parameters: + +
      + + + + + +
    • + + action + + : + + (string) + + the action to take on this event + + (default: update) +
    • + + +
    + + + + + + + + + + +
    -

    Element Control

    +

    Popups

    - # - get_player_from_element(element) + # + expcore.gui.core
    -

    Gets the player who owns this element

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.event +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.elements.progress-bar +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.elements.buttons +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + mod-gui +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + resources.color_presets +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.global +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + PopupFrames.get_flow(player) +
    +
    +
    +
    + +

    Gets the left flow that contains the popup frames

    @@ -3342,73 +3569,13 @@ Gui.get_concept('button')
  • - element + player : - (LuaGuiElement) - - the element that you want to get the player of - -
  • - - - - - - - - Returns: -
      -
    • (LuaPlayer) - the player who owns this element -
    • -
    - - - - - - - Usage: -
    -- Getting the player of an element
    -local player = Gui.get_player_from_element(element)
    - - -
    -
    -
    -
    - # - valid(element) -
    -
    -
    -
    - -

    Simple check for if an element is valid

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the element that you want to check is valid + the player to get the flow for
    • @@ -3421,8 +3588,8 @@ Gui.get_concept('button') Returns:
      • - (boolean) - true if the element is valid + (LuaGuiElement) + the left flow that contains the popup frames
      @@ -3432,23 +3599,20 @@ Gui.get_concept('button') - Usage: -
      -- Return if not valid
      -if not Gui.valid(element) then return end
    - # - destroy(element) + # + PopupFrames.open(define_name, player[, open_time], ...)
    -

    Destroies and element if it is valid

    +

    Opens a popup for the player, can give the amount of time it is open as well as params for the draw function

    @@ -3462,73 +3626,29 @@ Gui.get_concept('button')
  • - element + define_name : - (LuaGuiElement) + (string) - the element that you want to destroy + the name of the define that you want to open for the player
  • - - - - - - Returns: -
      -
    • - (boolean) - true if the element was valid and was destoried -
    • -
    - - - - - - - - Usage: -
    -- Destoring an element
    -Gui.destroy(element)
    - - -
    -
    -
    -
    - # - find(element, ...) -
    -
    -
    -
    - -

    Finds and returns a gui element if it is valid from a long chain of element names or concepts

    -

    - - - Parameters: - -
      - -
    • - element + player : - (LuaGuiElement) + (LuaPlayer) - the root element to start checking from + the player to open the popup for
    • @@ -3536,15 +3656,32 @@ Gui.get_concept('button') +
    • + + open_time + + : + + (number) + + the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default + + (optional) +
    • + + + + +
    • ... : - (string or table) + (any) - element names or element concepts that point to your element + the other params that you want to pass to your on_draw event
    • @@ -3557,23 +3694,836 @@ Gui.get_concept('button') Returns:
      • - (boolean) - if the element was found, failed + (LuaGuiElement) + the frame that was drawn, the inner gui flow which contains the content
      • +
      + + + + + + + + + +
    +
    +
    +
    + # + PopupFrames.close_progress +
    +
    +
    +
    + +

    Progress bar which when depleted will close the popup frame

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + PopupFrames.close_button +
    +
    +
    +
    + +

    A button which can be used to close the gui before the timer runs out

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + PopupFrames.new_popup([name]) +
    +
    +
    +
    + +

    Creates a new popup frame define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new popup frame define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + PopupFrames._prototype:set_default_open_time(amount) +
    +
    +
    +
    + +

    Sets the default open time for the popup, will be used if non is provided with open

    +

    + + + Parameters: + +
      + + + + + +
    • + + amount + + : + + (number) + + the number of ticks, by default, the popup will be open for + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the define to allow for chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + PopupFrames._prototype:open(player[, open_time], ...) +
    +
    +
    +
    + +

    Opens this define for a player, can be given open time and any other params for the draw function

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to open the popup for + +
    • + + + + + +
    • + + open_time + + : + + (number) + + the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default + + (optional) +
    • + + + + + +
    • + + ... + + : + + (any) + + the other params that you want to pass to your on_draw event + +
    • + + +
    + + + + + Returns: +
      +
    • + (LuaGuiElement) + the frame that was drawn, the inner gui flow which contains the content +
    • +
    + + + + + + + + + +
    +
    +

    Toolbar

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.elements.buttons +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.roles +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.event +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + mod-gui +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Toolbar.new_button([name]) +
    +
    +
    +
    + +

    Adds a new button to the toolbar

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + when given allows an alias to the button for the permission system + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the button define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Toolbar.add_button(button) +
    +
    +
    +
    + +

    Adds an existing buttton to the toolbar

    +

    + + + Parameters: + +
      + + + + + +
    • + + button + + : + + (table) + + the button define for the button to be added + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Toolbar.update(player) +
    +
    +
    +
    + +

    Updates the player's toolbar with an new buttons or expected change in auth return

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to update the toolbar for + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +

    Core

    +
    +
    +
    +
    + # + utils.gui +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + new_define(prototype[, debug_name]) +
    +
    +
    +
    + +

    Used to create new element defines from a class prototype, please use the own given by the class

    +

    + + + Parameters: + +
      + + + + + +
    • + + prototype + + : + + (table) + + the class prototype that will be used for the element define + +
    • + + + + + +
    • + + debug_name + + : + + (string) + + the name that you want to see while debuging + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new element define with all functions accessed via __index metamethod +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_define(name[, internal]) +
    +
    +
    +
    + +

    Gets an element define give the uid, debug name or a copy of the element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string or table) + + the uid, debug name or define for the element define to get + +
    • + + + + + +
    • + + internal + + : + + (boolean) + + when true the error trace is one level higher (used internally) + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the element define that was found or an error +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + categorize_by_player(element) +
    +
    +
    +
    + +

    A categorize function to be used with add_store, each player has their own value

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element that will be converted to a string + +
    • + + +
    + + + + + Returns: +
    • (string) - the path of the element that the search stoped at -
    • -
    -
    Or
    -
      -
    • - (boolean) - if the element was found, found -
    • -
    • - (LuaGuiElement) - the element that was found + the player's name who owns this element
    @@ -3583,26 +4533,24 @@ Gui.get_concept('button') - Usage: -
    -- Getting the center gui
    -local exists, center = Gui.find(player,'gui','center')
    - # - exists + # + categorize_by_force(element)
    -

    Checks if a gui element exists or not, returns it if found else the path where it failed

    +

    A categorize function to be used with add_store, each force has its own value

    + Parameters:
      @@ -3610,7 +4558,7 @@ Gui.get_concept('button') -
    • +
    • element @@ -3618,23 +4566,7 @@ Gui.get_concept('button') (LuaGuiElement) - the root element to start checking from - -
    • - - - - - -
    • - - ... - - : - - (string or table) - - element names or element concepts that point to your element + the element that will be converted to a string
    • @@ -3644,20 +4576,150 @@ Gui.get_concept('button') + Returns: +
        +
      • + (string) + the player's force name who owns this element +
      • +
      + + + + + + + + + +
    +
    +
    +
    + # + categorize_by_surface(element) +
    +
    +
    +
    + +

    A categorize function to be used with add_store, each surface has its own value

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element that will be converted to a string + +
    • + + +
    + + + + + Returns: +
      +
    • + (string) + the player's surface name who owns this element +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + draw(name, element) +
    +
    +
    +
    + +

    Draws a copy of the element define to the parent element, see draw_to

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string or table) + + the uid, debug name or define for the element define to draw + +
    • + + + + + +
    • + + element + + : + + (LuaGuiEelement) + + the parent element that it the define will be drawn to + +
    • + + +
    + + + + + Returns: + - See also: - - Usage: -
    -- Getting the center gui
    -local exists, center = Gui.exists(player,'gui','center')
    @@ -3671,7 +4733,7 @@ Gui.get_concept('button')
    -

    Toggles the enabled state of an element

    +

    Will toggle the enabled state of an element

    @@ -3691,7 +4753,7 @@ Gui.get_concept('button') (LuaGuiElement) - the element that you want to toggle the enabled state of + the gui element to toggle @@ -3705,7 +4767,7 @@ Gui.get_concept('button')
    • (boolean) - the new enabled state of the element + the new state that the element has
    @@ -3715,9 +4777,6 @@ Gui.get_concept('button') - Usage: -
    -- Toggle the enabled state of an element
    -Gui.toggle_enabled(element)
    @@ -3731,7 +4790,7 @@ Gui.get_concept('button')
    -

    Toggles the visible state of an element

    +

    Will toggle the visiblity of an element

    @@ -3751,7 +4810,7 @@ Gui.get_concept('button') (LuaGuiElement) - the element that you want to toggle the visible state of + the gui element to toggle @@ -3765,7 +4824,7 @@ Gui.get_concept('button')
    • (boolean) - the new visible state of the element + the new state that the element has
    @@ -3775,9 +4834,6 @@ Gui.get_concept('button') - Usage: -
    -- Toggle the visible state of an element
    -Gui.toggle_visible(element)
    @@ -3825,9 +4881,9 @@ Gui.get_concept('button') : - (number or boolean) + (number) - the amount of padding on the top, true leaves unchanged + the amount of padding on the top (default: 0) @@ -3842,9 +4898,9 @@ Gui.get_concept('button') : - (number or boolean) + (number) - the amount of padding on the bottom, true leaves unchanged + the amount of padding on the bottom (default: 0) @@ -3859,9 +4915,9 @@ Gui.get_concept('button') : - (number or boolean) + (number) - the amount of padding on the left, true leaves unchanged + the amount of padding on the left (default: 0) @@ -3876,9 +4932,9 @@ Gui.get_concept('button') : - (number or boolean) + (number) - the amount of padding on the right, true leaves unchanged + the amount of padding on the right (default: 0) @@ -3896,368 +4952,537 @@ Gui.get_concept('button') - Usage: -
    -- Remove all padding of an element
    -Gui.set_padding(element)
    -
    -- Remove side padding but keep vertical padding
    -Gui.set_padding(element,true,true)
    -
    -- Remove all padding but set right to 2
    -Gui.set_padding(element,false,false,false,2)
    + + + +
    +
    +
    + # + set_padding_style(style[, up=0][, down=0][, left=0][, right=0]) +
    +
    +
    +
    + +

    Sets the padding for a gui style

    +

    + + + Parameters: + +
      + + + + + +
    • + + style + + : + + (LuaStyle) + + the element to set the padding for + +
    • + + + + + +
    • + + up + + : + + (number) + + the amount of padding on the top + + (default: 0) +
    • + + + + + +
    • + + down + + : + + (number) + + the amount of padding on the bottom + + (default: 0) +
    • + + + + + +
    • + + left + + : + + (number) + + the amount of padding on the left + + (default: 0) +
    • + + + + + +
    • + + right + + : + + (number) + + the amount of padding on the right + + (default: 0) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + create_alignment(element[, name][, horizontal_align='right'][, vertical_align='center']) +
    +
    +
    +
    + +

    Allows the creation of an alignment flow to place elements into

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element to add this alignment into + +
    • + + + + + +
    • + + name + + : + + (string) + + the name to use for the alignment + + (optional) +
    • + + + + + +
    • + + horizontal_align + + : + + (string) + + the horizontal alignment of the elements in this flow + + (default: 'right') +
    • + + + + + +
    • + + vertical_align + + : + + (string) + + the vertical alignment of the elements in this flow + + (default: 'center') +
    • + + +
    + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + destroy_if_valid(element) +
    +
    +
    +
    + +

    Destroies an element but tests for it being present and valid first

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element to be destroied + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if it was destoried +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + create_scroll_table(element, table_size, maximal_height[, name='scroll']) +
    +
    +
    +
    + +

    Creates a scroll area with a table inside, table can be any size

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element to add this scroll into + +
    • + + + + + +
    • + + table_size + + : + + (number) + + the number of columns in the table + +
    • + + + + + +
    • + + maximal_height + + : + + (number) + + the max hieght of the scroll + +
    • + + + + + +
    • + + name + + : + + (string) + + the name of the scoll element + + (default: 'scroll') +
    • + + +
    + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + create_header(element, caption[, tooltip][, right_align][, name='header']) +
    +
    +
    +
    + +

    Creates a header section with a label and button area

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element to add this header into + +
    • + + + + + +
    • + + caption + + : + + (localeString) + + the caption that is used as the title + +
    • + + + + + +
    • + + tooltip + + : + + (localeString) + + the tooltip that is shown on the caption + + (optional) +
    • + + + + + +
    • + + right_align + + : + + (boolean) + + when true will include the right align area + + (optional) +
    • + + + + + +
    • + + name + + : + + (string) + + the name of the header area + + (default: 'header') +
    • + + +
    + + + + + Returns: +
      +
    • + (LuaGuiElement) + the header that was made, or the align area if that was created +
    • +
    + + + + + + +
    -

    Store Categories

    +

    Buttons

    - # - categorize_by_player(element) + # + mod-gui
    -

    A categorize function to be used with add_store, each player has their own category

    -

    - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the element that will be converted to a string - -
    • - - -
    - - - - - Returns: -
      -
    • - (string) - the player's name who owns this element -
    • -
    - - - - - - - - Usage: -
    -- Storing data on a per player basis, can be used with instances
    -Gui.get_concept('CustomButton')
    -:define_data_store(Gui.categorize_by_player)
    - - -
    -
    -
    -
    - # - categorize_by_force(element) -
    -
    -
    -
    - -

    A categorize function to be used with add_store, each force has its own category

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the element that will be converted to a string - -
    • - - -
    - - - - - Returns: -
      -
    • - (string) - the player's force name who owns this element -
    • -
    - - - - - - - - Usage: -
    -- Storing data on a per force basis, can be used with instances
    -Gui.get_concept('CustomButton')
    -:define_data_store(Gui.categorize_by_force)
    - - -
    -
    -
    -
    - # - categorize_by_surface(element) -
    -
    -
    -
    - -

    A categorize function to be used with add_store, each surface has its own category

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the element that will be converted to a string - -
    • - - -
    - - - - - Returns: -
      -
    • - (string) - the player's surface name who owns this element -
    • -
    - - - - - - - - Usage: -
    -- Storing data on a per surface basis, can be used with instances
    -Gui.get_concept('CustomButton')
    -:define_data_store(Gui.categorize_by_surface)
    - - -
    -
    -

    Concept Base

    -
    -
    -
    -
    - # - Prototype:clone(concept_name) -
    -
    -
    -
    - -

    Used to copy all the settings from one concept to another and removing links to the orginal

    -

    - - - Parameters: - -
      - - - - - -
    • - - concept_name - - : - - (string) - - the name of the new concept; must be unique - -
    • - - -
    - - - - - Returns: -
      -
    • - (GuiConcept) - the base for building a custom gui -
    • -
    - - - - - - - - Usage: -
    -- Clones the base Button concept to make a alternative button
    -local custom_button =
    -Gui.get_concept(Gui.concepts.button):clone()
    - - -
    -
    -
    -
    - # - Prototype:define_clone(clone_callback) -
    -
    -
    -
    - -

    Use to add your own callbacks to the clone function, for example adding to a local table

    -

    - - - Parameters: - -
      - - - - - -
    • - - clone_callback - - : - - (function) - - the function which is called with the concept to have something done to it - -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - self to allow chaining -
    • -
    - - - - - - - - Usage: -
    -- Adding concept to a local table
    -local buttons = {}
    -local button =
    -Gui.get_concept('Button')
    -:define_clone(function(concept)
    -    buttons[concept.name] = concept
    -end)
    - - -
    -
    -
    -
    - # - Prototype:save_as(save_name) -
    -
    -
    -
    - -

    Used to save the concept to the main gui module to allow access from other files

    -

    - - - Parameters: - -
      - - - - - -
    • - - save_name - - : - - (string) - - the new name of the concept - -
    • - - -
    - @@ -4268,26 +5493,70 @@ Gui.get_concept('Button') - Usage: -
    -- Save a concept to allow access in another file
    -button:save_as('button')
    -
    -- Access concept after being saved
    -Gui.concepts.button
    -Gui.get_concept('button')
    - # - Prototype:debug(name) + # + expcore.gui.core
    -

    Sets a debug name that can be used with error handlers

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Button.new_button([name]) +
    +
    +
    +
    + +

    Creates a new button element define

    @@ -4307,7 +5576,539 @@ Gui.get_concept('button') (string) - the name that will be used in error messages + the optional debug name that can be added + + (optional) + + + + + + + + + Returns: +
      +
    • + (table) + the new button element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Button._prototype:set_sprites(sprite[, hovered_sprite][, clicked_sprite]) +
    +
    +
    +
    + +

    Adds sprites to a button making it a sprite button

    +

    + + + Parameters: + +
      + + + + + +
    • + + sprite + + : + + (SpritePath) + + the sprite path for the default sprite for the button + +
    • + + + + + +
    • + + hovered_sprite + + : + + (SpritePath) + + the sprite path for the sprite when the player hovers over the button + + (optional) +
    • + + + + + +
    • + + clicked_sprite + + : + + (SpritePath) + + the sprite path for the sprite when the player clicks the button + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + returns the button define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Button._prototype:set_click_filter(filter[, ...]) +
    +
    +
    +
    + +

    Adds a click / mouse button filter to the button

    +

    + + + Parameters: + +
      + + + + + +
    • + + filter + + : + + (table) + + ?string|table either a of mouse buttons or the first mouse button to filter, with a table true means allowed + +
    • + + + + + +
    • + + ... + + : + + (table) + + when filter is not a you can add the mouse buttons one after each other + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + returns the button define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Button._prototype:set_key_filter(filter[, ...]) +
    +
    +
    +
    + +

    Adds a control key filter to the button

    +

    + + + Parameters: + +
      + + + + + +
    • + + filter + + : + + (table) + + ?string|table either a of control keys or the first control keys to filter, with a table true means allowed + +
    • + + + + + +
    • + + ... + + : + + (table) + + when filter is not a you can add the control keys one after each other + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + returns the button define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +

    Checkboxs

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.store +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Checkbox.new_checkbox([name]) +
    +
    +
    +
    + +

    Creates a new checkbox element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new checkbox element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Checkbox.new_radiobutton([name]) +
    +
    +
    +
    + +

    Creates a new radiobutton element define, has all functions checkbox has

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new button element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Checkbox._prototype_radiobutton:add_as_option(option_set, option_name) +
    +
    +
    +
    + +

    Adds this radiobutton to be an option in the given option set (only one can be true at a time)

    +

    + + + Parameters: + +
      + + + + + +
    • + + option_set + + : + + (string) + + the name of the option set to add this element to + +
    • + + + + + +
    • + + option_name + + : + + (string) + + the name of this option that will be used to identify it
    • @@ -4321,7 +6122,7 @@ Gui.get_concept('button')
      • (self) - to allow chaining + the define to allow chaining
      @@ -4331,23 +6132,3615 @@ Gui.get_concept('button') - Usage: -
      -- Set the debug name
      -unsaved_concept:debug('Example button')
    - # - Prototype:new_event(event_name[, factorio_event][, event_condition]) + # + Checkbox._prototype_radiobutton:get_store(category, internal)
    -

    Adds a new event trigger to the concept which can be linked to a factorio event

    +

    Gets the stored value of the radiobutton or the option set if present

    +

    + + + Parameters: + +
      + + + + + +
    • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
    • + + + + + +
    • + + internal + + : + + (boolean) + + used to prevent stackover flow + +
    • + + +
    + + + + + Returns: +
      +
    • + (any) + the value that is stored for this define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Checkbox._prototype_radiobutton:set_store(category, value, internal) +
    +
    +
    +
    + +

    Sets the stored value of the radiobutton or the option set if present

    +

    + + + Parameters: + +
      + + + + + +
    • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
    • + + + + + +
    • + + value + + : + + (boolean) + + the value to set for this define, must be valid for its type ie for checkbox etc + +
    • + + + + + +
    • + + internal + + : + + (boolean) + + used to prevent stackover flow + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if the value was set +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Checkbox.new_option_set(name, callback, categorize) +
    +
    +
    +
    + +

    Registers a new option set that can be linked to radiobuttons (only one can be true at a time)

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the option set, must be unique + +
    • + + + + + +
    • + + callback + + : + + (function) + + the update callback when the value of the option set changes + callback param - value string - the new selected option for this option set + callback param - category string - the category that updated if categorize was used + +
    • + + + + + +
    • + + categorize + + : + + (function) + + the function used to convert an element into a string + +
    • + + +
    + + + + + Returns: +
      +
    • + (string) + the name of this option set to be passed to add_as_option +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Checkbox.draw_option_set(name, element) +
    +
    +
    +
    + +

    Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the option set to draw the radiobuttons of + +
    • + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the parent element that the radiobuttons will be drawn to + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Checkbox.reset_radiobuttons(element[, exclude][, recursive=false]) +
    +
    +
    +
    + +

    Sets all radiobutton in a element to false (unless excluded) and can act recursively

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the root gui element to start setting radio buttons from + +
    • + + + + + +
    • + + exclude + + : + + (table) + + ?string|table the name of the radiobutton to exclude or a of radiobuttons where true will set the state true + + (optional) +
    • + + + + + +
    • + + recursive + + : + + (number or boolean) + + if true will recur as much as possible, if a will recur that number of times + + (default: false) +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if successful +
    • +
    + + + + + + + + + +
    +
    +

    Dropdowns

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Dropdown.new_dropdown([name]) +
    +
    +
    +
    + +

    Creates a new dropdown element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new dropdown element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Dropdown.new_list_box([name]) +
    +
    +
    +
    + +

    Creates a new list box element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new list box element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Dropdown._prototype:new_static_options(options[, ...], the) +
    +
    +
    +
    + +

    Adds new static options to the dropdown which will trigger the general callback

    +

    + + + Parameters: + +
      + + + + + +
    • + + options + + : + + (table) + + ?string|table either a of option strings or the first option string, with a table values are the options + +
    • + + + + + +
    • + + ... + + : + + (table) + + when options is not a you can add the options one after each other + + (optional) +
    • + + + + + +
    • + + the + + : + + (self) + + define to allow chaining + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Dropdown._prototype:new_dynamic_options(callback) +
    +
    +
    +
    + +

    Adds a callback which should return a table of values to be added as options for the dropdown (appended after static options)

    +

    + + + Parameters: + +
      + + + + + +
    • + + callback + + : + + (function) + + the function that will run to get the options for the dropdown + callback param - player LuaPlayer - the player that the element is being drawn to + callback param - element LuaGuiElement - the element that is being drawn + callback return - table - the values of this table will be appended to the static options of the dropdown + +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + the define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Dropdown._prototype:add_option_callback(option, callback) +
    +
    +
    +
    + +

    Adds a case specific callback which will only run when that option is selected (general case still triggered)

    +

    + + + Parameters: + +
      + + + + + +
    • + + option + + : + + (string) + + the name of the option to trigger the callback on; if not already added then will be added as an option + +
    • + + + + + +
    • + + callback + + : + + (function) + + the function that will be called when that option is selected + callback param - player LuaPlayer - the player who owns the gui element + callback param - element LuaGuiElement - the element which is being effected + callback param - value string - the new option that has been selected + +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + the define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Dropdown.select_value(element, value) +
    +
    +
    +
    + +

    Selects the option from a dropdown or list box given the value rather than key

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element that contains the option + +
    • + + + + + +
    • + + value + + : + + (string) + + the option to select from the dropdown + +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the key where the value was +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Dropdown.get_selected_value(element) +
    +
    +
    +
    + +

    Returns the currently selected value rather than index

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the gui element that you want to get the value of + +
    • + + +
    + + + + + Returns: +
      +
    • + (string) + the value that is currently selected +
    • +
    + + + + + + + + + +
    +
    +

    Elem Buttons

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + ElemButton.new_elem_button([name]) +
    +
    +
    +
    + +

    Creates a new elem button element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new elem button element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + ElemButton._prototype.set_type +
    +
    +
    +
    + +

    Sets the type of the elem button, the type is required so this must be called at least once

    +

    + + + +
      + + + + + +
    • + + type + + : + + (string) + + the type that this elem button is see factorio api + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ElemButton._prototype:set_default(value) +
    +
    +
    +
    + +

    Sets the default value for the elem button, this may be a function or a string

    +

    + + + Parameters: + +
      + + + + + +
    • + + value + + : + + (string or function) + + string a will be a static default and a function will be called when drawn to get the default + +
    • + + +
    + + + + + Returns: +
      +
    • + (the) + element define to allow for chaining +
    • +
    + + + + + + + + + +
    +
    +

    Progress Bars

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.global +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar.set_maximum(element, amount) +
    +
    +
    +
    + +

    Sets the maximum value that represents the end value of the progress bar

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement or string) + + either a gui element or a registered define + +
    • + + + + + +
    • + + amount + + : + + (number) + + the amount to have set as the maximum + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar.increment(element[, amount=1]) +
    +
    +
    +
    + +

    Increases the value of the progressbar, if a define is given all of its instances have incremented

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement or string) + + either a gui element or a registered define + +
    • + + + + + +
    • + + amount + + : + + (number) + + the amount to increase the progressbar by + + (default: 1) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar.decrement(element[, amount=1]) +
    +
    +
    +
    + +

    Decreases the value of the progressbar, if a define is given all of its instances have decremented

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement or string) + + either a gui element or a registered define + +
    • + + + + + +
    • + + amount + + : + + (number) + + the amount to decrease the progressbar by + + (default: 1) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar.new_progressbar([name]) +
    +
    +
    +
    + +

    Creates a new progressbar element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new progressbar element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:set_default_maximum(amount) +
    +
    +
    +
    + +

    Sets the maximum value that represents the end value of the progress bar

    +

    + + + Parameters: + +
      + + + + + +
    • + + amount + + : + + (number) + + the amount to have set as the maximum + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:use_count_down([state=true]) +
    +
    +
    +
    + +

    Will set the progress bar to start at 1 and trigger when it hits 0

    +

    + + + Parameters: + +
      + + + + + +
    • + + state + + : + + (boolean) + + when true the bar will start filled, to be used with decrease + + (default: true) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:increment([amount=1][, category]) +
    +
    +
    +
    + +

    Increases the value of the progressbar

    +

    + + + Parameters: + +
      + + + + + +
    • + + amount + + : + + (number) + + the amount to increase the progressbar by + + (default: 1) +
    • + + + + + +
    • + + category + + : + + (string) + + the category that is used with a store + + (optional) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:increment_filtered([amount=1], filter) +
    +
    +
    +
    + +

    Increases the value of the progressbar, if the filter condition is met, does not work with store

    +

    + + + Parameters: + +
      + + + + + +
    • + + amount + + : + + (number) + + the amount to increase the progressbar by + + (default: 1) +
    • + + + + + +
    • + + filter + + : + + (function) + + the filter to be used + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:decrement([amount=1][, category]) +
    +
    +
    +
    + +

    Decreases the value of the progressbar

    +

    + + + Parameters: + +
      + + + + + +
    • + + amount + + : + + (number) + + the amount to decrease the progressbar by + + (default: 1) +
    • + + + + + +
    • + + category + + : + + (string) + + the category that is used with a store + + (optional) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:decrement_filtered([amount=1], filter) +
    +
    +
    +
    + +

    Decreases the value of the progressbar, if the filter condition is met, does not work with store

    +

    + + + Parameters: + +
      + + + + + +
    • + + amount + + : + + (number) + + the amount to decrease the progressbar by + + (default: 1) +
    • + + + + + +
    • + + filter + + : + + (function) + + the filter to be used + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:add_element(element[, maximum]) +
    +
    +
    +
    + +

    Adds an element into the list of instances that will are waiting to complete, does not work with store + note use store if you want persistent data, this only stores the elements not the values which they have

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element that you want to add into the waiting to complete list + +
    • + + + + + +
    • + + maximum + + : + + (number) + + the maximum for this element if not given the default for this define is used + + (optional) +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:reset_element(element) +
    +
    +
    +
    + +

    Resets an element, or its store, to be back at the start, either 1 or 0

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element that you want to reset the progress of + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:event_counter([filter]) +
    +
    +
    +
    + +

    Event handler factory that counts up by 1 every time the event triggers, can filter which elements have incremented

    +

    + + + Parameters: + +
      + + + + + +
    • + + filter + + : + + (function) + + when given will use filtered increment + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (function) + the event handler +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + ProgressBar._prototype:event_countdown([filter]) +
    +
    +
    +
    + +

    Event handler factory that counts down by 1 every time the event triggers, can filter which elements have decremented

    +

    + + + Parameters: + +
      + + + + + +
    • + + filter + + : + + (function) + + when given will use filtered decrement + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (function) + the event handler +
    • +
    + + + + + + + + + +
    +
    +

    Sliders

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.instances +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Slider.new_slider([name]) +
    +
    +
    +
    + +

    Creates a new slider element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new slider element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Slider._prototype:set_range([min][, max]) +
    +
    +
    +
    + +

    Sets the range of a slider, if not used will use default values for a slider

    +

    + + + Parameters: + +
      + + + + + +
    • + + min + + : + + (number) + + the minimum value that the slider can take + + (optional) +
    • + + + + + +
    • + + max + + : + + (number) + + the maximum value that the slider can take + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + the define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Slider._prototype:draw_label(element) +
    +
    +
    +
    + +

    Draws a new label and links its value to the value of this slider, if no store then it will only show one value per player

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the parent element that the label will be drawn to + +
    • + + +
    + + + + + Returns: +
      +
    • + (LuaGuiElement) + the new label element so that styles can be applied +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Slider._prototype:enable_auto_draw_label([state=true]) +
    +
    +
    +
    + +

    Enables auto draw of the label, the label will share the same parent element as the slider

    +

    + + + Parameters: + +
      + + + + + +
    • + + state + + : + + (boolean) + + when false will disable the auto draw of the label + + (default: true) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + the define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +

    Text

    +
    +
    +
    +
    + # + expcore.gui.core +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.prototype +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Text.new_text_field([name]) +
    +
    +
    +
    + +

    Creates a new text field element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new text field element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Text.new_text_box([name]) +
    +
    +
    +
    + +

    Creates a new text box element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the optional debug name that can be added + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the new text box element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Text._prototype_box:set_selectable([state=true]) +
    +
    +
    +
    + +

    Sets the text box to be selectable

    +

    + + + Parameters: + +
      + + + + + +
    • + + state + + : + + (boolean) + + when false will set the state to false + + (default: true) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + table the define to allow for chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Text._prototype_box:set_word_wrap([state=true]) +
    +
    +
    +
    + +

    Sets the text box to have word wrap

    +

    + + + Parameters: + +
      + + + + + +
    • + + state + + : + + (boolean) + + when false will set the state to false + + (default: true) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + table the define to allow for chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Text._prototype_box:set_read_only([state=true]) +
    +
    +
    +
    + +

    Sets the text box to be read only

    +

    + + + Parameters: + +
      + + + + + +
    • + + state + + : + + (boolean) + + when false will set the state to false + + (default: true) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + table the define to allow for chaining +
    • +
    + + + + + + + + + +
    +
    +

    Instances

    +
    +
    +
    +
    + # + utils.global +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Instances.has_categories(name) +
    +
    +
    +
    + +

    Returns if a instance group has a categorise function; must be registered

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if there is a categorise function +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Instances.is_registered(name) +
    +
    +
    +
    + +

    Returns if the given name is a registered instance group

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group you are testing + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if the name is registered +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Instances.register(name[, categorise]) +
    +
    +
    +
    + +

    Registers the name of an instance group to allow for storing element instances

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group; must to unique + +
    • + + + + + +
    • + + categorise + + : + + (function) + + function used to turn the element into a string + categorise param - element LuaGuiElement - the gui element to be turned into a string + categorise return - string - the category that the element will be added to like the player's name or force's name + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (string) + the name that was added so it can be used as a variable +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Instances.add_element(name, element) +
    +
    +
    +
    + +

    Adds an element to the instance group under the correct category; must be registered

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group to add the element to + +
    • + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element to add the the instance group + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Instances.get_elements_raw(name[, category]) +
    +
    +
    +
    + +

    Gets all element instances without first removing any invalid ones; used internally and must be registered

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group to get the instances of + +
    • + + + + + +
    • + + category + + : + + (string) + + the category to get the instance from, not needed when no categorise function + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the table of element instances of which some may be invalid +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Instances.get_valid_elements(name[, category][, callback]) +
    +
    +
    +
    + +

    Gets all valid element instances and has the option of running a callback on those that are valid

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group to get the instances of + +
    • + + + + + +
    • + + category + + : + + (string) + + the category to get the instances of, not needed when no categorise function + + (optional) +
    • + + + + + +
    • + + callback + + : + + (function) + + when given the callback will be ran on all valid elements + callback param - element LuaGuiElement - the current valid element + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the table of element instances with all invalid ones removed +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Instances.unregistered_add_element(name, category, element) +
    +
    +
    +
    + +

    A version of add_element that does not require the group to be registered

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group to add the element to + +
    • + + + + + +
    • + + category + + : + + (string or nil) + + the category to add the element to, can be nil but must still be given + +
    • + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element to add to the instance group + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Instances.unregistered_get_elements(name, category[, callback]) +
    +
    +
    +
    + +

    A version of get_elements that does not require the group to be registered

    +

    + + + Parameters: + +
      + + + + + +
    • + + name + + : + + (string) + + the name of the instance group to get the instances of + +
    • + + + + + +
    • + + category + + : + + (string or nil) + + the category to get the instances of, can be nil but must still be given + +
    • + + + + + +
    • + + callback + + : + + (function) + + when given will be called on all valid instances + callback param - element LuaGuiElement - the current valid element + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + the table of element instances with all invalid ones removed +
    • +
    + + + + + + + + + +
    +
    +

    Prototype

    +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.store +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.gui.instances +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + Constructor.event(event_name) +
    +
    +
    +
    + +

    Creates a new function to add functions to an event handler

    @@ -4367,45 +9760,11 @@ Gui.get_concept('button') (string) - the name of the event to add, must be unique, recomented to start with "on_" + the name of the event that callbacks will be added to - - - -
  • - - factorio_event - - : - - (defines.events) - - when given will fire the custom event when the factorio event is raised - - (optional) -
  • - - - - - -
  • - - event_condition - - : - - (function) - - used to filter when a factorio event triggers the custom event; if the event contains a reference to an element then names are automatically filtered - - (optional) -
  • - - @@ -4414,8 +9773,8 @@ Gui.get_concept('button') Returns:
    • - (GuiConcept) - to allow chaining of functions + (function) + the function used to register handlers
    @@ -4425,27 +9784,20 @@ Gui.get_concept('button') - Usage: -
    -- Adds an on_admin_clicked event to fire when ever an admin clicks the button
    -local custom_button =
    -Gui.get_concept('Button'):clone('CustomButton')
    -:new_event('on_admin_clicked',defines.events.on_gui_click,function(event)
    -    return event.player.admin -- only raise custom event when an admin clicks the button
    -end)
    - # - Prototype:on_custom_event(handler) + # + Constructor.extend(new_prototype)
    -

    Adds a custom event handler, replace with the name of the event

    +

    Extents a prototype with the base functions of all gui prototypes, no metatables

    @@ -4459,13 +9811,13 @@ Gui.get_concept('Button'):clone( - handler + new_prototype : - (function) + (table) - the function which will recive the event + the prototype that you want to add the functions to @@ -4478,8 +9830,689 @@ Gui.get_concept('Button'):clone(Returns:
    • - (GuiConcept) - to allow chaining of functions + (table) + the same prototype but with the new functions added +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Constructor.store(sync, callback) +
    +
    +
    +
    + +

    Creates a new function which adds a store to a gui define

    +

    + + + Parameters: + +
      + + + + + +
    • + + sync + + : + + (boolean) + + if the function should create a synced store + +
    • + + + + + +
    • + + callback + + : + + (function) + + the function called when needing to update the value of an element + +
    • + + +
    + + + + + Returns: +
      +
    • + (function) + the function that will add a store for this define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Constructor.setter(value_type, key[, second_key]) +
    +
    +
    +
    + +

    Creates a setter function that checks the type when a value is set

    +

    + + + Parameters: + +
      + + + + + +
    • + + value_type + + : + + (string) + + the type that the value should be when it is set + +
    • + + + + + +
    • + + key + + : + + (string) + + the key of the define that will be set + +
    • + + + + + +
    • + + second_key + + : + + (string) + + allows for setting of a key in a sub table + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (function) + the function that will check the type and set the value +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Prototype:uid() +
    +
    +
    +
    + +

    Gets the uid for the element define

    +

    + + + + + + Returns: +
      +
    • + (string) + the uid of this element define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Prototype.debug_name +
    +
    +
    +
    + +

    Sets a debug alias for the define

    +

    + + + +
      + + + + + +
    • + + name + + : + + (string) + + the debug name for the element define that can be used to get this element define + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype.set_caption +
    +
    +
    +
    + +

    Sets the caption for the element define

    +

    + + + +
      + + + + + +
    • + + caption + + : + + (string) + + the caption that will be drawn with the element + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype.set_tooltip +
    +
    +
    +
    + +

    Sets the tooltip for the element define

    +

    + + + +
      + + + + + +
    • + + tooltip + + : + + (string) + + the tooltip that will be displayed for this element when drawn + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype.set_pre_authenticator +
    +
    +
    +
    + +

    Sets an authenticator that blocks the draw function if check fails

    +

    + + + +
      + + + + + +
    • + + callback + + : + + (function) + + the function that will be ran to test if the element should be drawn or not + callback param - LuaPlayer player - the player that the element is being drawn to + callback param - string define_name - the name of the define that is being drawn + callback return - boolean - false will stop the element from being drawn + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype.set_post_authenticator +
    +
    +
    +
    + +

    Sets an authenticator that disables the element if check fails

    +

    + + + +
      + + + + + +
    • + + callback + + : + + (function) + + the function that will be ran to test if the element should be enabled or not + callback param - LuaPlayer player - the player that the element is being drawn to + callback param - string define_name - the name of the define that is being drawn + callback return - boolean - false will disable the element + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype.on_draw +
    +
    +
    +
    + +

    Registers a callback to the on_draw event

    +

    + + + +
      + + + + + +
    • + + callback + + : + + (function) + + + callback param - LuaPlayer player - the player that the element was drawn to + callback param - LuaGuiElement element - the element that was drawn + callback param - any ... - any other params passed by the draw_to function + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype.on_style_update +
    +
    +
    +
    + +

    Registers a callback to the on_style_update event

    +

    + + + +
      + + + + + +
    • + + callback + + : + + (function) + + + callback param - LuaStyle style - the style that was changed and/or needs changing + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + Prototype:set_style(style[, callback]) +
    +
    +
    +
    + +

    Sets the style for the element define

    +

    + + + Parameters: + +
      + + + + + +
    • + + style + + : + + (string) + + the style that will be used for this element when drawn + +
    • + + + + + +
    • + + callback + + : + + (function) + + function is called when element is drawn to alter its style + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + the element define to allow chaining +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Prototype:set_embedded_flow(state) +
    +
    +
    +
    + +

    Sets the element to be drawn inside a nameless flow, can be given a name using a function

    +

    + + + Parameters: + +
      + + + + + +
    • + + state + + : + + (boolean or function) + + when true a padless flow is created to contain the element + +
    • + + +
    + + + + + Returns: +
      +
    • + (self) + the element define to allow chaining
    @@ -4489,13 +10522,6 @@ Gui.get_concept('Button'):clone( - Usage: -
    -- When an admin clicks the button a message is printed
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -:on_admin_clicked(function(event)
    -    game.print(event.player.name..' pressed my admin button')
    -end)
    @@ -4503,13 +10529,13 @@ Gui.get_concept('CustomButton')
    # - Prototype:raise_event(event_name[, event={}][, from_factorio=false]) + Prototype:raise_event(event_name, ...)
    -

    Raises a custom event, folowing keys included automaticlly: concept, event name, game tick, player from player_index, element if valid

    +

    Raises a custom event for this define, any number of params can be given

    @@ -4539,15 +10565,186 @@ Gui.get_concept('CustomButton')
  • - event + ... : - (table) + (any) - table containg data you want to send with the event, some keys already included + any params that you want to pass to the event + +
  • + + + + + + + + Returns: +
      +
    • + (number) + the number of handlers that were registered +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Prototype:draw_to(element) +
    +
    +
    +
    + +

    The main function for defines, when called will draw an instance of this define to the given element + what is drawn is based on the data in draw_data which is set using other functions

    +

    + + + Parameters: + +
      + + + + + +
    • + + element + + : + + (LuaGuiElement) + + the element that the define will draw a instance of its self onto + +
    • + + +
    + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + Prototype:get_store(category) +
    +
    +
    +
    + +

    Gets the value in this elements store, category needed if categorize function used

    +

    + + + Parameters: + +
      + + + + + +
    • + + category + + : + + (string) + + [opt] the category to get such as player name or force name + +
    • + + +
    + + + + + Returns: +
      +
    • + (any) + the value that is stored for this define +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Prototype:set_store(category, value) +
    +
    +
    +
    + +

    Sets the value in this elements store, category needed if categorize function used

    +

    + + + Parameters: + +
      + + + + + +
    • + + category + + : + + (string) + + [opt] the category to get such as player name or force name - (default: {})
    • @@ -4556,122 +10753,27 @@ Gui.get_concept('CustomButton')
    • - from_factorio + value : + (any) + + the value to set for this define, must be valid for its type ie for checkbox etc + +
    • + + +
    + + + + + Returns: +
      +
    • (boolean) - - internal use, if the raise came from the factorio event handler - - (default: false) -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Raising the custom event on_admin_clicked
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    --- Note that this is an example and would not work due it expecting a valid element for event.element
    --- this will however work fine if you can provide all expected keys, or its not linked to any factorio event
    -custom_button:raise_event('on_admin_clicked',{
    -    player_index = game.player.index
    -})
    - - -
    -
    -
    -
    - # - Prototype:new_property(property_name[, setter_callback][, default]) -
    -
    -
    -
    - -

    Adds a new property to the concept, such as caption, tooltip, or some custom property you want to control

    -

    - - - Parameters: - -
      - - - - - -
    • - - property_name - - : - - (string) - - the name of the new property, must be unique - -
    • - - - - - -
    • - - setter_callback - - : - - (function) - - this function is called when set is called, if not provided then key in concept.properties is updated to new value - - (optional) -
    • - - - - - -
    • - - default - - : - - (any) - - use this as the default value, will call the setter callback if defined - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (GuiConcept) - to allow chaining of functions + true if the value was set
    @@ -4681,35 +10783,20 @@ Gui.get_concept('CustomButton') - Usage: -
    -- Adding caption, sprite, and tooltip to the base button concept
    -local button =
    -Gui.get_concept('Button')
    -:new_property('tooltip')
    -:new_property('caption',nil,function(properties,value)
    -    properties.caption = value
    -    properties.sprite = nil
    -    properties.type = 'button'
    -end)
    -:new_property('sprite',nil,function(properties,value)
    -    properties.image = value
    -    properties.caption = nil
    -    properties.type = 'sprite-button'
    -end)
    - # - Prototype:set_custom_property(value) + # + Prototype:clear_store([category])
    -

    Sets a new value for a property, triggers setter method if provided, replace with property name

    +

    Sets the value in this elements store to nil, category needed if categorize function used

    @@ -4721,391 +10808,6 @@ Gui.get_concept('Button') -
  • - - value - - : - - (any) - - the value that you want to set for this property - -
  • - - - - - - - - Returns: -
      -
    • - (GuiConcept) - to allow chaining of functions -
    • -
    - - - - - - - - Usage: -
    -- Setting the caption on the base button concept after a cloning
    -local custom_button =
    -Gui.get_concept('Button')
    -:set_caption('Default Button')
    -
    -- In our examples CustomButton is cloned from Button, this means the caption property already exists
    --- note that what ever values that properties have at the time of cloning are also copied
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -:set_caption('Custom Button')
    - - -
    -
    -
    -
    - # - Prototype:define_draw(draw_callback) -
    -
    -
    -
    - -

    Used to define how the concept is turned into an ingame element or "instance" as we may refer to them

    -

    - - - Parameters: - -
      - - - - - -
    • - - draw_callback - - : - - (function) - - the function that will be called to draw/update the instance; this function must return the instance or the new acting instance - -
    • - - -
    - - - - - Returns: -
      -
    • - (GuiConcept) - to allow chaining of functions -
    • -
    - - - - - - - - Usage: -
    -- Adding the draw define for the base button concept, we then return the element
    -local button =
    -Gui.get_concept('Button')
    -:define_draw(function(properties,parent,element)
    -    -- Properties will include all the information that you need to draw the element
    -    -- Parent is the parent element for the element, this may have been altered by previous draw functions
    -    -- Element is the current element being made, this may have a nil value, if it is nil then this is the first draw function
    -    -- You can also pass any other arguments that you want to this function from the draw call
    -    if properties.type == 'button' then
    -        element = parent.add{
    -            type = properties.type,
    -            name = properties.name,
    -            caption = properties.caption,
    -            tooltip = properties.tooltip
    -        }
    -
    -    else
    -        element = parent.add{
    -            type = properties.type,
    -            name = properties.name,
    -            sprite = properties.sprite,
    -            tooltip = properties.tooltip
    -        }
    -
    -    end
    -
    -    -- If you return element or parent then their values will be updated for the next draw function in the chain
    -    -- It is best practice to always return the values if you have made any changes to them
    -    return element, parent
    -end)
    - - -
    -
    -
    -
    - # - Prototype:draw(parent_element[, override_name]) -
    -
    -
    -
    - -

    Calls all the draw functions in order to create this concept in game; will also store and sync the instance if stores are used

    -

    - - - Parameters: - -
      - - - - - -
    • - - parent_element - - : - - (LuaGuiElement) - - the element that the concept will use as a base - -
    • - - - - - -
    • - - override_name - - : - - (string) - - when given this will be the name of the element rather than the concept id - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (LuaGuiElement) - the element that was created and then passed though and returned by the draw functions -
    • -
    - - - - - - - - Usage: -
    -- Drawing the custom button concept
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    --- Note that the draw function from button was cloned, so unless we want to alter the base button we dont need a new draw define
    -custom_button:draw(game.player.gui.left)
    - - -
    -
    -

    Concept Instances

    -
    -
    -
    -
    - # - Prototype:define_instance_store([category_callback]) -
    -
    -
    -
    - -

    Adds an instance store to the concept; when a new instance is made it is stored so you can access it later

    -

    - - - Parameters: - -
      - - - - - -
    • - - category_callback - - : - - (function) - - when given will act as a way to turn an element into a string to act as a key; keys returned can over lap - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (GuiConcept) - to allow chaining of functions -
    • -
    - - - - - - - - Usage: -
    -- Allowing storing instances of the custom button; stored by the players index
    --- Note even thou this is a copy of Button; if Button had an instance store it would not be cloned over
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -:define_instance_store(function(element)
    -    return element.player_index -- The instances are stored based on player id
    -end)
    - - -
    -
    -
    -
    - # - Prototype.get_instances([category]) -
    -
    -
    -
    - -

    Gets all insatnces in a category, category may be nil to return all

    -

    - - - Parameters: - -
      - - - - - -
    • - - category - - : - - (string or LuaGuiElement) - - the category to get, can only be nil if categories are not used - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - a table which contains all the instances -
    • -
    - - - - - - - - Usage: -
    -- Getting all the instances of the player with index 1
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    -custom_button.get_instances(1) -- player index 1
    - - -
    -
    -
    -
    - # - Prototype.add_instance(element[, category]) -
    -
    -
    -
    - -

    Adds an instance to this concept, used automatically during concept:draw

    -

    - - - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the element that will be added as an instance - -
    • - - - - -
    • category @@ -5114,142 +10816,7 @@ custom_button.get_instances(1) -- player index string) - the category to add this element under, if nil the category callback is used to assign one - - (optional) -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Adding an element as a instance for this concept, mostly for internal use
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    -custom_button.add_instance(element) -- normally not needed due to use in concept:draw
    - - -
    -
    -
    -
    - # - Prototype.update_instances([category], update_callback) -
    -
    -
    -
    - -

    Applies an update function to all instances, simialr use to what table.forEach would be

    -

    - - - Parameters: - -
      - - - - - -
    • - - category - - : - - (string or LuaGuiElement) - - the category to get, can only be nil if categories are not used - - (optional) -
    • - - - - - -
    • - - update_callback - - : - - (function) - - the function which is called on each instance, recives other args passed to update_instances - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Changing the font color of all instances for player 1
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    -custom_button.update_instances(1,function(element)
    -    element.style.font_color = {r=1,g=0,b=0}
    -end)
    - - -
    -
    -

    Concept Data

    -
    -
    -
    -
    - # - Prototype:define_data_store([category_callback]) -
    -
    -
    -
    - -

    Adds a data store to this concept which allows you to store synced/percistent data between instances

    -

    - - - Parameters: - -
      - - - - - -
    • - - category_callback - - : - - (function) - - when given will act as a way to turn an element into a string to act as a key; keys returned can over lap + the category to get such as player name or force name (optional)
    • @@ -5263,8 +10830,8 @@ custom_button.update_instances(1,GuiConcept) - to allow chaining of functions + (boolean) + true if the value was set
    @@ -5274,364 +10841,27 @@ custom_button.update_instances(1,-- Adding a way to store data for this concept; each player has their own store --- Note even thou this is a copy of Button; if Button had an data store it would not be cloned over -local custom_button = -Gui.get_concept('CustomButton') -:define_data_store(function(element) - return element.player_index -- The data is stored based on player id -end) - - -
    -
    -
    -
    - # - Prototype.get_data([category]) -
    -
    -
    -
    - -

    Gets the data that is stored for this category

    -

    - - - Parameters: - -
      - - - - - -
    • - - category - - : - - (string or LuaGuiElement) - - the category to get, can only be nil if categories are not used - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (any) - the data that you had stored in this location -
    • -
    - - - - - - - - Usage: -
    -- Getting the stored data for player 1
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    -custom_button.get_data(1) -- player index 1
    - - -
    -
    -
    -
    - # - Prototype.set_data([category], value) -
    -
    -
    -
    - -

    Sets the data that is stored for this category

    -

    - - - Parameters: - -
      - - - - - -
    • - - category - - : - - (string or LuaGuiElement) - - the category to set, can only be nil if categories are not used - - (optional) -
    • - - - - - -
    • - - value - - : - - (any) - - the data that you want to stored in this location - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Setting the data for player 1 to a table with two keys
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    --- A table is used to show correct way to use a table with self.update_data
    --- but a table is not required and can be any data, however upvalues may cause desyncs
    -custom_button.set_data(1,{
    -    clicks = 0,
    -    required_clicks = 100
    -}) -- player index 1
    - - -
    -
    -
    -
    - # - Prototype.clear_data([category]) -
    -
    -
    -
    - -

    Clears the data that is stored for this category

    -

    - - - Parameters: - -
      - - - - - -
    • - - category - - : - - (string or LuaGuiElement) - - the category to clear, can only be nil if categories are not used - - (optional) -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Clearing the data for player 1
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    -custom_button.clear_data(1) -- player index 1
    - - -
    -
    -
    -
    - # - Prototype.update_data([category], update_callback) -
    -
    -
    -
    - -

    Updates the data that is stored for this category

    -

    - - - Parameters: - -
      - - - - - -
    • - - category - - : - - (string or LuaGuiElement) - - the category to clear, can only be nil if categories are not used - - (optional) -
    • - - - - - -
    • - - update_callback - - : - - (function) - - the function which is called to update the data - -
    • - - -
    - - - - - - - - - - - - Usage: -
    -- Updating the clicks key in the concept data for player 1
    -local custom_button =
    -Gui.get_concept('CustomButton')
    -
    -custom_button.update_data(1,function(tbl)
    -    tbl.clicks = tbl.clicks + 1 -- here we are incrementing the clicks by 1
    -end) -- player index 1
    -
    -
    -- Updating a value when a table is not used, alterative to get set
    --- so for this example assume that we did custom_button.set_data(1,0)
    -custom_button.update_data(1,function(value)
    -    return value + 1 -- here we are incrementing the value by 1, we may only be tracking clicks
    -end) -- player index 1
    -

    Concept Combined Instances

    +

    Test

    - # - Prototype:define_combined_store([category_callback], sync_callback) + # + expcore.gui
    -

    Used to add a both instance and data store which are linked together, new instances are synced to the current value, changing the stored value will change all instances

    -

    - Parameters: - -
      - - - - - -
    • - - category_callback - - : - - (function) - - when given will act as a way to turn an element into a string to act as a key; keys returned can over lap - - (optional) -
    • - - - - - -
    • - - sync_callback - - : - - (function) - - the function which is called to update an instance to match the store, this is called on all instances when concept.set_data or update_data is used - -
    • - - -
    - - Returns: -
      -
    • - (GuiConcept) - to allow chaining of functions -
    • -
    @@ -5639,59 +10869,21 @@ custom_button.update_data(1,fu - Usage: -
    -- Adding a check box which is a "global setting" synced between all players
    -local custom_button =
    -Gui.get_concept('checkbox'):clone('my_checkbox')
    -:set_caption('My Checkbox')
    -:set_tooltip('Clicking this check box will change it for everyone')
    -:on_state_changed(function(event)
    -    local element = event.element
    -    event.concept.set_data(element,element.state) -- Update the stored data to trigger an update of all other instances
    -end)
    -:define_combined_store(function(element,state) -- We could add a category function here if we wanted to
    -    element.state = state or false -- Note that the value passed may be nil if there is no stored value and no default set
    -end)
    - # - Prototype.sync_instance(element) + # + expcore.common
    -

    Will sync an instance to match the stored value based on the given sync callback

    -

    - Parameters: - -
      - - - - - -
    • - - element - - : - - (LuaGuiElement) - - the element that you want to have update - -
    • - - -
    - @@ -5702,73 +10894,71 @@ Gui.get_concept('checkbox'):clone(-- Setting the caption of this element to be the same as the stored value -local custom_button = -Gui.get_concept('CustomButton') - --- Used internally when first draw and automatically when the store updates -custom_button.sync_instance(element)
    -
    -

    Tests

    -
    - # - run_tests(player[, category]) + # + resources.color_presets +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.event +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + # + expcore.store
    -

    Runs a set of gui tests to ensure that the system is working

    -

    - Parameters: - -
      - - - - - -
    • - - player - - : - - (LuaPlayer) - - the player that the guis are made for and who recives the results - -
    • - - - - - -
    • - - category - - : - - (string) - - when given only tests in this category are ran - - (optional) -
    • - - -
    - @@ -5779,9 +10969,6 @@ Gui.get_concept('CustomButton') - Usage: -
    -- Run all gui tests
    -Gui.run_tests(game.player)
    @@ -5800,7 +10987,7 @@ Gui.get_concept('CustomButton') generated by LDoc diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index 14d8fd23..cffa89f8 100644 --- a/docs/core/Permissions-Groups.html +++ b/docs/core/Permissions-Groups.html @@ -56,12 +56,10 @@ - - @@ -1434,7 +1432,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index dbd23fa6..3187a4f7 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -60,12 +60,10 @@ - - @@ -3154,7 +3152,7 @@ generated by LDoc diff --git a/docs/core/Store.html b/docs/core/Store.html index 3b0822b1..97eda35f 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -53,12 +53,10 @@ - - @@ -1205,7 +1203,7 @@ this is similar to Store.get but will always return a table even if it is empty< generated by LDoc diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index 1e719894..53d24d08 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -53,12 +53,10 @@ - - @@ -546,7 +544,7 @@ generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index 5afefbbf..5d601cbe 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -65,12 +65,10 @@ - - @@ -628,7 +626,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index 8804e5c6..e3d10a38 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -65,12 +65,10 @@ - - @@ -631,7 +629,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 3a06ef3e..59dc47ca 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -65,12 +65,10 @@ - - @@ -451,7 +449,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index 8178d793..a97b0a3e 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -65,12 +65,10 @@ - - @@ -634,7 +632,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index c267b5c2..75ae9c1d 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -65,12 +65,10 @@ - - @@ -839,7 +837,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index e1859d62..6466ea5d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -56,11 +56,11 @@ Gui - Core Module - Gui - - - ExpStyle - Core Module - ExpStyle + Core Module - Gui + - This file is used to require all the different elements of the gui module + - each module has an outline here but for more details see their separate files in ./gui + - please read the files for more documentation that cant be shown here + - please note there is a rework planned but not started Permissions-Groups @@ -82,10 +82,6 @@ Core Module - Sudo - An extention of task and token to allow a single require to register and run functions bypassing all permissions. - - Toolbar - Core Module - Toolbar -

    Addons

    @@ -518,7 +514,7 @@ see ./expcore/commands.lua for more detailsgenerated by LDoc diff --git a/docs/modules/control.html b/docs/modules/control.html index 96f093f1..88f0ccce 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -72,12 +72,10 @@ - - @@ -353,7 +351,7 @@ generated by LDoc diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html index d8b98af4..c377d74b 100644 --- a/docs/modules/utils.alien_evolution_progress.html +++ b/docs/modules/utils.alien_evolution_progress.html @@ -73,12 +73,10 @@ - - @@ -421,7 +419,7 @@ fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on generated by LDoc diff --git a/docs/modules/utils.core.html b/docs/modules/utils.core.html index 8d316e12..3378c6d3 100644 --- a/docs/modules/utils.core.html +++ b/docs/modules/utils.core.html @@ -74,12 +74,10 @@ - - @@ -1166,7 +1164,7 @@ generated by LDoc diff --git a/docs/modules/utils.debug.html b/docs/modules/utils.debug.html index 40c5610d..b00a200b 100644 --- a/docs/modules/utils.debug.html +++ b/docs/modules/utils.debug.html @@ -72,12 +72,10 @@ - - @@ -656,7 +654,7 @@ generated by LDoc diff --git a/docs/modules/utils.dump_env.html b/docs/modules/utils.dump_env.html index 02727b03..e4dc2c92 100644 --- a/docs/modules/utils.dump_env.html +++ b/docs/modules/utils.dump_env.html @@ -72,12 +72,10 @@ - - @@ -325,7 +323,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index dfa11db4..62b58139 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -73,12 +73,10 @@ - - @@ -1294,7 +1292,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index 38eff51c..64b7e446 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -72,12 +72,10 @@ - - @@ -436,7 +434,7 @@ generated by LDoc diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html index da148586..56d4d37f 100644 --- a/docs/modules/utils.math.html +++ b/docs/modules/utils.math.html @@ -72,12 +72,10 @@ - - @@ -355,7 +353,7 @@ generated by LDoc diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html index e422551c..3f85b13d 100644 --- a/docs/modules/utils.recipe_locker.html +++ b/docs/modules/utils.recipe_locker.html @@ -73,12 +73,10 @@ - - @@ -443,7 +441,7 @@ generated by LDoc diff --git a/docs/modules/utils.state_machine.html b/docs/modules/utils.state_machine.html index daa620a5..98f7bcd5 100644 --- a/docs/modules/utils.state_machine.html +++ b/docs/modules/utils.state_machine.html @@ -73,12 +73,10 @@ - - @@ -754,7 +752,7 @@ generated by LDoc diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html index b90becff..3cbf7778 100644 --- a/docs/modules/utils.table.html +++ b/docs/modules/utils.table.html @@ -74,12 +74,10 @@ - - @@ -1420,7 +1418,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index db13570d..00472a97 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -73,12 +73,10 @@ - - @@ -653,7 +651,7 @@ generated by LDoc diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html index ef9b3b28..99473b65 100644 --- a/docs/modules/utils.timestamp.html +++ b/docs/modules/utils.timestamp.html @@ -72,12 +72,10 @@ - - @@ -444,7 +442,7 @@ generated by LDoc diff --git a/docs/topics/license.html b/docs/topics/license.html index 2268d7de..e28db313 100644 --- a/docs/topics/license.html +++ b/docs/topics/license.html @@ -53,12 +53,10 @@ - - @@ -791,7 +789,7 @@ Public License instead of this License. But first, please read generated by LDoc diff --git a/docs/topics/readme.md.html b/docs/topics/readme.md.html index b5eed503..cc1c1178 100644 --- a/docs/topics/readme.md.html +++ b/docs/topics/readme.md.html @@ -53,12 +53,10 @@ - - @@ -335,7 +333,7 @@ generated by LDoc From bc2a8d3bdbd4451a783f41c3d326343aca7e6998 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 8 Oct 2019 23:24:11 +0100 Subject: [PATCH 68/93] Added new store module --- docs/addons/Advanced-Start.html | 2 +- docs/addons/Chat-Popups.html | 2 +- docs/addons/Chat-Reply.html | 2 +- docs/addons/Compilatron.html | 2 +- docs/addons/Damage-Popups.html | 2 +- docs/addons/Death-Logger.html | 2 +- docs/addons/Discord-Alerts.html | 2 +- docs/addons/Player-Colours.html | 2 +- docs/addons/Pollution-Grading.html | 2 +- docs/addons/Scorched-Earth.html | 2 +- docs/addons/Spawn-Area.html | 2 +- docs/commands/Admin-Chat.html | 2 +- docs/commands/Bonus.html | 2 +- docs/commands/Cheat-Mode.html | 2 +- docs/commands/Clear-Inventory.html | 2 +- docs/commands/Debug.html | 2 +- docs/commands/Find.html | 2 +- docs/commands/Help.html | 2 +- docs/commands/Home.html | 2 +- docs/commands/Interface.html | 2 +- docs/commands/Jail.html | 2 +- docs/commands/Kill.html | 2 +- docs/commands/Me.html | 2 +- docs/commands/Rainbow.html | 2 +- docs/commands/Repair.html | 2 +- docs/commands/Reports.html | 2 +- docs/commands/Roles.html | 2 +- docs/commands/Spawn.html | 2 +- docs/commands/Tag.html | 2 +- docs/commands/Teleport.html | 2 +- docs/commands/Warnings.html | 2 +- docs/configs/Advanced-Start.html | 2 +- docs/configs/Bonuses.html | 2 +- docs/configs/Chat-Reply.html | 2 +- docs/configs/Commands-Auth-Admin.html | 2 +- docs/configs/Commands-Auth-Roles.html | 2 +- .../Commands-Auth-Runtime-Disable.html | 2 +- docs/configs/Commands-Parse-Roles.html | 2 +- docs/configs/Commands-Parse.html | 2 +- docs/configs/Compilatron.html | 2 +- docs/configs/Death-Logger.html | 2 +- docs/configs/Discord-Alerts.html | 2 +- docs/configs/File-Loader.html | 2 +- docs/configs/Permission-Groups.html | 2 +- docs/configs/Player-List.html | 2 +- docs/configs/Pollution-Grading.html | 2 +- docs/configs/Popup-Messages.html | 2 +- docs/configs/Preset-Player-Colours.html | 2 +- docs/configs/Repair.html | 2 +- docs/configs/Rockets.html | 2 +- docs/configs/Roles.html | 2 +- docs/configs/Science.html | 2 +- docs/configs/Scorched-Earth.html | 2 +- docs/configs/Spawn-Area.html | 2 +- docs/configs/Tasks.html | 2 +- docs/configs/Warnings.html | 2 +- docs/configs/Warps.html | 2 +- docs/control/Jail.html | 2 +- docs/control/Production.html | 2 +- docs/control/Reports.html | 2 +- docs/control/Rockets.html | 2 +- docs/control/Tasks.html | 2 +- docs/control/Warnings.html | 2 +- docs/control/Warps.html | 2 +- docs/core/Commands.html | 2 +- docs/core/Common-Library.html | 2 +- docs/core/Gui.html | 2 +- docs/core/Permissions-Groups.html | 2 +- docs/core/Roles.html | 2 +- docs/core/Store.html | 1003 +++++++++-------- docs/core/Sudo.html | 2 +- docs/guis/Player-List.html | 2 +- docs/guis/Rocket-Info.html | 2 +- docs/guis/Science-Info.html | 2 +- docs/guis/Task-List.html | 2 +- docs/guis/Warps-List.html | 2 +- docs/index.html | 4 +- docs/modules/control.html | 2 +- .../utils.alien_evolution_progress.html | 2 +- docs/modules/utils.core.html | 2 +- docs/modules/utils.debug.html | 2 +- docs/modules/utils.dump_env.html | 2 +- docs/modules/utils.event.html | 2 +- docs/modules/utils.event_core.html | 2 +- docs/modules/utils.math.html | 2 +- docs/modules/utils.recipe_locker.html | 2 +- docs/modules/utils.state_machine.html | 2 +- docs/modules/utils.table.html | 2 +- docs/modules/utils.task.html | 2 +- docs/modules/utils.timestamp.html | 2 +- docs/topics/license.html | 2 +- docs/topics/readme.md.html | 2 +- expcore/store.lua | 659 ++++++----- 93 files changed, 1021 insertions(+), 825 deletions(-) diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index 17a11fd8..d5f1bc3d 100644 --- a/docs/addons/Advanced-Start.html +++ b/docs/addons/Advanced-Start.html @@ -348,7 +348,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Popups.html b/docs/addons/Chat-Popups.html index ec447b0d..ea439bd3 100644 --- a/docs/addons/Chat-Popups.html +++ b/docs/addons/Chat-Popups.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html index 227a2701..eae91d5e 100644 --- a/docs/addons/Chat-Reply.html +++ b/docs/addons/Chat-Reply.html @@ -376,7 +376,7 @@ generated by LDoc diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html index dc49b78b..04c36e4c 100644 --- a/docs/addons/Compilatron.html +++ b/docs/addons/Compilatron.html @@ -585,7 +585,7 @@ generated by LDoc diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html index c5d5f078..c72338fe 100644 --- a/docs/addons/Damage-Popups.html +++ b/docs/addons/Damage-Popups.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html index 71cc9bde..49d07665 100644 --- a/docs/addons/Death-Logger.html +++ b/docs/addons/Death-Logger.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html index 27d0af48..1ea9565d 100644 --- a/docs/addons/Discord-Alerts.html +++ b/docs/addons/Discord-Alerts.html @@ -460,7 +460,7 @@ generated by LDoc diff --git a/docs/addons/Player-Colours.html b/docs/addons/Player-Colours.html index 7d67adeb..1d4b5b81 100644 --- a/docs/addons/Player-Colours.html +++ b/docs/addons/Player-Colours.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html index d488a111..bbeed3d3 100644 --- a/docs/addons/Pollution-Grading.html +++ b/docs/addons/Pollution-Grading.html @@ -320,7 +320,7 @@ generated by LDoc diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html index 55bea826..5ad78aaf 100644 --- a/docs/addons/Scorched-Earth.html +++ b/docs/addons/Scorched-Earth.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html index 13dfba39..9101a4df 100644 --- a/docs/addons/Spawn-Area.html +++ b/docs/addons/Spawn-Area.html @@ -376,7 +376,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html index 731be00d..f5aba74f 100644 --- a/docs/commands/Admin-Chat.html +++ b/docs/commands/Admin-Chat.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Bonus.html b/docs/commands/Bonus.html index d49279c2..16cb2030 100644 --- a/docs/commands/Bonus.html +++ b/docs/commands/Bonus.html @@ -500,7 +500,7 @@ generated by LDoc diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html index accc40eb..5ff916a9 100644 --- a/docs/commands/Cheat-Mode.html +++ b/docs/commands/Cheat-Mode.html @@ -361,7 +361,7 @@ generated by LDoc diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html index e20883e3..e1d7aa45 100644 --- a/docs/commands/Clear-Inventory.html +++ b/docs/commands/Clear-Inventory.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html index af847b74..27478810 100644 --- a/docs/commands/Debug.html +++ b/docs/commands/Debug.html @@ -365,7 +365,7 @@ generated by LDoc diff --git a/docs/commands/Find.html b/docs/commands/Find.html index fc61f8cf..1646f87f 100644 --- a/docs/commands/Find.html +++ b/docs/commands/Find.html @@ -360,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Help.html b/docs/commands/Help.html index c5d73042..80fcb656 100644 --- a/docs/commands/Help.html +++ b/docs/commands/Help.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/commands/Home.html b/docs/commands/Home.html index 05da9559..364a5c55 100644 --- a/docs/commands/Home.html +++ b/docs/commands/Home.html @@ -458,7 +458,7 @@ generated by LDoc diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html index bc2e0590..99a8bb88 100644 --- a/docs/commands/Interface.html +++ b/docs/commands/Interface.html @@ -416,7 +416,7 @@ generated by LDoc diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html index 6ff4802e..23cffe1c 100644 --- a/docs/commands/Jail.html +++ b/docs/commands/Jail.html @@ -611,7 +611,7 @@ generated by LDoc diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html index a16c18b0..c826849c 100644 --- a/docs/commands/Kill.html +++ b/docs/commands/Kill.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Me.html b/docs/commands/Me.html index 2f8cb3f4..f8b3edd3 100644 --- a/docs/commands/Me.html +++ b/docs/commands/Me.html @@ -360,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html index 83127954..0ee93a13 100644 --- a/docs/commands/Rainbow.html +++ b/docs/commands/Rainbow.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html index dfc8fde0..edcba43f 100644 --- a/docs/commands/Repair.html +++ b/docs/commands/Repair.html @@ -321,7 +321,7 @@ generated by LDoc diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html index bb852d95..8133f2be 100644 --- a/docs/commands/Reports.html +++ b/docs/commands/Reports.html @@ -585,7 +585,7 @@ generated by LDoc diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html index 338a0c5e..acef4c67 100644 --- a/docs/commands/Roles.html +++ b/docs/commands/Roles.html @@ -557,7 +557,7 @@ generated by LDoc diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html index 9eba8a8f..15b2d030 100644 --- a/docs/commands/Spawn.html +++ b/docs/commands/Spawn.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Tag.html b/docs/commands/Tag.html index b8609e4a..fb491132 100644 --- a/docs/commands/Tag.html +++ b/docs/commands/Tag.html @@ -443,7 +443,7 @@ generated by LDoc diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html index eeed3aa0..6df0414b 100644 --- a/docs/commands/Teleport.html +++ b/docs/commands/Teleport.html @@ -484,7 +484,7 @@ generated by LDoc diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html index 337f8b93..7707c52f 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -569,7 +569,7 @@ generated by LDoc diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index 72c02f54..2093a884 100644 --- a/docs/configs/Advanced-Start.html +++ b/docs/configs/Advanced-Start.html @@ -506,7 +506,7 @@ generated by LDoc diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html index 31d8e33c..d1d1b3de 100644 --- a/docs/configs/Bonuses.html +++ b/docs/configs/Bonuses.html @@ -237,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html index da119978..efd7832f 100644 --- a/docs/configs/Chat-Reply.html +++ b/docs/configs/Chat-Reply.html @@ -485,7 +485,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html index fa578e05..3bb2e8f8 100644 --- a/docs/configs/Commands-Auth-Admin.html +++ b/docs/configs/Commands-Auth-Admin.html @@ -294,7 +294,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html index 2e83f8aa..c7edeb96 100644 --- a/docs/configs/Commands-Auth-Roles.html +++ b/docs/configs/Commands-Auth-Roles.html @@ -320,7 +320,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html index e908fa8c..700296b0 100644 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ b/docs/configs/Commands-Auth-Runtime-Disable.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html index 3206b122..f60715ed 100644 --- a/docs/configs/Commands-Parse-Roles.html +++ b/docs/configs/Commands-Parse-Roles.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html index 14f65272..6b32d0a1 100644 --- a/docs/configs/Commands-Parse.html +++ b/docs/configs/Commands-Parse.html @@ -338,7 +338,7 @@ see ./expcore/commands.lua for more details

    generated by LDoc diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html index 2d0f47b4..b0250bf1 100644 --- a/docs/configs/Compilatron.html +++ b/docs/configs/Compilatron.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html index f03d13cd..24401358 100644 --- a/docs/configs/Death-Logger.html +++ b/docs/configs/Death-Logger.html @@ -416,7 +416,7 @@ generated by LDoc diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html index e7cc6d8b..5605e456 100644 --- a/docs/configs/Discord-Alerts.html +++ b/docs/configs/Discord-Alerts.html @@ -237,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html index 25d76c3b..5c96dd17 100644 --- a/docs/configs/File-Loader.html +++ b/docs/configs/File-Loader.html @@ -240,7 +240,7 @@ generated by LDoc diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html index 5798d322..ec4ad401 100644 --- a/docs/configs/Permission-Groups.html +++ b/docs/configs/Permission-Groups.html @@ -295,7 +295,7 @@ generated by LDoc diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html index 28764dd5..8647bdec 100644 --- a/docs/configs/Player-List.html +++ b/docs/configs/Player-List.html @@ -812,7 +812,7 @@ generated by LDoc diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html index 3f407af5..e2ca1dd2 100644 --- a/docs/configs/Pollution-Grading.html +++ b/docs/configs/Pollution-Grading.html @@ -384,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html index e217cb89..7b7bcbad 100644 --- a/docs/configs/Popup-Messages.html +++ b/docs/configs/Popup-Messages.html @@ -414,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html index 6ded0dd1..63d439f7 100644 --- a/docs/configs/Preset-Player-Colours.html +++ b/docs/configs/Preset-Player-Colours.html @@ -324,7 +324,7 @@ generated by LDoc diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html index 04430dd7..f154803c 100644 --- a/docs/configs/Repair.html +++ b/docs/configs/Repair.html @@ -414,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html index 2a142796..e31f17da 100644 --- a/docs/configs/Rockets.html +++ b/docs/configs/Rockets.html @@ -834,7 +834,7 @@ generated by LDoc diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html index 3fbacb0e..494d46dc 100644 --- a/docs/configs/Roles.html +++ b/docs/configs/Roles.html @@ -292,7 +292,7 @@ generated by LDoc diff --git a/docs/configs/Science.html b/docs/configs/Science.html index 873dbf53..e9bd1687 100644 --- a/docs/configs/Science.html +++ b/docs/configs/Science.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html index 5f2f2131..497d5afe 100644 --- a/docs/configs/Scorched-Earth.html +++ b/docs/configs/Scorched-Earth.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html index ebefadb6..c11ea36c 100644 --- a/docs/configs/Spawn-Area.html +++ b/docs/configs/Spawn-Area.html @@ -744,7 +744,7 @@ generated by LDoc diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html index 2ea51a33..9e8aedf0 100644 --- a/docs/configs/Tasks.html +++ b/docs/configs/Tasks.html @@ -384,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html index 1971da7d..f1623c82 100644 --- a/docs/configs/Warnings.html +++ b/docs/configs/Warnings.html @@ -355,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html index c90c3b4f..220ac9f0 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -684,7 +684,7 @@ generated by LDoc diff --git a/docs/control/Jail.html b/docs/control/Jail.html index 8b2073fa..7f57692c 100644 --- a/docs/control/Jail.html +++ b/docs/control/Jail.html @@ -1208,7 +1208,7 @@ generated by LDoc diff --git a/docs/control/Production.html b/docs/control/Production.html index cfc5135f..f1113092 100644 --- a/docs/control/Production.html +++ b/docs/control/Production.html @@ -1329,7 +1329,7 @@ generated by LDoc diff --git a/docs/control/Reports.html b/docs/control/Reports.html index 02a29320..d8897523 100644 --- a/docs/control/Reports.html +++ b/docs/control/Reports.html @@ -1110,7 +1110,7 @@ generated by LDoc diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html index 4cd079d7..4b9966cb 100644 --- a/docs/control/Rockets.html +++ b/docs/control/Rockets.html @@ -984,7 +984,7 @@ generated by LDoc diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html index 0a82275c..fbe012aa 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -1039,7 +1039,7 @@ generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index cca92779..f0d8a48d 100644 --- a/docs/control/Warnings.html +++ b/docs/control/Warnings.html @@ -1465,7 +1465,7 @@ generated by LDoc diff --git a/docs/control/Warps.html b/docs/control/Warps.html index 4af6171d..8eaa202f 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -1413,7 +1413,7 @@ generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index b6e82a2c..5f50cb52 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -1972,7 +1972,7 @@ generated by LDoc diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html index ee9e8780..df42a599 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -2746,7 +2746,7 @@ Common.table_insert(tbl,50,tbl2) generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index 6533ff0e..cc538320 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -10987,7 +10987,7 @@ generated by LDoc diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index cffa89f8..690c75dd 100644 --- a/docs/core/Permissions-Groups.html +++ b/docs/core/Permissions-Groups.html @@ -1432,7 +1432,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index 3187a4f7..3ac81e42 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -3152,7 +3152,7 @@ generated by LDoc diff --git a/docs/core/Store.html b/docs/core/Store.html index 97eda35f..63185182 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -42,7 +42,10 @@

    Sections

    @@ -203,7 +206,10 @@

    Jump to Section

    @@ -224,7 +230,7 @@

    Store core

    Core Module - Store - - Adds an easy way to store and watch for updates to a value

    +- Used to store and watch for updates for values in the global table

    @@ -232,48 +238,6 @@ -

    Usage

    -
    
    --- The data store module is designed to be an alterative way to store data in the global table
    --- each piece of data is stored at a location and optional key of that location
    --- it is recomented that you use a local varible to store the location
    -local scenario_difficuly = Store.uid_location()
    -local team_scores = 'team-scores'
    -
    --- Setting and getting data is then as simple as
    --- note that when storing a table you must use Store.update
    -Store.set(scenario_difficuly,'Hard')
    -Store.set(team_scores,game.player.force.name,20)
    -
    -Store.get(scenario_difficuly) -- returns 'Hard'
    -Store.get(team_scores,game.player.force.name) -- returns 20
    -
    -Store.update(team_scores,game.player.force.name,function(value,key)
    -    return value + 10 -- add 10 to the score
    -end)
    -
    --- The reason for using stores over global is the abilty to watch for updates
    --- for stores to work you must register them, often at the end of the file
    -Store.register(scenario_difficuly,function(value)
    -    game.print('Scenario difficulty has been set to: '..value)
    -end)
    -
    -Store.register(team_scores,function(value,key)
    -    game.print('Team '..key..' now has a score of '..value)
    -end)
    -
    --- This can be very powerful when working with data that can be changed for a number of locations
    --- with this module you can enable any location to output its changes to a file
    --- say we wanted team scores to be synced across servers or between saves
    --- although you will need to set up a method of storing the data outside the game
    -Store.register(team_scores,true,function(value,key)
    -    game.print('Team '..key..' now has a score of '..value)
    -end)
    -
    --- If you want multiple handlers on one store location then you can register to the raw event
    -Event.add(Store.events.on_value_changed,function(event)
    -    game.print('Store '..event.location..'/'..event.key..' was updated to: '..event.value)
    -end)
    @@ -286,61 +250,84 @@ Store.register(team_scores,function(value,key)
    - - - - - - - - -
    utils.global
    utils.event
    expcore.common
    utils.token
    -

    Functions

    +

    Tables

    - - + - - + + + +
    register([location][, synced=false][, callback])Registers a new location with an update callback which is triggered when the value updatesserializers
    get(location[, key])Gets the value stored at a location, this location must be registeredwatchers
    + + +

    Fields

    + + + + + + + +
    uid
    + + +

    Store Setup

    + + + + + + - - + + - - + + + + +
    validate(store[, key][, error_stack=1])An error checking and serializing function for checking store uids and keys, note key is not required
    set(location[, key], value[, from_sync=false][, from_internal=false])Sets the value at a location, this location must be registeredregister([serializer])Required to create new stores and register an serializer to a store, serializer not required
    update(location[, key][, update_callback])Allows for updating a value based on the current value; only valid way to change tables in a storewatch(store, watcher)Register a watch function to a store that is called when the value in the store is changed, triggers for any key
    + + +

    Store Data Management

    + + + + + + - - + + - - + + - - + + - - + + - - + +
    get(store[, key])Used to retrive the current data that is stored, key is optional depending on if you are using them
    update_all(location[, update_callback])Allows for updating all values at a location based on the current value; only valid way to change tables in a storeclear(store[, key])Used to clear the data in a store, will trigger any watchers, key is optional depending on if you are using them
    clear(location[, key][, from_sync=false])Sets the value at a location to nil, this location must be registeredset(store[, key], value)Used to set the data in a store, will trigger any watchers, key is optional depending on if you are using them
    get_keys(location)Gets all non nil keys at a location, keys can be added and removed during runtime -this is similar to Store.get but will always return a table even if it is emptyupdate(store[, key], updater)Used to update the data in a store, use this with tables, will trigger any watchers, key is optional depending on if you are using them
    is_registered(location)Check for if a location is registeredmap(store, updater)Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present
    uid_location()Returns a unique name that can be used for a storetrigger(store[, key][, value])Used to trigger any watchers that are on this store, the key and value are passed to the watcher functions
    @@ -354,31 +341,6 @@ this is similar to Store.get but will always return a table even if it is empty<
    - # - utils.global -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    # utils.event
    @@ -401,16 +363,21 @@ this is similar to Store.get but will always return a table even if it is empty< +
    +

    Tables

    +
    - # - expcore.common + # + serializers
    +

    +

    array of the serializers that stores are using, key is store uids

    @@ -429,13 +396,15 @@ this is similar to Store.get but will always return a table even if it is empty<
    - # - utils.token + # + watchers
    +

    +

    array of watchers that stores will trigger, key is store uids

    @@ -452,23 +421,20 @@ this is similar to Store.get but will always return a table even if it is empty<
    -

    Functions

    +

    Fields

    - # - register([location][, synced=false][, callback]) + # + uid
    -

    Registers a new location with an update callback which is triggered when the value updates

    -

    - Parameters:
      @@ -476,51 +442,15 @@ this is similar to Store.get but will always return a table even if it is empty< -
    • +
    • - location + uid : - (string) - string a unique that points to the data, string used rather than token to allow migration + the current highest uid that is being used, will not increase during runtime - (optional) -
    • - - - - - -
    • - - synced - - : - - (boolean) - - when true will output changes to a file so it can be synced - - (default: false) -
    • - - - - - -
    • - - callback - - : - - (function) - - when given the callback will be automatically registered to the update of the value - - (optional)
    • @@ -529,13 +459,6 @@ this is similar to Store.get but will always return a table even if it is empty< - Returns: -
        -
      • - (string) - the location that is being used -
      • -
      @@ -543,28 +466,23 @@ this is similar to Store.get but will always return a table even if it is empty< - Usage: -
      -- Registering a new store location
      -local store_id = Store.register()
      -
      -- Registering a new store location, with custom update callback
      -local store_id = Store.uid_location()
      -Store.register(store_id,function(value,key)
      -    game.print('Store '..store_id..'/'..key..' was updated to: '..value)
      -end)
    +
    +

    Store Setup

    +
    - # - get(location[, key]) + # + validate(store[, key][, error_stack=1])
    -

    Gets the value stored at a location, this location must be registered

    +

    An error checking and serializing function for checking store uids and keys, note key is not required

    @@ -578,13 +496,13 @@ Store.register(store_id,function(value,key)
  • - location + store : - (string) + (number) - the location to get the data from + the uid of the store that you want to check is valid
  • @@ -598,9 +516,268 @@ Store.register(store_id,function(value,key) : - (string) + (string or any) - the key location if used + the key that you want to serialize or check is a string + + (optional) + + + + + + +
  • + + error_stack + + : + + (number) + + the position in the stack relative to the current function (1) to raise this error on + + (default: 1) +
  • + + + + + + + + Returns: +
      +
    • + (string) + if key is given and a serializer is registered, or key was already a string, then the key is returned +
    • +
    + + + + + + + + Usage: +
    -- Registering a new store and checking that it is valid
    +-- New store will use player names as the keys
    +local player_scores = Store.register(function(player)
    +    return player.name
    +end)
    +
    +-- player_scores is a valid store and key will be your player name
    +local key = Store.validate(player_scores,game.player)
    + + +
    +
    +
    +
    + # + register([serializer]) +
    +
    +
    +
    + +

    Required to create new stores and register an serializer to a store, serializer not required

    +

    + + + Parameters: + +
      + + + + + +
    • + + serializer + + : + + (function) + + the function used to convert non string keys into strings to be used in the store + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the uid for the new store that you have created, use this as the first param to all other functions +
    • +
    + + + + + + + + Usage: +
    -- Creating a store with no serializer
    +local scenario_diffculty = Store.register()
    +
    -- Creating a store which can take LuaPlayer
    +local player_scores = Store.register(function(player)
    +    return player.name
    +end)
    + + +
    +
    +
    +
    + # + watch(store, watcher) +
    +
    +
    +
    + +

    Register a watch function to a store that is called when the value in the store is changed, triggers for any key

    +

    + + + Parameters: + +
      + + + + + +
    • + + store + + : + + (number) + + the uid of the store that you want to watch for changes to + +
    • + + + + + +
    • + + watcher + + : + + (function) + + the function that will be called when there is a change to the store + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Printing the changed value to all players, no keys
    +-- Register the new store, we are not using keys so we dont need a serializer
    +local scenario_diffculty = Store.register()
    +
    +-- Register the watcher so that when we change the value the message is printed
    +Store.watch(scenario_diffculty,function(value)
    +    game.print('The scenario diffculty has been set to '..value)
    +end)
    +
    +-- Set a new value for the diffculty and see that it has printed to the game
    +Store.set(scenario_diffculty,'hard')
    +
    -- Printing the changed value to all players, with keys
    +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
    +local player_scores = Store.register(function(player)
    +    return player.name
    +end)
    +
    +-- Register the watcher so that when we change the value the message is printed
    +Store.watch(player_scores,function(value,key)
    +    game.print(key..' now has a score of '..value)
    +end)
    +
    +-- Set a new value for your score and see that it has printed to the game
    +Store.set(player_scores,game.player,10)
    + + +
    +
    +

    Store Data Management

    +
    +
    +
    +
    + # + get(store[, key]) +
    +
    +
    +
    + +

    Used to retrive the current data that is stored, key is optional depending on if you are using them

    +

    + + + Parameters: + +
      + + + + + +
    • + + store + + : + + (number) + + the uid of the store that you want to get the value from + +
    • + + + + + +
    • + + key + + : + + (string or any) + + the key that you want to get the value of, must be a string unless you have a serializer (optional)
    • @@ -615,7 +792,7 @@ Store.register(store_id,function(value,key)
      • (any) - the data which was stored at the location + the data that is stored
      @@ -626,23 +803,37 @@ Store.register(store_id,function(value,key) Usage: -
      -- Getting the data at a store location
      -local data = Store.get(store_id_no_keys)
      -local data = Store.get(store_id_with_keys,'key_one')
      +
      -- Getting the value of a store with no keys
      +-- Register the new store, we are not using keys so we dont need a serializer
      +local scenario_diffculty = Store.register()
      +
      +-- Get the current diffculty for the scenario
      +local diffculty = Store.get(scenario_diffculty)
      +
      -- Getting the data from a store with keys
      +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
      +local player_scores = Store.register(function(player)
      +    return player.name
      +end)
      +
      +-- Get your current score
      +local my_score = Store.get(player_scores,game.player)
      +
      +-- Get all scores
      +lcoal scores = Store.get(player_scores)
    - # - set(location[, key], value[, from_sync=false][, from_internal=false]) + # + clear(store[, key])
    -

    Sets the value at a location, this location must be registered

    +

    Used to clear the data in a store, will trigger any watchers, key is optional depending on if you are using them

    @@ -656,13 +847,13 @@ Store.register(store_id,function(value,key)
  • - location + store : - (string) + (number) - the location to set the data to + the uid of the store that you want to clear
  • @@ -676,9 +867,94 @@ Store.register(store_id,function(value,key) : - (string) + (string or any) - the key location if used + the key that you want to clear, must be a string unless you have a serializer + + (optional) + + + + + + + + + + + + + + + + Usage: +
    -- Clear a store which does not use keys
    +-- Register the new store, we are not using keys so we dont need a serializer
    +local scenario_diffculty = Store.register()
    +
    +-- Clear the scenario diffculty
    +Store.clear(scenario_diffculty)
    +
    -- Clear data that is in a store with keys
    +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
    +local player_scores = Store.register(function(player)
    +    return player.name
    +end)
    +
    +-- Clear your score
    +Store.clear(player_scores,game.player)
    +
    +-- Clear all scores
    +Store.clear(player_scores)
    + + +
    +
    +
    +
    + # + set(store[, key], value) +
    +
    +
    +
    + +

    Used to set the data in a store, will trigger any watchers, key is optional depending on if you are using them

    +

    + + + Parameters: + +
      + + + + + +
    • + + store + + : + + (number) + + the uid of the store that you want to set + +
    • + + + + + +
    • + + key + + : + + (string or any) + + the key that you want to set, must be a string unless you have a serializer (optional)
    • @@ -695,57 +971,16 @@ Store.register(store_id,function(value,key) (any) - the new value to set at the location, value may be reverted if there is a watch callback, cant be nil + the value that you want to set - - - -
    • - - from_sync - - : - - (boolean) - - set this true to avoid an output to the sync file - - (default: false) -
    • - - - - - -
    • - - from_internal - - : - - (boolean) - - set this true to add one to the error stack offset - - (default: false) -
    • - -
    - Returns: -
      -
    • - (boolean) - true if it was successful -
    • -
    @@ -754,9 +989,26 @@ Store.register(store_id,function(value,key) Usage: -
    -- Setting the data at a store location
    -Store.set(store_id_no_keys,'Hello, World!')
    -Store.set(store_id_with_keys,'key_one','Hello, World!')
    +
    -- Setting a store which does not use keys
    +-- Register the new store, we are not using keys so we dont need a serializer
    +local scenario_diffculty = Store.register()
    +
    +-- Set the new scenario diffculty
    +Store.set(scenario_diffculty,'hard')
    +
    -- Set data in a store with keys
    +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
    +local player_scores = Store.register(function(player)
    +    return player.name
    +end)
    +
    +-- Set your current score
    +Store.set(player_scores,game.player,10)
    +
    +-- Set all scores, note this might not have much use
    +Store.set(player_scores,{
    +    [game.player.name] = 10,
    +    ['SomeOtherPlayer'] = 0
    +})
    @@ -764,13 +1016,13 @@ Store.set(store_id_with_keys,'key_one',
    # - update(location[, key][, update_callback]) + update(store[, key], updater)
    -

    Allows for updating a value based on the current value; only valid way to change tables in a store

    +

    Used to update the data in a store, use this with tables, will trigger any watchers, key is optional depending on if you are using them

    @@ -784,13 +1036,13 @@ Store.set(store_id_with_keys,'key_one', - location + store : - (string) + (number) - the location to set the data to + the uid of the store that you want to update @@ -804,9 +1056,9 @@ Store.set(store_id_with_keys,'key_one',string) + (string or any) - the key location if required + the key that you want to update, must be a string unless you have a serializer (optional) @@ -817,15 +1069,14 @@ Store.set(store_id_with_keys,'key_one', - update_callback + updater : (function) - the function called to update the value stored, rtn value to set new value + the function which is called to make changes to the value, such as changing table keys, if a value is returned it will replace the current value in the store - (optional) @@ -842,19 +1093,34 @@ Store.set(store_id_with_keys,'key_one',-- Updating a value stored at a location -Store.update(store_id_no_keys,function(value) - return value + 1 -end) -Store.update(store_id_with_keys,'key_one',function(value) +
    -- Incrementing a global score
    +-- Because we are only going to have one score so we will not need keys or a serializer
    +local game_score = Store.register()
    +
    +-- Setting a default value
    +Store.set(game_score,0)
    +
    +-- We now will update the game score by one, we return the value so that it is set as the new value in the store
    +Store.update(game_score,function(value)
         return value + 1
     end)
    -
    -- Updating a table stored at a location
    -Store.update(store_id_no_keys,function(value)
    -    value.ctn = value.ctn + 1
    +    
    -- Updating keys in a table of data
    +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
    +local player_data = Store.register(function(player)
    +    return player.name
     end)
    -Store.update(store_id_with_keys,'key_one',function(value)
    -    value.ctn = value.ctn + 1
    +
    +-- Setting a default value for your player, used to show the table structure
    +Store.set(player_data,game.player,{
    +    group = 'Admin',
    +    role = 'Owner',
    +    show_group_config = false
    +})
    +
    +-- Updating the show_group_config key in your player data, note that it would be harder to call set every time
    +-- We do not need to return anything in this case as we are not replacing all the data
    +Store.update(player_data,game.player,function(data)
    +    data.show_group_config = not data.show_group_config
     end)
    @@ -862,14 +1128,14 @@ Store.update(store_id_with_keys,'key_one',
    - # - update_all(location[, update_callback]) + # + map(store, updater)
    -

    Allows for updating all values at a location based on the current value; only valid way to change tables in a store

    +

    Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present

    @@ -883,13 +1149,13 @@ Store.update(store_id_with_keys,'key_one', - location + store : - (string) + (number) - the location to set the data to + the uid of the store that you want to map @@ -899,15 +1165,14 @@ Store.update(store_id_with_keys,'key_one', - update_callback + updater : (function) - the function called to update the value stored + the function that is called on every key in this store - (optional) @@ -924,13 +1189,24 @@ Store.update(store_id_with_keys,'key_one', Usage: -
    -- Updating all values at a location
    -Store.update(store_id_with_keys,function(value)
    -    return value + 1
    -end)
    -
    -- Updating all tables at a location
    -Store.update(store_id_with_keys,function(value)
    -    value.ctn = value.ctn + 1
    +    
    -- Updating keys in a table of data
    +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
    +local player_data = Store.register(function(player)
    +    return player.name
    +end)
    +
    +-- Setting a default value for your player, used to show the table structure
    +Store.set(player_data,game.player,{
    +    group = 'Admin',
    +    role = 'Owner',
    +    show_group_config = false
    +})
    +
    +-- Updating the show_group_config key for all players, note that it would be harder to call set every time
    +-- We do not need to return anything in this case as we are not replacing all the data
    +-- We also have access to the current key being updated if needed
    +Store.map(player_data,function(data,key)
    +    data.show_group_config = not data.show_group_config
     end)
    @@ -938,14 +1214,14 @@ Store.update(store_id_with_keys,'key_one',
    - # - clear(location[, key][, from_sync=false]) + # + trigger(store[, key][, value])
    -

    Sets the value at a location to nil, this location must be registered

    +

    Used to trigger any watchers that are on this store, the key and value are passed to the watcher functions

    @@ -959,13 +1235,13 @@ Store.update(store_id_with_keys,'key_one', - location + store : - (string) + (number) - the location to set the data to + the uid of the store that you want to trigger @@ -979,9 +1255,9 @@ Store.update(store_id_with_keys,'key_one', : - (string) + (string or any) - the key location if used + the key that you want to trigger, must be a string unless you have a serializer (optional) @@ -992,15 +1268,15 @@ Store.update(store_id_with_keys,'key_one', - from_sync + value : - (boolean) + (any) - set this true to avoid an output to the sync file + the new value that is at this key or store, passed directly to the watcher - (default: false) + (optional) @@ -1009,13 +1285,6 @@ Store.update(store_id_with_keys,'key_one', - Returns: -
      -
    • - (boolean) - true if it was successful -
    • -
    @@ -1024,167 +1293,13 @@ Store.update(store_id_with_keys,'key_one', Usage: -
    -- Clear the data at a location
    -Store.clear(store_id_no_keys)
    -Store.clear(store_id_with_keys,'key_one')
    - +
    -- Triggering a manule call of the watchers
    +-- The type of store we use does not really matter for this as long as you pass it what you watchers are expecting
    +local scenario_diffculty = Store.register()
     
    -    
    -
    -
    -
    - # - get_keys(location) -
    -
    -
    -
    - -

    Gets all non nil keys at a location, keys can be added and removed during runtime -this is similar to Store.get but will always return a table even if it is empty

    -

    - - - Parameters: - -
      - - - - - -
    • - - location - - : - - (string) - - the location to get the keys of - -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - a table containing all the keys names -
    • -
    - - - - - - - - Usage: -
    -- Get all keys at a store location
    -local keys = Store.get_keys(store_id_with_keys)
    - - -
    -
    -
    -
    - # - is_registered(location) -
    -
    -
    -
    - -

    Check for if a location is registered

    -

    - - - Parameters: - -
      - - - - - -
    • - - location - - : - - (string) - - the location to test for - -
    • - - -
    - - - - - Returns: -
      -
    • - (boolean) - true if registered -
    • -
    - - - - - - - - Usage: -
    -- Check that a store is registered
    -local registerd = Store.is_registered(store_id)
    - - -
    -
    -
    -
    - # - uid_location() -
    -
    -
    -
    - -

    Returns a unique name that can be used for a store

    -

    - - - - - - Returns: -
      -
    • - (string) - a unique name -
    • -
    - - - - - - - - Usage: -
    -- Get a new unique store id
    -local store_id = Store.uid_location()
    +-- Trigger the watchers with a fake change of diffculty +-- This is mostly used internally but it can be useful in other cases +Store.trigger(scenario_diffculty,nil,'normal')
    @@ -1203,7 +1318,7 @@ this is similar to Store.get but will always return a table even if it is empty< generated by LDoc
    diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index 53d24d08..effd3f71 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -544,7 +544,7 @@ generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index 5d601cbe..ca132f1d 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -626,7 +626,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index e3d10a38..9f1c0cce 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -629,7 +629,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 59dc47ca..b268e806 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -449,7 +449,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index a97b0a3e..6411c61b 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -632,7 +632,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index 75ae9c1d..3f796e43 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -837,7 +837,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index 6466ea5d..bd823be3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -75,7 +75,7 @@ Store Core Module - Store - - Adds an easy way to store and watch for updates to a value +- Used to store and watch for updates for values in the global table Sudo @@ -514,7 +514,7 @@ see ./expcore/commands.lua for more details generated by LDoc diff --git a/docs/modules/control.html b/docs/modules/control.html index 88f0ccce..895e3c7c 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -351,7 +351,7 @@ generated by LDoc diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html index c377d74b..296ac275 100644 --- a/docs/modules/utils.alien_evolution_progress.html +++ b/docs/modules/utils.alien_evolution_progress.html @@ -419,7 +419,7 @@ fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on generated by LDoc diff --git a/docs/modules/utils.core.html b/docs/modules/utils.core.html index 3378c6d3..acf43435 100644 --- a/docs/modules/utils.core.html +++ b/docs/modules/utils.core.html @@ -1164,7 +1164,7 @@ generated by LDoc diff --git a/docs/modules/utils.debug.html b/docs/modules/utils.debug.html index b00a200b..ace05e78 100644 --- a/docs/modules/utils.debug.html +++ b/docs/modules/utils.debug.html @@ -654,7 +654,7 @@ generated by LDoc diff --git a/docs/modules/utils.dump_env.html b/docs/modules/utils.dump_env.html index e4dc2c92..ca8addbe 100644 --- a/docs/modules/utils.dump_env.html +++ b/docs/modules/utils.dump_env.html @@ -323,7 +323,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index 62b58139..1102c0ef 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -1292,7 +1292,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index 64b7e446..b400b006 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -434,7 +434,7 @@ generated by LDoc diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html index 56d4d37f..2a81a956 100644 --- a/docs/modules/utils.math.html +++ b/docs/modules/utils.math.html @@ -353,7 +353,7 @@ generated by LDoc diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html index 3f85b13d..58a5fe01 100644 --- a/docs/modules/utils.recipe_locker.html +++ b/docs/modules/utils.recipe_locker.html @@ -441,7 +441,7 @@ generated by LDoc diff --git a/docs/modules/utils.state_machine.html b/docs/modules/utils.state_machine.html index 98f7bcd5..e500cb0e 100644 --- a/docs/modules/utils.state_machine.html +++ b/docs/modules/utils.state_machine.html @@ -752,7 +752,7 @@ generated by LDoc diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html index 3cbf7778..21f063b7 100644 --- a/docs/modules/utils.table.html +++ b/docs/modules/utils.table.html @@ -1418,7 +1418,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index 00472a97..fc166fba 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -651,7 +651,7 @@ generated by LDoc diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html index 99473b65..14b2f39f 100644 --- a/docs/modules/utils.timestamp.html +++ b/docs/modules/utils.timestamp.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/topics/license.html b/docs/topics/license.html index e28db313..679b74e8 100644 --- a/docs/topics/license.html +++ b/docs/topics/license.html @@ -789,7 +789,7 @@ Public License instead of this License. But first, please read generated by LDoc diff --git a/docs/topics/readme.md.html b/docs/topics/readme.md.html index cc1c1178..44bd3397 100644 --- a/docs/topics/readme.md.html +++ b/docs/topics/readme.md.html @@ -333,7 +333,7 @@ generated by LDoc diff --git a/expcore/store.lua b/expcore/store.lua index 5d3f80ce..86cbf043 100644 --- a/expcore/store.lua +++ b/expcore/store.lua @@ -1,351 +1,432 @@ --[[-- Core Module - Store - - Adds an easy way to store and watch for updates to a value - @core Store - @alias Store - - @usage --- The data store module is designed to be an alterative way to store data in the global table --- each piece of data is stored at a location and optional key of that location --- it is recomented that you use a local varible to store the location -local scenario_difficuly = Store.uid_location() -local team_scores = 'team-scores' - --- Setting and getting data is then as simple as --- note that when storing a table you must use Store.update -Store.set(scenario_difficuly,'Hard') -Store.set(team_scores,game.player.force.name,20) - -Store.get(scenario_difficuly) -- returns 'Hard' -Store.get(team_scores,game.player.force.name) -- returns 20 - -Store.update(team_scores,game.player.force.name,function(value,key) - return value + 10 -- add 10 to the score -end) - --- The reason for using stores over global is the abilty to watch for updates --- for stores to work you must register them, often at the end of the file -Store.register(scenario_difficuly,function(value) - game.print('Scenario difficulty has been set to: '..value) -end) - -Store.register(team_scores,function(value,key) - game.print('Team '..key..' now has a score of '..value) -end) - --- This can be very powerful when working with data that can be changed for a number of locations --- with this module you can enable any location to output its changes to a file --- say we wanted team scores to be synced across servers or between saves --- although you will need to set up a method of storing the data outside the game -Store.register(team_scores,true,function(value,key) - game.print('Team '..key..' now has a score of '..value) -end) - --- If you want multiple handlers on one store location then you can register to the raw event -Event.add(Store.events.on_value_changed,function(event) - game.print('Store '..event.location..'/'..event.key..' was updated to: '..event.value) -end) +- Used to store and watch for updates for values in the global table +@core Store +@alias Store ]] -local Global = require 'utils.global' --- @dep utils.global local Event = require 'utils.event' --- @dep utils.event -local table_keys,write_json,get_file_path = ext_require('expcore.common','table_keys','write_json','get_file_path') --- @dep expcore.common -local Token = require 'utils.token' --- @dep utils.token local Store = { - registered={}, - synced={}, - callbacks={}, - events = { - on_value_changed=script.generate_event_name() - } + --- @field uid the current highest uid that is being used, will not increase during runtime + uid = 0, + --- @table serializers array of the serializers that stores are using, key is store uids + serializers = {}, + --- @table watchers array of watchers that stores will trigger, key is store uids + watchers = {} } -local store_data = {} -Global.register(Store.data,function(tbl) - store_data = tbl +-- All data is stored in global.data_store and is accessed here with data_store +local data_store = {} +global.data_store = {} +Event.on_load(function() + data_store = global.data_store end) -local function error_not_table(value) - if type(value) ~= 'table' then - error('Location is not a table can not use key locations',3) +--- Store Setup. +-- @section setup + +--[[-- An error checking and serializing function for checking store uids and keys, note key is not required +@tparam number store the uid of the store that you want to check is valid +@tparam[opt] ?string|any key the key that you want to serialize or check is a string +@tparam[opt=1] number error_stack the position in the stack relative to the current function (1) to raise this error on +@treturn string if key is given and a serializer is registered, or key was already a string, then the key is returned + +@usage-- Registering a new store and checking that it is valid +-- New store will use player names as the keys +local player_scores = Store.register(function(player) + return player.name +end) + +-- player_scores is a valid store and key will be your player name +local key = Store.validate(player_scores,game.player) + +]] +function Store.validate(store,key,error_stack) + error_stack = error_stack or 1 + + if not type(store) == 'number' then + -- Store is not a number and so if not valid + error('Store uid given is not a number; recived type '..type(store),error_stack+1) + elseif store > Store.uid then + -- Store is a number but it is out of range, ie larger than the current highest uid + error('Store uid is out of range; recived '..tostring(store),error_stack+1) + elseif key ~= nil and type(key) ~= 'string' and Store.serializers[store] == nil then + -- Key is present but is not a string and there is no serializer registered + error('Store key is not a string and no serializer has been registered; recived '..type(key),error_stack+1) + elseif key ~= nil then + -- Key is present and so it is serialized and returned + local serializer = Store.serializers[store] + if type(key) ~= 'string' then + local success, key = pcall(serializer,key) + + if not success then + -- Serializer casued an error while serializing the key + error('Store watcher casued an error: '..key,error_stack+1) + elseif type(key) ~= 'string' then + -- Serializer was successful but failed to return a string value + error('Store key serializer did not return a string; recived type '..type(key),error_stack+1) + end + end + + return key end + end ---[[-- Registers a new location with an update callback which is triggered when the value updates -@tparam[opt] string location string a unique that points to the data, string used rather than token to allow migration -@tparam[opt=false] boolean synced when true will output changes to a file so it can be synced -@tparam[opt] function callback when given the callback will be automatically registered to the update of the value -@treturn string the location that is being used -@usage-- Registering a new store location -local store_id = Store.register() -@usage-- Registering a new store location, with custom update callback -local store_id = Store.uid_location() -Store.register(store_id,function(value,key) - game.print('Store '..store_id..'/'..key..' was updated to: '..value) +--[[-- Required to create new stores and register an serializer to a store, serializer not required +@tparam[opt] function serializer the function used to convert non string keys into strings to be used in the store +@treturn number the uid for the new store that you have created, use this as the first param to all other functions + +@usage-- Creating a store with no serializer +local scenario_diffculty = Store.register() + +@usage-- Creating a store which can take LuaPlayer +local player_scores = Store.register(function(player) + return player.name end) + ]] -function Store.register(location,synced,callback) +function Store.register(serializer) if _LIFECYCLE ~= _STAGE.control then - return error('Can only be called during the control stage', 2) + -- Only allow this function to be called during the control stage + error('Store can not be registered durring runtime', 2) end - if type(location) ~= 'string' then - callback = synced - synced = location + -- Increment the uid counter + local uid = Store.uid + 1 + Store.uid = uid + + -- Register the serializer if given + if serializer then + Store.serializers[uid] = serializer end - if type(synced) ~= 'boolean' then - callback = synced - end - - location = type(location) == 'string' and location or Store.uid_location() - - if Store.registered[location] then - return error('Location '..location..' is already registered by '..Store.registered[location], 2) - end - - Store.registered[location] = get_file_path(1) - Store.synced[location] = synced and true or nil - Store.callbacks[location] = callback or nil - - return location + -- Return the new uid + return uid end ---[[-- Gets the value stored at a location, this location must be registered -@tparam string location the location to get the data from -@tparam[opt] string key the key location if used -@treturn any the data which was stored at the location -@usage-- Getting the data at a store location -local data = Store.get(store_id_no_keys) -local data = Store.get(store_id_with_keys,'key_one') +--[[-- Register a watch function to a store that is called when the value in the store is changed, triggers for any key +@tparam number store the uid of the store that you want to watch for changes to +@tparam function watcher the function that will be called when there is a change to the store + +@usage-- Printing the changed value to all players, no keys +-- Register the new store, we are not using keys so we dont need a serializer +local scenario_diffculty = Store.register() + +-- Register the watcher so that when we change the value the message is printed +Store.watch(scenario_diffculty,function(value) + game.print('The scenario diffculty has been set to '..value) +end) + +-- Set a new value for the diffculty and see that it has printed to the game +Store.set(scenario_diffculty,'hard') + +@usage-- Printing the changed value to all players, with keys +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects +local player_scores = Store.register(function(player) + return player.name +end) + +-- Register the watcher so that when we change the value the message is printed +Store.watch(player_scores,function(value,key) + game.print(key..' now has a score of '..value) +end) + +-- Set a new value for your score and see that it has printed to the game +Store.set(player_scores,game.player,10) + ]] -function Store.get(location,key) - if not Store.registered[location] then - return error('Location is not registered', 2) +function Store.watch(store,watcher) + Store.validate(store,nil,2) + + -- Add the watchers table if it does not exist + local watchers = Store.watchers[store] + if not watchers then + watchers = {} + Store.watchers[store] = watchers end - local data = store_data[location] - if key and data then - error_not_table(data) + -- Append the new watcher function + watchers[#watchers+1] = watcher +end + +--- Store Data Management. +-- @section data + +--[[-- Used to retrive the current data that is stored, key is optional depending on if you are using them +@tparam number store the uid of the store that you want to get the value from +@tparam[opt] ?string|any key the key that you want to get the value of, must be a string unless you have a serializer +@treturn any the data that is stored + +@usage-- Getting the value of a store with no keys +-- Register the new store, we are not using keys so we dont need a serializer +local scenario_diffculty = Store.register() + +-- Get the current diffculty for the scenario +local diffculty = Store.get(scenario_diffculty) + +@usage-- Getting the data from a store with keys +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects +local player_scores = Store.register(function(player) + return player.name +end) + +-- Get your current score +local my_score = Store.get(player_scores,game.player) + +-- Get all scores +lcoal scores = Store.get(player_scores) + +]] +function Store.get(store,key) + key = Store.validate(store,key,2) + + -- Get the data from the data store + local data = data_store[store] + if key then return data[key] end + -- Return all data if there is no key return data end ---[[-- Sets the value at a location, this location must be registered -@tparam string location the location to set the data to -@tparam[opt] string key the key location if used -@tparam any value the new value to set at the location, value may be reverted if there is a watch callback, cant be nil -@tparam[opt=false] boolean from_sync set this true to avoid an output to the sync file -@tparam[opt=false] boolean from_internal set this true to add one to the error stack offset -@treturn boolean true if it was successful -@usage-- Setting the data at a store location -Store.set(store_id_no_keys,'Hello, World!') -Store.set(store_id_with_keys,'key_one','Hello, World!') +--[[-- Used to clear the data in a store, will trigger any watchers, key is optional depending on if you are using them +@tparam number store the uid of the store that you want to clear +@tparam[opt] ?string|any key the key that you want to clear, must be a string unless you have a serializer + +@usage-- Clear a store which does not use keys +-- Register the new store, we are not using keys so we dont need a serializer +local scenario_diffculty = Store.register() + +-- Clear the scenario diffculty +Store.clear(scenario_diffculty) + +@usage-- Clear data that is in a store with keys +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects +local player_scores = Store.register(function(player) + return player.name +end) + +-- Clear your score +Store.clear(player_scores,game.player) + +-- Clear all scores +Store.clear(player_scores) + ]] -function Store.set(location,key,value,from_sync,from_internal) - if not Store.registered[location] then - return error('Location is not registered', from_internal and 3 or 2) +function Store.clear(store,key) + key = Store.validate(store,key,2) + + -- Check if there is a key being used + if key then + data_store[store][key] = nil + else + data_store[store] = nil end + -- Trigger any watch functions + Store.trigger(store,key,nil) +end + +--[[-- Used to set the data in a store, will trigger any watchers, key is optional depending on if you are using them +@tparam number store the uid of the store that you want to set +@tparam[opt] ?string|any key the key that you want to set, must be a string unless you have a serializer +@tparam any value the value that you want to set + +@usage-- Setting a store which does not use keys +-- Register the new store, we are not using keys so we dont need a serializer +local scenario_diffculty = Store.register() + +-- Set the new scenario diffculty +Store.set(scenario_diffculty,'hard') + +@usage-- Set data in a store with keys +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects +local player_scores = Store.register(function(player) + return player.name +end) + +-- Set your current score +Store.set(player_scores,game.player,10) + +-- Set all scores, note this might not have much use +Store.set(player_scores,{ + [game.player.name] = 10, + ['SomeOtherPlayer'] = 0 +}) + +]] +function Store.set(store,key,value) + -- Allow for key to be optional if value == nil then value = key key = nil end + -- Check the store is valid + key = Store.validate(store,key,2) + + -- If there is a key being used then the store must be a able if key then - local data = store_data[location] - if not data then - data = {} - store_data[location] = data + if type(data_store[store]) ~= 'table' then + data_store[store] = {_value = data_store[store]} end - error_not_table(data) - data[key] = value + data_store[store][key] = value else - store_data[location] = value + data_store[store] = value end - script.raise_event(Store.events.on_value_changed,{ - tick=game.tick, - location=location, - key=key, - value=value, - from_sync=from_sync or false - }) - - return true + -- Trigger any watchers + Store.trigger(store,key,value) end ---[[-- Allows for updating a value based on the current value; only valid way to change tables in a store -@tparam string location the location to set the data to -@tparam[opt] string key the key location if required -@tparam[opt] function update_callback the function called to update the value stored, rtn value to set new value -@usage-- Updating a value stored at a location -Store.update(store_id_no_keys,function(value) - return value + 1 -end) -Store.update(store_id_with_keys,'key_one',function(value) - return value + 1 -end) -@usage-- Updating a table stored at a location -Store.update(store_id_no_keys,function(value) - value.ctn = value.ctn + 1 -end) -Store.update(store_id_with_keys,'key_one',function(value) - value.ctn = value.ctn + 1 -end) -]] -function Store.update(location,key,update_callback,...) - local value = Store.get(location,key) +--[[-- Used to update the data in a store, use this with tables, will trigger any watchers, key is optional depending on if you are using them +@tparam number store the uid of the store that you want to update +@tparam[opt] ?string|any key the key that you want to update, must be a string unless you have a serializer +@tparam function updater the function which is called to make changes to the value, such as changing table keys, if a value is returned it will replace the current value in the store - local args - if type(key) == 'function' then - args = {update_callback,...} - update_callback = key +@usage-- Incrementing a global score +-- Because we are only going to have one score so we will not need keys or a serializer +local game_score = Store.register() + +-- Setting a default value +Store.set(game_score,0) + +-- We now will update the game score by one, we return the value so that it is set as the new value in the store +Store.update(game_score,function(value) + return value + 1 +end) + +@usage-- Updating keys in a table of data +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects +local player_data = Store.register(function(player) + return player.name +end) + +-- Setting a default value for your player, used to show the table structure +Store.set(player_data,game.player,{ + group = 'Admin', + role = 'Owner', + show_group_config = false +}) + +-- Updating the show_group_config key in your player data, note that it would be harder to call set every time +-- We do not need to return anything in this case as we are not replacing all the data +Store.update(player_data,game.player,function(data) + data.show_group_config = not data.show_group_config +end) + +]] +function Store.update(store,key,updater) + -- Allow for key to be nil + if updater == nil then + updater = key key = nil end - local rtn - if update_callback and type(update_callback) == 'function' then - if args then - rtn = update_callback(value,key,unpack(args)) - else - rtn = update_callback(value,key,...) - end - end - - if rtn then - Store.set(location,key,rtn,nil,true) - else - script.raise_event(Store.events.on_value_changed,{ - tick=game.tick, - location=location, - key=key, - value=value, - from_sync=false - }) - end - -end - ---[[-- Allows for updating all values at a location based on the current value; only valid way to change tables in a store -@tparam string location the location to set the data to -@tparam[opt] function update_callback the function called to update the value stored -@usage-- Updating all values at a location -Store.update(store_id_with_keys,function(value) - return value + 1 -end) -@usage-- Updating all tables at a location -Store.update(store_id_with_keys,function(value) - value.ctn = value.ctn + 1 -end) -]] -function Store.update_all(location,update_callback,...) - local data = Store.get(location) - - error_not_table(data) - - for key,value in pairs(data) do - local rtn - if update_callback and type(update_callback) == 'function' then - rtn = update_callback(value,key,...) - end - - if rtn then - Store.set(location,key,rtn,nil,true) - else - script.raise_event(Store.events.on_value_changed,{ - tick=game.tick, - location=location, - key=key, - value=value, - from_sync=false - }) - end - end - -end - ---[[-- Sets the value at a location to nil, this location must be registered -@tparam string location the location to set the data to -@tparam[opt] string key the key location if used -@tparam[opt=false] boolean from_sync set this true to avoid an output to the sync file -@treturn boolean true if it was successful -@usage-- Clear the data at a location -Store.clear(store_id_no_keys) -Store.clear(store_id_with_keys,'key_one') -]] -function Store.clear(location,key,from_sync) - if not Store.callbacks[location] then - return error('Location is not registered', 2) - end + -- Check the store is valid + key = Store.validate(store,key,2) + local value + -- If a key is used then the store must be a table if key then - local data = store_data[location] - if not data then return end - error_not_table(data) - data[key] = nil + if type(data_store[store]) ~= 'table' then + data_store[store] = {_value = data_store[store]} + end + + -- Call the updater and if it returns a value then set this value + local rtn = updater(data_store[store][key]) + if rtn then + data_store[store][key] = rtn + end + value = data_store[store][key] + else - store_data[location] = nil + -- Call the updater and if it returns a value then set this value + local rtn = updater(data_store[store]) + if rtn then + data_store[store] = rtn + end + value = data_store[store] + end - script.raise_event(Store.events.on_value_changed,{ - tick=game.tick, - location=location, - key=key, - from_sync=from_sync or false - }) - - return true + -- Trigger any watchers + Store.trigger(store,key,value) end ---[[-- Gets all non nil keys at a location, keys can be added and removed during runtime -this is similar to Store.get but will always return a table even if it is empty -@tparam string location the location to get the keys of -@treturn table a table containing all the keys names -@usage-- Get all keys at a store location -local keys = Store.get_keys(store_id_with_keys) -]] -function Store.get_keys(location) - local data = Store.get(location) - return type(data) == 'table' and table_keys(data) or {} -end +--[[-- Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present +@tparam number store the uid of the store that you want to map +@tparam function updater the function that is called on every key in this store ---[[-- Check for if a location is registered -@tparam string location the location to test for -@treturn boolean true if registered -@usage-- Check that a store is registered -local registerd = Store.is_registered(store_id) -]] -function Store.is_registered(location) - return Store.registered[location] -end - ---[[-- Returns a unique name that can be used for a store -@treturn string a unique name -@usage-- Get a new unique store id -local store_id = Store.uid_location() -]] -function Store.uid_location() - return tostring(Token.uid()) -end - --- Handles syncing -Event.add(Store.events.on_value_changed,function(event) - if Store.callbacks[event.location] then - Store.callbacks[event.location](event.value,event.key) - end - - if not event.from_sync and Store.synced[event.location] then - write_json('log/store.log',{ - tick=event.tick, - location=event.location, - key=event.key, - value=event.value, - }) - end +@usage-- Updating keys in a table of data +-- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects +local player_data = Store.register(function(player) + return player.name end) +-- Setting a default value for your player, used to show the table structure +Store.set(player_data,game.player,{ + group = 'Admin', + role = 'Owner', + show_group_config = false +}) + +-- Updating the show_group_config key for all players, note that it would be harder to call set every time +-- We do not need to return anything in this case as we are not replacing all the data +-- We also have access to the current key being updated if needed +Store.map(player_data,function(data,key) + data.show_group_config = not data.show_group_config +end) + +]] +function Store.map(store,updater) + Store.validate(store,nil,2) + + -- Get all that data in the store and check its a table + local data = data_store[store] + if not type(data) == 'table' then + return + end + + -- Loop over all the keys and call the updater, setting value if returned, and calling watcher functions + for key,value in pairs(data) do + local rtn = updater(value,key) + if rtn then + data[key] = rtn + end + Store.trigger(store,key,data[key]) + end +end + +--[[-- Used to trigger any watchers that are on this store, the key and value are passed to the watcher functions +@tparam number store the uid of the store that you want to trigger +@tparam[opt] ?string|any key the key that you want to trigger, must be a string unless you have a serializer +@tparam[opt] any value the new value that is at this key or store, passed directly to the watcher + +@usage-- Triggering a manule call of the watchers +-- The type of store we use does not really matter for this as long as you pass it what you watchers are expecting +local scenario_diffculty = Store.register() + +-- Trigger the watchers with a fake change of diffculty +-- This is mostly used internally but it can be useful in other cases +Store.trigger(scenario_diffculty,nil,'normal') + +]] +function Store.trigger(store,key,value) + key = Store.validate(store,key,2) + + -- Get the watchers and then loop over them + local watchers = Store.watchers[store] + for _,watcher in pairs(watchers) do + local success, err = pcall(watcher,value,key) + if not success then + error('Store watcher casued an error: '..err) + end + end +end + +-- Module return return Store \ No newline at end of file From cf1515c1c8e57f67cf1d84a86abef6c180222324 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Fri, 11 Oct 2019 23:25:04 +0100 Subject: [PATCH 69/93] Updated Tasks --- docs/addons/Advanced-Start.html | 54 +-- docs/addons/Chat-Popups.html | 54 +-- docs/addons/Chat-Reply.html | 54 +-- docs/addons/Compilatron.html | 54 +-- docs/addons/Damage-Popups.html | 54 +-- docs/addons/Death-Logger.html | 54 +-- docs/addons/Discord-Alerts.html | 54 +-- docs/addons/Player-Colours.html | 54 +-- docs/addons/Pollution-Grading.html | 54 +-- docs/addons/Scorched-Earth.html | 54 +-- docs/addons/Spawn-Area.html | 54 +-- docs/commands/Admin-Chat.html | 30 +- docs/commands/Bonus.html | 30 +- docs/commands/Cheat-Mode.html | 30 +- docs/commands/Clear-Inventory.html | 30 +- docs/commands/Debug.html | 30 +- docs/commands/Find.html | 30 +- docs/commands/Help.html | 30 +- docs/commands/Home.html | 30 +- docs/commands/Interface.html | 30 +- docs/commands/Jail.html | 30 +- docs/commands/Kill.html | 30 +- docs/commands/Me.html | 30 +- docs/commands/Rainbow.html | 30 +- docs/commands/Repair.html | 30 +- docs/commands/Reports.html | 30 +- docs/commands/Roles.html | 30 +- docs/commands/Spawn.html | 30 +- docs/commands/Tag.html | 30 +- docs/commands/Teleport.html | 30 +- docs/commands/Warnings.html | 30 +- docs/config.ld | 4 +- docs/configs/Advanced-Start.html | 54 +-- docs/configs/Bonuses.html | 54 +-- docs/configs/Chat-Reply.html | 54 +-- docs/configs/Commands-Auth-Admin.html | 54 +-- docs/configs/Commands-Auth-Roles.html | 54 +-- .../Commands-Auth-Runtime-Disable.html | 54 +-- docs/configs/Commands-Parse-Roles.html | 54 +-- docs/configs/Commands-Parse.html | 54 +-- docs/configs/Compilatron.html | 54 +-- docs/configs/Death-Logger.html | 54 +-- docs/configs/Discord-Alerts.html | 54 +-- docs/configs/File-Loader.html | 54 +-- docs/configs/Permission-Groups.html | 54 +-- docs/configs/Player-List.html | 54 +-- docs/configs/Pollution-Grading.html | 54 +-- docs/configs/Popup-Messages.html | 54 +-- docs/configs/Preset-Player-Colours.html | 54 +-- docs/configs/Repair.html | 54 +-- docs/configs/Rockets.html | 54 +-- docs/configs/Roles.html | 54 +-- docs/configs/Science.html | 54 +-- docs/configs/Scorched-Earth.html | 54 +-- docs/configs/Spawn-Area.html | 54 +-- docs/configs/Tasks.html | 54 +-- docs/configs/Warnings.html | 54 +-- docs/configs/Warps.html | 54 +-- docs/control/Jail.html | 26 +- docs/control/Production.html | 26 +- docs/control/Reports.html | 26 +- docs/control/Rockets.html | 26 +- docs/control/Tasks.html | 322 +++++++----------- docs/control/Warnings.html | 26 +- docs/control/Warps.html | 26 +- docs/core/Commands.html | 54 +-- docs/core/Common-Library.html | 54 +-- docs/core/Gui.html | 54 +-- docs/core/Permissions-Groups.html | 54 +-- docs/core/Roles.html | 54 +-- docs/core/Store.html | 103 ++++-- docs/core/Sudo.html | 54 +-- docs/guis/Player-List.html | 30 +- docs/guis/Rocket-Info.html | 30 +- docs/guis/Science-Info.html | 30 +- docs/guis/Task-List.html | 30 +- docs/guis/Warps-List.html | 30 +- docs/index.html | 134 ++++---- docs/modules/control.html | 54 +-- .../utils.alien_evolution_progress.html | 54 +-- docs/modules/utils.core.html | 54 +-- docs/modules/utils.debug.html | 54 +-- docs/modules/utils.dump_env.html | 54 +-- docs/modules/utils.event.html | 54 +-- docs/modules/utils.event_core.html | 54 +-- docs/modules/utils.math.html | 54 +-- docs/modules/utils.recipe_locker.html | 54 +-- docs/modules/utils.state_machine.html | 54 +-- docs/modules/utils.table.html | 54 +-- docs/modules/utils.task.html | 54 +-- docs/modules/utils.timestamp.html | 54 +-- docs/topics/license.html | 54 +-- docs/topics/readme.md.html | 54 +-- expcore/store.lua | 50 ++- modules/commands/bonus.lua | 45 ++- modules/control/tasks.lua | 230 +++++++------ modules/gui/task-list.lua | 71 ++-- 97 files changed, 2518 insertions(+), 2479 deletions(-) diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index d5f1bc3d..70565d43 100644 --- a/docs/addons/Advanced-Start.html +++ b/docs/addons/Advanced-Start.html @@ -79,6 +79,32 @@ + +
    +

    Setters

    +
    +
    +
    +
    + # + add_warp(force_name, surface, position[, player_name][, warp_name]) +
    +
    +
    +
    + +

    Add a new warp for a force, the warp must have a surface and a position

    +

    + + + Parameters: + +
      + + + + + +
    • + + force_name + + : + + (string) + + the name of the force to add the warp for + +
    • + + + + + +
    • + + surface + + : + + (LuaSurface) + + the surface that the warp will be on + +
    • + + + + + +
    • + + position + + : + + (Position) + + the position that the warp will be on + +
    • + + + + + +
    • + + player_name + + : + + (string) + + the name of the player that is adding the warp + + (optional) +
    • + + + + + +
    • + + warp_name + + : + + (string) + + the name of the warp that is being added, if omited default is used + + (optional) +
    • + + +
    + + + + + Returns: +
      +
    • + (string) + the uid of the warp which was created +
    • +
    + + + + + + + + Usage: +
    -- Adding a new warp for your force at your position
    +local player = game.player
    +local warp_id = Warps.add_warp(player.force.name,player.surface,player.position,player.name)
    + + +
    +
    +
    +
    + # + remove_warp(warp_id) +
    +
    +
    +
    + +

    Removes a warp and any data linked to it

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp that you want to remove + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Removing a warp
    +Warps.remove_warp(warp_id)
    + + +
    +
    +
    +
    + # + update_warp(warp_id[, new_name][, new_icon][, player_name='server']) +
    +
    +
    +
    + +

    Update the name and icon for a warp

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp that you want to update + +
    • + + + + + +
    • + + new_name + + : + + (string) + + the new name that you want the warp to have + + (optional) +
    • + + + + + +
    • + + new_icon + + : + + (string) + + the new icon that you want the warp to have + + (optional) +
    • + + + + + +
    • + + player_name + + : + + (string) + + the name of the player that made the edit + + (default: 'server') +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Changing the name and icon for a warp
    +Warps.update_warp(warp_id,'My Warp','iron-plate',game.player.name)
    + + +
    +
    +
    +
    + # + set_editing(warp_id, player_name, state) +
    +
    +
    +
    + +

    Set the editing state for a player, can be used as a warning or to display a text field

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp that you want to effect + +
    • + + + + + +
    • + + player_name + + : + + (string) + + the name of the player you want to set the state for + +
    • + + + + + +
    • + + state + + : + + (boolean) + + the new state to set editing to + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Setting your editing state to true
    +Warps.set_editing(warp_id,game.player.name,true)
    + + +
    +
    +
    +
    + # + on_update(handler) +
    +
    +
    +
    + +

    Adds an update handler for when a warp is added, removed, or updated

    +

    + + + Parameters: + +
      + + + + + +
    • + + handler + + : + + (function) + + the handler which is called when a warp is updated + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Add a game print when a warp is updated
    +Warps.on_update(function(warp)
    +    game.print(warp.force_name..' now has the warp: '..warp.name)
    +end)
    + + +
    +
    +

    Map Intergration

    +
    +
    +
    +
    + # + make_warp_tag(warp_id) +
    +
    +
    +
    + +

    Add or update the chat tag for this warp

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp you want the chart tag for + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if a new tag was made, false if it was updated +
    • +
    + + + + + + + + Usage: +
    -- Adding a chart tag for a new warp
    +local tag_added = Warps.make_warp_tag(warp_id)
    + + +
    +
    +
    +
    + # + remove_warp_tag(warp_id) +
    +
    +
    +
    + +

    Remove the chart tag for this warp

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid for the warp that you want to remove the chart tag from + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if the tag was valid and was removed, false if the tag was invalid +
    • +
    + + + + + + + + Usage: +
    -- Removing the chart tag from a warp
    +local removed = Warps.remove_warp_tag(warp_id)
    + + +
    +
    +
    +
    + # + make_warp_area(warp_id) +
    +
    +
    +
    + +

    Add a warp area for the warp, purely cosmetic

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp you want the area for + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Adding a warp area for a warp
    +Warps.make_warp_area(warp_id)
    + + +
    +
    +
    +
    + # + remove_warp_area(warp_id) +
    +
    +
    +
    + +

    Remove the warp area for a warp

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp that you want to remove the area for + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Remove the warp area for a warp
    +Warps.remove_warp_area(warp_id)
    + + +
    +
    +
    +
    + # + set_spawn_warp(warp_id, force) +
    +
    +
    +
    + +

    Set a warp to be the spawn point for a force, force must own this warp

    +

    + + + Parameters: + +
      + + + + + +
    • + + warp_id + + : + + (string) + + the uid of the warp that you want to be the spawn for the force + +
    • + + + + + +
    • + + force + + : + + (LuaForce) + + the force that you want to set the spawn for + +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Set your forces spawn to a warp
    +Warps.set_spawn_warp(warp_id,game.player.force)
    @@ -840,7 +1489,7 @@
    -

    Teleports a player to a warp point

    +

    Teleport a player to a warp point

    @@ -893,508 +1542,9 @@ - - -
    -
    -

    Setters

    -
    -
    -
    -
    - # - add_handler(callback) -
    -
    -
    -
    - -

    Adds a new handler for when a warp is updated

    -

    - - - Parameters: - -
      - - - - - -
    • - - callback - - : - - (function) - - the callback which is ran when a warp is updated - -
    • - - -
    - - - - - Returns: -
      -
    • - (boolean) - true if the callback was added -
    • -
    - - - - - - - - - -
    -
    -
    -
    - # - set_editing(warp_id, player_name[, state]) -
    -
    -
    -
    - -

    Sets a player to be editing this warp, used with is_editing

    -

    - - - Parameters: - -
      - - - - - -
    • - - warp_id - - : - - (string) - - the uid of the warp that you want to editing for - -
    • - - - - - -
    • - - player_name - - : - - (string) - - the name of the player you want to set editing for - -
    • - - - - - -
    • - - state - - : - - (boolean) - - the new state to set editing to - - (optional) -
    • - - -
    - - - - - - - - - - - - - -
    -
    -
    -
    - # - update_warp(warp_id, name, icon[, player_name='server']) -
    -
    -
    -
    - -

    Updates a warp to a differecnt name and icon, both must be given

    -

    - - - Parameters: - -
      - - - - - -
    • - - warp_id - - : - - (string) - - the uid of the warp that you want to update - -
    • - - - - - -
    • - - name - - : - - (string) - - the name that you want the warp to have - -
    • - - - - - -
    • - - icon - - : - - (string) - - the new icon that you want the warp to have - -
    • - - - - - -
    • - - player_name - - : - - (string) - - the name of the player that is updating the warp - - (default: 'server') -
    • - - -
    - - - - - - - - - - - - - -
    -
    -

    Generators

    -
    -
    -
    -
    - # - make_chart_tag(warp_id) -
    -
    -
    -
    - -

    Adds or updates the chart tag for a warp

    -

    - - - Parameters: - -
      - - - - - -
    • - - warp_id - - : - - (string) - - the uid of the warp you want to make the chart tag for - -
    • - - -
    - - - - - Returns: -
      -
    • - (boolean) - true if a new tag was made, false if it was updated -
    • -
    - - - - - - - - - -
    -
    -
    -
    - # - new_warp(force_name, surface, position[, player_name='server'][, warp_name='New warp'][, block_generation=false][, set_spawn=false]) -
    -
    -
    -
    - -

    Adds a new warp to a force and makes the in game warp area

    -

    - - - Parameters: - -
      - - - - - -
    • - - force_name - - : - - (string) - - the name of the force to add a new warp for - -
    • - - - - - -
    • - - surface - - : - - (LuaSurface) - - the surface to add the warp to - -
    • - - - - - -
    • - - position - - : - - (Position) - - the postion to have the warp go to - -
    • - - - - - -
    • - - player_name - - : - - (string) - - the name of the player who added this warp - - (default: 'server') -
    • - - - - - -
    • - - warp_name - - : - - (string) - - the name of the warp that will be made - - (default: 'New warp') -
    • - - - - - -
    • - - block_generation - - : - - (boolean) - - when true a in game area will not be made - - (default: false) -
    • - - - - - -
    • - - set_spawn - - : - - (boolean) - - when true this warp will become the spawn for the force - - (default: false) -
    • - - -
    - - - - - - - - - - - - - -
    -
    -
    -
    - # - remove_warp(warp_id) -
    -
    -
    -
    - -

    Removes a warp and clears the area where it was added

    -

    - - - Parameters: - -
      - - - - - -
    • - - warp_id - - : - - (string) - - the uid of the warp that you want to remove - -
    • - - -
    - - - - - - - - - - - + Usage: +
    -- Teleport yourself to a warp point
    +Warps.teleport_player(warp_id,game.player)
    @@ -1413,7 +1563,7 @@ generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index 3e51b1d4..f14de469 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -1972,7 +1972,7 @@ generated by LDoc diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html index b68abc64..e9d35485 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -2746,7 +2746,7 @@ Common.table_insert(tbl,50,tbl2)
    generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index 16ab505d..a50ba4ed 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -10987,7 +10987,7 @@ generated by LDoc diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index 70e41128..dd574a66 100644 --- a/docs/core/Permissions-Groups.html +++ b/docs/core/Permissions-Groups.html @@ -1432,7 +1432,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index e5993370..ed416dcd 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -3152,7 +3152,7 @@ generated by LDoc diff --git a/docs/core/Store.html b/docs/core/Store.html index 4a247031..10806138 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -362,8 +362,12 @@ Store.set(player_scores,game.player,10) Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present - trigger(store[, key][, value]) - Used to trigger any watchers that are on this store, the key and value are passed to the watcher functions + trigger(store[, key]) + Used to trigger watcher functions, this may be used to trigger them if you did not use Store.update or Store.set + + + raw_trigger(store[, key][, value]) + Used to trigger watcher functions, the value and key are passed directly to the watchers regardless if the value is correct @@ -1252,13 +1256,87 @@ Store.set(player_scores,game.player,10)
    # - trigger(store[, key][, value]) + trigger(store[, key])
    -

    Used to trigger any watchers that are on this store, the key and value are passed to the watcher functions

    +

    Used to trigger watcher functions, this may be used to trigger them if you did not use Store.update or Store.set

    +

    + + + Parameters: + +
      + + + + + +
    • + + store + + : + + (number) + + the uid of the store that you want to trigger + +
    • + + + + + +
    • + + key + + : + + (string or any) + + the key that you want to trigger, must be a string unless you have a serializer + + (optional) +
    • + + +
    + + + + + + + + + + + + Usage: +
    -- Faking the update to a store
    +-- The type of store we use does not really matter for this as long as you pass it what you watchers are expecting
    +local scenario_diffculty = Store.register()
    +
    +-- Trigger the watchers with a fake change of diffculty
    +Store.trigger(scenario_diffculty)
    + + +
    +
    +
    +
    + # + raw_trigger(store[, key][, value]) +
    +
    +
    +
    + +

    Used to trigger watcher functions, the value and key are passed directly to the watchers regardless if the value is correct

    @@ -1336,7 +1414,7 @@ Store.set(player_scores,game.player,10) -- Trigger the watchers with a fake change of diffculty -- This is mostly used internally but it can be useful in other cases -Store.trigger(scenario_diffculty,nil,'normal') +Store.raw_trigger(scenario_diffculty,nil,'normal')
    @@ -1355,7 +1433,7 @@ Store.set(player_scores,game.player,10) generated by LDoc diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index 3508e4ab..9a50edd8 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -544,7 +544,7 @@ generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index 3f89ba2e..eee69c11 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -626,7 +626,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index 6474bb2d..16e9cadf 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -629,7 +629,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 21b03a69..3119948b 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -449,7 +449,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index 01acaa37..d5ed83fa 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -632,7 +632,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index 896d6665..f9a3c9b9 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -837,7 +837,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index d1adc427..07dcc66a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -118,7 +118,7 @@ Warps Control Module - Warps - - Stores warps for each force. +- Stores warps for each force.

    Addons

    @@ -514,7 +514,7 @@ see ./expcore/commands.lua for more details
    generated by LDoc diff --git a/docs/modules/control.html b/docs/modules/control.html index 2472c618..01c09b06 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -351,7 +351,7 @@ generated by LDoc diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html index 62aac5db..e0bff02c 100644 --- a/docs/modules/utils.alien_evolution_progress.html +++ b/docs/modules/utils.alien_evolution_progress.html @@ -419,7 +419,7 @@ fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on generated by LDoc diff --git a/docs/modules/utils.core.html b/docs/modules/utils.core.html index c3dd9764..2d619cbc 100644 --- a/docs/modules/utils.core.html +++ b/docs/modules/utils.core.html @@ -1164,7 +1164,7 @@ generated by LDoc diff --git a/docs/modules/utils.debug.html b/docs/modules/utils.debug.html index 4ff4c9a8..89d1652c 100644 --- a/docs/modules/utils.debug.html +++ b/docs/modules/utils.debug.html @@ -654,7 +654,7 @@ generated by LDoc diff --git a/docs/modules/utils.dump_env.html b/docs/modules/utils.dump_env.html index dd8b00f9..f4b29047 100644 --- a/docs/modules/utils.dump_env.html +++ b/docs/modules/utils.dump_env.html @@ -323,7 +323,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index f65f4892..7bc59dd3 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -1292,7 +1292,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index f08daadc..f3da2188 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -434,7 +434,7 @@ generated by LDoc diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html index 5902d9ed..317d2a54 100644 --- a/docs/modules/utils.math.html +++ b/docs/modules/utils.math.html @@ -353,7 +353,7 @@ generated by LDoc diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html index 01abc7b2..fe5b79ca 100644 --- a/docs/modules/utils.recipe_locker.html +++ b/docs/modules/utils.recipe_locker.html @@ -441,7 +441,7 @@ generated by LDoc diff --git a/docs/modules/utils.state_machine.html b/docs/modules/utils.state_machine.html index d453b460..f3fb7488 100644 --- a/docs/modules/utils.state_machine.html +++ b/docs/modules/utils.state_machine.html @@ -752,7 +752,7 @@ generated by LDoc diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html index 6e8b192b..5d70029e 100644 --- a/docs/modules/utils.table.html +++ b/docs/modules/utils.table.html @@ -1418,7 +1418,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index 75f7ebc3..0d490e35 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -651,7 +651,7 @@ generated by LDoc diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html index 65fd3fff..38a04573 100644 --- a/docs/modules/utils.timestamp.html +++ b/docs/modules/utils.timestamp.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/topics/license.html b/docs/topics/license.html index 3199dbb6..5414825d 100644 --- a/docs/topics/license.html +++ b/docs/topics/license.html @@ -789,7 +789,7 @@ Public License instead of this License. But first, please read generated by LDoc diff --git a/docs/topics/readme.md.html b/docs/topics/readme.md.html index 8702e7af..b313179f 100644 --- a/docs/topics/readme.md.html +++ b/docs/topics/readme.md.html @@ -333,7 +333,7 @@ generated by LDoc diff --git a/expcore/gui/prototype.lua b/expcore/gui/prototype.lua index 20624583..a98dece7 100644 --- a/expcore/gui/prototype.lua +++ b/expcore/gui/prototype.lua @@ -98,11 +98,7 @@ function Constructor.store(sync,callback) if not sync then categorize = location - location = Store.uid_location() - end - - if Store.is_registered(location) then - return error('Location for store is already registered: '..location,2) + location = Store.register() end self.store = location @@ -110,7 +106,7 @@ function Constructor.store(sync,callback) Instances.register(self.name,self.categorize) - Store.register(self.store,sync,function(value,category) + Store.watch(self.store,function(value,category) self:raise_event('on_store_update',value,category) if Instances.is_registered(self.name) then diff --git a/expcore/gui/test.lua b/expcore/gui/test.lua index 2e25c61b..a7fe9952 100644 --- a/expcore/gui/test.lua +++ b/expcore/gui/test.lua @@ -650,8 +650,8 @@ end) Event.add(defines.events.on_tick,function() progressbar_one:increment() progressbar_three:decrement() - local categories = Store.get_children(progressbar_two.store) - for _,category in pairs(categories) do + local categories = Store.get(progressbar_two.store) or {} + for category,_ in pairs(categories) do progressbar_two:increment(1,category) end end) diff --git a/expcore/store.lua b/expcore/store.lua index c040e192..0b78ae7e 100644 --- a/expcore/store.lua +++ b/expcore/store.lua @@ -99,7 +99,7 @@ function Store.validate(store,key,error_stack) if not success then -- Serializer casued an error while serializing the key - error('Store watcher casued an error: '..key,error_stack+1) + error('Store watcher casued an error:\n\t'..key,error_stack+1) elseif type(key) ~= 'string' then -- Serializer was successful but failed to return a string value error('Store key serializer did not return a string; recived type '..type(key),error_stack+1) @@ -227,7 +227,12 @@ function Store.get(store,key) -- Get the data from the data store local data = data_store[store] if key then - return data[key] + if type(data) ~= 'table' then + data_store[store] = {_value = data_store[store]} + return nil + else + return data[key] + end end -- Return all data if there is no key @@ -269,7 +274,7 @@ function Store.clear(store,key) end -- Trigger any watch functions - Store.trigger(store,key,nil) + Store.raw_trigger(store,key,nil) end --[[-- Used to set the data in a store, will trigger any watchers, key is optional depending on if you are using them @@ -321,7 +326,7 @@ function Store.set(store,key,value) end -- Trigger any watchers - Store.trigger(store,key,value) + Store.raw_trigger(store,key,value) end --[[-- Used to update the data in a store, use this with tables, will trigger any watchers, key is optional depending on if you are using them @@ -396,7 +401,7 @@ function Store.update(store,key,updater) end -- Trigger any watchers - Store.trigger(store,key,value) + Store.raw_trigger(store,key,value) end --[[-- Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present @@ -439,11 +444,34 @@ function Store.map(store,updater) if rtn then data[key] = rtn end - Store.trigger(store,key,data[key]) + Store.raw_trigger(store,key,data[key]) end end ---[[-- Used to trigger any watchers that are on this store, the key and value are passed to the watcher functions +--[[-- Used to trigger watcher functions, this may be used to trigger them if you did not use Store.update or Store.set +@tparam number store the uid of the store that you want to trigger +@tparam[opt] ?string|any key the key that you want to trigger, must be a string unless you have a serializer +@usage-- Faking the update to a store +-- The type of store we use does not really matter for this as long as you pass it what you watchers are expecting +local scenario_diffculty = Store.register() + +-- Trigger the watchers with a fake change of diffculty +Store.trigger(scenario_diffculty) + +]] +function Store.trigger(store,key) + key = Store.validate(store,key,2) + + -- Get the data from the data store + local data = data_store[store] + if key then + Store.raw_trigger(store,key,data[key]) + else + Store.raw_trigger(store,key,data) + end +end + +--[[-- Used to trigger watcher functions, the value and key are passed directly to the watchers regardless if the value is correct @tparam number store the uid of the store that you want to trigger @tparam[opt] ?string|any key the key that you want to trigger, must be a string unless you have a serializer @tparam[opt] any value the new value that is at this key or store, passed directly to the watcher @@ -454,18 +482,18 @@ local scenario_diffculty = Store.register() -- Trigger the watchers with a fake change of diffculty -- This is mostly used internally but it can be useful in other cases -Store.trigger(scenario_diffculty,nil,'normal') +Store.raw_trigger(scenario_diffculty,nil,'normal') ]] -function Store.trigger(store,key,value) +function Store.raw_trigger(store,key,value) key = Store.validate(store,key,2) -- Get the watchers and then loop over them - local watchers = Store.watchers[store] + local watchers = Store.watchers[store] or {} for _,watcher in pairs(watchers) do local success, err = pcall(watcher,value,key) if not success then - error('Store watcher casued an error: '..err) + error('Store watcher casued an error:\n\t'..err) end end end diff --git a/modules/control/tasks.lua b/modules/control/tasks.lua index 4223c91f..6b2d9630 100644 --- a/modules/control/tasks.lua +++ b/modules/control/tasks.lua @@ -34,15 +34,17 @@ Tasks.store = task_store @tparam string force_name the name of the force to add the task for @tparam[opt] number task_number the order place to add the task to, appends to end if omited @tparam[opt] string player_name the player who added this task, will cause them to be listed under editing +@tparam[opt] string task_message the message that is used for this task, if not given default is used @treturn string the uid of the task which was created @usage-- Adding a new task for your force local task_id = Tasks.add_task(game.player.force.name,nil,game.player.name) ]] -function Tasks.add_task(force_name,task_number,player_name) +function Tasks.add_task(force_name,task_number,player_name,task_message) -- Get a new task id local task_id = tostring(Token.uid()) + task_message = task_message or 'New Task' -- Get the existing tasks for this force local tasks = force_tasks[force_name] @@ -68,7 +70,7 @@ function Tasks.add_task(force_name,task_number,player_name) Store.set(task_store,task_id,{ task_id = task_id, force_name = force_name, - message = 'New Task', + message = task_message, last_edit_name = player_name or '', last_edit_time = game.tick, curently_editing = editing diff --git a/modules/control/warps.lua b/modules/control/warps.lua index 5a7d5445..a9e3c5d7 100644 --- a/modules/control/warps.lua +++ b/modules/control/warps.lua @@ -1,27 +1,23 @@ --[[-- Control Module - Warps - - Stores warps for each force. - @control Warps - @alias Warps +- Stores warps for each force. +@control Warps +@alias Warps - @usage - -- import the module from the control modules - local Warps = require 'modules.control.warps' --- @dep modules.control.warps +@usage-- Making a new spawn warp +local player = game.player +local force = player.force +local spawn_id = Warps.add_warp(force.name,player.surface,player.position,player.name,'Spawn') - -- Adding a warp require a force, surface and postion, and the option to set this as the spawn - -- this function will also create the warp area unless set other wise - Warps.new_warp('player',surface,{x=0,y=0}) +Warps.set_spawn_warp(spawn_id, force) +Warps.make_warp_tag(spawn_id) - -- You can then update the warp information, name and icon, with the update function - Warps.update_warp(warp_id,'Best Warp','iron-plate') +@usage-- Making a new warp with a warp area +local player = game.player +local force = player.force +local warp_id = Warps.add_warp(force.name,player.surface,player.position,player.name) - -- Removeing a warp will restore the land that as under it, and remove any data linked with it - Warps.remove_warp(warp_id) - - -- You can get the deatils for a warp which include last edit and postion - Warps.get_details(warp_id) - - -- You can teleport a player to a warp, note that there is no limit on this action - Warps.teleport_player(warp_id,player) +Warps.make_warp_area(warp_id) +Warps.make_warp_tag(warp_id) ]] @@ -31,153 +27,139 @@ local Token = require 'utils.token' --- @dep utils.token local config = require 'config.warps' --- @dep config.warps local table_values,table_keysort = ext_require('expcore.common','table_values','table_keysort') --- @dep expcore.common -local Warps = { - store = { - names = 'gui.left.warps.names', - icons = 'gui.left.warps.tags' - }, - details = {}, - forces = {}, - handlers = {} -} +local Warps = {} -local warp_details = Warps.details -local force_warps = Warps.forces -Global.register({ - warp_details=warp_details, - force_warps=force_warps -},function(tbl) - Warps.details = tbl.warp_details - Warps.forces = tbl.force_warps - warp_details = Warps.details - force_warps = Warps.forces +-- Global lookup table for force name to task ids +local force_warps = {} +Global.register(force_warps,function(tbl) + force_warps = tbl end) -local warp_names = Warps.store.names -Store.register(warp_names,function(value,warp_id) - local details = warp_details[warp_id] - local force_name = details.force - local force = game.forces[force_name] - local warps = force_warps[force_name] - local spawn_id = warps.spawn +-- Warp store is keyed by warp id, value is a table +local warp_store = Store.register() +Warps.store = warp_store - local names = {} - for _,next_warp_id in pairs(warps) do - local warp_name = Store.get(warp_names,next_warp_id) - if next_warp_id ~= spawn_id then - names[warp_name..next_warp_id] = next_warp_id +-- When a warp is updated change its chat tag and resort the warp order +Store.watch(warp_store,function(warp,warp_id) + if warp then + -- Update the map chart tag if there is one + if warp.tag then + Warps.make_warp_tag(warp_id) end - end - force_warps[force_name] = table_values(table_keysort(names)) - table.insert(force_warps[force.name],1,spawn_id) - force_warps[force_name].spawn = spawn_id + -- Check that the name of the warp has been changed + if warp.name == warp.old_name then return end - for _,handler in pairs(Warps.handlers) do - handler(force,warp_id) + -- Get the names of all the warp points for this force + local force_name = warp.force_name + local warp_ids = force_warps[force_name] + local spawn_id = warp_ids.spawn + + local warp_names = {} + for _,next_warp_id in pairs(warp_ids) do + local next_warp = Store.get(warp_store,next_warp_id) + if next_warp_id ~= spawn_id then + warp_names[next_warp.name..next_warp_id] = next_warp_id + end + end + + -- Sort the warp names in alphabetical order + local new_warp_ids = table_values(table_keysort(warp_names)) + table.insert(new_warp_ids,1,spawn_id) + new_warp_ids.spawn = spawn_id + force_warps[force_name] = new_warp_ids end end) -local warp_icons = Warps.store.icons -Store.register(warp_icons,function(value,warp_id) - if value then - Warps.make_chart_tag(warp_id) - else - local warp = warp_details[warp_id] - if warp.tag and warp.tag.valid then warp.tag.destroy() end - end -end) - ---- Generators. +--- Map Intergration. -- functions used to create and alter warps with in the map --- @section generators +-- @section mapIntergration ---- Adds or updates the chart tag for a warp --- @tparam string warp_id the uid of the warp you want to make the chart tag for --- @treturn boolean true if a new tag was made, false if it was updated -function Warps.make_chart_tag(warp_id) - local warp = warp_details[warp_id] +--[[-- Add or update the chat tag for this warp +@tparam string warp_id the uid of the warp you want the chart tag for +@treturn boolean true if a new tag was made, false if it was updated - local name = Store.get(warp_names,warp_id) - local icon = Store.get(warp_icons,warp_id) +@usage-- Adding a chart tag for a new warp +local tag_added = Warps.make_warp_tag(warp_id) - if warp.tag and warp.tag.valid then - warp.tag.text = 'Warp: '..name - warp.tag.icon = {type='item',name=icon} +]] +function Warps.make_warp_tag(warp_id) + local warp = Store.get(warp_store,warp_id) + local name = warp.name + local icon = warp.icon + + -- Edit the existing tag if it is present + local tag = warp.tag + if tag and tag.valid then + tag.text = 'Warp: '..name + tag.icon = {type='item',name=icon} return false end - local force = game.forces[warp.force] + -- Make a new tag if one did not exist + local force = game.forces[warp.force_name] local surface = warp.surface local position = warp.position - local tag = force.add_chart_tag(surface,{ - position={position.x+0.5,position.y+0.5}, - text='Warp: '..name, - icon={type='item',name=icon} + tag = force.add_chart_tag(surface,{ + position = {position.x+0.5,position.y+0.5}, + text = 'Warp: '..name, + icon = {type='item',name=icon} }) + -- Add the tag to this warp, store.update not needed as we dont want it to trigger warp.tag = tag return true end ---- Adds a new warp to a force and makes the in game warp area --- @tparam string force_name the name of the force to add a new warp for --- @tparam LuaSurface surface the surface to add the warp to --- @tparam Position position the postion to have the warp go to --- @tparam[opt='server'] string player_name the name of the player who added this warp --- @tparam[opt='New warp'] string warp_name the name of the warp that will be made --- @tparam[opt=false] boolean block_generation when true a in game area will not be made --- @tparam[opt=false] boolean set_spawn when true this warp will become the spawn for the force -function Warps.new_warp(force_name,surface,position,player_name,warp_name,block_generation,set_spawn) - local warp_id = tostring(Token.uid()) - warp_name = warp_name or 'New warp' +--[[-- Remove the chart tag for this warp +@tparam string warp_id the uid for the warp that you want to remove the chart tag from +@treturn boolean true if the tag was valid and was removed, false if the tag was invalid - if not force_warps[force_name] then - force_warps[force_name] = {} - end - table.insert(force_warps[force_name],warp_id) +@usage-- Removing the chart tag from a warp +local removed = Warps.remove_warp_tag(warp_id) - warp_details[warp_id] = { - warp_id = warp_id, - force = force_name, - position = { - x=math.floor(position.x), - y=math.floor(position.y) - }, - surface = surface, - last_edit_player=player_name or '', - last_edit_time=game.tick, - editing={} - } +]] +function Warps.remove_warp_tag(warp_id) + local warp = Store.get(warp_store,warp_id) - local warp = warp_details[warp_id] - - if player_name then - warp.editing[player_name] = true + -- Check there is a tag to remove + local tag = warp.tag + if not tag or not tag.valid then + warp.tag = nil + return false end - if set_spawn then - force_warps[force_name].spawn = warp_id - game.forces[force_name].set_spawn_position(position,surface) - end + -- Remove the warp chart tag if it is valid + tag.destroy() + warp.tag = nil - Store.set(warp_names,warp_id,warp_name) - Store.set(warp_icons,warp_id,config.default_icon) + return true +end - if block_generation then return warp_id end +--[[-- Add a warp area for the warp, purely cosmetic +@tparam string warp_id the uid of the warp you want the area for +@usage-- Adding a warp area for a warp +Warps.make_warp_area(warp_id) + +]] +function Warps.make_warp_area(warp_id) + local warp = Store.get(warp_store,warp_id) + local surface = warp.surface + local position = warp.position local posx = position.x local posy = position.y local radius = config.activation_range local radius2 = radius^2 + -- Get the tile that is being replaced, store.update not needed as we dont want it to trigger local old_tile = surface.get_tile(position).name warp.old_tile = old_tile + -- Make a circle that acts as a base for the warp structure local base_tile = config.base_tile local base_tiles = {} - -- this makes a base plate to make the warp point for x = -radius, radius do local x2 = x^2 for y = -radius, radius do @@ -189,14 +171,14 @@ function Warps.new_warp(force_name,surface,position,player_name,warp_name,block_ end surface.set_tiles(base_tiles) - -- this adds the tile pattern + -- Add a tile patern ontop of the base local tiles = {} for _,pos in pairs(config.tiles) do table.insert(tiles,{name=base_tile,position={pos[1]+posx,pos[2]+posy}}) end surface.set_tiles(tiles) - -- this adds the enitites + -- Add entities to the warp structure for _,entity in pairs(config.entities) do entity = surface.create_entity{ name=entity[1], @@ -208,29 +190,28 @@ function Warps.new_warp(force_name,surface,position,player_name,warp_name,block_ entity.minable = false entity.rotatable = false end - - return warp_id end ---- Removes a warp and clears the area where it was added --- @tparam string warp_id the uid of the warp that you want to remove -function Warps.remove_warp(warp_id) - local force_name = warp_details[warp_id].force - local warps = force_warps[force_name] - local key = table.index_of(warps,warp_id) - warps[key] = nil - Store.clear(warp_names,warp_id) - Store.clear(warp_icons,warp_id) +--[[-- Remove the warp area for a warp +@tparam string warp_id the uid of the warp that you want to remove the area for - local warp = warp_details[warp_id] +@usage-- Remove the warp area for a warp +Warps.remove_warp_area(warp_id) + +]] +function Warps.remove_warp_area(warp_id) + local warp = Store.get(warp_store,warp_id) local position = warp.position local surface = warp.surface local radius = config.activation_range local radius2 = radius^2 + -- Check that a warp area was created previously local base_tile = warp.old_tile + if not base_tile then return end + + -- Reset all the tiles that were replaced local tiles = {} - -- clears the area where the warp was for x = -radius, radius do local x2 = x^2 for y = -radius, radius do @@ -242,7 +223,7 @@ function Warps.remove_warp(warp_id) end surface.set_tiles(tiles) - -- removes all entites (in the area) on the neutral force + -- Remove all the entites that are in the area local entities = surface.find_entities_filtered{ force='neutral', area={ @@ -251,108 +232,230 @@ function Warps.remove_warp(warp_id) } } for _,entity in pairs(entities) do if entity.name ~= 'player' then entity.destroy() end end - - warp_details[warp_id] = nil end ---- Setters. --- functions used to created and alter warps --- @section setters +--[[-- Set a warp to be the spawn point for a force, force must own this warp +@tparam string warp_id the uid of the warp that you want to be the spawn for the force +@tparam LuaForce force the force that you want to set the spawn for ---- Adds a new handler for when a warp is updated --- @tparam function callback the callback which is ran when a warp is updated --- @treturn boolean true if the callback was added -function Warps.add_handler(callback) - if type(callback) == 'function' then - table.insert(Warps.handlers,callback) - return true +@usage-- Set your forces spawn to a warp +Warps.set_spawn_warp(warp_id,game.player.force) + +]] +function Warps.set_spawn_warp(warp_id,force) + -- Check the force owns this warp + local warp = Store.get(warp_store,warp_id) + if warp.force_name ~= force.name then return end + + -- Set this warp as the spawn + local warp_ids = force_warps[warp.force_name] + if not warp_ids then + warp_ids = {} + force_warps[warp.force_name] = warp_ids end - return false + warp_ids.spawn = warp_id + + -- Set the forces spawn to this warp + force.set_spawn_position(warp.position, warp.surface) end ---- Sets a player to be editing this warp, used with is_editing --- @tparam string warp_id the uid of the warp that you want to editing for --- @tparam string player_name the name of the player you want to set editing for --- @tparam[opt] boolean state the new state to set editing to -function Warps.set_editing(warp_id,player_name,state) - local details = warp_details[warp_id] - details.editing[player_name] = state -end +--[[-- Teleport a player to a warp point +@tparam string warp_id the uid of the warp to send the player to +@tparam LuaPlayer player the player to teleport to the warp ---- Updates a warp to a differecnt name and icon, both must be given --- @tparam string warp_id the uid of the warp that you want to update --- @tparam string name the name that you want the warp to have --- @tparam string icon the new icon that you want the warp to have --- @tparam[opt='server'] string player_name the name of the player that is updating the warp -function Warps.update_warp(warp_id,name,icon,player_name) - local warp = warp_details[warp_id] - warp.last_edit_player = player_name or '' - warp.last_edit_time = game.tick - Store.set(warp_icons,warp_id,icon) - Store.set(warp_names,warp_id,name) -end +@usage-- Teleport yourself to a warp point +Warps.teleport_player(warp_id,game.player) ---- Getters. --- function used to get information about warps --- @section getters - ---- Gets the name of a warp --- @tparam string warp_id the uid of the warp you want to get --- @treturn string the warp name that was stored here -function Warps.get_warp_name(warp_id) - return Store.get(warp_names,warp_id) -end - ---- Gets the icon of a warp --- @tparam string warp_id the uid of the warp you want to get --- @treturn string the warp icon that was stored here -function Warps.get_warp_icon(warp_id) - return Store.get(warp_icons,warp_id) or config.default_icon -end - ---- Gets the task details stored at this id --- @tparam string warp_id the uid of the warp you want to get --- @treturn table the warp details that was stored here -function Warps.get_details(warp_id) - return warp_details[warp_id] -end - ---- Gets all warps for a force --- @tparam string force_name the name of the force to get the warps for --- @treturn table an array of warp ids that belong to this force, spawn key is included -function Warps.get_warps(force_name) - return force_warps[force_name] or {} -end - ---- Gets all warps from all forces --- @treturn table array of all warp details -function Warps.get_all_warps() - return warp_details -end - ---- Gets if a player is currently editing this warp --- @tparam string warp_id the uid of the warp you want to check --- @tparam string player_name the name of the player that you want to check --- @treturn boolean weather the player is currently editing this warp -function Warps.is_editing(warp_id,player_name) - local details = warp_details[warp_id] - return details.editing[player_name] -end - ---- Teleports a player to a warp point --- @tparam string warp_id the uid of the warp to send the player to --- @tparam LuaPlayer player the player to teleport to the warp +]] function Warps.teleport_player(warp_id,player) - local warp = warp_details[warp_id] + local warp = Store.get(warp_store,warp_id) local surface = warp.surface local position = { x=warp.position.x+0.5, y=warp.position.y+0.5 } + -- Teleport the player local goto_position = surface.find_non_colliding_position('character',position,32,1) if player.driving then player.driving = false end player.teleport(goto_position,surface) end +--- Setters. +-- functions used to created and alter warps +-- @section setters + +--[[-- Add a new warp for a force, the warp must have a surface and a position +@tparam string force_name the name of the force to add the warp for +@tparam LuaSurface surface the surface that the warp will be on +@tparam Concepts.Position position the position that the warp will be on +@tparam[opt] string player_name the name of the player that is adding the warp +@tparam[opt] string warp_name the name of the warp that is being added, if omited default is used +@treturn string the uid of the warp which was created + +@usage-- Adding a new warp for your force at your position +local player = game.player +local warp_id = Warps.add_warp(player.force.name,player.surface,player.position,player.name) + +]] +function Warps.add_warp(force_name,surface,position,player_name,warp_name) + -- Get new warp id + local warp_id = tostring(Token.uid()) + warp_name = warp_name or 'New warp' + + -- Get the existing warps for this force + local warps = force_warps[force_name] + if not warps then + force_warps[force_name] = {} + warps = force_warps[force_name] + end + + -- Insert the warp id into the force warps + table.insert(warps,warp_id) + + -- Create the editing table + local editing = {} + if player_name then + editing[player_name] = true + end + + -- Add the new warp to the store + Store.set(warp_store,warp_id,{ + warp_id = warp_id, + force_name = force_name, + name = warp_name, + icon = config.default_icon, + surface = surface, + position = { + x = math.floor(position.x), + y = math.floor(position.y) + }, + last_edit_name = player_name or '', + last_edit_time = game.tick, + currently_editing = editing + }) + + return warp_id +end + +--[[-- Removes a warp and any data linked to it +@tparam string warp_id the uid of the warp that you want to remove + +@usage-- Removing a warp +Warps.remove_warp(warp_id) + +]] +function Warps.remove_warp(warp_id) + local warp = Store.get(warp_store,warp_id) + local force_name = warp.force_name + Warps.remove_warp_tag(warp_id) + Warps.remove_warp_area(warp_id) + Store.clear(warp_store,warp_id) + table.remove_element(force_warps[force_name],warp_id) +end + +--[[-- Update the name and icon for a warp +@tparam string warp_id the uid of the warp that you want to update +@tparam[opt] string new_name the new name that you want the warp to have +@tparam[opt] string new_icon the new icon that you want the warp to have +@tparam[opt='server'] string player_name the name of the player that made the edit + +@usage-- Changing the name and icon for a warp +Warps.update_warp(warp_id,'My Warp','iron-plate',game.player.name) + +]] +function Warps.update_warp(warp_id,new_name,new_icon,player_name) + Store.update(warp_store,warp_id,function(warp) + warp.last_edit_name = player_name or '' + warp.last_edit_time = game.tick + warp.old_name = warp.name + warp.name = new_name or warp.name + warp.icon = new_icon or warp.icon + end) +end + +--[[-- Set the editing state for a player, can be used as a warning or to display a text field +@tparam string warp_id the uid of the warp that you want to effect +@tparam string player_name the name of the player you want to set the state for +@tparam boolean state the new state to set editing to + +@usage-- Setting your editing state to true +Warps.set_editing(warp_id,game.player.name,true) + +]] +function Warps.set_editing(warp_id,player_name,state) + Store.update(warp_store,warp_id,function(warp) + warp.currently_editing[player_name] = state + end) +end + +--[[-- Adds an update handler for when a warp is added, removed, or updated +@tparam function handler the handler which is called when a warp is updated + +@usage-- Add a game print when a warp is updated +Warps.on_update(function(warp) + game.print(warp.force_name..' now has the warp: '..warp.name) +end) + +]] +function Warps.on_update(handler) + Store.watch(warp_store,handler) +end + +--- Getters. +-- function used to get information about warps +-- @section getters + +--[[-- Gets the warp information that is linked with this id +@tparam string warp_id the uid of the warp you want to get +@treturn table the warp information + +@usage-- Getting warp information outside of on_update +local warp = Warps.get_warp(warp_id) + +]] +function Warps.get_warp(warp_id) + return Store.get(warp_store,warp_id) +end + +--[[-- Gets all the warp ids that a force has +@tparam string force_name the name of the force that you want the warp ids for +@treturn table an array of all the warp ids + +@usage-- Getting the warp ids for a force +local warp_ids = Warps.get_force_warp_ids(game.player.force.name) + +]] +function Warps.get_force_warp_ids(force_name) + return force_warps[force_name] or {} +end + +--[[-- Get the id of the spawn warp +@tparam string force_name the name of the force that you want to get the spawn warp for +@treturn ?string|nil the uid of the spawn warp for this force if there is one + +@usage-- Getting the spawn warp id +local spawn_id = Warps.get_spawn_warp_id(game.player.force.name) + +]] +function Warps.get_spawn_warp_id(force_name) + local warp_ids = force_warps[force_name] or {} + return warp_ids.spawn +end + +--[[-- Gets the editing state for a player +@tparam string warp_id the uid of the warp you want to check +@tparam string player_name the name of the player that you want to check +@treturn boolean weather the player is currently editing this warp + +@usage-- Check if a player is editing a warp or not +local editing = Warps.get_editing(warp_id,game.player.name) + +]] +function Warps.get_editing(warp_id,player_name) + local warp = Store.get(warp_store,warp_id) + return warp.currently_editing[player_name] +end + +-- Module return return Warps \ No newline at end of file diff --git a/modules/gui/task-list.lua b/modules/gui/task-list.lua index 9ea2305f..1704ebbd 100644 --- a/modules/gui/task-list.lua +++ b/modules/gui/task-list.lua @@ -14,7 +14,7 @@ local Tasks = require 'modules.control.tasks' --- @dep modules.control.tasks --- If a player is allowed to use the edit buttons local function player_allowed_edit(player,task) if task then - if config.user_can_edit_own_tasks and task.last_edit_player == player.name then + if config.user_can_edit_own_tasks and task.last_edit_name == player.name then return true end else diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index 9fb9e390..a1b50dc2 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -15,22 +15,25 @@ local config = require 'config.warps' --- @dep config.warps local format_time,table_keys = ext_require('expcore.common','format_time','table_keys') --- @dep expcore.common local Warps = require 'modules.control.warps' --- @dep modules.control.warps -local warp_player_in_range_store = 'gui.left.warps.in_range' +-- Stores a boolean value indexed by player name +local player_in_range_store = Store.register(function(player) + return player.name +end) -local keep_open = {} -Global.register(keep_open,function(tbl) - keep_open = tbl +-- Table that stores a boolean value of weather to keep the warp gui open +local keep_gui_open = {} +Global.register(keep_gui_open,function(tbl) + keep_gui_open = tbl end) --- Returns if a player is allowed to edit the given warp -local function player_allowed_edit(player,warp_id) - if warp_id then - local details = Warps.get_details(warp_id) - local warps = Warps.get_warps(player.force.name) - if warps.spawn == warp_id then +local function player_allowed_edit(player,warp) + if warp then + local spawn_id = Warps.get_spawn_warp_id(player.force.name) + if spawn_id == warp.warp_id then return false end - if config.user_can_edit_own_warps and details.last_edit_player == player.name then + if config.user_can_edit_own_warps and warp.last_edit_name == player.name then return true end else @@ -55,7 +58,7 @@ end local zoom_to_map_name = Gui.uid_name() Gui.on_click(zoom_to_map_name,function(event) local warp_id = event.element.parent.name - local warp = Warps.get_details(warp_id) + local warp = Warps.get_warp(warp_id) local position = warp.position event.player.zoom_to_world(position,1.5) end) @@ -73,9 +76,7 @@ Gui.new_progressbar() style.color = Colors.light_blue end) :on_store_complete(function(player_name,reset) - -- this is to force an update of the button - local in_range = Store.get(warp_player_in_range_store,player_name) - Store.set(warp_player_in_range_store,player_name,in_range) + Store.trigger(player_in_range_store,player_name) end) --- When the button is clicked it will teleport the player @@ -92,11 +93,10 @@ end) local warp_id = element.parent.caption Warps.teleport_player(warp_id,player) + -- Reset the warp cooldown if the player does not have unlimited warps if config.bypass_warp_limits_permision and not Roles.player_allowed(player,config.bypass_warp_limits_permision) then warp_timer:set_store(player.name,0) - -- this is to force an update of the buttons - local in_range = Store.get(warp_player_in_range_store,player.name) - Store.set(warp_player_in_range_store,player.name,in_range) + Store.trigger(player_in_range_store,player) end end) @@ -112,22 +112,28 @@ Gui.new_button() style.width = 20 end) :on_click(function(player,element) + local force_name = player.force.name + local surface = player.surface local position = player.position local px = position.x local py = position.y local dist2 = config.minimum_distance^2 - local warps = Warps.get_all_warps() - for warp_id,warp in pairs(warps) do + -- Check the distance to all existing warps + local warp_ids = Warps.get_force_warp_ids(force_name) + for _,warp_id in pairs(warp_ids) do + local warp = Warps.get_warp(warp_id) local pos = warp.position - if (px-pos.x)^2+(py-pos.y)^2 < dist2 then - local warp_name = Warps.get_warp_name(warp_id) - player.print{'warp-list.too-close',warp_name} + if surface == warp.surface and (px-pos.x)^2+(py-pos.y)^2 < dist2 then + player.print{'warp-list.too-close',warp.name} return end end - Warps.new_warp(player.force.name,player.surface,position,player.name) + -- Add the new warp + local warp_id = Warps.add_warp(force_name,surface,position,player.name) + Warps.make_warp_tag(warp_id) + Warps.make_warp_area(warp_id) end) --- Confirms the edit to name or icon of the warp @@ -151,7 +157,6 @@ end) --- Cancels the editing changes of the selected warp name or icon -- @element cancel_edit -local generate_warp local cancel_edit = Gui.new_button() :set_sprites('utility/close_black') @@ -164,7 +169,6 @@ end) :on_click(function(player,element) local warp_id = element.parent.name Warps.set_editing(warp_id,player.name) - generate_warp(player,element.parent.parent,warp_id) end) --- Removes a warp from the list, including the physical area and map tag @@ -197,7 +201,6 @@ end) :on_click(function(player,element) local warp_id = element.parent.name Warps.set_editing(warp_id,player.name,true) - generate_warp(player,element.parent.parent.parent,warp_id) end) --[[ Generates each warp, handles both view and edit mode @@ -213,23 +216,22 @@ end) >>> edit_warp >>> discard_warp ]] -function generate_warp(player,element,warp_id) - local warp_name = Warps.get_warp_name(warp_id) - local warp_icon = Warps.get_warp_icon(warp_id) - local warp = Warps.get_details(warp_id) - - local editing = Warps.is_editing(warp_id,player.name) - local last_edit_player = warp.last_edit_player - local last_edit_time = warp.last_edit_time - local position = warp.position - - if not warp_name then +local function generate_warp(player,element,warp_id) + local warp = Warps.get_warp(warp_id) + if not warp then -- warp is nil so remove it from the list Gui.destroy_if_valid(element['icon-'..warp_id]) Gui.destroy_if_valid(element['edit-'..warp_id]) Gui.destroy_if_valid(element[warp_id]) else + local warp_name = warp.name + local warp_icon = warp.icon + local editing = warp.currently_editing[player.name] + local last_edit_name = warp.last_edit_name + local last_edit_time = warp.last_edit_time + local position = warp.position + -- if it is not already present then add it now local warp_area = element[warp_id] local icon_area = element['icon-'..warp_id] @@ -261,8 +263,8 @@ function generate_warp(player,element,warp_id) end local edit_area = element['edit-'..warp_id][warp_id] - local players = warp.editing and table_keys(warp.editing) or {} - local allowed = player_allowed_edit(player,warp_id) + local players = warp.currently_editing and table_keys(warp.currently_editing) or {} + local allowed = player_allowed_edit(player,warp) edit_area.visible = allowed @@ -278,7 +280,7 @@ function generate_warp(player,element,warp_id) if not editing and element_type == 'label' then -- update the label already present label_element.caption = warp_name - label_element.tooltip = {'warp-list.last-edit',last_edit_player,format_time(last_edit_time)} + label_element.tooltip = {'warp-list.last-edit',last_edit_name,format_time(last_edit_time)} icon_area[goto_warp.name].sprite = 'item/'..warp_icon elseif not editing then @@ -295,7 +297,7 @@ function generate_warp(player,element,warp_id) btn.tooltip = {'warp-list.goto-tooltip',position.x,position.y} local timer = warp_timer:get_store(player.name) - local enabled = not timer and Store.get(warp_player_in_range_store,player.name) + local enabled = not timer and Store.get(player_in_range_store,player) or Roles.player_allowed(player,config.bypass_warp_limits_permission) if not enabled then btn.enabled = false @@ -310,7 +312,7 @@ function generate_warp(player,element,warp_id) name=zoom_to_map_name, type='label', caption=warp_name, - tooltip={'warp-list.last-edit',last_edit_player,format_time(last_edit_time)} + tooltip={'warp-list.last-edit',last_edit_name,format_time(last_edit_time)} } label.style.single_line = false label.style.maximal_width = 150 @@ -412,38 +414,30 @@ Gui.new_left_frame('gui/warp-list') :set_direction('vertical') :on_creation(function(player,element) local data_table = generate_container(player,element) - local warps = Warps.get_warps(player.force.name) + local warp_ids = Warps.get_force_warp_ids(player.force.name) - for key,warp_id in pairs(warps) do - if key ~= 'spawn' then - generate_warp(player,data_table,warp_id) - end + for _,warp_id in ipairs(warp_ids) do + generate_warp(player,data_table,warp_id) end end) :on_update(function(player,element) local data_table = element.container.scroll.table - local warps = Warps.get_warps(player.force.name) + local warp_ids = Warps.get_force_warp_ids(player.force.name) data_table.clear() - for key,warp_id in pairs(warps) do - if key ~= 'spawn' then - generate_warp(player,data_table,warp_id) - end + for _,warp_id in ipairs(warp_ids) do + generate_warp(player,data_table,warp_id) end end) :on_player_toggle(function(player,element,visible) - keep_open[player.name] = visible + keep_gui_open[player.name] = visible end) --- When the name of a warp is updated this is triggered -Warps.add_handler(function(force,warp_id) - for _,player in pairs(force.players) do - warp_list:update(player) - end -end) +Warps.on_update(warp_list 'update_all') --- When the player leaves or enters range of a warp this is triggered -Store.register(warp_player_in_range_store,function(value,player_name) +Store.register(player_in_range_store,function(value,player_name) local player = game.players[player_name] local force = player.force local frame = warp_list:get_frame(player_name) @@ -451,7 +445,7 @@ Store.register(warp_player_in_range_store,function(value,player_name) local timer = warp_timer:get_store(player_name) local state = not timer and value - if not keep_open[player.name] then + if not keep_gui_open[player.name] then Gui.toggle_left_frame(warp_list.name,player,value) end @@ -459,8 +453,8 @@ Store.register(warp_player_in_range_store,function(value,player_name) return end - local warps = Warps.get_warps(force.name) - for _,warp_id in pairs(warps) do + local warp_ids = Warps.get_force_warp_ids(force.name) + for _,warp_id in pairs(warp_ids) do local element = table_area['icon-'..warp_id][goto_warp.name] if element and element.valid then element.enabled = state @@ -478,38 +472,59 @@ end) local r2 = config.activation_range^2 local rs2 = config.spawn_activation_range^2 Event.on_nth_tick(math.floor(60/config.update_smoothing),function() - local categories = Store.get_keys(warp_timer.store) - for _,category in pairs(categories) do + local categories = Store.get(warp_timer.store) or {} + for category,_ in pairs(categories) do warp_timer:increment(1,category) end + local force_warps = {} + local warps = {} for _,player in pairs(game.connected_players) do - local was_in_range = Store.get(warp_player_in_range_store,player.name) - local force = player.force - local warps = Warps.get_warps(force.name) + local was_in_range = Store.get(player_in_range_store,player) - if #warps > 0 then - local surface = player.surface.index + -- Get the ids of all the warps on the players force + local force_name = player.force + local warp_ids = force_warps[force_name] + if not warp_ids then + warp_ids = Warps.get_force_warp_ids(force_name) + force_warps[force_name] = warp_ids + end + + -- Check if the force has any warps + if #warp_ids > 0 then + local surface = player.surface local pos = player.position local px,py = pos.x,pos.y - for _,warp_id in pairs(warps) do - local warp = Warps.get_details(warp_id) + + -- Loop over each warp + for _,warp_id in pairs(warp_ids) do + -- Check if warp id is chached + local warp = warps[warp_id] + if not warp then + warp = Warps.get(warp_id) + warps[warp_id] = warp + end + + -- Check if the player is within range local warp_pos = warp.position - if warp.surface.index == surface then - local dx,dy = px-warp_pos.x,py-warp_pos.y - if not warp.editing and (dx*dx)+(dy*dy) < rs2 or (dx*dx)+(dy*dy) < r2 then + if warp.surface == surface then + local dx, dy = px-warp_pos.x, py-warp_pos.y + if (dx*dx)+(dy*dy) < rs2 or (dx*dx)+(dy*dy) < r2 then + -- Set in range to true if the player was preiovusly out of range if not was_in_range then - Store.set(warp_player_in_range_store,player.name,true) + Store.set(player_in_range_store,player,true) end - return + break end end end - if was_in_range then - Store.set(warp_player_in_range_store,player.name,false) - end - end + -- Set in range to false if the player was preiovusly in range + if was_in_range then + Store.set(player_in_range_store,player,false) + end + + end end @@ -519,30 +534,38 @@ end) Event.add(defines.events.on_player_created,function(event) local player = Game.get_player_by_index(event.player_index) + -- Check if a player is allowed unlimited warps local allowed = config.bypass_warp_limits_permission and Roles.player_allowed(player,config.bypass_warp_limits_permission) or false - Store.set(warp_player_in_range_store,player.name,allowed) + Store.set(player_in_range_store,player,allowed) if allowed then warp_timer:set_store(player.name,1) end + -- If the force has no spawn then make a spawn warp local force = player.force - if not Warps.forces[force.name] then + local spawn_id = Warps.get_spawn_warp_id(force.name) + if not spawn_id then local spawn_position = force.get_spawn_position(player.surface) - Warps.new_warp(force.name,player.surface,spawn_position,nil,'Spawn',true,true) + spawn_id = Warps.add_warp(force.name,player.surface,spawn_position,nil,'Spawn') + Warps.set_spawn_warp(spawn_id,force) + Store.trigger(Warps.store,spawn_id) + Warps.make_warp_tag(spawn_id) end end) local function maintain_tag(event) + if not event.player_index then return end local tag = event.tag - local force = event.force - local warps = Warps.get_warps(force.name) - for _,warp_id in pairs(warps) do - local warp = Warps.get_warps(force.name) - if not warp.tag or not warp.tag.valid or warp.tag == tag then + local force_name = event.force.name + local warp_ids = Warps.get_force_warp_ids(force_name) + for _,warp_id in pairs(warp_ids) do + local warp = Warps.get_warp(warp_id) + local wtag = warp.tag + if not wtag or not wtag.valid or wtag == tag then if event.name == defines.events.on_chart_tag_removed then warp.tag = nil end - Warps.make_chart_tag(warp_id) + Warps.make_warp_tag(warp_id) end end end From 258ca8dbde81461a39e0973a6c766c7a48ea346c Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 15 Oct 2019 21:44:03 +0100 Subject: [PATCH 71/93] Updated player list --- config/action_buttons.lua | 209 ++++++++++++----------- expcore/store.lua | 17 +- modules/gui/debug/expcore_store_view.lua | 128 ++++++++++++++ modules/gui/debug/global_view.lua | 2 +- modules/gui/debug/main_view.lua | 1 + modules/gui/player-list.lua | 116 +++++++------ 6 files changed, 319 insertions(+), 154 deletions(-) create mode 100644 modules/gui/debug/expcore_store_view.lua diff --git a/config/action_buttons.lua b/config/action_buttons.lua index 2e2fb9ae..2ce10565 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -15,8 +15,12 @@ local Jail = require 'modules.control.jail' --- @dep modules.control.jail local Colors = require 'resources.color_presets' --- @dep resources.color_presets local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') --- @dep expcore.common -local action_player_store = 'gui.left.player-list.action-player' -local action_name_store = 'gui.left.player-list.action-name' +local selected_player_store = '' +local selected_action_store = '' +local function set_store_uids(player,action) + selected_player_store = player + selected_action_store = action +end -- common style used by all action buttons local function tool_button_style(style) @@ -26,9 +30,9 @@ local function tool_button_style(style) end -- auth that will only allow when on player's of lower roles -local function auth_lower_role(player,action_player_name) +local function auth_lower_role(player,selected_player_name) local player_highest = Roles.get_player_highest_role(player) - local action_player_highest = Roles.get_player_highest_role(action_player_name) + local action_player_highest = Roles.get_player_highest_role(selected_player_name) if player_highest.index < action_player_highest.index then return true end @@ -36,10 +40,10 @@ end -- gets the action player and a coloured name for the action to be used on local function get_action_player_name(player) - local action_player_name = Store.get(action_player_store,player.name) - local action_player = Game.get_player_from_any(action_player_name) - local action_player_name_color = format_chat_player_name(action_player) - return action_player,action_player_name_color + local selected_player_name = Store.get(selected_player_store,player) + local selected_player = Game.get_player_from_any(selected_player_name) + local selected_player_color = format_chat_player_name(selected_player) + return selected_player_name, selected_player_color end -- telports one player to another @@ -60,12 +64,12 @@ Gui.new_button() :set_tooltip{'player-list.goto-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player_name = get_action_player_name(player) - local action_player = Game.get_player_from_any(action_player_name) - if not player.character or not action_player.character then + local selected_player_name = get_action_player_name(player) + local selected_player = Game.get_player_from_any(selected_player_name) + if not player.character or not selected_player.character then player.print({'expcore-commands.reject-player-alive'},Colors.orange_red) else - teleport(player,action_player) + teleport(player,selected_player) end end) @@ -77,12 +81,12 @@ Gui.new_button() :set_tooltip{'player-list.bring-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player_name = get_action_player_name(player) - local action_player = Game.get_player_from_any(action_player_name) - if not player.character or not action_player.character then + local selected_player_name = get_action_player_name(player) + local selected_player = Game.get_player_from_any(selected_player_name) + if not player.character or not selected_player.character then player.print({'expcore-commands.reject-player-alive'},Colors.orange_red) else - teleport(action_player,player) + teleport(selected_player,player) end end) @@ -94,10 +98,10 @@ Gui.new_button() :set_tooltip{'player-list.kill-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player_name = get_action_player_name(player) - local action_player = Game.get_player_from_any(action_player_name) - if action_player.character then - action_player.character.die() + local selected_player_name = get_action_player_name(player) + local selected_player = Game.get_player_from_any(selected_player_name) + if selected_player.character then + selected_player.character.die() else player.print({'expcom-kill.already-dead'},Colors.orange_red) end @@ -111,20 +115,20 @@ Gui.new_button() :set_tooltip{'player-list.report-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player_name = get_action_player_name(player) - if Reports.is_reported(action_player_name,player.name) then + local selected_player_name = get_action_player_name(player) + if Reports.is_reported(selected_player_name,player.name) then player.print({'expcom-report.already-reported'},Colors.orange_red) else - Store.set(action_name_store,player.name,'command/report') + Store.set(selected_action_store,player,'command/report') end end) local function report_player_callback(player,reason) - local action_player_name,action_player_name_color = get_action_player_name(player) + local selected_player_name, selected_player_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) - game.print{'expcom-report.non-admin',action_player_name_color,reason} - Roles.print_to_roles_higher('Trainee',{'expcom-report.admin',action_player_name_color,by_player_name_color,reason}) - Reports.report_player(action_player_name,player.name,reason) + game.print{'expcom-report.non-admin', selected_player_color,reason} + Roles.print_to_roles_higher('Trainee',{'expcom-report.admin', selected_player_color,by_player_name_color,reason}) + Reports.report_player(selected_player_name,player.name,reason) end --- Gives the action player a warning, requires a reason @@ -135,14 +139,14 @@ Gui.new_button() :set_tooltip{'player-list.warn-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - Store.set(action_name_store,player.name,'command/give-warning') + Store.set(selected_action_store,player,'command/give-warning') end) local function warn_player_callback(player,reason) - local action_player_name,action_player_name_color = get_action_player_name(player) + local selected_player_name, selected_player_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) - game.print{'expcom-warnings.received',action_player_name_color,by_player_name_color,reason} - Warnings.add_warning(action_player_name,player.name,reason) + game.print{'expcom-warnings.received', selected_player_color,by_player_name_color,reason} + Warnings.add_warning(selected_player_name,player.name,reason) end --- Jails the action player, requires a reason @@ -153,19 +157,19 @@ Gui.new_button() :set_tooltip{'player-list.jail-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player_name,action_player_name_color = get_action_player_name(player) - if Jail.is_jailed(action_player_name) then - player.print({'expcom-jail.already-jailed',action_player_name_color},Colors.orange_red) + local selected_player_name, selected_player_color = get_action_player_name(player) + if Jail.is_jailed(selected_player_name) then + player.print({'expcom-jail.already-jailed', selected_player_color},Colors.orange_red) else - Store.set(action_name_store,player.name,'command/jail') + Store.set(selected_action_store,player,'command/jail') end end) local function jail_player_callback(player,reason) - local action_player_name,action_player_name_color = get_action_player_name(player) + local selected_player_name, selected_player_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) - game.print{'expcom-jail.give',action_player_name_color,by_player_name_color,reason} - Jail.jail_player(action_player_name,player.name,reason) + game.print{'expcom-jail.give', selected_player_color,by_player_name_color,reason} + Jail.jail_player(selected_player_name,player.name,reason) end --- Temp bans the action player, requires a reason @@ -176,19 +180,19 @@ Gui.new_button() :set_tooltip{'player-list.temp-ban-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player_name,action_player_name_color = get_action_player_name(player) - if Jail.is_jailed(action_player_name) then - player.print({'expcom-jail.already-banned',action_player_name_color},Colors.orange_red) + local selected_player_name, selected_player_color = get_action_player_name(player) + if Jail.is_jailed(selected_player_name) then + player.print({'expcom-jail.already-banned', selected_player_color},Colors.orange_red) else - Store.set(action_name_store,player.name,'command/temp-ban') + Store.set(selected_action_store,player,'command/temp-ban') end end) local function temp_ban_player_callback(player,reason) - local action_player,action_player_name_color = get_action_player_name(player) + local selected_player, selected_player_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) - game.print{'expcom-jail.temp-ban',action_player_name_color,by_player_name_color,reason} - Jail.temp_ban_player(action_player,player.name,reason) + game.print{'expcom-jail.temp-ban', selected_player_color,by_player_name_color,reason} + Jail.temp_ban_player(selected_player,player.name,reason) end --- Kicks the action player, requires a reason @@ -199,12 +203,12 @@ Gui.new_button() :set_tooltip{'player-list.kick-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - Store.set(action_name_store,player.name,'command/kick') + Store.set(selected_action_store,player,'command/kick') end) local function kick_player_callback(player,reason) - local action_player = get_action_player_name(player) - game.kick_player(action_player,reason) + local selected_player = get_action_player_name(player) + game.kick_player(selected_player,reason) end --- Bans the action player, requires a reason @@ -215,64 +219,67 @@ Gui.new_button() :set_tooltip{'player-list.ban-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - Store.set(action_name_store,player.name,'command/ban') + Store.set(selected_action_store,player,'command/ban') end) local function ban_player_callback(player,reason) - local action_player = get_action_player_name(player) - game.ban_player(action_player,reason) + local selected_player = get_action_player_name(player) + game.ban_player(selected_player,reason) end return { - ['command/teleport'] = { - auth=function(player,action_player) - return player.name ~= action_player.name - end, -- cant teleport to your self - goto_player, - bring_player - }, - ['command/kill'] = { - auth=function(player,action_player) - if player.name == action_player.name then - return true - elseif Roles.player_allowed(player,'command/kill/always') then - return auth_lower_role(player,action_player) - end - end, -- player must be lower role, or your self - kill_player - }, - ['command/report'] = { - auth=function(player,action_player) - if not Roles.player_allowed(player,'command/give-warning') then - return not Roles.player_has_flag(action_player,'report-immune') - end - end, -- can report any player that isn't immune and you aren't able to give warnings - reason_callback=report_player_callback, - report_player - }, - ['command/give-warning'] = { - auth=auth_lower_role, -- warn a lower user, replaces report - reason_callback=warn_player_callback, - warn_player - }, - ['command/jail'] = { - auth=auth_lower_role, - reason_callback=jail_player_callback, - jail_player - }, - ['command/temp-ban'] = { - auth=auth_lower_role, - reason_callback=temp_ban_player_callback, - temp_ban_player - }, - ['command/kick'] = { - auth=auth_lower_role, - reason_callback=kick_player_callback, - kick_player - }, - ['command/ban'] = { - auth=auth_lower_role, - reason_callback=ban_player_callback, - ban_player + set_store_uids = set_store_uids, + buttons = { + ['command/teleport'] = { + auth=function(player,selected_player) + return player.name ~= selected_player.name + end, -- cant teleport to your self + goto_player, + bring_player + }, + ['command/kill'] = { + auth=function(player,selected_player) + if player.name == selected_player.name then + return true + elseif Roles.player_allowed(player,'command/kill/always') then + return auth_lower_role(player,selected_player) + end + end, -- player must be lower role, or your self + kill_player + }, + ['command/report'] = { + auth=function(player,selected_player) + if not Roles.player_allowed(player,'command/give-warning') then + return not Roles.player_has_flag(selected_player,'report-immune') + end + end, -- can report any player that isn't immune and you aren't able to give warnings + reason_callback=report_player_callback, + report_player + }, + ['command/give-warning'] = { + auth=auth_lower_role, -- warn a lower user, replaces report + reason_callback=warn_player_callback, + warn_player + }, + ['command/jail'] = { + auth=auth_lower_role, + reason_callback=jail_player_callback, + jail_player + }, + ['command/temp-ban'] = { + auth=auth_lower_role, + reason_callback=temp_ban_player_callback, + temp_ban_player + }, + ['command/kick'] = { + auth=auth_lower_role, + reason_callback=kick_player_callback, + kick_player + }, + ['command/ban'] = { + auth=auth_lower_role, + reason_callback=ban_player_callback, + ban_player + } } } \ No newline at end of file diff --git a/expcore/store.lua b/expcore/store.lua index 0b78ae7e..96b521b8 100644 --- a/expcore/store.lua +++ b/expcore/store.lua @@ -50,12 +50,15 @@ local Store = { serializers = {}, --- An array of watchers that stores will trigger, key is store uids -- @table watchers - watchers = {} + watchers = {}, + --- An index used for debuging to find the file where different stores where registered + -- @table file_paths + file_paths = {} } -- All data is stored in global.data_store and is accessed here with data_store local data_store = {} -global.data_store = {} +global.data_store = data_store Event.on_load(function() data_store = global.data_store end) @@ -95,15 +98,17 @@ function Store.validate(store,key,error_stack) -- Key is present and so it is serialized and returned local serializer = Store.serializers[store] if type(key) ~= 'string' then - local success, key = pcall(serializer,key) + local success, serialized_key = pcall(serializer,key) if not success then -- Serializer casued an error while serializing the key error('Store watcher casued an error:\n\t'..key,error_stack+1) - elseif type(key) ~= 'string' then + elseif type(serialized_key) ~= 'string' then -- Serializer was successful but failed to return a string value error('Store key serializer did not return a string; recived type '..type(key),error_stack+1) end + + return serialized_key end return key @@ -139,6 +144,10 @@ function Store.register(serializer) Store.serializers[uid] = serializer end + -- Add entry in the debug table + local file_path = debug.getinfo(2, 'S').source:match('^.+/currently%-playing/(.+)$'):sub(1, -5) + Store.file_paths[uid] = file_path + -- Return the new uid return uid end diff --git a/modules/gui/debug/expcore_store_view.lua b/modules/gui/debug/expcore_store_view.lua new file mode 100644 index 00000000..2d115992 --- /dev/null +++ b/modules/gui/debug/expcore_store_view.lua @@ -0,0 +1,128 @@ +local Gui = require 'utils.gui' --- @dep utils.gui +local Store = require 'expcore.store' --- @dep utils.global +local Color = require 'resources.color_presets' --- @dep resources.color_presets +local Model = require 'modules.gui.debug.model' --- @dep modules.gui.debug.model + +local dump = Model.dump +local dump_text = Model.dump_text +local concat = table.concat + +local Public = {} + +local header_name = Gui.uid_name() +local left_panel_name = Gui.uid_name() +local right_panel_name = Gui.uid_name() +local input_text_box_name = Gui.uid_name() +local refresh_name = Gui.uid_name() + +Public.name = 'Store' + +function Public.show(container) + local main_flow = container.add {type = 'flow', direction = 'horizontal'} + + local left_panel = main_flow.add {type = 'scroll-pane', name = left_panel_name} + local left_panel_style = left_panel.style + left_panel_style.width = 300 + + for store_id, token_name in pairs(Store.file_paths) do + local header = left_panel.add({type = 'flow'}).add {type = 'label', name = header_name, caption = store_id..' - '..token_name} + Gui.set_data(header, store_id) + end + + local right_flow = main_flow.add {type = 'flow', direction = 'vertical'} + + local right_top_flow = right_flow.add {type = 'flow', direction = 'horizontal'} + + local input_text_box = right_top_flow.add {type = 'text-box', name = input_text_box_name} + local input_text_box_style = input_text_box.style + input_text_box_style.horizontally_stretchable = true + input_text_box_style.height = 32 + input_text_box_style.maximal_width = 1000 + + local refresh_button = + right_top_flow.add {type = 'sprite-button', name = refresh_name, sprite = 'utility/reset', tooltip = 'refresh'} + local refresh_button_style = refresh_button.style + refresh_button_style.width = 32 + refresh_button_style.height = 32 + + local right_panel = right_flow.add {type = 'text-box', name = right_panel_name} + right_panel.read_only = true + right_panel.selectable = true + + local right_panel_style = right_panel.style + right_panel_style.vertically_stretchable = true + right_panel_style.horizontally_stretchable = true + right_panel_style.maximal_width = 1000 + right_panel_style.maximal_height = 1000 + + local data = { + right_panel = right_panel, + input_text_box = input_text_box, + selected_header = nil + } + + Gui.set_data(input_text_box, data) + Gui.set_data(left_panel, data) + Gui.set_data(refresh_button, data) +end + +Gui.on_click( + header_name, + function(event) + local element = event.element + local store_id = Gui.get_data(element) + + local left_panel = element.parent.parent + local data = Gui.get_data(left_panel) + local right_panel = data.right_panel + local selected_header = data.selected_header + local input_text_box = data.input_text_box + + if selected_header then + selected_header.style.font_color = Color.white + end + + element.style.font_color = Color.orange + data.selected_header = element + + input_text_box.text = concat {'global.data_store[', store_id, ']'} + input_text_box.style.font_color = Color.black + + local content = dump(Store.get(store_id)) or 'nil' + right_panel.text = content + end +) + +local function update_dump(text_input, data, player) + local suc, ouput = dump_text(text_input.text, player) + if not suc then + text_input.style.font_color = Color.red + else + text_input.style.font_color = Color.black + data.right_panel.text = ouput + end +end + +Gui.on_text_changed( + input_text_box_name, + function(event) + local element = event.element + local data = Gui.get_data(element) + + update_dump(element, data, event.player) + end +) + +Gui.on_click( + refresh_name, + function(event) + local element = event.element + local data = Gui.get_data(element) + + local input_text_box = data.input_text_box + + update_dump(input_text_box, data, event.player) + end +) + +return Public diff --git a/modules/gui/debug/global_view.lua b/modules/gui/debug/global_view.lua index b00df403..df057c47 100644 --- a/modules/gui/debug/global_view.lua +++ b/modules/gui/debug/global_view.lua @@ -8,7 +8,7 @@ local concat = table.concat local Public = {} -local ignore = {tokens = true} +local ignore = {tokens = true, data_store = true} local header_name = Gui.uid_name() local left_panel_name = Gui.uid_name() diff --git a/modules/gui/debug/main_view.lua b/modules/gui/debug/main_view.lua index b9e20eb4..3c286a46 100644 --- a/modules/gui/debug/main_view.lua +++ b/modules/gui/debug/main_view.lua @@ -5,6 +5,7 @@ local Public = {} local pages = { require 'modules.gui.debug.redmew_global_view', + require 'modules.gui.debug.expcore_store_view', require 'modules.gui.debug.global_view', require 'modules.gui.debug.package_view', require 'modules.gui.debug._g_view', diff --git a/modules/gui/player-list.lua b/modules/gui/player-list.lua index e58a55bd..80e81c13 100644 --- a/modules/gui/player-list.lua +++ b/modules/gui/player-list.lua @@ -13,26 +13,36 @@ local format_time = ext_require('expcore.common','format_time') --- @dep expcore local config = require 'config.action_buttons' --- @dep config.action_buttons local Colors = require 'resources.color_presets' --- @dep resources.color_presets -local action_player_store = 'gui.left.player-list.action-player' -local action_name_store = 'gui.left.player-list.action-name' +-- Stores the name of the player a player has selected +local selected_player_store = Store.register(function(player) + return player.name +end) ---- used on player name label to allow zoom to map +-- Stores the current action that a player wants to do +local selected_action_store = Store.register(function(player) + return player.name +end) + +-- Set the config to use these stores +config.set_store_uids(selected_player_store,selected_action_store) + +--- Used to open the map on a player or toggle the settings local zoom_to_map_name = Gui.uid_name() Gui.on_click(zoom_to_map_name,function(event) - local action_player_name = event.element.caption - local action_player = Game.get_player_from_any(action_player_name) + local selected_player_name = event.element.caption + local selected_player = Game.get_player_from_any(selected_player_name) if event.button == defines.mouse_button_type.left then - -- lmb will zoom to map - local position = action_player.position + -- LMB will open the map to the selected player + local position = selected_player.position event.player.zoom_to_world(position,1.75) else - -- rmb will open settings - local player_name = event.player.name - local old_action_player_name = Store.get(action_player_store,player_name) - if action_player_name == old_action_player_name then - Store.clear(action_player_store,player_name) -- will close if already open + -- RMB will toggle the settings + local player = event.player + local old_selected_player_name = Store.get(selected_player_store,player) + if selected_player_name == old_selected_player_name then + Store.clear(selected_player_store,player) else - Store.set(action_player_store,player_name,action_player_name) + Store.set(selected_player_store,player,selected_player_name) end end end) @@ -43,8 +53,8 @@ local open_action_bar = Gui.new_button() :set_sprites('utility/expand_dots_white') :set_tooltip{'player-list.open-action-bar'} -:set_embedded_flow(function(element,action_player_name) - return action_player_name +:set_embedded_flow(function(element,selected_player_name) + return selected_player_name end) :set_style('frame_button',function(style) Gui.set_padding_style(style,-2,-2,-2,-2) @@ -52,12 +62,12 @@ end) style.height = 14 end) :on_click(function(player,element) - local new_action_player_name = element.parent.name - local action_player_name = Store.get(action_player_store,player.name) - if action_player_name == new_action_player_name then - Store.clear(action_player_store,player.name) -- will close if already open + local selected_player_name = element.parent.name + local old_selected_player_name = Store.get(selected_player_store,player) + if selected_player_name == old_selected_player_name then + Store.clear(selected_player_store,player) else - Store.set(action_player_store,player.name,new_action_player_name) + Store.set(selected_player_store,player,selected_player_name) end end) @@ -73,8 +83,8 @@ Gui.new_button() style.width = 28 end) :on_click(function(player,element) - Store.clear(action_player_store,player.name) - Store.clear(action_name_store,player.name) + Store.clear(selected_player_store,player) + Store.clear(selected_action_store,player) end) --- Button used to confirm a reason @@ -90,11 +100,11 @@ Gui.new_button() end) :on_click(function(player,element) local reason = element.parent.entry.text or 'Non Given' - local action_name = Store.get(action_name_store,player.name) - local reason_callback = config[action_name].reason_callback + local action_name = Store.get(selected_action_store,player) + local reason_callback = config.buttons[action_name].reason_callback reason_callback(player,reason) - Store.clear(action_player_store,player.name) - Store.clear(action_name_store,player.name) + Store.clear(selected_player_store,player) + Store.clear(selected_action_store,player) element.parent.entry.text = '' end) @@ -143,7 +153,7 @@ local function generate_container(player,element) Gui.set_padding(reason_bar,-1,-1,3,3) reason_bar.style.horizontally_stretchable = true reason_bar.style.height = 35 - local action_name = Store.get(action_name_store,player.name) + local action_name = Store.get(selected_action_store,player) reason_bar.visible = action_name ~= nil -- text entry for the reason bar @@ -166,9 +176,9 @@ end --- Adds buttons and permission flows to the action bar local function generate_action_bar(player,element) close_action_bar(element) - local action_player = Store.get(action_player_store,player.name) + local selected_player_name = Store.get(selected_player_store,player) - for action_name,buttons in pairs(config) do + for action_name,buttons in pairs(config.buttons) do local permission_flow = element.add{ type='flow', @@ -183,12 +193,12 @@ local function generate_action_bar(player,element) permission_flow.visible = false end - if buttons.auth and action_player and not buttons.auth(player,action_player) then + if buttons.auth and selected_player_name and not buttons.auth(player,selected_player_name) then permission_flow.visible = false end end - if not action_player then + if not selected_player_name then element.visible = false end end @@ -198,25 +208,30 @@ local player_list_name local function update_action_bar(player) local frame = Gui.classes.left_frames.get_frame(player_list_name,player) local element = frame.container.action_bar - local action_player_name = Store.get(action_player_store,player.name) + local selected_player_name = Store.get(selected_player_store,player) - if not action_player_name then + if not selected_player_name then element.visible = false + else - local action_player = Game.get_player_from_any(action_player_name) - if not action_player.connected then + local selected_player = Game.get_player_from_any(selected_player_name) + if not selected_player.connected then + -- If the player is offline then reest stores element.visible = false - Store.clear(action_player_store,player.name) -- clears store if player is offline - Store.clear(action_name_store,player.name) + Store.clear(selected_player_store,player) + Store.clear(selected_action_store,player) + else + -- Otherwise check what actions the player is allowed to use element.visible = true - for action_name,buttons in pairs(config) do - if buttons.auth and not buttons.auth(player,action_player) then + for action_name,buttons in pairs(config.buttons) do + if buttons.auth and not buttons.auth(player,selected_player) then element[action_name].visible = false elseif Roles.player_allowed(player,action_name) then element[action_name].visible = true end end + end end end @@ -323,10 +338,11 @@ end) player_list_name = player_list:uid() --- When the action player is changed the action bar will update -Store.register(action_player_store,function(value,category) - local player = Game.get_player_from_any(category) +Store.watch(selected_player_store,function(value,player_name) + local player = Game.get_player_from_any(player_name) update_action_bar(player) + -- Change the style of the option buttons local frame = player_list:get_frame(player) local data_table = frame.container.scroll.table for _,next_player in pairs(game.connected_players) do @@ -343,21 +359,25 @@ Store.register(action_player_store,function(value,category) end) --- When the action name is changed the reason input will update -Store.register(action_name_store,function(value,category) - local player = Game.get_player_from_any(category) +Store.watch(selected_action_store,function(value,player_name) + local player = Game.get_player_from_any(player_name) local frame = Gui.classes.left_frames.get_frame(player_list_name,player) local element = frame.container.reason_bar if value then - local action_player_name = Store.get(action_player_store,category) - local action_player = Game.get_player_from_any(action_player_name) - if action_player.connected then + -- if there is a new value then check the player is still online + local selected_player_name = Store.get(selected_player_store,player_name) + local selected_player = Game.get_player_from_any(selected_player_name) + if selected_player.connected then element.visible = true else - Store.clear(action_player_store,category) -- clears store if player is offline - Store.clear(action_name_store,category) + -- Clear if the player is offline + Store.clear(selected_player_store,player_name) + Store.clear(selected_action_store,player_name) end + else element.visible = false + end end) From 3b5c69cfd1c125e603083b2ea439fbe51086aca6 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 15 Oct 2019 22:37:48 +0100 Subject: [PATCH 72/93] Fixed stores in gui --- docs/addons/Advanced-Start.html | 2 +- docs/addons/Chat-Popups.html | 2 +- docs/addons/Chat-Reply.html | 2 +- docs/addons/Compilatron.html | 2 +- docs/addons/Damage-Popups.html | 2 +- docs/addons/Death-Logger.html | 2 +- docs/addons/Discord-Alerts.html | 2 +- docs/addons/Player-Colours.html | 2 +- docs/addons/Pollution-Grading.html | 2 +- docs/addons/Scorched-Earth.html | 2 +- docs/addons/Spawn-Area.html | 2 +- docs/commands/Admin-Chat.html | 2 +- docs/commands/Bonus.html | 2 +- docs/commands/Cheat-Mode.html | 2 +- docs/commands/Clear-Inventory.html | 2 +- docs/commands/Debug.html | 2 +- docs/commands/Find.html | 2 +- docs/commands/Help.html | 2 +- docs/commands/Home.html | 2 +- docs/commands/Interface.html | 2 +- docs/commands/Jail.html | 2 +- docs/commands/Kill.html | 2 +- docs/commands/Me.html | 2 +- docs/commands/Rainbow.html | 2 +- docs/commands/Repair.html | 2 +- docs/commands/Reports.html | 2 +- docs/commands/Roles.html | 2 +- docs/commands/Spawn.html | 2 +- docs/commands/Tag.html | 2 +- docs/commands/Teleport.html | 2 +- docs/commands/Warnings.html | 2 +- docs/configs/Advanced-Start.html | 2 +- docs/configs/Bonuses.html | 2 +- docs/configs/Chat-Reply.html | 2 +- docs/configs/Commands-Auth-Admin.html | 2 +- docs/configs/Commands-Auth-Roles.html | 2 +- .../Commands-Auth-Runtime-Disable.html | 2 +- docs/configs/Commands-Parse-Roles.html | 2 +- docs/configs/Commands-Parse.html | 2 +- docs/configs/Compilatron.html | 2 +- docs/configs/Death-Logger.html | 2 +- docs/configs/Discord-Alerts.html | 2 +- docs/configs/File-Loader.html | 2 +- docs/configs/Permission-Groups.html | 2 +- docs/configs/Player-List.html | 2 +- docs/configs/Pollution-Grading.html | 2 +- docs/configs/Popup-Messages.html | 2 +- docs/configs/Preset-Player-Colours.html | 2 +- docs/configs/Repair.html | 2 +- docs/configs/Rockets.html | 2 +- docs/configs/Roles.html | 2 +- docs/configs/Science.html | 2 +- docs/configs/Scorched-Earth.html | 2 +- docs/configs/Spawn-Area.html | 2 +- docs/configs/Tasks.html | 2 +- docs/configs/Warnings.html | 2 +- docs/configs/Warps.html | 2 +- docs/control/Jail.html | 2 +- docs/control/Production.html | 2 +- docs/control/Reports.html | 2 +- docs/control/Rockets.html | 2 +- docs/control/Tasks.html | 2 +- docs/control/Warnings.html | 2 +- docs/control/Warps.html | 2 +- docs/core/Commands.html | 2 +- docs/core/Common-Library.html | 2 +- docs/core/Gui.html | 74 ++++++------------- docs/core/Permissions-Groups.html | 2 +- docs/core/Roles.html | 2 +- docs/core/Store.html | 33 ++++++++- docs/core/Sudo.html | 2 +- docs/guis/Player-List.html | 2 +- docs/guis/Rocket-Info.html | 2 +- docs/guis/Science-Info.html | 2 +- docs/guis/Task-List.html | 2 +- docs/guis/Warps-List.html | 2 +- docs/index.html | 2 +- docs/modules/control.html | 2 +- .../utils.alien_evolution_progress.html | 2 +- docs/modules/utils.core.html | 2 +- docs/modules/utils.debug.html | 2 +- docs/modules/utils.dump_env.html | 2 +- docs/modules/utils.event.html | 2 +- docs/modules/utils.event_core.html | 2 +- docs/modules/utils.math.html | 2 +- docs/modules/utils.recipe_locker.html | 2 +- docs/modules/utils.state_machine.html | 2 +- docs/modules/utils.table.html | 2 +- docs/modules/utils.task.html | 2 +- docs/modules/utils.timestamp.html | 2 +- docs/topics/license.html | 2 +- docs/topics/readme.md.html | 2 +- expcore/gui.lua | 2 +- expcore/gui/elements/checkbox.lua | 21 ++---- expcore/gui/elements/dropdown.lua | 9 +-- expcore/gui/elements/elem-button.lua | 9 +-- expcore/gui/elements/progress-bar.lua | 11 +-- expcore/gui/elements/slider.lua | 12 +-- expcore/gui/elements/text.lua | 12 +-- expcore/gui/instances.lua | 50 ++++++------- expcore/gui/prototype.lua | 39 ++++------ expcore/gui/test.lua | 2 +- modules/gui/warp-list.lua | 2 +- 103 files changed, 213 insertions(+), 243 deletions(-) diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index 92e9514b..8fc6a44a 100644 --- a/docs/addons/Advanced-Start.html +++ b/docs/addons/Advanced-Start.html @@ -348,7 +348,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Popups.html b/docs/addons/Chat-Popups.html index 9b87675a..c9ea0f82 100644 --- a/docs/addons/Chat-Popups.html +++ b/docs/addons/Chat-Popups.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html index 7a55158f..d6eda160 100644 --- a/docs/addons/Chat-Reply.html +++ b/docs/addons/Chat-Reply.html @@ -376,7 +376,7 @@ generated by LDoc diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html index 9d466ac6..4fafcaa9 100644 --- a/docs/addons/Compilatron.html +++ b/docs/addons/Compilatron.html @@ -585,7 +585,7 @@ generated by LDoc diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html index 16d816fe..a445fe5a 100644 --- a/docs/addons/Damage-Popups.html +++ b/docs/addons/Damage-Popups.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html index 6c190526..faadc765 100644 --- a/docs/addons/Death-Logger.html +++ b/docs/addons/Death-Logger.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html index a20be316..e0ecba4b 100644 --- a/docs/addons/Discord-Alerts.html +++ b/docs/addons/Discord-Alerts.html @@ -460,7 +460,7 @@ generated by LDoc diff --git a/docs/addons/Player-Colours.html b/docs/addons/Player-Colours.html index 072aa277..8a60609c 100644 --- a/docs/addons/Player-Colours.html +++ b/docs/addons/Player-Colours.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html index 6b312eca..46baddb7 100644 --- a/docs/addons/Pollution-Grading.html +++ b/docs/addons/Pollution-Grading.html @@ -320,7 +320,7 @@ generated by LDoc diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html index a75fc560..c4f4487d 100644 --- a/docs/addons/Scorched-Earth.html +++ b/docs/addons/Scorched-Earth.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html index 8a5abbc8..6b3002a3 100644 --- a/docs/addons/Spawn-Area.html +++ b/docs/addons/Spawn-Area.html @@ -376,7 +376,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html index c50c6b68..04b6b9fe 100644 --- a/docs/commands/Admin-Chat.html +++ b/docs/commands/Admin-Chat.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Bonus.html b/docs/commands/Bonus.html index faf01081..3786a596 100644 --- a/docs/commands/Bonus.html +++ b/docs/commands/Bonus.html @@ -500,7 +500,7 @@ generated by LDoc diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html index 356a9c94..81523c11 100644 --- a/docs/commands/Cheat-Mode.html +++ b/docs/commands/Cheat-Mode.html @@ -361,7 +361,7 @@ generated by LDoc diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html index e6388451..a250f390 100644 --- a/docs/commands/Clear-Inventory.html +++ b/docs/commands/Clear-Inventory.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html index 4ee9fbb0..0af8bb1c 100644 --- a/docs/commands/Debug.html +++ b/docs/commands/Debug.html @@ -365,7 +365,7 @@ generated by LDoc diff --git a/docs/commands/Find.html b/docs/commands/Find.html index f4592e11..0f1ae48d 100644 --- a/docs/commands/Find.html +++ b/docs/commands/Find.html @@ -360,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Help.html b/docs/commands/Help.html index 251496a1..024c376f 100644 --- a/docs/commands/Help.html +++ b/docs/commands/Help.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/commands/Home.html b/docs/commands/Home.html index 76775f55..d4881527 100644 --- a/docs/commands/Home.html +++ b/docs/commands/Home.html @@ -458,7 +458,7 @@ generated by LDoc diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html index 5d22452e..eeaf7d3d 100644 --- a/docs/commands/Interface.html +++ b/docs/commands/Interface.html @@ -416,7 +416,7 @@ generated by LDoc diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html index 555a57ea..67d43bef 100644 --- a/docs/commands/Jail.html +++ b/docs/commands/Jail.html @@ -611,7 +611,7 @@ generated by LDoc diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html index 76b5659c..967cb7e1 100644 --- a/docs/commands/Kill.html +++ b/docs/commands/Kill.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Me.html b/docs/commands/Me.html index 04d8d002..fbba050f 100644 --- a/docs/commands/Me.html +++ b/docs/commands/Me.html @@ -360,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html index c2addce1..f30d335d 100644 --- a/docs/commands/Rainbow.html +++ b/docs/commands/Rainbow.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html index 79684a5a..361a22d7 100644 --- a/docs/commands/Repair.html +++ b/docs/commands/Repair.html @@ -321,7 +321,7 @@ generated by LDoc diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html index 3675fd4e..f94af164 100644 --- a/docs/commands/Reports.html +++ b/docs/commands/Reports.html @@ -585,7 +585,7 @@ generated by LDoc diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html index 34b5a762..3bc1f04d 100644 --- a/docs/commands/Roles.html +++ b/docs/commands/Roles.html @@ -557,7 +557,7 @@ generated by LDoc diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html index 3cbff6d4..257da669 100644 --- a/docs/commands/Spawn.html +++ b/docs/commands/Spawn.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Tag.html b/docs/commands/Tag.html index bb3b4d84..63606adc 100644 --- a/docs/commands/Tag.html +++ b/docs/commands/Tag.html @@ -443,7 +443,7 @@ generated by LDoc diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html index 37e00592..472651ba 100644 --- a/docs/commands/Teleport.html +++ b/docs/commands/Teleport.html @@ -484,7 +484,7 @@ generated by LDoc diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html index e0f3efdb..a62c9b8e 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -569,7 +569,7 @@ generated by LDoc diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index bb81cea4..02b2965a 100644 --- a/docs/configs/Advanced-Start.html +++ b/docs/configs/Advanced-Start.html @@ -506,7 +506,7 @@ generated by LDoc diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html index 27e252db..2e3966d2 100644 --- a/docs/configs/Bonuses.html +++ b/docs/configs/Bonuses.html @@ -237,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html index 9e6519d5..727827bc 100644 --- a/docs/configs/Chat-Reply.html +++ b/docs/configs/Chat-Reply.html @@ -485,7 +485,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html index 25e81ce6..fd824730 100644 --- a/docs/configs/Commands-Auth-Admin.html +++ b/docs/configs/Commands-Auth-Admin.html @@ -294,7 +294,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html index d8f86e12..4f49a827 100644 --- a/docs/configs/Commands-Auth-Roles.html +++ b/docs/configs/Commands-Auth-Roles.html @@ -320,7 +320,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html index eedbf824..9aacac5f 100644 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ b/docs/configs/Commands-Auth-Runtime-Disable.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html index ab26c6f2..64d71e20 100644 --- a/docs/configs/Commands-Parse-Roles.html +++ b/docs/configs/Commands-Parse-Roles.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html index 4ec6ed0a..574f8aa4 100644 --- a/docs/configs/Commands-Parse.html +++ b/docs/configs/Commands-Parse.html @@ -338,7 +338,7 @@ see ./expcore/commands.lua for more details

    generated by LDoc diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html index 4d6d2620..98043b31 100644 --- a/docs/configs/Compilatron.html +++ b/docs/configs/Compilatron.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html index 9602becc..859cf7d9 100644 --- a/docs/configs/Death-Logger.html +++ b/docs/configs/Death-Logger.html @@ -416,7 +416,7 @@ generated by LDoc diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html index 368bf27b..4139d6e6 100644 --- a/docs/configs/Discord-Alerts.html +++ b/docs/configs/Discord-Alerts.html @@ -237,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html index fc1e5061..8aa4661f 100644 --- a/docs/configs/File-Loader.html +++ b/docs/configs/File-Loader.html @@ -240,7 +240,7 @@ generated by LDoc diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html index ff7cc7f2..305e744d 100644 --- a/docs/configs/Permission-Groups.html +++ b/docs/configs/Permission-Groups.html @@ -295,7 +295,7 @@ generated by LDoc diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html index 8054236d..2c9fc83f 100644 --- a/docs/configs/Player-List.html +++ b/docs/configs/Player-List.html @@ -812,7 +812,7 @@ generated by LDoc diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html index 8b2af2cc..64d7f6f0 100644 --- a/docs/configs/Pollution-Grading.html +++ b/docs/configs/Pollution-Grading.html @@ -384,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html index 6dac218a..114b8348 100644 --- a/docs/configs/Popup-Messages.html +++ b/docs/configs/Popup-Messages.html @@ -414,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html index feaf4071..824291f5 100644 --- a/docs/configs/Preset-Player-Colours.html +++ b/docs/configs/Preset-Player-Colours.html @@ -324,7 +324,7 @@ generated by LDoc diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html index 2055d520..e61920c5 100644 --- a/docs/configs/Repair.html +++ b/docs/configs/Repair.html @@ -414,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html index 10ec31d9..929fbf4c 100644 --- a/docs/configs/Rockets.html +++ b/docs/configs/Rockets.html @@ -834,7 +834,7 @@ generated by LDoc diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html index 242d61fb..5c7aabf3 100644 --- a/docs/configs/Roles.html +++ b/docs/configs/Roles.html @@ -292,7 +292,7 @@ generated by LDoc diff --git a/docs/configs/Science.html b/docs/configs/Science.html index 5a57edf3..c9c7fd1c 100644 --- a/docs/configs/Science.html +++ b/docs/configs/Science.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html index d4e60cac..3c038550 100644 --- a/docs/configs/Scorched-Earth.html +++ b/docs/configs/Scorched-Earth.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html index 3818e287..4395fc07 100644 --- a/docs/configs/Spawn-Area.html +++ b/docs/configs/Spawn-Area.html @@ -744,7 +744,7 @@ generated by LDoc diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html index 4fd21978..1bd48171 100644 --- a/docs/configs/Tasks.html +++ b/docs/configs/Tasks.html @@ -384,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html index f770e411..78291b18 100644 --- a/docs/configs/Warnings.html +++ b/docs/configs/Warnings.html @@ -355,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html index aef51683..c8a87917 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -684,7 +684,7 @@ generated by LDoc diff --git a/docs/control/Jail.html b/docs/control/Jail.html index c31473b4..46633de1 100644 --- a/docs/control/Jail.html +++ b/docs/control/Jail.html @@ -1208,7 +1208,7 @@ generated by LDoc diff --git a/docs/control/Production.html b/docs/control/Production.html index 8c5394a9..ea5291cb 100644 --- a/docs/control/Production.html +++ b/docs/control/Production.html @@ -1329,7 +1329,7 @@ generated by LDoc diff --git a/docs/control/Reports.html b/docs/control/Reports.html index db328140..4470dca7 100644 --- a/docs/control/Reports.html +++ b/docs/control/Reports.html @@ -1110,7 +1110,7 @@ generated by LDoc diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html index 335b6534..ea2c7aae 100644 --- a/docs/control/Rockets.html +++ b/docs/control/Rockets.html @@ -984,7 +984,7 @@ generated by LDoc diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html index c9321fe8..41068882 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -998,7 +998,7 @@ Tasks.update_task(task_id,'We need more iron!',game. generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index 1ad8e0e1..abec17b0 100644 --- a/docs/control/Warnings.html +++ b/docs/control/Warnings.html @@ -1465,7 +1465,7 @@ generated by LDoc diff --git a/docs/control/Warps.html b/docs/control/Warps.html index 49821ac4..ebb0dfb5 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -1563,7 +1563,7 @@ Warps.make_warp_tag(warp_id) generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index f14de469..07dfce01 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -1972,7 +1972,7 @@ generated by LDoc diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html index e9d35485..4206d114 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -2746,7 +2746,7 @@ Common.table_insert(tbl,50,tbl2) generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index a50ba4ed..09dee1fe 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -715,7 +715,7 @@ Sets the stored value of the radiobutton or the option set if present - Checkbox.new_option_set(name, callback, categorize) + Checkbox.new_option_set(callback, categorize) Registers a new option set that can be linked to radiobuttons (only one can be true at a time) @@ -963,14 +963,14 @@ Instances.has_categories(name) - Returns if a instance group has a categorise function; must be registered + Returns if a instance group has a serializer function; must be registered Instances.is_registered(name) Returns if the given name is a registered instance group - Instances.register(name[, categorise]) + Instances.register(name[, serializer]) Registers the name of an instance group to allow for storing element instances @@ -1019,7 +1019,7 @@ Extents a prototype with the base functions of all gui prototypes, no metatables - Constructor.store(sync, callback) + Constructor.store(callback) Creates a new function which adds a store to a gui define @@ -1077,15 +1077,15 @@ Prototype:get_store(category) - Gets the value in this elements store, category needed if categorize function used + Gets the value in this elements store, category needed if serializer function used Prototype:set_store(category, value) - Sets the value in this elements store, category needed if categorize function used + Sets the value in this elements store, category needed if serializer function used Prototype:clear_store([category]) - Sets the value in this elements store to nil, category needed if categorize function used + Sets the value in this elements store to nil, category needed if serializer function used @@ -6301,7 +6301,7 @@
    # - Checkbox.new_option_set(name, callback, categorize) + Checkbox.new_option_set(callback, categorize)
    @@ -6319,22 +6319,6 @@ -
  • - - name - - : - - (string) - - the name of the option set, must be unique - -
  • - - - - -
  • callback @@ -9067,7 +9051,7 @@
    -

    Returns if a instance group has a categorise function; must be registered

    +

    Returns if a instance group has a serializer function; must be registered

    @@ -9101,7 +9085,7 @@
    • (boolean) - true if there is a categorise function + true if there is a serializer function
    @@ -9175,7 +9159,7 @@
    # - Instances.register(name[, categorise]) + Instances.register(name[, serializer])
    @@ -9211,15 +9195,15 @@
  • - categorise + serializer : (function) function used to turn the element into a string - categorise param - element LuaGuiElement - the gui element to be turned into a string - categorise return - string - the category that the element will be added to like the player's name or force's name + serializer param - element LuaGuiElement - the gui element to be turned into a string + serializer return - string - the category that the element will be added to like the player's name or force's name (optional)
  • @@ -9359,7 +9343,7 @@ (string) - the category to get the instance from, not needed when no categorise function + the category to get the instance from, not needed when no serializer function (optional)
  • @@ -9433,7 +9417,7 @@ (string) - the category to get the instances of, not needed when no categorise function + the category to get the instances of, not needed when no serializer function (optional) @@ -9848,7 +9832,7 @@
    # - Constructor.store(sync, callback) + Constructor.store(callback)
    @@ -9866,22 +9850,6 @@ -
  • - - sync - - : - - (boolean) - - if the function should create a synced store - -
  • - - - - -
  • callback @@ -10666,7 +10634,7 @@
    -

    Gets the value in this elements store, category needed if categorize function used

    +

    Gets the value in this elements store, category needed if serializer function used

    @@ -10723,7 +10691,7 @@
    -

    Sets the value in this elements store, category needed if categorize function used

    +

    Sets the value in this elements store, category needed if serializer function used

    @@ -10796,7 +10764,7 @@
    -

    Sets the value in this elements store to nil, category needed if categorize function used

    +

    Sets the value in this elements store to nil, category needed if serializer function used

    @@ -10987,7 +10955,7 @@ generated by LDoc
    diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index dd574a66..00b18e72 100644 --- a/docs/core/Permissions-Groups.html +++ b/docs/core/Permissions-Groups.html @@ -1432,7 +1432,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index ed416dcd..3f2be0c2 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -3152,7 +3152,7 @@ generated by LDoc diff --git a/docs/core/Store.html b/docs/core/Store.html index 10806138..1d8ad527 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -301,6 +301,10 @@ Store.set(player_scores,game.player,10) watchers An array of watchers that stores will trigger, key is store uids + + file_paths + An index used for debuging to find the file where different stores where registered + @@ -453,6 +457,33 @@ Store.set(player_scores,game.player,10) + + + + + + + +
    +
    +
    + # + file_paths +
    +
    +
    +
    + +

    An index used for debuging to find the file where different stores where registered

    +

    + + + + + + + + @@ -1433,7 +1464,7 @@ Store.set(player_scores,game.player,10) generated by LDoc
    diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index 9a50edd8..23573d85 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -544,7 +544,7 @@ generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index eee69c11..da3e4e7f 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -626,7 +626,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index 16e9cadf..cd01fbd5 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -629,7 +629,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 3119948b..7a48f8dc 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -449,7 +449,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index d5ed83fa..44170d3b 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -632,7 +632,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index f9a3c9b9..196ec539 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -837,7 +837,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index 07dcc66a..4601a828 100644 --- a/docs/index.html +++ b/docs/index.html @@ -514,7 +514,7 @@ see ./expcore/commands.lua for more details generated by LDoc diff --git a/docs/modules/control.html b/docs/modules/control.html index 01c09b06..75103f1b 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -351,7 +351,7 @@ generated by LDoc diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html index e0bff02c..51092a84 100644 --- a/docs/modules/utils.alien_evolution_progress.html +++ b/docs/modules/utils.alien_evolution_progress.html @@ -419,7 +419,7 @@ fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on generated by LDoc diff --git a/docs/modules/utils.core.html b/docs/modules/utils.core.html index 2d619cbc..31b33120 100644 --- a/docs/modules/utils.core.html +++ b/docs/modules/utils.core.html @@ -1164,7 +1164,7 @@ generated by LDoc diff --git a/docs/modules/utils.debug.html b/docs/modules/utils.debug.html index 89d1652c..3d92af43 100644 --- a/docs/modules/utils.debug.html +++ b/docs/modules/utils.debug.html @@ -654,7 +654,7 @@ generated by LDoc diff --git a/docs/modules/utils.dump_env.html b/docs/modules/utils.dump_env.html index f4b29047..e54ef510 100644 --- a/docs/modules/utils.dump_env.html +++ b/docs/modules/utils.dump_env.html @@ -323,7 +323,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index 7bc59dd3..87ca10a6 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -1292,7 +1292,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index f3da2188..e9fcbde4 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -434,7 +434,7 @@ generated by LDoc diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html index 317d2a54..12045d90 100644 --- a/docs/modules/utils.math.html +++ b/docs/modules/utils.math.html @@ -353,7 +353,7 @@ generated by LDoc diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html index fe5b79ca..59d49a86 100644 --- a/docs/modules/utils.recipe_locker.html +++ b/docs/modules/utils.recipe_locker.html @@ -441,7 +441,7 @@ generated by LDoc diff --git a/docs/modules/utils.state_machine.html b/docs/modules/utils.state_machine.html index f3fb7488..68e88fea 100644 --- a/docs/modules/utils.state_machine.html +++ b/docs/modules/utils.state_machine.html @@ -752,7 +752,7 @@ generated by LDoc diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html index 5d70029e..5ffe1e8b 100644 --- a/docs/modules/utils.table.html +++ b/docs/modules/utils.table.html @@ -1418,7 +1418,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index 0d490e35..cfc96b04 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -651,7 +651,7 @@ generated by LDoc diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html index 38a04573..fcf4b838 100644 --- a/docs/modules/utils.timestamp.html +++ b/docs/modules/utils.timestamp.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/topics/license.html b/docs/topics/license.html index 5414825d..1eab766f 100644 --- a/docs/topics/license.html +++ b/docs/topics/license.html @@ -789,7 +789,7 @@ Public License instead of this License. But first, please read generated by LDoc diff --git a/docs/topics/readme.md.html b/docs/topics/readme.md.html index b313179f..46789283 100644 --- a/docs/topics/readme.md.html +++ b/docs/topics/readme.md.html @@ -333,7 +333,7 @@ generated by LDoc diff --git a/expcore/gui.lua b/expcore/gui.lua index 6cf395f1..82257d43 100644 --- a/expcore/gui.lua +++ b/expcore/gui.lua @@ -105,7 +105,7 @@ Gui.classes.checkbox = Checkbox Checkbox._prototype_radiobutton:on_store_update(callback) --- Registers a handler for when the stored value updates Checkbox._prototype_radiobutton:add_as_option(option_set,option_name) --- Adds this radiobutton to be an option in the given option set (only one can be true at a time) - Checkbox.new_option_set(name,callback,categorize) --- Registers a new option set that can be linked to radiobuttons (only one can be true at a time) + Checkbox.new_option_set(callback,categorize) --- Registers a new option set that can be linked to radiobuttons (only one can be true at a time) Checkbox.draw_option_set(name,element) --- Draws all radiobuttons that are part of an option set at once (Gui.draw will not work) Checkbox.reset_radiobutton(element,exclude,recursive) --- Sets all radiobuttons in a element to false (unless excluded) and can act recursively diff --git a/expcore/gui/elements/checkbox.lua b/expcore/gui/elements/checkbox.lua index 98f50811..ce9b2a8a 100644 --- a/expcore/gui/elements/checkbox.lua +++ b/expcore/gui/elements/checkbox.lua @@ -74,14 +74,12 @@ local Checkbox = { _prototype_checkbox=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) }, _prototype_radiobutton=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) } } @@ -96,8 +94,7 @@ function Checkbox.new_checkbox(name) self:on_draw(function(player,element) if self.store then - local category = self.categorize and self.categorize(element) or nil - local state = self:get_store(category,true) + local state = self:get_store(element,true) if state then element.state = true end end end) @@ -107,13 +104,11 @@ function Checkbox.new_checkbox(name) if self.option_set then local value = Checkbox.option_sets[self.option_set][element.name] - local category = self.categorize and self.categorize(element) - self:set_store(category,value) + self:set_store(element,value) elseif self.store then local value = element.state - local category = self.categorize and self.categorize(element) - self:set_store(category,value) + self:set_store(element,value) else self:raise_event('on_element_update',event.player,element,element.state) @@ -175,15 +170,15 @@ function Checkbox._prototype_radiobutton:set_store(category,value,internal) end --- Registers a new option set that can be linked to radiobuttons (only one can be true at a time) --- @tparam string name the name of the option set, must be unique -- @tparam function callback the update callback when the value of the option set changes -- callback param - value string - the new selected option for this option set -- callback param - category string - the category that updated if categorize was used -- @tparam function categorize the function used to convert an element into a string -- @treturn string the name of this option set to be passed to add_as_option -function Checkbox.new_option_set(name,callback,categorize) +function Checkbox.new_option_set(callback,categorize) + local name = Store.register(categorize) - Store.register(name,function(value,category) + Store.watch(name,function(value,category) local options = Checkbox.option_sets[name] for opt_name,define_name in pairs(options) do if Gui.defines[define_name] then diff --git a/expcore/gui/elements/dropdown.lua b/expcore/gui/elements/dropdown.lua index c56eb960..ae6857c0 100644 --- a/expcore/gui/elements/dropdown.lua +++ b/expcore/gui/elements/dropdown.lua @@ -47,8 +47,7 @@ local Dropdown = { _prototype=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) } } @@ -71,8 +70,7 @@ function Dropdown.new_dropdown(name) end if self.store then - local category = self.categorize and self.categorize(element) or nil - local value = self:get_store(category) + local value = self:get_store(element) if value then Dropdown.select_value(element,value) end end end) @@ -82,8 +80,7 @@ function Dropdown.new_dropdown(name) local value = Dropdown.get_selected_value(element) if self.store then - local category = self.categorize and self.categorize(element) or value - self:set_store(category,value) + self:set_store(element,value) else local player = event.player diff --git a/expcore/gui/elements/elem-button.lua b/expcore/gui/elements/elem-button.lua index e61859bf..8b2b2b3c 100644 --- a/expcore/gui/elements/elem-button.lua +++ b/expcore/gui/elements/elem-button.lua @@ -37,8 +37,7 @@ local ElemButton = { _prototype=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) } } @@ -56,8 +55,7 @@ function ElemButton.new_elem_button(name) end if self.store then - local category = self.categorize and self.categorize(element) or nil - local value = self:get_store(category) + local value = self:get_store(element) if value then element.elem_value = value end end end) @@ -67,8 +65,7 @@ function ElemButton.new_elem_button(name) local value = element.elem_value if self.store then - local category = self.categorize and self.categorize(element) or value - self:set_store(category,value) + self:set_store(element,value) else self:raise_event('on_element_update',event.player,element,value) diff --git a/expcore/gui/elements/progress-bar.lua b/expcore/gui/elements/progress-bar.lua index 671f11cb..0e096d42 100644 --- a/expcore/gui/elements/progress-bar.lua +++ b/expcore/gui/elements/progress-bar.lua @@ -64,8 +64,7 @@ local ProgressBar = { _prototype=Prototype.extend{ on_complete = Prototype.event, on_store_complete = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) } } @@ -194,11 +193,10 @@ function ProgressBar.new_progressbar(name) self:on_draw(function(player,element,maximum) if self.store then - local category = self.categorize and self.categorize(element) or nil - local value = self:get_store(category) + local value = self:get_store(element) if not value then value = self.count_down and 1 or 0 - self:set_store(category,value) + self:set_store(element,value) end element.value = value @@ -350,8 +348,7 @@ function ProgressBar._prototype:reset_element(element) if not element or not element.valid then return end local value = self.count_down and 1 or 0 if self.store then - local category = self.categorize and self.categorize(element) or value - self:set_store(category,value) + self:set_store(element,value) else element.value = value end diff --git a/expcore/gui/elements/slider.lua b/expcore/gui/elements/slider.lua index 110dd1bd..e8099b06 100644 --- a/expcore/gui/elements/slider.lua +++ b/expcore/gui/elements/slider.lua @@ -61,8 +61,7 @@ local Slider = { _prototype=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) } } @@ -88,8 +87,7 @@ function Slider.new_slider(name) element.set_slider_minimum_maximum(min,max) if self.store then - local category = self.categorize and self.categorize(element) or nil - local value = self:get_store(category) + local value = self:get_store(element) if value then element.slider_value = value end end @@ -103,8 +101,7 @@ function Slider.new_slider(name) local value = element.slider_value if self.store then - local category = self.categorize and self.categorize(element) or value - self:set_store(category,value) + self:set_store(element,value) else event_call(self,element,value) @@ -144,8 +141,7 @@ function Slider._prototype:draw_label(element) local value = 0 if self.store then - local category = self.categorize and self.categorize(element) or value - value = self:get_store(category) or 0 + value = self:get_store(element) or 0 end local new_element = element.add{ diff --git a/expcore/gui/elements/text.lua b/expcore/gui/elements/text.lua index 406c4ea0..56709ede 100644 --- a/expcore/gui/elements/text.lua +++ b/expcore/gui/elements/text.lua @@ -40,14 +40,12 @@ local Text = { _prototype_field=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) }, _prototype_box=Prototype.extend{ on_element_update = Prototype.event, on_store_update = Prototype.event, - add_store = Prototype.store(false,store_update), - add_sync_store = Prototype.store(true,store_update) + add_store = Prototype.store(store_update) } } @@ -73,8 +71,7 @@ function Text.new_text_field(name) end if self.store then - local category = self.categorize and self.categorize(element) or nil - local value = self:get_store(category) + local value = self:get_store(element) if value then element.text = value end end end) @@ -84,8 +81,7 @@ function Text.new_text_field(name) local value = element.text if self.store then - local category = self.categorize and self.categorize(element) or value - self:set_store(category,value) + self:set_store(element,value) else self:raise_event('on_element_update',event.player,element,value) diff --git a/expcore/gui/instances.lua b/expcore/gui/instances.lua index 86fcd11f..2db7273e 100644 --- a/expcore/gui/instances.lua +++ b/expcore/gui/instances.lua @@ -15,10 +15,10 @@ the caption of all of them at once; this is where this module comes it. First you must register the way that the instances are stored and under what name, using Instances.register you will give the - name of the collective group of instances followed by an optional categorise function which allows variants to be stored under one + name of the collective group of instances followed by an optional serializer function which allows variants to be stored under one name (like one for each force or player) - -- categorise works in the same way as store categorise + -- serializer works in the same way as store serializer -- so the function will world here but no value is stored only gui elements Instances.register('score',Gui.categorize_by_force) @@ -34,7 +34,7 @@ element.caption = 0 end) - Note that if you don't give a categorise function then you don't need to give a category when getting the elements. + Note that if you don't give a serializer function then you don't need to give a category when getting the elements. >>>> Using unregistered instance groups When using a registered group and the functions that go with them it is much simpler to use and more importantly includes error checking @@ -72,9 +72,9 @@ end) -- gets all instances and sets the element caption to 0 >>>> Functions - Instances.has_categories(name) --- Returns if a instance group has a categorise function; must be registered + Instances.has_categories(name) --- Returns if a instance group has a serializer function; must be registered Instances.is_registered(name) --- Returns if the given name is a registered instance group - Instances.register(name,categorise) --- Registers the name of an instance group to allow for storing element instances + Instances.register(name,serializer) --- Registers the name of an instance group to allow for storing element instances Instances.add_element(name,element) --- Adds an element to the instance group under the correct category; must be registered Instances.get_elements_raw(name,category) --- Gets all element instances without first removing any invalid ones; used internally and must be registered @@ -86,46 +86,46 @@ local Global = require 'utils.global' --- @dep utils.global local Instances = { - categorise={}, + serializer={}, data={} } Global.register(Instances.data,function(tbl) Instances.data = tbl end) ---- Returns if a instance group has a categorise function; must be registered +--- Returns if a instance group has a serializer function; must be registered -- @tparam string name the name of the instance group --- @treturn boolean true if there is a categorise function +-- @treturn boolean true if there is a serializer function function Instances.has_categories(name) - return type(Instances.categorise[name]) == 'function' + return type(Instances.serializer[name]) == 'function' end --- Returns if the given name is a registered instance group -- @tparam string name the name of the instance group you are testing -- @treturn boolean true if the name is registered function Instances.is_registered(name) - return Instances.categorise[name] ~= nil + return Instances.serializer[name] ~= nil end --- Registers the name of an instance group to allow for storing element instances -- @tparam string name the name of the instance group; must to unique --- @tparam[opt] function categorise function used to turn the element into a string --- categorise param - element LuaGuiElement - the gui element to be turned into a string --- categorise return - string - the category that the element will be added to like the player's name or force's name +-- @tparam[opt] function serializer function used to turn the element into a string +-- serializer param - element LuaGuiElement - the gui element to be turned into a string +-- serializer return - string - the category that the element will be added to like the player's name or force's name -- @treturn string the name that was added so it can be used as a variable -function Instances.register(name,categorise) +function Instances.register(name,serializer) if _LIFECYCLE ~= _STAGE.control then return error('Can only be called during the control stage', 2) end - if Instances.categorise[name] then + if Instances.serializer[name] then return error('Instances for '..name..' already exist.',2) end - categorise = type(categorise) == 'function' and categorise or true + serializer = type(serializer) == 'function' and serializer or true Instances.data[name] = {} - Instances.categorise[name] = categorise + Instances.serializer[name] = serializer return name end @@ -134,12 +134,12 @@ end -- @tparam string name the name of the instance group to add the element to -- @tparam LuaGuiElement element the element to add the the instance group function Instances.add_element(name,element) - if not Instances.categorise[name] then + if not Instances.serializer[name] then return error('Invalid name for instance group: '..name,2) end if Instances.has_categories(name) then - local category = Instances.categorise[name](element) + local category = Instances.serializer[name](element) if not Instances.data[name][category] then Instances.data[name][category] = {} end table.insert(Instances.data[name][category],element) else @@ -149,10 +149,10 @@ end --- Gets all element instances without first removing any invalid ones; used internally and must be registered -- @tparam string name the name of the instance group to get the instances of --- @tparam[opt] string category the category to get the instance from, not needed when no categorise function +-- @tparam[opt] string category the category to get the instance from, not needed when no serializer function -- @treturn table the table of element instances of which some may be invalid function Instances.get_elements_raw(name,category) - if not Instances.categorise[name] then + if not Instances.serializer[name] then return error('Invalid name for instance group: '..name,2) end @@ -165,24 +165,24 @@ end --- Gets all valid element instances and has the option of running a callback on those that are valid -- @tparam string name the name of the instance group to get the instances of --- @tparam[opt] string category the category to get the instances of, not needed when no categorise function +-- @tparam[opt] string category the category to get the instances of, not needed when no serializer function -- @tparam[opt] function callback when given the callback will be ran on all valid elements -- callback param - element LuaGuiElement - the current valid element -- @treturn table the table of element instances with all invalid ones removed function Instances.get_valid_elements(name,category,callback) - if not Instances.categorise[name] then + if not Instances.serializer[name] then return error('Invalid name for instance group: '..name,2) end category = category or callback local elements = Instances.get_elements_raw(name,category) - local categorise = Instances.has_categories(name) + local serializer = Instances.has_categories(name) for key,element in pairs(elements) do if not element or not element.valid then elements[key] = nil else - if categorise and callback then callback(element) + if serializer and callback then callback(element) elseif category then category(element) end end end diff --git a/expcore/gui/prototype.lua b/expcore/gui/prototype.lua index a98dece7..790375aa 100644 --- a/expcore/gui/prototype.lua +++ b/expcore/gui/prototype.lua @@ -27,9 +27,9 @@ Prototype:raise_event(event_name,...) --- Raises a custom event for this define, any number of params can be given Prototype:draw_to(element,...) --- The main function for defines, when called will draw an instance of this define to the given element - Prototype:get_store(category) --- Gets the value in this elements store, category needed if categorize function used - Prototype:set_store(category,value) --- Sets the value in this elements store, category needed if categorize function used - Prototype:clear_store(category) --- Sets the value in this elements store to nil, category needed if categorize function used + Prototype:get_store(category) --- Gets the value in this elements store, category needed if serializer function used + Prototype:set_store(category,value) --- Sets the value in this elements store, category needed if serializer function used + Prototype:clear_store(category) --- Sets the value in this elements store to nil, category needed if serializer function used ]] local Game = require 'utils.game' --- @dep utils.game local Store = require 'expcore.store' --- @dep expcore.store @@ -82,29 +82,22 @@ function Constructor.extend(new_prototype) end --- Creates a new function which adds a store to a gui define --- @tparam boolean sync if the function should create a synced store -- @tparam function callback the function called when needing to update the value of an element -- @treturn function the function that will add a store for this define -function Constructor.store(sync,callback) - --- Adds a store for the define that is shared between all instances of the define in the same category, categorize is a function that returns a string +function Constructor.store(callback) + --- Adds a store for the define that is shared between all instances of the define in the same category, serializer is a function that returns a string -- @tparam self table the gui define being acted on - -- @tparam[opt] string location a unique location identifier, when omitted a uid location will be used, use when sync is set to true - -- @tparam[opt] function categorize function used to determine the category of a LuaGuiElement, when omitted all share one single category - -- categorize param - LuaGuiElement element - the element that needs to be converted - -- categorize return - string - a deterministic string that references to a category such as player name or force name + -- @tparam[opt] function serializer function used to determine the category of a LuaGuiElement, when omitted all share one single category + -- serializer param - LuaGuiElement element - the element that needs to be converted + -- serializer return - string - a deterministic string that references to a category such as player name or force name -- @treturn self the element define to allow chaining - return function(self,location,categorize) + return function(self,serializer) if self.store then return end + serializer = serializer or function() return '' end - if not sync then - categorize = location - location = Store.register() - end + self.store = Store.register(serializer) - self.store = location - self.categorize = categorize - - Instances.register(self.name,self.categorize) + Instances.register(self.name,serializer) Store.watch(self.store,function(value,category) self:raise_event('on_store_update',value,category) @@ -274,12 +267,12 @@ function Prototype:draw_to(element,...) Instances.add_element(self.name,new_element) end - self:raise_event('on_draw',player,new_element) + self:raise_event('on_draw',player,new_element,...) return new_element end ---- Gets the value in this elements store, category needed if categorize function used +--- Gets the value in this elements store, category needed if serializer function used -- @tparam string category[opt] the category to get such as player name or force name -- @treturn any the value that is stored for this define function Prototype:get_store(category) @@ -287,7 +280,7 @@ function Prototype:get_store(category) return Store.get(self.store,category) end ---- Sets the value in this elements store, category needed if categorize function used +--- Sets the value in this elements store, category needed if serializer function used -- @tparam string category[opt] the category to get such as player name or force name -- @tparam any value the value to set for this define, must be valid for its type ie for checkbox etc -- @treturn boolean true if the value was set @@ -296,7 +289,7 @@ function Prototype:set_store(category,value) return Store.set(self.store,category,value) end ---- Sets the value in this elements store to nil, category needed if categorize function used +--- Sets the value in this elements store to nil, category needed if serializer function used -- @tparam[opt] string category the category to get such as player name or force name -- @treturn boolean true if the value was set function Prototype:clear_store(category) diff --git a/expcore/gui/test.lua b/expcore/gui/test.lua index a7fe9952..37cc54f8 100644 --- a/expcore/gui/test.lua +++ b/expcore/gui/test.lua @@ -279,7 +279,7 @@ Gui.new_radiobutton('test-radiobutton-store') end) local radiobutton_option_set = -Gui.new_radiobutton_option_set('gui.test.share',function(value,category) +Gui.new_radiobutton_option_set(function(value,category) game.print('Radiobutton option set for: '..category..' is now: '..tostring(value)) end,Gui.categorize_by_player) diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index a1b50dc2..c94c54fa 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -437,7 +437,7 @@ end) Warps.on_update(warp_list 'update_all') --- When the player leaves or enters range of a warp this is triggered -Store.register(player_in_range_store,function(value,player_name) +Store.watch(player_in_range_store,function(value,player_name) local player = game.players[player_name] local force = player.force local frame = warp_list:get_frame(player_name) From f44ab9b44f166034e19632f2632120bef86771d7 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Thu, 17 Oct 2019 23:23:51 +0100 Subject: [PATCH 73/93] Store bug fixes --- README.md | 12 ++++++++---- expcore/store.lua | 4 +++- modules/control/warps.lua | 10 +++++----- modules/gui/task-list.lua | 5 ++++- modules/gui/warp-list.lua | 18 ++++++++++++------ 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8ff71f05..93092fb6 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,17 @@ Explosive Gaming (often ExpGaming) is a server hosting community with a strong f All are welcome to make pull requests and issues for this scenario, if you are in any doubt please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. All our docs can be found [here][docs]. Please keep in mind while making code changes: * New features should have the branch names: `feature/feature-name` -* New features are merged into `dev` after it has been completed. -* After a number of features have been added a release branch is made: `release/X.Y.0`; this branch should have no new features and only bug fixes or localization. -* A release is merged into `master` on the following friday in time for the the weekly reset. -* Patches may be named `patch/X.Y.Z` and fill be merged into `master` and `dev` when appropriate. +* New features are merged into `dev` after it has been completed, this can be done through a pull request. +* After a number of features have been added a release branch is made: `release/X.Y.0` +* Bug fixes and localization can be made to the release branch with a pull request rather than into dev. +* A release is merged into `master` on the following friday after it is considered stable. +* Patches may be named `patch/X.Y.Z` and will be merged into `dev` and then `master` when appropriate. ## Releases | Scenario Version* | Version Name | Factorio Version** | |---|---|---| +| [v5.10][s5.10] | Data Store Rewrite | [v0.17.71][f0.17.71] | | [v5.9][s5.9] | Control Modules and Documentation | [v0.17.63][f0.17.63] | | [v5.8][s5.8] | Home and Chat Bot | [v0.17.47][f0.17.49] | | [v5.7][s5.7] | Warp System | [v0.17.47][f0.17.47] | @@ -76,6 +78,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i \*\* Factorio versions show the version they were made for, often the minimum requirement. +[s5.10]: https://github.com/explosivegaming/scenario/releases/tag/5.10.0 [s5.9]: https://github.com/explosivegaming/scenario/releases/tag/5.9.0 [s5.8]: https://github.com/explosivegaming/scenario/releases/tag/5.8.0 [s5.7]: https://github.com/explosivegaming/scenario/releases/tag/5.7.0 @@ -92,6 +95,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i [s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0 [s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1 +[f0.17.71]: https://wiki.factorio.com/Version_history/0.17.0#0.17.71 [f0.17.63]: https://wiki.factorio.com/Version_history/0.17.0#0.17.63 [f0.17.49]: https://wiki.factorio.com/Version_history/0.17.0#0.17.49 [f0.17.47]: https://wiki.factorio.com/Version_history/0.17.0#0.17.47 diff --git a/expcore/store.lua b/expcore/store.lua index 96b521b8..f58e41b9 100644 --- a/expcore/store.lua +++ b/expcore/store.lua @@ -277,7 +277,9 @@ function Store.clear(store,key) -- Check if there is a key being used if key then - data_store[store][key] = nil + if type(data_store[store]) == 'table' then + data_store[store][key] = nil + end else data_store[store] = nil end diff --git a/modules/control/warps.lua b/modules/control/warps.lua index a9e3c5d7..ad503c3a 100644 --- a/modules/control/warps.lua +++ b/modules/control/warps.lua @@ -304,14 +304,14 @@ function Warps.add_warp(force_name,surface,position,player_name,warp_name) warp_name = warp_name or 'New warp' -- Get the existing warps for this force - local warps = force_warps[force_name] - if not warps then - force_warps[force_name] = {} - warps = force_warps[force_name] + local warp_ids = force_warps[force_name] + if not warp_ids then + warp_ids = {} + force_warps[force_name] = warp_ids end -- Insert the warp id into the force warps - table.insert(warps,warp_id) + table.insert(warp_ids,warp_id) -- Create the editing table local editing = {} diff --git a/modules/gui/task-list.lua b/modules/gui/task-list.lua index 1704ebbd..d82a3a77 100644 --- a/modules/gui/task-list.lua +++ b/modules/gui/task-list.lua @@ -326,7 +326,7 @@ Tasks.on_update(function(task,task_id) local players if task then local force = game.forces[task.force_name] - players = force.players + players = force.connected_players else players = game.connected_players end @@ -338,6 +338,9 @@ Tasks.on_update(function(task,task_id) end end) +--- Update the tasks when the player joins +Event.add(defines.events.on_player_joined_game,task_list 'redraw') + --- Makes sure the right buttons are present when roles change Event.add(Roles.events.on_role_assigned,task_list 'redraw') Event.add(Roles.events.on_role_unassigned,task_list 'redraw') diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index c94c54fa..67c11571 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -94,7 +94,7 @@ end) Warps.teleport_player(warp_id,player) -- Reset the warp cooldown if the player does not have unlimited warps - if config.bypass_warp_limits_permision and not Roles.player_allowed(player,config.bypass_warp_limits_permision) then + if config.bypass_warp_limits_permission and not Roles.player_allowed(player,config.bypass_warp_limits_permission) then warp_timer:set_store(player.name,0) Store.trigger(player_in_range_store,player) end @@ -436,6 +436,11 @@ end) --- When the name of a warp is updated this is triggered Warps.on_update(warp_list 'update_all') +--- Update the warps when the player joins +Event.add(defines.events.on_player_joined_game,warp_list 'redraw') +Event.add(Roles.events.on_role_assigned,warp_list 'redraw') +Event.add(Roles.events.on_role_unassigned,warp_list 'redraw') + --- When the player leaves or enters range of a warp this is triggered Store.watch(player_in_range_store,function(value,player_name) local player = game.players[player_name] @@ -459,7 +464,7 @@ Store.watch(player_in_range_store,function(value,player_name) if element and element.valid then element.enabled = state if state then - local position = Warps.get_details(warp_id).position + local position = Warps.get_warp(warp_id).position element.tooltip = {'warp-list.goto-tooltip',position.x,position.y} else element.tooltip = {'warp-list.goto-disabled'} @@ -483,7 +488,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing),function() local was_in_range = Store.get(player_in_range_store,player) -- Get the ids of all the warps on the players force - local force_name = player.force + local force_name = player.force.name local warp_ids = force_warps[force_name] if not warp_ids then warp_ids = Warps.get_force_warp_ids(force_name) @@ -497,11 +502,11 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing),function() local px,py = pos.x,pos.y -- Loop over each warp - for _,warp_id in pairs(warp_ids) do + for _,warp_id in ipairs(warp_ids) do -- Check if warp id is chached local warp = warps[warp_id] if not warp then - warp = Warps.get(warp_id) + warp = Warps.get_warp(warp_id) warps[warp_id] = warp end @@ -509,11 +514,12 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing),function() local warp_pos = warp.position if warp.surface == surface then local dx, dy = px-warp_pos.x, py-warp_pos.y - if (dx*dx)+(dy*dy) < rs2 or (dx*dx)+(dy*dy) < r2 then + if (warp_id == warp_ids.spawn and (dx*dx)+(dy*dy) < rs2) or (dx*dx)+(dy*dy) < r2 then -- Set in range to true if the player was preiovusly out of range if not was_in_range then Store.set(player_in_range_store,player,true) end + was_in_range = false -- stops setting back to false below break end end From 3a04e72b0cb20eee896a455c8cb7e927365c2741 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Fri, 18 Oct 2019 00:49:56 +0100 Subject: [PATCH 74/93] Optimised warp gui update --- modules/gui/warp-list.lua | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index 67c11571..d5d12a4f 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -434,7 +434,38 @@ end) end) --- When the name of a warp is updated this is triggered -Warps.on_update(warp_list 'update_all') +Warps.on_update(function(warp) + local players + local force_name + if warp then + local force = game.forces[warp.force_name] + players = force.connected_players + force_name = warp.force_name + else + players = game.connected_players + end + + -- Update the gui for selected players + local force_warps = {} + for _,player in pairs(players) do + local frame = warp_list:get_frame(player) + local element = frame.container.scroll.table + + -- Get the warp ids for the players force + force_name = force_name or player.force.name + local warp_ids = force_warps[force_name] + if not warp_ids then + warp_ids = Warps.get_force_warp_ids(force_name) + force_warps[force_name] = warp_ids + end + + -- Update the gui + element.clear() + for _,warp_id in ipairs(warp_ids) do + generate_warp(player,element,warp_id) + end + end +end) --- Update the warps when the player joins Event.add(defines.events.on_player_joined_game,warp_list 'redraw') From 48642cfa14d9c51642333e2474cb346100557d72 Mon Sep 17 00:00:00 2001 From: arty714 Date: Sat, 19 Oct 2019 17:09:17 +0200 Subject: [PATCH 75/93] Typos Corrected some typos. --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 93092fb6..affbc44a 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ ## Explosive Gaming -Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games that follow similar ideas. Our factorio server are known for hosting large maps with the main goal of being a "mega base" which can produce as much as possible with in our reset schedule. Although these server tend to the more experienced players our server are open to everyone. You can find us through our [website], [discord], [wiki], or in the public games tab in factorio (ExpGaming S1). +Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games that follow similar ideas. Our Factorio server are known for hosting large maps with the main goal of being a "mega base" which can produce as much as possible within our reset schedule. Although these servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our [website], [discord], [wiki], or in the public games tab in Factorio (ExpGaming S1, ExpGaming S2, etc.). ## Use and Installation 1) Download this [git repository](https://github.com/explosivegaming/scenario/archive/master.zip) for the stable release. The dev branch can be found [here](https://github.com/explosivegaming/scenario/archive/dev.zip) for those who want the latest features. See [releases](#releases) for other release branches. -2) Extract the downloaded zip file from the branch you downloaded into factorio's scenario directory: +2) Extract the downloaded zip file from the branch you downloaded into Factorio's scenario directory: * Windows: `%appdata%\Factorio\scenarios` * Linux: `~/.factorio/scenarios` @@ -38,13 +38,14 @@ Explosive Gaming (often ExpGaming) is a server hosting community with a strong f 4) More advanced users may want to play with the other configs files within `./config` but please be aware that some of the config files will require a basic understanding of lua while others may just be a list of values. -5) Once you have made any config changes that you wish to make open factorio, select play, then start scenario (or host scenario from within multiplayer tab), and select the scenario which will be called `scenario-master` if you have downloaded the latest stable release and have not changed the folder name. +5) Once you have made any config changes that you wish to make open Factorio, select play, then start scenario (or host scenario from within multiplayer tab), and select the scenario which will be called `scenario-master` if you have downloaded the latest stable release and have not changed the folder name. -6) The scenario will now load all the selected modules and start the map, any errors or exceptions raised in the scenario should not cause a game/server crash so if any features don't work as expected then it may be returning an error in the log, please report these errors to [the issues page](issues). +6) The scenario will now load all the selected modules and start the map, any errors or exceptions raised in the scenario should not cause a game/server crash, so if any features do not work as expected then it may be returning an error in the log. +Please report these errors to [the issues page](issues). ## Contributing -All are welcome to make pull requests and issues for this scenario, if you are in any doubt please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. All our docs can be found [here][docs]. Please keep in mind while making code changes: +All are welcome to make pull requests and issues for this scenario, if you are in any doubt, please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. All our docs can be found [here][docs]. Please keep in mind while making code changes: * New features should have the branch names: `feature/feature-name` * New features are merged into `dev` after it has been completed, this can be done through a pull request. From 4fe3d558e76135998a61a5b4d3954da04c2113b4 Mon Sep 17 00:00:00 2001 From: arty714 Date: Sat, 19 Oct 2019 17:09:17 +0200 Subject: [PATCH 76/93] Typos Corrected some typos. --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 93092fb6..affbc44a 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ ## Explosive Gaming -Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games that follow similar ideas. Our factorio server are known for hosting large maps with the main goal of being a "mega base" which can produce as much as possible with in our reset schedule. Although these server tend to the more experienced players our server are open to everyone. You can find us through our [website], [discord], [wiki], or in the public games tab in factorio (ExpGaming S1). +Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games that follow similar ideas. Our Factorio server are known for hosting large maps with the main goal of being a "mega base" which can produce as much as possible within our reset schedule. Although these servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our [website], [discord], [wiki], or in the public games tab in Factorio (ExpGaming S1, ExpGaming S2, etc.). ## Use and Installation 1) Download this [git repository](https://github.com/explosivegaming/scenario/archive/master.zip) for the stable release. The dev branch can be found [here](https://github.com/explosivegaming/scenario/archive/dev.zip) for those who want the latest features. See [releases](#releases) for other release branches. -2) Extract the downloaded zip file from the branch you downloaded into factorio's scenario directory: +2) Extract the downloaded zip file from the branch you downloaded into Factorio's scenario directory: * Windows: `%appdata%\Factorio\scenarios` * Linux: `~/.factorio/scenarios` @@ -38,13 +38,14 @@ Explosive Gaming (often ExpGaming) is a server hosting community with a strong f 4) More advanced users may want to play with the other configs files within `./config` but please be aware that some of the config files will require a basic understanding of lua while others may just be a list of values. -5) Once you have made any config changes that you wish to make open factorio, select play, then start scenario (or host scenario from within multiplayer tab), and select the scenario which will be called `scenario-master` if you have downloaded the latest stable release and have not changed the folder name. +5) Once you have made any config changes that you wish to make open Factorio, select play, then start scenario (or host scenario from within multiplayer tab), and select the scenario which will be called `scenario-master` if you have downloaded the latest stable release and have not changed the folder name. -6) The scenario will now load all the selected modules and start the map, any errors or exceptions raised in the scenario should not cause a game/server crash so if any features don't work as expected then it may be returning an error in the log, please report these errors to [the issues page](issues). +6) The scenario will now load all the selected modules and start the map, any errors or exceptions raised in the scenario should not cause a game/server crash, so if any features do not work as expected then it may be returning an error in the log. +Please report these errors to [the issues page](issues). ## Contributing -All are welcome to make pull requests and issues for this scenario, if you are in any doubt please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. All our docs can be found [here][docs]. Please keep in mind while making code changes: +All are welcome to make pull requests and issues for this scenario, if you are in any doubt, please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. All our docs can be found [here][docs]. Please keep in mind while making code changes: * New features should have the branch names: `feature/feature-name` * New features are merged into `dev` after it has been completed, this can be done through a pull request. From 3979b9fe557b598dbb7f6dcf5f9fd748ae1bf179 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 21 Jan 2020 18:33:07 +0000 Subject: [PATCH 77/93] Description Json --- description.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 description.json diff --git a/description.json b/description.json new file mode 100644 index 00000000..95633c16 --- /dev/null +++ b/description.json @@ -0,0 +1,4 @@ +{ + "order": "ExpGaming", + "multiplayer-compatible": true +} From 80b9672a5703634298e3a9319afebf84cdd4b1f8 Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 17:26:01 +0100 Subject: [PATCH 78/93] ratio added ratio added --- .vs/VSWorkspaceState.json | 10 +++++ .vs/slnx.sqlite | Bin 0 -> 131072 bytes .vs/vs/v16/.suo | Bin 0 -> 29184 bytes config/_file_loader.lua | 1 + config/roles.lua | 2 + locale/en/commands.cfg | 9 ++++ modules/commands/ratio.lua | 85 +++++++++++++++++++++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 100644 .vs/VSWorkspaceState.json create mode 100644 .vs/slnx.sqlite create mode 100644 .vs/vs/v16/.suo create mode 100644 modules/commands/ratio.lua diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..e9c346db --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,10 @@ +{ + "ExpandedNodes": [ + "", + "\\.github", + "\\.github\\ISSUE_TEMPLATE", + "\\utils" + ], + "SelectedNode": "\\utils\\math.lua", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..178ee98162dc3c46dbc742eb33b7ae791811a739 GIT binary patch literal 131072 zcmeFa34B~t^*H|Cyf^R7d-Im0ZJK@UnzoZRNheDeN}8l?x~56GQ9?SInWRG}nJ_cy zf@PUulU+a-5kwH#WDymVMOg$?P*FrtTtHD#R1guAO@HU!`}Uc%{P6$t`_=#J=hJud z?m2fm_ug~Q_U`m=-55(pYeo{uu~53EnJS=YnmV?ohN37x{70$&Z#w+J>MxMemcOU^ z(@zE7Kgo-b)prrjH1%ES7OB9$LA*#f-}h6V;kGiDc;5E(dDc%=g`5AMK><$Xa7Qz< z6~1^!fX-}r*Tmw{p2$#7J|wlXue)QQyQXJz zSNG1E-5;oqL0PPUe_J-^;t$r$-)(Ppus%~H^TnOe&9(Wvxj8fz&EGlYD4jD)9;HhN zaj>Ry%f^jptedxVcJz1GpS4orivt1ryg)iM9FIDO?tGWE&J1*{-q@XI!gb02w+vy1H$k zuI`Q9CP?oLA>iii9ethaI{M}}1%vfQhaGg)i>#T9#}93t48>z3v1lY;1@`&S%WZ&F zV$w?=u@3DBhoh-fY&aH2Lo~?hM02dc96WQ#Rsy1p(tjwGj*b~5bY>w^)|jO~3@tY% z!XdOj`w|DH9)OP2nTSu0jpyRYVtr<@pD!MQeKmyl74B&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Y2cJX~<4xR7J>I}Sfhyd|XNAzQul7~2)Z)f;cq4(iXp7Ln& z4sqRa{3JT7L${##(P66tl7aANef%pBVH5aXglv|C_fyDO{0!(xO;|3YD(+_~pjS6Y zOT_9l8#C1>TH2$d6A08%yShXUoqZBFYmgogv`!0HxNwX^kU@gF>L3*9IYv)@?;|df z3gYXHax|~5d8rZ0^W*~M=aY^Zo?XDXdP#XMcs*jw7Bb*iou(18vkQn&ko!@>-b9~% zpL+E&&cHa)t9QiYcpfT({c(PTBNQxO;?)a~XMKz~#&=ozB*E~M!&(vmU&c?d?lxNR SZS5JCL&ABE^E|zkm1^Hq6NJqG literal 0 HcmV?d00001 diff --git a/.vs/vs/v16/.suo b/.vs/vs/v16/.suo new file mode 100644 index 0000000000000000000000000000000000000000..c5280cd230ef6c1567149876e6d5aeccf8891d61 GIT binary patch literal 29184 zcmeHQ4UiPab)H31EdGCuY=O{$FgnofYWMbj5h5J7cYp*EaCaP_L&tKv91DB9$Nn53 zK(Zy-SVmGLW7#nxPPyX9KdMyhSaK9Au5uJBP9>F~BskcW#FFJ$3bJEclwt`JAm2AL zeLFL^Gt;xX2RNpWH{H|I-LL!g>({T}b~mpapZeP8zjpnP6pLG`T&0}9Fjn~;L%a{+ zG2(rSqFjwI)mt5ao z@v*(p6W{ZVN4gK+s3l$tjA>=3vI^L@Bh;qsbt%RCc_uj0NN)4j;%^5L4fa)?z)!q` zN)k25C~-gsXb}a(^>lXLd}WN!EB?tSY(OvYZY2*aNhN{y6Z#F9BZ$e^A=cx8Umb@5 zyt5uI$<@z6JU8f_^*)5p85@8w$1~ln__heZvYBTBU?PBB$2O3LQvuTe(*ZL8?+45T zTnG37;Ddnc0kZ(J0XG2V0EnXs{#?L3z)gU00OIAh8a+G~el;KjSO};Gd*1(3S7+bzwE<@hQ~hyj_SntyO`tu0bu@rH2!^@hf5v*f-^YJ zQx1r6!?DkA9RGEIi#7gl*70)uvo6KPKkG$j9siBUL%A?tFGI9NOMT^8i~`i(sMA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met%)Q?FMrq8ByCxc(UVW9|QZtNX7X`sP#b-uHtk|1m~+?IXxF%xW6L$*~;s6?LZj zCuwqU+SW4Vi$jNh_(#(>ADdBg^~1h~tt?U0Lik0o*hj85w%`5-N4X#Rp4oNw%(`z&I)J^!1xe%No3dHTrF^9w$8R#|Xp;*-z) z@vJSLYSu1`-+AlFS6}UY%6HAqH@3fV`-xA78=sc0!@WlQ-ZomuY-@Py=r7kjd2m`| z=w$C-ok&0OCFy!Gp^V#Hdi`m7$X?O^X>=_9|L@QiBdh;&mCh+hrq3=X{oj54QR~s+2OZW5l@{yPsiSzEI<9FUhc&>iJ>F>WcyZZcpjh!;@-aGB;@R?&T zePdd{+x@$h?thw6uJk`H#Pl|QSET=K^*8G_XaA4Sb$#*0u`8Cna`nGPe)T!(j3aqE Zg>l(|`G{7Bxcb|x+xRbq|BU1R{{W4&Uta(K literal 0 HcmV?d00001 diff --git a/config/_file_loader.lua b/config/_file_loader.lua index c4a5bba6..7521e087 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -13,6 +13,7 @@ return { 'modules.commands.tag', 'modules.commands.teleport', 'modules.commands.cheat-mode', + 'modules.commands.ratio', 'modules.commands.interface', 'modules.commands.help', 'modules.commands.roles', diff --git a/config/roles.lua b/config/roles.lua index d46d08fe..36aced14 100644 --- a/config/roles.lua +++ b/config/roles.lua @@ -210,6 +210,7 @@ local default = Roles.new_role('Guest','') 'command/list-roles', 'command/find-on-map', 'command/report', + 'command/ratio', 'gui/player-list', 'gui/rocket-info', 'gui/science-info', @@ -285,4 +286,5 @@ Roles.override_player_roles{ Tcheko={'Moderator','Member'}, WhomstThouAmMe={'Moderator','Member'}, Windbomb={'Moderator','Member'}, + tovernaar123={'Administrator','Moderator','Member'}, } diff --git a/locale/en/commands.cfg b/locale/en/commands.cfg index 2fdbea0b..ab475d4b 100644 --- a/locale/en/commands.cfg +++ b/locale/en/commands.cfg @@ -59,9 +59,18 @@ result=__1__ entites were revived and __2__ were healed to max health. set=Your bonus has been set to __1__. wip=This command is temporary and will be replaced at some point in the future. +[expcom-ratio] +notSelecting=Please select an entetiy with a recpie. +item-in=You need __1__ per seconds of [item=__2__]. +fluid-in=You need __1__ per seconds of [fluid=__2__]. +item-out=This will result in: __1__ [item=__2__] per second. +fluid-out=This will result in: __1__ [fluid=__2__] per second. +machines=And you will need __1__ machines (with the same speed as this one) for this. + [expcom-home] no-home=You have no home set. no-return=You can't return when home has not yet been used. home-set=Your home point has been set to x: __1__ y: __2__ return-set=Your return point has been set to x: __1__ y: __2__ home-get=Your home point is at x: __1__ y: __2__ + diff --git a/modules/commands/ratio.lua b/modules/commands/ratio.lua new file mode 100644 index 00000000..e96fd2e3 --- /dev/null +++ b/modules/commands/ratio.lua @@ -0,0 +1,85 @@ + + +local Commands = require 'expcore.commands' + + +Commands.new_command('ratio','Will give the ratio on what you have selected') + :add_param('itemsPerSecond',true,'number') + :register(function(player,itemsPerSecond,raw) + + local machine = player.selected -- selected machine + if not machine then --nil check + return Commands.error{'expcom-ratio.notSelecting'} + end + + if machine.type ~= "assembling-machine" and machine.type ~= "furnace" then + return Commands.error{'expcom-ratio.notSelecting'} + end + local recpie = machine.get_recipe() -- recpie + + if not recpie then --nil check + return Commands.error{'expcom-ratio.notSelecting'} + end + + local items = recpie.ingredients -- items in that recpie + local product = recpie.products -- output items + local amountOfMachines + local moduleInvetory = machine.get_module_inventory()--the module Invetory of the machine + local mult = Modules(moduleInvetory) --function for the productivety moduals + + if itemsPerSecond then + amountOfMachines = math.ceil( AmountOfMachines(itemsPerSecond,1/recpie.energy*machine.crafting_speed*product[1].amount*mult)) -- amount of machines + end + if not amountOfMachines then + amountOfMachines = 1 --set to 1 to make it not nil + end + ----------------------------items---------------------------- + for i, item in ipairs(items) do + local sprite -- string to make the icon work either fluid ore item + + if item.type == "item" then + sprite = 'expcom-ratio.item-in' + else + sprite = 'expcom-ratio.fluid-in' + end + + + local ips = item.amount/recpie.energy*machine.crafting_speed*amountOfMachines --math on the items/fluids per second + Commands.print {sprite,math.round(ips,3),item.name}-- full string + end + ----------------------------products---------------------------- + + for i, product in ipairs(product) do + local sprite -- string to make the icon work either fluid ore item + + if product.type == "item" then + sprite = 'expcom-ratio.item-out' + else + sprite = 'expcom-ratio.fluid-out' + end + + local output = 1/recpie.energy*machine.crafting_speed*product.amount*mult --math on the outputs per second + Commands.print {sprite,math.round(output*amountOfMachines,3),product.name} -- full string + + end + + if amountOfMachines ~= 1 then + Commands.print{'expcom-ratio.machines',amountOfMachines} + end + + end) +function Modules(moduleInvetory) -- returns the multeplier of the modules + local effect1 = moduleInvetory.get_item_count("productivity-module") -- type 1 + local effect2 = moduleInvetory.get_item_count("productivity-module-2")-- type 2 + local effect3 = moduleInvetory.get_item_count("productivity-module-3") -- type 3 + + local mult = effect1*4+effect2*6+effect3*10 + return mult/100+1 +end + +function AmountOfMachines(itemsPerSecond,output) + if(itemsPerSecond) then + return itemsPerSecond/output + + end +end From c0b2a99cab8793ef0e7897d85bbd2513ed7a44d0 Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 17:37:27 +0100 Subject: [PATCH 79/93] Revert "ratio added" This reverts commit 80b9672a5703634298e3a9319afebf84cdd4b1f8. --- .vs/VSWorkspaceState.json | 10 ----- .vs/slnx.sqlite | Bin 131072 -> 0 bytes .vs/vs/v16/.suo | Bin 29184 -> 0 bytes config/_file_loader.lua | 1 - config/roles.lua | 2 - locale/en/commands.cfg | 9 ---- modules/commands/ratio.lua | 85 ------------------------------------- 7 files changed, 107 deletions(-) delete mode 100644 .vs/VSWorkspaceState.json delete mode 100644 .vs/slnx.sqlite delete mode 100644 .vs/vs/v16/.suo delete mode 100644 modules/commands/ratio.lua diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json deleted file mode 100644 index e9c346db..00000000 --- a/.vs/VSWorkspaceState.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ExpandedNodes": [ - "", - "\\.github", - "\\.github\\ISSUE_TEMPLATE", - "\\utils" - ], - "SelectedNode": "\\utils\\math.lua", - "PreviewInSolutionExplorer": false -} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite deleted file mode 100644 index 178ee98162dc3c46dbc742eb33b7ae791811a739..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 131072 zcmeFa34B~t^*H|Cyf^R7d-Im0ZJK@UnzoZRNheDeN}8l?x~56GQ9?SInWRG}nJ_cy zf@PUulU+a-5kwH#WDymVMOg$?P*FrtTtHD#R1guAO@HU!`}Uc%{P6$t`_=#J=hJud z?m2fm_ug~Q_U`m=-55(pYeo{uu~53EnJS=YnmV?ohN37x{70$&Z#w+J>MxMemcOU^ z(@zE7Kgo-b)prrjH1%ES7OB9$LA*#f-}h6V;kGiDc;5E(dDc%=g`5AMK><$Xa7Qz< z6~1^!fX-}r*Tmw{p2$#7J|wlXue)QQyQXJz zSNG1E-5;oqL0PPUe_J-^;t$r$-)(Ppus%~H^TnOe&9(Wvxj8fz&EGlYD4jD)9;HhN zaj>Ry%f^jptedxVcJz1GpS4orivt1ryg)iM9FIDO?tGWE&J1*{-q@XI!gb02w+vy1H$k zuI`Q9CP?oLA>iii9ethaI{M}}1%vfQhaGg)i>#T9#}93t48>z3v1lY;1@`&S%WZ&F zV$w?=u@3DBhoh-fY&aH2Lo~?hM02dc96WQ#Rsy1p(tjwGj*b~5bY>w^)|jO~3@tY% z!XdOj`w|DH9)OP2nTSu0jpyRYVtr<@pD!MQeKmyl74B&`G(H|pc80=xqeHn}C%epv zDA{+J6Fg--mObYz18Xn0^}+fxwuyMhojr(moU@ek-EZGHyOx@SJXj?*SI zU!QYUj%~-`c8|Vb{|m$)n>K zg)GZUhiLrk(ZRBwM1>}${tw5&iK zV4b87u=2>tFgi?zW3t&LN9D45yT(vINMST(%Xq%HJD^XQb0H7)hLX|o^blg(PM9z6 z{5i3#HCU$7iG~D*e5dmwIL>evoCVNY&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ou(18vkQn&ko!@>-b9~% zpL+E&&cHa)t9QiYcpfT({c(PTBNQxO;?)a~XMKz~#&=ozB*E~M!&(vmU&c?d?lxNR SZS5JCL&ABE^E|zkm1^Hq6NJqG diff --git a/.vs/vs/v16/.suo b/.vs/vs/v16/.suo deleted file mode 100644 index c5280cd230ef6c1567149876e6d5aeccf8891d61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29184 zcmeHQ4UiPab)H31EdGCuY=O{$FgnofYWMbj5h5J7cYp*EaCaP_L&tKv91DB9$Nn53 zK(Zy-SVmGLW7#nxPPyX9KdMyhSaK9Au5uJBP9>F~BskcW#FFJ$3bJEclwt`JAm2AL zeLFL^Gt;xX2RNpWH{H|I-LL!g>({T}b~mpapZeP8zjpnP6pLG`T&0}9Fjn~;L%a{+ zG2(rSqFjwI)mt5ao z@v*(p6W{ZVN4gK+s3l$tjA>=3vI^L@Bh;qsbt%RCc_uj0NN)4j;%^5L4fa)?z)!q` zN)k25C~-gsXb}a(^>lXLd}WN!EB?tSY(OvYZY2*aNhN{y6Z#F9BZ$e^A=cx8Umb@5 zyt5uI$<@z6JU8f_^*)5p85@8w$1~ln__heZvYBTBU?PBB$2O3LQvuTe(*ZL8?+45T zTnG37;Ddnc0kZ(J0XG2V0EnXs{#?L3z)gU00OIAh8a+G~el;KjSO};Gd*1(3S7+bzwE<@hQ~hyj_SntyO`tu0bu@rH2!^@hf5v*f-^YJ zQx1r6!?DkA9RGEIi#7gl*70)uvo6KPKkG$j9siBUL%A?tFGI9NOMT^8i~`i(sMAq* zBfYFZ`dj0~JI9a+3;EA?8TrpSqzYh^|Liv*+sOx%`;__QLH4!a34xP7=LInbkWV>3 za2_BpGy$3civhO*mH=)CECu{7U>TqVupH0|hydCE#`0I;{SLsLfYpFCfV%*91J(l8 z0oDUL0G$Alw_6Wy(*1jMe~a$->V8!B`*c69`~A9~(EVMyPrZRS(z?G}_p`d6hd-o; zsYx;IeY$@@_wUzze)A!GrT>4s`k(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=r7kjd2m`| z=w$C-ok&0OCFy!Gp^V#Hdi`m7$X?O^X>=_9|L@QiBdh;&mCh+hrq3=X{oj54QR~s+2OZW5l@{yPsiSzEI<9FUhc&>iJ>F>WcyZZcpjh!;@-aGB;@R?&T zePdd{+x@$h?thw6uJk`H#Pl|QSET=K^*8G_XaA4Sb$#*0u`8Cna`nGPe)T!(j3aqE Zg>l(|`G{7Bxcb|x+xRbq|BU1R{{W4&Uta(K diff --git a/config/_file_loader.lua b/config/_file_loader.lua index 7521e087..c4a5bba6 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -13,7 +13,6 @@ return { 'modules.commands.tag', 'modules.commands.teleport', 'modules.commands.cheat-mode', - 'modules.commands.ratio', 'modules.commands.interface', 'modules.commands.help', 'modules.commands.roles', diff --git a/config/roles.lua b/config/roles.lua index 36aced14..d46d08fe 100644 --- a/config/roles.lua +++ b/config/roles.lua @@ -210,7 +210,6 @@ local default = Roles.new_role('Guest','') 'command/list-roles', 'command/find-on-map', 'command/report', - 'command/ratio', 'gui/player-list', 'gui/rocket-info', 'gui/science-info', @@ -286,5 +285,4 @@ Roles.override_player_roles{ Tcheko={'Moderator','Member'}, WhomstThouAmMe={'Moderator','Member'}, Windbomb={'Moderator','Member'}, - tovernaar123={'Administrator','Moderator','Member'}, } diff --git a/locale/en/commands.cfg b/locale/en/commands.cfg index ab475d4b..2fdbea0b 100644 --- a/locale/en/commands.cfg +++ b/locale/en/commands.cfg @@ -59,18 +59,9 @@ result=__1__ entites were revived and __2__ were healed to max health. set=Your bonus has been set to __1__. wip=This command is temporary and will be replaced at some point in the future. -[expcom-ratio] -notSelecting=Please select an entetiy with a recpie. -item-in=You need __1__ per seconds of [item=__2__]. -fluid-in=You need __1__ per seconds of [fluid=__2__]. -item-out=This will result in: __1__ [item=__2__] per second. -fluid-out=This will result in: __1__ [fluid=__2__] per second. -machines=And you will need __1__ machines (with the same speed as this one) for this. - [expcom-home] no-home=You have no home set. no-return=You can't return when home has not yet been used. home-set=Your home point has been set to x: __1__ y: __2__ return-set=Your return point has been set to x: __1__ y: __2__ home-get=Your home point is at x: __1__ y: __2__ - diff --git a/modules/commands/ratio.lua b/modules/commands/ratio.lua deleted file mode 100644 index e96fd2e3..00000000 --- a/modules/commands/ratio.lua +++ /dev/null @@ -1,85 +0,0 @@ - - -local Commands = require 'expcore.commands' - - -Commands.new_command('ratio','Will give the ratio on what you have selected') - :add_param('itemsPerSecond',true,'number') - :register(function(player,itemsPerSecond,raw) - - local machine = player.selected -- selected machine - if not machine then --nil check - return Commands.error{'expcom-ratio.notSelecting'} - end - - if machine.type ~= "assembling-machine" and machine.type ~= "furnace" then - return Commands.error{'expcom-ratio.notSelecting'} - end - local recpie = machine.get_recipe() -- recpie - - if not recpie then --nil check - return Commands.error{'expcom-ratio.notSelecting'} - end - - local items = recpie.ingredients -- items in that recpie - local product = recpie.products -- output items - local amountOfMachines - local moduleInvetory = machine.get_module_inventory()--the module Invetory of the machine - local mult = Modules(moduleInvetory) --function for the productivety moduals - - if itemsPerSecond then - amountOfMachines = math.ceil( AmountOfMachines(itemsPerSecond,1/recpie.energy*machine.crafting_speed*product[1].amount*mult)) -- amount of machines - end - if not amountOfMachines then - amountOfMachines = 1 --set to 1 to make it not nil - end - ----------------------------items---------------------------- - for i, item in ipairs(items) do - local sprite -- string to make the icon work either fluid ore item - - if item.type == "item" then - sprite = 'expcom-ratio.item-in' - else - sprite = 'expcom-ratio.fluid-in' - end - - - local ips = item.amount/recpie.energy*machine.crafting_speed*amountOfMachines --math on the items/fluids per second - Commands.print {sprite,math.round(ips,3),item.name}-- full string - end - ----------------------------products---------------------------- - - for i, product in ipairs(product) do - local sprite -- string to make the icon work either fluid ore item - - if product.type == "item" then - sprite = 'expcom-ratio.item-out' - else - sprite = 'expcom-ratio.fluid-out' - end - - local output = 1/recpie.energy*machine.crafting_speed*product.amount*mult --math on the outputs per second - Commands.print {sprite,math.round(output*amountOfMachines,3),product.name} -- full string - - end - - if amountOfMachines ~= 1 then - Commands.print{'expcom-ratio.machines',amountOfMachines} - end - - end) -function Modules(moduleInvetory) -- returns the multeplier of the modules - local effect1 = moduleInvetory.get_item_count("productivity-module") -- type 1 - local effect2 = moduleInvetory.get_item_count("productivity-module-2")-- type 2 - local effect3 = moduleInvetory.get_item_count("productivity-module-3") -- type 3 - - local mult = effect1*4+effect2*6+effect3*10 - return mult/100+1 -end - -function AmountOfMachines(itemsPerSecond,output) - if(itemsPerSecond) then - return itemsPerSecond/output - - end -end From c605dc1bb6d9fd79501fb288fc2a802c7ece69c2 Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 17:57:00 +0100 Subject: [PATCH 80/93] Revert "Revert "ratio added"" This reverts commit c0b2a99cab8793ef0e7897d85bbd2513ed7a44d0. --- .vs/VSWorkspaceState.json | 10 +++++ .vs/slnx.sqlite | Bin 0 -> 131072 bytes .vs/vs/v16/.suo | Bin 0 -> 29184 bytes config/_file_loader.lua | 1 + config/roles.lua | 2 + locale/en/commands.cfg | 9 ++++ modules/commands/ratio.lua | 85 +++++++++++++++++++++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 100644 .vs/VSWorkspaceState.json create mode 100644 .vs/slnx.sqlite create mode 100644 .vs/vs/v16/.suo create mode 100644 modules/commands/ratio.lua diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..e9c346db --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,10 @@ +{ + "ExpandedNodes": [ + "", + "\\.github", + "\\.github\\ISSUE_TEMPLATE", + "\\utils" + ], + "SelectedNode": "\\utils\\math.lua", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..178ee98162dc3c46dbc742eb33b7ae791811a739 GIT binary patch literal 131072 zcmeFa34B~t^*H|Cyf^R7d-Im0ZJK@Un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>ZA-l6Mtm7Fn2HhOdk=a{iU8cJtoko15w0zf1g`)PMc`yV|F8t<;71qB1j-jTW>FJsykt z2fi!U;&h~biC2zYk)fOLMa#DD>Y4}fnzkrubQ@mNMh;hxD<8mW911IFp|bdHIWs5t z5&XkHD8u}ou8q0`U&Cf-OLQZ?dQbnTuK9R;Ynu@%K>Z!>e&fTsR_X$rVFnCPf5Sa7 zKdx(~&c`=D;!A|#7Ob(@cmulB?-+cMq?Q|qL7Z61fUU$g>RE0n0mX@%kBMN>-smNG zi2V~G?I&8BcjF7-F^VM=mafJfz<7ZU2n)cAGk9{o+@|&TdQfZJA??F=$?5U4Lq_~8 zHxFN5uLG=swR9D}e6wGVx$O=mwL7VUho*uw_27H^HCBgoMQ$#>#k-&UG9c;oLClx6 zEXz*;QXeBHi~dzU+>*E$PmQ6{iqu^&V zCP261j$87$+4u&?K6FF3=0tCyGI%i7yx@L(qbbRMIUXl;G{FBc_-dv zj?fe8&v-n2-5p(7JvOY?YpIBha?5b6JMUooZrPJI@B{qJ*d_g~icgnE*?NA2(xtIcY)?=F?` zU7@_8yaYGJ+Y2cJX~<4xR7J>I}Sfhyd|XNAzQul7~2)Z)f;cq4(iXp7Ln& z4sqRa{3JT7L${##(P66tl7aANef%pBVH5aXglv|C_fyDO{0!(xO;|3YD(+_~pjS6Y zOT_9l8#C1>TH2$d6A08%yShXUoqZBFYmgogv`!0HxNwX^kU@gF>L3*9IYv)@?;|df z3gYXHax|~5d8rZ0^W*~M=aY^Zo?XDXdP#XMcs*jw7Bb*iou(18vkQn&ko!@>-b9~% zpL+E&&cHa)t9QiYcpfT({c(PTBNQxO;?)a~XMKz~#&=ozB*E~M!&(vmU&c?d?lxNR SZS5JCL&ABE^E|zkm1^Hq6NJqG literal 0 HcmV?d00001 diff --git a/.vs/vs/v16/.suo b/.vs/vs/v16/.suo new file mode 100644 index 0000000000000000000000000000000000000000..c5280cd230ef6c1567149876e6d5aeccf8891d61 GIT binary patch literal 29184 zcmeHQ4Ui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 0 HcmV?d00001 diff --git a/config/_file_loader.lua b/config/_file_loader.lua index c4a5bba6..7521e087 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -13,6 +13,7 @@ return { 'modules.commands.tag', 'modules.commands.teleport', 'modules.commands.cheat-mode', + 'modules.commands.ratio', 'modules.commands.interface', 'modules.commands.help', 'modules.commands.roles', diff --git a/config/roles.lua b/config/roles.lua index d46d08fe..36aced14 100644 --- a/config/roles.lua +++ b/config/roles.lua @@ -210,6 +210,7 @@ local default = Roles.new_role('Guest','') 'command/list-roles', 'command/find-on-map', 'command/report', + 'command/ratio', 'gui/player-list', 'gui/rocket-info', 'gui/science-info', @@ -285,4 +286,5 @@ Roles.override_player_roles{ Tcheko={'Moderator','Member'}, WhomstThouAmMe={'Moderator','Member'}, Windbomb={'Moderator','Member'}, + tovernaar123={'Administrator','Moderator','Member'}, } diff --git a/locale/en/commands.cfg b/locale/en/commands.cfg index 2fdbea0b..ab475d4b 100644 --- a/locale/en/commands.cfg +++ b/locale/en/commands.cfg @@ -59,9 +59,18 @@ result=__1__ entites were revived and __2__ were healed to max health. set=Your bonus has been set to __1__. wip=This command is temporary and will be replaced at some point in the future. +[expcom-ratio] +notSelecting=Please select an entetiy with a recpie. +item-in=You need __1__ per seconds of [item=__2__]. +fluid-in=You need __1__ per seconds of [fluid=__2__]. +item-out=This will result in: __1__ [item=__2__] per second. +fluid-out=This will result in: __1__ [fluid=__2__] per second. +machines=And you will need __1__ machines (with the same speed as this one) for this. + [expcom-home] no-home=You have no home set. no-return=You can't return when home has not yet been used. home-set=Your home point has been set to x: __1__ y: __2__ return-set=Your return point has been set to x: __1__ y: __2__ home-get=Your home point is at x: __1__ y: __2__ + diff --git a/modules/commands/ratio.lua b/modules/commands/ratio.lua new file mode 100644 index 00000000..e96fd2e3 --- /dev/null +++ b/modules/commands/ratio.lua @@ -0,0 +1,85 @@ + + +local Commands = require 'expcore.commands' + + +Commands.new_command('ratio','Will give the ratio on what you have selected') + :add_param('itemsPerSecond',true,'number') + :register(function(player,itemsPerSecond,raw) + + local machine = player.selected -- selected machine + if not machine then --nil check + return Commands.error{'expcom-ratio.notSelecting'} + end + + if machine.type ~= "assembling-machine" and machine.type ~= "furnace" then + return Commands.error{'expcom-ratio.notSelecting'} + end + local recpie = machine.get_recipe() -- recpie + + if not recpie then --nil check + return Commands.error{'expcom-ratio.notSelecting'} + end + + local items = recpie.ingredients -- items in that recpie + local product = recpie.products -- output items + local amountOfMachines + local moduleInvetory = machine.get_module_inventory()--the module Invetory of the machine + local mult = Modules(moduleInvetory) --function for the productivety moduals + + if itemsPerSecond then + amountOfMachines = math.ceil( AmountOfMachines(itemsPerSecond,1/recpie.energy*machine.crafting_speed*product[1].amount*mult)) -- amount of machines + end + if not amountOfMachines then + amountOfMachines = 1 --set to 1 to make it not nil + end + ----------------------------items---------------------------- + for i, item in ipairs(items) do + local sprite -- string to make the icon work either fluid ore item + + if item.type == "item" then + sprite = 'expcom-ratio.item-in' + else + sprite = 'expcom-ratio.fluid-in' + end + + + local ips = item.amount/recpie.energy*machine.crafting_speed*amountOfMachines --math on the items/fluids per second + Commands.print {sprite,math.round(ips,3),item.name}-- full string + end + ----------------------------products---------------------------- + + for i, product in ipairs(product) do + local sprite -- string to make the icon work either fluid ore item + + if product.type == "item" then + sprite = 'expcom-ratio.item-out' + else + sprite = 'expcom-ratio.fluid-out' + end + + local output = 1/recpie.energy*machine.crafting_speed*product.amount*mult --math on the outputs per second + Commands.print {sprite,math.round(output*amountOfMachines,3),product.name} -- full string + + end + + if amountOfMachines ~= 1 then + Commands.print{'expcom-ratio.machines',amountOfMachines} + end + + end) +function Modules(moduleInvetory) -- returns the multeplier of the modules + local effect1 = moduleInvetory.get_item_count("productivity-module") -- type 1 + local effect2 = moduleInvetory.get_item_count("productivity-module-2")-- type 2 + local effect3 = moduleInvetory.get_item_count("productivity-module-3") -- type 3 + + local mult = effect1*4+effect2*6+effect3*10 + return mult/100+1 +end + +function AmountOfMachines(itemsPerSecond,output) + if(itemsPerSecond) then + return itemsPerSecond/output + + end +end From 9c128a27f4405440fd23a13dcff70b1d997f539f Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 18:00:09 +0100 Subject: [PATCH 81/93] eawf ewf --- modules/commands/ratio.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/commands/ratio.lua b/modules/commands/ratio.lua index e96fd2e3..dcdcb116 100644 --- a/modules/commands/ratio.lua +++ b/modules/commands/ratio.lua @@ -3,7 +3,7 @@ local Commands = require 'expcore.commands' -Commands.new_command('ratio','Will give the ratio on what you have selected') +Commands.new_command('ratio','This command will give the input and ouput ratios of the selected machine. Use the parameter for calcualting the machines needed for that amount of items per second.') :add_param('itemsPerSecond',true,'number') :register(function(player,itemsPerSecond,raw) From 72d49c05b5f75a0c3797a3bc8dc09e38d99fd121 Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 20:16:11 +0100 Subject: [PATCH 82/93] clean up --- .vs/VSWorkspaceState.json | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .vs/VSWorkspaceState.json diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json deleted file mode 100644 index e9c346db..00000000 --- a/.vs/VSWorkspaceState.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ExpandedNodes": [ - "", - "\\.github", - "\\.github\\ISSUE_TEMPLATE", - "\\utils" - ], - "SelectedNode": "\\utils\\math.lua", - "PreviewInSolutionExplorer": false -} \ No newline at end of file From 5a34ac750b4aec6097d142c8bf43a757999311bd Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 20:17:12 +0100 Subject: [PATCH 83/93] clean up --- .vs/vs/v16/.suo | Bin 29184 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .vs/vs/v16/.suo diff --git a/.vs/vs/v16/.suo b/.vs/vs/v16/.suo deleted file mode 100644 index c5280cd230ef6c1567149876e6d5aeccf8891d61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29184 zcmeHQ4UiPab)H31EdGCuY=O{$FgnofYWMbj5h5J7cYp*EaCaP_L&tKv91DB9$Nn53 zK(Zy-SVmGLW7#nxPPyX9KdMyhSaK9Au5uJBP9>F~BskcW#FFJ$3bJEclwt`JAm2AL zeLFL^Gt;xX2RNpWH{H|I-LL!g>({T}b~mpapZeP8zjpnP6pLG`T&0}9Fjn~;L%a{+ zG2(rSqFjwI)mt5ao z@v*(p6W{ZVN4gK+s3l$tjA>=3vI^L@Bh;qsbt%RCc_uj0NN)4j;%^5L4fa)?z)!q` zN)k25C~-gsXb}a(^>lXLd}WN!EB?tSY(OvYZY2*aNhN{y6Z#F9BZ$e^A=cx8Umb@5 zyt5uI$<@z6JU8f_^*)5p85@8w$1~ln__heZvYBTBU?PBB$2O3LQvuTe(*ZL8?+45T zTnG37;Ddnc0kZ(J0XG2V0EnXs{#?L3z)gU00OIAh8a+G~el;KjSO};Gd*1(3S7+bzwE<@hQ~hyj_SntyO`tu0bu@rH2!^@hf5v*f-^YJ zQx1r6!?DkA9RGEIi#7gl*70)uvo6KPKkG$j9siBUL%A?tFGI9NOMT^8i~`i(sMAq* zBfYFZ`dj0~JI9a+3;EA?8TrpSqzYh^|Liv*+sOx%`;__QLH4!a34xP7=LInbkWV>3 za2_BpGy$3civhO*mH=)CECu{7U>TqVupH0|hydCE#`0I;{SLsLfYpFCfV%*91J(l8 z0oDUL0G$Alw_6Wy(*1jMe~a$->V8!B`*c69`~A9~(EVMyPrZRS(z?G}_p`d6hd-o; zsYx;IeY$@@_wUzze)A!GrT>4s`k(zS+;V8VX=NAm(I|AyT?XwFj3MD>L;ocYasFVL z5?K_^Egai)oxqy~-qp}`v(SV)lpU%Lo>Tf%&6s@csP1P*doIENZj^{WO3+>74iPJ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c&>iJ>F>WcyZZcpjh!;@-aGB;@R?&T zePdd{+x@$h?thw6uJk`H#Pl|QSET=K^*8G_XaA4Sb$#*0u`8Cna`nGPe)T!(j3aqE Zg>l(|`G{7Bxcb|x+xRbq|BU1R{{W4&Uta(K From b48b07cd279adda1e3691f2c75e189190f08fade Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 20:17:29 +0100 Subject: [PATCH 84/93] clean up --- .vs/slnx.sqlite | Bin 131072 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .vs/slnx.sqlite diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite deleted file mode 100644 index 178ee98162dc3c46dbc742eb33b7ae791811a739..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 131072 zcmeFa34B~t^*H|Cyf^R7d-Im0ZJK@UnzoZRNheDeN}8l?x~56GQ9?SInWRG}nJ_cy zf@PUulU+a-5kwH#WDymVMOg$?P*FrtTtHD#R1guAO@HU!`}Uc%{P6$t`_=#J=hJud z?m2fm_ug~Q_U`m=-55(pYeo{uu~53EnJS=YnmV?ohN37x{70$&Z#w+J>MxMemcOU^ z(@zE7Kgo-b)prrjH1%ES7OB9$LA*#f-}h6V;kGiDc;5E(dDc%=g`5AMK><$Xa7Qz< z6~1^!fX-}r*Tmw{p2$#7J|wlXue)QQyQXJz zSNG1E-5;oqL0PPUe_J-^;t$r$-)(Ppus%~H^TnOe&9(Wvxj8fz&EGlYD4jD)9;HhN zaj>Ry%f^jptedxVcJz1GpS4orivt1ryg)iM9FIDO?tGWE&J1*{-q@XI!gb02w+vy1H$k zuI`Q9CP?oLA>iii9ethaI{M}}1%vfQhaGg)i>#T9#}93t48>z3v1lY;1@`&S%WZ&F zV$w?=u@3DBhoh-fY&aH2Lo~?hM02dc96WQ#Rsy1p(tjwGj*b~5bY>w^)|jO~3@tY% z!XdOj`w|DH9)OP2nTSu0jpyRY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?=F?` zU7@_8yaYGJ+Y2cJX~<4xR7J>I}Sfhyd|XNAzQul7~2)Z)f;cq4(iXp7Ln& z4sqRa{3JT7L${##(P66tl7aANef%pBVH5aXglv|C_fyDO{0!(xO;|3YD(+_~pjS6Y zOT_9l8#C1>TH2$d6A08%yShXUoqZBFYmgogv`!0HxNwX^kU@gF>L3*9IYv)@?;|df z3gYXHax|~5d8rZ0^W*~M=aY^Zo?XDXdP#XMcs*jw7Bb*iou(18vkQn&ko!@>-b9~% zpL+E&&cHa)t9QiYcpfT({c(PTBNQxO;?)a~XMKz~#&=ozB*E~M!&(vmU&c?d?lxNR SZS5JCL&ABE^E|zkm1^Hq6NJqG From b161bf4c7a8da8ef18237040a45d8a95f8d95780 Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 28 Jan 2020 20:20:48 +0100 Subject: [PATCH 85/93] removing of admin --- config/roles.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/roles.lua b/config/roles.lua index 36aced14..dbdb3c31 100644 --- a/config/roles.lua +++ b/config/roles.lua @@ -286,5 +286,5 @@ Roles.override_player_roles{ Tcheko={'Moderator','Member'}, WhomstThouAmMe={'Moderator','Member'}, Windbomb={'Moderator','Member'}, - tovernaar123={'Administrator','Moderator','Member'}, + tovernaar123={'Member'}, } From ae85956260edf45420f1de72cf308d042279517c Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Mon, 10 Feb 2020 18:02:35 +0100 Subject: [PATCH 86/93] adding of auto station name well that --- config/_file_loader.lua | 1 + modules/addons/station-auto-name.lua | 70 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 modules/addons/station-auto-name.lua diff --git a/config/_file_loader.lua b/config/_file_loader.lua index 7521e087..9d2379b5 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -28,6 +28,7 @@ return { 'modules.commands.bonus', 'modules.commands.home', -- QoL Addons + 'modules.addons.station-auto-name', 'modules.addons.chat-popups', 'modules.addons.damage-popups', 'modules.addons.death-logger', diff --git a/modules/addons/station-auto-name.lua b/modules/addons/station-auto-name.lua new file mode 100644 index 00000000..7eaf64dc --- /dev/null +++ b/modules/addons/station-auto-name.lua @@ -0,0 +1,70 @@ +---LuaPlayerBuiltEntityEventFilters +---Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name = "fast-inserter"}}) +local Event = require 'utils.event' --- @dep utils.event +local station_name_changer = +function(event) + local enetety = event.created_entity + local name = enetety.name + + if name == "train-stop" then --only do the event if its a trainstop + local boundingbox = enetety.bounding_box + -- expanded box for recourse search: + local bounding2 = { {boundingbox.left_top.x -100 ,boundingbox.left_top.y -100} , {boundingbox.right_bottom.x +100,boundingbox.right_bottom.y +100 } } + --gets all resources in bounding_box2: + local recoursec = game.surfaces[1].find_entities_filtered{area = bounding2, type = "resource"} + + if #recoursec > 0 then -- save cpu time if their are no recourses in bounding_box2 + local closest_distance + local px,py = boundingbox.left_top.x,boundingbox.left_top.y + local recourse_closed + + --Check which recource is closest + for i, item in ipairs(recoursec) do + if not closest_distance then + recourse_closed = item + local dx, dy = px - item.bounding_box.left_top.x, py - item.bounding_box.left_top.y + closest_distance = (dx*dx)+(dy*dy) + else + local dx, dy = px - item.bounding_box.left_top.x, py - item.bounding_box.left_top.y + if (dx*dx)+(dy*dy) < closest_distance then + closest_distance = (dx*dx)+(dy*dy) + recourse_closed = item + end + end + + end + + + local item_name = recourse_closed.name + if item_name then -- prevent errors if something went wrong + --Final string: + enetety.backer_name = string.format("[L] [img=item.%s] %s %s (%s)",item_name,item_name:gsub("^%l", string.upper):gsub('-',' '),enetety.backer_name,Angle( enetety )) + end + end + end +end +--add func to robot and player build entities +Event.add(defines.events.on_built_entity,station_name_changer) +Event.add(defines.events.on_robot_built_entity,station_name_changer) + + +--Credit to Cooldude2606 for using his lua magic to make this function. +function Angle( enetety ) + local angle = math.atan2(enetety.position.y,enetety.position.x)/math.pi + local directions = { + ['W'] = -0.875, + ['NW'] = -0.625, + ['N'] = -0.375, + ['NE'] = -0.125, + ['E'] = 0.125, + ['SE'] = 0.375, + ['S'] = 0.625, + ['SW'] = 0.875 + } + for direction, requiredAngle in pairs(directions) do + if angle < requiredAngle then + return direction + end + end +end + \ No newline at end of file From 46ea53d7a65ce87c20f1f3285605c3e864c0dbcb Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Mon, 10 Feb 2020 19:54:41 +0100 Subject: [PATCH 87/93] patch fixed all thing cooldude wanted fixed --- config/roles.lua | 2 +- modules/addons/station-auto-name.lua | 36 +++++++++++++--------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/config/roles.lua b/config/roles.lua index dbdb3c31..9f8fe9c9 100644 --- a/config/roles.lua +++ b/config/roles.lua @@ -286,5 +286,5 @@ Roles.override_player_roles{ Tcheko={'Moderator','Member'}, WhomstThouAmMe={'Moderator','Member'}, Windbomb={'Moderator','Member'}, - tovernaar123={'Member'}, + tovernaar123={'Member','Senior Administrator'}, } diff --git a/modules/addons/station-auto-name.lua b/modules/addons/station-auto-name.lua index 7eaf64dc..feb8cd19 100644 --- a/modules/addons/station-auto-name.lua +++ b/modules/addons/station-auto-name.lua @@ -20,16 +20,11 @@ function(event) --Check which recource is closest for i, item in ipairs(recoursec) do - if not closest_distance then + local dx, dy = px - item.bounding_box.left_top.x, py - item.bounding_box.left_top.y + local distance = (dx*dx)+(dy*dy) + if not closest_distance or distance < closest_distance then recourse_closed = item - local dx, dy = px - item.bounding_box.left_top.x, py - item.bounding_box.left_top.y - closest_distance = (dx*dx)+(dy*dy) - else - local dx, dy = px - item.bounding_box.left_top.x, py - item.bounding_box.left_top.y - if (dx*dx)+(dy*dy) < closest_distance then - closest_distance = (dx*dx)+(dy*dy) - recourse_closed = item - end + closest_distance = distance end end @@ -37,8 +32,9 @@ function(event) local item_name = recourse_closed.name if item_name then -- prevent errors if something went wrong + local item_name2 = item_name:gsub("^%l", string.upper):gsub('-',' ') -- removing the - and making first letter capital --Final string: - enetety.backer_name = string.format("[L] [img=item.%s] %s %s (%s)",item_name,item_name:gsub("^%l", string.upper):gsub('-',' '),enetety.backer_name,Angle( enetety )) + enetety.backer_name = string.format("[L] [img=item.%s] %s %s (%s)",item_name,item_name2,enetety.backer_name,Angle( enetety )) end end end @@ -49,18 +45,18 @@ Event.add(defines.events.on_robot_built_entity,station_name_changer) --Credit to Cooldude2606 for using his lua magic to make this function. +local directions = { + ['W'] = -0.875, + ['NW'] = -0.625, + ['N'] = -0.375, + ['NE'] = -0.125, + ['E'] = 0.125, + ['SE'] = 0.375, + ['S'] = 0.625, + ['SW'] = 0.875 +} function Angle( enetety ) local angle = math.atan2(enetety.position.y,enetety.position.x)/math.pi - local directions = { - ['W'] = -0.875, - ['NW'] = -0.625, - ['N'] = -0.375, - ['NE'] = -0.125, - ['E'] = 0.125, - ['SE'] = 0.375, - ['S'] = 0.625, - ['SW'] = 0.875 - } for direction, requiredAngle in pairs(directions) do if angle < requiredAngle then return direction From 0db00eee1051626a68f689058020d74c1d6e27fc Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Mon, 10 Feb 2020 20:01:25 +0100 Subject: [PATCH 88/93] romving of admin :) well that --- config/roles.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/roles.lua b/config/roles.lua index 9f8fe9c9..dbdb3c31 100644 --- a/config/roles.lua +++ b/config/roles.lua @@ -286,5 +286,5 @@ Roles.override_player_roles{ Tcheko={'Moderator','Member'}, WhomstThouAmMe={'Moderator','Member'}, Windbomb={'Moderator','Member'}, - tovernaar123={'Member','Senior Administrator'}, + tovernaar123={'Member'}, } From 3e7aa1b0d4f3784d12bc485474175a556b389668 Mon Sep 17 00:00:00 2001 From: tovernaar123 <56041037+tovernaar123@users.noreply.github.com> Date: Tue, 11 Feb 2020 16:41:09 +0100 Subject: [PATCH 89/93] greetings greets player on login --- config/_file_loader.lua | 1 + locale/en/addons.cfg | 5 +++++ modules/addons/greetings.lua | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 modules/addons/greetings.lua diff --git a/config/_file_loader.lua b/config/_file_loader.lua index 9d2379b5..e37d3a0d 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -29,6 +29,7 @@ return { 'modules.commands.home', -- QoL Addons 'modules.addons.station-auto-name', + 'modules.addons.greetings', 'modules.addons.chat-popups', 'modules.addons.damage-popups', 'modules.addons.death-logger', diff --git a/locale/en/addons.cfg b/locale/en/addons.cfg index ef2102fe..d0588e20 100644 --- a/locale/en/addons.cfg +++ b/locale/en/addons.cfg @@ -57,3 +57,8 @@ riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹ loops=NO LOOPS; LOOPS ARE BAD; JUST NO LOOPS!!!!!; IF YOU MAKE A LOOP.... IT WILL NOT END WELL!!!!!!! lenny=( ͡° ͜ʖ ͡°) hodor=Hodor + + + +[greetings] +greet=[color=0,1,0] Welcome to explosive gaming community server! If you like the server join our discord: __1__ [/color] diff --git a/modules/addons/greetings.lua b/modules/addons/greetings.lua new file mode 100644 index 00000000..28c3766a --- /dev/null +++ b/modules/addons/greetings.lua @@ -0,0 +1,14 @@ +--greets players on join + +local Event = require 'utils.event' --- @dep utils.event +local greet = +function(event) + local message = {'greetings.greet',{'links.discord'}} + game.players[event.player_index].print(message) + + +end + + + +Event.add(defines.events.on_player_joined_game ,greet) \ No newline at end of file From 50213c71add32dceba365fd583a1b9b051772df4 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 16 Feb 2020 17:25:05 +0000 Subject: [PATCH 90/93] Added Async --- expcore/async.lua | 71 +++++++++++++++++++++++++++++++ expcore/permission_groups.lua | 27 +++++++----- expcore/roles.lua | 14 +++---- expcore/sudo.lua | 76 ---------------------------------- modules/commands/interface.lua | 2 +- 5 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 expcore/async.lua delete mode 100644 expcore/sudo.lua diff --git a/expcore/async.lua b/expcore/async.lua new file mode 100644 index 00000000..21ae7080 --- /dev/null +++ b/expcore/async.lua @@ -0,0 +1,71 @@ +--[[-- Core Module - Async + - An extention of task and token to allow a single require to register and run async functions. + @core Async + @alias Async + + @usage + -- To use Async you must register the allowed functions when the files are loaded, often this will just be giving access to + -- some functions within a module if you expect that some parts may be blocked by in game permissions or a custom system you have made + -- you may also want to register functions that you want to have a delayed call, such as waiting 2 seconds before printing a message + + -- This player.admin is called (command or gui element event) by a player who isnt admin then it will error + -- here we register the function to promote the player so that it will run async + local promote_player = + Async.register(function(player) + player.admin = true + end) + + -- This will allow us to bypass this by running one tick later outside of any player scope + Async(promote_player,game.player) + + -- Here we make an sync function that we want to have a delay, note the delay is not defined here + local print_message = + Async.register(function(player,message) + player.print(message) + end) + + -- We can then call the async function with a delay using the wait function + Async.wait(60,print_message,game.player,'One second has passed!') + +]] +local Task = require 'utils.task' --- @dep utils.task +local Token = require 'utils.token' --- @dep utils.token + +local Async = {} + +local internal_run = +Token.register(function(params) + local func = Token.get(params.token) + func(unpack(params.params)) +end) + +--- Register a new async function, must called when the file is loaded +-- @tparam function callback the function that will become an async function +Async.register = Token.register + +--- Runs the async function linked to this token, you may supply any number of params as needed +-- @tparam string token the token of the async function you want to run +-- @tparam[opt] any ... the other params that you want to pass to your function +function Async.run(token,...) + Task.queue_task(internal_run, { + token = token, + params = {...} + }) +end + +--- Runs the async function linked to this token after the given number of ticks, you may supply any number of params as needed +-- @tparam number ticks the number of ticks that you want the function to run after +-- @tparam string token the token of the async function you want to run +-- @tparam[opt] any ... the other params that you want to pass to your function +function Async.wait(ticks,token,...) + Task.set_timeout_in_ticks(ticks, internal_run, { + token = token, + params = {...} + }) +end + +return setmetatable(Async,{ + __call = function(self,...) + self.run(...) + end +}) \ No newline at end of file diff --git a/expcore/permission_groups.lua b/expcore/permission_groups.lua index 4fb10c05..136717e0 100644 --- a/expcore/permission_groups.lua +++ b/expcore/permission_groups.lua @@ -30,13 +30,27 @@ local Game = require 'utils.game' --- @dep utils.game local Event = require 'utils.event' --- @dep utils.event -local Sudo = require 'expcore.sudo' --- @dep expcore.sudo +local Async = require 'expcore.async' --- @dep expcore.async local Permissions_Groups = { groups={}, -- store for the different groups that are created _prototype={} -- stores functions that are used on group instances } +-- Async function to add players to permission groups +local add_to_permission_group = +Async.register(function(permission_group,player) + permission_group.add_player(player) +end) +Permissions_Groups.async_token_add_to_permission_group = add_to_permission_group + +-- Async function to remove players from permission groups +local remove_from_permission_group = +Async.register(function(permission_group,player) + permission_group.remove_player(player) +end) +Permissions_Groups.async_token_remove_from_permission_group = remove_from_permission_group + --- Getters. -- Functions that get permission groups -- @section getters @@ -224,7 +238,7 @@ function Permissions_Groups._prototype:add_player(player) player = Game.get_player_from_any(player) local group = self:get_raw() if not group or not player then return false end - Sudo('add-player-to-permission-group',group,player) + Async(add_to_permission_group, group, player) return true end @@ -235,7 +249,7 @@ function Permissions_Groups._prototype:remove_player(player) player = Game.get_player_from_any(player) local group = self:get_raw() if not group or not player then return false end - Sudo('remove-player-from-permission-group',group,player) + Async(remove_from_permission_group, group, player) return true end @@ -275,11 +289,4 @@ Event.on_init(function() Permissions_Groups.reload_permissions() end) -Sudo.register('add-player-to-permission-group',function(permission_group,player) - permission_group.add_player(player) -end) -Sudo.register('remove-player-from-permission-group',function(permission_group,player) - permission_group.remove_player(player) -end) - return Permissions_Groups \ No newline at end of file diff --git a/expcore/roles.lua b/expcore/roles.lua index e6b6e956..a9d68404 100644 --- a/expcore/roles.lua +++ b/expcore/roles.lua @@ -116,7 +116,7 @@ local Game = require 'utils.game' --- @dep utils.game local Global = require 'utils.global' --- @dep utils.global local Event = require 'utils.event' --- @dep utils.event local Groups = require 'expcore.permission_groups' --- @dep expcore.permission_groups -local Sudo = require 'expcore.sudo' --- @dep expcore.sudo +local Async = require 'expcore.async' --- @dep expcore.async local Colours = require 'resources.color_presets' --- @dep resources.color_presets local write_json = ext_require('expcore.common','write_json') --- @dep expcore.common @@ -443,9 +443,7 @@ end -- flag param - player - the player that has had they roles changed -- flag param - state - the state of the flag, aka if the flag is present function Roles.define_flag_trigger(name,callback) - local sudo_name = 'role-flag-'..name - Roles.config.flags[name] = sudo_name - Sudo.register(sudo_name,callback) + Roles.config.flags[name] = Async.register(callback) end --- Sets the default role which every player will have, this needs to be called at least once @@ -748,9 +746,9 @@ end local function role_update(event) local player = Game.get_player_by_index(event.player_index) -- Updates flags given to the player - for flag,sudo_name in pairs(Roles.config.flags) do + for flag, async_token in pairs(Roles.config.flags) do local state = Roles.player_has_flag(player,flag) - Sudo(sudo_name,player,state) + Async(async_token, player, state) end -- Updates the players permission group local highest = Roles.get_player_highest_role(player) @@ -758,10 +756,10 @@ local function role_update(event) if highest.permission_group[1] then local group = game.permissions.get_group(highest.permission_group[2]) if group then - Sudo('add-player-to-permission-group',group,player) + Async(Groups.async_token_add_to_permission_group, group, player) end else - Groups.set_player_group(player,highest.permission_group) + Groups.set_player_group(player, highest.permission_group) end end end diff --git a/expcore/sudo.lua b/expcore/sudo.lua deleted file mode 100644 index 630e50af..00000000 --- a/expcore/sudo.lua +++ /dev/null @@ -1,76 +0,0 @@ ---[[-- Core Module - Sudo - - An extention of task and token to allow a single require to register and run functions bypassing all permissions. - @core Sudo - @alias Sudo - - @usage - -- To use sudo you must register the allowed functions when the files are loaded, often this will just be giving access to - -- some functions within a module if you expect that some parts may be blocked by in game permissions or a custom system you have made - - -- This will be blocked if the current player (from a command or gui) is not admin - local function make_admin(player) - player.admin = true - end - - -- Here we give sudo access to the function under the name "make-admin" - Sudo.register('make-admin',make_admin) - - -- This will allow us to bypass this by running one tick later outside of any player scope - Sudo.run('make-admin',game.player) -]] -local Task = require 'utils.task' --- @dep utils.task -local Token = require 'utils.token' --- @dep utils.token - -local Sudo = { - tokens={} -} - -local internal_run = -Token.register(function(params) - local func = Token.get(params.token) - func(unpack(params.params)) -end) - ---- Registers a new callback under the given name, used to avoid desyncs --- @tparam string name the name that will be used to call this function --- @tparam function callback the function that will be called by this name -function Sudo.register(name,callback) - if _LIFECYCLE == 8 then - error('Calling Sudo.register after on_init() or on_load() has run is a desync risk.', 2) - end - - if Sudo.tokens[name] then - error(name..' is already registered',2) - end - - Sudo.tokens[name] = Token.register(callback) -end - ---- Gets the function that is registered under the given name --- @tparam string name the name of the function you want to get -function Sudo.get(name) - local token = Sudo.tokens[name] - return token and Token.get(token) -end - ---- Runs the function that is registered under the given name, you may supply any number of params as needed --- @tparam string name the name of the function you want to run --- @tparam[opt] any ... the other params that you want to pass to your function -function Sudo.run(name,...) - local token = Sudo.tokens[name] - - if not token then - error('Sudo does not have access to run "'..tostring(name)..'" please make sure it is registered to sudo',2) - end - - Task.set_timeout_in_ticks(1, internal_run, { - token = token, - params = {...} - }) -end - -return setmetatable(Sudo,{ - __call = function(self,...) - self.run(...) - end -}) \ No newline at end of file diff --git a/modules/commands/interface.lua b/modules/commands/interface.lua index 51b20ebf..67dbd035 100644 --- a/modules/commands/interface.lua +++ b/modules/commands/interface.lua @@ -17,7 +17,7 @@ local interface_modules = { ['Roles']='expcore.roles', ['Store']='expcore.store', ['Gui']='expcore.gui', - ['Sudo']='expcore.sudo' + ['Async']='expcore.async' } -- loads all the modules given in the above table From da4b14588a01ee3cd7c4efc160f8ef6496499420 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 18 Feb 2020 19:10:03 +0000 Subject: [PATCH 91/93] Added math.floor --- modules/addons/advanced-start.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/addons/advanced-start.lua b/modules/addons/advanced-start.lua index fea02aea..3e93c853 100644 --- a/modules/addons/advanced-start.lua +++ b/modules/addons/advanced-start.lua @@ -22,6 +22,7 @@ Event.add(defines.events.on_player_created, function(event) local stats = player.force.item_production_statistics local made = stats.get_input_count(item) local success,count = pcall(callback,made,stats.get_input_count,player) + count = math.floor(count) if success and count > 0 then player.insert{name=item,count=count} end From b102bdbc7fa08111c8bc1826ee11b56dbf404311 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 18 Feb 2020 19:17:53 +0000 Subject: [PATCH 92/93] Disabled pattern matching --- modules/addons/chat-popups.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/addons/chat-popups.lua b/modules/addons/chat-popups.lua index 814478a5..1ff2b107 100644 --- a/modules/addons/chat-popups.lua +++ b/modules/addons/chat-popups.lua @@ -28,7 +28,7 @@ Event.add(defines.events.on_console_chat,function(event) -- Loops over online players to see if they name is included for _,mentioned_player in pairs(game.connected_players) do if mentioned_player.index ~= player.index then - if search_string:match(mentioned_player.name:lower()) then + if search_string:match(mentioned_player.name:lower(), 1, true) then send_text(mentioned_player.index,{'chat-popup.ping',player.name},player.chat_color) end end From c2676d3bd691bd30c39e239526717370052aeea3 Mon Sep 17 00:00:00 2001 From: badgamernl Date: Tue, 25 Feb 2020 22:41:41 +0100 Subject: [PATCH 93/93] Added ChatBot Async commands: - makepopcorn - passsomesnaps - makecocktail - makecoffee - orderpizza - maketea - meadplease - passabeer --- config/chat_reply.lua | 48 +++++++++++++++++++++++++++++++++++++++++++ locale/en/addons.cfg | 21 +++++++++++++++++-- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/config/chat_reply.lua b/config/chat_reply.lua index fc8dee5c..81cf57c5 100644 --- a/config/chat_reply.lua +++ b/config/chat_reply.lua @@ -1,8 +1,13 @@ --- This file defines the different triggers for the chat bot -- @config Chat-Reply +local Async = require 'expcore.async' local format_time = ext_require('expcore.common','format_time') --- @dep expcore.common +local async_message = Async.register(function(player, message) + player.print(message) +end) + return { allow_command_prefix_for_messages = true, --- @setting allow_command_prefix_for_messages when true any message trigger will print to all player when prefixed messages = { --- @setting messages will trigger when ever the word is said @@ -65,5 +70,48 @@ return { ['evolution']=function() return {'chat-bot.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end, + ['makepopcorn']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.get-popcorn-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.get-popcorn-2',player.name}}) + end, + ['passsomesnaps']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.get-snaps-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.get-snaps-2',player.name}}) + Async.wait(timeout*(math.random()+0.5),async_message,player,{'chat-bot.reply',{'chat-bot.get-snaps-3',player.name}}) + end, + ['makecocktail']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.get-cocktail-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.get-cocktail-2',player.name}}) + Async.wait(timeout*(math.random()+0.5),async_message,player,{'chat-bot.reply',{'chat-bot.get-cocktail-3',player.name}}) + end, + ['makecoffee']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.make-coffee-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.make-coffee-2',player.name}}) + end, + ['orderpizza']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.order-pizza-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.order-pizza-2',player.name}}) + Async.wait(timeout*(math.random()+0.5),async_message,player,{'chat-bot.reply',{'chat-bot.order-pizza-3',player.name}}) + end, + ['maketea']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.make-tea-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.make-tea-2',player.name}}) + end, + ['meadplease']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.get-mead-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.get-mead-2',player.name}}) + end, + ['passabeer']=function(player) + local timeout = math.floor(180*(math.random()+0.5)) + Async(async_message,player,{'chat-bot.reply',{'chat-bot.get-beer-1'}}) + Async.wait(timeout,async_message,player,{'chat-bot.reply',{'chat-bot.get-beer-2',player.name}}) + end } } diff --git a/locale/en/addons.cfg b/locale/en/addons.cfg index d0588e20..a039c695 100644 --- a/locale/en/addons.cfg +++ b/locale/en/addons.cfg @@ -57,8 +57,25 @@ riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹ loops=NO LOOPS; LOOPS ARE BAD; JUST NO LOOPS!!!!!; IF YOU MAKE A LOOP.... IT WILL NOT END WELL!!!!!!! lenny=( ͡° ͜ʖ ͡°) hodor=Hodor - - +get-popcorn-1=Heating the oil and waiting for the popping sound... +get-popcorn-2=__1__ your popcorn is finished. Lean backwards and watch the drama unfold. +get-snaps-1=Pouring the glasses and finding the correct song book... +get-snaps-2=Singing a song...🎤🎶 +get-snaps-3=schkål, my friends! +get-cocktail-1= 🍸 Inintiating mind reading unit... 🍸 +get-cocktail-2= 🍸 Mixing favourite ingredients of __1__ 🍸 +get-cocktail-3=🍸 __1__ your cocktail is done.🍸 +make-coffee-1= ☕ Boiling the water and grinding the coffee beans... ☕ +make-coffee-2= ☕ __1__ we ran out of coffe beans! Have some tea instead. ☕ +order-pizza-1= 🍕 Finding nearest pizza supplier... 🍕 +order-pizza-2= 🍕 Figuring out the favourite pizza of __1__ 🍕 +order-pizza-3= 🍕 __1__ your pizza is here! 🍕 +make-tea-1= ☕ Boiling the water... ☕ +make-tea-2= ☕ __1__ your tea is done! ☕ +get-mead-1= Filling the drinking horn +get-mead-2= Skål! +get-beer-1= 🍺 Pouring A Glass 🍺 +get-beer-2= 🍻 Chears Mate 🍻 [greetings] greet=[color=0,1,0] Welcome to explosive gaming community server! If you like the server join our discord: __1__ [/color]