summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-06 18:15:13 +0000
committerdarkvater <darkvater@openttd.org>2004-09-06 18:15:13 +0000
commitbf0652d3fce57024fe56f75d43898a261fea7570 (patch)
treeff59ad94248c5c270741fe954c139e1f953b197c /train_cmd.c
parentdf1397a47e68cf07d0a0d4fe02758f4b4f8c469f (diff)
downloadopenttd-bf0652d3fce57024fe56f75d43898a261fea7570.tar.xz
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
-Fix: Sorter icon pointing down 'v' sorts in every window lowest value first, '^' highest value first -CodeChange: move Dropdownlist from settings_gui.c to widget.c. More in place there.
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index cb6306d91..342883e1f 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -496,6 +496,7 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
NormalizeTrainVehInDepot(v);
InvalidateWindow(WC_VEHICLE_DEPOT, tile);
+ _vehicle_sort_dirty[VEHTRAIN] = true; // build a trainengine
InvalidateWindow(WC_TRAINS_LIST, v->owner);
InvalidateWindow(WC_COMPANY, v->owner);
}
@@ -793,7 +794,10 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
// always redraw the depot. maybe redraw train list
InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
- if (first->subtype == 0) InvalidateWindow(WC_TRAINS_LIST, first->owner);
+ if (first->subtype == 0) {
+ _vehicle_sort_dirty[VEHTRAIN] = true; // sell a wagon / locomotive
+ InvalidateWindow(WC_TRAINS_LIST, first->owner);
+ }
// when selling an attached locomotive. we need to delete its window.
if (v->subtype == 0) {
DeleteWindowById(WC_VEHICLE_VIEW, v->index);
@@ -2198,6 +2202,7 @@ static void DeleteLastWagon(Vehicle *v)
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
DeleteWindowById(WC_VEHICLE_VIEW, v->index);
+ _vehicle_sort_dirty[VEHTRAIN] = true; // remove crashed train
InvalidateWindow(WC_TRAINS_LIST, v->owner);
InvalidateWindow(WC_COMPANY, v->owner);