1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-08-05 13:00:19 +02:00

add curtain rods and "opened" curtains

rods in brass, wrought iron, wood
opened curtains in same colors as regular
made all curtains use texture alpha, gave their textures ~90% opacity
moved curtains defs into window_treatments.lua
This commit is contained in:
Vanessa Ezekowitz
2014-08-10 17:37:58 -04:00
parent 6519231604
commit 256029f259
18 changed files with 115 additions and 39 deletions

View File

@ -1,4 +1,6 @@
local S = homedecor.gettext
minetest.register_node("homedecor:window_quartered", {
description = "Window",
tiles = {
@ -189,3 +191,85 @@ minetest.register_node("homedecor:blinds_thin", {
},
})
local curtaincolors = {
"red",
"green",
"blue",
"white",
"pink",
"violet"
}
for c in ipairs(curtaincolors) do
local color = curtaincolors[c]
local color_d = S(curtaincolors[c])
minetest.register_node("homedecor:curtain_"..color, {
description = S("Curtains (%s)"):format(color_d),
tiles = { "homedecor_curtain_"..color..".png" },
inventory_image = "homedecor_curtain_"..color..".png",
wield_image = "homedecor_curtain_"..color..".png",
drawtype = 'signlike',
sunlight_propagates = true,
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
paramtype2 = 'wallmounted',
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("homedecor:curtain_open_"..color, {
description = S("Curtains (%s)"):format(color_d),
tiles = { "homedecor_curtain_open_"..color..".png" },
inventory_image = "homedecor_curtain_open_"..color..".png",
wield_image = "homedecor_curtain_open_"..color..".png",
drawtype = 'signlike',
sunlight_propagates = true,
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
paramtype2 = 'wallmounted',
selection_box = {
type = "wallmounted",
},
})
end
local mats = {
{ "brass", "Brass", "homedecor_tile_brass2.png" },
{ "wrought_iron", "Wrought iron", "homedecor_tile_wrought_iron2.png" },
{ "wood", "Wooden", "default_wood.png" }
}
for i in ipairs(mats) do
local material = mats[i][1]
local mat_name = mats[i][2]
local texture = mats[i][3]
minetest.register_node("homedecor:curtainrod_"..material, {
tiles = { texture },
inventory_image = "homedecor_curtainrod_"..material.."_inv.png",
description = "Curtain Rod ("..mat_name..")",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = { snappy = 3 },
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.375, 0.5, -0.4375, 0.4375},
{-0.4375, -0.5, 0.4375, -0.375, -0.4375, 0.5},
{0.375, -0.5, 0.4375, 0.4375, -0.4375, 0.5}
}
}
})
end