Added Redmew Debugger and Debugged Checkboxs

This commit is contained in:
Cooldude2606
2019-05-10 22:47:10 +01:00
parent 5c43c5f854
commit 0559bade9c
21 changed files with 1067 additions and 72 deletions

View File

@@ -3,13 +3,11 @@
-- Dependencies
local Game = require 'utils.game'
local Color = require 'resources.color_presets'
local Server = require 'features.server'
-- localized functions
local random = math.random
local sqrt = math.sqrt
local floor = math.floor
local format = string.format
local match = string.match
local insert = table.insert
local concat = table.concat
@@ -201,27 +199,6 @@ function Module.set_and_return(tbl, key, value)
return value
end
--- Takes msg and prints it to all players. Also prints to the log and discord
-- @param msg <string> The message to print
-- @param warning_prefix <string> The name of the module/warning
function Module.action_warning(warning_prefix, msg)
game.print(prefix .. msg, Color.yellow)
msg = format('%s %s', warning_prefix, msg)
log(msg)
Server.to_discord_bold(msg)
end
--- Takes msg and prints it to all players except provided player. Also prints to the log and discord
-- @param msg <string> The message to print
-- @param warning_prefix <string> The name of the module/warning
-- @param player <LuaPlayer> the player not to send the message to
function Module.silent_action_warning(warning_prefix, msg, player)
Module.print_except(prefix .. msg, player, Color.yellow)
msg = format('%s %s', warning_prefix, msg)
log(msg)
Server.to_discord_bold(msg)
end
-- add utility functions that exist in base factorio/util
require 'util'

View File

@@ -36,7 +36,7 @@ function Global.register_init(tbl, init_handler, callback)
)
end
if _DEBUG then
if _DEBUG or true then
local concat = table.concat
local names = {}