diff options
author | Y. Wang <y5nw@protonmail.com> | 2024-09-20 12:45:20 +0000 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2024-11-09 22:10:06 +0100 |
commit | b075d8e3336dfb2755dd1b9dc29c5320a155013b (patch) | |
tree | 065aa5602afac4b54b1555e44bce4446b59215ea /advtrains_interlocking/routesetting.lua | |
parent | 66868e2eefe97b7a6d35fa3fecc895b9c7bbc4cc (diff) | |
download | advtrains-b075d8e3336dfb2755dd1b9dc29c5320a155013b.tar.gz advtrains-b075d8e3336dfb2755dd1b9dc29c5320a155013b.tar.bz2 advtrains-b075d8e3336dfb2755dd1b9dc29c5320a155013b.zip |
Implement staticdata for trains
This patch exposes train.staticdata that can be used by other modders to
save data in trains across restarts. It additionally exposes two new
APIs for modders where this is relevant:
* advtrains.te_register_on_couple(function(init_train, stat_train)):
registers a callback for train coupling, where stat_train is couple
into init_train and is subsequently removed. This callback is run
before the actual coupling takes place; in particular, it is run
before stat_train is removed.
* advtrains.te_register_on_decouple(function(train, newtrain, index)):
registers a callback for train decoupling, where newtrain is created
by splitting the train at the given index (the wagon at the index is
part of the new train). This callback is run after decoupling takes
place.
advtrains.te_register_on_decouple(function
Diffstat (limited to 'advtrains_interlocking/routesetting.lua')
0 files changed, 0 insertions, 0 deletions