summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-11-20 11:57:46 +0100
committerorwell96 <orwell@bleipb.de>2018-11-20 11:57:46 +0100
commit9a1f381882d96e3733694a7dd9337fbf825f93e5 (patch)
treebd59286cd369a06e6b1495e35f5a2cc1ae9893f0
parenteb0f6f9d516450a696714e8f96620fd4a69b76da (diff)
downloadbasic_trains-9a1f381882d96e3733694a7dd9337fbf825f93e5.tar.gz
basic_trains-9a1f381882d96e3733694a7dd9337fbf825f93e5.tar.bz2
basic_trains-9a1f381882d96e3733694a7dd9337fbf825f93e5.zip
Make "Line" property accessible from OBC and gettable via LATC, change subway wagon texture handling
-rw-r--r--advtrains_train_subway/init.lua20
-rw-r--r--advtrains_train_subway/textures/advtrains_subway_wagon_line0.png (renamed from advtrains_train_subway/textures/advtrains_subway_wagon_line10.png)bin1224 -> 1224 bytes
2 files changed, 20 insertions, 0 deletions
diff --git a/advtrains_train_subway/init.lua b/advtrains_train_subway/init.lua
index 62bcc41..c1a50e2 100644
--- a/advtrains_train_subway/init.lua
+++ b/advtrains_train_subway/init.lua
@@ -101,6 +101,26 @@ advtrains.register_wagon("subway_wagon", {
self.sound_loop_tmr=0
end
end,
+ custom_on_step = function(self, dtime, data, train)
+ --set line number
+ local line = nil
+ if train.line then
+ line = tonumber(string.sub(train.line, 1, 1))
+ end
+ if line and line~=self.line_cache then
+ local new_line_tex="advtrains_subway_wagon.png^advtrains_subway_wagon_line"..line..".png"
+ self.object:set_properties({
+ textures={new_line_tex},
+ })
+ self.line_cache=line
+ elseif self.line_cache~=nil and line==nil then
+ atdebug("clear line")
+ self.object:set_properties({
+ textures=self.textures,
+ })
+ self.line_cache=nil
+ end
+ end,
}, S("Subway Passenger Wagon"), "advtrains_subway_wagon_inv.png")
--wagons
diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line10.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line0.png
index c656d97..c656d97 100644
--- a/advtrains_train_subway/textures/advtrains_subway_wagon_line10.png
+++ b/advtrains_train_subway/textures/advtrains_subway_wagon_line0.png
Binary files differ