summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-02-10 08:43:54 +0000
committerGitHub <noreply@github.com>2019-02-10 08:43:54 +0000
commitd242875d270e29f198cc62508b338f8949bf3404 (patch)
tree331272647b78fb37fddcf50d437c419d7f7422a2 /src/vehicle_gui.cpp
parent6e211908588ab5272336d0d2db3bbb4020f7004f (diff)
downloadopenttd-d242875d270e29f198cc62508b338f8949bf3404.tar.xz
Fix #7197: Invalidate depot buttons when necessary. (#7212)
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index b4d6fdfab..777716c64 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -2503,6 +2503,8 @@ public:
this->GetWidget<NWidgetCore>(WID_VV_SHOW_ORDERS)->tool_tip = STR_VEHICLE_VIEW_TRAIN_ORDERS_TOOLTIP + v->type;
this->GetWidget<NWidgetCore>(WID_VV_SHOW_DETAILS)->tool_tip = STR_VEHICLE_VIEW_TRAIN_SHOW_DETAILS_TOOLTIP + v->type;
this->GetWidget<NWidgetCore>(WID_VV_CLONE)->tool_tip = STR_VEHICLE_VIEW_CLONE_TRAIN_INFO + v->type;
+
+ this->UpdateButtonStatus();
}
~VehicleViewWindow()
@@ -2732,7 +2734,7 @@ public:
}
}
- virtual void OnGameTick()
+ void UpdateButtonStatus()
{
const Vehicle *v = Vehicle::Get(this->window_number);
bool veh_stopped = v->IsStoppedInDepot();
@@ -2769,6 +2771,8 @@ public:
* Nothing to do for this window. */
return;
}
+
+ this->UpdateButtonStatus();
}
virtual bool IsNewGRFInspectable() const