Allow other mods to use colorstring_to_number

This commit is contained in:
luk3yx 2021-07-06 19:53:05 +12:00
parent f095267be0
commit 40101f3a68
1 changed files with 4 additions and 5 deletions

View File

@ -24,13 +24,12 @@ if minetest.global_exists("modlib") and (modlib.version or 0) >= 54 then
return spec:to_number_rgb()
end
else
function colorstring_to_number(col)
colorstring_to_number = dofile(minetest.get_modpath(modname) ..
"/colorstring_to_number.lua")
return colorstring_to_number(col)
end
colorstring_to_number = dofile(minetest.get_modpath(modname) ..
"/colorstring_to_number.lua")
end
hud_fs.colorstring_to_number = colorstring_to_number
-- Hacks to allow colorize() to work to some extent on labels
local function get_label_number(label)
local number, text = label:match("^\027%(c@([^%)]+)%)(.*)$")