Allow other mods to use colorstring_to_number
This commit is contained in:
parent
f095267be0
commit
40101f3a68
5
init.lua
5
init.lua
|
@ -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
|
||||
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@([^%)]+)%)(.*)$")
|
||||
|
|
Loading…
Reference in New Issue