mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Fixed player list colours
This commit is contained in:
@@ -28,7 +28,7 @@ end
|
|||||||
|
|
||||||
--- Returns a colour that is a bit lighter than the one given
|
--- Returns a colour that is a bit lighter than the one given
|
||||||
local function lighten(c)
|
local function lighten(c)
|
||||||
return {r = 1 - (1 - c.r) * 0.5, g = 1 - (1 - c.g) * 0.5, b = 1 - (1 - c.b) * 0.5, a = 1}
|
return {r = 255 - (255 - c.r) * 0.5, g = 255 - (255 - c.g) * 0.5, b = 255 - (255 - c.b) * 0.5, a = 255}
|
||||||
end
|
end
|
||||||
|
|
||||||
--- When your data loads apply the players colour, or a random on if none is saved
|
--- When your data loads apply the players colour, or a random on if none is saved
|
||||||
@@ -36,7 +36,7 @@ PlayerColours:on_load(function(player_name, player_colour)
|
|||||||
if not player_colour then
|
if not player_colour then
|
||||||
local preset = config.players[player_name]
|
local preset = config.players[player_name]
|
||||||
if preset then
|
if preset then
|
||||||
player_colour = {preset, preset}
|
player_colour = {preset, lighten(preset)}
|
||||||
else
|
else
|
||||||
local colour_name = 'white'
|
local colour_name = 'white'
|
||||||
while config.disallow[colour_name] do
|
while config.disallow[colour_name] do
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ local function get_player_list_order()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--[[Adds fake players to the player list
|
--[[Adds fake players to the player list
|
||||||
|
local tick = game.tick+1
|
||||||
for i = 1, 10 do
|
for i = 1, 10 do
|
||||||
local online_time = math.random(1, tick)
|
local online_time = math.random(1, tick)
|
||||||
local afk_time = math.random(online_time-(tick/10), tick)
|
local afk_time = math.random(online_time-(tick/10), tick)
|
||||||
@@ -337,7 +338,7 @@ local function get_player_list_order()
|
|||||||
caption = caption,
|
caption = caption,
|
||||||
tooltip = tooltip
|
tooltip = tooltip
|
||||||
}
|
}
|
||||||
end]]
|
end--]]
|
||||||
|
|
||||||
return player_list_order
|
return player_list_order
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user