diff --git a/config/action_buttons.lua b/config/action_buttons.lua index cd48100d..10002094 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -1,3 +1,8 @@ +--- Config for the different action buttons that show on the player list +-- each button has the button define(s) given along side an auth function, and optional reason callback +-- if a reason callback is used then Store.set_child(action_name_store,player.name,'BUTTON_NAME') should be called during on_click +-- buttons can be removed from the gui by commenting them out of the config at the bottom of this file +-- the key used for the name of the button is the permision name used by the role system local Gui = require 'expcore.gui' local Roles = require 'expcore.roles' local Store = require 'expcore.store' @@ -10,12 +15,14 @@ local format_chat_player_name = ext_require('expcore.common','format_chat_player local action_player_store = 'gui.left.player-list.action-player' local action_name_store = 'gui.left.player-list.action-name' +-- common style used by all action buttons local function tool_button_style(style) Gui.set_padding_style(style,-1,-1,-1,-1) style.height = 28 style.width = 28 end +-- auth that will only allow when on player's of lower roles local function auth_lower_role(player,action_player_name) local player_highest = Roles.get_player_highest_role(player) local action_player_highest = Roles.get_player_highest_role(action_player_name) @@ -24,6 +31,7 @@ local function auth_lower_role(player,action_player_name) end end +-- gets the action player and a coloured name for the action to be used on local function get_action_player(player) local action_player_name = Store.get_child(action_player_store,player.name) local action_player = Game.get_player_from_any(action_player_name) @@ -31,6 +39,7 @@ local function get_action_player(player) return action_player,action_player_name_color end +-- telports one player to another local function teleport(from_player,to_player) local surface = to_player.surface local position = surface.find_non_colliding_position('character',to_player.position,32,1) @@ -40,6 +49,7 @@ local function teleport(from_player,to_player) return true end +-- teleports the user to the action player local goto_player = Gui.new_button() :set_sprites('utility/export') @@ -50,6 +60,7 @@ Gui.new_button() teleport(player,action_player) end) +-- teleports the action player to the user local bring_player = Gui.new_button() :set_sprites('utility/import') @@ -60,6 +71,7 @@ Gui.new_button() teleport(action_player,player) end) +-- kills the action player, if there are alive local kill_player = Gui.new_button() :set_sprites('utility/too_far') @@ -72,6 +84,7 @@ Gui.new_button() end end) +-- reports the action player, requires a reason to be given local report_player = Gui.new_button() :set_sprites('utility/spawn_flag') @@ -89,6 +102,7 @@ local function report_player_callback(player,reason) Reports.report_player(action_player,reason,player.name) end +-- gives the action player a warning, requires a reason local warn_player = Gui.new_button() :set_sprites('utility/spawn_flag') @@ -105,6 +119,7 @@ local function warn_player_callback(player,reason) Warnings.add_warnings(action_player,player.name) end +-- jails the action player, requires a reason local jail_player = Gui.new_button() :set_sprites('utility/item_editor_icon') @@ -121,6 +136,7 @@ local function jail_player_callback(player,reason) Jail.jail_player(action_player,player.name) end +-- temp bans the action player, requires a reason local temp_ban_player = Gui.new_button() :set_sprites('utility/clock') @@ -135,6 +151,7 @@ local function temp_ban_player_callback(player,reason) Jail.temp_ban_player(action_player,player.name,reason) end +-- kicks the action player, requires a reason local kick_player = Gui.new_button() :set_sprites('utility/warning_icon') @@ -149,6 +166,7 @@ local function kick_player_callback(player,reason) game.kick_player(action_player,reason) end +-- bans the action player, requires a reason local ban_player = Gui.new_button() :set_sprites('utility/danger_icon') @@ -167,7 +185,7 @@ return { ['command/teleport'] = { auth=function(player,action_player_name) return player.name ~= action_player_name - end, + end, -- cant teleport to your self goto_player, bring_player }, @@ -178,7 +196,7 @@ return { elseif Roles.player_allowed(player,'command/kill/always') then return auth_lower_role(player,action_player_name) end - end, + end, -- player must be lower role, or your self kill_player }, ['command/report'] = { @@ -186,12 +204,12 @@ return { if not Roles.player_allowed(player,'command/give-warning') then return not Roles.player_has_flag(action_player_name,'report-immune') end - end, + end, -- can report any player that isnt immune and you arnt able to give warnings reason_callback=report_player_callback, report_player }, ['command/give-warning'] = { - auth=auth_lower_role, + auth=auth_lower_role, -- warn a lower user, replaces report reason_callback=warn_player_callback, warn_player }, diff --git a/config/compilatron.lua b/config/compilatron.lua index a4980f92..47ffccb3 100644 --- a/config/compilatron.lua +++ b/config/compilatron.lua @@ -1,3 +1,4 @@ +-- config file for the compliatrons including where they spawn and what messages they show return { message_cycle=60*15, -- 15 seconds default, how often (in ticks) the messages will cycle locations={ -- defines the spawn locations for all compilatrons diff --git a/config/preset_player_colours.lua b/config/preset_player_colours.lua index 527ad065..d10fd64a 100644 --- a/config/preset_player_colours.lua +++ b/config/preset_player_colours.lua @@ -1,3 +1,4 @@ +-- preset colours that players get when they join the server, if not in the list then will be given a random colour (which isnt disallowed) return { players={ BADgamerNL={r=255,g=20,b=147}, diff --git a/config/repair.lua b/config/repair.lua index dd58d8be..5980c8c2 100644 --- a/config/repair.lua +++ b/config/repair.lua @@ -1,13 +1,14 @@ +-- config file for the repair command return { - disallow = { + disallow = { -- items in this list will never be repaired ['loader']=true, ['fast-loader']=true, ['express-loader']=true, ['electric-energy-interface']=true, ['infinity-chest']=true }, - max_range=50, - allow_blueprint_repair=false, - allow_ghost_revive=true, - allow_heal_entities=true + max_range=50, -- the max range that can be used with the repair command + allow_blueprint_repair=false, -- when true will allow blueprints (things not destroied by biters) to be build instently using the repair command + allow_ghost_revive=true, -- when true will allow ghosts (things destoried by biters) to be build instently using the repair command + allow_heal_entities=true -- when true will heal entities to full health that are within range } \ No newline at end of file diff --git a/config/science.lua b/config/science.lua index 9fd7334a..194303f3 100644 --- a/config/science.lua +++ b/config/science.lua @@ -1,5 +1,6 @@ -return { - show_eta=true, +-- 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 'automation-science-pack', 'logistic-science-pack', 'military-science-pack', diff --git a/config/tasks.lua b/config/tasks.lua index 7b1502e5..4c6bd54a 100644 --- a/config/tasks.lua +++ b/config/tasks.lua @@ -1,3 +1,4 @@ +-- config file for the tasks gui return { only_admins_can_edit = false, -- true will hide the edit and delete buttons from non (game) admins edit_tasks_role_permision = 'gui/task-list/edit' -- value used with custom permision system