aboutsummaryrefslogtreecommitdiff
path: root/signs/nodes.lua
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2018-11-01 18:10:26 +0100
committerPierre-Yves Rollo <dev@pyrollo.com>2018-11-01 18:10:26 +0100
commitc1835931e52769bf50425990370b60dfc9d17f63 (patch)
treea271841df0d1d3010ef8d8a9a416b2f5b5a22827 /signs/nodes.lua
parent06d35ec9bf48e5fd96952cca5264d92742cf31db (diff)
downloaddisplay_modpack-c1835931e52769bf50425990370b60dfc9d17f63.tar.gz
display_modpack-c1835931e52769bf50425990370b60dfc9d17f63.tar.bz2
display_modpack-c1835931e52769bf50425990370b60dfc9d17f63.zip
Added labels and wooden signs
Diffstat (limited to 'signs/nodes.lua')
-rw-r--r--signs/nodes.lua75
1 files changed, 58 insertions, 17 deletions
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