From dcf9bf648fb4645743d3a64c8f6391517ae415e5 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sat, 25 Feb 2017 16:29:14 -0500 Subject: override default dyes to keep their hues/shades consistent with how this mod uses them. Also fix missing aliases for same. --- init.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 00c3cf2..adb03ce 100644 --- a/init.lua +++ b/init.lua @@ -706,18 +706,20 @@ for _, h in ipairs(unifieddyes.HUES_EXTENDED) do desc = val:sub(1, -2):gsub("%a", string.upper, 1) .." "..desc end - if not minetest.registered_items["dye:"..val..hue] then - - local color = string.format("%02x", r2)..string.format("%02x", g2)..string.format("%02x", b2) - + local color = string.format("%02x", r2)..string.format("%02x", g2)..string.format("%02x", b2) + if minetest.registered_items["dye:"..val..hue] then + minetest.override_item("dye:"..val..hue, { + inventory_image = "unifieddyes_dye.png^[colorize:#"..color..":200" + }) + else minetest.register_craftitem(":dye:"..val..hue, { description = S(desc), inventory_image = "unifieddyes_dye.png^[colorize:#"..color..":200", groups = { dye=1, not_in_creative_inventory=1 }, on_use = unifieddyes.on_use }) - minetest.register_alias("unifieddyes:"..val..hue, "dye:"..val..hue) end + minetest.register_alias("unifieddyes:"..val..hue, "dye:"..val..hue) if v > 3 then -- also register the low-sat version @@ -763,6 +765,14 @@ for y = 1, 14 do -- colors 0 and 15 are black and white, default dyes end end +minetest.override_item("dye:grey", { + inventory_image = "unifieddyes_dye.png^[colorize:#888888:200" +}) + +minetest.override_item("dye:dark_grey", { + inventory_image = "unifieddyes_dye.png^[colorize:#444444:200" +}) + minetest.register_craftitem(":dye:light_grey", { description = S("Light grey Dye"), inventory_image = "unifieddyes_dye.png^[colorize:#cccccc:200", -- cgit v1.2.3