From c179f44ba481c73158fa72d658cbd9fed046dcdd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sat, 26 Aug 2017 14:12:38 +0200 Subject: Release 2017-08-26 --- signs/README.md | 12 +- signs/common.lua | 118 ++++---- signs/compatibility.lua | 55 ++++ signs/copyright.txt | 6 +- signs/depends.txt | 3 +- signs/init.lua | 11 +- signs/locale/fr.po | 17 +- signs/locale/template.pot | 10 +- signs/models/signs_dir_left.obj | 45 +-- signs/models/signs_dir_right.obj | 38 +-- signs/nodes.lua | 112 +++----- signs/svg/black_direction.svg | 128 +++++++++ signs/svg/blue_street.svg | 139 +++++++++ signs/svg/green_street.svg | 104 +++++++ signs/svg/poster.svg | 435 +++++++++++++++++++++++++++++ signs/textures/signs_default.png | Bin 554 -> 0 bytes signs/textures/signs_default_inventory.png | Bin 617 -> 0 bytes signs/textures/signs_dir_texture.png | Bin 203 -> 0 bytes signs/textures/signs_poster_sides.png | Bin 0 -> 1106 bytes signs/textures/signs_wooden_direction.png | Bin 619 -> 816 bytes signs/textures/signs_wooden_inventory.png | Bin 1289 -> 606 bytes 21 files changed, 1038 insertions(+), 195 deletions(-) create mode 100644 signs/compatibility.lua create mode 100644 signs/svg/black_direction.svg create mode 100644 signs/svg/blue_street.svg create mode 100644 signs/svg/green_street.svg create mode 100644 signs/svg/poster.svg delete mode 100644 signs/textures/signs_default.png delete mode 100644 signs/textures/signs_default_inventory.png delete mode 100644 signs/textures/signs_dir_texture.png create mode 100644 signs/textures/signs_poster_sides.png (limited to 'signs') diff --git a/signs/README.md b/signs/README.md index 472d157..9e678de 100644 --- a/signs/README.md +++ b/signs/README.md @@ -2,20 +2,14 @@ This mod provides various signs with text display. Text is locked if area is protected. +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?f=11&t=13563) at the Minetest forums. + **Dependancies**: default, display\_lib, font\_lib **License**: Code under LGPL, Textures and models under CC-BY-SA ## Recipes -**Sign** (overrides default sign) - - W W W - W W W - - S - - -W = Wooden Plank, S = Stick - **Poster** P P - @@ -26,7 +20,7 @@ P = Paper Poster displays only title, much more text can be read by right-clicking on it. -**Wooden direction sigh** +**Wooden direction sign** W W W W W - diff --git a/signs/common.lua b/signs/common.lua index 7771d49..63f21dc 100644 --- a/signs/common.lua +++ b/signs/common.lua @@ -30,7 +30,7 @@ function signs.set_formspec(pos) if maxlines == 1 then formspec = "size[6,3]".. - "field[0.5,0.7;5.5,1;display_text;"..F("Displayed text")..";${display_text}]".. + "field[0.5,0.7;5.5,1;display_text;"..F("Text")..";${display_text}]".. "button_exit[2,2;2,1;ok;"..F("Write").."]" else local extralabel = "" @@ -39,7 +39,7 @@ function signs.set_formspec(pos) end formspec = "size[6,4]".. - "textarea[0.5,0.7;5.5,2;display_text;"..F("Displayed text")..""..extralabel..";${display_text}]".. + "textarea[0.5,0.7;5.5,2;display_text;"..F("Text")..""..extralabel..";${display_text}]".. "button_exit[2,3;2,1;ok;"..F("Write").."]" end @@ -50,7 +50,7 @@ end function signs.on_receive_fields(pos, formname, fields, player) if not minetest.is_protected(pos, player:get_player_name()) then local meta = minetest.get_meta(pos) - if fields and fields.ok then + if fields and (fields.ok or fields.key_enter) then meta:set_string("display_text", fields.display_text) meta:set_string("infotext", "\""..fields.display_text.."\"") display_lib.update_entities(pos) @@ -61,63 +61,71 @@ end -- On place callback for direction signs -- (chooses which sign according to look direction) function signs.on_place_direction(itemstack, placer, pointed_thing) - local above = pointed_thing.above - local under = pointed_thing.under - local wdir = minetest.dir_to_wallmounted( - {x = under.x - above.x, - y = under.y - above.y, - z = under.z - above.z}) - - local dir = placer:get_look_dir() - - if wdir == 0 or wdir == 1 then - wdir = minetest.dir_to_wallmounted({x=dir.x, y=0, z=dir.z}) - end - local name = itemstack:get_name() + local ndef = minetest.registered_nodes[name] + + local bdir = {x = pointed_thing.under.x - pointed_thing.above.x, + y = pointed_thing.under.y - pointed_thing.above.y, + z = pointed_thing.under.z - pointed_thing.above.z} + local pdir = placer:get_look_dir() + + local ndir, test + + if ndef.paramtype2 == "facedir" then + if bdir.x == 0 and bdir.z == 0 then + -- Ceiling or floor pointed (facedir chosen from player dir) + ndir = minetest.dir_to_facedir({x=pdir.x, y=0, z=pdir.z}) + else + -- Wall pointed + ndir = minetest.dir_to_facedir(bdir) + end + + test = {[0]=-pdir.x, pdir.z, pdir.x, -pdir.z} + end - -- Only for direction signs (ending with _right) - if name:sub(-string.len("_right")) == "_right" then - name = name:sub(1, -string.len("_right")) + if ndef.paramtype2 == "wallmounted" then + ndir = minetest.dir_to_wallmounted(bdir) + if ndir == 0 or ndir == 1 then + -- Ceiling or floor + ndir = minetest.dir_to_wallmounted({x=pdir.x, y=0, z=pdir.z}) + end + + test = {0, pdir.z, -pdir.z, -pdir.x, pdir.x} + end - local test = {0, dir.z, -dir.z, -dir.x, dir.x} - if test[wdir] > 0 then - itemstack:set_name(name.."left") + -- Only for direction signs + if ndef.signs_other_dir then + if test[ndir] > 0 then + itemstack:set_name(ndef.signs_other_dir) end - itemstack = minetest.item_place(itemstack, placer, pointed_thing, wdir) - itemstack:set_name(name.."right") + itemstack = minetest.item_place(itemstack, placer, pointed_thing, ndir) + itemstack:set_name(name) return itemstack else - return minetest.item_place(itemstack, placer, pointed_thing, wdir) + return minetest.item_place(itemstack, placer, pointed_thing, ndir) end end --- Screwdriver is no more usable for switching direction as on_rotate --- callback is not called anymore for wallmounted nodes since --- minetest_game commit of 24 dec 2015. Now we use right click. -function signs.on_right_click_direction(pos, node, player, itemstack, pointed_thing) - if not minetest.is_protected(pos, player:get_player_name()) then - local name - if node.name:sub(-string.len("_right")) == "_right" then - name = node.name:sub(1, -string.len("_right")).."left" - end - if node.name:sub(-string.len("_left")) == "_left" then - name = node.name:sub(1, -string.len("_left")).."right" - end - - if name then - minetest.swap_node(pos, {name = name, param1 = node.param1, param2 = node.param2}) +-- Handles screwdriver rotation. Direction is affected for direction signs +function signs.on_rotate(pos, node, player, mode, new_param2) + if mode == 2 then + local ndef = minetest.registered_nodes[node.name] + if ndef.signs_other_dir then + minetest.swap_node(pos, {name = ndef.signs_other_dir, + param1 = node.param1, param2 = node.param2}) + display_lib.update_entities(pos) end - end - - return itemstack + else + display_lib.on_rotate(pos, node, user, mode, new_param2) + end + return false; end --- Generic callback for show_formspec displayed formspecs +-- Generic callback for show_formspec displayed formspecs of "sign" mod + minetest.register_on_player_receive_fields(function(player, formname, fields) local found, _, mod, node_name, pos = formname:find("([%w_]+):([%w_]+)@(.+)") - if found then if mod ~= 'signs' then return end @@ -134,24 +142,20 @@ function signs.register_sign(mod, name, model) local fields = { sunlight_propagates = true, paramtype = "light", - paramtype2 = "wallmounted", + paramtype2 = "facedir", drawtype = "nodebox", node_box = { - type = "wallmounted", - wall_side = {-0.5, -model.height/2, -model.width/2, - -0.5 + model.depth, model.height/2, model.width/2}, - wall_bottom = {-model.width/2, -0.5, -model.height/2, - model.width/2, -0.5 + model.depth, model.height/2}, - wall_top = {-model.width/2, 0.5, -model.height/2, - model.width/2, 0.5 - model.depth, model.height/2}, + type = "fixed", + fixed = {-model.width/2, -model.height/2, 0.5, + model.width/2, model.height/2, 0.5 - model.depth}, }, - groups = {choppy=2, dig_immediate=2, attached_node=1}, + groups = {choppy=2, dig_immediate=2}, sounds = default.node_sound_defaults(), display_entities = { ["signs:text"] = { on_display_update = font_lib.on_display_update, depth = 0.499 - model.depth, - size = { x = 1, y = 1 }, + size = { x = model.width, y = model.height }, resolution = { x = 64, y = 64 }, maxlines = 1, }, @@ -163,7 +167,9 @@ function signs.register_sign(mod, name, model) display_lib.on_construct(pos) end, on_destruct = display_lib.on_destruct, - on_receive_fields = signs.on_receive_fields, + on_rotate = signs.on_rotate, + on_receive_fields = signs.on_receive_fields, + on_punch = function(pos, node, player, pointed_thing) display_lib.update_entities(pos) end, } -- Node fields override diff --git a/signs/compatibility.lua b/signs/compatibility.lua new file mode 100644 index 0000000..76bca89 --- /dev/null +++ b/signs/compatibility.lua @@ -0,0 +1,55 @@ +--[[ + signs mod for Minetest - Various signs with text displayed on + (c) Pierre-Yves Rollo + + This file is part of signs. + + signs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + signs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with signs. If not, see . +--]] + + +-- Wallmounted to facedir conversion +local wallmounted_to_facedir = { + [0]=1, -- Should not happend with signs + [1]=1, -- Should not happend with signs + [2]=1, + [3]=3, + [4]=0, + [5]=2 +} + +-- Nodes conversions +local convert_nodes = { + ['signs:wooden_right'] = 'signs:wooden_right_sign', + ['signs:wooden_left'] = 'signs:wooden_left_sign', + ['signs:poster'] = 'signs:paper_poster' +} + +local function compatibility_check(pos, node) + -- Old wallmounted modes to new facedir nodes conversion + node.name = convert_nodes[node.name] + if node.name then + node.param2 = wallmounted_to_facedir[node.param2] + display_lib.on_destruct(pos) + minetest.swap_node(pos, node) + display_lib.on_construct(pos) + end +end + +minetest.register_lbm({ name = "signs:conpatibility_1", + nodenames = {"signs:wooden_right", "signs:wooden_left", "signs:poster"}, + action = compatibility_check, +}) + + diff --git a/signs/copyright.txt b/signs/copyright.txt index 22f9aae..b752dff 100644 --- a/signs/copyright.txt +++ b/signs/copyright.txt @@ -1,2 +1,4 @@ -Code and Models by Pierre-Yves Rollo -Textures by Pierre-Yves Rollo, except signs_default.png and signs_default_inventory.png by Kilbith +Code, Textures and Models by Pierre-Yves Rollo (pyrollo) +intllib support (i18n) by fat115 +intllib fallback code and tools by Diego Martínez (kaeza) + diff --git a/signs/depends.txt b/signs/depends.txt index 0c5fcba..3feca07 100644 --- a/signs/depends.txt +++ b/signs/depends.txt @@ -1,5 +1,4 @@ default +intllib? display_lib font_lib -homedecor? -intllib? diff --git a/signs/init.lua b/signs/init.lua index efa1b26..4f9239f 100644 --- a/signs/init.lua +++ b/signs/init.lua @@ -19,13 +19,18 @@ --]] signs = {} -signs.path = minetest.get_modpath("signs") +signs.name = minetest.get_current_modname() +signs.path = minetest.get_modpath(signs.name) -- Load support for intllib. -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S, NS = dofile(signs.path.."/intllib.lua") signs.intllib = S dofile(signs.path.."/common.lua") dofile(signs.path.."/nodes.lua") dofile(signs.path.."/crafts.lua") +dofile(signs.path.."/compatibility.lua") + + + + diff --git a/signs/locale/fr.po b/signs/locale/fr.po index ebfc543..7a00544 100644 --- a/signs/locale/fr.po +++ b/signs/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-05 10:06+0200\n" +"POT-Creation-Date: 2017-08-26 13:20+0200\n" "PO-Revision-Date: 2017-05-08 07:08+0200\n" "Last-Translator: Peppy \n" "Language-Team: \n" @@ -17,9 +17,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.12\n" -#: common.lua -msgid "Displayed text" -msgstr "Texte affiché" +#: common.lua nodes.lua +msgid "Text" +msgstr "Texte" #: common.lua nodes.lua msgid "Write" @@ -34,10 +34,6 @@ msgstr " (uniquement les %s premières lignes)" msgid "Title" msgstr "Titre" -#: nodes.lua -msgid "Text" -msgstr "Texte" - #: nodes.lua msgid "Close" msgstr "Fermer" @@ -48,8 +44,11 @@ msgstr "(Clic-droit pour afficher le texte entier)" #: nodes.lua msgid "Wooden direction sign" -msgstr "Panneau indicateur en bois" +msgstr "Panneau de direction en bois" #: nodes.lua msgid "Poster" msgstr "Affiche" + +#~ msgid "Textd" +#~ msgstr "Texte" diff --git a/signs/locale/template.pot b/signs/locale/template.pot index fc374aa..a1fc065 100644 --- a/signs/locale/template.pot +++ b/signs/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-05 10:06+0200\n" +"POT-Creation-Date: 2017-08-26 13:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,8 +17,8 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: common.lua -msgid "Displayed text" +#: common.lua nodes.lua +msgid "Text" msgstr "" #: common.lua nodes.lua @@ -34,10 +34,6 @@ msgstr "" msgid "Title" msgstr "" -#: nodes.lua -msgid "Text" -msgstr "" - #: nodes.lua msgid "Close" msgstr "" diff --git a/signs/models/signs_dir_left.obj b/signs/models/signs_dir_left.obj index 0ed1d8f..91ead2d 100644 --- a/signs/models/signs_dir_left.obj +++ b/signs/models/signs_dir_left.obj @@ -1,17 +1,17 @@ -# Blender v2.69 (sub 0) OBJ File: 'signs_dir_left.blend' +# Blender v2.76 (sub 0) OBJ File: 'signs_dir_right.blend' # www.blender.org -mtllib signs_dir_left.mtl +mtllib signs_dir_right.mtl o Plane -v -0.437500 -0.500000 -0.218750 -v -0.437500 -0.500000 0.218750 -v 0.312500 -0.500000 -0.218750 -v 0.312500 -0.500000 0.218750 -v 0.500000 -0.500000 0.000000 -v -0.437500 -0.437500 -0.218750 -v -0.437500 -0.437500 0.218750 -v 0.312500 -0.437500 -0.218750 -v 0.312500 -0.437500 0.218750 -v 0.500000 -0.437500 0.000000 +v -0.500000 0.218750 0.437500 +v -0.500000 -0.218750 0.437500 +v 0.250000 0.218750 0.437500 +v 0.250000 -0.218750 0.437500 +v 0.437500 -0.000000 0.437500 +v -0.500000 0.218750 0.500000 +v -0.500000 -0.218750 0.500000 +v 0.250000 0.218750 0.500000 +v 0.250000 -0.218750 0.500000 +v 0.437500 -0.000000 0.500000 vt 0.062500 0.500000 vt 0.062500 0.937500 vt 0.812500 0.937500 @@ -33,12 +33,19 @@ vt 0.062500 0.312500 vt 0.000000 0.000000 vt 0.000000 0.500000 vt 0.000000 0.937500 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 1.000000 +vn 0.759300 0.650800 0.000000 +vn 0.000000 1.000000 0.000000 +vn -0.000000 -1.000000 0.000000 +vn 0.759300 -0.650800 -0.000000 +vn -1.000000 0.000000 0.000000 usemtl None s off -f 2/1 1/2 3/3 5/4 4/5 -f 7/6 9/7 10/8 8/9 6/10 -f 3/11 8/12 10/13 5/14 -f 1/2 6/15 8/16 3/3 -f 4/5 9/7 7/6 2/1 -f 5/17 10/18 9/10 4/19 -f 2/1 7/20 6/21 1/2 +f 2/1/1 1/2/1 3/3/1 5/4/1 4/5/1 +f 7/6/2 9/7/2 10/8/2 8/9/2 6/10/2 +f 3/11/3 8/12/3 10/13/3 5/14/3 +f 1/2/4 6/15/4 8/16/4 3/3/4 +f 4/5/5 9/7/5 7/6/5 2/1/5 +f 5/17/6 10/18/6 9/10/6 4/19/6 +f 2/1/7 7/20/7 6/21/7 1/2/7 diff --git a/signs/models/signs_dir_right.obj b/signs/models/signs_dir_right.obj index d980e38..6597bfd 100644 --- a/signs/models/signs_dir_right.obj +++ b/signs/models/signs_dir_right.obj @@ -1,17 +1,17 @@ -# Blender v2.76 (sub 0) OBJ File: 'signs_dir_right2.blend' +# Blender v2.76 (sub 0) OBJ File: 'signs_dir_left.blend' # www.blender.org -mtllib signs_dir_right.mtl +mtllib signs_dir_left.mtl o Plane -v 0.437500 -0.437500 -0.218750 -v 0.437500 -0.437500 0.218750 -v -0.312500 -0.437500 -0.218750 -v -0.312500 -0.437500 0.218750 -v -0.500000 -0.437500 0.000000 -v 0.437500 -0.500000 -0.218750 -v 0.437500 -0.500000 0.218750 -v -0.312500 -0.500000 -0.218750 -v -0.312500 -0.500000 0.218750 -v -0.500000 -0.500000 0.000000 +v 0.500000 -0.218750 0.437500 +v 0.500000 0.218750 0.437500 +v -0.250000 -0.218750 0.437500 +v -0.250000 0.218750 0.437500 +v -0.437500 -0.000000 0.437500 +v 0.500000 -0.218750 0.500000 +v 0.500000 0.218750 0.500000 +v -0.250000 -0.218750 0.500000 +v -0.250000 0.218750 0.500000 +v -0.437500 -0.000000 0.500000 vt 0.062500 0.500000 vt 0.062500 0.937500 vt 0.812500 0.937500 @@ -33,13 +33,13 @@ vt 0.062500 0.312500 vt 0.000000 0.000000 vt 0.000000 0.500000 vt 0.000000 0.937500 -vn 0.000000 1.000000 0.000000 -vn -0.000000 -1.000000 -0.000000 -vn -0.759300 0.000000 -0.650800 -vn -0.000000 -0.000000 -1.000000 -vn 0.000000 0.000000 1.000000 -vn -0.759300 0.000000 0.650800 -vn 1.000000 0.000000 -0.000000 +vn -0.000000 0.000000 -1.000000 +vn 0.000000 -0.000000 1.000000 +vn -0.759300 -0.650800 -0.000000 +vn 0.000000 -1.000000 -0.000000 +vn -0.000000 1.000000 0.000000 +vn -0.759300 0.650800 0.000000 +vn 1.000000 0.000000 0.000000 usemtl None s off f 2/1/1 1/2/1 3/3/1 5/4/1 4/5/1 diff --git a/signs/nodes.lua b/signs/nodes.lua index abd63a0..6146d50 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -22,17 +22,20 @@ local S = signs.intllib local F = function(...) return minetest.formspec_escape(S(...)) end -- Poster specific formspec -local function on_rightclick_poster(pos, node, player) +local function on_rightclick_poster(pos, node, player, itemstack, pointed_thing) local formspec local meta = minetest.get_meta(pos) + if not minetest.is_protected(pos, player:get_player_name()) then formspec = "size[6.5,7.5]".. - "field[0.5,0.7;6,1;display_text;"..F("Title")..";"..minetest.formspec_escape(meta:get_string("display_text")).."]".. - "textarea[0.5,1.7;6,6;text;"..F("Text")..";"..minetest.formspec_escape(meta:get_string("text")).."]".. + "field[0.5,0.7;6,1;display_text;"..F("Title")..";".. + minetest.formspec_escape(meta:get_string("display_text")).."]".. + "textarea[0.5,1.7;6,6;text;"..F("Text")..";".. + minetest.formspec_escape(meta:get_string("text")).."]".. "button_exit[2,7;2,1;ok;"..F("Write").."]" minetest.show_formspec(player:get_player_name(), - "signs:poster@"..minetest.pos_to_string(pos), + node.name.."@"..minetest.pos_to_string(pos), formspec) else formspec = "size[8,9]".. @@ -45,14 +48,14 @@ local function on_rightclick_poster(pos, node, player) "", formspec) end - + return itemstack end -- Poster specific on_receive_fields callback local function on_receive_fields_poster(pos, formname, fields, player) local meta = minetest.get_meta(pos) if not minetest.is_protected(pos, player:get_player_name()) then - if fields and fields.ok then + if fields and (fields.ok or fields.key_enter) then meta:set_string("display_text", fields.display_text) meta:set_string("text", fields.text) meta:set_string("infotext", "\""..fields.display_text @@ -67,66 +70,55 @@ display_lib.register_display_entity("signs:text") -- Sign models and registration local models = { - wooden_right={ - depth=1/16, + wooden_right_sign = { + depth = 1/16, width = 14/16, height = 7/16, entity_fields = { - size = { x = 12/16, y = 5/16 }, + right = -3/32, + size = { x = 12/16, y = 6/16 }, resolution = { x = 112, y = 64 }, maxlines = 2, color="#000", }, node_fields = { - description=S("Wooden direction sign"), - tiles={"signs_wooden_direction.png"}, - inventory_image="signs_wooden_inventory.png", - on_place=signs.on_place_direction, - on_rightclick = signs.on_right_click_direction, + description = S("Wooden direction sign"), + tiles = { "signs_wooden_direction.png" }, + inventory_image = "signs_wooden_inventory.png", + signs_other_dir = 'signs:wooden_left_sign', + on_place = signs.on_place_direction, drawtype = "mesh", mesh = "signs_dir_right.obj", - selection_box = { type="wallmounted", - wall_side = {-0.5, -7/32, -7/16, -7/16, 7/32, 0.5}, - wall_bottom = {-0.5, -0.5, -0.5, 0.5, -7/16, 0.5}, - wall_top = {-0.5, 0.5, -0.5, 0.5, 7/16, 0.5}}, - collision_box = { type="wallmounted", - wall_side = {-0.5, -7/32, -7/16, -7/16, 7/32, 0.5}, - wall_bottom = {-0.5, -0.5, -0.5, 0.5, -7/16, 0.5}, - wall_top = {-0.5, 0.5, -0.5, 0.5, 7/16, 0.5}}, + selection_box = { type="fixed", fixed = {-0.5, -7/32, 0.5, 7/16, 7/32, 7/16}}, + collision_box = { type="fixed", fixed = {-0,5, -7/32, 0.5, 7/16, 7/32, 7/16}}, }, }, - wooden_left={ + wooden_left_sign = { depth = 1/16, width = 14/16, height = 7/16, entity_fields = { - size = { x = 12/16, y = 5/16 }, + right = 3/32, + size = { x = 12/16, y = 6/16 }, resolution = { x = 112, y = 64 }, maxlines = 2, - color="#000", + color = "#000", }, node_fields = { - description=S("Wooden direction sign"), - tiles={"signs_wooden_direction.png"}, - inventory_image="signs_wooden_inventory.png", - on_place=signs.on_place_direction, - on_rightclick = signs.on_right_click_direction, + description = S("Wooden direction sign"), + tiles = { "signs_wooden_direction.png" }, + inventory_image = "signs_wooden_inventory.png", + signs_other_dir = 'signs:wooden_right_sign', drawtype = "mesh", mesh = "signs_dir_left.obj", - selection_box = { type="wallmounted", - wall_side = {-0.5, -7/32, -0.5, -7/16, 7/32, 7/16}, - wall_bottom = {-0.5, -0.5, -0.5, 0.5, -7/16, 0.5}, - wall_top = {-0.5, 0.5, -0.5, 0.5, 7/16, 0.5}}, - collision_box = { type="wallmounted", - wall_side = {-0.5, -7/32, -0.5, -7/16, 7/32, 7/16}, - wall_bottom = {-0.5, -0.5, -0.5, 0.5, -7/16, 0.5}, - wall_top = {-0.5, 0.5, -0.5, 0.5, 7/16, 0.5}}, - groups={not_in_creative_inventory=1}, - drop="signs:wooden_right", + selection_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}}, + collision_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}}, + groups = { not_in_creative_inventory = 1 }, + drop = "signs:wooden_right_sign", }, }, - poster={ - depth=1/32, + paper_poster = { + depth = 1/32, width = 26/32, height = 30/32, entity_fields = { @@ -136,39 +128,21 @@ local models = { valign="top", }, node_fields = { - description=S("Poster"), - tiles={"signs_poster.png"}, - inventory_image="signs_poster_inventory.png", - on_construct=display_lib.on_construct, - on_rightclick=on_rightclick_poster, - on_receive_fields=on_receive_fields_poster, + description = S("Poster"), + tiles = { "signs_poster_sides.png", "signs_poster_sides.png", + "signs_poster_sides.png", "signs_poster_sides.png", + "signs_poster_sides.png", "signs_poster.png" }, + inventory_image = "signs_poster_inventory.png", + on_construct = display_lib.on_construct, + on_rightclick = on_rightclick_poster, + on_receive_fields = on_receive_fields_poster, }, }, } +-- Node registration for name, model in pairs(models) do signs.register_sign("signs", name, model) end -if minetest.get_modpath("homedecor") then - print ("["..minetest.get_current_modname().."] homedecor mod is present, not overriding default:sign.") -else --- Override default sign - signs.register_sign(":default", "sign_wall", { - depth = 1/16, - width = 14/16, - height = 10/16, - entity_fields = { - size = { x = 12/16, y = 8/16 }, - resolution = { x = 144, y = 64 }, - maxlines = 3, - color="#000", - }, - node_fields = { - description="Sign", - tiles={"signs_default.png"}, - inventory_image="signs_default_inventory.png", - }, - }) -end diff --git a/signs/svg/black_direction.svg b/signs/svg/black_direction.svg new file mode 100644 index 0000000..8e9b8a9 --- /dev/null +++ b/signs/svg/black_direction.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/signs/svg/blue_street.svg b/signs/svg/blue_street.svg new file mode 100644 index 0000000..0aa87ff --- /dev/null +++ b/signs/svg/blue_street.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/signs/svg/green_street.svg b/signs/svg/green_street.svg new file mode 100644 index 0000000..5d87509 --- /dev/null +++ b/signs/svg/green_street.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/signs/svg/poster.svg b/signs/svg/poster.svg new file mode 100644 index 0000000..4f6f774 --- /dev/null +++ b/signs/svg/poster.svg @@ -0,0 +1,435 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/signs/textures/signs_default.png b/signs/textures/signs_default.png deleted file mode 100644 index 0db6bfd..0000000 Binary files a/signs/textures/signs_default.png and /dev/null differ diff --git a/signs/textures/signs_default_inventory.png b/signs/textures/signs_default_inventory.png deleted file mode 100644 index 55a5120..0000000 Binary files a/signs/textures/signs_default_inventory.png and /dev/null differ diff --git a/signs/textures/signs_dir_texture.png b/signs/textures/signs_dir_texture.png deleted file mode 100644 index bcbbd68..0000000 Binary files a/signs/textures/signs_dir_texture.png and /dev/null differ diff --git a/signs/textures/signs_poster_sides.png b/signs/textures/signs_poster_sides.png new file mode 100644 index 0000000..ebb26de Binary files /dev/null and b/signs/textures/signs_poster_sides.png differ diff --git a/signs/textures/signs_wooden_direction.png b/signs/textures/signs_wooden_direction.png index 23fad3f..3e18765 100644 Binary files a/signs/textures/signs_wooden_direction.png and b/signs/textures/signs_wooden_direction.png differ diff --git a/signs/textures/signs_wooden_inventory.png b/signs/textures/signs_wooden_inventory.png index e93ebe2..d997480 100644 Binary files a/signs/textures/signs_wooden_inventory.png and b/signs/textures/signs_wooden_inventory.png differ -- cgit v1.2.3