OpenTTD Source 20260711-master-g3fb3006dff
newgrf_text_type.h File Reference

Header of Action 04 "universal holder" structure. More...

Go to the source code of this file.

Data Structures

struct  GRFText
 A GRF text with associated language ID. More...
struct  LanguageMap
 Mapping of language data between a NewGRF and OpenTTD. More...
struct  LanguageMap::Mapping
 Mapping between NewGRF and OpenTTD IDs. More...

Typedefs

using GRFStringID = StrongType::Typedef<uint32_t, struct GRFStringIDTag, StrongType::Compare, StrongType::Integer>
 Type for GRF-internal string IDs.
using GRFTextList = std::vector<GRFText>
 A GRF text with a list of translations.
using GRFTextWrapper = std::shared_ptr<GRFTextList>
 Reference counted wrapper around a GRFText pointer.

Enumerations

enum class  GRFLanguage : uint8_t {
  American = 0 , English = 1 , German = 2 , French = 3 ,
  Spanish = 4 , Unspecified = 0x7F , End = 0x7F , Fallback = American
}
 Incomplete enumeration of the (New)GRF languages. More...

Variables

static constexpr GRFStringID GRFSTR_MISC_GRF_TEXT {0xD000}
 Miscellaneous GRF text range.
static const char32_t NFO_UTF8_IDENTIFIER = 0x00DE
 This character (thorn) indicates a unicode string to NFO.

Detailed Description

Header of Action 04 "universal holder" structure.

Definition in file newgrf_text_type.h.

Typedef Documentation

◆ GRFStringID

using GRFStringID = StrongType::Typedef<uint32_t, struct GRFStringIDTag, StrongType::Compare, StrongType::Integer>

Type for GRF-internal string IDs.

Definition at line 17 of file newgrf_text_type.h.

◆ GRFTextList

using GRFTextList = std::vector<GRFText>

A GRF text with a list of translations.

Definition at line 45 of file newgrf_text_type.h.

◆ GRFTextWrapper

using GRFTextWrapper = std::shared_ptr<GRFTextList>

Reference counted wrapper around a GRFText pointer.

Definition at line 47 of file newgrf_text_type.h.

Enumeration Type Documentation

◆ GRFLanguage

enum class GRFLanguage : uint8_t
strong

Incomplete enumeration of the (New)GRF languages.

Enumerator
American 

American (English US).

English 

English (English UK).

German 

German.

French 

French.

Spanish 

Spanish.

Unspecified 

No specific language.

End 

End marker of the valid languages.

Fallback 

Default fallback language.

Definition at line 25 of file newgrf_text_type.h.

Variable Documentation

◆ GRFSTR_MISC_GRF_TEXT

◆ NFO_UTF8_IDENTIFIER

const char32_t NFO_UTF8_IDENTIFIER = 0x00DE
static

This character (thorn) indicates a unicode string to NFO.

Definition at line 22 of file newgrf_text_type.h.

Referenced by GlobalVarChangeInfo(), and TranslateTTDPatchCodes().