diff --git a/config/action_buttons.lua b/config/action_buttons.lua index d190030f..a98208f3 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -7,9 +7,9 @@ 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 Warnings = require 'modules.addons.warnings-control' -local Jail = require 'modules.addons.jail-control' +local Reports = require 'modules.control.reports' +local Warnings = require 'modules.control.warnings' +local Jail = require 'modules.control.jail' local Colors = require 'resources.color_presets' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') @@ -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 @@ -135,7 +135,7 @@ local function warn_player_callback(player,reason) local action_player_name,action_player_name_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_warnings(action_player_name,player.name) + Warnings.add_warning(action_player_name,player.name,reason) end -- jails the action player, requires a reason @@ -146,7 +146,7 @@ Gui.new_button() :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 Roles.player_has_role(action_player_name,'Jail') then + if Jail.is_jailed(action_player_name) then player.print({'expcom-jail.already-jailed',action_player_name_color},Colors.orange_red) else Store.set(action_name_store,player.name,'command/jail') @@ -157,7 +157,7 @@ local function jail_player_callback(player,reason) local action_player_name,action_player_name_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) + Jail.jail_player(action_player_name,player.name,reason) end -- temp bans the action player, requires a reason @@ -168,7 +168,7 @@ Gui.new_button() :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 Roles.player_has_role(action_player_name,'Jail') then + if Jail.is_jailed(action_player_name) then player.print({'expcom-jail.already-banned',action_player_name_color},Colors.orange_red) else Store.set(action_name_store,player.name,'command/temp-ban') diff --git a/config/science.lua b/config/science.lua index 3cd3ce5f..f3ee8939 100644 --- a/config/science.lua +++ b/config/science.lua @@ -1,8 +1,8 @@ -- config file for the science info gui return { -- list of all science packs to be shown in the gui show_eta=true, -- when true the eta for research completion will be shown - required_for_green=5, -- the amount required for the text to show as green - required_for_red=-5, -- the amount required for the text to show as red + color_clamp=5, -- the amount required for the text to show as green or red + color_flux=0.1, -- the ammount of flucuation allowed in production before icon change 'automation-science-pack', 'logistic-science-pack', 'military-science-pack', diff --git a/config/warnings.lua b/config/warnings.lua index 7fd627a4..73696544 100644 --- a/config/warnings.lua +++ b/config/warnings.lua @@ -14,6 +14,6 @@ return { game.ban_player(player,{'warnings.received',by_player_name,number_of_warnings,{'warnings.ban',{'links.website'}}}) end }, - temp_warning_cool_down=30, -- time for a temp warning (given by script) to be removed (in minutes) - temp_warning_limit=5 -- the number of temp warnings (given by script) that are allowed before full warnings are given + script_warning_cool_down=30, -- time for a script warning (given by script) to be removed (in minutes) + script_warning_limit=5 -- the number of script warnings (given by script) that are allowed before full warnings are given } \ No newline at end of file diff --git a/doc/config.ld b/doc/config.ld new file mode 100644 index 00000000..79ac9eed --- /dev/null +++ b/doc/config.ld @@ -0,0 +1,98 @@ +file = '../' +dir = '../doc' +project = 'ExpGaming Scenario' +title = 'ExpGaming Scenario' +description = 'Explosive Gaming\'s server scenario for 0.17' + +convert_opt = true +sort = false +not_luadoc = true +no_lua_ref = true +template_escape = ">" +topics = {"../README.md", "../LICENSE"} +style = '../doc' +template = '../doc' +no_space_before_args = true + +new_type("core", "Core", true) +new_type("addon", "Addons", true) +new_type("commands", "Commands", true) +new_type("control", "Control", true) +new_type("gui", "Guis", true) +new_type("config", "Configs", true) + +new_type("dep", "Dependencies", false) +new_type("event", "Events", false, "Event Parameters") +new_type("command", "Commands", false, "Command 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/control/Jail.html b/doc/control/Jail.html new file mode 100644 index 00000000..d4e42066 --- /dev/null +++ b/doc/control/Jail.html @@ -0,0 +1,1172 @@ + + + + + + + + Jail control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Jail control

+

Control Module - Jail + - Adds a way to jail players and temp ban players.

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Jail = require 'modules.control.jail'
+
+    -- This will move 'MrBiter' to the jail role and remove all other roles from them
+    -- the player name and reason are only so they can be included in the event for user feedback
+    Jail.jail_player('MrBiter','Cooldude2606','Likes biters too much')
+
+    -- This will give 'MrBiter' all his roles back and remove him from jail
+    -- again as above the player name is only used in the event for user feedback
+    Jail.unjail_player('MrBiter','Cooldude2606')
+
+    -- Temp ban works the same as jail but will store the reason and move the players items to spawn
+    -- this is meant to be used as a more permiment jail but not as strong as a ban
+    Jail.temp_ban_player('MrBiter','Cooldude2606','Likes biters too much')
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + +
expcore.rolesAllows moving players into the jail role
utils.gameAllows accessing a player from any value
utils.globalAllows storing data in the global table
expcore.commonUse of move_items to clear inventroies
+ + +

Events

+ + + + + + + + + + + + + + + + + + + + +
on_player_jailedWhen a player is assigned to jail
on_player_unjailedWhen a player is unassigned from jail
on_player_temp_bannedWhen a player is temp banned
on_player_untemp_bannedWhen a temp ban is removed from a player
+ + +

Jail

+ + + + + + + + + + + + + + + + +
is_jailed(player)Checks if the player is currently in jail
jail_player(player, by_player_name[, reason='Non given.'])Moves a player to jail and removes all other roles
unjail_player(player, by_player_name)Moves a player out of jail and restores all roles previously removed
+ + +

Temp ban

+ + + + + + + + + + + + + + + + +
is_temp_banned(player)Checks if a player is temp banned
temp_ban_player(player, by_player_name[, reason='Non given.'])Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn
untemp_ban_player(player, by_player_name)Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.roles +
+
+
+
+ +

Allows moving players into the jail role

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.game +
+
+
+
+ +

Allows accessing a player from any value

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing data in the global table

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + expcore.common +
+
+
+
+ +

Use of move_items to clear inventroies

+

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

Events

+
+
+
+
+ # + on_player_jailed +
+
+
+
+ +

When a player is assigned to jail

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was jailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who jailed the other player + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was jailed + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_player_unjailed +
+
+
+
+ +

When a player is unassigned from jail

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was unjailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who unjailed the other player + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_player_temp_banned +
+
+
+
+ +

When a player is temp banned

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was temp banned + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who temp banned the other player + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was temp banned + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_player_untemp_banned +
+
+
+
+ +

When a temp ban is removed from a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was untemp banned + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who untemp banned the other player + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Jail

+
+
+
+
+ # + is_jailed(player) +
+
+
+
+ +

Checks if the player is currently in jail

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to check if they are in jail + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player is currently in jail +
  • +
+ + + + + + + + + +
+
+
+
+ # + jail_player(player, by_player_name[, reason='Non given.']) +
+
+
+
+ +

Moves a player to jail and removes all other roles

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player who will be jailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the jailing + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being jailed + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + wheather the user was jailed successfully +
  • +
+ + + + + + + + + +
+
+
+
+ # + unjail_player(player, by_player_name) +
+
+
+
+ +

Moves a player out of jail and restores all roles previously removed

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will be unjailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player that is doing the unjail + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player was unjailed successfully +
  • +
+ + + + + + + + + +
+
+

Temp ban

+
+
+
+
+ # + is_temp_banned(player) +
+
+
+
+ +

Checks if a player is temp banned

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to check if they are temp banned + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player is temp banned +
  • +
+ + + + + + + + + +
+
+
+
+ # + temp_ban_player(player, by_player_name[, reason='Non given.']) +
+
+
+
+ +

Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will be temp banned + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the temp ban + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being temp banned + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player was successfully temp banned +
  • +
+ + + + + + + + + +
+
+
+
+ # + untemp_ban_player(player, by_player_name) +
+
+
+
+ +

Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player who is being removed from temp ban + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the untemp ban + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player was successfully removed +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/control/Production.html b/doc/control/Production.html new file mode 100644 index 00000000..acb4cdbc --- /dev/null +++ b/doc/control/Production.html @@ -0,0 +1,1287 @@ + + + + + + + + Production control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Production control

+

Control Module - Production + - Common functions used to track production of items

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Production = require 'modules.control.production'
+
+    -- This will return the less precise index from the one given
+    -- this means that one_second will return one_minute or ten_hours will return fifty_hours
+    -- the other precision work like wise
+    Production.precision_up(defines.flow_precision_index.one_second)
+
+    -- The get production function is used to get production, consumion and net
+    -- it may be used for any item and with any precision level, use total for total
+    Production.get_production(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
+
+    -- The fluctuations works by compearing recent production with the average over time
+    -- again any precision may be used, apart from one_thousand_hours as there would be no valid average
+    Production.get_fluctuations(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
+
+    -- ETA is calculated based on what function you use but all share a similar method
+    -- for production eta it will take current production average given by the precision
+    -- and work out how many ticks it will require to make the required amount (1000 by default)
+    Production.get_production_eta(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute,250000)
+
+    -- Both get_color and format_number are helper functions to help format production stats
+    -- get_color will return green,orange,red,or grey based on the active_value
+    -- the passive_value is used when active_value is 0 and can only return orange,red,or grey
+    Production.get_color(clamp,active_value,passive_value)
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + +
resources.color_presetsProvides colors for Production.get_color
utilProvides format_number function to add surfixs
+ + +

Precision

+ + + + + + + + + + + + + + + + +
precision_up(precision)Gets the next lesser precision index value, eg 1 second -> 1 minute
precision_down(precision)Gets the next greater precision index value, eg 1 minute -> 1 second
precision_ticks(precision)Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks
+ + +

Statistics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_production_total(force, item_name)Returns the production data for the whole game time
get_production(force, item_name, precision)Returns the production data for the given precision game time
get_fluctuations(force, item_name, precision)Returns the current fluctuation from the average
get_production_eta(force, item_name, precision[, required=1000])Returns the amount of ticks required to produce a certain amount
get_consumsion_eta(force, item_name, precision[, required=1000])Returns the amount of ticks required to consume a certain amount
get_net_eta(force, item_name, precision[, required=1000])Returns the amount of ticks required to produce but not consume a certain amount
+ + +

Formating

+ + + + + + + + + + + + +
get_color(clamp, active_value, passive_value)Returns a color value bassed on the value that was given
format_number(value)Returns three parts used to format a number
+ + +
+ + +

Dependencies

+
+
+
+
+ # + resources.color_presets +
+
+
+
+ +

Provides colors for Production.get_color

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + util +
+
+
+
+ +

Provides format_number function to add surfixs

+

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

Precision

+
+
+
+
+ # + precision_up(precision) +
+
+
+
+ +

Gets the next lesser precision index value, eg 1 second -> 1 minute

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + precision_down(precision) +
+
+
+
+ +

Gets the next greater precision index value, eg 1 minute -> 1 second

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + precision_ticks(precision) +
+
+
+
+ +

Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks

+

+ + + Parameters: + + + + + + + Returns: +
    +
  • + (number) + the number of ticks in this time +
  • +
+ + + + + + + + + +
+
+

Statistics

+
+
+
+
+ # + get_production_total(force, item_name) +
+
+
+
+ +

Returns the production data for the whole game time

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains total made, used and net +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_production(force, item_name, precision) +
+
+
+
+ +

Returns the production data for the given precision game time

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains made, used and net +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_fluctuations(force, item_name, precision) +
+
+
+
+ +

Returns the current fluctuation from the average

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains made, used and net +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_production_eta(force, item_name, precision[, required=1000]) +
+
+
+
+ +

Returns the amount of ticks required to produce a certain amount

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + + + + +
  • + + required + + : + + (number) + + the number of items that are required to be made + + (default: 1000) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to produce this ammount of items +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_consumsion_eta(force, item_name, precision[, required=1000]) +
+
+
+
+ +

Returns the amount of ticks required to consume a certain amount

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + + + + +
  • + + required + + : + + (number) + + the number of items that are required to be consumed + + (default: 1000) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to consume this ammount of items +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_net_eta(force, item_name, precision[, required=1000]) +
+
+
+
+ +

Returns the amount of ticks required to produce but not consume a certain amount

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + + + + +
  • + + required + + : + + (number) + + the number of items that are required to be made but not used + + (default: 1000) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to produce, but not use, this ammount of items +
  • +
+ + + + + + + + + +
+
+

Formating

+
+
+
+
+ # + get_color(clamp, active_value, passive_value) +
+
+
+
+ +

Returns a color value bassed on the value that was given

+

+ + + Parameters: + +
    + + + + + +
  • + + clamp + + : + + (number) + + value which seperates the different colours + +
  • + + + + + +
  • + + active_value + + : + + (number) + + first value tested, tested against clamp + +
  • + + + + + +
  • + + passive_value + + : + + (number) + + second value tested, tested against 0 + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains r,g,b keys +
  • +
+ + + + + + + + + +
+
+
+
+ # + format_number(value) +
+
+
+
+ +

Returns three parts used to format a number

+

+ + + Parameters: + +
    + + + + + +
  • + + value + + : + + (number) + + the value to format + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the sign for the number +
  • +
  • + (string) + the surfix for any unit used +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/control/Reports.html b/doc/control/Reports.html new file mode 100644 index 00000000..f013b057 --- /dev/null +++ b/doc/control/Reports.html @@ -0,0 +1,1036 @@ + + + + + + + + Reports control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Reports control

+

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

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Reports = require 'modules.control.reports'
+
+    -- 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
+
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + +
utils.gameAllows getting player from any value
utils.globalAllows storing of data in global table
+ + +

Events

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

Getters

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

Setters

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

Dependencies

+
+
+
+
+ # + utils.game +
+
+
+
+ +

Allows getting player from any value

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing of data in global table

+

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

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 + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Getters

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+

Setters

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/control/Rockets.html b/doc/control/Rockets.html new file mode 100644 index 00000000..58c6133b --- /dev/null +++ b/doc/control/Rockets.html @@ -0,0 +1,945 @@ + + + + + + + + Rockets control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Rockets control

+

Control Module - Rockets + - Stores rocket stats for each force.

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Rockets = require 'modules.control.rockets'
+
+    -- Some basic information is stored for each silo that has been built
+    -- the data includes: the tick it was built, the rockets launched from it and more
+    Rockets.get_silo_data(rocket_silo_entity)
+
+    -- Some information is also stored for each force
+    Rockets.get_stats('player')
+
+    -- You can get the rocket data for all silos for a force by using get_silos
+    Rockets.get_silos('player')
+
+    -- You can get the launch time for a rocket, meaning what game tick the 50th rocket was launched
+    Rockets.get_rocket_time('player',50)
+
+    -- The rolling average will work out the time to launch one rocket based on the last X rockets
+    Rockets.get_rolling_average('player',10)
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + +
utils.eventAllows registering event handlers
utils.globalAllows storing in the global table
config.rocketsContains the config for this module
+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_silo_data(silo)Gets the silo data for a given silo entity
get_silo_data_by_name(silo_name)Gets the silo data for a given silo entity
get_silo_entity(silo_name)Gets the silo entity from its silo name, reverse to get_silo_data
get_stats(force_name)Gets the rocket stats for a force
get_silos(force_name)Gets all the rocket silos that belong to a force
get_rocket_time(force_name, rocket_number)Gets the launch time of a given rocket, due to cleaning not all counts are valid
get_rocket_count(force_name)Gets the number of rockets that a force has launched
get_game_rocket_count()Gets the total number of rockets launched by all forces
get_rolling_average(force_name, count)Gets the rolling average time to launch a rocket
+ + +

Fields

+ + + + + + + + +
silo_data.launchedAdds this 1 to the launch count for this silo
+ + +
+ + +

Dependencies

+
+
+
+
+ # + utils.event +
+
+
+
+ +

Allows registering event handlers

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing in the global table

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + config.rockets +
+
+
+
+ +

Contains the config for this module

+

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

Functions

+
+
+
+
+ # + get_silo_data(silo) +
+
+
+
+ +

Gets the silo data for a given silo entity

+

+ + + Parameters: + +
    + + + + + +
  • + + silo + + : + + (LuaEntity) + + the rocket silo entity + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the data table for this silo, contains rockets launch, silo status, and its force +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_silo_data_by_name(silo_name) +
+
+
+
+ +

Gets the silo data for a given silo entity

+

+ + + Parameters: + +
    + + + + + +
  • + + silo_name + + : + + (string) + + the silo name that is stored in its data + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the data table for this silo, contains rockets launch, silo status, and its force +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_silo_entity(silo_name) +
+
+
+
+ +

Gets the silo entity from its silo name, reverse to get_silo_data

+

+ + + Parameters: + +
    + + + + + +
  • + + silo_name + + : + + (string) + + the silo name that is stored in its data + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaEntity) + the rocket silo entity +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_stats(force_name) +
+
+
+
+ +

Gets the rocket stats for a force

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to get the stats for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the table of stats for the force +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_silos(force_name) +
+
+
+
+ +

Gets all the rocket silos that belong to a force

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to get the silos for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of silo data that all belong to this force +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_rocket_time(force_name, rocket_number) +
+
+
+
+ +

Gets the launch time of a given rocket, due to cleaning not all counts are valid

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to get the count for + +
  • + + + + + +
  • + + rocket_number + + : + + (number) + + the number of the rocket to get the launch time for + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the game tick that the rocket was lanuched on +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_rocket_count(force_name) +
+
+
+
+ +

Gets the number of rockets that a force has launched

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to get the count for + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of rockets that the force has launched +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_game_rocket_count() +
+
+
+
+ +

Gets the total number of rockets launched by all forces

+

+ + + + + + Returns: +
    +
  • + (number) + the total number of rockets launched this game +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_rolling_average(force_name, count) +
+
+
+
+ +

Gets the rolling average time to launch a rocket

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to get the average for + +
  • + + + + + +
  • + + count + + : + + (number) + + the distance to get the rolling average over + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to launch one rocket +
  • +
+ + + + + + + + + +
+
+

Fields

+
+
+
+
+ # + silo_data.launched +
+
+
+
+ +

Adds this 1 to the launch count for this silo

+

+ + + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/control/Tasks.html b/doc/control/Tasks.html new file mode 100644 index 00000000..7c59bb8f --- /dev/null +++ b/doc/control/Tasks.html @@ -0,0 +1,1000 @@ + + + + + + + + Tasks control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Tasks control

+

Control Module - Tasks + - Stores tasks for each force.

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Tasks = require 'modules.control.tasks'
+
+    -- To create a new task all you need is the name of the force you want to add the task to
+    -- you can give a place to add it but this is optional
+    Tasks.new_task('player')
+
+    -- You can then update this task to what ever value that you want
+    -- the task id is returned by new_task, or within an update handler
+    -- if a player name is not given that it will assume '<server>'
+    Tasks.update_task(task_id,'My number one task!','Cooldude2606')
+
+    -- You can then remove the task and all data linked with it
+    Tasks.remove_task(task_id)
+
+    -- set_editing and is_editing may be used to block other or provide warnings
+    -- none of this is enforced by this module and so you must do so in your own module
+    Tasks.set_editing(task_id,'Cooldude2606',true)
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + +
expcore.storeAllows storing of task ids
utils.globalAllows storing in the global table
utils.tokenAllows non conflicting task ids
+ + +

Getters

+ + + + + + + + + + + + + + + + + + + + +
get_task(task_id)Gets the task stored at this id
get_details(task_id)Gets the task details stored at this id
get_force_tasks(force_name)Gets the task ids for a force
is_editing(task_id, player_name)Gets if a player is currently editing this task
+ + +

Setters

+ + + + + + + + + + + + + + + + + + + + + + + + +
add_handler(callback)Adds a new handler for when a task is updated
new_task(force_name[, task_number][, player_name])Adds a new task for a force, with option to place it in a certain order
remove_task(task_id)Removes a task and all data linked with it
update_task(task_id, task[, player_name='server'])Updates a task message
set_editing(task_id, player_name[, state])Sets a player to be editing this task, used with is_editing
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.store +
+
+
+
+ +

Allows storing of task ids

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing in the global table

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.token +
+
+
+
+ +

Allows non conflicting task ids

+

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

Getters

+
+
+
+
+ # + get_task(task_id) +
+
+
+
+ +

Gets the task stored at this id

+

+ + + Parameters: + +
    + + + + + +
  • + + task_id + + : + + (string) + + the uid of the task you want to get + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the task message that was stored here +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_details(task_id) +
+
+
+
+ +

Gets the task details stored at this id

+

+ + + Parameters: + +
    + + + + + +
  • + + task_id + + : + + (string) + + the uid of the task you want to get + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the task details that was stored here +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_force_tasks(force_name) +
+
+
+
+ +

Gets the task ids for a force

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force that you want the ids for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of all the task ids +
  • +
+ + + + + + + + + +
+
+
+
+ # + is_editing(task_id, player_name) +
+
+
+
+ +

Gets if a player is currently editing this task

+

+ + + Parameters: + +
    + + + + + +
  • + + task_id + + : + + (string) + + the uid of the task you want to check + +
  • + + + + + +
  • + + player_name + + : + + (string) + + the name of the player that you want to check + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + weather the player is currently editing this task +
  • +
+ + + + + + + + + +
+
+

Setters

+
+
+
+
+ # + add_handler(callback) +
+
+
+
+ +

Adds a new handler for when a task is updated

+

+ + + Parameters: + +
    + + + + + +
  • + + callback + + : + + (function) + + the callback which is ran when a task is updated + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if the callback was added +
  • +
+ + + + + + + + + +
+
+
+
+ # + new_task(force_name[, task_number][, player_name]) +
+
+
+
+ +

Adds a new task for a force, with option to place it in a certain order

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to add the task for + +
  • + + + + + +
  • + + task_number + + : + + (number) + + the order place to add the task to, adds to end if omited + + (optional) +
  • + + + + + +
  • + + player_name + + : + + (string) + + when given this player will be added to the editing list + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the uid of the task which was created +
  • +
+ + + + + + + + + +
+
+
+
+ # + remove_task(task_id) +
+
+
+
+ +

Removes a task and all data linked with it

+

+ + + Parameters: + +
    + + + + + +
  • + + task_id + + : + + (string) + + the uid of the task which you want to remove + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + update_task(task_id, task[, player_name='server']) +
+
+
+
+ +

Updates a task message

+

+ + + Parameters: + +
    + + + + + +
  • + + task_id + + : + + (string) + + the uid of the task that you want to update + +
  • + + + + + +
  • + + task + + : + + (string) + + the message that you want to change the task to + +
  • + + + + + +
  • + + player_name + + : + + (string) + + the name of the player who made the edit + + (default: 'server') +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + set_editing(task_id, player_name[, state]) +
+
+
+
+ +

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

+

+ + + Parameters: + +
    + + + + + +
  • + + task_id + + : + + (string) + + the uid of the task 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) +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/control/Warnings.html b/doc/control/Warnings.html new file mode 100644 index 00000000..5eea7b5d --- /dev/null +++ b/doc/control/Warnings.html @@ -0,0 +1,1429 @@ + + + + + + + + Warnings control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Warnings control

+

Control Module - Warnings + - Adds a way to give and remove warnings to players.

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Warnings = require 'modules.control.warnings'
+
+    -- This will add a warning to the player
+    Warnings.add_warning('MrBiter','Cooldude2606','Killed too many biters')
+
+    -- This will remove a warning from a player, second name is just who is doing the action
+    Warnings.remove_warning('MrBiter','Cooldude2606')
+
+    -- Script warning as similar to normal warning but are designed to have no effect for a short amount of time
+    -- this is so it can be used for greifer protection without being too agressive
+    Warnings.add_script_warning('MrBiter','Killed too many biters')
+
+    -- Both normal and script warnings can also be cleared, this will remove all warnings
+    Warnings.clear_warnings('MrBiter','Cooldude2606')
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + +
utils.eventAllows registering of custom events
utils.gameAllows getting player from any value
utils.globalAllows storing in the global table
config.warningsConfig file for this module
+ + +

Events

+ + + + + + + + + + + + + + + + + + + + +
on_warning_addedWhen a warning is added to a player
on_warning_removedWhen a warning is removed from a player
on_script_warning_addedWhen a warning is added to a player, by the script
on_script_warning_removedWhen a warning is remnoved from a player, by the script
+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_warnings(player)Gets an array of warnings that the player has, always returns a list even if emtpy
count_warnings(player)Gets the number of warnings that a player has on them
add_warning(player, by_player_name[, reason='Non given.'])Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file
remove_warning(player, by_player_name)Removes a warning from a player, always removes the earlyist warning, fifo
clear_warnings(player, by_player_name)Removes all warnings from a player, will trigger remove event for each warning
get_script_warnings(player)Gets an array of all the script warnings that a player has
count_script_warnings(player)Gets the number of script warnings that a player has on them
add_script_warning(player[, reason='Non given.'])Adds a script warning to a player, this may add a full warning if max script warnings is met
remove_script_warning(player)Removes a script warning from a player
clear_script_warnings(player)Removes all script warnings from a player, emits event for each warning removed
+ + +
+ + +

Dependencies

+
+
+
+
+ # + utils.event +
+
+
+
+ +

Allows registering of custom events

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.game +
+
+
+
+ +

Allows getting player from any value

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing in the global table

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + config.warnings +
+
+
+
+ +

Config file for this module

+

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

Events

+
+
+
+
+ # + on_warning_added +
+
+
+
+ +

When a warning is added to a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who recived the warning + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who gave the warning + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was given a warning + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_warning_removed +
+
+
+
+ +

When a warning is removed from a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who is having the warning removed + +
  • + + + + + +
  • + + warning_by_name + + : + + (string) + + the name of the player who gave the warning + +
  • + + + + + +
  • + + removed_by_name + + : + + (string) + + the name of the player who is removing the warning + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_script_warning_added +
+
+
+
+ +

When a warning is added to a player, by the script

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who recived the warning + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was given a warning + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_script_warning_removed +
+
+
+
+ +

When a warning is remnoved from a player, by the script

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who is having the warning removed + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Functions

+
+
+
+
+ # + get_warnings(player) +
+
+
+
+ +

Gets an array of warnings that the player has, always returns a list even if emtpy

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the warning for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of all the warnings on this player, contains tick, by_player_name and reason +
  • +
+ + + + + + + + + +
+
+
+
+ # + count_warnings(player) +
+
+
+
+ +

Gets the number of warnings that a player has on them

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to count the warnings for + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + add_warning(player, by_player_name[, reason='Non given.']) +
+
+
+
+ +

Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to add a warning to + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being warned + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + remove_warning(player, by_player_name) +
+
+
+
+ +

Removes a warning from a player, always removes the earlyist warning, fifo

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to remove a warning from + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + clear_warnings(player, by_player_name) +
+
+
+
+ +

Removes all warnings from a player, will trigger remove event for each warning

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to clear the warnings from + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true when warnings were cleared succesfully +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_script_warnings(player) +
+
+
+
+ +

Gets an array of all the script warnings that a player has

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the script warnings of + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + a table of all the script warnings a player has, contains tick and reason +
  • +
+ + + + + + + + + +
+
+
+
+ # + count_script_warnings(player) +
+
+
+
+ +

Gets the number of script warnings that a player has on them

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to count the script warnings of + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of script warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + add_script_warning(player[, reason='Non given.']) +
+
+
+
+ +

Adds a script warning to a player, this may add a full warning if max script warnings is met

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to add a script warning to + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being warned + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of script warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + remove_script_warning(player) +
+
+
+
+ +

Removes a script warning from a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to remove a script warning from + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of script warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + clear_script_warnings(player) +
+
+
+
+ +

Removes all script warnings from a player, emits event for each warning removed

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to clear the script warnings from + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/control/Warps.html b/doc/control/Warps.html new file mode 100644 index 00000000..a4d89c30 --- /dev/null +++ b/doc/control/Warps.html @@ -0,0 +1,1380 @@ + + + + + + + + Warps control + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Warps control

+

Control Module - Warps + - Stores warps for each force.

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Warps = require 'modules.control.warps'
+
+    -- 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})
+
+    -- You can then update the warp information, name and icon, with the update function
+    Warps.update_warp(warp_id,'Best Warp','iron-plate')
+
+    -- 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)
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + + + + + +
expcore.storeAllows storing of warp ids
utils.globalAllows storing of warp details
utils.tokenAllows non conflicting warp ids
expcore.storeConfig for the warps
expcore.commonAccess to table_values and table_keysort
+ + +

Getters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_warp_name(warp_id)Gets the name of a warp
get_warp_icon(warp_id)Gets the icon of a warp
get_details(warp_id)Gets the task details stored at this id
get_warps(force_name)Gets all warps for a force
get_all_warps()Gets all warps from all forces
is_editing(warp_id, player_name)Gets if a player is currently editing this warp
teleport_player(warp_id, player)Teleports a player to a warp point
+ + +

Setters

+ + + + + + + + + + + + + + + + +
add_handler(callback)Adds a new handler for when a warp is updated
set_editing(warp_id, player_name[, state])Sets a player to be editing this warp, used with is_editing
update_warp(warp_id, name, icon[, player_name='server'])Updates a warp to a differecnt name and icon, both must be given
+ + +

Generators

+ + + + + + + + + + + + + + + + +
make_chart_tag(warp_id)Adds or updates the chart tag for a warp
new_warp(force_name, surface, postion[, 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
remove_warp(warp_id)Removes a warp and clears the area where it was added
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.store +
+
+
+
+ +

Allows storing of warp ids

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing of warp details

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.token +
+
+
+
+ +

Allows non conflicting warp ids

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + expcore.store +
+
+
+
+ +

Config for the warps

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + expcore.common +
+
+
+
+ +

Access to table_values and table_keysort

+

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

Getters

+
+
+
+
+ # + get_warp_name(warp_id) +
+
+
+
+ +

Gets the name of a warp

+

+ + + Parameters: + +
    + + + + + +
  • + + warp_id + + : + + (string) + + the uid of the warp you want to get + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the warp name that was stored here +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_warp_icon(warp_id) +
+
+
+
+ +

Gets the icon of a warp

+

+ + + Parameters: + +
    + + + + + +
  • + + warp_id + + : + + (string) + + the uid of the warp you want to get + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the warp icon that was stored here +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_details(warp_id) +
+
+
+
+ +

Gets the task details stored at this id

+

+ + + Parameters: + +
    + + + + + +
  • + + warp_id + + : + + (string) + + the uid of the warp you want to get + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + the warp details that was stored here +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_warps(force_name) +
+
+
+
+ +

Gets all warps for a force

+

+ + + Parameters: + +
    + + + + + +
  • + + force_name + + : + + (string) + + the name of the force to get the warps for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of warp ids that belong to this force, spawn key is included +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_all_warps() +
+
+
+
+ +

Gets all warps from all forces

+

+ + + + + + Returns: +
    +
  • + (table) + array of all warp details +
  • +
+ + + + + + + + + +
+
+
+
+ # + is_editing(warp_id, player_name) +
+
+
+
+ +

Gets if a player is currently editing this warp

+

+ + + Parameters: + +
    + + + + + +
  • + + warp_id + + : + + (string) + + the uid of the warp you want to check + +
  • + + + + + +
  • + + player_name + + : + + (string) + + the name of the player that you want to check + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + weather the player is currently editing this warp +
  • +
+ + + + + + + + + +
+
+
+
+ # + teleport_player(warp_id, player) +
+
+
+
+ +

Teleports a player to a warp point

+

+ + + Parameters: + +
    + + + + + +
  • + + warp_id + + : + + (string) + + the uid of the warp to send the player to + +
  • + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to teleport to the warp + +
  • + + +
+ + + + + + + + + + + + + +
+
+

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, postion[, 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 + +
  • + + + + + +
  • + + postion + + : + + (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 + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/index.html b/doc/index.html index 45c80e3f..a552d766 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,376 +1,409 @@ - - - - - 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..539ab547 --- /dev/null +++ b/doc/ldoc.ltp @@ -0,0 +1,416 @@ +> 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/Jail.html b/doc/modules/Jail.html new file mode 100644 index 00000000..a03abf37 --- /dev/null +++ b/doc/modules/Jail.html @@ -0,0 +1,1169 @@ + + + + + + + + Jail module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Jail module

+

Control Module - Jail + - Adds a way to jail players and temp ban players.

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Jail = require 'modules.control.jail'
+
+    -- This will move 'MrBiter' to the jail role and remove all other roles from them
+    -- the player name and reason are only so they can be included in the event for user feedback
+    Jail.jail_player('MrBiter','Cooldude2606','Likes biters too much')
+
+    -- This will give 'MrBiter' all his roles back and remove him from jail
+    -- again as above the player name is only used in the event for user feedback
+    Jail.unjail_player('MrBiter','Cooldude2606')
+
+    -- Temp ban works the same as jail but will store the reason and move the players items to spawn
+    -- this is meant to be used as a more permiment jail but not as strong as a ban
+    Jail.temp_ban_player('MrBiter','Cooldude2606','Likes biters too much')
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + +
expcore.rolesAllows moving players into the jail role
utils.gameAllows accessing a player from any value
utils.globalAllows storing data in the global table
expcore.commonUse of move_items to clear inventroies
+ + +

Events

+ + + + + + + + + + + + + + + + + + + + +
on_player_jailedWhen a player is assigned to jail
on_player_unjailedWhen a player is unassigned from jail
on_player_temp_bannedWhen a player is temp banned
on_player_untemp_bannedWhen a temp ban is removed from a player
+ + +

Jail functions

+ + + + + + + + + + + + + + + + +
is_jailed (player)Checks if the player is currently in jail
jail_player (player, by_player_name[, reason='Non given.'])Moves a player to jail and removes all other roles
unjail_player (player, by_player_name)Moves a player out of jail and restores all roles previously removed
+ + +

Temp ban functions

+ + + + + + + + + + + + + + + + +
is_temp_banned (player)Checks if a player is temp banned
temp_ban_player (player, by_player_name[, reason='Non given.'])Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn
untemp_ban_player (player, by_player_name)Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.roles +
+
+
+
+ +

Allows moving players into the jail role

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.game +
+
+
+
+ +

Allows accessing a player from any value

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing data in the global table

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + expcore.common +
+
+
+
+ +

Use of move_items to clear inventroies

+

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

Events

+
+
+
+
+ # + on_player_jailed +
+
+
+
+ +

When a player is assigned to jail

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was jailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who jailed the other player + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was jailed + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_player_unjailed +
+
+
+
+ +

When a player is unassigned from jail

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was unjailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who unjailed the other player + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_player_temp_banned +
+
+
+
+ +

When a player is temp banned

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was temp banned + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who temp banned the other player + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was temp banned + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_player_untemp_banned +
+
+
+
+ +

When a temp ban is removed from a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who was untemp banned + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who untemp banned the other player + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Jail functions

+
+
+
+
+ # + is_jailed (player) +
+
+
+
+ +

Checks if the player is currently in jail

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to check if they are in jail + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player is currently in jail +
  • +
+ + + + + + + + + +
+
+
+
+ # + jail_player (player, by_player_name[, reason='Non given.']) +
+
+
+
+ +

Moves a player to jail and removes all other roles

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player who will be jailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the jailing + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being jailed + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + wheather the user was jailed successfully +
  • +
+ + + + + + + + + +
+
+
+
+ # + unjail_player (player, by_player_name) +
+
+
+
+ +

Moves a player out of jail and restores all roles previously removed

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will be unjailed + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player that is doing the unjail + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player was unjailed successfully +
  • +
+ + + + + + + + + +
+
+

Temp ban functions

+
+
+
+
+ # + is_temp_banned (player) +
+
+
+
+ +

Checks if a player is temp banned

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to check if they are temp banned + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player is temp banned +
  • +
+ + + + + + + + + +
+
+
+
+ # + temp_ban_player (player, by_player_name[, reason='Non given.']) +
+
+
+
+ +

Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that will be temp banned + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the temp ban + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being temp banned + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player was successfully temp banned +
  • +
+ + + + + + + + + +
+
+
+
+ # + untemp_ban_player (player, by_player_name) +
+
+
+
+ +

Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player who is being removed from temp ban + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the untemp ban + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + whether the player was successfully removed +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/Production.html b/doc/modules/Production.html new file mode 100644 index 00000000..ca9dbceb --- /dev/null +++ b/doc/modules/Production.html @@ -0,0 +1,1281 @@ + + + + + + + + Production module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Production module

+

Control Module - Production + - Common functions used to track production of items

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Production = require 'modules.control.production'
+
+    -- This will return the less precise index from the one given
+    -- this means that one_second will return one_minute or ten_hours will return fifty_hours
+    -- the other precision work like wise
+    Production.precision_up(defines.flow_precision_index.one_second)
+
+    -- The get production function is used to get production, consumion and net
+    -- it may be used for any item and with any precision level, use total for total
+    Production.get_production(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
+
+    -- The fluctuations works by compearing recent production with the average over time
+    -- again any precision may be used, apart from one_thousand_hours as there would be no valid average
+    Production.get_fluctuations(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
+
+    -- ETA is calculated based on what function you use but all share a similar method
+    -- for production eta it will take current production average given by the precision
+    -- and work out how many ticks it will require to make the required amount (1000 by default)
+    Production.get_production_eta(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute,250000)
+
+    -- Both get_color and format_number are helper functions to help format production stats
+    -- get_color will return green,orange,red,or grey based on the active_value
+    -- the passive_value is used when active_value is 0 and can only return orange,red,or grey
+    Production.get_color(clamp,active_value,passive_value)
+ + + + + + + +

Dependencies

+ + + + + + + + + + + + +
resources.color_presetsProvides colors for Production.get_color
utilProvides format_number function to add surfixs
+ + +

Precision

+ + + + + + + + + + + + + + + + +
precision_up (precision)Gets the next lesser precision index value, eg 1 second -> 1 minute
precision_down (precision)Gets the next greater precision index value, eg 1 minute -> 1 second
precision_ticks (precision)Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks
+ + +

Stats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_production_total (force, item_name)Returns the production data for the whole game time
get_production (force, item_name, precision)Returns the production data for the given precision game time
get_fluctuations (force, item_name, precision)Returns the current fluctuation from the average
get_production_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce a certain amount
get_consumsion_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to consume a certain amount
get_net_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce but not consume a certain amount
+ + +

Formating

+ + + + + + + + + + + + +
get_color (clamp, active_value, passive_value)Returns a color value bassed on the value that was given
format_number (value)Returns three parts used to format a number
+ + +
+ + +

Dependencies

+
+
+
+
+ # + resources.color_presets +
+
+
+
+ +

Provides colors for Production.get_color

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + util +
+
+
+
+ +

Provides format_number function to add surfixs

+

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

Precision

+
+
+
+
+ # + precision_up (precision) +
+
+
+
+ +

Gets the next lesser precision index value, eg 1 second -> 1 minute

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + precision_down (precision) +
+
+
+
+ +

Gets the next greater precision index value, eg 1 minute -> 1 second

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + precision_ticks (precision) +
+
+
+
+ +

Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks

+

+ + + Parameters: + + + + + + + Returns: +
    +
  • + (number) + the number of ticks in this time +
  • +
+ + + + + + + + + +
+
+

Stats

+
+
+
+
+ # + get_production_total (force, item_name) +
+
+
+
+ +

Returns the production data for the whole game time

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains total made, used and net +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_production (force, item_name, precision) +
+
+
+
+ +

Returns the production data for the given precision game time

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains made, used and net +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_fluctuations (force, item_name, precision) +
+
+
+
+ +

Returns the current fluctuation from the average

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains made, used and net +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_production_eta (force, item_name, precision[, required=1000]) +
+
+
+
+ +

Returns the amount of ticks required to produce a certain amount

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + + + + +
  • + + required + + : + + (number) + + the number of items that are required to be made + + (default: 1000) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to produce this ammount of items +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_consumsion_eta (force, item_name, precision[, required=1000]) +
+
+
+
+ +

Returns the amount of ticks required to consume a certain amount

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + + + + +
  • + + required + + : + + (number) + + the number of items that are required to be consumed + + (default: 1000) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to consume this ammount of items +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_net_eta (force, item_name, precision[, required=1000]) +
+
+
+
+ +

Returns the amount of ticks required to produce but not consume a certain amount

+

+ + + Parameters: + +
    + + + + + +
  • + + force + + : + + (LuaForce) + + the force to get the data for + +
  • + + + + + +
  • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
  • + + + + + +
  • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
  • + + + + + +
  • + + required + + : + + (number) + + the number of items that are required to be made but not used + + (default: 1000) +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of ticks required to produce, but not use, this ammount of items +
  • +
+ + + + + + + + + +
+
+

Formating

+
+
+
+
+ # + get_color (clamp, active_value, passive_value) +
+
+
+
+ +

Returns a color value bassed on the value that was given

+

+ + + Parameters: + +
    + + + + + +
  • + + clamp + + : + + (number) + + value which seperates the different colours + +
  • + + + + + +
  • + + active_value + + : + + (number) + + first value tested, tested against clamp + +
  • + + + + + +
  • + + passive_value + + : + + (number) + + second value tested, tested against 0 + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + contains r,g,b keys +
  • +
+ + + + + + + + + +
+
+
+
+ # + format_number (value) +
+
+
+
+ +

Returns three parts used to format a number

+

+ + + Parameters: + +
    + + + + + +
  • + + value + + : + + (number) + + the value to format + +
  • + + +
+ + + + + Returns: +
    +
  • + (string) + the sign for the number +
  • +
  • + (string) + the surfix for any unit used +
  • +
  • + (string) + the number formated +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/Reports.html b/doc/modules/Reports.html new file mode 100644 index 00000000..35edb453 --- /dev/null +++ b/doc/modules/Reports.html @@ -0,0 +1,1026 @@ + + + + + + + + Reports module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Reports module

+

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

+

+ + + + + + +

Usage

+

+    -- import the module from the control modules
+    local Reports = require 'modules.control.reports'
+
+    -- 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
+ + +

Dependencies

+ + + + + + + + + + + + +
utils.gameAllows getting player from any value
utils.globalAllows storing of data in global table
+ + +

Get functions

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

Set functions

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

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 + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Dependencies

+
+
+
+
+ # + utils.game +
+
+
+
+ +

Allows getting player from any value

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + utils.global +
+
+
+
+ +

Allows storing of data in global table

+

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

Get functions

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+

Set functions

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/Warnings.html b/doc/modules/Warnings.html new file mode 100644 index 00000000..69fcc9c9 --- /dev/null +++ b/doc/modules/Warnings.html @@ -0,0 +1,1279 @@ + + + + + + + + Warnings module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Warnings module

+

Control Module - Warnings + - Adds a way to give and remove warnings to players.

+

+ + + + + + +

Usage

+

+    -- This will add a warning to the player
+    Warnings.add_warning('MrBiter','Cooldude2606','Killed too many biters')
+
+    -- This will remove a warning from a player, second name is just who is doing the action
+    Warnings.remove_warning('MrBiter','Cooldude2606')
+
+    -- Script warning as similar to normal warning but are designed to have no effect for a short amount of time
+    -- this is so it can be used for greifer protection without being too agressive
+    Warnings.add_script_warning('MrBiter','Killed too many biters')
+
+    -- Both normal and script warnings can also be cleared, this will remove all warnings
+    Warnings.clear_warnings('MrBiter','Cooldude2606')
+ + + + + + + +

Events

+ + + + + + + + + + + + + + + + + + + + +
on_warning_addedWhen a warning is added to a player
on_warning_removedWhen a warning is removed from a player
on_script_warning_addedWhen a warning is added to a player, by the script
on_script_warning_removedWhen a warning is remnoved from a player, by the script
+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_warnings (player)Gets an array of warnings that the player has, always returns a list even if emtpy
count_warnings (player)Gets the number of warnings that a player has on them
add_warning (player, by_player_name[, reason='Non given.'])Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file
remove_warning (player, by_player_name)Removes a warning from a player, always removes the earlyist warning, fifo
clear_warnings (player, by_player_name)Removes all warnings from a player, will trigger remove event for each warning
get_script_warnings (player)Gets an array of all the script warnings that a player has
count_script_warnings (player)Gets the number of script warnings that a player has on them
add_script_warning (player[, reason='Non given.'])Adds a script warning to a player, this may add a full warning if max script warnings is met
remove_script_warning (player)Removes a script warning from a player
clear_script_warnings (player)Removes all script warnings from a player, emits event for each warning removed
+ + +
+ + +

Events

+
+
+
+
+ # + on_warning_added +
+
+
+
+ +

When a warning is added to a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who recived the warning + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who gave the warning + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was given a warning + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_warning_removed +
+
+
+
+ +

When a warning is removed from a player

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who is having the warning removed + +
  • + + + + + +
  • + + warning_by_name + + : + + (string) + + the name of the player who gave the warning + +
  • + + + + + +
  • + + removed_by_name + + : + + (string) + + the name of the player who is removing the warning + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_script_warning_added +
+
+
+
+ +

When a warning is added to a player, by the script

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who recived the warning + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player was given a warning + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + on_script_warning_removed +
+
+
+
+ +

When a warning is remnoved from a player, by the script

+

+ + + Event Parameters: + +
    + + + + + +
  • + + player_index + + : + + (number) + + the index of the player who is having the warning removed + +
  • + + + + + +
  • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
  • + + +
+ + + + + + + + + + + + + +
+
+

Functions

+
+
+
+
+ # + get_warnings (player) +
+
+
+
+ +

Gets an array of warnings that the player has, always returns a list even if emtpy

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the warning for + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of all the warnings on this player, contains tick, by_player_name and reason +
  • +
+ + + + + + + + + +
+
+
+
+ # + count_warnings (player) +
+
+
+
+ +

Gets the number of warnings that a player has on them

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to count the warnings for + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + add_warning (player, by_player_name[, reason='Non given.']) +
+
+
+
+ +

Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to add a warning to + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being warned + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + remove_warning (player, by_player_name) +
+
+
+
+ +

Removes a warning from a player, always removes the earlyist warning, fifo

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to remove a warning from + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + clear_warnings (player, by_player_name) +
+
+
+
+ +

Removes all warnings from a player, will trigger remove event for each warning

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to clear the warnings from + +
  • + + + + + +
  • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true when warnings were cleared succesfully +
  • +
+ + + + + + + + + +
+
+
+
+ # + get_script_warnings (player) +
+
+
+
+ +

Gets an array of all the script warnings that a player has

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the script warnings of + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + a table of all the script warnings a player has, contains tick and reason +
  • +
+ + + + + + + + + +
+
+
+
+ # + count_script_warnings (player) +
+
+
+
+ +

Gets the number of script warnings that a player has on them

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to count the script warnings of + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of script warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + add_script_warning (player[, reason='Non given.']) +
+
+
+
+ +

Adds a script warning to a player, this may add a full warning if max script warnings is met

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to add a script warning to + +
  • + + + + + +
  • + + reason + + : + + (string) + + the reason that the player is being warned + + (default: 'Non given.') +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of script warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + remove_script_warning (player) +
+
+
+
+ +

Removes a script warning from a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to remove a script warning from + +
  • + + +
+ + + + + Returns: +
    +
  • + (number) + the number of script warnings that the player has +
  • +
+ + + + + + + + + +
+
+
+
+ # + clear_script_warnings (player) +
+
+
+
+ +

Removes all script warnings from a player, emits event for each warning removed

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to clear the script warnings from + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + 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..dbc972de 100644 --- a/doc/modules/config._file_loader.html +++ b/doc/modules/config._file_loader.html @@ -1,121 +1,192 @@ - - - - - Reference + + + + + + + + config._file_loader module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.action_buttons.html b/doc/modules/config.action_buttons.html index ae1730dc..6159b590 100644 --- a/doc/modules/config.action_buttons.html +++ b/doc/modules/config.action_buttons.html @@ -1,122 +1,193 @@ - - - - - Reference + + + + + + + + config.action_buttons module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.advanced_start.html b/doc/modules/config.advanced_start.html index e1826c7e..eefefc7c 100644 --- a/doc/modules/config.advanced_start.html +++ b/doc/modules/config.advanced_start.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.advanced_start module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.bonuses.html b/doc/modules/config.bonuses.html new file mode 100644 index 00000000..a27c8ed9 --- /dev/null +++ b/doc/modules/config.bonuses.html @@ -0,0 +1,189 @@ + + + + + + + + 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..67b88043 --- /dev/null +++ b/doc/modules/config.chat_reply.html @@ -0,0 +1,189 @@ + + + + + + + + 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..7d9803ac 100644 --- a/doc/modules/config.death_logger.html +++ b/doc/modules/config.death_logger.html @@ -1,120 +1,191 @@ - - - - - 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..584ae0d9 --- /dev/null +++ b/doc/modules/config.discord_alerts.html @@ -0,0 +1,189 @@ + + + + + + + + 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..186ebcab 100644 --- a/doc/modules/config.expcore-commands.auth_admin.html +++ b/doc/modules/config.expcore-commands.auth_admin.html @@ -1,120 +1,191 @@ - - - - - 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..7cfdc526 100644 --- a/doc/modules/config.expcore-commands.auth_roles.html +++ b/doc/modules/config.expcore-commands.auth_roles.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.expcore-commands.auth_roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.expcore-commands.auth_runtime_disable.html b/doc/modules/config.expcore-commands.auth_runtime_disable.html index f8f18960..7c550560 100644 --- a/doc/modules/config.expcore-commands.auth_runtime_disable.html +++ b/doc/modules/config.expcore-commands.auth_runtime_disable.html @@ -1,119 +1,190 @@ - - - - - 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..902f8a4d 100644 --- a/doc/modules/config.expcore-commands.parse_general.html +++ b/doc/modules/config.expcore-commands.parse_general.html @@ -1,122 +1,193 @@ - - - - - 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..1b36bc56 100644 --- a/doc/modules/config.expcore-commands.parse_roles.html +++ b/doc/modules/config.expcore-commands.parse_roles.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.expcore-commands.parse_roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.permission_groups.html b/doc/modules/config.permission_groups.html index c9572f7f..a9de68c5 100644 --- a/doc/modules/config.permission_groups.html +++ b/doc/modules/config.permission_groups.html @@ -1,121 +1,192 @@ - - - - - Reference + + + + + + + + config.permission_groups module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/config.popup_messages.html b/doc/modules/config.popup_messages.html index 93daa302..07f369e8 100644 --- a/doc/modules/config.popup_messages.html +++ b/doc/modules/config.popup_messages.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.popup_messages module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.rockets.html b/doc/modules/config.rockets.html index 93c35073..cacc61b1 100644 --- a/doc/modules/config.rockets.html +++ b/doc/modules/config.rockets.html @@ -1,165 +1,278 @@ - - - - - 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..a1e771f9 100644 --- a/doc/modules/config.roles.html +++ b/doc/modules/config.roles.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.scorched_earth.html b/doc/modules/config.scorched_earth.html index 22741e11..c9977ebe 100644 --- a/doc/modules/config.scorched_earth.html +++ b/doc/modules/config.scorched_earth.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.scorched_earth module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.spawn_area.html b/doc/modules/config.spawn_area.html index e25138fb..27a41651 100644 --- a/doc/modules/config.spawn_area.html +++ b/doc/modules/config.spawn_area.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.spawn_area module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.warnings.html b/doc/modules/config.warnings.html index d087da36..0f79fed5 100644 --- a/doc/modules/config.warnings.html +++ b/doc/modules/config.warnings.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + config.warnings module + + + - - + + -
+
+
-
- -
-
-
+ + + - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - + + + diff --git a/doc/modules/config.warps.html b/doc/modules/config.warps.html new file mode 100644 index 00000000..cd96cd9d --- /dev/null +++ b/doc/modules/config.warps.html @@ -0,0 +1,189 @@ + + + + + + + + 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..0edbea2d 100644 --- a/doc/modules/control.html +++ b/doc/modules/control.html @@ -1,121 +1,192 @@ - - - - - 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..11ec533f 100644 --- a/doc/modules/expcore.commands.html +++ b/doc/modules/expcore.commands.html @@ -1,123 +1,193 @@ - - - - - Reference + + + + + + + + expcore.commands module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + + +
+ + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.common.html b/doc/modules/expcore.common.html index 83fc1ed4..6c0405d7 100644 --- a/doc/modules/expcore.common.html +++ b/doc/modules/expcore.common.html @@ -1,996 +1,2276 @@ - - - - - Reference + + + + + + + + expcore.common module + + + - - + + -
+
+
-
- -
-
-
+ + + +
+
+ + + + diff --git a/doc/modules/expcore.gui.concepts.center.html b/doc/modules/expcore.gui.concepts.center.html new file mode 100644 index 00000000..9a8406c2 --- /dev/null +++ b/doc/modules/expcore.gui.concepts.center.html @@ -0,0 +1,934 @@ + + + + + + + + expcore.gui.concepts.center module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.center module

+

Gui structure define for center gui frames +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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(permision_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
+ + +
+ + +

Functions

+
+
+
+
+ # + CenterFrames.get_flow(player) +
+
+
+
+ +

Gets the center flow for a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to get the flow for + +
  • + + +
+ + + + + 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) + + when set will force a state for the frame + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + if the frame if no open or closed +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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._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: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: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: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._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) +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.concepts.left.html b/doc/modules/expcore.gui.concepts.left.html new file mode 100644 index 00000000..1484b153 --- /dev/null +++ b/doc/modules/expcore.gui.concepts.left.html @@ -0,0 +1,1200 @@ + + + + + + + + expcore.gui.concepts.left module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.left module

+

Gui structure define for left frames +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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 visiblty of a left frame, or sets its visiblty state
LeftFrames.new_frame(permision_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 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._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
+ + +
+ + +

Functions

+
+
+
+
+ # + 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.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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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._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: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:_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: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 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._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) +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.concepts.popups.html b/doc/modules/expcore.gui.concepts.popups.html new file mode 100644 index 00000000..6538f8ff --- /dev/null +++ b/doc/modules/expcore.gui.concepts.popups.html @@ -0,0 +1,680 @@ + + + + + + + + expcore.gui.concepts.popups module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.concepts.popups module

+

Gui structure define for popup gui +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + +
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.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
+ + +

Fields

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

Functions

+
+
+
+
+ # + 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.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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+

Fields

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

Progress bar which when depleaded will close the popup frame

+

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

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

+

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

expcore.gui.concepts.toolbar module

+

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

+

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

Functions

+ + + + + + + + + + + + + + + + +
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
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.core.html b/doc/modules/expcore.gui.core.html index 523bda7b..6ec0d1c1 100644 --- a/doc/modules/expcore.gui.core.html +++ b/doc/modules/expcore.gui.core.html @@ -1,121 +1,192 @@ - - - - - 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..698bac8b --- /dev/null +++ b/doc/modules/expcore.gui.elements.buttons.html @@ -0,0 +1,530 @@ + + + + + + + + expcore.gui.elements.buttons module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.buttons module

+

Gui class define for buttons and sprite buttons +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + +
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 spirte 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
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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._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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.checkboxs.html b/doc/modules/expcore.gui.elements.checkboxs.html new file mode 100644 index 00000000..de6841e3 --- /dev/null +++ b/doc/modules/expcore.gui.elements.checkboxs.html @@ -0,0 +1,848 @@ + + + + + + + + expcore.gui.elements.checkboxs module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.checkboxs module

+

Gui class define for checkboxs and radiobuttons +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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 radiobutotns (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 radiobutotn in a element to false (unless excluded) and can act recursivly
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 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.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.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 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..452ee6db --- /dev/null +++ b/doc/modules/expcore.gui.elements.dropdown.html @@ -0,0 +1,710 @@ + + + + + + + + expcore.gui.elements.dropdown module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.dropdown module

+

Gui class define for dropdowns and list boxs +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + 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..60520283 --- /dev/null +++ b/doc/modules/expcore.gui.elements.elem-button.html @@ -0,0 +1,406 @@ + + + + + + + + expcore.gui.elements.elem-button module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.elem-button module

+

Gui class defines for elem buttons +[[

+

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

Functions

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

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.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_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 +
  • +
+ + + + + + + + + +
+
+

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..1e1ace09 --- /dev/null +++ b/doc/modules/expcore.gui.elements.progress-bar.html @@ -0,0 +1,1151 @@ + + + + + + + + expcore.gui.elements.progress-bar module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.progress-bar module

+

Gui element define for progess bars +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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 are incremented
ProgressBar.decrement(element[, amount=1])Decreases the value of the progressbar, if a define is given all of its instances are decresed
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 triggeres, can filter which elements are incremented
ProgressBar._prototype:event_countdown([filter])Event handler factory that counts down by 1 every time the event triggeres, can filter which elements are decremented
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 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.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.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._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 triggeres, can filter which elements are incremented

+

+ + + Parameters: + +
    + + + + + +
  • + + filter + + : + + (function) + + when given will use filtered incerement + + (optional) +
  • + + +
+ + + + + Returns: +
    +
  • + (function) + the event handler +
  • +
+ + + + + + + + + +
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.slider.html b/doc/modules/expcore.gui.elements.slider.html new file mode 100644 index 00000000..e3e95a74 --- /dev/null +++ b/doc/modules/expcore.gui.elements.slider.html @@ -0,0 +1,481 @@ + + + + + + + + expcore.gui.elements.slider module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.slider module

+

Gui class define for silders +[[

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + +
Slider.new_slider([name])Creates a 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
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
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.elements.text.html b/doc/modules/expcore.gui.elements.text.html new file mode 100644 index 00000000..bfd88ce8 --- /dev/null +++ b/doc/modules/expcore.gui.elements.text.html @@ -0,0 +1,527 @@ + + + + + + + + expcore.gui.elements.text module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

expcore.gui.elements.text module

+

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

+

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

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + +
Text.new_text_field([name])Creates a new text field element define
Text.new_text_box([name])Creates a new text box element define
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._prototype_box:set_read_only([state=true])Sets the text box to be read only
+ + +
+ + +

Functions

+
+
+
+
+ # + 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 +
  • +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.html b/doc/modules/expcore.gui.html index 810d6e38..c2a494e8 100644 --- a/doc/modules/expcore.gui.html +++ b/doc/modules/expcore.gui.html @@ -1,119 +1,190 @@ - - - - - Reference + + + + + + + + expcore.gui module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.instances.html b/doc/modules/expcore.gui.instances.html index b379c6a8..c121c018 100644 --- a/doc/modules/expcore.gui.instances.html +++ b/doc/modules/expcore.gui.instances.html @@ -1,119 +1,190 @@ - - - - - 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..9156e2fb --- /dev/null +++ b/doc/modules/expcore.gui.prototype.html @@ -0,0 +1,1421 @@ + + + + + + + + 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.store(sync, callback)Creates a new function which adds a store to a gui define
Constructor.setter(value_type, key[, second_key])Creates a setter function that checks the type when a value is set
Prototype:uid()Gets the uid for the element define
Prototype:set_style(style[, function])Sets the style for the element define
Prototype:set_embeded_flow(boolean)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
+ + +

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Prototype.debug_nameSets a debug alias for the define
Prototype.set_captionSets the caption for the element define
Prototype.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
+ + +
+ + +

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.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: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: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: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: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 + +
  • + + + + + +
  • + + 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: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 +
  • +
+ + + + + + + + + +
+
+

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.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 + +
  • + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/doc/modules/expcore.gui.test.html b/doc/modules/expcore.gui.test.html index be35af41..4551e5b9 100644 --- a/doc/modules/expcore.gui.test.html +++ b/doc/modules/expcore.gui.test.html @@ -1,120 +1,191 @@ - - - - - Reference + + + + + + + + expcore.gui.test module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + + +
+
+
+ + + + diff --git a/doc/modules/expcore.permission_groups.html b/doc/modules/expcore.permission_groups.html index 33781f3f..69ac8823 100644 --- a/doc/modules/expcore.permission_groups.html +++ b/doc/modules/expcore.permission_groups.html @@ -1,660 +1,1229 @@ - - - - - Reference + + + + + + + + expcore.permission_groups module + + + - - + + -
+
+
-
- -
-
-
+ + + - - +
+
+
+ + + + diff --git a/doc/modules/expcore.roles.html b/doc/modules/expcore.roles.html index 493741d1..65d26d09 100644 --- a/doc/modules/expcore.roles.html +++ b/doc/modules/expcore.roles.html @@ -1,1307 +1,2701 @@ - - - - - Reference + + + + + + + + expcore.roles module + + + - - + + -
+
+
-
- -
-
-
+ + + - - + + + +
  • + + skip_check + + : + + (boolean) + + when true player will be taken as the player name (use when player has not yet joined) + +
  • + + + + + +
  • + + skip_event + + : + + (boolean) + + when true the event emit will be skipped, this is used internally with Roles.assign + +
  • + + + + + + + + Returns: +
      +
    • + (boolean) + true if the player was added successfully +
    • +
    + + + + + + + + + + +
    +
    +
    + # + Roles._prototype:remove_player(player, skip_check, skip_event) +
    +
    +
    +
    + +

    Removes a player from this role, players can have more than one role at a time, used internally see Roles.unassign

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player that will lose this role + +
    • + + + + + +
    • + + skip_check + + : + + (boolean) + + when true player will be taken as the player name (use when player has not yet joined) + +
    • + + + + + +
    • + + skip_event + + : + + (boolean) + + when true the event emit will be skipped, this is used internally with Roles.unassign + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true if the player was removed successfully +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Roles._prototype:get_players([online=nil]) +
    +
    +
    +
    + +

    Returns an array of all the players who have this role, can be filtered by online status

    +

    + + + Parameters: + +
      + + + + + +
    • + + online + + : + + (boolean) + + when given will filter by this online state, nil will return all players + + (default: nil) +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + all the players who have this role, indexed order is meaningless +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + Roles._prototype:print(message) +
    +
    +
    +
    + +

    Will print a message to all players with this role

    +

    + + + Parameters: + +
      + + + + + +
    • + + message + + : + + (string) + + the message that will be printed to the players + +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of players who received the message +
    • +
    + + + + + + + + + +
    + + + + +
    +
    +
    + + + + diff --git a/doc/modules/expcore.store.html b/doc/modules/expcore.store.html index 57e11bed..d3717626 100644 --- a/doc/modules/expcore.store.html +++ b/doc/modules/expcore.store.html @@ -1,464 +1,776 @@ - - - - - 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..fae79bb1 --- /dev/null +++ b/doc/modules/expcore.sudo.html @@ -0,0 +1,190 @@ + + + + + + + + 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..378ebfc8 100644 --- a/doc/modules/modules.addons.advanced-start.html +++ b/doc/modules/modules.addons.advanced-start.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + modules.addons.advanced-start module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - - -
    -
    -
    -generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
    -
    - - + + + diff --git a/doc/modules/modules.addons.chat-popups.html b/doc/modules/modules.addons.chat-popups.html index b7f53d32..154bfa82 100644 --- a/doc/modules/modules.addons.chat-popups.html +++ b/doc/modules/modules.addons.chat-popups.html @@ -1,119 +1,190 @@ - - - - - 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..c2ceb83e 100644 --- a/doc/modules/modules.addons.damage-popups.html +++ b/doc/modules/modules.addons.damage-popups.html @@ -1,119 +1,190 @@ - - - - - Reference + + + + + + + + modules.addons.damage-popups module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - + + + + +
    +
    +
    + + + + diff --git a/doc/modules/modules.control.production.html b/doc/modules/modules.control.production.html new file mode 100644 index 00000000..30718ab0 --- /dev/null +++ b/doc/modules/modules.control.production.html @@ -0,0 +1,1281 @@ + + + + + + + + modules.control.production module + + + + + + + +
    +
    + + + + + + + +
    + + + + + + + + +

    modules.control.production module

    +

    Control Module - Production + - Common functions used to track production of items

    +

    + + + + + + +

    Usage

    +
    
    +    -- import the module from the control modules
    +    local Production = require 'modules.control.production'
    +
    +    -- This will return the less precise index from the one given
    +    -- this means that one_second will return one_minute or ten_hours will return fifty_hours
    +    -- the other precision work like wise
    +    Production.precision_up(defines.flow_precision_index.one_second)
    +
    +    -- The get production function is used to get production, consumion and net
    +    -- it may be used for any item and with any precision level, use total for total
    +    Production.get_production(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
    +
    +    -- The fluctuations works by compearing recent production with the average over time
    +    -- again any precision may be used, apart from one_thousand_hours as there would be no valid average
    +    Production.get_fluctuations(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
    +
    +    -- ETA is calculated based on what function you use but all share a similar method
    +    -- for production eta it will take current production average given by the precision
    +    -- and work out how many ticks it will require to make the required amount (1000 by default)
    +    Production.get_production_eta(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute,250000)
    +
    +    -- Both get_color and format_number are helper functions to help format production stats
    +    -- get_color will return green,orange,red,or grey based on the active_value
    +    -- the passive_value is used when active_value is 0 and can only return orange,red,or grey
    +    Production.get_color(clamp,active_value,passive_value)
    + + + + + + + +

    Dependencies

    + + + + + + + + + + + + +
    resources.color_presetsProvides colors for Production.get_color
    utilProvides format_number function to add surfixs
    + + +

    Precision

    + + + + + + + + + + + + + + + + +
    precision_up (precision)Gets the next lesser precision index value, eg 1 second -> 1 minute
    precision_down (precision)Gets the next greater precision index value, eg 1 minute -> 1 second
    precision_ticks (precision)Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks
    + + +

    Statistics

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    get_production_total (force, item_name)Returns the production data for the whole game time
    get_production (force, item_name, precision)Returns the production data for the given precision game time
    get_fluctuations (force, item_name, precision)Returns the current fluctuation from the average
    get_production_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce a certain amount
    get_consumsion_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to consume a certain amount
    get_net_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce but not consume a certain amount
    + + +

    Formating

    + + + + + + + + + + + + +
    get_color (clamp, active_value, passive_value)Returns a color value bassed on the value that was given
    format_number (value)Returns three parts used to format a number
    + + +
    + + +

    Dependencies

    +
    +
    +
    +
    + # + resources.color_presets +
    +
    +
    +
    + +

    Provides colors for Production.get_color

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + util +
    +
    +
    +
    + +

    Provides format_number function to add surfixs

    +

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

    Precision

    +
    +
    +
    +
    + # + precision_up (precision) +
    +
    +
    +
    + +

    Gets the next lesser precision index value, eg 1 second -> 1 minute

    +

    + + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + precision_down (precision) +
    +
    +
    +
    + +

    Gets the next greater precision index value, eg 1 minute -> 1 second

    +

    + + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
    +
    +
    +
    + # + precision_ticks (precision) +
    +
    +
    +
    + +

    Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks

    +

    + + + Parameters: + + + + + + + Returns: +
      +
    • + (number) + the number of ticks in this time +
    • +
    + + + + + + + + + +
    +
    +

    Statistics

    +
    +
    +
    +
    + # + get_production_total (force, item_name) +
    +
    +
    +
    + +

    Returns the production data for the whole game time

    +

    + + + Parameters: + +
      + + + + + +
    • + + force + + : + + (LuaForce) + + the force to get the data for + +
    • + + + + + +
    • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + contains total made, used and net +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_production (force, item_name, precision) +
    +
    +
    +
    + +

    Returns the production data for the given precision game time

    +

    + + + Parameters: + +
      + + + + + +
    • + + force + + : + + (LuaForce) + + the force to get the data for + +
    • + + + + + +
    • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
    • + + + + + +
    • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + contains made, used and net +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_fluctuations (force, item_name, precision) +
    +
    +
    +
    + +

    Returns the current fluctuation from the average

    +

    + + + Parameters: + +
      + + + + + +
    • + + force + + : + + (LuaForce) + + the force to get the data for + +
    • + + + + + +
    • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
    • + + + + + +
    • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + contains made, used and net +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_production_eta (force, item_name, precision[, required=1000]) +
    +
    +
    +
    + +

    Returns the amount of ticks required to produce a certain amount

    +

    + + + Parameters: + +
      + + + + + +
    • + + force + + : + + (LuaForce) + + the force to get the data for + +
    • + + + + + +
    • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
    • + + + + + +
    • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
    • + + + + + +
    • + + required + + : + + (number) + + the number of items that are required to be made + + (default: 1000) +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of ticks required to produce this ammount of items +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_consumsion_eta (force, item_name, precision[, required=1000]) +
    +
    +
    +
    + +

    Returns the amount of ticks required to consume a certain amount

    +

    + + + Parameters: + +
      + + + + + +
    • + + force + + : + + (LuaForce) + + the force to get the data for + +
    • + + + + + +
    • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
    • + + + + + +
    • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
    • + + + + + +
    • + + required + + : + + (number) + + the number of items that are required to be consumed + + (default: 1000) +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of ticks required to consume this ammount of items +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_net_eta (force, item_name, precision[, required=1000]) +
    +
    +
    +
    + +

    Returns the amount of ticks required to produce but not consume a certain amount

    +

    + + + Parameters: + +
      + + + + + +
    • + + force + + : + + (LuaForce) + + the force to get the data for + +
    • + + + + + +
    • + + item_name + + : + + (string) + + the name of the item that you want the data about + +
    • + + + + + +
    • + + precision + + : + + (defines.flow_precision_index) + + the precision that you want the data given to + +
    • + + + + + +
    • + + required + + : + + (number) + + the number of items that are required to be made but not used + + (default: 1000) +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of ticks required to produce, but not use, this ammount of items +
    • +
    + + + + + + + + + +
    +
    +

    Formating

    +
    +
    +
    +
    + # + get_color (clamp, active_value, passive_value) +
    +
    +
    +
    + +

    Returns a color value bassed on the value that was given

    +

    + + + Parameters: + +
      + + + + + +
    • + + clamp + + : + + (number) + + value which seperates the different colours + +
    • + + + + + +
    • + + active_value + + : + + (number) + + first value tested, tested against clamp + +
    • + + + + + +
    • + + passive_value + + : + + (number) + + second value tested, tested against 0 + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + contains r,g,b keys +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + format_number (value) +
    +
    +
    +
    + +

    Returns three parts used to format a number

    +

    + + + Parameters: + +
      + + + + + +
    • + + value + + : + + (number) + + the value to format + +
    • + + +
    + + + + + Returns: +
      +
    • + (string) + the sign for the number +
    • +
    • + (string) + the surfix for any unit used +
    • +
    • + (string) + the number formated +
    • +
    + + + + + + + + + +
    +
    + + + +
    +
    +
    + + + + diff --git a/doc/modules/modules.control.reports.html b/doc/modules/modules.control.reports.html new file mode 100644 index 00000000..cbfd54ef --- /dev/null +++ b/doc/modules/modules.control.reports.html @@ -0,0 +1,1026 @@ + + + + + + + + modules.control.reports module + + + + + + + +
    +
    + + + + + + + +
    + + + + + + + + +

    modules.control.reports module

    +

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

    +

    + + + + + + +

    Usage

    +
    
    +    -- import the module from the control modules
    +    local Reports = require 'modules.control.reports'
    +
    +    -- 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
    + + +

    Dependencies

    + + + + + + + + + + + + +
    utils.gameAllows getting player from any value
    utils.globalAllows storing of data in global table
    + + +

    Get functions

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

    Set functions

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

    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 + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +

    Dependencies

    +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + +

    Allows getting player from any value

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.global +
    +
    +
    +
    + +

    Allows storing of data in global table

    +

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

    Get functions

    +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    +

    Set functions

    +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + 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 +
    • +
    + + + + + + + + + +
    +
    + + + +
    +
    +
    + + + + diff --git a/doc/modules/modules.control.warnings.html b/doc/modules/modules.control.warnings.html new file mode 100644 index 00000000..022c2d8a --- /dev/null +++ b/doc/modules/modules.control.warnings.html @@ -0,0 +1,1416 @@ + + + + + + + + modules.control.warnings module + + + + + + + +
    +
    + + + + + + + +
    + + + + + + + + +

    modules.control.warnings module

    +

    Control Module - Warnings + - Adds a way to give and remove warnings to players.

    +

    + + + + + + +

    Usage

    +
    
    +    -- This will add a warning to the player
    +    Warnings.add_warning('MrBiter','Cooldude2606','Killed too many biters')
    +
    +    -- This will remove a warning from a player, second name is just who is doing the action
    +    Warnings.remove_warning('MrBiter','Cooldude2606')
    +
    +    -- Script warning as similar to normal warning but are designed to have no effect for a short amount of time
    +    -- this is so it can be used for greifer protection without being too agressive
    +    Warnings.add_script_warning('MrBiter','Killed too many biters')
    +
    +    -- Both normal and script warnings can also be cleared, this will remove all warnings
    +    Warnings.clear_warnings('MrBiter','Cooldude2606')
    + + + + + + + +

    Events

    + + + + + + + + + + + + + + + + + + + + +
    on_warning_addedWhen a warning is added to a player
    on_warning_removedWhen a warning is removed from a player
    on_script_warning_addedWhen a warning is added to a player, by the script
    on_script_warning_removedWhen a warning is remnoved from a player, by the script
    + + +

    Dependencies

    + + + + + + + + + + + + + + + + + + + + +
    utils.eventAllows registering of custom events
    utils.gameAllows getting player from any value
    utils.globalAllows storing in the global table
    config.warningsConfig file for this module
    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    get_warnings (player)Gets an array of warnings that the player has, always returns a list even if emtpy
    count_warnings (player)Gets the number of warnings that a player has on them
    add_warning (player, by_player_name[, reason='Non given.'])Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file
    remove_warning (player, by_player_name)Removes a warning from a player, always removes the earlyist warning, fifo
    clear_warnings (player, by_player_name)Removes all warnings from a player, will trigger remove event for each warning
    get_script_warnings (player)Gets an array of all the script warnings that a player has
    count_script_warnings (player)Gets the number of script warnings that a player has on them
    add_script_warning (player[, reason='Non given.'])Adds a script warning to a player, this may add a full warning if max script warnings is met
    remove_script_warning (player)Removes a script warning from a player
    clear_script_warnings (player)Removes all script warnings from a player, emits event for each warning removed
    + + +
    + + +

    Events

    +
    +
    +
    +
    + # + on_warning_added +
    +
    +
    +
    + +

    When a warning is added to a player

    +

    + + + Event Parameters: + +
      + + + + + +
    • + + player_index + + : + + (number) + + the index of the player who recived the warning + +
    • + + + + + +
    • + + by_player_name + + : + + (string) + + the name of the player who gave the warning + +
    • + + + + + +
    • + + reason + + : + + (string) + + the reason that the player was given a warning + +
    • + + + + + +
    • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + on_warning_removed +
    +
    +
    +
    + +

    When a warning is removed from a player

    +

    + + + Event Parameters: + +
      + + + + + +
    • + + player_index + + : + + (number) + + the index of the player who is having the warning removed + +
    • + + + + + +
    • + + warning_by_name + + : + + (string) + + the name of the player who gave the warning + +
    • + + + + + +
    • + + removed_by_name + + : + + (string) + + the name of the player who is removing the warning + +
    • + + + + + +
    • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + on_script_warning_added +
    +
    +
    +
    + +

    When a warning is added to a player, by the script

    +

    + + + Event Parameters: + +
      + + + + + +
    • + + player_index + + : + + (number) + + the index of the player who recived the warning + +
    • + + + + + +
    • + + reason + + : + + (string) + + the reason that the player was given a warning + +
    • + + + + + +
    • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + # + on_script_warning_removed +
    +
    +
    +
    + +

    When a warning is remnoved from a player, by the script

    +

    + + + Event Parameters: + +
      + + + + + +
    • + + player_index + + : + + (number) + + the index of the player who is having the warning removed + +
    • + + + + + +
    • + + warning_count + + : + + (number) + + the new number of warnings that the player has + +
    • + + +
    + + + + + + + + + + + + + +
    +
    +

    Dependencies

    +
    +
    +
    +
    + # + utils.event +
    +
    +
    +
    + +

    Allows registering of custom events

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.game +
    +
    +
    +
    + +

    Allows getting player from any value

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + utils.global +
    +
    +
    +
    + +

    Allows storing in the global table

    +

    + + + + + + + + + + + + + + +
    +
    +
    +
    + # + config.warnings +
    +
    +
    +
    + +

    Config file for this module

    +

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

    Functions

    +
    +
    +
    +
    + # + get_warnings (player) +
    +
    +
    +
    + +

    Gets an array of warnings that the player has, always returns a list even if emtpy

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to get the warning for + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + an array of all the warnings on this player, contains tick, by_player_name and reason +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + count_warnings (player) +
    +
    +
    +
    + +

    Gets the number of warnings that a player has on them

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to count the warnings for + +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of warnings that the player has +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + add_warning (player, by_player_name[, reason='Non given.']) +
    +
    +
    +
    + +

    Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to add a warning to + +
    • + + + + + +
    • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
    • + + + + + +
    • + + reason + + : + + (string) + + the reason that the player is being warned + + (default: 'Non given.') +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of warnings that the player has +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + remove_warning (player, by_player_name) +
    +
    +
    +
    + +

    Removes a warning from a player, always removes the earlyist warning, fifo

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to remove a warning from + +
    • + + + + + +
    • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of warnings that the player has +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + clear_warnings (player, by_player_name) +
    +
    +
    +
    + +

    Removes all warnings from a player, will trigger remove event for each warning

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to clear the warnings from + +
    • + + + + + +
    • + + by_player_name + + : + + (string) + + the name of the player who is doing the action + +
    • + + +
    + + + + + Returns: +
      +
    • + (boolean) + true when warnings were cleared succesfully +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + get_script_warnings (player) +
    +
    +
    +
    + +

    Gets an array of all the script warnings that a player has

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to get the script warnings of + +
    • + + +
    + + + + + Returns: +
      +
    • + (table) + a table of all the script warnings a player has, contains tick and reason +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + count_script_warnings (player) +
    +
    +
    +
    + +

    Gets the number of script warnings that a player has on them

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to count the script warnings of + +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of script warnings that the player has +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + add_script_warning (player[, reason='Non given.']) +
    +
    +
    +
    + +

    Adds a script warning to a player, this may add a full warning if max script warnings is met

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to add a script warning to + +
    • + + + + + +
    • + + reason + + : + + (string) + + the reason that the player is being warned + + (default: 'Non given.') +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of script warnings that the player has +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + remove_script_warning (player) +
    +
    +
    +
    + +

    Removes a script warning from a player

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to remove a script warning from + +
    • + + +
    + + + + + Returns: +
      +
    • + (number) + the number of script warnings that the player has +
    • +
    + + + + + + + + + +
    +
    +
    +
    + # + clear_script_warnings (player) +
    +
    +
    +
    + +

    Removes all script warnings from a player, emits event for each warning removed

    +

    + + + Parameters: + +
      + + + + + +
    • + + player + + : + + (LuaPlayer) + + the player to clear the script warnings from + +
    • + + +
    + + + + + + + + + + + + + +
    +
    + + + +
    +
    +
    + + + + diff --git a/doc/modules/modules.gui.player-list.html b/doc/modules/modules.gui.player-list.html index 7fc8957c..739b15f8 100644 --- a/doc/modules/modules.gui.player-list.html +++ b/doc/modules/modules.gui.player-list.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + modules.gui.player-list module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - - -
    -
    -
    -generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
    -
    - - + + + diff --git a/doc/modules/modules.gui.rocket-info.html b/doc/modules/modules.gui.rocket-info.html index 310b86a0..e05e2620 100644 --- a/doc/modules/modules.gui.rocket-info.html +++ b/doc/modules/modules.gui.rocket-info.html @@ -1,118 +1,247 @@ - - - - - Reference + + + + + + + + modules.gui.rocket-info module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + -
    -
    -
    -generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
    -
    - - + + + diff --git a/doc/modules/modules.gui.science-info.html b/doc/modules/modules.gui.science-info.html index 8df96f38..e9b374b5 100644 --- a/doc/modules/modules.gui.science-info.html +++ b/doc/modules/modules.gui.science-info.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + modules.gui.science-info module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - - -
    -
    -
    -generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
    -
    - - + + + diff --git a/doc/modules/modules.gui.task-list.html b/doc/modules/modules.gui.task-list.html index a14412da..8138bb55 100644 --- a/doc/modules/modules.gui.task-list.html +++ b/doc/modules/modules.gui.task-list.html @@ -1,118 +1,189 @@ - - - - - Reference + + + + + + + + modules.gui.task-list module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - - -
    -
    -
    -generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
    -
    - - + + + diff --git a/doc/modules/utils.alien_evolution_progress.html b/doc/modules/utils.alien_evolution_progress.html index a26633ee..3e6f3529 100644 --- a/doc/modules/utils.alien_evolution_progress.html +++ b/doc/modules/utils.alien_evolution_progress.html @@ -1,158 +1,274 @@ - - - - - Reference + + + + + + + + utils.alien_evolution_progress module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - +
  • + + total_aliens + + : + + + table + +
  • + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + diff --git a/doc/modules/utils.core.html b/doc/modules/utils.core.html index 41b857d2..5946f90d 100644 --- a/doc/modules/utils.core.html +++ b/doc/modules/utils.core.html @@ -1,452 +1,981 @@ - - - - - Reference + + + + + + + + utils.core module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - +
    +
    +
    + + + + diff --git a/doc/modules/utils.event_core.html b/doc/modules/utils.event_core.html index c0f45322..43f703ff 100644 --- a/doc/modules/utils.event_core.html +++ b/doc/modules/utils.event_core.html @@ -1,204 +1,386 @@ - - - - - Reference + + + + + + + + utils.event_core module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - + + + + + + + + + +
  • + + handler + + + + + +
  • + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + diff --git a/doc/modules/utils.math.html b/doc/modules/utils.math.html index 2760964b..f64391a5 100644 --- a/doc/modules/utils.math.html +++ b/doc/modules/utils.math.html @@ -1,161 +1,290 @@ - - - - - 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..783c5810 100644 --- a/doc/modules/utils.recipe_locker.html +++ b/doc/modules/utils.recipe_locker.html @@ -1,155 +1,271 @@ - - - - - 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..0eaaa743 100644 --- a/doc/modules/utils.table.html +++ b/doc/modules/utils.table.html @@ -1,583 +1,1293 @@ - - - - - Reference + + + + + + + + utils.table module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + + - - +
    +
    +
    + + + + diff --git a/doc/modules/utils.timestamp.html b/doc/modules/utils.timestamp.html index e2b2a781..9689bc56 100644 --- a/doc/modules/utils.timestamp.html +++ b/doc/modules/utils.timestamp.html @@ -1,217 +1,394 @@ - - - - - Reference + + + + + + + + utils.timestamp module + + + - - + + -
    +
    +
    -
    - -
    -
    -
    + + +