summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-02-24 14:46:15 +0000
committersmatz <smatz@openttd.org>2010-02-24 14:46:15 +0000
commitf051066bc451479a0c2ff44e2554941628a62f6a (patch)
tree239197109c12b15a24e9ae8ab70a7549e34d4a8b /src/misc_gui.cpp
parentc1e2bc90cd3751dfa316519cfe2f558aa2697b2c (diff)
downloadopenttd-f051066bc451479a0c2ff44e2554941628a62f6a.tar.xz
(svn r19224) -Codechange: change parameters passed to ShowErrorMessage() a bit
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index c456394f6..0e9a75162 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -33,6 +33,7 @@
#include "window_func.h"
#include "tilehighlight_func.h"
#include "querystring_gui.h"
+#include "console_func.h"
#include "core/geometry_func.hpp"
#include "table/strings.h"
@@ -690,14 +691,16 @@ public:
* Display an error message in a window.
* @param summary_msg General error message showed in first line. Must be valid.
* @param detailed_msg Detailed error message showed in second line. Can be INVALID_STRING_ID.
+ * @param wl Message severity
* @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 the error location. Set both x and y to 0 to just center the message when there is no related error tile.
- * @param no_timeout Set to true, if the message is that important that it should not close automatically after some time.
*/
-void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, int x, int y, bool no_timeout)
+void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x, int y)
{
DeleteWindowById(WC_ERRMSG, 0);
+ bool no_timeout = wl == WL_CRITICAL;
+
if (_settings_client.gui.errmsg_duration == 0 && !no_timeout) return;
if (summary_msg == STR_NULL) summary_msg = STR_EMPTY;
@@ -716,7 +719,7 @@ void ShowEstimatedCostOrIncome(Money cost, int x, int y)
msg = STR_MESSAGE_ESTIMATED_INCOME;
}
SetDParam(0, cost);
- ShowErrorMessage(msg, INVALID_STRING_ID, x, y);
+ ShowErrorMessage(msg, INVALID_STRING_ID, WL_INFO, x, y);
}
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
@@ -1874,7 +1877,7 @@ public:
case SLWW_CONTENT_DOWNLOAD:
if (!_network_available) {
- ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0);
+ ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, WL_ERROR);
} else {
#if defined(ENABLE_NETWORK)
switch (_saveload_mode) {
@@ -1922,7 +1925,7 @@ public:
if (this->IsWidgetLowered(SLWW_DELETE_SELECTION)) { // Delete button clicked
if (!FiosDelete(this->text.buf)) {
- ShowErrorMessage(STR_ERROR_UNABLE_TO_DELETE_FILE, INVALID_STRING_ID, 0, 0);
+ ShowErrorMessage(STR_ERROR_UNABLE_TO_DELETE_FILE, INVALID_STRING_ID, WL_ERROR);
} else {
BuildFileList();
/* Reset file name to current date on successful delete */