From 926242a585216ea3653c936c9b8e88230a61b088 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Thu, 25 Aug 2016 21:58:28 +0200 Subject: Relicensing to LGPL, fixes and evolutions --- signs/LICENSE.txt | 179 +++++++++++++++++++++++++++--- signs/README.md | 2 +- signs/common.lua | 60 ++++++---- signs/copyright.txt | 2 + signs/depends.txt | 1 + signs/init.lua | 22 +++- signs/models/signs_dir_left.obj | 44 ++++++++ signs/models/signs_dir_right.obj | 44 ++++++++ signs/nodes.lua | 64 +++++++++-- signs/textures/signs_dir_texture.png | Bin 0 -> 203 bytes signs/textures/signs_wooden_direction.png | Bin 0 -> 619 bytes 11 files changed, 371 insertions(+), 47 deletions(-) create mode 100644 signs/copyright.txt create mode 100644 signs/models/signs_dir_left.obj create mode 100644 signs/models/signs_dir_right.obj create mode 100644 signs/textures/signs_dir_texture.png create mode 100644 signs/textures/signs_wooden_direction.png (limited to 'signs') diff --git a/signs/LICENSE.txt b/signs/LICENSE.txt index bc06764..341c30b 100644 --- a/signs/LICENSE.txt +++ b/signs/LICENSE.txt @@ -1,13 +1,166 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - -Copyright (C) 2004 Sam Hocevar - -Everyone is permitted to copy and distribute verbatim or modified -copies of this license document, and changing it is allowed as long -as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/signs/README.md b/signs/README.md index 8e38019..472d157 100644 --- a/signs/README.md +++ b/signs/README.md @@ -4,7 +4,7 @@ This mod provides various signs with text display. Text is locked if area is pro **Dependancies**: default, display\_lib, font\_lib -**License**: WTFPL +**License**: Code under LGPL, Textures and models under CC-BY-SA ## Recipes diff --git a/signs/common.lua b/signs/common.lua index 24286b9..85da0b2 100644 --- a/signs/common.lua +++ b/signs/common.lua @@ -1,3 +1,23 @@ +--[[ + 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 . +--]] + function signs.set_formspec(pos) local meta = minetest.get_meta(pos) local ndef = minetest.registered_nodes[minetest.get_node(pos).name] @@ -70,24 +90,25 @@ function signs.on_place_direction(itemstack, placer, pointed_thing) end end --- On_rotate (screwdriver) callback for direction signs -function signs.on_rotate_direction(pos, node, user, mode, new_param2) - if mode == screwdriver.ROTATE_AXIS 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}) - end - return false - else - return display_lib.on_rotate(pos, node, user, mode, new_param2) - 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}) + end + end + + return itemstack end -- Generic callback for show_formspec displayed formspecs @@ -139,8 +160,7 @@ function signs.register_sign(mod, name, model) display_lib.on_construct(pos) end, on_destruct = display_lib.on_destruct, - on_rotate = display_lib.on_rotate, - on_receive_fields = signs.on_receive_fields, + on_receive_fields = signs.on_receive_fields, } -- Node fields override diff --git a/signs/copyright.txt b/signs/copyright.txt new file mode 100644 index 0000000..22f9aae --- /dev/null +++ b/signs/copyright.txt @@ -0,0 +1,2 @@ +Code and Models by Pierre-Yves Rollo +Textures by Pierre-Yves Rollo, except signs_default.png and signs_default_inventory.png by Kilbith diff --git a/signs/depends.txt b/signs/depends.txt index a5e20d4..b017eff 100644 --- a/signs/depends.txt +++ b/signs/depends.txt @@ -1,3 +1,4 @@ default display_lib font_lib +homedecor? diff --git a/signs/init.lua b/signs/init.lua index 81d3a5b..d3118b9 100644 --- a/signs/init.lua +++ b/signs/init.lua @@ -1,6 +1,22 @@ --- Signs mod by P.Y. Rollo --- --- License: WTFPL +--[[ + 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 . +--]] signs = {} signs.path = minetest.get_modpath("signs") diff --git a/signs/models/signs_dir_left.obj b/signs/models/signs_dir_left.obj new file mode 100644 index 0000000..0ed1d8f --- /dev/null +++ b/signs/models/signs_dir_left.obj @@ -0,0 +1,44 @@ +# Blender v2.69 (sub 0) OBJ File: 'signs_dir_left.blend' +# www.blender.org +mtllib signs_dir_left.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 +vt 0.062500 0.500000 +vt 0.062500 0.937500 +vt 0.812500 0.937500 +vt 1.000000 0.718750 +vt 0.812500 0.500000 +vt 0.062500 0.437500 +vt 0.812500 0.437500 +vt 1.000000 0.218750 +vt 0.812500 0.000000 +vt 0.062500 0.000000 +vt 1.000000 0.312500 +vt 0.937500 0.312500 +vt 0.937500 0.625000 +vt 1.000000 0.625000 +vt 0.062500 1.000000 +vt 0.812500 1.000000 +vt 0.000000 0.312500 +vt 0.062500 0.312500 +vt 0.000000 0.000000 +vt 0.000000 0.500000 +vt 0.000000 0.937500 +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 diff --git a/signs/models/signs_dir_right.obj b/signs/models/signs_dir_right.obj new file mode 100644 index 0000000..9c30880 --- /dev/null +++ b/signs/models/signs_dir_right.obj @@ -0,0 +1,44 @@ +# Blender v2.69 (sub 0) OBJ File: 'signs_dir_right.blend' +# www.blender.org +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 +vt 0.062500 0.500000 +vt 0.062500 0.937500 +vt 0.812500 0.937500 +vt 1.000000 0.718750 +vt 0.812500 0.500000 +vt 0.062500 0.437500 +vt 0.812500 0.437500 +vt 1.000000 0.218750 +vt 0.812500 0.000000 +vt 0.062500 0.000000 +vt 1.000000 0.312500 +vt 0.937500 0.312500 +vt 0.937500 0.625000 +vt 1.000000 0.625000 +vt 0.062500 1.000000 +vt 0.812500 1.000000 +vt 0.000000 0.312500 +vt 0.062500 0.312500 +vt 0.000000 0.000000 +vt 0.000000 0.500000 +vt 0.000000 0.937500 +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 diff --git a/signs/nodes.lua b/signs/nodes.lua index 0c23c5e..ab3c1e5 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -1,3 +1,23 @@ +--[[ + 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 . +--]] + -- Poster specific formspec local function on_rightclick_poster(pos, node, player) local formspec @@ -49,36 +69,57 @@ local models = { 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="Wooden direction sign", - tiles={"signs_wooden_right.png"}, + tiles={"signs_wooden_direction.png"}, inventory_image="signs_wooden_inventory.png", on_place=signs.on_place_direction, - on_rotate=signs.on_rotate_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={ - depth=1/16, + 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="Wooden direction sign", - tiles={"signs_wooden_left.png"}, + 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_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={choppy=1,oddly_breakable_by_hand=1,not_in_creative_inventory=1}, drop="signs:wooden_right", - on_place=signs.on_place_direction, - on_rotate=signs.on_rotate_direction, }, }, poster={ @@ -102,14 +143,16 @@ local models = { }, } - 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", { + signs.register_sign(":default", "sign_wall", { depth = 1/16, width = 14/16, height = 10/16, @@ -124,5 +167,6 @@ signs.register_sign(":default", "sign_wall", { tiles={"signs_default.png"}, inventory_image="signs_default_inventory.png", }, - }) + }) +end diff --git a/signs/textures/signs_dir_texture.png b/signs/textures/signs_dir_texture.png new file mode 100644 index 0000000..bcbbd68 Binary files /dev/null and b/signs/textures/signs_dir_texture.png differ diff --git a/signs/textures/signs_wooden_direction.png b/signs/textures/signs_wooden_direction.png new file mode 100644 index 0000000..23fad3f Binary files /dev/null and b/signs/textures/signs_wooden_direction.png differ -- cgit v1.2.3