mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-30 11:46:24 +01:00
introduce coloured loot message
This commit is contained in:
@@ -8,4 +8,33 @@ function dirtostring(dir)
|
||||
return k
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function toHighlightedText(text, color)
|
||||
local tmpData = {}
|
||||
|
||||
for i, part in ipairs(text:split("[")) do
|
||||
if i == 1 then
|
||||
table.insert(tmpData, part)
|
||||
table.insert(tmpData, color)
|
||||
else
|
||||
for j, part2 in ipairs(part:split("]")) do
|
||||
if j == 1 then
|
||||
local text = part2:split(":")
|
||||
if #text == 2 then
|
||||
table.insert(tmpData, part2:split(":")[2])
|
||||
table.insert(tmpData, part2:split(":")[1])
|
||||
else
|
||||
table.insert(tmpData, '[' .. part2 .. ']')
|
||||
table.insert(tmpData, color)
|
||||
end
|
||||
else
|
||||
table.insert(tmpData, part2)
|
||||
table.insert(tmpData, color)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return tmpData
|
||||
end
|
||||
Reference in New Issue
Block a user