aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainhud.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/trainhud.lua')
-rw-r--r--advtrains/trainhud.lua18
1 files changed, 12 insertions, 6 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index db32824..35ba718 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -11,7 +11,7 @@ end)
local mletter={[1]="F", [-1]="R", [0]="N"}
function advtrains.on_control_change(pc, train, flip)
- local maxspeed = train.max_speed or 10
+ local maxspeed = train.max_speed or 10
if pc.sneak then
if pc.up then
train.tarvelocity = maxspeed
@@ -46,13 +46,16 @@ function advtrains.on_control_change(pc, train, flip)
train.ctrl.user = 1
act=true
end
+ if pc.aux1 then
+ train.sifa = 0
+ end
-- If atc command set, only "Jump" key can clear command. To prevent accidental control.
if train.tarvelocity or train.atc_command then
return
end
if pc.up then
- train.ctrl.user=4
- act=true
+ train.ctrl.user=4
+ act=true
end
if pc.down then
if train.velocity>0 then
@@ -99,7 +102,7 @@ function advtrains.set_trainhud(name, text, driver)
local hud = advtrains.hud[name]
local player=minetest.get_player_by_name(name)
if not player then
- return
+ return
end
local driverhud = {
hud_elem_type = "image",
@@ -141,7 +144,7 @@ function advtrains.set_help_hud(name, text)
local hud = advtrains.hhud[name]
local player=minetest.get_player_by_name(name)
if not player then
- return
+ return
end
if not hud then
hud = {}
@@ -187,7 +190,7 @@ function advtrains.hud_train_format(train, flip)
local tlev=train.lever or 1
if train.velocity==0 and not train.active_control then tlev=1 end
- local ht = {"[combine:440x110:0,0=(advtrains_hud_bg.png^[resize\\:440x110)"}
+ local ht = {"[combine:490x110:0,0=(advtrains_hud_bg.png^[resize\\:490x110)"}
local st = {}
if train.debug then st = {train.debug} end
@@ -248,6 +251,9 @@ function advtrains.hud_train_format(train, flip)
if train.ctrl.lzb then
ht[#ht+1] = "50,10=(advtrains_hud_lzb.png^[resize\\:30x30^[multiply\\:red)"
end
+ if train.sifa and train.sifa > 30 then
+ ht[#ht+1] = sformat("440,10=(advtrains_hud_sifa.png^[resize\\:40x40%s)",train.ctrl.sifa and "^[multiply\\:red" or "")
+ end
if train.is_shunt then
ht[#ht+1] = "90,10=(advtrains_hud_shunt.png^[resize\\:30x30^[multiply\\:orange)"
end