Make tile element type strings in the Tile Inspector translatable

This commit is contained in:
Michael Steenbeek 2018-01-02 15:23:50 +01:00
parent 347ff702d0
commit d25856d59c
3 changed files with 18 additions and 9 deletions

View File

@ -4497,6 +4497,8 @@ STR_6187 :{MEDIUMFONT}{OUTLINE}{WINDOW_COLOUR_2}{STRING}
STR_6188 :Vomit
STR_6189 :Duck
STR_6190 :{SMALLFONT}{BLACK}You cannot select a sprite while the main title screen is active.
STR_6191 :Surface
STR_6192 :Wall
#############
# Scenarios #

View File

@ -24,6 +24,7 @@
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/localisation/string_ids.h>
#include <openrct2/ride/ride_data.h>
#include <openrct2/ride/Track.h>
#include <openrct2/sprites.h>
@ -1985,40 +1986,43 @@ static void window_tile_inspector_scrollpaint(rct_window *w, rct_drawpixelinfo *
switch (type) {
case TILE_ELEMENT_TYPE_SURFACE:
typeName = "Surface";
typeName = language_get_string(STR_TILE_INSPECTOR_SURFACE);
break;
case TILE_ELEMENT_TYPE_PATH:
typeName = footpath_element_is_queue(tileElement) ? "Queue" : "Footpath";
typeName = footpath_element_is_queue(tileElement) ? language_get_string(STR_QUEUE_LINE_MAP_TIP) : language_get_string(STR_FOOTPATH_MAP_TIP);
break;
case TILE_ELEMENT_TYPE_TRACK:
typeName = "Track";
typeName = language_get_string(STR_RIDE_COMPONENT_TRACK_CAPITALISED);
break;
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
snprintf(
buffer, sizeof(buffer),
"Scenery (%s)",
"%s (%s)",
language_get_string(STR_OBJECT_SELECTION_SMALL_SCENERY),
language_get_string(get_small_scenery_entry(tileElement->properties.scenery.type)->name)
);
typeName = buffer;
break;
case TILE_ELEMENT_TYPE_ENTRANCE:
typeName = "Entrance";
typeName = language_get_string(STR_RIDE_CONSTRUCTION_ENTRANCE);
break;
case TILE_ELEMENT_TYPE_WALL:
snprintf(
buffer, sizeof(buffer),
"Wall (%s)",
"%s (%s)",
language_get_string(STR_TILE_INSPECTOR_WALL),
language_get_string(get_wall_entry(tileElement->properties.scenery.type)->name)
);
typeName = buffer;
break;
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
typeName = "Scenery multiple";
typeName = language_get_string(STR_OBJECT_SELECTION_LARGE_SCENERY);
break;
case TILE_ELEMENT_TYPE_BANNER:
snprintf(
buffer, sizeof(buffer),
"Banner (%d)",
"%s (%d)",
language_get_string(STR_BANNER_WINDOW_TITLE),
tileElement->properties.banner.index
);
typeName = buffer;
@ -2026,7 +2030,7 @@ static void window_tile_inspector_scrollpaint(rct_window *w, rct_drawpixelinfo *
case TILE_ELEMENT_TYPE_CORRUPT:
// fall-through
default:
snprintf(buffer, sizeof(buffer), "Unknown (type %d)", type);
snprintf(buffer, sizeof(buffer), "%s (%d)", language_get_string(STR_UNKNOWN_OBJECT_TYPE), type);
typeName = buffer;
}

View File

@ -3841,6 +3841,9 @@ enum {
STR_DUCK = 6189,
STR_TITLE_COMMAND_EDITOR_SELECT_SPRITE_TOOLTIP = 6190,
STR_TILE_INSPECTOR_SURFACE = 6191,
STR_TILE_INSPECTOR_WALL = 6192,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};