OpenTTD Source: src/newgrf/newgrf_stringmapping.h File Reference

OpenTTD Source 15.0-RC2

Functions
newgrf_stringmapping.h File Reference

NewGRF string mapping definition. More...

`#include "../strings_type.h"`
`#include "../newgrf_text_type.h"`

Go to the source code of this file.

## Functions
void | AddStringForMapping (GRFStringID source, std::function< void(StringID)> &&func)
| Record a static StringID for getting translated later.
void | AddStringForMapping (GRFStringID source, StringID *target)
| Record a static StringID for getting translated later.
void | FinaliseStringMapping ()
| Finalise all string mappings.

## Detailed Description

NewGRF string mapping definition.

Definition in file newgrf_stringmapping.h.

## Function Documentation

## ◆ AddStringForMapping() [1/2]

void AddStringForMapping | ( | GRFStringID | source,
|  | std::function< void(StringID)> && | func
| ) |  |

Record a static StringID for getting translated later.

Parameters

  source | Source grf-local GRFStringID.
  func | Function to call to set the mapping result.

Definition at line 42 of file newgrf_stringmapping.cpp.

References _string_to_grf_mapping, and GrfProcessingState::grffile.

Referenced by AddStringForMapping(), AirportChangeInfo(), CargoReserveInfo(), GlobalVarChangeInfo(), IndustriesChangeInfo(), ObjectChangeInfo(), RailTypeChangeInfo(), RoadTypeChangeInfo(), StationChangeInfo(), and TownHouseChangeInfo().

## ◆ AddStringForMapping() [2/2]

void AddStringForMapping | ( | GRFStringID | source,
|  | StringID * | target
| ) |  |

Record a static StringID for getting translated later.

Parameters

  source | Source grf-local GRFStringID.
  target | Destination for the mapping result.

Definition at line 53 of file newgrf_stringmapping.cpp.

References AddStringForMapping().

## ◆ FinaliseStringMapping()

void FinaliseStringMapping | ( |  | ) |

Finalise all string mappings.

Definition at line 159 of file newgrf_stringmapping.cpp.

References _string_to_grf_mapping, and MapGRFStringID().

Referenced by AfterLoadGRFs().