(svn r22244) -Codechange: Make vehicle windows handle command-/GUI-scope invalidations themself (from autoreplace and refitting).

This commit is contained in:
frosch
2011-03-13 21:33:02 +00:00
parent 0ff4f31723
commit f051a81b4e
4 changed files with 14 additions and 22 deletions

View File

@@ -250,12 +250,10 @@ struct TimetableWindow : Window {
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
{
if (!gui_scope) return;
switch (data) {
case -666:
/* Autoreplace replaced the vehicle */
this->vehicle = Vehicle::Get(this->window_number);
/* This case is _not_ called asynchronously. Get out directly, rest can be done later */
break;
case -1:
@@ -267,11 +265,13 @@ struct TimetableWindow : Window {
break;
case -2:
if (!gui_scope) break;
this->UpdateSelectionStates();
this->ReInit();
break;
default: {
if (!gui_scope) break;
/* Moving an order. If one of these is INVALID_VEH_ORDER_ID, then
* the order is being created / removed */
if (this->sel_index == -1) break;