Add painted door option.

Enabling the "Painted doors - visible but camouflaged" option in the mod settings lets you choose to have concealed doors remain slightly visible - wooden doors which have been painted to match their surroundings. This allows players that pay attention to find concealed doors, as well as providing decor-matched doors for interior decoration.
master
Treer 4 years ago
parent ccb8594b61
commit f5979ecb1d
  1. 4
      locale/it.po
  2. 4
      locale/template.pot
  3. 43
      main.lua
  4. 6
      settingtypes.txt
  5. BIN
      textures/hidden_doors_hinges_overlay.png
  6. BIN
      textures/hidden_doors_painted_overlay.png

@ -22,6 +22,10 @@ msgstr ""
msgid "Concealed "
msgstr "Porta camuffata di "
#: init.lua
msgid "Painted "
msgstr "Porta dipinto di "
#: init.lua
msgid " Door"
msgstr " "

@ -21,6 +21,10 @@ msgstr ""
msgid "Concealed "
msgstr ""
#: init.lua
msgid "Painted "
msgstr ""
#: init.lua
msgid " Door"
msgstr ""

@ -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,

@ -7,6 +7,12 @@ hidden_doors_res (Resolution in pixels for the textures) int 16
# doors' opening and closing sounds, the default value is 5.0
hidden_doors_vol (Opening and closing sounds' volume in float) float 5.0
# You can choose to have concealed doors remain slightly visible - wooden
# doors which have been painted to match their surroundings.
# This allows players that pay attention to find concealed doors, as well
# as providing decor-matched doors for interior decoration.
hidden_doors_painted (Painted doors - visible but camouflaged) bool false
# Disable the module's nodes and activate the
# L.B.M. based module's nodes remover.
hidden_doors_remover (Disable and remove this mod's nodes) bool false

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Loading…
Cancel
Save