diff --git a/.luacheckrc b/.luacheckrc index 2dd9700..d8f740b 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -18,6 +18,7 @@ read_globals = { "mesecon", "unifieddyes", "letters", + "signs_api", "stealthnode", "slats", "mtt" diff --git a/mod.conf b/mod.conf index 460683e..8d7ace2 100644 --- a/mod.conf +++ b/mod.conf @@ -16,5 +16,6 @@ unifieddyes, letters, mesecons_stealthnode, mtt, -slats +slats, +signs_api """ diff --git a/nodes.json b/nodes.json index 0f54545..f172a89 100644 --- a/nodes.json +++ b/nodes.json @@ -8,7 +8,9 @@ "white2": { "description": "plastic", "colorable": true, - "sounds": "stone" + "sounds": "stone", + "signs_banner": true, + "signs_banner_color": "#000" }, "super_white": { "description": "Super Plastic", @@ -68,7 +70,8 @@ "description": "metal mesh" }, "black": { - "description": "black wall" + "description": "black wall", + "signs_banner": true }, "blackoct": { "description": "black octagon" @@ -89,7 +92,8 @@ "description": "blue bars" }, "bluemetal": { - "description": "blue metal" + "description": "blue metal", + "signs_banner": true }, "bluetile": { "description": "blue tile", @@ -148,7 +152,8 @@ "colorable": true }, "greenmetal": { - "description": "green metal wall" + "description": "green metal wall", + "signs_banner": true }, "greenmetal2": { "description": "green metal wall2" @@ -172,7 +177,8 @@ "description": "green pipes" }, "grey": { - "description": "grey wall" + "description": "grey wall", + "signs_banner": true }, "greybolts": { "description": "grey wall bolts" @@ -276,7 +282,8 @@ "slat": true }, "purple": { - "description": "Purple node" + "description": "Purple node", + "signs_banner": true }, "rock": { "description": "Moonstone", diff --git a/nodes.lua b/nodes.lua index e42fb7b..299f305 100644 --- a/nodes.lua +++ b/nodes.lua @@ -2,6 +2,7 @@ local has_unifieddyes_mod = minetest.get_modpath("unifieddyes") local has_moreblocks_mod = minetest.get_modpath("moreblocks") local has_slats_mod = minetest.get_modpath("slats") local has_advtrains_mod = minetest.get_modpath("advtrains") +local has_signs_api_mod = minetest.get_modpath("signs_api") --nodes @@ -667,6 +668,25 @@ for name, def in pairs(nodes) do advtrains.register_platform("scifi_nodes", "scifi_nodes:" .. name) end + if has_signs_api_mod and def.signs_banner then + signs_api.register_sign("scifi_nodes", name .. "_banner", { + depth = 1/16, + width = 5, + height = 1, + entity_fields = { + maxlines = 1, + color = def.signs_banner_color or "#fff", + }, + node_fields = { + visual_scale = 1, + description = name .. " banner", + tiles = tiles, + inventory_image = "scifi_nodes_" .. name .. ".png", + use_texture_alpha = "clip", + }, + }) + end + if has_slats_mod and def.slat then slats.register_slat( name,