diff options
author | cheapie <no-email-for-you@example.com> | 2015-12-28 18:31:50 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2015-12-28 18:31:50 -0600 |
commit | 40c4e95834ff97be1dd58c12012062af9d7513f6 (patch) | |
tree | 98d2b7179a3eb89424ba2b2c852ac849e8a3193d /trafficlight | |
parent | 5be7aec758b23dc1773520abd0ee450b361979b6 (diff) | |
download | roads-40c4e95834ff97be1dd58c12012062af9d7513f6.tar roads-40c4e95834ff97be1dd58c12012062af9d7513f6.tar.gz roads-40c4e95834ff97be1dd58c12012062af9d7513f6.tar.bz2 roads-40c4e95834ff97be1dd58c12012062af9d7513f6.tar.xz roads-40c4e95834ff97be1dd58c12012062af9d7513f6.zip |
Add flash red mode
Diffstat (limited to 'trafficlight')
-rw-r--r-- | trafficlight/init.lua | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/trafficlight/init.lua b/trafficlight/init.lua index 562068f..a042dee 100644 --- a/trafficlight/init.lua +++ b/trafficlight/init.lua @@ -33,6 +33,9 @@ streets.tlRythm = { }, toWarn = { {name = "streets:trafficlight_top_warn", pauseBefore = 0} + }, + toFlashRed = { + {name = "streets:trafficlight_top_flashred", pauseBefore = 0} } } @@ -80,6 +83,11 @@ streets.on_digiline_receive = function(pos, node, channel, msg) pos = pos, to = "toWarn" }) + elseif msg == "FLASHRED" then + streets.tlSwitch({ + pos = pos, + to = "toFlashRed" + }) elseif msg == "GET" then local state = minetest.get_meta(pos):get_string("state") if not state or state == "" then @@ -267,6 +275,32 @@ minetest.register_node(":streets:trafficlight_top_warn",{ }, }) +minetest.register_node(":streets:trafficlight_top_flashred",{ + drop = "streets:trafficlight_top_off", + groups = {cracky = 1, not_in_creative_inventory = 1}, + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drawtype = "nodebox", + tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ + name="streets_tl_flashred.png", + animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}, + }}, + node_box = { + type = "fixed", + fixed = streets.tlBox + }, + light_source = 6, + digiline = { + receptor = {}, + effector = { + action = function(pos, node, channel, msg) + streets.on_digiline_receive(pos, node, channel, msg) + end + } + }, +}) + minetest.register_craft({ output = "streets:trafficlight_top_off", recipe = { @@ -283,4 +317,4 @@ minetest.register_craft({ {"digilines:wire_std_00000000", "mesecons_luacontroller:luacontroller0000", "digilines:wire_std_00000000"}, {"", "digilines:wire_std_00000000", ""} } -})
\ No newline at end of file +}) |