mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 12:16:37 +09:00
Refactor of commands
This commit is contained in:
48
old/modules/PlayerAutoColor/control.lua
Normal file
48
old/modules/PlayerAutoColor/control.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
--- Assigns random colours to players (larger range than default) and allows predefined colours for users.
|
||||
-- @module PlayerAutoColor@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alias ThisModule
|
||||
|
||||
-- Module Require
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
|
||||
-- Module Define
|
||||
local module_verbose = false
|
||||
local ThisModule = {}
|
||||
|
||||
-- Global Define
|
||||
local global = {
|
||||
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}
|
||||
}
|
||||
Global.register(global,function(tbl) global = tbl end)
|
||||
|
||||
-- Event Handlers Define
|
||||
Event.add(defines.events.on_player_created, function(event)
|
||||
local player = game.players[event.player_index]
|
||||
local colours = table.keys(defines.color)
|
||||
player.color = defines.color.black
|
||||
while player.color.r == defines.color.black.r and player.color.g == defines.color.black.g and player.color.b == defines.color.black.b
|
||||
or player.color.r == defines.color.white.r and player.color.g == defines.color.white.g and player.color.b == defines.color.white.b do
|
||||
player.color = defines.color[colours[math.random(#colours)]]
|
||||
if global[player.name] then
|
||||
local c = global[player.name]
|
||||
player.color = Color.from_rgb(c.r,c.g,c.b)
|
||||
end
|
||||
end
|
||||
player.chat_color = player.color
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
19
old/modules/PlayerAutoColor/softmod.json
Normal file
19
old/modules/PlayerAutoColor/softmod.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "PlayerAutoColor",
|
||||
"version": "4.0.0",
|
||||
"description": "Assigns random colours to players (larger range than default) and allows predefined colours for users.",
|
||||
"location": "FSM_ARCHIVE",
|
||||
"keywords": [
|
||||
"Colour",
|
||||
"Color",
|
||||
"Player",
|
||||
"Vibrant"
|
||||
],
|
||||
"author": "Cooldude2606",
|
||||
"contact": "Discord: Cooldude2606#5241",
|
||||
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
|
||||
"dependencies": {
|
||||
"FactorioStdLib.Color": "^0.8.0"
|
||||
},
|
||||
"submodules": {}
|
||||
}
|
||||
Reference in New Issue
Block a user