diff --git a/README.md b/README.md index ae67ab3..2a190f1 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,25 @@ This modpack provides mods with dynamic display. Mods are : - **signs**: A mod providing signs and direction signs displaying text; - **signs_road**: A mod providing road signs displaying text; - **steles**: A mod providing stone steles with text; + +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?f=11&t=13563) at the Minetest forums. + +## Changelog + +###2017-08-26 + +- Changed signs from wallmounted to facedir to improve textures and make it possible to use screwdriver. +**IMPORTANT** : Map will be updated to change to new nodes but inventory items will turn into "Unknown items" and have to be re-crafted. + +- Intllib support added with french translation (whole modpack, thanks to fat115) ; + +- Punch on nodes to update entity (signs, signs_road and steles). Usefull in case of /clearobjects ; + +- Changed wooden direction sign textures (signs) ; + +- Added back and side textures to all signs (road_signs) ; + +- Added more sign types : White/yellow/green signs and direction signs (signs_road) ; + + + diff --git a/display_lib/README.md b/display_lib/README.md index d7372d7..3f8571a 100644 --- a/display_lib/README.md +++ b/display_lib/README.md @@ -8,4 +8,7 @@ This library's purpose is to ease creation of nodes with one or more displays on **License**: LPGL -**API**: See API.md document please. +**API**: See [API.md](https://github.com/pyrollo/display_modpack/blob/master/display_lib/API.md) document please. + +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?f=11&t=13563) at the Minetest forums. + diff --git a/display_lib/copyright.txt b/display_lib/copyright.txt new file mode 100644 index 0000000..5d4adad --- /dev/null +++ b/display_lib/copyright.txt @@ -0,0 +1,2 @@ +Code by Pierre-Yves Rollo (pyrollo) + diff --git a/display_lib/init.lua b/display_lib/init.lua index 63ce99c..4416928 100644 --- a/display_lib/init.lua +++ b/display_lib/init.lua @@ -114,7 +114,6 @@ local function place_entities(pos) local depth = clip_pos_prop(props.depth) local height = clip_pos_prop(props.height) local right = clip_pos_prop(props.right) - if not objrefs[entity_name] then objrefs[entity_name] = minetest.add_entity(pos, entity_name) end @@ -158,26 +157,30 @@ end --- On_place callback for display_lib items. Does nothing more than preventing item --- from being placed on ceiling or ground function display_lib.on_place(itemstack, placer, pointed_thing) - local ndef = minetest.registered_nodes[itemstack.name] + local ndef = itemstack:get_definition() local above = pointed_thing.above local under = pointed_thing.under local dir = {x = under.x - above.x, y = under.y - above.y, z = under.z - above.z} - if ndef and ndef.paramtype2 == "wallmounted" then - local wdir = minetest.dir_to_wallmounted(dir) + if ndef then + if ndef.paramtype2 == "wallmounted" then - if wdir == 0 or wdir == 1 then - dir = placer:get_look_dir() - dir.y = 0 - wdir = minetest.dir_to_wallmounted(dir) + local wdir = minetest.dir_to_wallmounted(dir) + + if wdir == 0 or wdir == 1 then + dir = placer:get_look_dir() + dir.y = 0 + wdir = minetest.dir_to_wallmounted(dir) + end + + return minetest.item_place(itemstack, placer, pointed_thing, wdir) + else + return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(dir)) end - - return minetest.item_place(itemstack, placer, pointed_thing, wdir) - else - return minetest.item_place(itemstack, placer, pointed_thing) end + end --- On_construct callback for display_lib items. Creates entities and update them. @@ -196,7 +199,7 @@ end -- On_rotate (screwdriver) callback for display_lib items. Prevents axis rotation and reorients entities. function display_lib.on_rotate(pos, node, user, mode, new_param2) - if mode ~= screwdriver.ROTATE_FACE then return false end + if mode ~= 1 then return false end local values = get_values(node) diff --git a/font_lib/README.md b/font_lib/README.md index 75ea12e..67903a9 100644 --- a/font_lib/README.md +++ b/font_lib/README.md @@ -8,7 +8,7 @@ This library for font display on entities (to be used with display_lib for sign (Font taken from VanessaE's homedecor/signs_lib, originally under WTFPL) -**API**: See API.md document please. - +**API**: See [API.md](https://github.com/pyrollo/display_modpack/blob/master/font_lib/API.md) document please. +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?f=11&t=13563) at the Minetest forums. diff --git a/font_lib/copyright.txt b/font_lib/copyright.txt index 83b4af0..eb0ec6a 100644 --- a/font_lib/copyright.txt +++ b/font_lib/copyright.txt @@ -1,2 +1,2 @@ -Code by Pierre-Yves Rollo -Textures by Vanessa Ezekowitz +Code by Pierre-Yves Rollo (pyrollo) +Textures by Vanessa Ezekowitz (VanessaE) diff --git a/font_lib/init.lua b/font_lib/init.lua index b3b3222..9dd6908 100644 --- a/font_lib/init.lua +++ b/font_lib/init.lua @@ -62,8 +62,7 @@ end function font_lib.get_line_width(text) local char local width = 0 - - p=0 + local p=0 while p < #text do char, p = get_next_char(text, p) @@ -82,10 +81,8 @@ end function font_lib.make_line_texture(text, texturew, x, y) local char - local texture = "" - - p=0 + local p=0 while p < #text do char, p = get_next_char(text, p) diff --git a/ontime_clocks/README.md b/ontime_clocks/README.md index 082e59b..72c94db 100644 --- a/ontime_clocks/README.md +++ b/ontime_clocks/README.md @@ -2,6 +2,8 @@ This mod provides clocks that display real ingame time. +For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?f=11&t=13563) at the Minetest forums. + **Dependancies**: display_lib, default **License**: Code under LGPL, textures under CC-BY-SA diff --git a/ontime_clocks/copyright.txt b/ontime_clocks/copyright.txt new file mode 100644 index 0000000..b752dff --- /dev/null +++ b/ontime_clocks/copyright.txt @@ -0,0 +1,4 @@ +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/ontime_clocks/init.lua b/ontime_clocks/init.lua index d6d2da4..d0ac334 100644 --- a/ontime_clocks/init.lua +++ b/ontime_clocks/init.lua @@ -19,11 +19,11 @@ --]] ontime_clocks = {} -ontime_clocks.path = minetest.get_modpath("ontime_clocks") +ontime_clocks.name = minetest.get_current_modname() +ontime_clocks.path = minetest.get_modpath(ontime_clocks.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(ontime_clocks.path.."/intllib.lua") ontime_clocks.intllib = S dofile(ontime_clocks.path.."/common.lua") diff --git a/ontime_clocks/locale/template.pot b/ontime_clocks/locale/template.pot index 0367f5c..dca736f 100644 --- a/ontime_clocks/locale/template.pot +++ b/ontime_clocks/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 09:50+0200\n" +"POT-Creation-Date: 2017-08-26 11:21+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" 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() + local name = itemstack:get_name() + local ndef = minetest.registered_nodes[name] - if wdir == 0 or wdir == 1 then - wdir = minetest.dir_to_wallmounted({x=dir.x, y=0, z=dir.z}) + 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 + + 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 name = itemstack:get_name() - - -- Only for direction signs (ending with _right) - if name:sub(-string.len("_right")) == "_right" then - name = name:sub(1, -string.len("_right")) - - 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" +-- 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 - 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}) - 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, - width = 14/16, - height = 7/16, - entity_fields = { - size = { x = 12/16, y = 5/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, - 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}}, - }, - }, - wooden_left={ + 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_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", + mesh = "signs_dir_right.obj", + 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}}, }, }, - poster={ - depth=1/32, + wooden_left_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + 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", + signs_other_dir = 'signs:wooden_right_sign', + drawtype = "mesh", + mesh = "signs_dir_left.obj", + 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", + }, + }, + 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 diff --git a/signs_road/README.md b/signs_road/README.md index e042855..c09c82e 100644 --- a/signs_road/README.md +++ b/signs_road/README.md @@ -2,6 +2,8 @@ This mod provides road 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, signs **License**: Code under LGPL, texture under CC-BY-SA @@ -10,19 +12,19 @@ This mod provides road signs with text display. Text is locked if area is protec **Blue Street Sign** - B W S + B W - S S S - - - B = Blue Dye, W = White Dye, S = Steel Ingot -**Green Street Sign** +**Red and White Street Sign** - G W S - S S S + W R - + S S S - - - -G = Green Dye, W = White Dye, S = Steel Ingot +W = White Dye, R = Red Dye, S = Steel Ingot **Black direction sign** @@ -32,3 +34,33 @@ G = Green Dye, W = White Dye, S = Steel Ingot B = Black Dye, W = White Dye, S = Steel Ingot +**White Signs** + +Two kinds of signs, normal and direction signs : + + W B - W B S + S S S S S - + - - - - - - + +W = White Dye, B = Black Dye, S = Steel Ingot + +**Green Signs** + +Two kinds of signs, normal and direction signs : + + G W - G W S + S S S S S - + - - - - - - + +G = Green Dye, W = White Dye, S = Steel Ingot + +**Yellow Signs** + +Two kinds of signs, normal and direction signs : + + Y B - Y B S + S S S S S - + - - - - - - + +Y = Yellow Dye, B = Black Dye, S = Steel Ingot + diff --git a/signs_road/compatibility.lua b/signs_road/compatibility.lua new file mode 100644 index 0000000..4ef25ba --- /dev/null +++ b/signs_road/compatibility.lua @@ -0,0 +1,58 @@ +--[[ + 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_road:blue_street'] = 'signs_road:blue_street_sign', + ['signs_road:green_street'] = 'signs_road:green_street_sign', + ['signs_road:black_right'] = 'signs_road:black_right_sign', + ['signs_road:black_left'] = 'signs_road:black_left_sign', + ['signs_road:green_right'] = 'signs_road:green_right_sign', + ['signs_road:green_left'] = 'signs_road:green_left_sign' +} + +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_road:conpatibility_1", + nodenames = {'signs_road:blue_street', 'signs_road:green_street', 'signs_road:black_right', + 'signs_road:black_left', 'signs_road:green_right', 'signs_road:green_left'}, + action = compatibility_check, +}) + + diff --git a/signs_road/copyright.txt b/signs_road/copyright.txt index 20965d5..b752dff 100644 --- a/signs_road/copyright.txt +++ b/signs_road/copyright.txt @@ -1 +1,4 @@ -Code, Textures and Models by Pierre-Yves Rollo +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_road/crafts.lua b/signs_road/crafts.lua index 670b7e2..0a0c205 100644 --- a/signs_road/crafts.lua +++ b/signs_road/crafts.lua @@ -20,25 +20,53 @@ --]] minetest.register_craft({ - output = 'signs_road:blue_street', + output = 'signs_road:blue_street_sign 2', recipe = { - {'dye:blue', 'dye:white', 'default:steel_ingot'}, + {'dye:blue', 'dye:white', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) minetest.register_craft({ - output = 'signs_road:green_street', + output = 'signs_road:red_street_sign 2', recipe = { - {'dye:green', 'dye:white', 'default:steel_ingot'}, + {'dye:white', 'dye:red', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) minetest.register_craft({ - output = 'signs_road:black_right', + output = 'signs_road:white_street_sign 2', + recipe = { + {'dye:white', 'dye:black', ''}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + output = 'signs_road:green_street_sign 2', + recipe = { + {'dye:green', 'dye:white', ''}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + output = 'signs_road:yellow_street_sign 2', + recipe = { + {'dye:yellow', 'dye:black', ''}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', '', ''}, + } +}) + + +minetest.register_craft({ + output = 'signs_road:black_right_sign 2', recipe = { {'dye:black', 'dye:white', 'default:steel_ingot'}, {'default:steel_ingot', 'default:steel_ingot', ''}, @@ -46,3 +74,30 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'signs_road:green_right_sign 2', + recipe = { + {'dye:green', 'dye:white', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', ''}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + output = 'signs_road:yellow_right_sign 2', + recipe = { + {'dye:yellow', 'dye:white', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', ''}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + output = 'signs_road:white_right_sign 2', + recipe = { + {'dye:white', 'dye:black', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', ''}, + {'', '', ''}, + } +}) + diff --git a/signs_road/depends.txt b/signs_road/depends.txt index e6b5e54..730e727 100644 --- a/signs_road/depends.txt +++ b/signs_road/depends.txt @@ -1,6 +1,6 @@ default +intllib? dye display_lib font_lib signs -intllib? diff --git a/signs_road/init.lua b/signs_road/init.lua index 60c1b66..cd95c6c 100644 --- a/signs_road/init.lua +++ b/signs_road/init.lua @@ -20,12 +20,18 @@ --]] signs_road = {} -signs_road.path = minetest.get_modpath("signs_road") +signs_road.name = minetest.get_current_modname() +signs_road.path = minetest.get_modpath(signs_road.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_road.path.."/intllib.lua") signs_road.intllib = S dofile(signs_road.path.."/nodes.lua") dofile(signs_road.path.."/crafts.lua") +dofile(signs_road.path.."/compatibility.lua") + + + + + diff --git a/signs_road/locale/fr.po b/signs_road/locale/fr.po index 8208347..833f115 100644 --- a/signs_road/locale/fr.po +++ b/signs_road/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-05 09:50+0200\n" +"POT-Creation-Date: 2017-08-26 11:26+0200\n" "PO-Revision-Date: 2017-05-08 06:40+0200\n" "Last-Translator: Peppy \n" "Language-Team: \n" @@ -22,14 +22,35 @@ msgstr "" msgid "Blue street sign" msgstr "Plaque de rue bleue" +#: nodes.lua +msgid "Red and white town sign" +msgstr "Panneau de ville rouge et blanc" + +#: nodes.lua +msgid "White street sign" +msgstr "Panneau blanc" + #: nodes.lua msgid "Green street sign" -msgstr "Plaque de rue verte" +msgstr "Panneau vert" + +#: nodes.lua +msgid "Yellow street sign" +msgstr "Panneau jaune" #: nodes.lua msgid "Black direction sign" -msgstr "Panneau indicateur noir" +msgstr "Panneau de direction noir" #: nodes.lua msgid "Green direction sign" -msgstr "Panneau indicateur vert" +msgstr "Panneau de direction vert" + +#: nodes.lua +msgid "Yellow direction sign" +msgstr "Panneau de direction jaune" + +#: nodes.lua +msgid "White direction sign" +msgstr "Panneau de direction blanc" + diff --git a/signs_road/locale/template.pot b/signs_road/locale/template.pot index 1b5cfae..b15ce94 100644 --- a/signs_road/locale/template.pot +++ b/signs_road/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 09:50+0200\n" +"POT-Creation-Date: 2017-08-26 11:28+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,10 +21,22 @@ msgstr "" msgid "Blue street sign" msgstr "" +#: nodes.lua +msgid "Red and white town sign" +msgstr "" + +#: nodes.lua +msgid "White street sign" +msgstr "" + #: nodes.lua msgid "Green street sign" msgstr "" +#: nodes.lua +msgid "Yellow street sign" +msgstr "" + #: nodes.lua msgid "Black direction sign" msgstr "" @@ -32,3 +44,11 @@ msgstr "" #: nodes.lua msgid "Green direction sign" msgstr "" + +#: nodes.lua +msgid "Yellow direction sign" +msgstr "" + +#: nodes.lua +msgid "White direction sign" +msgstr "" diff --git a/signs_road/nodes.lua b/signs_road/nodes.lua index 980d4a3..9b7f205 100644 --- a/signs_road/nodes.lua +++ b/signs_road/nodes.lua @@ -22,134 +22,290 @@ local S = signs_road.intllib local models = { - blue_street={ + blue_street_sign = { depth = 1/16, width = 14/16, height = 12/16, entity_fields = { resolution = { x = 144, y = 64 }, maxlines = 3, - color="#fff", + color = "#fff", }, node_fields = { - description=S("Blue street sign"), - tiles={"signs_blue_street.png"}, - inventory_image="signs_blue_street_inventory.png", + description = S("Blue street sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_blue.png" }, + inventory_image = "signs_road_blue.png", }, }, - green_street={ - depth = 1/32, + red_street_sign = { + depth = 1/16, width = 1, - height = 6/16, + height = 7/16, entity_fields = { resolution = { x = 96, y = 64 }, maxlines = 1, - color="#fff", + color = "#000", }, node_fields = { - description=S("Green street sign"), - tiles={"signs_green_street.png"}, - inventory_image="signs_green_street_inventory.png", + description = S("Red and white town sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_red_white.png" }, + inventory_image="signs_road_red_white.png", }, }, - black_right={ + white_street_sign = { + depth = 1/16, + width = 1, + height = 7/16, + entity_fields = { + resolution = { x = 96, y = 64 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("White street sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_white.png" }, + inventory_image = "signs_road_white.png", + }, + }, + green_street_sign = { + depth = 1/16, + width = 1, + height = 7/16, + entity_fields = { + resolution = { x = 96, y = 64 }, + maxlines = 2, + color = "#fff", + }, + node_fields = { + description = S("Green street sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_green.png" }, + inventory_image = "signs_road_green.png", + }, + }, + yellow_street_sign = { + depth = 1/16, + width = 1, + height = 7/16, + entity_fields = { + resolution = { x = 96, y = 64 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("Yellow street sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_yellow.png" }, + inventory_image="signs_road_yellow.png", + }, + }, + black_right_sign = { + depth = 1/32, + width = 1, + height = 0.5, + entity_fields = { + resolution = { x = 96, y = 64 }, + maxlines = 1, + color = "#000", + }, + node_fields = { + description = S("Black direction sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_black_dir_right.png" }, + inventory_image = "signs_road_black_dir_inventory.png", + signs_other_dir = "signs_road:black_left_sign", + on_place = signs.on_place_direction, + on_rightclick = signs.on_right_click_direction, + }, + }, + black_left_sign = { depth = 1/32, width = 1, height = 0.5, entity_fields = { resolution = { x = 96, y = 64 }, maxlines = 1, - color="#000", + color = "#000", }, node_fields = { - description=S("Black direction sign"), - tiles={"signs_black_right.png"}, - inventory_image="signs_black_inventory.png", - on_place=signs.on_place_direction, - on_rightclick=signs.on_right_click_direction, + description = S("Black direction sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_black_dir_left.png" }, + inventory_image = "signs_road_black_dir_inventory.png", + signs_other_dir = "signs_road:black_right_sign", + groups = { not_in_creative_inventory = 1 }, + drop = "signs_road:black_right_sign", + on_place = signs.on_place_direction, + on_rightclick = signs.on_right_click_direction, }, }, - black_left={ - depth = 1/32, - width = 1, - height = 0.5, - entity_fields = { - resolution = { x = 96, y = 64 }, - maxlines = 1, - color="#000", - }, - node_fields = { - description=S("Black direction sign"), - tiles={"signs_black_left.png"}, - inventory_image="signs_black_inventory.png", - groups={not_in_creative_inventory=1}, - drop="signs_road:black_right", - on_place=signs.on_place_direction, - on_rightclick=signs.on_right_click_direction, - }, - }, - green_right={ + + green_right_sign = { depth = 1/16, width = 14/16, height = 7/16, entity_fields = { + right = -3/32, size = { x = 12/16, y = 6/16 }, resolution = { x = 112, y = 64 }, maxlines = 2, - color="#fff", + color = "#fff", }, node_fields = { - description=S("Green direction sign"), - tiles={"signs_green_direction.png"}, - inventory_image="signs_green_dir_inventory.png", - on_place=signs.on_place_direction, + description = S("Green direction sign"), + tiles = { "signs_road_green_direction.png" }, + inventory_image = "signs_road_green_dir_inventory.png", + signs_other_dir = "signs_road:green_left_sign", + on_place = signs.on_place_direction, on_rightclick = signs.on_right_click_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 } }, }, }, - green_left={ + green_left_sign = { depth = 1/16, width = 14/16, height = 7/16, entity_fields = { + right = 3/32, size = { x = 12/16, y = 6/16 }, resolution = { x = 112, y = 64 }, maxlines = 2, color="#fff", }, node_fields = { - description=S("Green direction sign"), - tiles={"signs_green_direction.png"}, - inventory_image="signs_green_dir_inventory.png", + description = S("Green direction sign"), + tiles = { "signs_road_green_direction.png" }, + inventory_image = "signs_road_green_dir_inventory.png", + signs_other_dir = "signs_road:green_right_sign", + on_place = signs.on_place_direction, + on_rightclick = signs.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_left.obj", + 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_road:green_right_sign", + }, + }, + yellow_right_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = -3/32, + size = { x = 12/16, y = 6/16 }, + resolution = { x = 112, y = 64 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("Yellow direction sign"), + tiles = { "signs_road_yellow_direction.png" }, + inventory_image = "signs_road_yellow_dir_inventory.png", + signs_other_dir = "signs_road:yellow_left_sign", + on_place = signs.on_place_direction, + on_rightclick = signs.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_right.obj", + 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 } }, + }, + }, + yellow_left_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = 3/32, + size = { x = 12/16, y = 6/16 }, + resolution = { x = 112, y = 64 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("Yellow direction sign"), + tiles = { "signs_road_yellow_direction.png" }, + inventory_image = "signs_road_yellow_dir_inventory.png", + signs_other_dir = "signs_road:yellow_right_sign", + on_place = signs.on_place_direction, + on_rightclick = signs.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_left.obj", + 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_road:yellow_left_sign", + }, + }, + white_right_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = -3/32, + size = { x = 12/16, y = 6/16 }, + resolution = { x = 112, y = 64 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("White direction sign"), + tiles = { "signs_road_white_direction.png" }, + inventory_image = "signs_road_white_dir_inventory.png", + signs_other_dir = "signs_road:white_left_sign", + on_place = signs.on_place_direction, + on_rightclick = signs.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_right.obj", + 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 } }, + }, + }, + white_left_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = 3/32, + size = { x = 12/16, y = 6/16 }, + resolution = { x = 112, y = 64 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("White direction sign"), + tiles = { "signs_road_white_direction.png" }, + inventory_image = "signs_road_white_dir_inventory.png", + signs_other_dir = "signs_road:white_right_sign", on_place=signs.on_place_direction, on_rightclick = signs.on_right_click_direction, 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_road:green_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_road:white_right_sign", }, }, } +-- Node registration for name, model in pairs(models) do signs.register_sign("signs_road", name, model) end + diff --git a/signs_road/svg/green_street.svg b/signs_road/svg/green_street.svg new file mode 100644 index 0000000..89d8474 --- /dev/null +++ b/signs_road/svg/green_street.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/signs_road/svg/signs_black.svg b/signs_road/svg/signs_black.svg new file mode 100644 index 0000000..8e9b8a9 --- /dev/null +++ b/signs_road/svg/signs_black.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/signs_road/svg/signs_blue_street.svg b/signs_road/svg/signs_blue_street.svg new file mode 100644 index 0000000..0aa87ff --- /dev/null +++ b/signs_road/svg/signs_blue_street.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/signs_road/svg/signs_green_direction.svg b/signs_road/svg/signs_green_direction.svg new file mode 100644 index 0000000..3cdbc77 --- /dev/null +++ b/signs_road/svg/signs_green_direction.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/signs_road/svg/signs_road_black_direction.svg b/signs_road/svg/signs_road_black_direction.svg new file mode 100644 index 0000000..f513524 --- /dev/null +++ b/signs_road/svg/signs_road_black_direction.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/signs_road/svg/signs_road_red.svg b/signs_road/svg/signs_road_red.svg new file mode 100644 index 0000000..513b970 --- /dev/null +++ b/signs_road/svg/signs_road_red.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/signs_road/svg/signs_yellow_direction.svg b/signs_road/svg/signs_yellow_direction.svg new file mode 100644 index 0000000..1414a5c --- /dev/null +++ b/signs_road/svg/signs_yellow_direction.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/signs_road/svg/white_street.svg b/signs_road/svg/white_street.svg new file mode 100644 index 0000000..f33bc02 --- /dev/null +++ b/signs_road/svg/white_street.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/signs_road/svg/yellow_street.svg b/signs_road/svg/yellow_street.svg new file mode 100644 index 0000000..ea26f30 --- /dev/null +++ b/signs_road/svg/yellow_street.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/signs_road/textures/signs_blue_street_inventory.png b/signs_road/textures/signs_blue_street_inventory.png deleted file mode 100644 index a702669..0000000 Binary files a/signs_road/textures/signs_blue_street_inventory.png and /dev/null differ diff --git a/signs_road/textures/signs_green_dir_inventory.png b/signs_road/textures/signs_green_dir_inventory.png deleted file mode 100644 index 7d6567c..0000000 Binary files a/signs_road/textures/signs_green_dir_inventory.png and /dev/null differ diff --git a/signs_road/textures/signs_green_direction.png b/signs_road/textures/signs_green_direction.png deleted file mode 100644 index 6becd79..0000000 Binary files a/signs_road/textures/signs_green_direction.png and /dev/null differ diff --git a/signs_road/textures/signs_green_street.png b/signs_road/textures/signs_green_street.png deleted file mode 100644 index b5c653d..0000000 Binary files a/signs_road/textures/signs_green_street.png and /dev/null differ diff --git a/signs_road/textures/signs_green_street_inventory.png b/signs_road/textures/signs_green_street_inventory.png deleted file mode 100644 index 6c2a52c..0000000 Binary files a/signs_road/textures/signs_green_street_inventory.png and /dev/null differ diff --git a/signs_road/textures/signs_black_inventory.png b/signs_road/textures/signs_road_black_dir_inventory.png similarity index 100% rename from signs_road/textures/signs_black_inventory.png rename to signs_road/textures/signs_road_black_dir_inventory.png diff --git a/signs_road/textures/signs_black_left.png b/signs_road/textures/signs_road_black_dir_left.png similarity index 100% rename from signs_road/textures/signs_black_left.png rename to signs_road/textures/signs_road_black_dir_left.png diff --git a/signs_road/textures/signs_black_right.png b/signs_road/textures/signs_road_black_dir_right.png similarity index 100% rename from signs_road/textures/signs_black_right.png rename to signs_road/textures/signs_road_black_dir_right.png diff --git a/signs_road/textures/signs_blue_street.png b/signs_road/textures/signs_road_blue.png similarity index 100% rename from signs_road/textures/signs_blue_street.png rename to signs_road/textures/signs_road_blue.png diff --git a/signs_road/textures/signs_road_green.png b/signs_road/textures/signs_road_green.png new file mode 100644 index 0000000..8512fb1 Binary files /dev/null and b/signs_road/textures/signs_road_green.png differ diff --git a/signs_road/textures/signs_road_green_dir_inventory.png b/signs_road/textures/signs_road_green_dir_inventory.png new file mode 100644 index 0000000..3b7f031 Binary files /dev/null and b/signs_road/textures/signs_road_green_dir_inventory.png differ diff --git a/signs_road/textures/signs_road_green_direction.png b/signs_road/textures/signs_road_green_direction.png new file mode 100644 index 0000000..c4c8d10 Binary files /dev/null and b/signs_road/textures/signs_road_green_direction.png differ diff --git a/signs_road/textures/signs_road_red_white.png b/signs_road/textures/signs_road_red_white.png new file mode 100644 index 0000000..7afc658 Binary files /dev/null and b/signs_road/textures/signs_road_red_white.png differ diff --git a/signs_road/textures/signs_road_sides.png b/signs_road/textures/signs_road_sides.png new file mode 100644 index 0000000..7afd08e Binary files /dev/null and b/signs_road/textures/signs_road_sides.png differ diff --git a/signs_road/textures/signs_road_white.png b/signs_road/textures/signs_road_white.png new file mode 100644 index 0000000..3fd45fb Binary files /dev/null and b/signs_road/textures/signs_road_white.png differ diff --git a/signs_road/textures/signs_road_white_dir_inventory.png b/signs_road/textures/signs_road_white_dir_inventory.png new file mode 100644 index 0000000..5cc6dc4 Binary files /dev/null and b/signs_road/textures/signs_road_white_dir_inventory.png differ diff --git a/signs_road/textures/signs_road_white_direction.png b/signs_road/textures/signs_road_white_direction.png new file mode 100644 index 0000000..e6ae658 Binary files /dev/null and b/signs_road/textures/signs_road_white_direction.png differ diff --git a/signs_road/textures/signs_road_yellow.png b/signs_road/textures/signs_road_yellow.png new file mode 100644 index 0000000..1c546fd Binary files /dev/null and b/signs_road/textures/signs_road_yellow.png differ diff --git a/signs_road/textures/signs_road_yellow_dir_inventory.png b/signs_road/textures/signs_road_yellow_dir_inventory.png new file mode 100644 index 0000000..8b56025 Binary files /dev/null and b/signs_road/textures/signs_road_yellow_dir_inventory.png differ diff --git a/signs_road/textures/signs_road_yellow_direction.png b/signs_road/textures/signs_road_yellow_direction.png new file mode 100644 index 0000000..f5b1b18 Binary files /dev/null and b/signs_road/textures/signs_road_yellow_direction.png differ diff --git a/steles/README.md b/steles/README.md index 7b621dc..e83a6af 100644 --- a/steles/README.md +++ b/steles/README.md @@ -2,6 +2,8 @@ This mod provides stone steles 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, technic? (Technic adds marble and granite steles) diff --git a/steles/init.lua b/steles/init.lua index a84a596..e5d2430 100644 --- a/steles/init.lua +++ b/steles/init.lua @@ -19,11 +19,11 @@ --]] steles = {} -steles.path = minetest.get_modpath("steles") +steles.name = minetest.get_current_modname() +steles.path = minetest.get_modpath(steles.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(steles.path.."/intllib.lua") steles.intllib = S dofile(steles.path.."/config.lua") diff --git a/steles/locale/template.pot b/steles/locale/template.pot index f494ee7..0144ace 100644 --- a/steles/locale/template.pot +++ b/steles/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 11:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/steles/nodes.lua b/steles/nodes.lua index a298293..39eb9ee 100644 --- a/steles/nodes.lua +++ b/steles/nodes.lua @@ -87,6 +87,7 @@ for i, material in ipairs(steles.materials) do end end end, + on_punch = function(pos, node, player, pointed_thing) display_lib.update_entities(pos) end, }) end end