From 40101f3a68ba36e6ef97155e71f0b5e57fa0d755 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Tue, 6 Jul 2021 19:53:05 +1200 Subject: [PATCH] Allow other mods to use colorstring_to_number --- init.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index becac2f..5ec1e9f 100644 --- a/init.lua +++ b/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 + 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@([^%)]+)%)(.*)$")