From fc201d4ad8268234ce67d2ea1e49d470ab0c2004 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 Jun 2007 11:58:59 +0000 Subject: (svn r10266) -Codechange: keep track of the origin, time of travel and accumulated feeder share (transfers) of individual pieces of cargo. This means that cargo isn't thrown on a big pile when it's put in a station or unloaded at a station, however the GUI does not reflect these changes yet so you will not actually see it. --- src/train_gui.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/train_gui.cpp') diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 1a1a475c8..095e51739 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -327,13 +327,12 @@ void ShowTrainViewWindow(const Vehicle *v) static void TrainDetailsCargoTab(const Vehicle *v, int x, int y) { if (v->cargo_cap != 0) { - uint num = v->cargo_count; StringID str = STR_8812_EMPTY; - if (num != 0) { + if (!v->cargo.Empty()) { SetDParam(0, v->cargo_type); - SetDParam(1, num); - SetDParam(2, v->cargo_source); + SetDParam(1, v->cargo.Count()); + SetDParam(2, v->cargo.Source()); SetDParam(3, _patches.freight_trains); str = FreightWagonMult(v->cargo_type) > 1 ? STR_FROM_MULT : STR_8813_FROM; } @@ -387,7 +386,7 @@ static void DrawTrainDetailsWindow(Window *w) } do { - act_cargo[u->cargo_type] += u->cargo_count; + act_cargo[u->cargo_type] += u->cargo.Count(); max_cargo[u->cargo_type] += u->cargo_cap; } while ((u = u->next) != NULL); @@ -504,7 +503,7 @@ static void DrawTrainDetailsWindow(Window *w) DrawString(x, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_013F_TOTAL_CAPACITY, 0); } } - SetDParam(0, v->cargo_feeder_share); + SetDParam(0, v->cargo.FeederShare()); DrawString(x, y + 15, STR_FEEDER_CARGO_VALUE, 0); } } -- cgit v1.2.3-54-g00ecf