From 2793e0ab8f67b28120bc19086efe126c96cd79dd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Thu, 20 Sep 2018 15:27:42 +0200 Subject: [PATCH] Added simple wooden sign --- signs/nodes.lua | 24 +++++++++++++++++----- signs/textures/signs_wooden_inventory.png | Bin 606 -> 581 bytes 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/signs/nodes.lua b/signs/nodes.lua index 7e2dbe8..7500297 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -27,7 +27,7 @@ local function display_poster(pos, node, player) local meta = minetest.get_meta(pos) local def = minetest.registered_nodes[node.name].display_entities["signs:display_text"] local font = font_api.get_font(meta:get_string("font") or def.font_name) - + -- Title texture local titletexture = font:make_text_texture( meta:get_string("display_text"), font:get_height()*8.4, font:get_height(), 1, "center") @@ -77,7 +77,7 @@ local function on_receive_fields_poster(pos, formname, fields, player) local node = minetest.get_node(pos) if not minetest.is_protected(pos, player:get_player_name()) and fields then - if formname == node.name.."@"..minetest.pos_to_string(pos)..":display" and + if formname == node.name.."@"..minetest.pos_to_string(pos)..":display" and fields.edit then edit_poster(pos, node, player) end @@ -98,6 +98,21 @@ display_api.register_display_entity("signs:display_text") -- Sign models and registration local models = { + wooden_sign = { + depth = 1/16, + width = 14/16, + height = 12/16, + entity_fields = { + size = { x = 12/16, y = 10/16 }, + maxlines = 3, + color = "#000", + }, + node_fields = { + description = S("Wooden sign"), + tiles = { "signs_wooden.png" }, + inventory_image = "signs_wooden_inventory.png", + }, + }, wooden_right_sign = { depth = 1/16, width = 14/16, @@ -111,7 +126,7 @@ local models = { node_fields = { description = S("Wooden direction sign"), tiles = { "signs_wooden_direction.png" }, - inventory_image = "signs_wooden_inventory.png", + inventory_image = "signs_wooden_direction_inventory.png", signs_other_dir = 'signs:wooden_left_sign', on_place = signs_api.on_place_direction, drawtype = "mesh", @@ -133,7 +148,7 @@ local models = { node_fields = { description = S("Wooden direction sign"), tiles = { "signs_wooden_direction.png" }, - inventory_image = "signs_wooden_inventory.png", + inventory_image = "signs_wooden_direction_inventory.png", signs_other_dir = 'signs:wooden_right_sign', drawtype = "mesh", mesh = "signs_dir_left.obj", @@ -171,4 +186,3 @@ for name, model in pairs(models) do signs_api.register_sign("signs", name, model) end - diff --git a/signs/textures/signs_wooden_inventory.png b/signs/textures/signs_wooden_inventory.png index d99748060bdf835d2f90e30bdfefc9c961873665..bb7e9496c70caa1d38242459ec90f63438a1d567 100644 GIT binary patch delta 531 zcmV+u0_^?X1jPi9J%0-m000XU0RWnu7ytkO2XskIMF-*u6bLvc`L*h}0005fNklE2|IR;xZJd67kJ1C0W<^ui7=NrBu@+p@a5y14e+SkGKjCA-T`brygk8>1M0FOy-9Z+f+WCn25CvUW`(j8 zdT8_g=Pv+ZmGu&Ue7>N_W{lzh%a+Kkxal-S3kzi_+QluPnl6 z@vdMt6^nU8HJfpK`~olXF+xyX-qM>4uOBbEX$crro29Rg&PK3{=TAZRs@H^-Zpy93X>3k`}-BG zS+ZUmBH!JaNoz%GI75XP(iKYLZW-7qQ{H)27XV5(=;Qev9z1!=Xc+OLzQxMM7KWwp@Z~3}wFcGK4Tdt} z(OLtEH&g zzc52S?@F<_FfV7Pa&!*+xcMx8yMrI}IZ<#?Rh?cpKq!)Em=MPa0B$}z_HP>F7If2M zrT&x0Z#K~kg;$@qdH(Si!x%ij%hUDm)S9~(rjB8bp?|{|-fwQBv|DXRPwhjKR?8FW&ABtT&s9o9gOIb+1xzQ+ z$*e{um!ncDka8T#u0^plN!hiLG3*4A`>S8YjoB$QfaTf-08Y*!4)-wZ6hFK@;y5N5 u4L~t44<$l6hd$|y!`_%#bWD^00000