From c1835931e52769bf50425990370b60dfc9d17f63 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Thu, 1 Nov 2018 18:10:26 +0100 Subject: [PATCH] Added labels and wooden signs --- signs/crafts.lua | 47 ++++- signs/nodes.lua | 75 ++++++-- signs/svg/poster.svg | 171 ++++++++++-------- signs/textures/signs_label.png | Bin 0 -> 404 bytes .../textures/signs_label_medium_inventory.png | Bin 0 -> 406 bytes .../textures/signs_label_small_inventory.png | Bin 0 -> 417 bytes .../signs_wooden_direction_inventory.png | Bin 546 -> 710 bytes signs/textures/signs_wooden_long.png | Bin 0 -> 524 bytes .../textures/signs_wooden_long_inventory.png | Bin 0 -> 636 bytes 9 files changed, 202 insertions(+), 91 deletions(-) create mode 100644 signs/textures/signs_label.png create mode 100644 signs/textures/signs_label_medium_inventory.png create mode 100644 signs/textures/signs_label_small_inventory.png create mode 100644 signs/textures/signs_wooden_long.png create mode 100644 signs/textures/signs_wooden_long_inventory.png diff --git a/signs/crafts.lua b/signs/crafts.lua index b4e0206..ef82dbc 100644 --- a/signs/crafts.lua +++ b/signs/crafts.lua @@ -2,17 +2,60 @@ minetest.register_craft({ output = 'signs:wooden_right_sign', recipe = { {'group:wood', 'group:wood', 'group:wood'}, - {'group:wood', 'group:wood', ''}, + {'group:wood', 'group:wood', 'dye:black'}, {'', '', ''}, } }) +minetest.register_craft({ + output = 'signs:wooden_right_sign', + type = 'shapeless', + recipe = { 'signs:wooden_long_sign' } +}) + +minetest.register_craft({ + output = 'signs:wooden_long_sign', + recipe = { + {'group:wood', 'dye:black', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + output = 'signs:wooden_long_sign', + type = 'shapeless', + recipe = { 'signs:wooden_right_sign' } +}) + +minetest.register_craft({ + output = 'signs:wooden_sign', + recipe = { + {'', 'dye:black', ''}, + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + minetest.register_craft({ output = 'signs:paper_poster', recipe = { - {'default:paper', 'default:paper', ''}, + {'default:paper', 'default:paper', 'dye:black'}, {'default:paper', 'default:paper', ''}, {'default:paper', 'default:paper', ''}, } }) +minetest.register_craft({ + output = 'signs:label_small', + recipe = { + {'default:paper', 'dye:black'}, + } +}) + +minetest.register_craft({ + output = 'signs:label_small', + recipe = { + {'default:paper', 'default:paper', 'dye:black'}, + } +}) diff --git a/signs/nodes.lua b/signs/nodes.lua index 7500297..c74ab6f 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -77,12 +77,12 @@ 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 - fields.edit then + if formname == node.name.."@"..minetest.pos_to_string(pos)..":display" + and fields.edit then edit_poster(pos, node, player) end - if formname == node.name.."@"..minetest.pos_to_string(pos)..":edit" and - (fields.write or fields.key_enter) then + if formname == node.name.."@"..minetest.pos_to_string(pos)..":edit" + and (fields.write 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 @@ -99,9 +99,7 @@ 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, + depth = 1/16, width = 14/16, height = 12/16, entity_fields = { size = { x = 12/16, y = 10/16 }, maxlines = 3, @@ -111,12 +109,29 @@ local models = { description = S("Wooden sign"), tiles = { "signs_wooden.png" }, inventory_image = "signs_wooden_inventory.png", + groups= { dig_immediate = 2 }, + }, + }, + wooden_long_sign = { + depth = 1/16, width = 1, height = 7/16, + entity_fields = { + size = { x = 1, y = 6/16 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("Wooden long sign"), + tiles = { "signs_wooden_long.png", "signs_wooden_long.png", + "signs_wooden_long.png^[transformR90", + "signs_wooden_long.png^[transformR90", + "signs_wooden_long.png", "signs_wooden_long.png", + }, + inventory_image = "signs_wooden_long_inventory.png", + groups= { dig_immediate = 2 }, }, }, wooden_right_sign = { - depth = 1/16, - width = 14/16, - height = 7/16, + depth = 1/16, width = 14/16, height = 7/16, entity_fields = { right = -3/32, size = { x = 12/16, y = 6/16 }, @@ -133,12 +148,11 @@ local models = { 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}}, + groups= { dig_immediate = 2 }, }, }, wooden_left_sign = { - depth = 1/16, - width = 14/16, - height = 7/16, + depth = 1/16, width = 14/16, height = 7/16, entity_fields = { right = 3/32, size = { x = 12/16, y = 6/16 }, @@ -154,14 +168,12 @@ local models = { 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 }, + groups = { not_in_creative_inventory = 1, dig_immediate = 2 }, drop = "signs:wooden_right_sign", }, }, paper_poster = { - depth = 1/32, - width = 26/32, - height = 30/32, + depth = 1/32, width = 26/32, height = 30/32, entity_fields = { top = -11/32, size = { x = 26/32, y = 6/32 }, @@ -174,11 +186,40 @@ local models = { "signs_poster_sides.png", "signs_poster_sides.png", "signs_poster_sides.png", "signs_poster.png" }, inventory_image = "signs_poster_inventory.png", + groups= { dig_immediate = 3 }, on_construct = display_api.on_construct, on_rightclick = display_poster, on_receive_fields = on_receive_fields_poster, }, }, + label_small = { + depth = 1/32, width = 4/16, height = 4/16, + entity_fields = { + size = { x = 4/16, y = 4/16 }, + maxlines = 1, + color = "#000", + }, + node_fields = { + description = S("Small label"), + tiles = { "signs_label.png" }, + inventory_image = "signs_label_small_inventory.png", + groups= { dig_immediate = 3 }, + }, + }, + label_medium = { + depth = 1/32, width = 8/16, height = 8/16, + entity_fields = { + size = { x = 8/16, y = 8/16 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("Label"), + tiles = { "signs_label.png" }, + inventory_image = "signs_label_medium_inventory.png", + groups= { dig_immediate = 3 }, + }, + }, } -- Node registration diff --git a/signs/svg/poster.svg b/signs/svg/poster.svg index 4f6f774..f2388a8 100644 --- a/signs/svg/poster.svg +++ b/signs/svg/poster.svg @@ -15,8 +15,8 @@ height="32px" id="svg2985" version="1.1" - inkscape:version="0.48.4 r9939" - sodipodi:docname="affiche.svg" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="poster.svg" inkscape:export-filename="/home/pyrollo/dev/minetest-mods/signs/textures/signs_poster.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> @@ -73,18 +73,18 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.197802" - inkscape:cx="-4.798213" - inkscape:cy="9.6735437" - inkscape:current-layer="layer5" + inkscape:zoom="22.395604" + inkscape:cx="15.573035" + inkscape:cy="16.977299" + inkscape:current-layer="layer2" showgrid="true" inkscape:grid-bbox="true" inkscape:document-units="px" - inkscape:window-width="1239" - inkscape:window-height="776" - inkscape:window-x="41" - inkscape:window-y="24" - inkscape:window-maximized="1" + inkscape:window-width="785" + inkscape:window-height="447" + inkscape:window-x="2459" + inkscape:window-y="340" + inkscape:window-maximized="0" showguides="true" inkscape:guide-bbox="true" inkscape:object-paths="true"> @@ -95,11 +95,13 @@ visible="true" enabled="true" snapvisiblegridlinesonly="true" - spacingx="0.5px" - spacingy="0.5px" + spacingx="0.5" + spacingy="0.5" dotted="false" color="#ff0000" - opacity="0.1254902" /> + opacity="0.1254902" + originx="0" + originy="0" /> @@ -109,7 +111,7 @@ image/svg+xml - + @@ -127,7 +129,7 @@ height="32.081406" width="32.003735" /> + y="-10.876763" + style="font-family:sans-serif" />  + inkscape:label="Fond inv" + style="display:inline"> READ ME ! + style="font-weight:bold;font-size:3.42845988px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'Sans Bold'">READ ME ! + + + + + style="display:none"> diff --git a/signs/textures/signs_label.png b/signs/textures/signs_label.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf7edc812c1cc58db00e778af04c84d96a9ca63 GIT binary patch literal 404 zcmeAS@N?(olHy`uVBq!ia0vp^{22?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4M>n@T|Jb8nG!Q(*FMcNi3cW9*fR@xz8;0i~GYq z`wIuyN;`9cSUWy@KG&J`gVVuDwL+BRK%KQ-sEPo`-J7#-Uz@m(b92|$bH#O16;{h@ zXjS=M^3ZL+4F%3D%;M^5{_K1{9@Dn(}u?mpSvx4d8=#Y z`{I3JITNoGZhg8tnM>-GTX#y2<5d@-&_?0gukTOzR$H`mnaN)%%v+15JKS6H>+3)He|jgM{S8Vs0fr!hr>mdKI;Vst028yNHvj+t literal 0 HcmV?d00001 diff --git a/signs/textures/signs_label_medium_inventory.png b/signs/textures/signs_label_medium_inventory.png new file mode 100644 index 0000000000000000000000000000000000000000..96222015d0f4d4fc9ac607503fbd6d6fe79a9ccf GIT binary patch literal 406 zcmV;H0crk;P)<;9l5S2Tr2@7(Jw}vjzSZbF1BQfh+h_RI~!f5*~Ju0+8YEtd@o+2onYUZ3L z#y<&euyZ+0lJiNF{J>5CGLy_aCjbNy0TMZ%TR|Yvc_HUSq0I<7S+C|8q#vpSdiA=*T+u{ELE{}%${i{pzTJz#Jq8jOXeaD&T z@qPQ>yZdpR_m0f3^WgNF*08Gur8-uq?dawF7xWp-cEZTF>i_@%07*qoM6N<$g3X?+ ABLDyZ literal 0 HcmV?d00001 diff --git a/signs/textures/signs_label_small_inventory.png b/signs/textures/signs_label_small_inventory.png new file mode 100644 index 0000000000000000000000000000000000000000..2dd60af3a5fb96f807fa6224a919cc0c31c10215 GIT binary patch literal 417 zcmV;S0bc%zP)E$Y z*wiv`+BYc2aw>=-a3&zulGa^R;BX(_|2#T!85Oaz;n;0RFXqq+tOa%hZG)T7X3iJJ z7iPC(2YEd9_L8MA*sdrZ<5v+hcmvY}*j~FX<#r>^Y&z4e%kPK4&a>7_y$4DWkcAI0 z&Uuc)kn^~!Q>ydXlO*ShD10%V-GVvKfDtOYM9$Y5XCPH(&8Sg?V+=AUlE^f)c*fY) zyf=V|u^2Jz`$sjXlI>^ncE5v86>c>qFGhrZ-)=+KF9U#P^gzZxcsJL*(E`#%nG$Q^pE`;`oha=31S(x00000 LNkvXXu0mjfmzA;Q literal 0 HcmV?d00001 diff --git a/signs/textures/signs_wooden_direction_inventory.png b/signs/textures/signs_wooden_direction_inventory.png index 1b8e3d407db096d4b5406248e755db0a3efcc9f5..c4be3af43e45c1d35ae7845d194d786eacd32782 100644 GIT binary patch delta 674 zcmV;T0$u&01jYp+iBL{Q4GJ0x0000DNk~Le0000W0000W2nGNE0CReJ^pPPke+vN* zJ1(;fbt?r1{hQRnwG82!=9%P=_*PK&p_~`v{14 z=p!(|$jmb!Mph(dB!&p715s5Xk~B`7*h$HR}e;H+W{b*&qo&Ke@*c~uiFEl zT9tL)NaCyYDge$vyx|Q-JUXa{&mZ4b0B=6DuDkrIrFnat^|f8^fNE+39v0J4@9VeDKw5$0as1|XHx2tq~k{;e?nKCr&% ze!B#qSSw!}7=#`Gld)FF5r+Hw4FGZ_VHzkU&)Z!9+@7sFqxMK<3xH0$!-X5D*c7;M z0|j7=1|!LBZTGL-zMhNaZ2)%GUKof{!-*(ZTCVu`rK4io3x57Mcz{u?6s6BYiBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZy*e+d)` z1t*f9$T0u_0k26!K~y-))sww$(@+3~zkBU#$90^;^ARz`A7?2Q8z#|~u zfk$9~k(p;ejI4|-NT|w6RSHrZ^5ehj+&Hlr3LU$2K%56S`p(fgqHSAlBFPQ)?+wJO z=TF*QZLpM!F*QbOn&z?>uj`{6f5mdKB=9@v(%^a?Z$D1NUjuusHTUie5!;4dG)5OW z@()*8ZBW9-I_x4{i@MxU*E?Q5yWhTk|3v`ELRU0qOEik{;{n@EgH%3J`2@X?OjlTr zhhA0m;}E4R9-fSO@%VNNU<)A$`W~~NGeWZgAekl{j6y6+5%#(?Ta8i{e~VM# zKIuGVnU_pXzXJ$4hzDf4Q@R%0aTR%*Q=|p!b(vg#|9__6Kcl}_w&>)Y00000NkvXXu0mjfpZVn8 diff --git a/signs/textures/signs_wooden_long.png b/signs/textures/signs_wooden_long.png new file mode 100644 index 0000000000000000000000000000000000000000..c23a56afec2d27ecbac3d56e3bb7f978657665fd GIT binary patch literal 524 zcmV+n0`vWeP)eClh%@4Wi*DJO_LntC9~B5qZ~tsi*F zcSxz}+8#^9Ec1#nE9^ETSpj^le9RDDbq+*fd00 z#Ja4cPYF{y62<|UYXeYSDlGAex>XIYN>G(GVH!Og2mrWT3bdt=N+KM|z3NGyQCE+9_Rg; zWSRju9Z$UE2~uj3aLc;%Xe}vE1?8zA$s)oy_&?)6Go$slcb@O-ANePOFiM%0D6ixI O0000G9#zCGs(S&@B7Yo&J9*k6dW>6IB*;R9042wSZ`lF2Ovwg05og| zfbBNbnj`?^d39cNx-I~A%LX8r2LO0(8-OHMKBv4-#1F-dv%L#%LDVtOo~2`5{^+YxSp%KqNpYc%&vvBf2VJl zsej{@7&TkMc(T^oc2)b>xI9>{R8z;PFb;3R3iEg>=B