* 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
| 294 | * @param cc CommandCost containing the optional detailed and extra error messages shown in the second and third lines (can be empty). |
| 295 | */ |
| 296 | void 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. |
no test coverage detected