While the most recent versions do have the code restructured to make adding such a feature more trivial, I have no intention to add such a feature at this moment. Personally I do not see the big added value.
I am not forcing anyone's hand here. But allow me to explain why it's useful or at least how it can add to gameplay. Of course, everyone has their own tastes and desires so we should all keep that in mind.
When your profit margins largely rely on whether you deliver some cargo in a timely manner. Say you only have 100 days of transport before you are being paid nickles rather than gold bars for your delivery. Then you are bound to have some trains just waiting around for the opportune moment to deliver that cargo.
While these trains are waiting (not loading, because then the cargo time ticker will tick) they are still costing just as much as they do transporting the cargo. So one could just send them more frequently instead and ignore the fact they don't carry that much cargo at the time.
This ofc also applies to transfers of cargo, where one train is waiting for another to arrive before departing.
So my idea (and even assumption after i switched to the NML version) was that idle trains would cost less while waiting around. And that therefore, trains that aren't fully loaded but still running around like headless chickens, would be less profitable than a carefully orchestrated schedule that minimizes actual travel times and thus maximizes the profits.
Again, i play a VERY different game to most others. Where every thousand credits can make or break an operation. Where not just picking the most powerful/fastest unit makes you more money. You can see my ideology for that in my other thread
IF i were to implement this (i agree, it's a lot of work) i would also change another aspect that bothers me. The wagon running costs overriding any point in picking a loco that has a good running cost to power or speed ratio.
Because there's really no penalty (aside from initial investment cost) to having more locos on a 60 tile long train as far as running costs go. At least not when breakdowns are set to none which i unfortunately had to resort to because of how monotone setting up timetables is.
Either way, i would make it so the engine (again) stands for the brunt of the running cost of the whole train. Rather than picking an engine that costs 100,000/yr and 4 wagons that brings the total to twice that of the engine running cost.
On a side note, i have already reduced the reliability_decay from 20 to 2 on ALL vehicles in 2cc. As i am playing with "minutes" rather than days, it's kinda odd that a train can't make a 4 hour trip without already being at 50% reliability and having at least one breakdown.
But that had the unfortunate side effect that timetables are not that great when it comes to repeating routes. There's no copy/paste in timetables so i can't set it up so a train goes 22 hours on it's regular service and then spends 2 hours finding one of my very few (and expensive) depots.
But if you really want, supermop has given a nice explanation on what it should look like, although I prepared the code in this set to have those pieces of code hidden behind some #defines from C/make, to allow a single point of definition.
Yes, i see what you did. If i were to do that change then ofc i would make use of the defines rather than hardcoding it in each graphics. I just didn't know where to put the declaration for the callback and how to access variables other than "extra_callback_info" but now i see how that works.