2018-09-07 22:32:38 +02:00
|
|
|
local S = homedecor.gettext
|
2015-08-16 17:41:19 +02:00
|
|
|
|
|
|
|
homedecor.register("filing_cabinet", {
|
2018-09-07 22:32:38 +02:00
|
|
|
description = S("Filing Cabinet"),
|
2015-08-16 17:41:19 +02:00
|
|
|
mesh = "homedecor_filing_cabinet.obj",
|
|
|
|
tiles = {
|
|
|
|
homedecor.plain_wood,
|
|
|
|
"homedecor_filing_cabinet_front.png",
|
|
|
|
"homedecor_filing_cabinet_bottom.png"
|
|
|
|
},
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
infotext=S("Filing cabinet"),
|
|
|
|
inventory = {
|
|
|
|
size=16,
|
2015-08-19 19:30:03 +02:00
|
|
|
lockable=true,
|
2015-08-16 17:41:19 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
local desk_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, -0.5, 1.5, 0.5, 0.5 }
|
|
|
|
}
|
|
|
|
homedecor.register("desk", {
|
2018-09-07 22:32:38 +02:00
|
|
|
description = "Desk",
|
2015-08-16 17:41:19 +02:00
|
|
|
mesh = "homedecor_desk.obj",
|
|
|
|
tiles = {
|
|
|
|
homedecor.plain_wood,
|
|
|
|
"homedecor_desk_drawers.png",
|
2018-09-07 22:32:38 +02:00
|
|
|
"homedecor_generic_metal_black.png",
|
2015-08-16 17:41:19 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_desk_inv.png",
|
|
|
|
selection_box = desk_cbox,
|
|
|
|
collision_box = desk_cbox,
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
groups = { snappy = 3 },
|
2015-09-08 09:50:02 +02:00
|
|
|
expand = { right="placeholder" },
|
2015-08-16 17:41:19 +02:00
|
|
|
inventory = {
|
|
|
|
size=24,
|
2015-08-19 20:21:56 +02:00
|
|
|
lockable=true,
|
2015-08-16 17:41:19 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_alias("homedecor:desk_r", "air")
|
|
|
|
|
|
|
|
local globe_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.4, -0.5, -0.3, 0.3, 0.3, 0.3 }
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("desk_globe", {
|
2018-09-07 22:32:38 +02:00
|
|
|
description = "Desk globe",
|
2015-08-16 17:41:19 +02:00
|
|
|
mesh = "homedecor_desk_globe.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_generic_wood_red.png",
|
2018-09-07 22:32:38 +02:00
|
|
|
"homedecor_generic_metal_black.png^[brighten",
|
2015-08-16 17:41:19 +02:00
|
|
|
"homedecor_earth.png"
|
|
|
|
},
|
|
|
|
inventory_image = "homedecor_desk_globe_inv.png",
|
|
|
|
selection_box = globe_cbox,
|
|
|
|
collision_box = globe_cbox,
|
2018-09-07 22:32:38 +02:00
|
|
|
groups = {choppy=2},
|
2015-08-16 17:41:19 +02:00
|
|
|
walkable = false,
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("calendar", {
|
2018-09-07 22:32:38 +02:00
|
|
|
description = "Calendar",
|
2015-08-16 17:41:19 +02:00
|
|
|
mesh = "homedecor_calendar.obj",
|
|
|
|
tiles = {"homedecor_calendar.png"},
|
|
|
|
inventory_image = "homedecor_calendar_inv.png",
|
|
|
|
wield_image = "homedecor_calendar_inv.png",
|
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_side = { -8/16, -8/16, -4/16, -5/16, 5/16, 4/16 },
|
|
|
|
wall_bottom = { -4/16, -8/16, -8/16, 4/16, -5/16, 5/16 },
|
|
|
|
wall_top = { -4/16, 5/16, -8/16, 4/16, 8/16, 5/16 }
|
|
|
|
},
|
|
|
|
groups = {choppy=2,attached_node=1},
|
|
|
|
legacy_wallmounted = true,
|
|
|
|
sounds = default.node_sound_defaults(),
|
2018-09-07 22:32:38 +02:00
|
|
|
infotext = "Date (right-click to update):\n" .. os.date("%Y-%m-%d"), -- ISO 8601 format
|
|
|
|
on_rightclick = function(pos, node, clicker)
|
2015-08-16 17:41:19 +02:00
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local date = os.date("%Y-%m-%d")
|
2018-09-07 22:32:38 +02:00
|
|
|
meta:set_string("infotext", "Date (right-click to update):\n"..date)
|
2015-08-16 17:41:19 +02:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
local ofchairs_sbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -8/16, -8/16, -8/16, 8/16, 29/32, 8/16 }
|
|
|
|
}
|
|
|
|
local ofchairs_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -5/16, 1/16, -7/16, 5/16, 4/16, 7/16 }, -- seat
|
|
|
|
{ -5/16, 4/16, 4/16, 5/16, 29/32, 15/32 }, -- seatback
|
|
|
|
{ -1/16, -11/32, -1/16, 1/16, 1/16, 1/16 }, -- cylinder
|
|
|
|
{ -8/16, -8/16, -8/16, 8/16, -11/32, 8/16 } -- legs/wheels
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-07 22:32:38 +02:00
|
|
|
for _, c in pairs({"basic", "upscale"}) do
|
|
|
|
homedecor.register("office_chair_"..c, {
|
|
|
|
description = "Office chair ("..c..")",
|
2015-08-16 17:41:19 +02:00
|
|
|
drawtype = "mesh",
|
2018-09-07 22:32:38 +02:00
|
|
|
tiles = { "homedecor_office_chair_"..c..".png" },
|
|
|
|
mesh = "homedecor_office_chair_"..c..".obj",
|
2015-08-16 17:41:19 +02:00
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
selection_box = ofchairs_sbox,
|
|
|
|
collision_box = ofchairs_cbox,
|
2015-09-08 09:50:02 +02:00
|
|
|
expand = { top = "placeholder" },
|
2015-08-16 17:41:19 +02:00
|
|
|
on_rotate = screwdriver.rotate_simple
|
|
|
|
})
|
|
|
|
end
|