Many Changes To Doc

This commit is contained in:
Cooldude2606
2018-05-29 22:56:54 +01:00
parent 9b80e8d8fe
commit 310d9599b8
31 changed files with 798 additions and 561 deletions

View File

@@ -160,8 +160,8 @@ function left._left.toggle(event)
else
left.style.visible = false
end
if open == false then player_return({'gui.cant-open-no-reason'},defines.text_color.crit,player) player.play_sound{path='utility/cannot_build'}
elseif open ~= true then player_return({'gui.cant-open',open},defines.text_color.crit,player) player.play_sound{path='utility/cannot_build'} end
if open == false then player_return({'gui.cant-open-no-reason'},defines.textcolor.crit,player) player.play_sound{path='utility/cannot_build'}
elseif open ~= true then player_return({'gui.cant-open',open},defines.textcolor.crit,player) player.play_sound{path='utility/cannot_build'} end
end
-- draws the left guis when a player first joins, fake_event is just because i am lazy

View File

@@ -82,7 +82,7 @@ local function run_custom_command(command)
local player_name = Game.get_player(command) and Game.get_player(command).name or 'server'
-- is the player allowed to use this command
if is_type(Ranking,'table') and Ranking._presets and Ranking._presets().meta.rank_count > 0 and not Ranking.get_rank(player_name):allowed(command.name) then
player_return({'commands.unauthorized'},defines.text_color.crit)
player_return({'commands.unauthorized'},defines.textcolor.crit)
if game.player then game.player.play_sound{path='utility/cannot_build'} end
game.write_file('commands.log',
game.tick
@@ -96,7 +96,7 @@ local function run_custom_command(command)
-- gets the args for the command
local args, valid = command_args(command,command_data)
if not valid then
player_return({'commands.invalid-inputs',command.name,command_inputs(command_data)},defines.text_color.high)
player_return({'commands.invalid-inputs',command.name,command_inputs(command_data)},defines.textcolor.high)
if game.player then game.player.play_sound{path='utility/deconstruct_big'} end
game.write_file('commands.log',
game.tick
@@ -110,7 +110,7 @@ local function run_custom_command(command)
-- runs the command
local success, err = pcall(command_calls[command.name],command,args)
if not success then error(err) end
if err ~= commands.error and player_name ~= 'server' then player_return({'commands.command-ran'},defines.text_color.info) end
if err ~= commands.error and player_name ~= 'server' then player_return({'commands.command-ran'},defines.textcolor.info) end
game.write_file('commands.log',
game.tick
..' Player: "'..player_name..'"'

View File

@@ -121,7 +121,7 @@ end
-- @param[opt='server'] by_player the player who is giving the rank
-- @param[opt=game.tick] tick the tick that the rank is being given on
function Ranking.give_rank(player,rank,by_player,tick)
local print_colour = defines.text_color.info
local print_colour = defines.textcolor.info
local tick = tick or game.tick
local by_player_name = Game.get_player(by_player) and Game.get_player(by_player).name or game.player and game.player.name or is_type(by_player,'string') and by_player or 'server'
local rank = Ranking.get_rank(rank) or Ranking.get_rank(Ranking._presets().meta.default)
@@ -154,7 +154,7 @@ function Ranking.give_rank(player,rank,by_player,tick)
if rank.group.name == 'Jail' and Ranking._presets().last_jail ~= player.name then
Sync.emit_embeded{
title='Player Jail',
color=Color.to_hex(defines.text_color.med),
color=Color.to_hex(defines.textcolor.med),
description='There was a player jailed.',
['Player:']=player.name,
['By:']='<<inline>>'..by_player_name,

View File

@@ -122,7 +122,7 @@ function Server._thread_handler(event)
table.each(Server._threads().print_to,function(print_to,player_index,event)
if event.name == defines.events.on_tick then return true end
if print_to[event.name] then
player_return(event,defines.text_color.bg,player_index)
player_return(event,defines.textcolor.bg,player_index)
end
end,event)
local event_id = event.name

View File

@@ -93,7 +93,7 @@ end
-- set up error handle
verbose('Set New Error Handle')
_G.error_handle = function(err)
local color = _G.Color and Color.to_hex(defines.text_color.bg) or '0x0'
local color = _G.Color and Color.to_hex(defines.textcolor.bg) or '0x0'
Sync.emit_embeded{title='SCRIPT ERROR',color=color,description='There was an error in the script @Developers ',Error=err}
end