OpenTTD Source 20250312-master-gcdcc6b491d
ErrorMessageData Class Reference

The data of the error message. More...

#include <error.h>

Inheritance diagram for ErrorMessageData:
ErrmsgWindow

Public Member Functions

 ErrorMessageData (EncodedString &&summary_msg, EncodedString &&detailed_msg, bool is_critical=false, int x=0, int y=0, EncodedString &&extra_msg={}, CompanyID company=CompanyID::Invalid())
 Display an error message in a window.
 
bool HasFace () const
 Check whether error window shall display a company manager face.
 

Protected Attributes

bool is_critical
 Whether the error message is critical.
 
EncodedString summary_msg
 General error message showed in first line. Must be valid.
 
EncodedString detailed_msg
 Detailed error message showed in second line. Can be INVALID_STRING_ID.
 
EncodedString extra_msg
 Extra error message shown in third line. Can be INVALID_STRING_ID.
 
Point position
 Position of the error message window.
 
CompanyID company
 Company belonging to the face being shown. CompanyID::Invalid() if no face present.
 

Detailed Description

The data of the error message.

Definition at line 31 of file error.h.

Constructor & Destructor Documentation

◆ ErrorMessageData()

ErrorMessageData::ErrorMessageData ( EncodedString &&  summary_msg,
EncodedString &&  detailed_msg,
bool  is_critical = false,
int  x = 0,
int  y = 0,
EncodedString &&  extra_msg = {},
CompanyID  company = CompanyID::Invalid() 
)

Display an error message in a window.

Parameters
summary_msgGeneral error message showed in first line. Must be valid.
detailed_msgDetailed error message showed in second line. Can be empty.
is_criticalWhether the error is critical. Critical messages never go away on their own.
xWorld X position (TileVirtX) of the error location. Set both x and y to 0 to just center the message when there is no related error tile.
yWorld Y position (TileVirtY) of the error location. Set both x and y to 0 to just center the message when there is no related error tile.
extra_msgExtra error message showed in third line. Can be empty.

Definition at line 82 of file error_gui.cpp.

References summary_msg.

Member Function Documentation

◆ HasFace()

bool ErrorMessageData::HasFace ( ) const
inline

Check whether error window shall display a company manager face.

Definition at line 44 of file error.h.

References company.

Field Documentation

◆ company

CompanyID ErrorMessageData::company
protected

Company belonging to the face being shown. CompanyID::Invalid() if no face present.

Definition at line 38 of file error.h.

Referenced by ErrmsgWindow::DrawWidget(), ErrmsgWindow::GetWidgetString(), HasFace(), and ErrmsgWindow::OnInvalidateData().

◆ detailed_msg

EncodedString ErrorMessageData::detailed_msg
protected

Detailed error message showed in second line. Can be INVALID_STRING_ID.

Definition at line 35 of file error.h.

Referenced by ErrmsgWindow::DrawWidget(), and ErrmsgWindow::UpdateWidgetSize().

◆ extra_msg

EncodedString ErrorMessageData::extra_msg
protected

Extra error message shown in third line. Can be INVALID_STRING_ID.

Definition at line 36 of file error.h.

Referenced by ErrmsgWindow::DrawWidget(), and ErrmsgWindow::UpdateWidgetSize().

◆ is_critical

bool ErrorMessageData::is_critical
protected

Whether the error message is critical.

Definition at line 33 of file error.h.

Referenced by ErrmsgWindow::IsCritical(), and ErrmsgWindow::OnMouseLoop().

◆ position

Point ErrorMessageData::position
protected

Position of the error message window.

Definition at line 37 of file error.h.

Referenced by ErrmsgWindow::OnInitialPosition().

◆ summary_msg

EncodedString ErrorMessageData::summary_msg
protected

General error message showed in first line. Must be valid.

Definition at line 34 of file error.h.

Referenced by ErrmsgWindow::DrawWidget(), ErrorMessageData(), and ErrmsgWindow::UpdateWidgetSize().


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