diff options
author | orwell96 <orwell@bleipb.de> | 2018-10-10 23:17:31 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-10-10 23:17:31 +0200 |
commit | 9db52bcd32b49d6b98644dcb7edcf14987850fa5 (patch) | |
tree | 6ed4e2859c433cdd4e42b6f4163294b4b3bd2fdc /advtrains/trainhud.lua | |
parent | 842a85606e4495dd631c2916d09a760d74a0ce13 (diff) | |
download | advtrains-9db52bcd32b49d6b98644dcb7edcf14987850fa5.tar.gz advtrains-9db52bcd32b49d6b98644dcb7edcf14987850fa5.tar.bz2 advtrains-9db52bcd32b49d6b98644dcb7edcf14987850fa5.zip |
Remote Routesetting from Onboard Computer
+ Fix lzb oncoming item deletion/speed restriction
Diffstat (limited to 'advtrains/trainhud.lua')
-rw-r--r-- | advtrains/trainhud.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua index f326427..9ea7466 100644 --- a/advtrains/trainhud.lua +++ b/advtrains/trainhud.lua @@ -161,8 +161,9 @@ function advtrains.hud_train_format(train, flip) local fct=flip and -1 or 1 if not train then return "" end - local max=train.max_speed or 10 - local vel=advtrains.abs_ceil(train.velocity) + local max = train.max_speed or 10 + local res = train.speed_restriction or max + local vel = advtrains.abs_ceil(train.velocity) local vel_kmh=advtrains.abs_ceil(advtrains.ms_to_kmh(train.velocity)) local levers = "B - o +" @@ -184,7 +185,7 @@ function advtrains.hud_train_format(train, flip) if train.atc_brake_target then b="-B-" end - secondLine="ATC"..b..": |"..string.rep("+", tvel)..string.rep("_", max-tvel).."> "..tvel_kmh.." km/h" + secondLine="ATC"..b..": |"..string.rep("+", tvel)..string.rep("_", max-tvel).." > "..tvel_kmh.." km/h" elseif train.atc_delay then secondLine = "ATC waiting "..advtrains.abs_ceil(train.atc_delay).."s" else @@ -195,7 +196,7 @@ function advtrains.hud_train_format(train, flip) end topLine=" ["..mletter[fct].."] {"..levers.."} "..doorstr[(train.door_open or 0) * fct] - firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", max-vel).."> "..vel_kmh.." km/h" + firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", res-vel).."|"..string.rep("_", max-res).."> "..vel_kmh.." km/h" return (train.debug or "").."\n"..topLine.."\n"..firstLine.."\n"..secondLine end |