summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-06-07 20:00:21 +0000
committerfrosch <frosch@openttd.org>2010-06-07 20:00:21 +0000
commit7de069af3bf4e61760d7d741e7f821f0eff5cdc0 (patch)
tree2bf6efb9e303ae826c7c115d982534591f69c54a
parent38b8259f3b85b91a1a4a4b1fbbff1a35c708810e (diff)
downloadopenttd-7de069af3bf4e61760d7d741e7f821f0eff5cdc0.tar.xz
(svn r19944) -Feature(ette): Open vehicle view when clicking on the caption of vehicle news.
-rw-r--r--src/news_gui.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index b73670175..fac55e719 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -18,6 +18,7 @@
#include "date_func.h"
#include "vehicle_base.h"
#include "vehicle_func.h"
+#include "vehicle_gui.h"
#include "station_base.h"
#include "industry.h"
#include "town.h"
@@ -458,6 +459,12 @@ struct NewsWindow : Window {
break;
case NTW_CAPTION:
+ if (this->ni->reftype1 == NR_VEHICLE) {
+ const Vehicle *v = Vehicle::Get(this->ni->ref1);
+ ShowVehicleViewWindow(v);
+ }
+ break;
+
case NTW_VIEWPORT:
break; // Ignore clicks