rework meshes for table and standing lamps, better use of materials
use default wool for the lamp shades also, use ^[colorize to brighten the lampshades and lightbulbs according to the lamp's light/brightness setting, instead of baking it into the textures.
@ -311,7 +311,17 @@ homedecor.register("lattice_lantern_small", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
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 brights_tab = { 0, 50, 100, 150, 200 }
|
||||||
|
|
||||||
|
local lamp_colors = {
|
||||||
|
"",
|
||||||
|
"blue",
|
||||||
|
"green",
|
||||||
|
"pink",
|
||||||
|
"red",
|
||||||
|
"violet"
|
||||||
|
}
|
||||||
|
|
||||||
local tlamp_cbox = {
|
local tlamp_cbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -326,15 +336,25 @@ local slamp_cbox = {
|
|||||||
local function reg_lamp(suffix, nxt, tilesuffix, light, color)
|
local function reg_lamp(suffix, nxt, tilesuffix, light, color)
|
||||||
local lampcolor = "_"..color
|
local lampcolor = "_"..color
|
||||||
local colordesc = " ("..color..")"
|
local colordesc = " ("..color..")"
|
||||||
|
local woolcolor = color
|
||||||
|
local wool_brighten = (light or 0) * 7
|
||||||
|
local bulb_brighten = (light or 0) * 14
|
||||||
|
|
||||||
if color == "" then
|
if color == "" then
|
||||||
lampcolor = ""
|
lampcolor = ""
|
||||||
colordesc = " (white)"
|
colordesc = " (white)"
|
||||||
|
woolcolor = "white"
|
||||||
end
|
end
|
||||||
|
|
||||||
homedecor.register("table_lamp"..lampcolor.."_"..suffix, {
|
homedecor.register("table_lamp"..lampcolor.."_"..suffix, {
|
||||||
description = S("Table Lamp "..colordesc),
|
description = S("Table Lamp "..colordesc),
|
||||||
mesh = "homedecor_table_lamp.obj",
|
mesh = "homedecor_table_lamp.obj",
|
||||||
tiles = { "homedecor_table_standing_lamp"..lampcolor.."_"..suffix..".png" },
|
tiles = {
|
||||||
|
"wool_"..woolcolor..".png^[colorize:#ffffff:"..wool_brighten,
|
||||||
|
"homedecor_table_standing_lamp_lightbulb.png^[colorize:#ffffff:"..bulb_brighten,
|
||||||
|
"homedecor_table_standing_lamp_wood.png",
|
||||||
|
"forniture_metal.png",
|
||||||
|
},
|
||||||
inventory_image = "homedecor_table_lamp"..lampcolor.."_inv.png",
|
inventory_image = "homedecor_table_lamp"..lampcolor.."_inv.png",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
light_source = light,
|
light_source = light,
|
||||||
@ -355,7 +375,12 @@ local function reg_lamp(suffix, nxt, tilesuffix, light, color)
|
|||||||
homedecor.register("standing_lamp"..lampcolor.."_"..suffix, {
|
homedecor.register("standing_lamp"..lampcolor.."_"..suffix, {
|
||||||
description = S("Standing Lamp"..colordesc),
|
description = S("Standing Lamp"..colordesc),
|
||||||
mesh = "homedecor_standing_lamp.obj",
|
mesh = "homedecor_standing_lamp.obj",
|
||||||
tiles = { "homedecor_table_standing_lamp"..lampcolor.."_"..suffix..".png" },
|
tiles = {
|
||||||
|
"wool_"..woolcolor..".png^[colorize:#ffffff:"..wool_brighten,
|
||||||
|
"homedecor_table_standing_lamp_lightbulb.png^[colorize:#ffffff:"..bulb_brighten,
|
||||||
|
"homedecor_table_standing_lamp_wood.png",
|
||||||
|
"forniture_metal.png",
|
||||||
|
},
|
||||||
inventory_image = "homedecor_standing_lamp"..lampcolor.."_inv.png",
|
inventory_image = "homedecor_standing_lamp"..lampcolor.."_inv.png",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
light_source = light,
|
light_source = light,
|
||||||
@ -371,11 +396,10 @@ local function reg_lamp(suffix, nxt, tilesuffix, light, color)
|
|||||||
expand = { top="air" },
|
expand = { top="air" },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- "bottom" in the node name is obsolete now, as "top" node doesn't exist anymore.
|
|
||||||
minetest.register_alias("homedecor:standing_lamp_bottom"..lampcolor.."_"..suffix, "homedecor:standing_lamp"..lampcolor.."_"..suffix)
|
minetest.register_alias("homedecor:standing_lamp_bottom"..lampcolor.."_"..suffix, "homedecor:standing_lamp"..lampcolor.."_"..suffix)
|
||||||
minetest.register_alias("homedecor:standing_lamp_top"..lampcolor.."_"..suffix, "air")
|
minetest.register_alias("homedecor:standing_lamp_top"..lampcolor.."_"..suffix, "air")
|
||||||
|
|
||||||
-- for old maps that had 3dfornit`ure
|
-- for old maps that had the original 3dforniture mod
|
||||||
if lampcolor == "" then
|
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
|
||||||
|
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 7.9 KiB |
BIN
homedecor/textures/homedecor_table_standing_lamp_lightbulb.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 8.7 KiB |
BIN
homedecor/textures/homedecor_table_standing_lamp_wood.png
Normal file
After Width: | Height: | Size: 858 B |