add table lamps in different colors to match curtains

This commit is contained in:
Vanessa Ezekowitz 2014-06-25 02:08:54 -04:00
parent d1c01d3dff
commit 2fe54e38e0
26 changed files with 18 additions and 11 deletions

View File

@ -110,15 +110,18 @@ for i in ipairs(chaircolors) do
end end
local repl = { off="low", low="med", med="hi", hi="max", max="off", } local repl = { off="low", low="med", med="hi", hi="max", max="off", }
local lamp_colors = { "", "blue", "green", "pink", "red", "violet" }
local function reg_lamp(suffix, nxt, desc, tilesuffix, light) local function reg_lamp(suffix, nxt, desc, tilesuffix, light, color)
minetest.register_node("homedecor:table_lamp_"..suffix, { local lampcolor = "_"..color
if color == "" then lampcolor = "" end
minetest.register_node("homedecor:table_lamp"..lampcolor.."_"..suffix, {
description = S(desc), description = S(desc),
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"forniture_table_lamp_s"..tilesuffix..".png", "forniture_table_lamp_s"..tilesuffix..".png",
"forniture_table_lamp_s"..tilesuffix..".png", "forniture_table_lamp_s"..tilesuffix..".png",
"forniture_table_lamp_l"..tilesuffix..".png", "forniture_table_lamp"..lampcolor.."_l"..tilesuffix..".png",
}, },
paramtype = "light", paramtype = "light",
node_box = { node_box = {
@ -144,21 +147,25 @@ local function reg_lamp(suffix, nxt, desc, tilesuffix, light)
groups = {cracky=2,oddly_breakable_by_hand=1, groups = {cracky=2,oddly_breakable_by_hand=1,
not_in_creative_inventory=((desc == nil) and 1) or nil, not_in_creative_inventory=((desc == nil) and 1) or nil,
}, },
drop = "homedecor:table_lamp_off", drop = "homedecor:table_lamp"..lampcolor.."_off",
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
node.name = "homedecor:table_lamp_"..repl[suffix] node.name = "homedecor:table_lamp"..lampcolor.."_"..repl[suffix]
minetest.set_node(pos, node) minetest.set_node(pos, node)
nodeupdate(pos) nodeupdate(pos)
end, end,
}) })
if lampcolor == "" then
minetest.register_alias("3dforniture:table_lamp_"..suffix, "homedecor:table_lamp_"..suffix) minetest.register_alias("3dforniture:table_lamp_"..suffix, "homedecor:table_lamp_"..suffix)
end
end end
reg_lamp("off", "low", "Table Lamp", "", nil ) for _, color in ipairs(lamp_colors) do
reg_lamp("low", "med", nil, "l", 3 ) reg_lamp("off", "low", "Table Lamp", "", nil, color )
reg_lamp("med", "hi" , nil, "m", 7 ) reg_lamp("low", "med", nil, "l", 3, color )
reg_lamp("hi" , "max", nil, "h", 11 ) reg_lamp("med", "hi" , nil, "m", 7, color )
reg_lamp("max", "off", nil, "x", 14 ) reg_lamp("hi" , "max", nil, "h", 11, color )
reg_lamp("max", "off", nil, "x", 14, color )
end
-- Aliases for 3dforniture mod. -- Aliases for 3dforniture mod.
minetest.register_alias("3dforniture:table", "homedecor:table") minetest.register_alias("3dforniture:table", "homedecor:table")

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B