OpenTTD Source 20250312-master-gcdcc6b491d
CompanyNewsInformation Struct Reference

Data that needs to be stored for company news messages. More...

#include <news_type.h>

Inheritance diagram for CompanyNewsInformation:
NewsAllocatedData

Public Member Functions

 CompanyNewsInformation (StringID title, const struct Company *c, const struct Company *other=nullptr)
 Fill the CompanyNewsInformation struct with the required data.
 

Data Fields

std::string company_name
 The name of the company.
 
std::string president_name
 The name of the president.
 
std::string other_company_name
 The name of the company taking over this one.
 
StringID title
 
uint32_t face
 The face of the president.
 
Colours colour
 The colour related to the company.
 

Detailed Description

Data that needs to be stored for company news messages.

The problem with company news messages are the custom name of the companies and the fact that the company data is reset, resulting in wrong names and such.

Definition at line 161 of file news_type.h.

Constructor & Destructor Documentation

◆ CompanyNewsInformation()

CompanyNewsInformation::CompanyNewsInformation ( StringID  title,
const struct Company c,
const struct Company other = nullptr 
)

Fill the CompanyNewsInformation struct with the required data.

Parameters
cthe current company.
otherthe other company (use nullptr if not relevant).

Definition at line 809 of file company_cmd.cpp.

References CompanyProperties::colour, colour, company_name, CompanyProperties::face, face, GetString(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, other_company_name, and president_name.

Field Documentation

◆ colour

Colours CompanyNewsInformation::colour

The colour related to the company.

Definition at line 168 of file news_type.h.

Referenced by CompanyNewsInformation().

◆ company_name

std::string CompanyNewsInformation::company_name

The name of the company.

Definition at line 162 of file news_type.h.

Referenced by CompanyNewsInformation().

◆ face

uint32_t CompanyNewsInformation::face

The face of the president.

Definition at line 167 of file news_type.h.

Referenced by CompanyNewsInformation().

◆ other_company_name

std::string CompanyNewsInformation::other_company_name

The name of the company taking over this one.

Definition at line 164 of file news_type.h.

Referenced by CompanyNewsInformation().

◆ president_name

std::string CompanyNewsInformation::president_name

The name of the president.

Definition at line 163 of file news_type.h.

Referenced by CompanyNewsInformation(), and NewsWindow::OnResize().

◆ title

StringID CompanyNewsInformation::title

Definition at line 166 of file news_type.h.


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