Changeset - r20055:c53a5b6f3871
[Not reviewed]
master
0 3 0
rubidium - 11 years ago 2013-02-17 14:59:27
rubidium@openttd.org
(svn r25013) -Feature: show the amount of cargo that has already been reserved by full loading vehicles in the station (fonsinchen)
3 files changed with 31 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.h
Show inline comments
 
@@ -445,6 +445,25 @@ public:
 
	friend class CargoReservation;
 
	friend class CargoReturn;
 

	
 
	/**
 
	 * Returns sum of cargo reserved for loading onto vehicles.
 
	 * @return Cargo reserved for loading.
 
	 */
 
	inline uint ReservedCount() const
 
	{
 
		return this->reserved_count;
 
	}
 

	
 
	/**
 
	 * Returns total count of cargo, including reserved cargo that's not
 
	 * actually in the list.
 
	 * @return Total cargo count.
 
	 */
 
	inline uint TotalCount() const
 
	{
 
		return this->count + this->reserved_count;
 
	}
 

	
 
	void Append(CargoPacket *cp);
 

	
 
	/* Methods for moving cargo around. First parameter is always maximum
src/lang/english.txt
Show inline comments
 
@@ -2933,6 +2933,7 @@ STR_STATION_VIEW_CAPTION                
 
STR_STATION_VIEW_WAITING_TITLE                                  :{BLACK}Waiting: {WHITE}{STRING}
 
STR_STATION_VIEW_WAITING_CARGO                                  :{WHITE}{CARGO_LONG}
 
STR_STATION_VIEW_EN_ROUTE_FROM                                  :{YELLOW}({CARGO_SHORT} en-route from {STATION})
 
STR_STATION_VIEW_RESERVED                                       :{YELLOW}({CARGO_SHORT} reserved for loading)
 

	
 
STR_STATION_VIEW_ACCEPTS_BUTTON                                 :{BLACK}Accepts
 
STR_STATION_VIEW_ACCEPTS_TOOLTIP                                :{BLACK}Show list of accepted cargo
src/station_gui.cpp
Show inline comments
 
@@ -938,7 +938,7 @@ struct StationViewWindow : public Window
 
				this->cargo_rows[i] = 0;
 
			} else {
 
				/* Add an entry for total amount of cargo of this type waiting. */
 
				cargolist->push_back(CargoData(i, INVALID_STATION, st->goods[i].cargo.Count()));
 
				cargolist->push_back(CargoData(i, INVALID_STATION, st->goods[i].cargo.TotalCount()));
 

	
 
				/* Set the row for this cargo entry for the expand/hide button */
 
				this->cargo_rows[i] = (uint16)cargolist->size();
 
@@ -969,6 +969,12 @@ struct StationViewWindow : public Window
 
						if (!added) cargolist->push_back(CargoData(i, cp->SourceStation(), cp->Count()));
 
					}
 
				}
 
				if (st->goods[i].cargo.ReservedCount() > 0) {
 
					SetBit(*transfers, i);
 
					if (HasBit(this->cargo, i)) {
 
						cargolist->push_back(CargoData(i, NEW_STATION, st->goods[i].cargo.ReservedCount()));
 
					}
 
				}
 
			}
 
		}
 
	}
 
@@ -1019,6 +1025,10 @@ struct StationViewWindow : public Window
 
					} else {
 
						DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_WAITING_CARGO, TC_FROMSTRING, SA_RIGHT);
 
					}
 
				} else if (cd->source == NEW_STATION) {
 
					SetDParam(0, cd->cargo);
 
					SetDParam(1, cd->count);
 
					DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_RESERVED, TC_FROMSTRING, SA_RIGHT);
 
				} else {
 
					SetDParam(0, cd->cargo);
 
					SetDParam(1, cd->count);
0 comments (0 inline, 0 general)