diff options
author | truelight <truelight@openttd.org> | 2007-06-21 16:17:47 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-21 16:17:47 +0000 |
commit | 56eb1738ee6de39367047a3cd0f20011560eb393 (patch) | |
tree | 9a8cf5e86397687ed30d3da2567447b1d843509d /src/economy.cpp | |
parent | 2792019b78fbfd10702b93a2d570562397cf8cb2 (diff) | |
download | openttd-56eb1738ee6de39367047a3cd0f20011560eb393.tar.xz |
(svn r10254) -Feature: loading indicator, which shows in % how full a vehicle is while loading/unloading (TheJosh)
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index b12a912e1..9c55781d2 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1718,6 +1718,16 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) } } + /* Calculate the loading indicator fill percent and display */ + if (_patches.loading_indicators && _game_mode != GM_MENU && v->owner == _local_player) { + int percent = CalcPercentVehicleFilled(v); + if (v->fill_percent_te_id == INVALID_TE_ID) { + v->fill_percent_te_id = ShowFillingPercent(v->x_pos, v->y_pos, v->z_pos + 20, percent); + } else { + UpdateFillingPercent(v->fill_percent_te_id, percent); + } + } + v->load_unload_time_rem = unloading_time; if (completely_empty) { |