diff options
author | pyrollo <dev@pyrollo.com> | 2017-12-10 10:46:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 10:46:48 +0100 |
commit | d07e0c5c134eb9a6e8b5dc097a86d642d67fa04d (patch) | |
tree | 71a53f16da091e399d40239541711a54a7e47cfe | |
parent | 2e4d8f529c85b5de0cbc0399ca453783fd4888d6 (diff) | |
parent | 63317776bda02f413729e655b0f1e0e8c0973ccb (diff) | |
download | display_modpack-d07e0c5c134eb9a6e8b5dc097a86d642d67fa04d.tar.gz display_modpack-d07e0c5c134eb9a6e8b5dc097a86d642d67fa04d.tar.bz2 display_modpack-d07e0c5c134eb9a6e8b5dc097a86d642d67fa04d.zip |
Merge pull request #8 from gpcf/master
Compatibility with signs_lib and advtrains, new large banner signs.
-rw-r--r-- | display_lib/init.lua | 7 | ||||
-rw-r--r-- | ontime_clocks/nodes.lua | 12 | ||||
-rw-r--r-- | signs/common.lua | 10 | ||||
-rw-r--r-- | signs/nodes.lua | 2 | ||||
-rw-r--r-- | signs_road/crafts.lua | 9 | ||||
-rw-r--r-- | signs_road/nodes.lua | 19 | ||||
-rw-r--r-- | signs_road/textures/station_sign.png | bin | 0 -> 168 bytes |
7 files changed, 44 insertions, 15 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 63f21dc..559f7f7 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 @@ -149,10 +149,10 @@ 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: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 = { 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 @@ -47,6 +47,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 = { {'dye:green', 'dye:white', ''}, 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 Binary files differnew file mode 100644 index 0000000..c2a7872 --- /dev/null +++ b/signs_road/textures/station_sign.png |