diff --git a/config/preset_player_colours.lua b/config/preset_player_colours.lua new file mode 100644 index 00000000..8a15069e --- /dev/null +++ b/config/preset_player_colours.lua @@ -0,0 +1,36 @@ +return { + players={ + BADgamerNL={r=255,g=20,b=147}, + arty714={r=150,g=68,b=161}, + Cooldude2606={r=57,g=192,b=207}, + mark9064={r=99,g=0,b=255}, + eissturm={r=25,g=25,b=112}, + Sakama={r=20,g=213,b=80}, + Sakama={r=20,g=213,b=80}, + freek18={r=50,g=0,b=255}, + aldldl={r=0,g=131,b=255}, + NAD4X4={r=135,g=206,b=250}, + cydes={r=82,g=249,b=155}, + UUBlueFire={r=0,g=204,b=255} + }, + disallow = { -- the value does not matter it is only the key which is checked + black = {r = 0, g = 0, b = 0}, + white = {r = 255, g = 255, b = 255}, + jailed = {r = 255, g = 255, b = 255}, + probation = {r = 255, g = 255, b = 255}, + guest = {r = 255, g = 255, b = 255}, + auto_trusted = {r = 192, g = 192, b = 192}, + regular = {r = 0.155, g = 0.540, b = 0.898}, + admin = {r = 0.093, g = 0.768, b = 0.172}, + donator = {r = 172.6, g = 70.2, b = 215.8}, + [-10] = {r = 255, g = 255, b = 255}, + [0] = {r = 255, g = 255, b = 255}, + [10] = {r = 192, g = 192, b = 192}, + [20] = {r = 0.155, g = 0.540, b = 0.898}, + [30] = {r = 0.093, g = 0.768, b = 0.172}, + success = {r = 0, g = 255, b = 0}, + warning = {r = 255, g = 255, b = 0}, + fail = {r = 255, g = 0, b = 0}, + info = {r = 255, g = 255, b = 255} + } +} \ No newline at end of file diff --git a/modules/addons/random-player-colours.lua b/modules/addons/random-player-colours.lua new file mode 100644 index 00000000..df5b190b --- /dev/null +++ b/modules/addons/random-player-colours.lua @@ -0,0 +1,27 @@ +local Colours = require 'resources.colour_presets' +local Game = require 'utils.game' +local Event = require 'utils.events' +local config = require 'config.preset_player_colours' +local Global = require 'utils.global' +require 'utils.table' + +Global.reigster(config,function(tbl) + config = tbl +end) + +local white = Colours.white +local black = Colours.black +Event.add(defines.events.on_player_created,function(event) + local color = 'white' + if config.players[player.name] then + color = config.players[player.name] + else + while not config.disallow[color] do + color = table.get_random_dictionary_entry(Colours,true) + end + color = Colours[color] + end + color = {r=color.r/255,g=color.g/255,b=color.b/255,a=0.5} + player.color = color + player.chat_color = color +end) \ No newline at end of file diff --git a/old/modules/ExpGamingCommands/repair/control.lua b/old/modules/DONE/Commands/repair/control.lua similarity index 100% rename from old/modules/ExpGamingCommands/repair/control.lua rename to old/modules/DONE/Commands/repair/control.lua diff --git a/old/modules/ExpGamingCommands/repair/softmod.json b/old/modules/DONE/Commands/repair/softmod.json similarity index 100% rename from old/modules/ExpGamingCommands/repair/softmod.json rename to old/modules/DONE/Commands/repair/softmod.json diff --git a/old/modules/ExpGamingCommands/repair/src/tempban.lua b/old/modules/DONE/Commands/repair/src/tempban.lua similarity index 100% rename from old/modules/ExpGamingCommands/repair/src/tempban.lua rename to old/modules/DONE/Commands/repair/src/tempban.lua diff --git a/old/modules/PlayerAutoColor/control.lua b/old/modules/DONE/PlayerAutoColor/control.lua similarity index 100% rename from old/modules/PlayerAutoColor/control.lua rename to old/modules/DONE/PlayerAutoColor/control.lua diff --git a/old/modules/PlayerAutoColor/softmod.json b/old/modules/DONE/PlayerAutoColor/softmod.json similarity index 100% rename from old/modules/PlayerAutoColor/softmod.json rename to old/modules/DONE/PlayerAutoColor/softmod.json