mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use parameterised GetString() for file windows.
parent
4389321623
commit
937fb12d9a
|
@ -490,8 +490,11 @@ public:
|
||||||
|
|
||||||
Rect ir = r.Shrink(WidgetDimensions::scaled.framerect);
|
Rect ir = r.Shrink(WidgetDimensions::scaled.framerect);
|
||||||
|
|
||||||
if (free_space.has_value()) SetDParam(0, free_space.value());
|
if (free_space.has_value()) {
|
||||||
DrawString(ir.left, ir.right, ir.top + GetCharacterHeight(FS_NORMAL), free_space.has_value() ? STR_SAVELOAD_BYTES_FREE : STR_ERROR_UNABLE_TO_READ_DRIVE);
|
DrawString(ir.left, ir.right, ir.top + GetCharacterHeight(FS_NORMAL), GetString(STR_SAVELOAD_BYTES_FREE, free_space.value()));
|
||||||
|
} else {
|
||||||
|
DrawString(ir.left, ir.right, ir.top + GetCharacterHeight(FS_NORMAL), STR_ERROR_UNABLE_TO_READ_DRIVE);
|
||||||
|
}
|
||||||
DrawString(ir.left, ir.right, ir.top, path, TC_BLACK);
|
DrawString(ir.left, ir.right, ir.top, path, TC_BLACK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -547,21 +550,17 @@ public:
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
} else if (_load_check_data.error != INVALID_STRING_ID) {
|
} else if (_load_check_data.error != INVALID_STRING_ID) {
|
||||||
/* Incompatible / broken savegame */
|
/* Incompatible / broken savegame */
|
||||||
SetDParamStr(0, _load_check_data.error_msg);
|
tr.top = DrawStringMultiLine(tr, GetString(_load_check_data.error, _load_check_data.error_msg), TC_RED);
|
||||||
tr.top = DrawStringMultiLine(tr, _load_check_data.error, TC_RED);
|
|
||||||
} else {
|
} else {
|
||||||
/* Mapsize */
|
/* Mapsize */
|
||||||
SetDParam(0, _load_check_data.map_size_x);
|
DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_MAP_SIZE, _load_check_data.map_size_x, _load_check_data.map_size_y));
|
||||||
SetDParam(1, _load_check_data.map_size_y);
|
|
||||||
DrawString(tr, STR_NETWORK_SERVER_LIST_MAP_SIZE);
|
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
if (tr.top > tr.bottom) return;
|
if (tr.top > tr.bottom) return;
|
||||||
|
|
||||||
/* Climate */
|
/* Climate */
|
||||||
LandscapeType landscape = _load_check_data.settings.game_creation.landscape;
|
LandscapeType landscape = _load_check_data.settings.game_creation.landscape;
|
||||||
if (to_underlying(landscape) < NUM_LANDSCAPE) {
|
if (to_underlying(landscape) < NUM_LANDSCAPE) {
|
||||||
SetDParam(0, STR_CLIMATE_TEMPERATE_LANDSCAPE + to_underlying(landscape));
|
DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_LANDSCAPE, STR_CLIMATE_TEMPERATE_LANDSCAPE + to_underlying(landscape)));
|
||||||
DrawString(tr, STR_NETWORK_SERVER_LIST_LANDSCAPE);
|
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,8 +569,7 @@ public:
|
||||||
|
|
||||||
/* Start date (if available) */
|
/* Start date (if available) */
|
||||||
if (_load_check_data.settings.game_creation.starting_year != 0) {
|
if (_load_check_data.settings.game_creation.starting_year != 0) {
|
||||||
SetDParam(0, TimerGameCalendar::ConvertYMDToDate(_load_check_data.settings.game_creation.starting_year, 0, 1));
|
DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_START_DATE, TimerGameCalendar::ConvertYMDToDate(_load_check_data.settings.game_creation.starting_year, 0, 1)));
|
||||||
DrawString(tr, STR_NETWORK_SERVER_LIST_START_DATE);
|
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
}
|
}
|
||||||
if (tr.top > tr.bottom) return;
|
if (tr.top > tr.bottom) return;
|
||||||
|
@ -579,8 +577,7 @@ public:
|
||||||
/* Hide current date for scenarios */
|
/* Hide current date for scenarios */
|
||||||
if (this->abstract_filetype != FT_SCENARIO) {
|
if (this->abstract_filetype != FT_SCENARIO) {
|
||||||
/* Current date */
|
/* Current date */
|
||||||
SetDParam(0, _load_check_data.current_date);
|
DrawString(tr, GetString(STR_NETWORK_SERVER_LIST_CURRENT_DATE, _load_check_data.current_date));
|
||||||
DrawString(tr, STR_NETWORK_SERVER_LIST_CURRENT_DATE);
|
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,9 +587,7 @@ public:
|
||||||
if (tr.top > tr.bottom) return;
|
if (tr.top > tr.bottom) return;
|
||||||
|
|
||||||
/* NewGrf compatibility */
|
/* NewGrf compatibility */
|
||||||
SetDParam(0, _load_check_data.grfconfig.empty() ? STR_NEWGRF_LIST_NONE :
|
DrawString(tr, GetString(STR_SAVELOAD_DETAIL_GRFSTATUS, _load_check_data.grfconfig.empty() ? STR_NEWGRF_LIST_NONE : STR_NEWGRF_LIST_ALL_FOUND + _load_check_data.grf_compatibility));
|
||||||
STR_NEWGRF_LIST_ALL_FOUND + _load_check_data.grf_compatibility);
|
|
||||||
DrawString(tr, STR_SAVELOAD_DETAIL_GRFSTATUS);
|
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
}
|
}
|
||||||
if (tr.top > tr.bottom) return;
|
if (tr.top > tr.bottom) return;
|
||||||
|
@ -604,16 +599,13 @@ public:
|
||||||
|
|
||||||
/* Companies / AIs */
|
/* Companies / AIs */
|
||||||
for (auto &pair : _load_check_data.companies) {
|
for (auto &pair : _load_check_data.companies) {
|
||||||
SetDParam(0, pair.first + 1);
|
|
||||||
const CompanyProperties &c = *pair.second;
|
const CompanyProperties &c = *pair.second;
|
||||||
if (!c.name.empty()) {
|
if (c.name.empty()) {
|
||||||
SetDParam(1, STR_JUST_RAW_STRING);
|
DrawString(tr, GetString(STR_SAVELOAD_DETAIL_COMPANY_INDEX, pair.first + 1, c.name_1, c.name_2));
|
||||||
SetDParamStr(2, c.name);
|
|
||||||
} else {
|
} else {
|
||||||
SetDParam(1, c.name_1);
|
DrawString(tr, GetString(STR_SAVELOAD_DETAIL_COMPANY_INDEX, pair.first + 1, STR_JUST_RAW_STRING, c.name));
|
||||||
SetDParam(2, c.name_2);
|
|
||||||
}
|
}
|
||||||
DrawString(tr, STR_SAVELOAD_DETAIL_COMPANY_INDEX);
|
|
||||||
tr.top += GetCharacterHeight(FS_NORMAL);
|
tr.top += GetCharacterHeight(FS_NORMAL);
|
||||||
if (tr.top > tr.bottom) break;
|
if (tr.top > tr.bottom) break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue