Merge commit 'a8b575671894ffe1329ef37dca4989c0e60d70f5'
These merges are becoming more awful every time Conflicts: src/ai/ai_gui.cpp src/build_vehicle_gui.cpp src/cheat_gui.cpp src/company_gui.cpp src/depot_gui.cpp src/dock_gui.cpp src/error_gui.cpp src/genworld_gui.cpp src/misc_gui.cpp src/network/network_content_gui.cpp src/network/network_gui.cpp src/newgrf_gui.cpp src/news_gui.cpp src/rail_gui.cpp src/rev.cpp.in src/road_gui.cpp src/settings_gui.cpp src/settings_gui.h src/signs_gui.cpp src/station_gui.cpp src/table/settings.ini src/terraform_gui.cpp src/toolbar_gui.cpp src/toolbar_gui.h src/vehicle_gui.cpp src/video/sdl_v.cpp src/viewport.cpp src/widget.cpp src/widgets/settings_widget.h
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "window_func.h"
|
||||
#include "debug.h"
|
||||
#include "game/game_text.hpp"
|
||||
#include "network/network_content_gui.h"
|
||||
#include <stack>
|
||||
|
||||
#include "table/strings.h"
|
||||
@@ -48,9 +49,9 @@ const LanguageMetadata *_current_language = NULL; ///< The currently loaded lang
|
||||
|
||||
TextDirection _current_text_dir; ///< Text direction of the currently selected language.
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
Collator *_current_collator = NULL; ///< Collator for the language currently in use.
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
static uint64 _global_string_params_data[20]; ///< Global array of string parameters. To access, use #SetDParam.
|
||||
static WChar _global_string_params_type[20]; ///< Type of parameters stored in #_decode_parameters
|
||||
@@ -874,7 +875,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
bool lookup = (l == SCC_ENCODED);
|
||||
if (lookup) s += len;
|
||||
|
||||
param = (int32)strtoul(s, &p, 16);
|
||||
param = strtoull(s, &p, 16);
|
||||
|
||||
if (lookup) {
|
||||
if (param >= TAB_SIZE) {
|
||||
@@ -1274,7 +1275,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (c == NULL) break;
|
||||
|
||||
if (c->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)c->name};
|
||||
int64 args_array[] = {(int64)(size_t)c->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1300,7 +1301,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
case SCC_DEPOT_NAME: { // {DEPOT}
|
||||
VehicleType vt = (VehicleType)args->GetInt32(SCC_DEPOT_NAME);
|
||||
if (vt == VEH_AIRCRAFT) {
|
||||
uint64 args_array[] = {args->GetInt32()};
|
||||
uint64 args_array[] = {(uint64)args->GetInt32()};
|
||||
WChar types_array[] = {SCC_STATION_NAME};
|
||||
StringParameters tmp_params(args_array, 1, types_array);
|
||||
buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_AIRCRAFT, &tmp_params, last);
|
||||
@@ -1309,7 +1310,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
|
||||
const Depot *d = Depot::Get(args->GetInt32());
|
||||
if (d->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)d->name};
|
||||
int64 args_array[] = {(int64)(size_t)d->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1325,7 +1326,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (e == NULL) break;
|
||||
|
||||
if (e->name != NULL && e->IsEnabled()) {
|
||||
int64 args_array[] = {(uint64)(size_t)e->name};
|
||||
int64 args_array[] = {(int64)(size_t)e->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1340,7 +1341,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (g == NULL) break;
|
||||
|
||||
if (g->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)g->name};
|
||||
int64 args_array[] = {(int64)(size_t)g->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1377,7 +1378,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (c == NULL) break;
|
||||
|
||||
if (c->president_name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)c->president_name};
|
||||
int64 args_array[] = {(int64)(size_t)c->president_name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1402,7 +1403,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
}
|
||||
|
||||
if (st->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)st->name};
|
||||
int64 args_array[] = {(int64)(size_t)st->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1431,7 +1432,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (t == NULL) break;
|
||||
|
||||
if (t->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)t->name};
|
||||
int64 args_array[] = {(int64)(size_t)t->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1445,7 +1446,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (wp == NULL) break;
|
||||
|
||||
if (wp->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)wp->name};
|
||||
int64 args_array[] = {(int64)(size_t)wp->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1463,7 +1464,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (v == NULL) break;
|
||||
|
||||
if (v->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)v->name};
|
||||
int64 args_array[] = {(int64)(size_t)v->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1489,7 +1490,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
if (si == NULL) break;
|
||||
|
||||
if (si->name != NULL) {
|
||||
int64 args_array[] = {(uint64)(size_t)si->name};
|
||||
int64 args_array[] = {(int64)(size_t)si->name};
|
||||
StringParameters tmp_params(args_array);
|
||||
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
|
||||
} else {
|
||||
@@ -1789,7 +1790,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
strecpy(_config_language_file, c_file, lastof(_config_language_file));
|
||||
SetCurrentGrfLangID(_current_language->newgrflangid);
|
||||
|
||||
#ifdef WITH_ICU
|
||||
#ifdef WITH_ICU_SORT
|
||||
/* Delete previous collator. */
|
||||
if (_current_collator != NULL) {
|
||||
delete _current_collator;
|
||||
@@ -1806,7 +1807,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
delete _current_collator;
|
||||
_current_collator = NULL;
|
||||
}
|
||||
#endif /* WITH_ICU */
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
/* Some lists need to be sorted again after a language change. */
|
||||
ReconsiderGameScriptLanguage();
|
||||
@@ -1814,6 +1815,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
SortIndustryTypes();
|
||||
BuildIndustriesLegend();
|
||||
SortNetworkLanguages();
|
||||
BuildContentTypeStringList();
|
||||
InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window.
|
||||
InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window.
|
||||
InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window.
|
||||
@@ -1864,7 +1866,7 @@ int CDECL StringIDSorter(const StringID *a, const StringID *b)
|
||||
GetString(stra, *a, lastof(stra));
|
||||
GetString(strb, *b, lastof(strb));
|
||||
|
||||
return strcmp(stra, strb);
|
||||
return strnatcmp(stra, strb);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2131,7 +2133,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
||||
/* Update the font with cache */
|
||||
LoadStringWidthTable(searcher->Monospace());
|
||||
|
||||
#if !defined(WITH_ICU)
|
||||
#if !defined(WITH_ICU_LAYOUT)
|
||||
/*
|
||||
* For right-to-left languages we need the ICU library. If
|
||||
* we do not have support for that library we warn the user
|
||||
@@ -2151,5 +2153,5 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
||||
SetDParamStr(0, err_str);
|
||||
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
|
||||
}
|
||||
#endif
|
||||
#endif /* !WITH_ICU_LAYOUT */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user