2017-01-24 21:43:20 +01:00
|
|
|
|
2017-01-30 00:12:02 +01:00
|
|
|
local S = homedecor_i18n.gettext
|
2014-07-19 11:39:18 +02:00
|
|
|
|
2017-02-06 13:40:46 +01:00
|
|
|
minetest.register_node("homedecor:bathroom_tiles_dark", {
|
|
|
|
description = S("Bathroom/kitchen tiles (dark)"),
|
|
|
|
tiles = {
|
2017-06-16 22:14:02 +02:00
|
|
|
"homedecor_bathroom_tiles_bg.png"
|
|
|
|
},
|
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xff606060 },
|
2017-02-06 13:40:46 +01:00
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
2017-02-25 01:06:17 +01:00
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2017-02-06 13:40:46 +01:00
|
|
|
groups = {cracky=3, ud_param2_colorable = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
2017-03-14 07:13:17 +01:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2017-02-06 13:40:46 +01:00
|
|
|
})
|
2015-05-04 05:12:30 +02:00
|
|
|
|
2017-02-06 13:40:46 +01:00
|
|
|
minetest.register_node("homedecor:bathroom_tiles_medium", {
|
|
|
|
description = S("Bathroom/kitchen tiles (medium)"),
|
|
|
|
tiles = {
|
2017-06-16 22:14:02 +02:00
|
|
|
"homedecor_bathroom_tiles_bg.png"
|
|
|
|
},
|
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffc0c0c0 },
|
2017-02-06 13:40:46 +01:00
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
2017-02-25 01:06:17 +01:00
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2017-02-06 13:40:46 +01:00
|
|
|
groups = {cracky=3, ud_param2_colorable = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
2017-03-14 07:13:17 +01:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2017-02-06 13:40:46 +01:00
|
|
|
})
|
2015-05-04 05:12:30 +02:00
|
|
|
|
2017-02-06 13:40:46 +01:00
|
|
|
minetest.register_node("homedecor:bathroom_tiles_light", {
|
|
|
|
description = S("Bathroom/kitchen tiles (light)"),
|
|
|
|
tiles = {
|
2017-06-16 22:14:02 +02:00
|
|
|
"homedecor_bathroom_tiles_bg.png"
|
|
|
|
},
|
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffffffff },
|
2017-02-06 13:40:46 +01:00
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
2017-02-25 01:06:17 +01:00
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2017-02-06 13:40:46 +01:00
|
|
|
groups = {cracky=3, ud_param2_colorable = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
2017-03-14 07:13:17 +01:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2017-02-06 13:40:46 +01:00
|
|
|
})
|
2014-06-27 03:33:27 +02:00
|
|
|
|
2015-03-31 08:12:42 +02:00
|
|
|
local tr_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.375, -0.3125, 0.25, 0.375, 0.375, 0.5 }
|
|
|
|
}
|
|
|
|
|
2015-01-21 19:19:14 +01:00
|
|
|
homedecor.register("towel_rod", {
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Towel rod with towel"),
|
2015-03-31 08:12:42 +02:00
|
|
|
mesh = "homedecor_towel_rod.obj",
|
2014-06-27 03:33:27 +02:00
|
|
|
tiles = {
|
2015-03-31 08:12:42 +02:00
|
|
|
"homedecor_generic_terrycloth.png",
|
|
|
|
"default_wood.png",
|
2014-06-27 03:33:27 +02:00
|
|
|
},
|
2015-03-31 17:42:33 +02:00
|
|
|
inventory_image = "homedecor_towel_rod_inv.png",
|
2015-03-31 08:12:42 +02:00
|
|
|
selection_box = tr_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2014-06-27 03:33:27 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3},
|
|
|
|
sounds = default.node_sound_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-01-21 19:19:14 +01:00
|
|
|
homedecor.register("medicine_cabinet", {
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Medicine cabinet"),
|
2015-05-04 08:16:36 +02:00
|
|
|
mesh = "homedecor_medicine_cabinet.obj",
|
2014-08-02 03:26:04 +02:00
|
|
|
tiles = {
|
2015-05-04 08:16:36 +02:00
|
|
|
'default_wood.png',
|
|
|
|
'homedecor_medicine_cabinet_mirror.png'
|
2014-08-02 03:26:04 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_medicine_cabinet_inv.png",
|
2015-01-21 19:19:14 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2014-08-02 03:26:04 +02:00
|
|
|
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
|
2015-01-21 19:19:14 +01:00
|
|
|
},
|
2015-05-04 10:21:11 +02:00
|
|
|
walkable = false,
|
2014-08-02 03:26:04 +02:00
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2014-09-20 13:05:07 +02:00
|
|
|
on_punch = function(pos, node, puncher, pointed_thing)
|
2015-01-21 13:42:20 +01:00
|
|
|
node.name = "homedecor:medicine_cabinet_open"
|
|
|
|
minetest.swap_node(pos, node)
|
2014-09-20 13:05:07 +02:00
|
|
|
end,
|
2015-01-21 19:19:14 +01:00
|
|
|
infotext=S("Medicine cabinet"),
|
|
|
|
inventory = {
|
2015-01-23 02:36:43 +01:00
|
|
|
size=6,
|
2015-01-21 19:19:14 +01:00
|
|
|
},
|
2014-08-02 03:26:04 +02:00
|
|
|
})
|
|
|
|
|
2015-01-21 19:19:14 +01:00
|
|
|
homedecor.register("medicine_cabinet_open", {
|
2015-05-04 08:16:36 +02:00
|
|
|
mesh = "homedecor_medicine_cabinet_open.obj",
|
2014-09-20 13:05:07 +02:00
|
|
|
tiles = {
|
2015-05-04 08:16:36 +02:00
|
|
|
'default_wood.png',
|
|
|
|
'homedecor_medicine_cabinet_mirror.png',
|
|
|
|
'homedecor_medicine_cabinet_inside.png'
|
2014-09-20 13:05:07 +02:00
|
|
|
},
|
2015-05-04 08:16:36 +02:00
|
|
|
selection_box = {
|
2014-09-20 13:05:07 +02:00
|
|
|
type = "fixed",
|
2015-05-04 08:16:36 +02:00
|
|
|
fixed = {-0.3125, -0.1875, -0.25, 0.3125, 0.5, 0.5}
|
2014-09-20 13:05:07 +02:00
|
|
|
},
|
2015-05-04 10:21:11 +02:00
|
|
|
walkable = false,
|
2015-05-04 08:16:36 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2014-09-20 13:05:07 +02:00
|
|
|
drop = "homedecor:medicine_cabinet",
|
|
|
|
on_punch = function(pos, node, puncher, pointed_thing)
|
2015-01-21 13:42:20 +01:00
|
|
|
node.name = "homedecor:medicine_cabinet"
|
|
|
|
minetest.swap_node(pos, node)
|
2014-09-20 13:05:07 +02:00
|
|
|
end,
|
|
|
|
})
|
2017-02-06 13:40:46 +01:00
|
|
|
|
|
|
|
-- convert old static nodes
|
|
|
|
|
|
|
|
homedecor.old_static_bathroom_tiles = {
|
|
|
|
"homedecor:tiles_1",
|
|
|
|
"homedecor:tiles_2",
|
|
|
|
"homedecor:tiles_3",
|
|
|
|
"homedecor:tiles_4",
|
|
|
|
"homedecor:tiles_red",
|
|
|
|
"homedecor:tiles_tan",
|
|
|
|
"homedecor:tiles_yellow",
|
|
|
|
"homedecor:tiles_green",
|
|
|
|
"homedecor:tiles_blue"
|
|
|
|
}
|
|
|
|
|
|
|
|
local old_to_color = {
|
|
|
|
"light_grey",
|
|
|
|
"grey",
|
|
|
|
"black",
|
|
|
|
"black"
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_lbm({
|
|
|
|
name = "homedecor:convert_bathroom_tiles",
|
|
|
|
label = "Convert bathroom tiles to use param2 color",
|
2017-02-16 22:58:48 +01:00
|
|
|
run_at_every_load = false,
|
2017-02-06 13:40:46 +01:00
|
|
|
nodenames = homedecor.old_static_bathroom_tiles,
|
|
|
|
action = function(pos, node)
|
|
|
|
local name = node.name
|
|
|
|
local newname = "homedecor:bathroom_tiles_light"
|
2017-02-16 03:53:52 +01:00
|
|
|
local a = string.find(name, "_")
|
|
|
|
local color = string.sub(name, a + 1)
|
2017-02-06 13:40:46 +01:00
|
|
|
|
|
|
|
if color == "tan" then
|
|
|
|
color = "yellow_s50"
|
|
|
|
elseif color == "1" or color == "2" or color == "3" or color == "4" then
|
|
|
|
if color == "4" then
|
|
|
|
newname = "homedecor:bathroom_tiles_medium"
|
|
|
|
end
|
|
|
|
color = old_to_color[tonumber(color)]
|
|
|
|
elseif color ~= "yellow" then
|
|
|
|
color = color.."_s50"
|
|
|
|
end
|
|
|
|
|
2017-02-25 03:27:22 +01:00
|
|
|
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
|
2017-02-06 13:40:46 +01:00
|
|
|
|
|
|
|
minetest.set_node(pos, { name = newname, param2 = paletteidx })
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("dye", "unifieddyes:"..color)
|
2017-02-25 07:02:51 +01:00
|
|
|
meta:set_string("palette", "ext")
|
2017-02-06 13:40:46 +01:00
|
|
|
end
|
|
|
|
})
|
2017-02-25 01:06:17 +01:00
|
|
|
|
|
|
|
minetest.register_lbm({
|
|
|
|
name = "homedecor:recolor_bathroom_tiles",
|
|
|
|
label = "Convert bathroom tiles to use UD extended palette",
|
|
|
|
run_at_every_load = false,
|
|
|
|
nodenames = {
|
|
|
|
"homedecor:bathroom_tiles_light",
|
|
|
|
"homedecor:bathroom_tiles_medium",
|
|
|
|
"homedecor:bathroom_tiles_dark",
|
|
|
|
},
|
|
|
|
action = function(pos, node)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
if meta:get_string("palette") ~= "ext" then
|
|
|
|
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
|
|
|
|
meta:set_string("palette", "ext")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|