summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-25 16:29:14 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-25 16:41:16 -0500
commitdcf9bf648fb4645743d3a64c8f6391517ae415e5 (patch)
tree087feeb82dbefc96da7e4b18a40a1b65ab7516a6
parent58cac62bf41436ce157676df09031aa8aa6ed2a0 (diff)
downloadunifieddyes-dcf9bf648fb4645743d3a64c8f6391517ae415e5.tar
unifieddyes-dcf9bf648fb4645743d3a64c8f6391517ae415e5.tar.gz
unifieddyes-dcf9bf648fb4645743d3a64c8f6391517ae415e5.tar.bz2
unifieddyes-dcf9bf648fb4645743d3a64c8f6391517ae415e5.tar.xz
unifieddyes-dcf9bf648fb4645743d3a64c8f6391517ae415e5.zip
override default dyes to keep their hues/shades consistent
with how this mod uses them. Also fix missing aliases for same.
-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",