MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShowErrorMessage

Function ShowErrorMessage

src/error_gui.cpp:296–303  ·  view source on GitHub ↗

* Display an error message in a window. * Note: CommandCost errors are always severity level WL_INFO. * @param summary_msg General error message showed in first line. Must be valid. * @param 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. * @param y World Y position (TileVirtY) of

Source from the content-addressed store, hash-verified

294 * @param cc CommandCost containing the optional detailed and extra error messages shown in the second and third lines (can be empty).
295 */
296void ShowErrorMessage(EncodedString &&summary_msg, int x, int y, CommandCost &cc)
297{
298 EncodedString error = std::move(cc.GetEncodedMessage());
299 if (error.empty()) error = GetEncodedStringIfValid(cc.GetErrorMessage());
300
301 ShowErrorMessage(std::move(summary_msg), std::move(error), WL_INFO, x, y,
302 GetEncodedStringIfValid(cc.GetExtraErrorMessage()), cc.GetErrorOwner());
303}
304
305/**
306 * Display an error message in a window.

Callers 15

OnClickMethod · 0.85
OnClickMethod · 0.85
GraphicsSetLoadConfigFunction · 0.85
GRFLoadConfigFunction · 0.85
CmdBuildIndustryFunction · 0.85
CheckIndustriesFunction · 0.85
SwitchToModeFunction · 0.85
ShowNewGRFErrorFunction · 0.85
OnClickMethod · 0.85
AddGRFToActiveMethod · 0.85
CheckForMissingGlyphsFunction · 0.85

Calls 11

GetEncodedStringIfValidFunction · 0.85
FindWindowByIdFunction · 0.85
GetErrorMessageMethod · 0.80
GetExtraErrorMessageMethod · 0.80
GetErrorOwnerMethod · 0.80
GetDecodedStringMethod · 0.80
IsCriticalMethod · 0.80
push_backMethod · 0.80
IConsolePrintFunction · 0.70
emptyMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected