mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-05-28 22:16:02 +09:00
Added comments to config files
This commit is contained in:
@@ -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 Gui = require 'expcore.gui'
|
||||||
local Roles = require 'expcore.roles'
|
local Roles = require 'expcore.roles'
|
||||||
local Store = require 'expcore.store'
|
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_player_store = 'gui.left.player-list.action-player'
|
||||||
local action_name_store = 'gui.left.player-list.action-name'
|
local action_name_store = 'gui.left.player-list.action-name'
|
||||||
|
|
||||||
|
-- common style used by all action buttons
|
||||||
local function tool_button_style(style)
|
local function tool_button_style(style)
|
||||||
Gui.set_padding_style(style,-1,-1,-1,-1)
|
Gui.set_padding_style(style,-1,-1,-1,-1)
|
||||||
style.height = 28
|
style.height = 28
|
||||||
style.width = 28
|
style.width = 28
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- auth that will only allow when on player's of lower roles
|
||||||
local function auth_lower_role(player,action_player_name)
|
local function auth_lower_role(player,action_player_name)
|
||||||
local player_highest = Roles.get_player_highest_role(player)
|
local player_highest = Roles.get_player_highest_role(player)
|
||||||
local action_player_highest = Roles.get_player_highest_role(action_player_name)
|
local action_player_highest = Roles.get_player_highest_role(action_player_name)
|
||||||
@@ -24,6 +31,7 @@ local function auth_lower_role(player,action_player_name)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- gets the action player and a coloured name for the action to be used on
|
||||||
local function get_action_player(player)
|
local function get_action_player(player)
|
||||||
local action_player_name = Store.get_child(action_player_store,player.name)
|
local action_player_name = Store.get_child(action_player_store,player.name)
|
||||||
local action_player = Game.get_player_from_any(action_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
|
return action_player,action_player_name_color
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- telports one player to another
|
||||||
local function teleport(from_player,to_player)
|
local function teleport(from_player,to_player)
|
||||||
local surface = to_player.surface
|
local surface = to_player.surface
|
||||||
local position = surface.find_non_colliding_position('character',to_player.position,32,1)
|
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
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- teleports the user to the action player
|
||||||
local goto_player =
|
local goto_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/export')
|
:set_sprites('utility/export')
|
||||||
@@ -50,6 +60,7 @@ Gui.new_button()
|
|||||||
teleport(player,action_player)
|
teleport(player,action_player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- teleports the action player to the user
|
||||||
local bring_player =
|
local bring_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/import')
|
:set_sprites('utility/import')
|
||||||
@@ -60,6 +71,7 @@ Gui.new_button()
|
|||||||
teleport(action_player,player)
|
teleport(action_player,player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- kills the action player, if there are alive
|
||||||
local kill_player =
|
local kill_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/too_far')
|
:set_sprites('utility/too_far')
|
||||||
@@ -72,6 +84,7 @@ Gui.new_button()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- reports the action player, requires a reason to be given
|
||||||
local report_player =
|
local report_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/spawn_flag')
|
:set_sprites('utility/spawn_flag')
|
||||||
@@ -89,6 +102,7 @@ local function report_player_callback(player,reason)
|
|||||||
Reports.report_player(action_player,reason,player.name)
|
Reports.report_player(action_player,reason,player.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- gives the action player a warning, requires a reason
|
||||||
local warn_player =
|
local warn_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/spawn_flag')
|
:set_sprites('utility/spawn_flag')
|
||||||
@@ -105,6 +119,7 @@ local function warn_player_callback(player,reason)
|
|||||||
Warnings.add_warnings(action_player,player.name)
|
Warnings.add_warnings(action_player,player.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- jails the action player, requires a reason
|
||||||
local jail_player =
|
local jail_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/item_editor_icon')
|
:set_sprites('utility/item_editor_icon')
|
||||||
@@ -121,6 +136,7 @@ local function jail_player_callback(player,reason)
|
|||||||
Jail.jail_player(action_player,player.name)
|
Jail.jail_player(action_player,player.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- temp bans the action player, requires a reason
|
||||||
local temp_ban_player =
|
local temp_ban_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/clock')
|
: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)
|
Jail.temp_ban_player(action_player,player.name,reason)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- kicks the action player, requires a reason
|
||||||
local kick_player =
|
local kick_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/warning_icon')
|
:set_sprites('utility/warning_icon')
|
||||||
@@ -149,6 +166,7 @@ local function kick_player_callback(player,reason)
|
|||||||
game.kick_player(action_player,reason)
|
game.kick_player(action_player,reason)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- bans the action player, requires a reason
|
||||||
local ban_player =
|
local ban_player =
|
||||||
Gui.new_button()
|
Gui.new_button()
|
||||||
:set_sprites('utility/danger_icon')
|
:set_sprites('utility/danger_icon')
|
||||||
@@ -167,7 +185,7 @@ return {
|
|||||||
['command/teleport'] = {
|
['command/teleport'] = {
|
||||||
auth=function(player,action_player_name)
|
auth=function(player,action_player_name)
|
||||||
return player.name ~= action_player_name
|
return player.name ~= action_player_name
|
||||||
end,
|
end, -- cant teleport to your self
|
||||||
goto_player,
|
goto_player,
|
||||||
bring_player
|
bring_player
|
||||||
},
|
},
|
||||||
@@ -178,7 +196,7 @@ return {
|
|||||||
elseif Roles.player_allowed(player,'command/kill/always') then
|
elseif Roles.player_allowed(player,'command/kill/always') then
|
||||||
return auth_lower_role(player,action_player_name)
|
return auth_lower_role(player,action_player_name)
|
||||||
end
|
end
|
||||||
end,
|
end, -- player must be lower role, or your self
|
||||||
kill_player
|
kill_player
|
||||||
},
|
},
|
||||||
['command/report'] = {
|
['command/report'] = {
|
||||||
@@ -186,12 +204,12 @@ return {
|
|||||||
if not Roles.player_allowed(player,'command/give-warning') then
|
if not Roles.player_allowed(player,'command/give-warning') then
|
||||||
return not Roles.player_has_flag(action_player_name,'report-immune')
|
return not Roles.player_has_flag(action_player_name,'report-immune')
|
||||||
end
|
end
|
||||||
end,
|
end, -- can report any player that isnt immune and you arnt able to give warnings
|
||||||
reason_callback=report_player_callback,
|
reason_callback=report_player_callback,
|
||||||
report_player
|
report_player
|
||||||
},
|
},
|
||||||
['command/give-warning'] = {
|
['command/give-warning'] = {
|
||||||
auth=auth_lower_role,
|
auth=auth_lower_role, -- warn a lower user, replaces report
|
||||||
reason_callback=warn_player_callback,
|
reason_callback=warn_player_callback,
|
||||||
warn_player
|
warn_player
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
-- config file for the compliatrons including where they spawn and what messages they show
|
||||||
return {
|
return {
|
||||||
message_cycle=60*15, -- 15 seconds default, how often (in ticks) the messages will cycle
|
message_cycle=60*15, -- 15 seconds default, how often (in ticks) the messages will cycle
|
||||||
locations={ -- defines the spawn locations for all compilatrons
|
locations={ -- defines the spawn locations for all compilatrons
|
||||||
|
|||||||
@@ -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 {
|
return {
|
||||||
players={
|
players={
|
||||||
BADgamerNL={r=255,g=20,b=147},
|
BADgamerNL={r=255,g=20,b=147},
|
||||||
|
|||||||
+6
-5
@@ -1,13 +1,14 @@
|
|||||||
|
-- config file for the repair command
|
||||||
return {
|
return {
|
||||||
disallow = {
|
disallow = { -- items in this list will never be repaired
|
||||||
['loader']=true,
|
['loader']=true,
|
||||||
['fast-loader']=true,
|
['fast-loader']=true,
|
||||||
['express-loader']=true,
|
['express-loader']=true,
|
||||||
['electric-energy-interface']=true,
|
['electric-energy-interface']=true,
|
||||||
['infinity-chest']=true
|
['infinity-chest']=true
|
||||||
},
|
},
|
||||||
max_range=50,
|
max_range=50, -- the max range that can be used with the repair command
|
||||||
allow_blueprint_repair=false,
|
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,
|
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
|
allow_heal_entities=true -- when true will heal entities to full health that are within range
|
||||||
}
|
}
|
||||||
+3
-2
@@ -1,5 +1,6 @@
|
|||||||
return {
|
-- config file for the science info gui
|
||||||
show_eta=true,
|
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',
|
'automation-science-pack',
|
||||||
'logistic-science-pack',
|
'logistic-science-pack',
|
||||||
'military-science-pack',
|
'military-science-pack',
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
-- config file for the tasks gui
|
||||||
return {
|
return {
|
||||||
only_admins_can_edit = false, -- true will hide the edit and delete buttons from non (game) admins
|
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
|
edit_tasks_role_permision = 'gui/task-list/edit' -- value used with custom permision system
|
||||||
|
|||||||
Reference in New Issue
Block a user