@ -31,6 +31,13 @@ hidden_doors = {}
local description_1 = S ( " Concealed " )
local description_2 = S ( " Door " )
-- 'painted' doors are not fully concealed, they are wooden doors painted to blend in
local doors_are_painted = minetest.settings : get_bool ( " hidden_doors_painted " , false )
if doors_are_painted then
description_1 = S ( " Painted " )
end
-- Hidden Doors' sounds
local hidden_doors_vol = tonumber ( minetest.settings : get ( " hidden_doors_vol " ) )
@ -166,14 +173,30 @@ else
end
-- If the door uses textures from Darkage then use the default 16px res.
-- Do the same for Moreblocks.
local use_default_16px_res = ( modname == " darkage " ) or ( modname == " moreblocks " )
local painted_texture_suffix = " "
local painted_texture_suffix_inv = " "
if doors_are_painted then
if use_default_16px_res then
painted_texture_suffix = " ^(hidden_doors_painted_overlay.png^[opacity:50^[resize:38x32)^hidden_doors_hinges_overlay.png "
painted_texture_suffix_inv = " :8,0=hidden_doors_painted_overlay.png \\ ^[opacity \\ :60 \\ ^[resize \\ :38x32 "
else
painted_texture_suffix = " ^(hidden_doors_painted_overlay.png^[opacity:50^[resize: " .. image_size .. " )^hidden_doors_hinges_overlay.png "
painted_texture_suffix_inv = " : " .. X1 .. " ,0=hidden_doors_painted_overlay.png \\ ^[opacity \\ :60 \\ ^[resize \\ : " .. image_size
end
end
function hidden_doors . register_hidden_doors ( modname , subname , recipeItem1 ,
recipeItem2 , recipeItem3 , desc , sounds , sound_open , sound_close )
local texture_name = modname .. " _ " .. subname .. " .png "
-- If the door uses textures from Darkage then use the default 16px res.
-- Do the same for Moreblocks.
if ( modname ~= " darkage " ) and ( modname ~= " moreblocks " ) then
if ( not use_default_16px_res ) then
local new_texture = " [combine: " .. image_size .. " : 0, " ..
" 0= " .. texture_name .. " : 0, " ..
@ -188,13 +211,14 @@ function hidden_doors.register_hidden_doors(modname, subname, recipeItem1,
description = description_1 .. desc .. description_2 ,
tiles = { { name = " ( " .. new_texture ..
" ^[transformFX)^[combine: " .. image_size .. " : " .. X3 .. " , " ..
" ^[transformFX)^( [combine: " .. image_size .. " : " .. X3 .. " , " ..
" 0= " .. texture_name .. " : " .. X3 .. " , " ..
Y3 .. " = " .. texture_name , backface_culling = true } } ,
Y3 .. " = " .. texture_name .. " ) " .. painted_texture_suffix ,
backface_culling = true } } ,
inventory_image = " [combine: " .. inv_size .. " : " .. X1 .. " , " ..
" 0= " .. texture_name .. " : " .. X1 .. " , " ..
Y1 .. " = " .. texture_name ,
Y1 .. " = " .. texture_name .. painted_texture_suffix_inv ,
groups = { cracky = 1 , level = 2 } ,
sounds = sounds ,
@ -219,13 +243,14 @@ function hidden_doors.register_hidden_doors(modname, subname, recipeItem1,
description = description_1 .. desc .. description_2 ,
tiles = { { name = " ( " .. new_texture ..
" ^[transformFX)^[combine: " .. " 38x32 " .. " : 16, " ..
" ^[transformFX)^( [combine: " .. " 38x32 " .. " : 16, " ..
" 0= " .. texture_name .. " : 16, " ..
" 16= " .. texture_name , backface_culling = true } } ,
" 16= " .. texture_name .. " ) " .. painted_texture_suffix ,
backface_culling = true } } ,
inventory_image = " [combine: " .. " 32x32 " .. " : 8, " ..
" 0= " .. texture_name .. " : 8, " ..
" 16= " .. texture_name ,
" 16= " .. texture_name .. painted_texture_suffix_inv ,
groups = { cracky = 1 , level = 2 } ,
sounds = sounds ,