Public Member Functions | Protected Attributes

# ErrorMessageData Class Reference

The data of the error message. More...

`#include <error.h>`

Inheritance diagram for ErrorMessageData:

## Public Member Functions
| ErrorMessageData (const ErrorMessageData &data)
| Copy the given data into our instance.
| ~ErrorMessageData ()
| Free all the strings.
| 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.
bool | HasFace () const
| Check whether error window shall display a company manager face.
void | SetDParam (uint n, uint64 v)
| Set a error string parameter.
void | SetDParamStr (uint n, const char *str)
| Set a rawstring parameter.
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 GRFFile * | textref_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::ErrorMessageData | ( | const ErrorMessageData & | data | ) |

Copy the given data into our instance.

Parameters:

  | data | The data to copy.

Definition at line 73 of file error_gui.cpp.

References decode_params, lengthof, and strings.

ErrorMessageData::~ErrorMessageData | ( |  | ) |

Free all the strings.

Definition at line 85 of file error_gui.cpp.

References free(), lengthof, and strings.

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_msg | General error message showed in first line. Must be valid.
  | detailed_msg | Detailed error message showed in second line. Can be INVALID_STRING_ID.
  | duration | The amount of time to show this error message.
  | x | World 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.
  | y | World 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_grffile | NewGRF that provides the TextRefStack for the error message.
  | textref_stack_size | Number of uint32 values to put on the TextRefStack for the error message; 0 if the TextRefStack shall not be used.
  | textref_stack | Values to put on the TextRefStack.

Definition at line 101 of file error_gui.cpp.

References decode_params, INVALID_STRING_ID, MemCpyT(), position, and strings.

## Member Function Documentation

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

Set a error string parameter.

Parameters:

  | n | Parameter index
  | v | Parameter value

Definition at line 146 of file error_gui.cpp.

References decode_params.

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

Set a rawstring parameter.

Parameters:

  | n | Parameter index
  | str | Raw string

Definition at line 156 of file error_gui.cpp.

References free(), and strings.

Referenced by IniLoadSettings(), openttd_main(), and StringToVal().

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

- src/error.h
- src/error_gui.cpp