(svn r19224) -Codechange: change parameters passed to ShowErrorMessage() a bit

This commit is contained in:
smatz
2010-02-24 14:46:15 +00:00
parent 0db792f467
commit 5504b1105e
27 changed files with 83 additions and 71 deletions

View File

@@ -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 */