diff --git a/locale/it.po b/locale/it.po index 4783ec8..a259547 100644 --- a/locale/it.po +++ b/locale/it.po @@ -22,6 +22,10 @@ msgstr "" msgid "Concealed " msgstr "Porta camuffata di " +#: init.lua +msgid "Painted " +msgstr "Porta dipinto di " + #: init.lua msgid " Door" msgstr " " diff --git a/locale/template.pot b/locale/template.pot index cbcd119..c6feddb 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -21,6 +21,10 @@ msgstr "" msgid "Concealed " msgstr "" +#: init.lua +msgid "Painted " +msgstr "" + #: init.lua msgid " Door" msgstr "" diff --git a/main.lua b/main.lua index 27a71b7..bdf5074 100644 --- a/main.lua +++ b/main.lua @@ -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, diff --git a/settingtypes.txt b/settingtypes.txt index c947159..59ea056 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -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 \ No newline at end of file diff --git a/textures/hidden_doors_hinges_overlay.png b/textures/hidden_doors_hinges_overlay.png new file mode 100644 index 0000000..a0ddb9d Binary files /dev/null and b/textures/hidden_doors_hinges_overlay.png differ diff --git a/textures/hidden_doors_painted_overlay.png b/textures/hidden_doors_painted_overlay.png new file mode 100644 index 0000000..0f62065 Binary files /dev/null and b/textures/hidden_doors_painted_overlay.png differ