aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorywang <yw05@forksworld.de>2021-08-01 17:34:05 +0200
committerY. Wang <yw05@forksworld.de>2022-03-12 18:23:30 +0100
commit135d5fb4d14d1adc889b10886556f16a821d34f4 (patch)
tree952f4c025d4b3aef629651fe7b6929ba9a7189f3
parent215dc8585183697d1a16090e9a8d89f1b2f58714 (diff)
downloadadvtrains-135d5fb4d14d1adc889b10886556f16a821d34f4.tar.gz
advtrains-135d5fb4d14d1adc889b10886556f16a821d34f4.tar.bz2
advtrains-135d5fb4d14d1adc889b10886556f16a821d34f4.zip
Fix digital speed indicator; add texture_escape from moretrains
-rw-r--r--advtrains/trainhud.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index 3f7b797..6ba4c49 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -178,6 +178,10 @@ Value Disp Control Meaning
4 + W Accelerate
]]
+function advtrains.hud.texture_escape(str)
+ return string.gsub(str, "[%[%()^:]", "\\%1")
+end
+
function advtrains.hud.dtext(train, flip)
local st = {}
if train.debug then st = {train.debug} end
@@ -318,7 +322,7 @@ function advtrains.hud.dgraphical(train, flip)
end
ht[#ht+1] = advtrains.hud.door(train.door_open, 170, 10, 60, 30, 2)
-- speed indications
- ht[#ht+1] = advtrains.hud.number(vel, nil, 320, 10, 30, 10, 10, "[colorize\\:red\\:255")
+ ht[#ht+1] = advtrains.hud.number(vel, 2, 320, 10, 30, 10, 10, "[colorize\\:red\\:255")
for i = 1, vel, 1 do
ht[#ht+1] = sformat("%d,65=(advtrains_hud_bg.png^[resize\\:8x20^[colorize\\:white)", i*11-1)
end