2013-03-18 00:09:42 +01:00
|
|
|
-- Various kinds of window shutters
|
|
|
|
|
2017-01-30 00:12:02 +01:00
|
|
|
local S = homedecor_i18n.gettext
|
2013-03-18 00:09:42 +01:00
|
|
|
|
2013-08-28 11:31:42 +02:00
|
|
|
local shutters = {
|
2017-01-25 10:22:28 +01:00
|
|
|
{"oak", S("unpainted oak"), "bf8a51" },
|
|
|
|
{"mahogany", S("mahogany"), "822606" },
|
|
|
|
{"red", S("red"), "d00000" },
|
|
|
|
{"yellow", S("yellow"), "ffff00" },
|
|
|
|
{"forest_green", S("forest green"), "006000" },
|
|
|
|
{"light_blue", S("light blue"), "2878d8" },
|
|
|
|
{"violet", S("violet"), "7000e0" },
|
|
|
|
{"black", S("black"), "181818" },
|
|
|
|
{"dark_grey", S("dark grey"), "404040" },
|
|
|
|
{"grey", S("grey"), "b0b0b0" },
|
|
|
|
{"white", S("white"), "ffffff" },
|
2013-08-28 11:31:42 +02:00
|
|
|
}
|
|
|
|
|
2015-01-25 21:32:36 +01:00
|
|
|
local shutter_cbox = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
|
|
|
|
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
|
2015-05-04 05:47:43 +02:00
|
|
|
wall_side = { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 }
|
2015-01-25 21:32:36 +01:00
|
|
|
}
|
|
|
|
|
2017-01-24 21:43:20 +01:00
|
|
|
for _, s in ipairs(shutters) do
|
|
|
|
local name, desc, hue = unpack(s)
|
2015-05-04 05:47:43 +02:00
|
|
|
|
2017-01-25 10:22:28 +01:00
|
|
|
local tile = { name = "homedecor_window_shutter.png", color = tonumber("0xff"..hue) }
|
|
|
|
local inv = "homedecor_window_shutter_inv.png^[colorize:#"..hue..":150"
|
2013-08-28 11:31:42 +02:00
|
|
|
|
2015-01-25 21:32:36 +01:00
|
|
|
homedecor.register("shutter_"..name, {
|
|
|
|
mesh = "homedecor_window_shutter.obj",
|
2015-05-04 05:47:43 +02:00
|
|
|
tiles = { tile },
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Wooden Shutter (@1)", desc),
|
2015-05-04 05:47:43 +02:00
|
|
|
inventory_image = inv,
|
|
|
|
wield_image = inv,
|
2015-01-25 21:32:36 +01:00
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
selection_box = shutter_cbox,
|
|
|
|
node_box = shutter_cbox,
|
|
|
|
-- collision_box doesn't accept type="wallmounted", but node_box
|
|
|
|
-- does. Said nodeboxes create a custom collision box but are
|
|
|
|
-- invisible themselves because drawtype="mesh".
|
|
|
|
})
|
2013-08-28 11:31:42 +02:00
|
|
|
end
|
2013-04-03 23:03:42 +02:00
|
|
|
|
|
|
|
minetest.register_alias("homedecor:shutter_purple", "homedecor:shutter_violet")
|