mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Added Player Auto Color
This commit is contained in:
36
config/preset_player_colours.lua
Normal file
36
config/preset_player_colours.lua
Normal file
@@ -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}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
modules/addons/random-player-colours.lua
Normal file
27
modules/addons/random-player-colours.lua
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user