33 #include "core/alloc_func.hpp" |
33 #include "core/alloc_func.hpp" |
34 #include "string_func.h" |
34 #include "string_func.h" |
35 #include "settings_type.h" |
35 #include "settings_type.h" |
36 #include "widgets/dropdown_func.h" |
36 #include "widgets/dropdown_func.h" |
37 #include "order_func.h" |
37 #include "order_func.h" |
38 #include "depot_base.h" |
|
39 |
38 |
40 #include "table/sprites.h" |
39 #include "table/sprites.h" |
41 #include "table/strings.h" |
40 #include "table/strings.h" |
42 |
41 |
43 struct refit_d { |
42 struct refit_d { |
113 switch (w->window_class) { |
116 switch (w->window_class) { |
114 case WC_TRAINS_LIST: |
117 case WC_TRAINS_LIST: |
115 case WC_ROADVEH_LIST: |
118 case WC_ROADVEH_LIST: |
116 case WC_SHIPS_LIST: |
119 case WC_SHIPS_LIST: |
117 case WC_AIRCRAFT_LIST: |
120 case WC_AIRCRAFT_LIST: |
118 WP(w, vehiclelist_d).l.flags |= VL_REBUILD; |
121 WP(w, vehiclelist_d).l.flags |= sl_flag; |
119 SetWindowDirty(w); |
122 SetWindowDirty(w); |
120 break; |
123 break; |
121 |
124 |
122 default: break; |
125 default: break; |
123 } |
126 } |
124 } |
127 } |
125 } |
128 } |
126 |
129 |
|
130 /** |
|
131 * Rebuild all vehicle list windows |
|
132 */ |
|
133 void RebuildVehicleLists() |
|
134 { |
|
135 SetVehicleListsFlag(VL_REBUILD); |
|
136 } |
|
137 |
|
138 /** |
|
139 * Resort all vehicle list windows |
|
140 */ |
127 void ResortVehicleLists() |
141 void ResortVehicleLists() |
128 { |
142 { |
129 Window* const *wz; |
143 SetVehicleListsFlag(VL_RESORT); |
130 |
|
131 FOR_ALL_WINDOWS(wz) { |
|
132 Window *w = *wz; |
|
133 |
|
134 switch (w->window_class) { |
|
135 case WC_TRAINS_LIST: |
|
136 case WC_ROADVEH_LIST: |
|
137 case WC_SHIPS_LIST: |
|
138 case WC_AIRCRAFT_LIST: |
|
139 WP(w, vehiclelist_d).l.flags |= VL_RESORT; |
|
140 SetWindowDirty(w); |
|
141 break; |
|
142 |
|
143 default: break; |
|
144 } |
|
145 } |
|
146 } |
144 } |
147 |
145 |
148 void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 window_type) |
146 void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 window_type) |
149 { |
147 { |
150 if (!(vl->l.flags & VL_REBUILD)) return; |
148 if (!(vl->l.flags & VL_REBUILD)) return; |