(svn r14157) -Codechange: Add and use string properties for rail types instead of relying on consecutive string IDs.

This commit is contained in:
peter1138
2008-08-24 21:31:24 +00:00
parent 8abd4137d4
commit 6261063689
5 changed files with 55 additions and 23 deletions

View File

@@ -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;
}
}