OpenTTD
Public Member Functions | Protected Attributes
ErrorMessageData Class Reference

The data of the error message. More...

#include <error.h>

Inheritance diagram for ErrorMessageData:
ErrmsgWindow

Public Member Functions

 ErrorMessageData (const ErrorMessageData &data)
 Copy the given data into our instance. More...
 
 ~ErrorMessageData ()
 Free all the strings. More...
 
 ErrorMessageData (StringID summary_msg, StringID detailed_msg, uint duration=0, int x=0, int y=0, const GRFFile *textref_stack_grffile=NULL, uint textref_stack_size=0, const uint32 *textref_stack=NULL)
 Display an error message in a window. More...
 
bool HasFace () const
 Check whether error window shall display a company manager face.
 
void SetDParam (uint n, uint64 v)
 Set a error string parameter. More...
 
void SetDParamStr (uint n, const char *str)
 Set a rawstring parameter. More...
 
void CopyOutDParams ()
 Copy error parameters from current DParams.
 

Protected Attributes

uint duration
 Length of display of the message. 0 means forever,.
 
uint64 decode_params [20]
 Parameters of the message strings.
 
const char * strings [20]
 Copies of raw strings that were used.
 
const GRFFiletextref_stack_grffile
 NewGRF that filled the TextRefStack for the error message.
 
uint textref_stack_size
 Number of uint32 values to put on the TextRefStack for the error message.
 
uint32 textref_stack [16]
 Values to put on the TextRefStack for the error message.
 
StringID summary_msg
 General error message showed in first line. Must be valid.
 
StringID detailed_msg
 Detailed error message showed in second line. Can be INVALID_STRING_ID.
 
Point position
 Position of the error message window.
 
CompanyID face
 Company belonging to the face being shown. INVALID_COMPANY if no face present.
 

Detailed Description

The data of the error message.

Definition at line 30 of file error.h.

Constructor & Destructor Documentation

◆ ErrorMessageData() [1/2]

ErrorMessageData::ErrorMessageData ( const ErrorMessageData data)

Copy the given data into our instance.

Parameters
dataThe data to copy.

Definition at line 75 of file error_gui.cpp.

References decode_params, lengthof, stredup(), and strings.

◆ ~ErrorMessageData()

ErrorMessageData::~ErrorMessageData ( )

Free all the strings.

Definition at line 87 of file error_gui.cpp.

References free(), lengthof, and strings.

◆ ErrorMessageData() [2/2]

ErrorMessageData::ErrorMessageData ( StringID  summary_msg,
StringID  detailed_msg,
uint  duration = 0,
int  x = 0,
int  y = 0,
const GRFFile textref_stack_grffile = NULL,
uint  textref_stack_size = 0,
const uint32 *  textref_stack = NULL 
)

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 INVALID_STRING_ID.
durationThe amount of time to show this error message.
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.
textref_stack_grffileNewGRF that provides the TextRefStack for the error message.
textref_stack_sizeNumber of uint32 values to put on the TextRefStack for the error message; 0 if the TextRefStack shall not be used.
textref_stackValues to put on the TextRefStack.

Definition at line 103 of file error_gui.cpp.

Member Function Documentation

◆ SetDParam()

void ErrorMessageData::SetDParam ( uint  n,
uint64  v 
)

Set a error string parameter.

Parameters
nParameter index
vParameter value

Definition at line 148 of file error_gui.cpp.

References decode_params.

Referenced by HasFace().

◆ SetDParamStr()

void ErrorMessageData::SetDParamStr ( uint  n,
const char *  str 
)

Set a rawstring parameter.

Parameters
nParameter index
strRaw string

Definition at line 158 of file error_gui.cpp.

References free(), stredup(), and strings.

Referenced by HasFace(), and StringToVal().


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