feature/control-separation

This commit is contained in:
Cooldude2606
2019-07-22 16:31:05 +01:00
435 changed files with 52086 additions and 22747 deletions

View File

@@ -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')

View File

@@ -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',

View File

@@ -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
}