summaryrefslogtreecommitdiff
path: root/pilantern.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-13 20:23:08 -0500
committercheapie <no-email-for-you@example.com>2024-04-13 20:23:08 -0500
commit4f04035bc45719872d07326599628429192bcc5b (patch)
tree5dcdfd1cc0773518e2f258047005fbdb04998289 /pilantern.lua
parenta50ceb4d277020a9b1259f759b1f1d13211f740d (diff)
downloadcelevator-4f04035bc45719872d07326599628429192bcc5b.tar
celevator-4f04035bc45719872d07326599628429192bcc5b.tar.gz
celevator-4f04035bc45719872d07326599628429192bcc5b.tar.bz2
celevator-4f04035bc45719872d07326599628429192bcc5b.tar.xz
celevator-4f04035bc45719872d07326599628429192bcc5b.zip
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
Diffstat (limited to 'pilantern.lua')
-rw-r--r--pilantern.lua9
1 files changed, 7 insertions, 2 deletions
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,})