From 11d6a12ce7752c7640c3cb85e76814ebeb3f94ef Mon Sep 17 00:00:00 2001 From: Gabriel PĂ©rez-Cerezo Date: Mon, 23 Oct 2017 13:33:27 +0200 Subject: Set wagon line number --- advtrains/wagons.lua | 7 +++++++ advtrains_luaautomation/atc_rail.lua | 4 ++++ .../textures/advtrains_subway_wagon_line1.png | Bin 0 -> 1203 bytes .../textures/advtrains_subway_wagon_line10.png | Bin 0 -> 1224 bytes .../textures/advtrains_subway_wagon_line2.png | Bin 0 -> 1230 bytes .../textures/advtrains_subway_wagon_line3.png | Bin 0 -> 1230 bytes .../textures/advtrains_subway_wagon_line4.png | Bin 0 -> 1226 bytes .../textures/advtrains_subway_wagon_line5.png | Bin 0 -> 1231 bytes .../textures/advtrains_subway_wagon_line6.png | Bin 0 -> 1227 bytes .../textures/advtrains_subway_wagon_line7.png | Bin 0 -> 1226 bytes .../textures/advtrains_subway_wagon_line8.png | Bin 0 -> 1233 bytes .../textures/advtrains_subway_wagon_line9.png | Bin 0 -> 1235 bytes 12 files changed, 11 insertions(+) create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line1.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line10.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line2.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line3.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line4.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line5.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line6.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line7.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line8.png create mode 100644 advtrains_train_subway/textures/advtrains_subway_wagon_line9.png diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 567b560..715f501 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -291,6 +291,13 @@ function wagon:on_step(dtime) local gp=self:train() local fct=self.wagon_flipped and -1 or 1 + --set line number + if self.name == "advtrains:subway_wagon" and gp.line then + self.object:set_properties({ + textures={"advtrains_subway_wagon.png^advtrains_subway_wagon_line"..gp.line..".png"}, + visual_size = text_scale, + }) + end --door animation if self.doors then if (self.door_anim_timer or 0)<=0 then diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua index 3ec82c8..1fae28d 100644 --- a/advtrains_luaautomation/atc_rail.lua +++ b/advtrains_luaautomation/atc_rail.lua @@ -58,6 +58,10 @@ function r.fire_event(pos, evtdata) train.atc_arrow=atc_arrow return true end, + set_line = function(line) + train.line = line + return true + end, atc_reset = function(cmd) if not train_id then return false end assertt(cmd, "string") diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line1.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line1.png new file mode 100644 index 0000000..ad596df Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line1.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line10.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line10.png new file mode 100644 index 0000000..c656d97 Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line10.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line2.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line2.png new file mode 100644 index 0000000..7dbe679 Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line2.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line3.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line3.png new file mode 100644 index 0000000..3ccb6fb Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line3.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line4.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line4.png new file mode 100644 index 0000000..67d7def Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line4.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line5.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line5.png new file mode 100644 index 0000000..1af9e9c Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line5.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line6.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line6.png new file mode 100644 index 0000000..e48c6ed Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line6.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line7.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line7.png new file mode 100644 index 0000000..8ed26e7 Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line7.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line8.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line8.png new file mode 100644 index 0000000..4e19353 Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line8.png differ diff --git a/advtrains_train_subway/textures/advtrains_subway_wagon_line9.png b/advtrains_train_subway/textures/advtrains_subway_wagon_line9.png new file mode 100644 index 0000000..a79d7a7 Binary files /dev/null and b/advtrains_train_subway/textures/advtrains_subway_wagon_line9.png differ -- cgit v1.2.3