From 4f04035bc45719872d07326599628429192bcc5b Mon Sep 17 00:00:00 2001 From: cheapie Date: Sat, 13 Apr 2024 20:23:08 -0500 Subject: Add in-car switch panel and independent service, also fix a few bugs Switches for fire service phase 2 (not yet implemented) and car fan and light (no plans) are also available --- pilantern.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pilantern.lua') diff --git a/pilantern.lua b/pilantern.lua index 28ffd44..909c68f 100644 --- a/pilantern.lua +++ b/pilantern.lua @@ -31,6 +31,11 @@ minetest.register_entity("celevator:incar_pi_entity",{ local text = carinfo.pitext or "--" if string.len(text) < 3 then text = string.rep(" ",3-string.len(text))..text end text = string.sub(text,1,3) + if carinfo.flash_is and os.time()%2 == 0 then + text = " IS" + elseif carinfo.flash_fs and os.time()%2 == 0 then + text = " FS" + end local etex = celevator.pi.generatetexture(text,carinfo.piuparrow,carinfo.pidownarrow,false,true) self.object:set_properties({textures = {etex}}) else @@ -79,10 +84,10 @@ function celevator.pi.updatedisplay(pos) local islantern = minetest.get_item_group(minetest.get_node(pos).name,"_celevator_lantern") == 1 local etex = celevator.pi.generatetexture(text,uparrow,downarrow,islantern) if flash_fs then - if flashtimer then etex = celevator.pi.generatetexture(" FS",uparrow,downarrow) end + if flashtimer then etex = celevator.pi.generatetexture(" FS",uparrow,downarrow,islantern) end entity:set_properties({_flash_fs = true,_flash_is = false,}) elseif flash_is then - if flashtimer then etex = celevator.pi.generatetexture(" IS",uparrow,downarrow) end + if flashtimer then etex = celevator.pi.generatetexture(" IS",uparrow,downarrow,islantern) end entity:set_properties({_flash_fs = false,_flash_is = true,}) else entity:set_properties({_flash_fs = false,_flash_is = false,}) -- cgit v1.2.3