Added modern floor clock, wall shelf with books and paintings

master
Andrey2470T 2022-08-10 19:07:17 +03:00
parent dad6f0e1e1
commit bca91ceba9
67 changed files with 138 additions and 10 deletions

View File

@ -24,3 +24,14 @@ function helpers.clamp(s, e, v)
return v < start_v and start_v or v > end_v and end_v or v
end
function helpers.upper_first_letters(s)
local new_s = ""
for substr in s:gmatch("%a+") do
minetest.debug("substr: " .. substr)
new_s = new_s .. substr:sub(1, 1):upper() .. substr:sub(2) .. " "
end
return new_s
end

View File

@ -10,7 +10,8 @@ register.supported_types = {
"table",
"shelf",
"bed",
"light"
"light",
"decoration"
}
-- Default furniture styles
@ -109,7 +110,7 @@ function register.register_furniture_unit(name, def, craft_def)
f_def.drawtype = def.drawtype or "mesh"
f_def.paramtype = "light"
f_def.paramtype2 = def.paramtype2 or "facedir"
f_def.use_texture_alpha = "clip"
f_def.use_texture_alpha = def.use_texture_alpha or "clip"
f_def.drop = def.drop
f_def.light_source = def.light_source
f_def.use_texture_alpha = def.use_texture_alpha
@ -171,12 +172,15 @@ function register.register_furniture_unit(name, def, craft_def)
end
end
f_def.callbacks = def.callbacks or {}
for cb_name, f in pairs(f_def.callbacks) do
f_def[cb_name] = f
if def.type ~= "decoration" then
f_def.callbacks = def.callbacks or {}
for cb_name, f in pairs(f_def.callbacks) do
f_def[cb_name] = f
end
f_def.add_properties = def.add_properties or {}
end
f_def.add_properties = def.add_properties or {}
local f_name = "multidecor:" .. name
minetest.register_node(":" .. f_name, f_def)
@ -188,10 +192,6 @@ function register.register_furniture_unit(name, def, craft_def)
replacements = craft_def.replacements or nil
})
end
--[[if f_def.add_properties.common_name then
connecting.register_connect_parts(f_def)
end]]
end
-- Registers a set of furniture components of certain type: "kitchen", "bathroom", "bedroom", "living_room" and etc.

View File

@ -3,6 +3,8 @@ local modpath = minetest.get_modpath("modern")
dofile(modpath .. "/bedroom.lua")
dofile(modpath .. "/chairs.lua")
dofile(modpath .. "/lamps.lua")
dofile(modpath .. "/living_room.lua")
dofile(modpath .. "/paintings.lua")
dofile(modpath .. "/shelves.lua")
dofile(modpath .. "/tables.lua")
dofile(modpath .. "/wardrobes.lua")

17
modern/living_room.lua Normal file
View File

@ -0,0 +1,17 @@
register.register_furniture_unit("modern_floor_clock", {
type = "decoration",
style = "modern",
material = "wood",
visual_scale = 0.5,
description = "Floor Clock",
inventory_image = "multidecor_floor_clock_inv.png",
use_texture_alpha = "blend",
mesh = "multidecor_floor_clock.b3d",
tiles = {
"multidecor_jungle_wood.png",
"multidecor_dial.png",
"multidecor_gold_material.png",
"multidecor_glass_material.png"
},
bounding_boxes = {{-0.4, -0.5, -0.3, 0.4, 2, 0.4}}
})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

72
modern/paintings.lua Normal file
View File

@ -0,0 +1,72 @@
local frame_types = {
"quadratic",
"ext_quadratic",
"round",
"embossed_quadratic",
"embossed_ext_quadratic",
"embossed_ext_quadratic2"
}
local materials = {"wood", "plastic"}
local bbox = {-0.5, -0.5, 0.35, 0.5, 0.5, 0.5}
local images = {
--{<image_name>, <frame_types_i>, <materials_i>, <size>}
{"alps", 1, 1, 1},
{"cactus_valley", 1, 2, 1},
{"cefeus", 1, 2, 1},
{"chamomile", 4, 1, 1},
{"dark_forest", 2, 1, 1},
{"elk", 1, 2, 1},
{"forest", 4, 1, 1},
{"jupiter_and_saturn", 2, 2, 2},
{"minetest_castle", 5, 1, 1},
{"minetest_logo", 1, 2, 1},
{"prairie", 1, 1, 1},
{"rose", 4, 1, 1},
{"ship_in_lava", 4, 1, 2},
{"sky", 3, 2, 1},
{"sunset_in_sea", 6, 1, 1},
{"supernova", 3, 1, 2},
{"tropic", 2, 2, 1}
}
for _, img in ipairs(images) do
local img_bbox = table.copy(bbox)
local ftype = frame_types[img[2]]
if ftype == "ext_quadratic" or ftype == "round" or ftype == "embossed_ext_quadratic" then
img_bbox[4] = img_bbox[4] + 1
elseif ftype == "embossed_ext_quadratic2" then
img_bbox[5] = img_bbox[5] + 1
end
img_bbox[4] = (img_bbox[4]+0.5) * img[4] - 0.5
img_bbox[5] = (img_bbox[5]+0.5) * img[4] - 0.5
local mat = materials[img[3]]
local base_tile = "multidecor_" .. mat
if mat == "plastic" then
base_tile = base_tile .. "_material.png^[multiply:dimgray"
else
base_tile = base_tile .. ".png"
end
local mesh = ftype .. "_painting"
mesh = img[4] > 1 and "upscaled_" .. mesh or mesh
local name = mesh .. "_" .. img[1]
register.register_furniture_unit(name, {
type = "decoration",
style = "modern",
material = mat,
visual_scale = 0.5,
description = helpers.upper_first_letters(name),
mesh = "multidecor_" .. mesh .. ".b3d",
tiles = {base_tile, "multidecor_image_" .. img[1] .. ".png"},
bounding_boxes = {img_bbox}
})
end

View File

@ -65,4 +65,30 @@ for _, wood_n in ipairs({"", "jungle", "pine", "aspen"}) do
type = "shapeless",
recipe = {"multidecor:" .. wood_n .. "plank", "multidecor:" .. wood_n .. "plank"}
})
register.register_table("modern_wooden_" .. wood_n .. "wall_shelf_with_books", {
style = "modern",
material = "wood",
visual_scale = 0.5,
paramtype2 = "wallmounted",
description = "Modern Wooden " .. wood_n:sub(1, 1):upper() .. wood_n:sub(2, -1) .. " Wall Shelf With Books",
mesh = "multidecor_wall_shelf_with_books.b3d",
tiles = { -- Red, blue, green, darkmagenta, darkorange
tex,
"multidecor_book_envelope.png^[multiply:red^multidecor_book.png",
"multidecor_book_envelope.png^[multiply:darkorange^multidecor_book.png",
"multidecor_book_envelope.png^[multiply:blue^multidecor_book_pattern.png^multidecor_book.png",
"multidecor_book_envelope.png^[multiply:green^multidecor_book_pattern2.png^multidecor_book.png",
"multidecor_book_envelope.png^[multiply:darkmagenta^multidecor_book_pattern.png^multidecor_book.png",
},
bounding_boxes = {
{-0.5, 0, 0.4, 0.5, -0.5, 0.5},
{-0.5, 0, 0.15, -0.4, -0.5, 0.4},
{0.4, 0, 0.15, 0.5, -0.5, 0.4}
}
}--[[,
{
type = "shapeless",
recipe = {"multidecor:" .. wood_n .. "plank", "multidecor:" .. wood_n .. "plank"}
}]])
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB