From d35bc1e515253bcda6c60523c2c94f232528e2b9 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Thu, 26 Sep 2019 00:51:30 -0400 Subject: [PATCH] Adapt to changes in signs_lib API Requires signs_lib commit 38362152 (2019-09-25) or later Use custom pole mount images for glass signs Use custom model for yard version of glass signs Move wooden yard sign back to signs_lib --- init.lua | 109 +++++------------- models/basic_signs_yard_sign.obj | 85 -------------- models/basic_signs_yard_sign_entity.obj | 15 --- textures/basic_signs_pole_mount_glass.png | Bin 0 -> 772 bytes .../basic_signs_pole_mount_obsidian_glass.png | Bin 0 -> 672 bytes 5 files changed, 26 insertions(+), 183 deletions(-) delete mode 100644 models/basic_signs_yard_sign.obj delete mode 100644 models/basic_signs_yard_sign_entity.obj create mode 100644 textures/basic_signs_pole_mount_glass.png create mode 100644 textures/basic_signs_pole_mount_obsidian_glass.png diff --git a/init.lua b/init.lua index 6d383ba..9cda6ea 100644 --- a/init.lua +++ b/init.lua @@ -9,65 +9,11 @@ dofile(basic_signs.path .. "/crafting.lua") local S, NS = dofile(basic_signs.path .. "/intllib.lua") basic_signs.gettext = S -function basic_signs.check_for_floor(pointed_thing) - if pointed_thing.above.x == pointed_thing.under.x - and pointed_thing.above.z == pointed_thing.under.z - and pointed_thing.above.y > pointed_thing.under.y then - return true - end -end - -function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing) - - local playername = placer:get_player_name() - local pt_name = minetest.get_node(pointed_thing.under).name - local node = minetest.get_node(pos) -- since we're in after-place, this will be the wall sign itself - - if minetest.is_protected(pointed_thing.under, playername) then - minetest.record_protection_violation(pointed_thing.under, playername) - return itemstack - end - - local newparam2 = minetest.dir_to_facedir(placer:get_look_dir()) - - if minetest.registered_nodes[pt_name] and - minetest.registered_nodes[pt_name].on_rightclick and - not placer:get_player_control().sneak then - return minetest.registered_nodes[pt_name].on_rightclick(pos, node, placer, itemstack, pointed_thing) - elseif signs_lib.check_for_pole(pos, pointed_thing) then - minetest.swap_node(pos, {name = "default:sign_wall_wood_onpole", param2 = node.param2}) - elseif signs_lib.check_for_horizontal_pole(pos, pointed_thing) then - minetest.swap_node(pos, {name = "default:sign_wall_wood_onpole_horiz", param2 = node.param2}) - elseif signs_lib.check_for_ceiling(pointed_thing) then - minetest.swap_node(pos, {name = "default:sign_wall_wood_hanging", param2 = newparam2}) - elseif basic_signs.check_for_floor(pointed_thing) then - minetest.swap_node(pos, {name = "basic_signs:yard_sign", param2 = newparam2}) - end - signs_lib.update_sign(pos) - - if not creative.is_enabled_for(playername) then - itemstack:take_item() - end - return itemstack -end - -local def - -local wgroups = table.copy(signs_lib.standard_wood_groups) -wgroups.not_in_creative_inventory = 1 - -local sgroups = table.copy(signs_lib.standard_steel_groups) -sgroups.not_in_creative_inventory = 1 - -minetest.override_item("default:sign_wall_wood", { - after_place_node = basic_signs.determine_sign_type -}) - signs_lib.register_sign("basic_signs:sign_wall_locked", { description = S("Locked Sign"), tiles = { "basic_signs_sign_wall_locked.png", - "signs_lib_sign_wall_steel_edges.png", + "signs_lib_sign_wall_steel_edges.png" }, inventory_image = "basic_signs_sign_wall_locked_inv.png", locked = true, @@ -75,14 +21,20 @@ signs_lib.register_sign("basic_signs:sign_wall_locked", { allow_hanging = true, allow_widefont = true, allow_onpole = true, - allow_onpole_horizontal = true + allow_onpole_horizontal = true, + allow_yard = true, }) signs_lib.register_sign("basic_signs:sign_wall_glass", { description = S("Glass Sign"), + yard_mesh = "signs_lib_standard_sign_yard_two_sticks.obj", tiles = { { name = "basic_signs_sign_wall_glass.png", backface_culling = true}, "basic_signs_sign_wall_glass_edges.png", + "basic_signs_pole_mount_glass.png", + nil, + nil, + "default_steel_block.png" -- the sticks on back of the yard sign model }, inventory_image = "basic_signs_sign_wall_glass_inv.png", default_color = "c", @@ -94,14 +46,20 @@ signs_lib.register_sign("basic_signs:sign_wall_glass", { allow_widefont = true, allow_onpole = true, allow_onpole_horizontal = true, + allow_yard = true, use_texture_alpha = true, }) signs_lib.register_sign("basic_signs:sign_wall_obsidian_glass", { description = S("Obsidian Glass Sign"), + yard_mesh = "signs_lib_standard_sign_yard_two_sticks.obj", tiles = { { name = "basic_signs_sign_wall_obsidian_glass.png", backface_culling = true}, "basic_signs_sign_wall_obsidian_glass_edges.png", + "basic_signs_pole_mount_obsidian_glass.png", + nil, + nil, + "default_steel_block.png" -- the sticks on back of the yard sign model }, inventory_image = "basic_signs_sign_wall_obsidian_glass_inv.png", default_color = "c", @@ -113,12 +71,12 @@ signs_lib.register_sign("basic_signs:sign_wall_obsidian_glass", { allow_widefont = true, allow_onpole = true, allow_onpole_horizontal = true, + allow_yard = true, use_texture_alpha = true, }) minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked") - -- array : color, translated color, default text color local sign_colors = { @@ -139,48 +97,33 @@ for i, color in ipairs(sign_colors) do description = S("Sign (@1, steel)", color[2]), paramtype2 = "facedir", selection_box = cbox, - mesh = "signs_lib_standard_wall_sign_facedir.obj", + mesh = "signs_lib_standard_facedir_sign_wall.obj", tiles = { "basic_signs_steel_"..color[1]..".png", "signs_lib_sign_wall_steel_edges.png", + nil, + nil, + "default_steel_block.png" }, inventory_image = "basic_signs_steel_"..color[1].."_inv.png", groups = signs_lib.standard_steel_groups, sounds = signs_lib.standard_steel_sign_sounds, default_color = color[3], entity_info = { - mesh = "signs_lib_standard_wall_sign_entity.obj", + mesh = "signs_lib_standard_sign_entity_wall.obj", yaw = signs_lib.standard_yaw }, allow_hanging = true, allow_widefont = true, allow_onpole = true, - allow_onpole_horizontal = true + allow_onpole_horizontal = true, + allow_yard = true, }) + minetest.register_alias("basic_signs:sign_wall_steel_"..color[1].."_onpole", "basic_signs:sign_steel_"..color[1].."_onpole") + minetest.register_alias("basic_signs:sign_wall_steel_"..color[1].."_onpole_horiz", "basic_signs:sign_steel_"..color[1].."_onpole_horiz") + minetest.register_alias("basic_signs:sign_wall_steel_"..color[1].."_hanging", "basic_signs:sign_steel_"..color[1].."_hanging") + table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1]) minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1]) end - -signs_lib.register_sign("basic_signs:yard_sign", { - description = "Wooden yard sign", - paramtype2 = "facedir", - selection_box = signs_lib.make_selection_boxes(35, 34.5, false, 0, -1.25, -19.69, true), - mesh = "basic_signs_yard_sign.obj", - tiles = { - "signs_lib_sign_wall_wooden.png", - "signs_lib_sign_wall_wooden_edges.png", - "default_wood.png" - }, - inventory_image = "default_sign_wood.png", - entity_info = { - mesh = "basic_signs_yard_sign_entity.obj", - yaw = signs_lib.standard_yaw - }, - groups = wgroups, - drop = "default:sign_wall_wood", - allow_widefont = true -}) - -table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard") -minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign") diff --git a/models/basic_signs_yard_sign.obj b/models/basic_signs_yard_sign.obj deleted file mode 100644 index b6ed365..0000000 --- a/models/basic_signs_yard_sign.obj +++ /dev/null @@ -1,85 +0,0 @@ -# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend' -# www.blender.org -o Cube -v 0.437500 -0.250000 -0.000000 -v 0.437500 -0.250000 -0.062500 -v 0.437500 0.375000 0.000000 -v 0.437500 0.375000 -0.062500 -v -0.437500 -0.250000 -0.000000 -v -0.437500 -0.250000 -0.062500 -v -0.437500 0.375000 0.000000 -v -0.437500 0.375000 -0.062500 -v 0.437500 -0.250000 -0.000000 -v 0.437500 -0.250000 -0.062500 -v 0.437500 0.375000 0.000000 -v 0.437500 0.375000 -0.062500 -v -0.437500 -0.250000 -0.000000 -v -0.437500 -0.250000 -0.062500 -v -0.437500 0.375000 0.000000 -v -0.437500 0.375000 -0.062500 -v 0.062500 -0.500000 0.000000 -v 0.062500 0.250000 0.000000 -v 0.062500 -0.500000 0.062500 -v 0.062500 0.250000 0.062500 -v -0.062500 -0.500000 0.000000 -v -0.062500 0.250000 0.000000 -v -0.062500 -0.500000 0.062500 -v -0.062500 0.250000 0.062500 -vt 0.468750 0.812500 -vt 0.031250 0.812500 -vt 0.031250 0.187500 -vt 0.468750 0.187500 -vt 0.531250 0.812500 -vt 0.968750 0.812500 -vt 0.968750 0.187500 -vt 0.531250 0.187500 -vt 0.234375 0.000000 -vt 0.234375 1.000000 -vt 0.015625 1.000000 -vt 0.015625 -0.000000 -vt 0.609375 -0.000000 -vt 0.609375 1.000000 -vt 0.390625 1.000000 -vt 0.390625 -0.000000 -vt 0.765625 0.000000 -vt 0.765625 1.000000 -vt 0.000000 0.750000 -vt 2.000000 0.750000 -vt 2.000000 0.875000 -vt 0.000000 0.875000 -vt 0.000000 0.125000 -vt 2.000000 0.125000 -vt 2.000000 0.375000 -vt 0.000000 0.375000 -vt 2.000000 0.500000 -vt 0.000000 0.500000 -vt 0.812500 0.875000 -vt 0.562500 0.875000 -vt 0.562500 1.000000 -vt 0.812500 1.000000 -vt 0.125000 0.875000 -vt 0.375000 0.875000 -vt 0.375000 1.000000 -vt 0.125000 1.000000 -vn 0.0000 0.0000 -1.0000 -vn 0.0000 -0.0000 1.0000 -vn 0.0000 -1.0000 0.0000 -vn 0.0000 1.0000 0.0000 -vn 1.0000 0.0000 0.0000 -vn -1.0000 0.0000 0.0000 -g Cube_Cube_front-back -s off -f 8/1/1 4/2/1 2/3/1 6/4/1 -f 3/5/2 7/6/2 5/7/2 1/8/2 -g Cube_Cube_edges -f 13/9/3 14/10/3 10/11/3 9/12/3 -f 11/13/4 12/14/4 16/15/4 15/16/4 -f 11/13/5 9/17/5 10/18/5 12/14/5 -f 13/9/6 15/16/6 16/15/6 14/10/6 -g Cube_Cube_default_wood -f 17/19/5 18/20/5 20/21/5 19/22/5 -f 19/23/2 20/24/2 24/25/2 23/26/2 -f 23/26/6 24/25/6 22/27/6 21/28/6 -f 21/28/1 22/27/1 18/20/1 17/19/1 -f 19/29/3 23/30/3 21/31/3 17/32/3 -f 24/33/4 20/34/4 18/35/4 22/36/4 diff --git a/models/basic_signs_yard_sign_entity.obj b/models/basic_signs_yard_sign_entity.obj deleted file mode 100644 index fde001b..0000000 --- a/models/basic_signs_yard_sign_entity.obj +++ /dev/null @@ -1,15 +0,0 @@ -# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend' -# www.blender.org -o Plane -v 0.406250 -0.218750 -0.074219 -v -0.406250 -0.218750 -0.074219 -v 0.406250 0.343750 -0.074219 -v -0.406250 0.343750 -0.074219 -vt 0.000000 0.000000 -vt 1.000000 0.000000 -vt 1.000000 1.000000 -vt 0.000000 1.000000 -vn 0.0000 -0.0000 -1.0000 -g Plane_Plane_None -s off -f 1/1/1 2/2/1 4/3/1 3/4/1 diff --git a/textures/basic_signs_pole_mount_glass.png b/textures/basic_signs_pole_mount_glass.png new file mode 100644 index 0000000000000000000000000000000000000000..90e3157ea9c7f332a857c585e5d99cb76d662a6b GIT binary patch literal 772 zcmeAS@N?(olHy`uVBq!ia0vp^4nW+%!3HFEH|A$CFfg6=ba4!+xb=39WBw}xp5w8r zA07A-kk3*0~Z@16ivMRjf@4sc|*Xt*xDJdmA`<*Sg^Y5KHMWsa&ckA}=kN;liu<*L2L-J4-{_Al?<17)_0_8lxYbGd%-#Tm=%LV~&5Z!bSzaBk}-r^nLki`S+0vww&X z&ocAf8n=G6@8yt{cekd0a(}sF$=6dludL=x`WCUb;+b~X@muQ*uPxnEH8UuE0>kEg z>sClSn0v}Y*1vpZ%yx;F1!~C-U%GlPcG~JsXW6ysRRfEaS$oe8TWKZkeSm!Eo!GkFOaLa=On8|+43oinp}7crm=T37>M&v@cDSB z{H{oS^4mqqsT&U;;w)i}lw4X6^j)A-cJ|C=3w|e*%C5f88C~*ah0cMQ*DU>4C1)RO zeEWjOPSp3q4xNK#JJ#@S{B`ie4W?5U4tDJIGU#2mK;S{`Bbk-juVNIAZWg*$&fqD= z+~OL$d>-3z@c^Nn=N^~X#0F^Ua!B3bUHT$=RdIUb@;c|8zNeoSWy(v-b+))vRf#-} z_kYms<{3XdLRQ#f%d`I*A6^W(G_y+g*{0p>HGB4N|N3hAbMq3d z`6kcV=LIE-9Afe;;`JuabX$ILb+1zhym~MpQfG&V?OeaKPv0LF%-Gkmjme=}CSw9H z*?>R;!|u5CYHVw4`?OTHNA3I>KYPZmYueMCy1E~K%vdDAC3$>85~m?VE#+iFUfX+~ z)+o>Wl3trw{<+^dbw(MKeu038bCvVGoR{(|4=wW%;zaN^y&-K)Pm z`|>!j@14dizREM5)_b`=X7kOzyXQJ%@9gqb_y3tZUwZYq_baw0L@{&cQN^xi<W0_?y!k^ex$Rj>^bZ2MX#*;o*${KX)9hF7sP5Z@AB+c?uDDCBur=Y|DM0@>BV_J zWuuuE);&8L?!WKW+}G(FSf&X%9evN1s>`tLB8&NaMxeR(FZ|hScZL6O&wKsy?dQ`r zZU6cA)cwr03>~uUR=_w0fq)BY=4CQgX}Mch-2Wf!H2KISiNcQwE*!m`$z2hP*ddB2 zA=jM!apppV_Df@DPcH}Vou9ry44aWKd0+XBOZGtr4S2c}>o2xmO`WJL`UfQG>FVdQ I&MBb@0DWT>+5i9m literal 0 HcmV?d00001