summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua20
1 files 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",