OpenTTD Source 20241224-master-gf74b0cf984
|
The data of the error message. More...
#include <error.h>
Public Member Functions | |
ErrorMessageData (const ErrorMessageData &data) | |
Copy the given data into our instance. | |
ErrorMessageData (StringID summary_msg, StringID detailed_msg, bool is_critical=false, int x=0, int y=0, const GRFFile *textref_stack_grffile=nullptr, uint textref_stack_size=0, const uint32_t *textref_stack=nullptr, StringID extra_msg=INVALID_STRING_ID) | |
Display an error message in a window. | |
ErrorMessageData & | operator= (ErrorMessageData &rhs)=delete |
bool | HasFace () const |
Check whether error window shall display a company manager face. | |
void | SetDParam (uint n, uint64_t v) |
Set a error string parameter. | |
void | SetDParamStr (uint n, const char *str) |
Set a rawstring parameter. | |
void | SetDParamStr (uint n, const std::string &str) |
Set a rawstring parameter. | |
void | CopyOutDParams () |
Copy error parameters from current DParams. | |
Protected Attributes | |
bool | is_critical |
Whether the error message is critical. | |
std::vector< StringParameterData > | params |
Backup of parameters of the message strings. | |
const GRFFile * | textref_stack_grffile |
NewGRF that filled the TextRefStack for the error message. | |
uint | textref_stack_size |
Number of uint32_t values to put on the TextRefStack for the error message. | |
uint32_t | 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. | |
StringID | extra_msg |
Extra error message shown in third 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. | |
ErrorMessageData::ErrorMessageData | ( | const ErrorMessageData & | data | ) |
Copy the given data into our instance.
data | The data to copy. |
Definition at line 77 of file error_gui.cpp.
References textref_stack.
ErrorMessageData::ErrorMessageData | ( | StringID | summary_msg, |
StringID | detailed_msg, | ||
bool | is_critical = false , |
||
int | x = 0 , |
||
int | y = 0 , |
||
const GRFFile * | textref_stack_grffile = nullptr , |
||
uint | textref_stack_size = 0 , |
||
const uint32_t * | textref_stack = nullptr , |
||
StringID | extra_msg = INVALID_STRING_ID |
||
) |
Display an error message in a window.
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. |
is_critical | Whether the error is critical. Critical messages never go away on their own. |
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_t 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. |
extra_msg | Extra error message showed in third line. Can be INVALID_STRING_ID. |
Definition at line 96 of file error_gui.cpp.
References INVALID_STRING_ID, MemCpyT(), position, summary_msg, textref_stack, and textref_stack_size.
void ErrorMessageData::CopyOutDParams | ( | ) |
Copy error parameters from current DParams.
Definition at line 116 of file error_gui.cpp.
References CopyOutDParam(), detailed_msg, face, GetDParam(), MAX_COMPANIES, OWNED_BY_OWNER_IN_PARAMETERS_OFFSET, params, StartTextRefStackUsage(), StopTextRefStackUsage(), textref_stack, textref_stack_grffile, and textref_stack_size.
Referenced by ShowErrorMessage().
|
inline |
Check whether error window shall display a company manager face.
Definition at line 52 of file error.h.
References face, and INVALID_COMPANY.
void ErrorMessageData::SetDParam | ( | uint | n, |
uint64_t | v | ||
) |
Set a error string parameter.
n | Parameter index |
v | Parameter value |
Definition at line 135 of file error_gui.cpp.
References params.
void ErrorMessageData::SetDParamStr | ( | uint | n, |
const char * | str | ||
) |
Set a rawstring parameter.
n | Parameter index |
str | Raw string |
Definition at line 146 of file error_gui.cpp.
References params.
Referenced by openttd_main(), IntSettingDesc::ParseValue(), BoolSettingDesc::ParseValue(), OneOfManySettingDesc::ParseValue(), ManyOfManySettingDesc::ParseValue(), and ListSettingDesc::ParseValue().
void ErrorMessageData::SetDParamStr | ( | uint | n, |
const std::string & | str | ||
) |
Set a rawstring parameter.
n | Parameter index |
str | Raw string |
Definition at line 157 of file error_gui.cpp.
References params.
|
protected |
Detailed error message showed in second line. Can be INVALID_STRING_ID.
Definition at line 39 of file error.h.
Referenced by CopyOutDParams(), ErrmsgWindow::DrawWidget(), and ErrmsgWindow::UpdateWidgetSize().
|
protected |
Extra error message shown in third line. Can be INVALID_STRING_ID.
Definition at line 40 of file error.h.
Referenced by ErrmsgWindow::DrawWidget(), and ErrmsgWindow::UpdateWidgetSize().
|
protected |
Company belonging to the face being shown. INVALID_COMPANY if no face present.
Definition at line 42 of file error.h.
Referenced by CopyOutDParams(), ErrmsgWindow::DrawWidget(), HasFace(), and ErrmsgWindow::OnInvalidateData().
|
protected |
Whether the error message is critical.
Definition at line 33 of file error.h.
Referenced by ErrmsgWindow::IsCritical(), and ErrmsgWindow::OnMouseLoop().
|
protected |
Backup of parameters of the message strings.
Definition at line 34 of file error.h.
Referenced by CopyOutDParams(), ErrmsgWindow::DrawWidget(), SetDParam(), SetDParamStr(), SetDParamStr(), ErrmsgWindow::SetStringParameters(), and ErrmsgWindow::UpdateWidgetSize().
|
protected |
Position of the error message window.
Definition at line 41 of file error.h.
Referenced by ErrorMessageData(), and ErrmsgWindow::OnInitialPosition().
|
protected |
General error message showed in first line. Must be valid.
Definition at line 38 of file error.h.
Referenced by ErrmsgWindow::DrawWidget(), ErrorMessageData(), and ErrmsgWindow::UpdateWidgetSize().
|
protected |
Values to put on the TextRefStack for the error message.
Definition at line 37 of file error.h.
Referenced by CopyOutDParams(), ErrmsgWindow::DrawWidget(), ErrorMessageData(), ErrorMessageData(), and ErrmsgWindow::UpdateWidgetSize().
|
protected |
NewGRF that filled the TextRefStack for the error message.
Definition at line 35 of file error.h.
Referenced by CopyOutDParams(), ErrmsgWindow::DrawWidget(), and ErrmsgWindow::UpdateWidgetSize().
|
protected |
Number of uint32_t values to put on the TextRefStack for the error message.
Definition at line 36 of file error.h.
Referenced by CopyOutDParams(), ErrmsgWindow::DrawWidget(), ErrorMessageData(), and ErrmsgWindow::UpdateWidgetSize().