summaryrefslogtreecommitdiff
path: root/src/error.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-05-14 20:58:59 +0000
committerfrosch <frosch@openttd.org>2012-05-14 20:58:59 +0000
commitfd6f92a4e893ff8a31df344d4b3f68d9a7ddef21 (patch)
tree5de559f3084a62acb2d461da3176bbdfc578dacc /src/error.h
parentc11d80148f2e48b2ab67569c4cce64d9af953eaf (diff)
downloadopenttd-fd6f92a4e893ff8a31df344d4b3f68d9a7ddef21.tar.xz
(svn r24248) -Codechange: Move ErrorMessageData class definition to header file.
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/error.h b/src/error.h
index 206bb67fb..83ac53d84 100644
--- a/src/error.h
+++ b/src/error.h
@@ -13,6 +13,8 @@
#define ERROR_H
#include "strings_type.h"
+#include "company_type.h"
+#include "core/geometry_type.hpp"
/** Message severity/type */
enum WarningLevel {
@@ -22,6 +24,25 @@ enum WarningLevel {
WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
};
+/** The data of the error message. */
+class ErrorMessageData {
+protected:
+ 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.
+ 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.
+
+public:
+ ErrorMessageData(const ErrorMessageData &data);
+ ~ErrorMessageData();
+ ErrorMessageData(StringID summary_msg, StringID detailed_msg, uint duration = 0, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
+};
+
void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
void ClearErrorMessages();
void ShowFirstError();