From 497fee872bbbd767832bd614e6c2a9aaa243596f Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Thu, 12 Sep 2019 11:34:20 -0400 Subject: [PATCH] update signs_lib, basic_signs, street_signs --- basic_signs/init.lua | 4 ++++ signs_lib/api.lua | 5 ++++- signs_lib/standard_signs.lua | 2 ++ street_signs/signs_class_d.lua | 2 ++ street_signs/signs_class_m.lua | 2 ++ street_signs/signs_class_r.lua | 3 +++ street_signs/signs_class_w.lua | 7 +++++++ street_signs/signs_misc_generic.lua | 6 ++++++ 8 files changed, 30 insertions(+), 1 deletion(-) diff --git a/basic_signs/init.lua b/basic_signs/init.lua index eeb640ff..4bb474cf 100644 --- a/basic_signs/init.lua +++ b/basic_signs/init.lua @@ -96,6 +96,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "basic_signs_sign_wall_locked_inv.png", groups = wood_groups, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = function(pos, placer, itemstack, pointed_thing) @@ -145,6 +146,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "basic_signs_steel_"..color[1].."_inv.png", groups = steel_groups, default_color = color[3], + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -196,6 +198,7 @@ minetest.register_node("basic_signs:yard_sign", { wield_image = "default_sign_wood.png", groups = nci_wood_groups, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -240,6 +243,7 @@ minetest.register_node("basic_signs:hanging_sign", { wield_image = "default_sign_wood.png", groups = nci_wood_groups, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, diff --git a/signs_lib/api.lua b/signs_lib/api.lua index 3cef9cf3..c3bb1639 100644 --- a/signs_lib/api.lua +++ b/signs_lib/api.lua @@ -434,7 +434,10 @@ signs_lib.construct_sign = function(pos) "textarea[0,-0.3;6.5,3;text;;${text}]".. "button_exit[2,3.4;2,1;ok;"..S("Write").."]".. "background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]") - meta:set_string("infotext", "") + local i = meta:get_string("infotext") + if i == "" then -- it wasn't even set, so set it. + meta:set_string("infotext", "") + end end function signs_lib.destruct_sign(pos) diff --git a/signs_lib/standard_signs.lua b/signs_lib/standard_signs.lua index d9ce07d6..1fdc4360 100644 --- a/signs_lib/standard_signs.lua +++ b/signs_lib/standard_signs.lua @@ -37,6 +37,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "signs_lib_sign_wall_wooden_inv.png", groups = wood_groups, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, on_receive_fields = signs_lib.receive_fields, @@ -76,6 +77,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "signs_lib_sign_wall_steel_inv.png", groups = wood_groups, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = function(pos, placer, itemstack, pointed_thing) diff --git a/street_signs/signs_class_d.lua b/street_signs/signs_class_d.lua index 84b1f443..ab2a40e8 100644 --- a/street_signs/signs_class_d.lua +++ b/street_signs/signs_class_d.lua @@ -27,6 +27,7 @@ minetest.register_node("street_signs:sign_basic", { groups = {choppy=2, dig_immediate=2}, default_color = "f", on_construct = signs_lib.construct_sign, + on_rightclick = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, on_receive_fields = signs_lib.receive_fields, on_punch = signs_lib.update_sign, @@ -69,6 +70,7 @@ minetest.register_node("street_signs:sign_basic_top_only", { tiles = { "street_signs_basic.png" }, groups = {choppy=2, dig_immediate=2}, default_color = "f", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, on_receive_fields = signs_lib.receive_fields, diff --git a/street_signs/signs_class_m.lua b/street_signs/signs_class_m.lua index f20da8a3..46158985 100644 --- a/street_signs/signs_class_m.lua +++ b/street_signs/signs_class_m.lua @@ -34,6 +34,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_us_route_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -72,6 +73,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_us_interstate_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "f", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, diff --git a/street_signs/signs_class_r.lua b/street_signs/signs_class_r.lua index 61995f20..f2749463 100644 --- a/street_signs/signs_class_r.lua +++ b/street_signs/signs_class_r.lua @@ -107,6 +107,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_speed_limit_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -798,6 +799,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_ped_push_button_to_cross_r10_3i_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -836,6 +838,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_ped_push_button_to_cross_r10_3i_left_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, diff --git a/street_signs/signs_class_w.lua b/street_signs/signs_class_w.lua index 225a31e9..b25b67e1 100644 --- a/street_signs/signs_class_w.lua +++ b/street_signs/signs_class_w.lua @@ -742,6 +742,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_hill_with_grade_ahead_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -782,6 +783,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_distance_2_lines_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -820,6 +822,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_distance_2_lines_orange_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -931,6 +934,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_low_clearance_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -971,6 +975,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_advisory_speed_mph_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -1009,6 +1014,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_advisory_speed_kmh_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -1047,6 +1053,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_advisory_speed_ms_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, diff --git a/street_signs/signs_misc_generic.lua b/street_signs/signs_misc_generic.lua index f7218c49..3127d9dd 100644 --- a/street_signs/signs_misc_generic.lua +++ b/street_signs/signs_misc_generic.lua @@ -32,6 +32,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_warning_3_line_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -70,6 +71,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_warning_4_line_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -108,6 +110,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_warning_orange_3_line_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -146,6 +149,7 @@ for _, onpole in ipairs({"", "_onpole"}) do wield_image = "street_signs_warning_orange_4_line_inv.png", groups = {choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, default_color = "0", + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, after_place_node = signs_lib.after_place_node, @@ -211,6 +215,7 @@ for _, s in ipairs(street_signs.big_sign_sizes) do }, default_color = defc, groups = {choppy=2, dig_immediate=2}, + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, on_receive_fields = signs_lib.receive_fields, @@ -248,6 +253,7 @@ for _, s in ipairs(street_signs.big_sign_sizes) do }, default_color = defc, groups = {choppy=2, dig_immediate=2}, + on_rightclick = signs_lib.construct_sign, on_construct = signs_lib.construct_sign, on_destruct = signs_lib.destruct_sign, on_receive_fields = signs_lib.receive_fields,