OpenTTD Source 20260206-master-g4d4e37dbf1
NewsTypeData Struct Reference

Per-NewsType data. More...

#include <news_type.h>

Public Member Functions

 NewsTypeData (std::string_view name, uint8_t age, SoundFx sound)
 Construct this entry.
NewsDisplay GetDisplay () const
 Return the news display option.

Data Fields

const std::string_view name
 Name.
const uint8_t age
 Maximum age of news items (in days).
const SoundFx sound
 Sound.

Detailed Description

Per-NewsType data.

Definition at line 109 of file news_type.h.

Constructor & Destructor Documentation

◆ NewsTypeData()

NewsTypeData::NewsTypeData ( std::string_view name,
uint8_t age,
SoundFx sound )
inline

Construct this entry.

Parameters
nameThe name of the type.
ageThe maximum age for these messages.
soundThe sound to play.

Definition at line 120 of file news_type.h.

References age, name, and sound.

Member Function Documentation

◆ GetDisplay()

NewsDisplay NewsTypeData::GetDisplay ( ) const

Return the news display option.

Returns
display options

Definition at line 348 of file news_gui.cpp.

References SettingDesc::AsIntSetting(), GetSettingFromName(), SettingDesc::IsIntSetting(), and name.

Field Documentation

◆ age

const uint8_t NewsTypeData::age

Maximum age of news items (in days).

Definition at line 111 of file news_type.h.

Referenced by NewsTypeData().

◆ name

const std::string_view NewsTypeData::name

Name.

Definition at line 110 of file news_type.h.

Referenced by GetDisplay(), and NewsTypeData().

◆ sound

const SoundFx NewsTypeData::sound

Sound.

Definition at line 112 of file news_type.h.

Referenced by NewsTypeData().


The documentation for this struct was generated from the following files: