summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/ai_gui.cpp6
-rw-r--r--src/ai/ai_instance.cpp2
-rw-r--r--src/bridge_gui.cpp2
-rw-r--r--src/command.cpp8
-rw-r--r--src/company_gui.cpp8
-rw-r--r--src/gui.h2
-rw-r--r--src/heightmap.cpp14
-rw-r--r--src/industry_gui.cpp6
-rw-r--r--src/intro_gui.cpp4
-rw-r--r--src/misc_gui.cpp26
-rw-r--r--src/network/network_content.cpp6
-rw-r--r--src/network/network_content_gui.cpp4
-rw-r--r--src/newgrf_gui.cpp4
-rw-r--r--src/newgrf_industries.cpp2
-rw-r--r--src/openttd.cpp18
-rw-r--r--src/saveload/saveload.cpp4
-rw-r--r--src/settings.cpp16
-rw-r--r--src/settings_gui.cpp2
-rw-r--r--src/spriteloader/grf.cpp2
-rw-r--r--src/strings.cpp4
-rw-r--r--src/town_cmd.cpp4
-rw-r--r--src/town_gui.cpp2
-rw-r--r--src/train_cmd.cpp2
-rw-r--r--src/vehicle.cpp2
24 files changed, 75 insertions, 75 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 355cbbb00..e100b456c 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -178,7 +178,7 @@ struct AIListWindow : public Window {
case AIL_WIDGET_CONTENT_DOWNLOAD:
if (!_network_available) {
- ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERROR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0);
} else {
#if defined(ENABLE_NETWORK)
ShowNetworkContentListWindow(NULL, CONTENT_TYPE_AI);
@@ -365,7 +365,7 @@ struct AISettingsWindow : public Window {
if (_settings_newgame.difficulty.diff_level != 3) {
_settings_newgame.difficulty.diff_level = 3;
- ShowErrorMessage(INVALID_STRING_ID, STR_WARNING_DIFFICULTY_TO_CUSTOM, 0, 0);
+ ShowErrorMessage(STR_WARNING_DIFFICULTY_TO_CUSTOM, INVALID_STRING_ID, 0, 0);
}
} else if (!bool_item) {
/* Display a query box so users can enter a custom value. */
@@ -962,6 +962,6 @@ void ShowAIDebugWindow(CompanyID show_company)
if (w == NULL) w = new AIDebugWindow(&_ai_debug_desc, 0);
if (show_company != INVALID_COMPANY) w->ChangeToAI(show_company);
} else {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_AI_DEBUG_SERVER_ONLY, 0, 0);
+ ShowErrorMessage(STR_ERROR_AI_DEBUG_SERVER_ONLY, INVALID_STRING_ID, 0, 0);
}
}
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index d55ca085d..6ebaae46c 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -304,7 +304,7 @@ void AIInstance::Died()
const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo();
if (info != NULL) {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_AI_PLEASE_REPORT_CRASH, 0, 0);
+ ShowErrorMessage(STR_ERROR_AI_PLEASE_REPORT_CRASH, INVALID_STRING_ID, 0, 0);
if (info->GetURL() != NULL) {
AILog::Info("Please report the error to the following URL:");
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 259a7a843..0b57fb19d 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -416,6 +416,6 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
new BuildBridgeWindow(&_build_bridge_desc, start, end, type, bl);
} else {
delete bl;
- ShowErrorMessage(errmsg, STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, TileX(end) * TILE_SIZE, TileY(end) * TILE_SIZE);
+ ShowErrorMessage(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, errmsg, TileX(end) * TILE_SIZE, TileY(end) * TILE_SIZE);
}
}
diff --git a/src/command.cpp b/src/command.cpp
index 00e1d32d1..8cc6ad77c 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -535,7 +535,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
* The server will ditch any server commands a client sends to it, so effectively
* this guards the server from executing functions for an invalid company. */
if (_game_mode == GM_NORMAL && (cmd_flags & (CMD_SPECTATOR | CMD_SERVER)) == 0 && !Company::IsValidID(_current_company)) {
- if (my_cmd) ShowErrorMessage(_error_message, error_part1, x, y);
+ if (my_cmd) ShowErrorMessage(error_part1, _error_message, x, y);
return false;
}
@@ -555,7 +555,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
SetTownRatingTestMode(false);
if (CmdFailed(res)) {
res.SetGlobalErrorMessage();
- ShowErrorMessage(_error_message, error_part1, x, y);
+ ShowErrorMessage(error_part1, _error_message, x, y);
} else {
ShowEstimatedCostOrIncome(res.GetCost(), x, y);
}
@@ -626,7 +626,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
if (res2.GetCost() != 0 && tile != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
if (_additional_cash_required != 0) {
SetDParam(0, _additional_cash_required);
- if (my_cmd) ShowErrorMessage(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY, error_part1, x, y);
+ if (my_cmd) ShowErrorMessage(error_part1, STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY, x, y);
if (res2.GetCost() == 0) goto callb_err;
}
}
@@ -640,7 +640,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
show_error:
/* show error message if the command fails? */
if (IsLocalCompany() && error_part1 != 0 && my_cmd) {
- ShowErrorMessage(_error_message, error_part1, x, y);
+ ShowErrorMessage(error_part1, _error_message, x, y);
}
callb_err:
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index edd61db8a..f6e242033 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -1282,7 +1282,7 @@ public:
case SCMFW_WIDGET_LOAD:
this->face = _company_manager_face;
ScaleAllCompanyManagerFaceBits(this->face);
- ShowErrorMessage(INVALID_STRING_ID, STR_FACE_LOAD_DONE, 0, 0);
+ ShowErrorMessage(STR_FACE_LOAD_DONE, INVALID_STRING_ID, 0, 0);
this->UpdateData();
this->SetDirty();
break;
@@ -1296,7 +1296,7 @@ public:
/* Save button */
case SCMFW_WIDGET_SAVE:
_company_manager_face = this->face;
- ShowErrorMessage(INVALID_STRING_ID, STR_FACE_SAVE_DONE, 0, 0);
+ ShowErrorMessage(STR_FACE_SAVE_DONE, INVALID_STRING_ID, 0, 0);
break;
/* Toggle gender (male/female) button */
@@ -1372,11 +1372,11 @@ public:
if (!StrEmpty(str)) {
this->face = strtoul(str, NULL, 10);
ScaleAllCompanyManagerFaceBits(this->face);
- ShowErrorMessage(INVALID_STRING_ID, STR_FACE_FACECODE_SET, 0, 0);
+ ShowErrorMessage(STR_FACE_FACECODE_SET, INVALID_STRING_ID, 0, 0);
this->UpdateData();
this->SetDirty();
} else {
- ShowErrorMessage(INVALID_STRING_ID, STR_FACE_FACECODE_ERR, 0, 0);
+ ShowErrorMessage(STR_FACE_FACECODE_ERR, INVALID_STRING_ID, 0, 0);
}
}
};
diff --git a/src/gui.h b/src/gui.h
index 4600219cc..5e7fc5354 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -65,7 +65,7 @@ void ShowIndustryDirectory();
void ShowSubsidiesList();
void ShowEstimatedCostOrIncome(Money cost, int x, int y);
-void ShowErrorMessage(StringID detailed_msg, StringID summary_msg, int x, int y, bool no_timeout = false);
+void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, int x, int y, bool no_timeout = false);
void ShowSmallMap();
void ShowExtraViewPortWindow(TileIndex tile = INVALID_TILE);
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index f5f71338c..089d96d46 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -107,20 +107,20 @@ static bool ReadHeightmapPNG(char *filename, uint *x, uint *y, byte **map)
fp = FioFOpenFile(filename, "rb");
if (fp == NULL) {
- ShowErrorMessage(STR_ERROR_PNGMAP_FILE_NOT_FOUND, STR_ERROR_PNGMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_PNGMAP, STR_ERROR_PNGMAP_FILE_NOT_FOUND, 0, 0);
return false;
}
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) {
- ShowErrorMessage(STR_ERROR_PNGMAP_MISC, STR_ERROR_PNGMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_PNGMAP, STR_ERROR_PNGMAP_MISC, 0, 0);
fclose(fp);
return false;
}
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL || setjmp(png_jmpbuf(png_ptr))) {
- ShowErrorMessage(STR_ERROR_PNGMAP_MISC, STR_ERROR_PNGMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_PNGMAP, STR_ERROR_PNGMAP_MISC, 0, 0);
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return false;
@@ -136,7 +136,7 @@ static bool ReadHeightmapPNG(char *filename, uint *x, uint *y, byte **map)
/* Maps of wrong colour-depth are not used.
* (this should have been taken care of by stripping alpha and 16-bit samples on load) */
if ((info_ptr->channels != 1) && (info_ptr->channels != 3) && (info_ptr->bit_depth != 8)) {
- ShowErrorMessage(STR_ERROR_PNGMAP_IMAGE_TYPE, STR_ERROR_PNGMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_PNGMAP, STR_ERROR_PNGMAP_IMAGE_TYPE, 0, 0);
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return false;
@@ -230,14 +230,14 @@ static bool ReadHeightmapBMP(char *filename, uint *x, uint *y, byte **map)
f = FioFOpenFile(filename, "rb");
if (f == NULL) {
- ShowErrorMessage(STR_ERROR_PNGMAP_FILE_NOT_FOUND, STR_ERROR_BMPMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_BMPMAP, STR_ERROR_PNGMAP_FILE_NOT_FOUND, 0, 0);
return false;
}
BmpInitializeBuffer(&buffer, f);
if (!BmpReadHeader(&buffer, &info, &data)) {
- ShowErrorMessage(STR_ERROR_BMPMAP_IMAGE_TYPE, STR_ERROR_BMPMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_BMPMAP, STR_ERROR_BMPMAP_IMAGE_TYPE, 0, 0);
fclose(f);
BmpDestroyData(&data);
return false;
@@ -245,7 +245,7 @@ static bool ReadHeightmapBMP(char *filename, uint *x, uint *y, byte **map)
if (map != NULL) {
if (!BmpReadBitmap(&buffer, &info, &data)) {
- ShowErrorMessage(STR_ERROR_BMPMAP_IMAGE_TYPE, STR_ERROR_BMPMAP, 0, 0);
+ ShowErrorMessage(STR_ERROR_BMPMAP, STR_ERROR_BMPMAP_IMAGE_TYPE, 0, 0);
fclose(f);
BmpDestroyData(&data);
return false;
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index f21fda155..d1d614af4 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -427,7 +427,7 @@ public:
this->HandleButtonClick(DPIW_FUND_WIDGET);
if (Town::GetNumItems() == 0) {
- ShowErrorMessage(STR_ERROR_MUST_FOUND_TOWN_FIRST, STR_ERROR_CAN_T_GENERATE_INDUSTRIES, 0, 0);
+ ShowErrorMessage(STR_ERROR_CAN_T_GENERATE_INDUSTRIES, STR_ERROR_MUST_FOUND_TOWN_FIRST, 0, 0);
} else {
extern void GenerateIndustries();
_generating_world = true;
@@ -462,7 +462,7 @@ public:
/* Show error if no town exists at all */
if (Town::GetNumItems() == 0) {
SetDParam(0, indsp->name);
- ShowErrorMessage(STR_ERROR_MUST_FOUND_TOWN_FIRST, STR_ERROR_CAN_T_BUILD_HERE, pt.x, pt.y);
+ ShowErrorMessage(STR_ERROR_CAN_T_BUILD_HERE, STR_ERROR_MUST_FOUND_TOWN_FIRST, pt.x, pt.y);
return;
}
@@ -472,7 +472,7 @@ public:
success = DoCommandP(tile, (InteractiveRandomRange(indsp->num_table) << 8) | this->selected_type, seed, CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY));
if (!success) {
SetDParam(0, indsp->name);
- ShowErrorMessage(_error_message, STR_ERROR_CAN_T_BUILD_HERE, pt.x, pt.y);
+ ShowErrorMessage(STR_ERROR_CAN_T_BUILD_HERE, _error_message, pt.x, pt.y);
}
_ignore_restrictions = false;
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp
index 7f7bd72d0..ce636f61a 100644
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -122,7 +122,7 @@ struct SelectGameWindow : public Window {
case SGI_PLAY_NETWORK:
if (!_network_available) {
- ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERROR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0);
} else {
ShowNetworkGameWindow();
}
@@ -141,7 +141,7 @@ struct SelectGameWindow : public Window {
case SGI_GRF_SETTINGS: ShowNewGRFSettings(true, true, false, &_grfconfig_newgame); break;
case SGI_CONTENT_DOWNLOAD:
if (!_network_available) {
- ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERROR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0);
} else {
ShowNetworkContentListWindow();
}
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index af14cda7a..a0b5155a8 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -556,22 +556,22 @@ struct ErrmsgWindow : public Window {
private:
uint duration; ///< Length of display of the message. 0 means forever,
uint64 decode_params[20]; ///< Parameters of the message strings.
- StringID detailed_msg; ///< Detailed error message showed in second line. Can be #INVALID_STRING_ID.
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.
bool show_company_manager_face; ///< Display the face of the manager in the window.
- Rect area_detailed; ///< Area available for #detailed_msg in the #EMW_MESSAGE widget.
Rect area_summary; ///< Area available for #summary_msg in the #EMW_MESSAGE widget.
+ Rect area_detailed; ///< Area available for #detailed_msg in the #EMW_MESSAGE widget.
public:
- ErrmsgWindow(Point pt, int width, int height, StringID detailed_msg, StringID summary_msg, const Widget *widget, bool show_company_manager_face, bool no_timeout) :
+ ErrmsgWindow(Point pt, int width, int height, StringID summary_msg, StringID detailed_msg, const Widget *widget, bool show_company_manager_face, bool no_timeout) :
Window(pt.x, pt.y, width, height, WC_ERRMSG, widget),
show_company_manager_face(show_company_manager_face)
{
this->duration = no_timeout ? 0 : _settings_client.gui.errmsg_duration;
CopyOutDParam(this->decode_params, 0, lengthof(this->decode_params));
- this->detailed_msg = detailed_msg;
this->summary_msg = summary_msg;
+ this->detailed_msg = detailed_msg;
this->desc_flags = WDF_STD_BTN | WDF_DEF_WIDGET;
SwitchToErrorRefStack();
@@ -596,10 +596,10 @@ public:
this->area_summary.bottom = height - WD_FRAMERECT_BOTTOM;
} else {
int over = (height - h) / 2;
- this->area_detailed.bottom = height - WD_FRAMERECT_BOTTOM;
- this->area_detailed.top = this->area_detailed.bottom - height_detailed - over;
this->area_summary.top = this->widget[EMW_MESSAGE].top + WD_FRAMERECT_TOP;
this->area_summary.bottom = this->area_summary.top + height_summary + over;
+ this->area_detailed.bottom = height - WD_FRAMERECT_BOTTOM;
+ this->area_detailed.top = this->area_detailed.bottom - height_detailed - over;
}
this->FindWindowPlacementAndResize(width, height);
@@ -663,13 +663,13 @@ public:
/**
* Display an error message in a window.
- * @param detailed_msg Detailed error message showed in second line. Can be INVALID_STRING_ID.
* @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 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 detailed_msg, StringID summary_msg, int x, int y, bool no_timeout)
+void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, int x, int y, bool no_timeout)
{
static Widget *generated_errmsg_widgets = NULL;
static Widget *generated_errmsg_face_widgets = NULL;
@@ -703,7 +703,7 @@ void ShowErrorMessage(StringID detailed_msg, StringID summary_msg, int x, int y,
const Widget *wid = InitializeWidgetArrayFromNestedWidgets(_nested_errmsg_widgets, lengthof(_nested_errmsg_widgets),
_errmsg_widgets, &generated_errmsg_widgets);
- new ErrmsgWindow(pt, 240, 46, detailed_msg, summary_msg, wid, false, no_timeout);
+ new ErrmsgWindow(pt, 240, 46, summary_msg, detailed_msg, wid, false, no_timeout);
} else {
if ((x | y) != 0) {
pt = RemapCoords2(x, y);
@@ -717,7 +717,7 @@ void ShowErrorMessage(StringID detailed_msg, StringID summary_msg, int x, int y,
const Widget *wid = InitializeWidgetArrayFromNestedWidgets(_nested_errmsg_face_widgets, lengthof(_nested_errmsg_face_widgets),
_errmsg_face_widgets, &generated_errmsg_face_widgets);
- new ErrmsgWindow(pt, 334, 137, detailed_msg, summary_msg, wid, true, no_timeout);
+ new ErrmsgWindow(pt, 334, 137, summary_msg, detailed_msg, wid, true, no_timeout);
}
}
@@ -730,7 +730,7 @@ void ShowEstimatedCostOrIncome(Money cost, int x, int y)
msg = STR_MESSAGE_ESTIMATED_INCOME;
}
SetDParam(0, cost);
- ShowErrorMessage(INVALID_STRING_ID, msg, x, y);
+ ShowErrorMessage(msg, INVALID_STRING_ID, x, y);
}
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
@@ -1990,7 +1990,7 @@ public:
case SLWW_CONTENT_DOWNLOAD:
if (!_network_available) {
- ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERROR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0);
} else {
#if defined(ENABLE_NETWORK)
switch (_saveload_mode) {
@@ -2038,7 +2038,7 @@ public:
if (this->IsWidgetLowered(SLWW_DELETE_SELECTION)) { // Delete button clicked
if (!FiosDelete(this->text.buf)) {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_UNABLE_TO_DELETE_FILE, 0, 0);
+ ShowErrorMessage(STR_ERROR_UNABLE_TO_DELETE_FILE, INVALID_STRING_ID, 0, 0);
} else {
BuildFileList();
/* Reset file name to current date on successful delete */
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index 529ece802..5b2ce2258 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -382,7 +382,7 @@ DEF_CONTENT_RECEIVE_COMMAND(Client, PACKET_CONTENT_SERVER_CONTENT)
if (filename == NULL) {
/* Unless that fails ofcourse... */
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
- ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, 0, 0);
+ ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, 0, 0);
this->Close();
return false;
}
@@ -394,7 +394,7 @@ DEF_CONTENT_RECEIVE_COMMAND(Client, PACKET_CONTENT_SERVER_CONTENT)
size_t toRead = (size_t)(p->size - p->pos);
if (fwrite(p->buffer + p->pos, 1, toRead, this->curFile) != toRead) {
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
- ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, 0, 0);
+ ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, 0, 0);
this->Close();
fclose(this->curFile);
this->curFile = NULL;
@@ -417,7 +417,7 @@ DEF_CONTENT_RECEIVE_COMMAND(Client, PACKET_CONTENT_SERVER_CONTENT)
this->OnDownloadComplete(this->curInfo->id);
} else {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONTENT_ERROR_COULD_NOT_EXTRACT, 0, 0);
+ ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_EXTRACT, INVALID_STRING_ID, 0, 0);
}
}
}
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 80631f17f..2e07a7bc7 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -755,7 +755,7 @@ public:
virtual void OnConnect(bool success)
{
if (!success) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONTENT_ERROR_COULD_NOT_CONNECT, 0, 0);
+ ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_CONNECT, INVALID_STRING_ID, 0, 0);
delete this;
}
@@ -895,7 +895,7 @@ void ShowNetworkContentListWindow(ContentVector *cv, ContentType type)
DeleteWindowById(WC_NETWORK_WINDOW, 1);
new NetworkContentListWindow(&_network_content_list_desc, cv != NULL);
#else
- ShowErrorMessage(STR_CONTENT_NO_ZLIB_SUB, STR_CONTENT_NO_ZLIB, 0, 0);
+ ShowErrorMessage(STR_CONTENT_NO_ZLIB, STR_CONTENT_NO_ZLIB_SUB, 0, 0);
/* Connection failed... clean up the mess */
if (cv != NULL) {
for (ContentIterator iter = cv->Begin(); iter != cv->End(); iter++) delete *iter;
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 5319b1c3f..579193c29 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -353,7 +353,7 @@ public:
/* Find last entry in the list, checking for duplicate grfid on the way */
for (list = this->list; *list != NULL; list = &(*list)->next) {
if ((*list)->grfid == src->grfid) {
- ShowErrorMessage(INVALID_STRING_ID, STR_NEWGRF_DUPLICATE_GRFID, 0, 0);
+ ShowErrorMessage(STR_NEWGRF_DUPLICATE_GRFID, INVALID_STRING_ID, 0, 0);
return;
}
}
@@ -835,7 +835,7 @@ struct NewGRFWindow : public Window {
case SNGRFS_CONTENT_DOWNLOAD:
if (!_network_available) {
- ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERROR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0);
} else {
#if defined(ENABLE_NETWORK)
/* Only show the things in the current list, or everything when nothing's selected */
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index e361f65f4..04b1a47ad 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -529,7 +529,7 @@ void IndustryProductionCallback(Industry *ind, int reason)
/* display error message */
SetDParamStr(0, spec->grf_prop.grffile->filename);
SetDParam(1, spec->name);
- ShowErrorMessage(STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK, STR_NEWGRF_BUGGY, 0, 0);
+ ShowErrorMessage(STR_NEWGRF_BUGGY, STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK, 0, 0);
/* abort the function early, this error isn't critical and will allow the game to continue to run */
break;
diff --git a/src/openttd.cpp b/src/openttd.cpp
index dd7b3bd09..9bdb76258 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -777,9 +777,9 @@ static void ShowScreenshotResult(bool b)
if (b) {
extern char _screenshot_name[];
SetDParamStr(0, _screenshot_name);
- ShowErrorMessage(INVALID_STRING_ID, STR_MESSAGE_SCREENSHOT_SUCCESSFULLY, 0, 0);
+ ShowErrorMessage(STR_MESSAGE_SCREENSHOT_SUCCESSFULLY, INVALID_STRING_ID, 0, 0);
} else {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_SCREENSHOT_FAILED, 0, 0);
+ ShowErrorMessage(STR_ERROR_SCREENSHOT_FAILED, INVALID_STRING_ID, 0, 0);
}
}
@@ -866,7 +866,7 @@ static void StartScenario()
if (_file_to_saveload.mode == SL_INVALID) {
DEBUG(sl, 0, "Savegame is obsolete or invalid format: '%s'", _file_to_saveload.name);
SetDParamStr(0, GetSaveLoadErrorString());
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
_game_mode = GM_MENU;
return;
}
@@ -882,7 +882,7 @@ static void StartScenario()
if (SaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, SCENARIO_DIR) != SL_OK) {
LoadIntroGame();
SetDParamStr(0, GetSaveLoadErrorString());
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
}
_settings_game.difficulty = _settings_newgame.difficulty;
@@ -998,7 +998,7 @@ void SwitchToMode(SwitchMode new_mode)
if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL, NO_DIRECTORY)) {
LoadIntroGame();
SetDParamStr(0, GetSaveLoadErrorString());
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
} else {
if (_saveload_mode == SLD_LOAD_SCENARIO) {
StartupEngines();
@@ -1041,7 +1041,7 @@ void SwitchToMode(SwitchMode new_mode)
_settings_newgame.game_creation.starting_year = _cur_year;
} else {
SetDParamStr(0, GetSaveLoadErrorString());
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
}
break;
}
@@ -1054,7 +1054,7 @@ void SwitchToMode(SwitchMode new_mode)
/* Make network saved games on pause compatible to singleplayer */
if (SaveOrLoad(_file_to_saveload.name, SL_SAVE, NO_DIRECTORY) != SL_OK) {
SetDParamStr(0, GetSaveLoadErrorString());
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
} else {
DeleteWindowById(WC_SAVELOAD, 0);
}
@@ -1071,7 +1071,7 @@ void SwitchToMode(SwitchMode new_mode)
}
if (_switch_mode_errorstr != INVALID_STRING_ID) {
- ShowErrorMessage(INVALID_STRING_ID, _switch_mode_errorstr, 0, 0, true);
+ ShowErrorMessage(_switch_mode_errorstr, INVALID_STRING_ID, 0, 0, true);
}
}
@@ -1219,7 +1219,7 @@ static void DoAutosave()
DEBUG(sl, 2, "Autosaving to '%s'", buf);
if (SaveOrLoad(buf, SL_SAVE, AUTOSAVE_DIR) != SL_OK) {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_AUTOSAVE_FAILED, 0, 0);
+ ShowErrorMessage(STR_ERROR_AUTOSAVE_FAILED, INVALID_STRING_ID, 0, 0);
}
}
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index f423d2c46..8fe0a2e93 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -1697,7 +1697,7 @@ const char *GetSaveLoadErrorString()
static void SaveFileError()
{
SetDParamStr(0, GetSaveLoadErrorString());
- ShowErrorMessage(STR_JUST_RAW_STRING, STR_NULL, 0, 0);
+ ShowErrorMessage(STR_NULL, STR_JUST_RAW_STRING, 0, 0);
SaveFileDone();
}
@@ -1791,7 +1791,7 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, boo
/* An instance of saving is already active, so don't go saving again */
if (_ts.saveinprogress && mode == SL_SAVE) {
/* if not an autosave, but a user action, show error message */
- if (!_do_autosave) ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_SAVE_STILL_IN_PROGRESS, 0, 0);
+ if (!_do_autosave) ShowErrorMessage(STR_ERROR_SAVE_STILL_IN_PROGRESS, INVALID_STRING_ID, 0, 0);
return SL_OK;
}
WaitTillSaved();
diff --git a/src/settings.cpp b/src/settings.cpp
index 9dfac0e32..25f95645c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -813,7 +813,7 @@ static bool DifficultyChange(int32)
{
if (_game_mode == GM_MENU) {
if (_settings_newgame.difficulty.diff_level != 3) {
- ShowErrorMessage(INVALID_STRING_ID, STR_WARNING_DIFFICULTY_TO_CUSTOM, 0, 0);
+ ShowErrorMessage(STR_WARNING_DIFFICULTY_TO_CUSTOM, INVALID_STRING_ID, 0, 0);
_settings_newgame.difficulty.diff_level = 3;
}
SetWindowClassesDirty(WC_SELECT_GAME);
@@ -888,14 +888,14 @@ static bool CheckFreeformEdges(int32 p1)
Ship *s;
FOR_ALL_SHIPS(s) {
if (TileX(s->tile) == 0 || TileY(s->tile) == 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_EDGES_NOT_EMPTY, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_EDGES_NOT_EMPTY, INVALID_STRING_ID, 0, 0);
return false;
}
}
Station *st;
FOR_ALL_STATIONS(st) {
if (TileX(st->xy) == 0 || TileY(st->xy) == 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_EDGES_NOT_EMPTY, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_EDGES_NOT_EMPTY, INVALID_STRING_ID, 0, 0);
return false;
}
}
@@ -904,25 +904,25 @@ static bool CheckFreeformEdges(int32 p1)
} else {
for (uint i = 0; i < MapMaxX(); i++) {
if (TileHeight(TileXY(i, 1)) != 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_EDGES_NOT_WATER, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_EDGES_NOT_WATER, INVALID_STRING_ID, 0, 0);
return false;
}
}
for (uint i = 1; i < MapMaxX(); i++) {
if (!IsTileType(TileXY(i, MapMaxY() - 1), MP_WATER) || TileHeight(TileXY(1, MapMaxY())) != 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_EDGES_NOT_WATER, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_EDGES_NOT_WATER, INVALID_STRING_ID, 0, 0);
return false;
}
}
for (uint i = 0; i < MapMaxY(); i++) {
if (TileHeight(TileXY(1, i)) != 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_EDGES_NOT_WATER, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_EDGES_NOT_WATER, INVALID_STRING_ID, 0, 0);
return false;
}
}
for (uint i = 1; i < MapMaxY(); i++) {
if (!IsTileType(TileXY(MapMaxX() - 1, i), MP_WATER) || TileHeight(TileXY(MapMaxX(), i)) != 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_EDGES_NOT_WATER, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_EDGES_NOT_WATER, INVALID_STRING_ID, 0, 0);
return false;
}
}
@@ -951,7 +951,7 @@ static bool ChangeDynamicEngines(int32 p1)
const Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (IsCompanyBuildableVehicleType(v)) {
- ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES, 0, 0);
+ ShowErrorMessage(STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES, INVALID_STRING_ID, 0, 0);
return false;
}
}
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 41858e3d3..5611f27a5 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -315,7 +315,7 @@ struct GameOptionsWindow : Window {
case GOW_FULLSCREEN_BUTTON: // Click fullscreen on/off
/* try to toggle full-screen on/off */
if (!ToggleFullScreen(!_fullscreen)) {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_FULLSCREEN_FAILED, 0, 0);
+ ShowErrorMessage(STR_ERROR_FULLSCREEN_FAILED, INVALID_STRING_ID, 0, 0);
}
this->SetWidgetLoweredState(GOW_FULLSCREEN_BUTTON, _fullscreen);
this->SetDirty();
diff --git a/src/spriteloader/grf.cpp b/src/spriteloader/grf.cpp
index 14151dce3..3b1ccc5f3 100644
--- a/src/spriteloader/grf.cpp
+++ b/src/spriteloader/grf.cpp
@@ -31,7 +31,7 @@ static bool WarnCorruptSprite(uint8 file_slot, size_t file_pos, int line)
static byte warning_level = 0;
if (warning_level == 0) {
SetDParamStr(0, FioGetFilename(file_slot));
- ShowErrorMessage(INVALID_STRING_ID, STR_NEWGRF_ERROR_CORRUPT_SPRITE, 0, 0);
+ ShowErrorMessage(STR_NEWGRF_ERROR_CORRUPT_SPRITE, INVALID_STRING_ID, 0, 0);
}
DEBUG(sprite, warning_level, "[%i] Loading corrupted sprite from %s at position %i", line, FioGetFilename(file_slot), (int)file_pos);
warning_level = 6;
diff --git a/src/strings.cpp b/src/strings.cpp
index 7c1b082f6..f22603261 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -1577,7 +1577,7 @@ void CheckForMissingGlyphsInLoadedLanguagePack()
static char *err_str = strdup("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this.");
Utf8Encode(err_str, SCC_YELLOW);
SetDParamStr(0, err_str);
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
/* Reset the font width */
LoadStringWidthTable();
@@ -1610,7 +1610,7 @@ void CheckForMissingGlyphsInLoadedLanguagePack()
static char *err_str = strdup("XXXThis version of OpenTTD does not support right-to-left languages. Recompile with icu enabled.");
Utf8Encode(err_str, SCC_YELLOW);
SetDParamStr(0, err_str);
- ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+ ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, 0, 0);
}
#endif
}
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 85920161e..975eeda63 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2291,7 +2291,7 @@ void ExpandTown(Town *t)
* but do this only onces per openttd run. */
static bool warned_no_roads = false;
if (!_settings_game.economy.allow_town_roads && !warned_no_roads) {
- ShowErrorMessage(INVALID_STRING_ID, STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS, 0, 0);
+ ShowErrorMessage(STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS, INVALID_STRING_ID, 0, 0);
warned_no_roads = true;
}
@@ -2435,7 +2435,7 @@ static void TownActionBribe(Town *t)
/* only show errormessage to the executing player. All errors are handled command.c
* but this is special, because it can only 'fail' on a DC_EXEC */
- if (IsLocalCompany()) ShowErrorMessage(STR_ERROR_BRIBE_FAILED_2, STR_ERROR_BRIBE_FAILED, 0, 0);
+ if (IsLocalCompany()) ShowErrorMessage(STR_ERROR_BRIBE_FAILED, STR_ERROR_BRIBE_FAILED_2, 0, 0);
/* decrease by a lot!
* ChangeTownRating is only for stuff in demolishing. Bribe failure should
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index a2e6abb69..8b6733416 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -1046,7 +1046,7 @@ public:
_generating_world = true;
UpdateNearestTownForRoadTiles(true);
if (!GenerateTowns(this->town_layout)) {
- ShowErrorMessage(STR_ERROR_NO_SPACE_FOR_TOWN, STR_ERROR_CAN_T_GENERATE_TOWN, 0, 0);
+ ShowErrorMessage(STR_ERROR_CAN_T_GENERATE_TOWN, STR_ERROR_NO_SPACE_FOR_TOWN, 0, 0);
}
UpdateNearestTownForRoadTiles(false);
_generating_world = false;
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 2cb2541c0..1dd977353 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -198,7 +198,7 @@ void CheckTrainsLengths()
(w->track == TRACK_BIT_DEPOT && TicksToLeaveDepot(u) <= 0)) {
SetDParam(0, v->index);
SetDParam(1, v->owner);
- ShowErrorMessage(INVALID_STRING_ID, STR_BROKEN_VEHICLE_LENGTH, 0, 0, true);
+ ShowErrorMessage(STR_BROKEN_VEHICLE_LENGTH, INVALID_STRING_ID, 0, 0, true);
if (!_networking) DoCommandP(0, PM_PAUSED_ERROR, 1, CMD_PAUSE);
}
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 2914c4393..9cee5abd6 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -130,7 +130,7 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF
SetBit(grfconfig->grf_bugs, bug_type);
SetDParamStr(0, grfconfig->name);
SetDParam(1, engine);
- ShowErrorMessage(part2, part1, 0, 0, true);
+ ShowErrorMessage(part1, part2, 0, 0, true);
if (!_networking) DoCommand(0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1, DC_EXEC, CMD_PAUSE);
}