summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2017-03-18 20:43:43 +0000
committeralberth <alberth@openttd.org>2017-03-18 20:43:43 +0000
commitad88588481d043a84030ce4deefaf064ee11fc79 (patch)
tree2b1ddbe06b0c10666b5275b08a30765c7a194eeb /src/engine.cpp
parent19188818eae21fd3ff3b3c5ae35cde693b31ec28 (diff)
downloadopenttd-ad88588481d043a84030ce4deefaf064ee11fc79.tar.xz
(svn r27797) -Add: Display aircraft type in its vehicle window (patch by Samu)
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 3e69c4ac8..b0af3bc4d 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -464,7 +464,26 @@ uint16 Engine::GetRange() const
}
/**
- * Initializes the EngineOverrideManager with the default engines.
+ * Get the name of the aircraft type for display purposes.
+ * @return Aircraft type string.
+ */
+StringID Engine::GetAircraftTypeText() const
+{
+ switch (this->type) {
+ case VEH_AIRCRAFT:
+ switch (this->u.air.subtype) {
+ case AIR_HELI: return STR_LIVERY_HELICOPTER;
+ case AIR_CTOL: return STR_LIVERY_SMALL_PLANE;
+ case AIR_CTOL | AIR_FAST: return STR_LIVERY_LARGE_PLANE;
+ default: NOT_REACHED();
+ }
+
+ default: NOT_REACHED();
+ }
+}
+
+/**
+ * Initializes the #EngineOverrideManager with the default engines.
*/
void EngineOverrideManager::ResetToDefaultMapping()
{