From d89b63e1b7b266ec3f72596dc27e9331ba4a5777 Mon Sep 17 00:00:00 2001 From: Gabriel Pérez-Cerezo Date: Thu, 30 Nov 2017 21:15:06 +0100 Subject: Compatibility with signs_lib --- signs/common.lua | 8 ++++---- signs/nodes.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/signs/common.lua b/signs/common.lua index 63f21dc..34abd40 100644 --- a/signs/common.lua +++ b/signs/common.lua @@ -24,8 +24,8 @@ local F = function(...) return minetest.formspec_escape(S(...)) end function signs.set_formspec(pos) local meta = minetest.get_meta(pos) local ndef = minetest.registered_nodes[minetest.get_node(pos).name] - if ndef and ndef.display_entities and ndef.display_entities["signs:text"] then - local maxlines = ndef.display_entities["signs:text"].maxlines + if ndef and ndef.display_entities and ndef.display_entities["signs:display_text"] then + local maxlines = ndef.display_entities["signs:display_text"].maxlines local formspec if maxlines == 1 then @@ -152,7 +152,7 @@ function signs.register_sign(mod, name, model) groups = {choppy=2, dig_immediate=2}, sounds = default.node_sound_defaults(), display_entities = { - ["signs:text"] = { + ["signs:display_text"] = { on_display_update = font_lib.on_display_update, depth = 0.499 - model.depth, size = { x = model.width, y = model.height }, @@ -187,7 +187,7 @@ function signs.register_sign(mod, name, model) -- Entity fields override for key, value in pairs(model.entity_fields) do - fields.display_entities["signs:text"][key] = value + fields.display_entities["signs:display_text"][key] = value end minetest.register_node(mod..":"..name, fields) diff --git a/signs/nodes.lua b/signs/nodes.lua index 6146d50..204a2a9 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -66,7 +66,7 @@ local function on_receive_fields_poster(pos, formname, fields, player) end -- Text entity for all signs -display_lib.register_display_entity("signs:text") +display_lib.register_display_entity("signs:display_text") -- Sign models and registration local models = { -- cgit v1.2.3 From 6e0608f30221ea5aaadeaedd9aa7140e52cb95d3 Mon Sep 17 00:00:00 2001 From: Gabriel Pérez-Cerezo Date: Fri, 1 Dec 2017 12:12:25 +0100 Subject: Added big sign for stations --- signs_road/nodes.lua | 19 +++++++++++++++++++ signs_road/textures/station_sign.png | Bin 0 -> 168 bytes 2 files changed, 19 insertions(+) create mode 100644 signs_road/textures/station_sign.png diff --git a/signs_road/nodes.lua b/signs_road/nodes.lua index 9b7f205..d90b7c6 100644 --- a/signs_road/nodes.lua +++ b/signs_road/nodes.lua @@ -39,6 +39,25 @@ local models = { inventory_image = "signs_road_blue.png", }, }, + large_street_sign = { + depth = 1/16, + width = 64/16, + height = 12/16, + entity_fields = { + resolution = { x = 30, y = 20 }, + maxlines = 1, + color = "#000", + }, + node_fields = { + visual_scale = 1, + description = S("Large banner"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "station_sign.png" }, + inventory_image = "signs_road_white.png", + }, + }, + red_street_sign = { depth = 1/16, width = 1, diff --git a/signs_road/textures/station_sign.png b/signs_road/textures/station_sign.png new file mode 100644 index 0000000..c2a7872 Binary files /dev/null and b/signs_road/textures/station_sign.png differ -- cgit v1.2.3 From dc264512e27fa2c63df71e2d0c9b6a899541ba66 Mon Sep 17 00:00:00 2001 From: Gabriel Pérez-Cerezo Date: Fri, 8 Dec 2017 12:15:15 +0100 Subject: Added craft recipe for large banner --- signs_road/crafts.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/signs_road/crafts.lua b/signs_road/crafts.lua index 0a0c205..6d36361 100644 --- a/signs_road/crafts.lua +++ b/signs_road/crafts.lua @@ -46,6 +46,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + type = "shapeless", + output = 'signs_road:large_street_sign', + recipe = {'signs_road:white_street_sign','signs_road:white_street_sign','signs_road:white_street_sign','signs_road:white_street_sign'} + +}) + + + minetest.register_craft({ output = 'signs_road:green_street_sign 2', recipe = { -- cgit v1.2.3 From 63317776bda02f413729e655b0f1e0e8c0973ccb Mon Sep 17 00:00:00 2001 From: Gabriel Pérez-Cerezo Date: Fri, 8 Dec 2017 14:04:59 +0100 Subject: Added compatibility with advtrains mod --- display_lib/init.lua | 7 ++++--- ontime_clocks/nodes.lua | 12 ++++++------ signs/common.lua | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/display_lib/init.lua b/display_lib/init.lua index 4416928..210aac9 100644 --- a/display_lib/init.lua +++ b/display_lib/init.lua @@ -149,9 +149,10 @@ end --- On_activate callback for display_lib entities. Calls on_display_update callbacks --- of corresponding node for each entity. function display_lib.on_activate(entity, staticdata) - if entity then - call_node_on_display_update(entity.object:getpos(), entity.object) - end + if entity then + entity.object:set_armor_groups({immortal=1}) + call_node_on_display_update(entity.object:getpos(), entity.object) + end end --- On_place callback for display_lib items. Does nothing more than preventing item diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua index 8055c18..70bbfd1 100644 --- a/ontime_clocks/nodes.lua +++ b/ontime_clocks/nodes.lua @@ -35,7 +35,7 @@ minetest.register_node("ontime_clocks:green_digital", { wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } }, tiles = {"ontime_clocks_digital.png"}, - groups = {oddly_breakable_by_hand=1}, + groups = {oddly_breakable_by_hand=1,not_blocking_trains=1}, display_entities = { ["ontime_clocks:display"] = { depth = 13/32 - 0.01, @@ -73,7 +73,7 @@ minetest.register_node("ontime_clocks:red_digital", { wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } }, tiles = {"ontime_clocks_digital.png"}, - groups = {oddly_breakable_by_hand=1}, + groups = {oddly_breakable_by_hand=1,not_blocking_trains=1}, display_entities = { ["ontime_clocks:display"] = { depth = 13/32 - 0.01, @@ -111,7 +111,7 @@ minetest.register_node("ontime_clocks:white", { wall_top = { -7/16, 0.5, -7/16, 7/16, 7/16, 7/16}, }, tiles = {"ontime_clocks_white.png"}, - groups = {choppy=1,oddly_breakable_by_hand=1}, + groups = {choppy=1,oddly_breakable_by_hand=1,not_blocking_trains=1}, display_entities = { ["ontime_clocks:display"] = { depth = 6/16 - 0.01, @@ -148,7 +148,7 @@ minetest.register_node("ontime_clocks:frameless_black", { wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } }, tiles = {"ontime_clocks_frameless.png"}, - groups = {choppy=1,oddly_breakable_by_hand=1}, + groups = {choppy=1,oddly_breakable_by_hand=1,not_blocking_trains=1}, display_entities = { ["ontime_clocks:display"] = { depth = 7/16, @@ -185,7 +185,7 @@ minetest.register_node("ontime_clocks:frameless_gold", { wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } }, tiles = {"ontime_clocks_frameless.png^[colorize:#FF0"}, - groups = {choppy=1,oddly_breakable_by_hand=1}, + groups = {choppy=1,oddly_breakable_by_hand=1,not_blocking_trains=1}, display_entities = { ["ontime_clocks:display"] = { depth = 7/16, @@ -222,7 +222,7 @@ minetest.register_node("ontime_clocks:frameless_white", { wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } }, tiles = {"ontime_clocks_frameless.png^[colorize:#FFF"}, - groups = {choppy=1,oddly_breakable_by_hand=1}, + groups = {choppy=1,oddly_breakable_by_hand=1,not_blocking_trains=1}, display_entities = { ["ontime_clocks:display"] = { depth = 7/16, diff --git a/signs/common.lua b/signs/common.lua index 34abd40..559f7f7 100644 --- a/signs/common.lua +++ b/signs/common.lua @@ -149,7 +149,7 @@ function signs.register_sign(mod, name, model) fixed = {-model.width/2, -model.height/2, 0.5, model.width/2, model.height/2, 0.5 - model.depth}, }, - groups = {choppy=2, dig_immediate=2}, + groups = {choppy=2, dig_immediate=2, not_blocking_trains = 1}, sounds = default.node_sound_defaults(), display_entities = { ["signs:display_text"] = { -- cgit v1.2.3