From ff07598ce23d2126e6dbdf6eb4db2bb346e4de11 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 24 Aug 2008 21:31:24 +0000 Subject: (svn r14157) -Codechange: Add and use string properties for rail types instead of relying on consecutive string IDs. --- src/engine_gui.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/engine_gui.cpp') diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index e574545fe..f2eba113e 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -17,6 +17,7 @@ #include "strings_func.h" #include "engine_gui.h" #include "articulated_vehicles.h" +#include "rail.h" #include "table/strings.h" #include "table/sprites.h" @@ -29,13 +30,7 @@ StringID GetEngineCategoryName(EngineID engine) case VEH_AIRCRAFT: return STR_8104_AIRCRAFT; case VEH_SHIP: return STR_8105_SHIP; case VEH_TRAIN: - switch (RailVehInfo(engine)->railtype) { - default: NOT_REACHED(); - case RAILTYPE_RAIL: return STR_8102_RAILROAD_LOCOMOTIVE; - case RAILTYPE_ELECTRIC: return STR_8102_RAILROAD_LOCOMOTIVE; - case RAILTYPE_MONO: return STR_8106_MONORAIL_LOCOMOTIVE; - case RAILTYPE_MAGLEV: return STR_8107_MAGLEV_LOCOMOTIVE; - } + return GetRailTypeInfo(RailVehInfo(engine)->railtype)->strings.new_loco; } } -- cgit v1.2.3-54-g00ecf