From 87fa05ad6a9e76c477787393a4740b73a987b5a2 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 20 Jan 2017 20:33:31 -0600 Subject: [PATCH] Add RRFBs --- trafficlight/init.lua | 103 +++++++++++++++++++++ trafficlight/textures/streets_rrfb_inv.png | Bin 0 -> 3066 bytes trafficlight/textures/streets_rrfb_off.png | Bin 0 -> 627 bytes trafficlight/textures/streets_rrfb_on.png | Bin 0 -> 762 bytes 4 files changed, 103 insertions(+) create mode 100644 trafficlight/textures/streets_rrfb_inv.png create mode 100644 trafficlight/textures/streets_rrfb_off.png create mode 100644 trafficlight/textures/streets_rrfb_on.png diff --git a/trafficlight/init.lua b/trafficlight/init.lua index b64af8a..0754ebd 100644 --- a/trafficlight/init.lua +++ b/trafficlight/init.lua @@ -75,6 +75,14 @@ streets.hbBox = { {0.0625,-0.125,0.3125,0.125,-0.0625,0.5}, --Bottom Visor, Right } +streets.rrfbBox = { + {-0.375,0.05,0.5,0.375,0.3,0.75}, --Box + + {-0.125, 0.125, 0.85, 0.125, 0.25, 0.75}, -- Pole Mounting Bracket + + --These usually don't have visors +} + streets.tlDigilineRules = { {x= 0, y= 0, z=-1}, {x= 0, y= 0, z= 1}, @@ -135,6 +143,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) streets.tlSwitch(pos,"streets:beacon_hybrid_off") elseif name:find("beacon") then streets.tlSwitch(pos,"streets:beacon_off") + elseif name:find("rrfb") then + streets.tlSwitch(pos,"streets:trafficlight_rrfb_off") else streets.tlSwitch(pos,"streets:trafficlight_top_off") end @@ -156,6 +166,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) --Not Supported elseif name:find("beacon") then --Not Supported + elseif name:find("rrfb") then + --Not Supported else streets.tlSwitch(pos,"streets:trafficlight_top_green") end @@ -177,6 +189,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) streets.tlSwitch(pos,"streets:beacon_hybrid_red") elseif name:find("beacon") then streets.tlSwitch(pos,"streets:beacon_red") + elseif name:find("rrfb") then + --Not Supported else streets.tlSwitch(pos,"streets:trafficlight_top_red") end @@ -198,6 +212,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) streets.tlSwitch(pos,"streets:beacon_hybrid_flashyellow") elseif name:find("beacon") then streets.tlSwitch(pos,"streets:beacon_flashyellow") + elseif name:find("rrfb") then + streets.tlSwitch(pos,"streets:trafficlight_rrfb_on") else streets.tlSwitch(pos,"streets:trafficlight_top_warn") end @@ -219,6 +235,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) streets.tlSwitch(pos,"streets:beacon_hybrid_flashyellow") elseif name:find("beacon") then streets.tlSwitch(pos,"streets:beacon_flashyellow") + elseif name:find("rrfb") then + streets.tlSwitch(pos,"streets:trafficlight_rrfb_on") else streets.tlSwitch(pos,"streets:trafficlight_top_warn") end @@ -240,6 +258,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) streets.tlSwitch(pos,"streets:beacon_hybrid_yellow") elseif name:find("beacon") then streets.tlSwitch(pos,"streets:beacon_yellow") + elseif name:find("rrfb") then + --Not Supported else streets.tlSwitch(pos,"streets:trafficlight_top_yellow") end @@ -261,6 +281,8 @@ streets.on_digiline_receive = function(pos, node, channel, msg) streets.tlSwitch(pos,"streets:beacon_hybrid_flashred") elseif name:find("beacon") then streets.tlSwitch(pos,"streets:beacon_flashred") + elseif name:find("rrfb") then + --Not Supported else streets.tlSwitch(pos,"streets:trafficlight_top_flashred") end @@ -1258,6 +1280,78 @@ for _,i in pairs({"","_left","_right"}) do }) end +minetest.register_node(":streets:trafficlight_rrfb_off",{ + description = streets.S("Rectangular Rapid Flashing Beacon"), + drawtype="nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1, level = 2}, + inventory_image = "streets_rrfb_inv.png", + light_source = 11, + sunlight_propagates = true, + node_box = { + type = "fixed", + fixed = streets.rrfbBox + }, + tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_rrfb_off.png"}, + digiline = { + receptor = {}, + wire = {rules=streets.tlDigilineRules}, + effector = { + action = function(pos, node, channel, msg) + streets.on_digiline_receive(pos, node, channel, msg) + end + } + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "field[channel;Channel;${channel}]") + end, + on_receive_fields = function(pos, formname, fields, sender) + if (fields.channel) then + minetest.get_meta(pos):set_string("channel", fields.channel) + minetest.get_meta(pos):set_string("state", "Off") + end + end, +}) + +minetest.register_node(":streets:trafficlight_rrfb_on",{ + drop = "streets:trafficlight_rrfb_off", + drawtype="nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + light_source = 11, + sunlight_propagates = true, + node_box = { + type = "fixed", + fixed = streets.rrfbBox + }, + tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ + name="streets_rrfb_on.png", + animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=0.75}, + }}, + digiline = { + receptor = {}, + wire = {rules=streets.tlDigilineRules}, + effector = { + action = function(pos, node, channel, msg) + streets.on_digiline_receive(pos, node, channel, msg) + end + } + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "field[channel;Channel;${channel}]") + end, + on_receive_fields = function(pos, formname, fields, sender) + if (fields.channel) then + minetest.get_meta(pos):set_string("channel", fields.channel) + minetest.get_meta(pos):set_string("state", "Off") + end + end, +}) + minetest.register_node(":streets:green_arrow",{ description = "Straight-through green arrow", drawtype="nodebox", @@ -1344,6 +1438,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "streets:trafficlight_rrfb_off", + recipe = { + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, + {"dye:yellow", "default:steel_ingot", "dye:yellow"}, + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} + } +}) + minetest.register_craft({ output = "streets:green_arrow", recipe = { diff --git a/trafficlight/textures/streets_rrfb_inv.png b/trafficlight/textures/streets_rrfb_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..89779268bc275766cd1444d85009550a7d5253f7 GIT binary patch literal 3066 zcmVbt>>7LoykFlhgm2Arr z$O^%hZS)X_D1`Ve!6wMyU~G^Q2+2cULV_WLs2ixF}BoN3$B5;fo2fqX-maxIW z!3bGKCYB|!@_N6fdv`UvJF_$Waqq1)pm6*P0Z_ulS0|8we`|M^!f zyfxk$Z;iLcF&vLR`rae?9hv2q-F??xT)TdK>c6e6tvv{=sA_P|Nl_H%M8qt%+hlo8 z;XQegvvTINf9a)HZXNVntE+4Ddfk2R(L)$G69Cp$*XTx*Ik~jhIeq4?_ZCI*kXQd8 za6j-)5jia)s;U6zK}OXRI~Pbi3>ML55EI zTqg{7vjCvm>$0}G_EAM2Hbx!>Ihz;xnyTJic^wge zXT+e@w7plXHFvA({{VUH#lv`8r+D4XD*RRTpMCHGwgZYWwwjcoAfN~X5prOqnu>;c zHj1j2cS#uy^;A^@A_i5Dh$V!OdhZ3GuV_cgZ>T{SM4t^5rMm7%*Y)TtYG#*BIVgAxRPdI)e1I zaqO6N8vTtuFOl&bLEH>;;8l=&CqKO3d;am(P2OD;I8_XAvDafD!e5*`$$u^`(Fp+` zJctl{z!=jkmHN6iUR8&!R;vmB8iY>dT|Ho;@%?TdrKR?MVGRFz^9J`9#n`_uYhYR7 zi<`GNp~^Sgo#r_)LS7WKlB8J*&bcZ-1c3Dm7k)mBzb`hveTeJ${<#1ULSV;QzP+(= zhw;0jg{ry3ox5dUz z5ZQT-xh< z+JeYFOt3$tJeV0~{>{-S!+VbfE*itrX?mz1T+Ma#EpRy8#d|rgOXr7 zB2Y8T0c?vgW!R~*Wend>Q~qvoDPnkcjtyg2w-yr_rm9$LOF$~GRm@O8>?EOiy&auI z1Zsx8073|$CA10fqa@*+b9?~L2X_W{tjqJx@`a@n{KUC2PlOP5Ltnw#hFaegk)KT? zG}AuY>pK2ymPydY(P@lfl;>muf3SRtw=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S5U<|%fdqYpr~P# zjmA2@8pJ64w}H=><@WNi1|Y8{J0^4<1VC1mzG{x4Tk|gaALL+b0%VTkIk%fhYvD!Z|{@gkD z@;tl`GdwLm?ezBQ>e>?U5b!?Wfm5eWJqCPmdwVyMB$0*RHd^zTSY4v`TSQgZ`y4 z=5yWddNHqgx_N!^w2)m~JmDXBU?~8+|NV}wtxdMJwzz$JlZ}lHuB>07*InnwKYrm7 zLI?QYc^W@g0H%|k!Wd&JYAm$dZPGO5?AfyzW7yu_W^;4%drv?8-+#2ax^@!b#l52G zO$k7~=}|Mh_!z7)hE}V^J*#V1fmdpS=V|=hnBaajzpesBQIx80br8BfChLpb9JG|) zv;a8gnnYIvQJwy5c!2l*D5rF^0ED0o2+p~&^>y_y3Y z)I7bZ0m!oaTv6l$kmeL`fiz8<%@3&mk6``&=&Qgl00|gw%;;Nk%K!iX07*qo IM6N<$g4;UI@Bjb+ literal 0 HcmV?d00001 diff --git a/trafficlight/textures/streets_rrfb_off.png b/trafficlight/textures/streets_rrfb_off.png new file mode 100644 index 0000000000000000000000000000000000000000..0d1ba1abdce6d3dee95d0abaa6290141625ca9fa GIT binary patch literal 627 zcmV-(0*w8MP)| zb4En4)>2AgT~|be7$X2VXKJm?^Gs_EfYutu7>u6aZ?i#2Cpr<5U$@C4|7&*B57r z2&&p2JRXnU3n4JiGyA?{VvHTy-)gOqbLMin;GBEul~Q;-9xTg(JGY(chY%>GP)fl$ z$GWb3e0+3jDJ6_C48uSO0f{lTbMiQjq?A~erK_*1wALu4aKGRA{QRWW$}~;?sork4 zR!Sk~j4_5%3f_Bi&fPNaeb?hWd+*t{4QGrYgh0-jQVR1tBO)Bf0l?ea8{gmGFB*sl z&*u|W#ht#22*wzIo=Tu^K6$5-{AmZ?FaB#`1P@Q5sCVBi)8VMc~ob0mO* z>?NMQuIvvPMH!7bHb`c#2MWn%hD4M&=jZ08=9K`s3=Gaisfi`2DGKG8B^e6tp1uJo zda3LT3`_-{E{-7?_ufwT?YnKj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