From 877349c13d133f2694ba1f72603a85d543e616c2 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 5 May 2023 00:04:52 +0200 Subject: [PATCH 01/38] Codechange: use std::string for text file name resolution --- src/ai/ai_gui.cpp | 2 +- src/base_media_base.h | 10 ++++---- src/game/game_gui.cpp | 2 +- src/network/core/tcp_content.cpp | 8 +++--- src/network/core/tcp_content_type.h | 4 ++- src/network/network_content_gui.cpp | 6 ++--- src/newgrf_config.cpp | 6 ++--- src/newgrf_config.h | 3 ++- src/newgrf_gui.cpp | 6 ++--- src/script/script_config.cpp | 4 +-- src/script/script_config.hpp | 4 +-- src/script/script_gui.cpp | 6 ++--- src/settings_gui.cpp | 10 ++++---- src/textfile_gui.cpp | 38 ++++++++++++----------------- src/textfile_gui.h | 5 ++-- 15 files changed, 56 insertions(+), 58 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index edd7e48348..ac2daee27d 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -285,7 +285,7 @@ struct AIConfigWindow : public Window { this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot + 1))); for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) { - this->SetWidgetDisabledState(WID_AIC_TEXTFILE + tft, this->selected_slot == INVALID_COMPANY || (AIConfig::GetConfig(this->selected_slot)->GetTextfile(tft, this->selected_slot) == nullptr)); + this->SetWidgetDisabledState(WID_AIC_TEXTFILE + tft, this->selected_slot == INVALID_COMPANY || !AIConfig::GetConfig(this->selected_slot)->GetTextfile(tft, this->selected_slot).has_value()); } } }; diff --git a/src/base_media_base.h b/src/base_media_base.h index 84c12d0858..d78539f730 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -137,17 +137,17 @@ struct BaseSet { /** * Search a textfile file next to this base media. * @param type The type of the textfile to search for. - * @return The filename for the textfile, \c nullptr otherwise. + * @return The filename for the textfile. */ - const char *GetTextfile(TextfileType type) const + std::optional GetTextfile(TextfileType type) const { for (uint i = 0; i < NUM_FILES; i++) { - const char *textfile = ::GetTextfile(type, BASESET_DIR, this->files[i].filename.c_str()); - if (textfile != nullptr) { + auto textfile = ::GetTextfile(type, BASESET_DIR, this->files[i].filename); + if (textfile.has_value()) { return textfile; } } - return nullptr; + return std::nullopt; } }; diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index 0d941d884a..0885f38db6 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -405,7 +405,7 @@ struct GSConfigWindow : public Window { this->SetWidgetDisabledState(WID_GSC_CHANGE, (_game_mode == GM_NORMAL) || !IsEditable()); for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) { - this->SetWidgetDisabledState(WID_GSC_TEXTFILE + tft, GameConfig::GetConfig()->GetTextfile(tft, (CompanyID)OWNER_DEITY) == nullptr); + this->SetWidgetDisabledState(WID_GSC_TEXTFILE + tft, !GameConfig::GetConfig()->GetTextfile(tft, (CompanyID)OWNER_DEITY).has_value()); } this->RebuildVisibleSettings(); HideDropDownMenu(this); diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp index dbbb70dcaa..913a8b9bdc 100644 --- a/src/network/core/tcp_content.cpp +++ b/src/network/core/tcp_content.cpp @@ -49,11 +49,11 @@ bool ContentInfo::IsValid() const /** * Search a textfile file next to this file in the content list. * @param type The type of the textfile to search for. - * @return The filename for the textfile, \c nullptr otherwise. + * @return The filename for the textfile. */ -const char *ContentInfo::GetTextfile(TextfileType type) const +std::optional ContentInfo::GetTextfile(TextfileType type) const { - if (this->state == INVALID) return nullptr; + if (this->state == INVALID) return std::nullopt; const char *tmp; switch (this->type) { default: NOT_REACHED(); @@ -88,7 +88,7 @@ const char *ContentInfo::GetTextfile(TextfileType type) const tmp = FindScenario(this, true); break; } - if (tmp == nullptr) return nullptr; + if (tmp == nullptr) return std::nullopt; return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp); } diff --git a/src/network/core/tcp_content_type.h b/src/network/core/tcp_content_type.h index 5daae39dc6..7ac64c6e35 100644 --- a/src/network/core/tcp_content_type.h +++ b/src/network/core/tcp_content_type.h @@ -12,6 +12,8 @@ #ifndef NETWORK_CORE_TCP_CONTENT_TYPE_H #define NETWORK_CORE_TCP_CONTENT_TYPE_H +#include + /** The values in the enum are important; they are used as database 'keys' */ enum ContentType { CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types @@ -75,7 +77,7 @@ struct ContentInfo { bool IsSelected() const; bool IsValid() const; - const char *GetTextfile(TextfileType type) const; + std::optional GetTextfile(TextfileType type) const; }; #endif /* NETWORK_CORE_TCP_CONTENT_TYPE_H */ diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 3f8c97e348..7d53329069 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -43,8 +43,8 @@ struct ContentTextfileWindow : public TextfileWindow { ContentTextfileWindow(TextfileType file_type, const ContentInfo *ci) : TextfileWindow(file_type), ci(ci) { - const char *textfile = this->ci->GetTextfile(file_type); - this->LoadTextfile(textfile, GetContentInfoSubDir(this->ci->type)); + auto textfile = this->ci->GetTextfile(file_type); + this->LoadTextfile(textfile.value(), GetContentInfoSubDir(this->ci->type)); } StringID GetTypeString() const @@ -998,7 +998,7 @@ public: this->SetWidgetDisabledState(WID_NCL_SELECT_UPDATE, !show_select_upgrade); this->SetWidgetDisabledState(WID_NCL_OPEN_URL, this->selected == nullptr || this->selected->url.empty()); for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) { - this->SetWidgetDisabledState(WID_NCL_TEXTFILE + tft, this->selected == nullptr || this->selected->state != ContentInfo::ALREADY_HERE || this->selected->GetTextfile(tft) == nullptr); + this->SetWidgetDisabledState(WID_NCL_TEXTFILE + tft, this->selected == nullptr || this->selected->state != ContentInfo::ALREADY_HERE || !this->selected->GetTextfile(tft).has_value()); } this->GetWidget(WID_NCL_CANCEL)->widget_data = this->filesize_sum == 0 ? STR_AI_SETTINGS_CLOSE : STR_AI_LIST_CANCEL; diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 77f82fcb2b..b2b29a5b89 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -785,9 +785,9 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last) /** * Search a textfile file next to this NewGRF. * @param type The type of the textfile to search for. - * @return The filename for the textfile, \c nullptr otherwise. + * @return The filename for the textfile. */ -const char *GRFConfig::GetTextfile(TextfileType type) const +std::optional GRFConfig::GetTextfile(TextfileType type) const { - return ::GetTextfile(type, NEWGRF_DIR, this->filename.c_str()); + return ::GetTextfile(type, NEWGRF_DIR, this->filename); } diff --git a/src/newgrf_config.h b/src/newgrf_config.h index 3e5a56739a..cc7b899ea1 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -17,6 +17,7 @@ #include "fileio_type.h" #include "textfile_type.h" #include "newgrf_text.h" +#include /** GRF config bit flags */ enum GCF_Flags { @@ -184,7 +185,7 @@ struct GRFConfig : ZeroedMemoryAllocator { void CopyParams(const GRFConfig &src); - const char *GetTextfile(TextfileType type) const; + std::optional GetTextfile(TextfileType type) const; const char *GetName() const; const char *GetDescription() const; const char *GetURL() const; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index f4fb441dd7..663de441c2 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -545,8 +545,8 @@ struct NewGRFTextfileWindow : public TextfileWindow { NewGRFTextfileWindow(TextfileType file_type, const GRFConfig *c) : TextfileWindow(file_type), grf_config(c) { - const char *textfile = this->grf_config->GetTextfile(file_type); - this->LoadTextfile(textfile, NEWGRF_DIR); + auto textfile = this->grf_config->GetTextfile(file_type); + this->LoadTextfile(textfile.value(), NEWGRF_DIR); } void SetStringParameters(int widget) const override @@ -1285,7 +1285,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { const GRFConfig *selected_config = (this->avail_sel == nullptr) ? this->active_sel : this->avail_sel; for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) { - this->SetWidgetDisabledState(WID_NS_NEWGRF_TEXTFILE + tft, selected_config == nullptr || selected_config->GetTextfile(tft) == nullptr); + this->SetWidgetDisabledState(WID_NS_NEWGRF_TEXTFILE + tft, selected_config == nullptr || !selected_config->GetTextfile(tft).has_value()); } this->SetWidgetDisabledState(WID_NS_OPEN_URL, selected_config == nullptr || StrEmpty(selected_config->GetURL())); diff --git a/src/script/script_config.cpp b/src/script/script_config.cpp index 29ab7af430..a36d7046f0 100644 --- a/src/script/script_config.cpp +++ b/src/script/script_config.cpp @@ -234,9 +234,9 @@ std::string ScriptConfig::SettingsToString() const return string; } -const char *ScriptConfig::GetTextfile(TextfileType type, CompanyID slot) const +std::optional ScriptConfig::GetTextfile(TextfileType type, CompanyID slot) const { - if (slot == INVALID_COMPANY || this->GetInfo() == nullptr) return nullptr; + if (slot == INVALID_COMPANY || this->GetInfo() == nullptr) return std::nullopt; return ::GetTextfile(type, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR, this->GetInfo()->GetMainScript()); } diff --git a/src/script/script_config.hpp b/src/script/script_config.hpp index be788d0526..342d5ad362 100644 --- a/src/script/script_config.hpp +++ b/src/script/script_config.hpp @@ -184,9 +184,9 @@ public: * Search a textfile file next to this script. * @param type The type of the textfile to search for. * @param slot #CompanyID to check status of. - * @return The filename for the textfile, \c nullptr otherwise. + * @return The filename for the textfile. */ - const char *GetTextfile(TextfileType type, CompanyID slot) const; + std::optional GetTextfile(TextfileType type, CompanyID slot) const; void SetToLoadData(ScriptInstance::ScriptData *data); ScriptInstance::ScriptData *GetToLoadData(); diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index d060620af1..aeec99445f 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -643,11 +643,11 @@ struct ScriptTextfileWindow : public TextfileWindow { void OnInvalidateData(int data = 0, bool gui_scope = true) override { - const char *textfile = GetConfig(slot)->GetTextfile(file_type, slot); - if (textfile == nullptr) { + auto textfile = GetConfig(slot)->GetTextfile(file_type, slot); + if (!textfile.has_value()) { this->Close(); } else { - this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR); + this->LoadTextfile(textfile.value(), (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR); } } }; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 1be6742b92..6e51539b5e 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -101,8 +101,8 @@ struct BaseSetTextfileWindow : public TextfileWindow { BaseSetTextfileWindow(TextfileType file_type, const TBaseSet* baseset, StringID content_type) : TextfileWindow(file_type), baseset(baseset), content_type(content_type) { - const char *textfile = this->baseset->GetTextfile(file_type); - this->LoadTextfile(textfile, BASESET_DIR); + auto textfile = this->baseset->GetTextfile(file_type); + this->LoadTextfile(textfile.value(), BASESET_DIR); } void SetStringParameters(int widget) const override @@ -704,9 +704,9 @@ struct GameOptionsWindow : Window { this->GetWidget(WID_GO_BASE_GRF_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_GRF_STATUS, STR_NULL); for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) { - this->SetWidgetDisabledState(WID_GO_BASE_GRF_TEXTFILE + tft, BaseGraphics::GetUsedSet() == nullptr || BaseGraphics::GetUsedSet()->GetTextfile(tft) == nullptr); - this->SetWidgetDisabledState(WID_GO_BASE_SFX_TEXTFILE + tft, BaseSounds::GetUsedSet() == nullptr || BaseSounds::GetUsedSet()->GetTextfile(tft) == nullptr); - this->SetWidgetDisabledState(WID_GO_BASE_MUSIC_TEXTFILE + tft, BaseMusic::GetUsedSet() == nullptr || BaseMusic::GetUsedSet()->GetTextfile(tft) == nullptr); + this->SetWidgetDisabledState(WID_GO_BASE_GRF_TEXTFILE + tft, BaseGraphics::GetUsedSet() == nullptr || !BaseGraphics::GetUsedSet()->GetTextfile(tft).has_value()); + this->SetWidgetDisabledState(WID_GO_BASE_SFX_TEXTFILE + tft, BaseSounds::GetUsedSet() == nullptr || !BaseSounds::GetUsedSet()->GetTextfile(tft).has_value()); + this->SetWidgetDisabledState(WID_GO_BASE_MUSIC_TEXTFILE + tft, BaseMusic::GetUsedSet() == nullptr || !BaseMusic::GetUsedSet()->GetTextfile(tft).has_value()); } missing_files = BaseMusic::GetUsedSet()->GetNumInvalid() == 0; diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 021d7326d5..86a370045f 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -333,9 +333,9 @@ static void Xunzip(byte **bufp, size_t *sizep) /** * Loads the textfile text from file and setup #lines. */ -/* virtual */ void TextfileWindow::LoadTextfile(const char *textfile, Subdirectory dir) +/* virtual */ void TextfileWindow::LoadTextfile(const std::string &textfile, Subdirectory dir) { - if (textfile == nullptr) return; + if (textfile.empty()) return; this->lines.clear(); @@ -350,19 +350,14 @@ static void Xunzip(byte **bufp, size_t *sizep) if (read != filesize) return; -#if defined(WITH_ZLIB) || defined(WITH_LIBLZMA) - const char *suffix = strrchr(textfile, '.'); - if (suffix == nullptr) return; -#endif - #if defined(WITH_ZLIB) /* In-place gunzip */ - if (strcmp(suffix, ".gz") == 0) Gunzip((byte**)&this->text, &filesize); + if (StrEndsWith(textfile, ".gz")) Gunzip((byte**)&this->text, &filesize); #endif #if defined(WITH_LIBLZMA) /* In-place xunzip */ - if (strcmp(suffix, ".xz") == 0) Xunzip((byte**)&this->text, &filesize); + if (StrEndsWith(textfile, ".xz")) Xunzip((byte**)&this->text, &filesize); #endif if (!this->text) return; @@ -409,7 +404,7 @@ static void Xunzip(byte **bufp, size_t *sizep) * @param filename The filename of the content to look for. * @return The path to the textfile, \c nullptr otherwise. */ -const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filename) +std::optional GetTextfile(TextfileType type, Subdirectory dir, const std::string &filename) { static const char * const prefixes[] = { "readme", @@ -418,17 +413,16 @@ const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filenam }; static_assert(lengthof(prefixes) == TFT_END); - const char *prefix = prefixes[type]; + std::string_view prefix = prefixes[type]; - if (filename == nullptr) return nullptr; + if (filename.empty()) return std::nullopt; - static char file_path[MAX_PATH]; - strecpy(file_path, filename, lastof(file_path)); + auto slash = filename.find_last_of(PATHSEPCHAR); + if (slash == std::string::npos) return std::nullopt; - char *slash = strrchr(file_path, PATHSEPCHAR); - if (slash == nullptr) return nullptr; + std::string_view base_path(filename.data(), slash + 1); - static const char * const exts[] = { + static const std::initializer_list extensions{ "txt", #if defined(WITH_ZLIB) "txt.gz", @@ -438,15 +432,15 @@ const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filenam #endif }; - for (size_t i = 0; i < lengthof(exts); i++) { - seprintf(slash + 1, lastof(file_path), "%s_%s.%s", prefix, GetCurrentLanguageIsoCode(), exts[i]); + for (auto &extension : extensions) { + std::string file_path = fmt::format("{}{}_{}.{}", base_path, prefix, GetCurrentLanguageIsoCode(), extension); if (FioCheckFileExists(file_path, dir)) return file_path; - seprintf(slash + 1, lastof(file_path), "%s_%.2s.%s", prefix, GetCurrentLanguageIsoCode(), exts[i]); + file_path = fmt::format("{}{}_{:.2s}.{}", base_path, prefix, GetCurrentLanguageIsoCode(), extension); if (FioCheckFileExists(file_path, dir)) return file_path; - seprintf(slash + 1, lastof(file_path), "%s.%s", prefix, exts[i]); + file_path = fmt::format("{}{}.{}", base_path, prefix, extension); if (FioCheckFileExists(file_path, dir)) return file_path; } - return nullptr; + return std::nullopt; } diff --git a/src/textfile_gui.h b/src/textfile_gui.h index cdcae73888..d7d0a8391d 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -14,8 +14,9 @@ #include "strings_func.h" #include "textfile_type.h" #include "window_gui.h" +#include -const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filename); +std::optional GetTextfile(TextfileType type, Subdirectory dir, const std::string &filename); /** Window for displaying a textfile */ struct TextfileWindow : public Window, MissingGlyphSearcher { @@ -51,7 +52,7 @@ struct TextfileWindow : public Window, MissingGlyphSearcher { bool Monospace() override; void SetFontNames(FontCacheSettings *settings, const char *font_name, const void *os_data) override; - virtual void LoadTextfile(const char *textfile, Subdirectory dir); + virtual void LoadTextfile(const std::string &textfile, Subdirectory dir); private: uint ReflowContent(); From a7d3c79d79ef19022ffae34e66fc533e9584dd61 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Fri, 5 May 2023 09:08:57 +0200 Subject: [PATCH 02/38] Fix c6c3d0e6: restore string-based settings in network-private settings (#10765) By accident the SDTC_SSTR got replaced with SDTC_VAR, which breaks many of the settings in this file. --- src/table/settings/network_private_settings.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/table/settings/network_private_settings.ini b/src/table/settings/network_private_settings.ini index 4bd478882b..d984011903 100644 --- a/src/table/settings/network_private_settings.ini +++ b/src/table/settings/network_private_settings.ini @@ -15,11 +15,10 @@ static const SettingVariant _network_private_settings_table[] = { [templates] SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup), SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup), -SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup), +SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $def, $length, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup), [validation] SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size"); -SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size"); [defaults] flags = SF_NONE From bda754ec837bc48eb6e7e1afa1d54102fa3a8ceb Mon Sep 17 00:00:00 2001 From: PeterN Date: Fri, 5 May 2023 09:22:03 +0100 Subject: [PATCH 03/38] Fix: Make all settingsgen 'warnings' fatal. (#10766) Compilation should stop If settingsgen fails to complete properly. --- src/settingsgen/settingsgen.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index dfd0494a41..8952f9ee77 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -29,7 +29,7 @@ */ void NORETURN FatalErrorI(const std::string &msg) { - fprintf(stderr, "FATAL: %s\n", msg.c_str()); + fprintf(stderr, "settingsgen: FATAL: %s\n", msg.c_str()); exit(1); } @@ -66,7 +66,7 @@ public: void Write(FILE *out_fp) const { if (fwrite(this->data, 1, this->size, out_fp) != this->size) { - fprintf(stderr, "Error: Cannot write output\n"); + FatalError("Cannot write output"); } } @@ -323,8 +323,7 @@ static void DumpSections(IniLoadFile *ifile) IniItem *template_item = templates_grp->GetItem(grp->name, false); // Find template value. if (template_item == nullptr || !template_item->value.has_value()) { - fprintf(stderr, "settingsgen: Warning: Cannot find template %s\n", grp->name.c_str()); - continue; + FatalError("Cannot find template {}", grp->name); } DumpLine(template_item, grp, default_grp, _stored_output); @@ -348,8 +347,7 @@ static void CopyFile(const char *fname, FILE *out_fp) FILE *in_fp = fopen(fname, "r"); if (in_fp == nullptr) { - fprintf(stderr, "settingsgen: Warning: Cannot open file %s for copying\n", fname); - return; + FatalError("Cannot open file {} for copying", fname); } char buffer[4096]; @@ -357,8 +355,7 @@ static void CopyFile(const char *fname, FILE *out_fp) do { length = fread(buffer, 1, lengthof(buffer), in_fp); if (fwrite(buffer, 1, length, out_fp) != length) { - fprintf(stderr, "Error: Cannot copy file\n"); - break; + FatalError("Cannot copy file"); } } while (length == lengthof(buffer)); @@ -507,8 +504,7 @@ int CDECL main(int argc, char *argv[]) FILE *fp = fopen(tmp_output, "w"); if (fp == nullptr) { - fprintf(stderr, "settingsgen: Warning: Cannot open file %s\n", tmp_output); - return 1; + FatalError("Cannot open file {}", tmp_output); } CopyFile(before_file, fp); _stored_output.Write(fp); From 5dd54e2708a8f0df26296ac93a144efdfc7979ab Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 5 May 2023 18:42:16 +0000 Subject: [PATCH 04/38] Update: Translations from eints japanese: 10 changes by fmang vietnamese: 14 changes by KhoiCanDev dutch: 14 changes by Afoklala polish: 1 change by pAter-exe --- src/lang/afrikaans.txt | 25 ----------------- src/lang/arabic_egypt.txt | 25 ----------------- src/lang/basque.txt | 25 ----------------- src/lang/belarusian.txt | 25 ----------------- src/lang/brazilian_portuguese.txt | 27 ------------------- src/lang/bulgarian.txt | 25 ----------------- src/lang/catalan.txt | 27 ------------------- src/lang/chuvash.txt | 25 ----------------- src/lang/croatian.txt | 25 ----------------- src/lang/czech.txt | 27 ------------------- src/lang/danish.txt | 27 ------------------- src/lang/dutch.txt | 45 +++++++++++-------------------- src/lang/english_AU.txt | 27 ------------------- src/lang/english_US.txt | 27 ------------------- src/lang/esperanto.txt | 25 ----------------- src/lang/estonian.txt | 27 ------------------- src/lang/faroese.txt | 25 ----------------- src/lang/finnish.txt | 27 ------------------- src/lang/french.txt | 27 ------------------- src/lang/frisian.txt | 25 ----------------- src/lang/gaelic.txt | 26 ------------------ src/lang/galician.txt | 27 ------------------- src/lang/german.txt | 27 ------------------- src/lang/greek.txt | 27 ------------------- src/lang/hebrew.txt | 26 ------------------ src/lang/hindi.txt | 25 ----------------- src/lang/hungarian.txt | 27 ------------------- src/lang/icelandic.txt | 25 ----------------- src/lang/ido.txt | 25 ----------------- src/lang/indonesian.txt | 27 ------------------- src/lang/irish.txt | 25 ----------------- src/lang/italian.txt | 27 ------------------- src/lang/japanese.txt | 42 +++++++---------------------- src/lang/korean.txt | 27 ------------------- src/lang/latin.txt | 25 ----------------- src/lang/latvian.txt | 27 ------------------- src/lang/lithuanian.txt | 26 ------------------ src/lang/luxembourgish.txt | 27 ------------------- src/lang/macedonian.txt | 25 ----------------- src/lang/malay.txt | 25 ----------------- src/lang/maltese.txt | 25 ----------------- src/lang/marathi.txt | 25 ----------------- src/lang/norwegian_bokmal.txt | 25 ----------------- src/lang/norwegian_nynorsk.txt | 25 ----------------- src/lang/persian.txt | 25 ----------------- src/lang/polish.txt | 29 +------------------- src/lang/portuguese.txt | 27 ------------------- src/lang/romanian.txt | 27 ------------------- src/lang/russian.txt | 27 ------------------- src/lang/serbian.txt | 27 ------------------- src/lang/simplified_chinese.txt | 27 ------------------- src/lang/slovak.txt | 27 ------------------- src/lang/slovenian.txt | 25 ----------------- src/lang/spanish.txt | 27 ------------------- src/lang/spanish_MX.txt | 27 ------------------- src/lang/swedish.txt | 27 ------------------- src/lang/tamil.txt | 25 ----------------- src/lang/thai.txt | 25 ----------------- src/lang/traditional_chinese.txt | 27 ------------------- src/lang/turkish.txt | 27 ------------------- src/lang/ukrainian.txt | 27 ------------------- src/lang/urdu.txt | 25 ----------------- src/lang/vietnamese.txt | 45 +++++++++++-------------------- src/lang/welsh.txt | 25 ----------------- 64 files changed, 43 insertions(+), 1681 deletions(-) diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 5d2232e889..a42c1bb793 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -5212,33 +5212,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 040f72595c..118ae3b32c 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -4912,33 +4912,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/basque.txt b/src/lang/basque.txt index a84f2427c1..4e7b412531 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -4946,33 +4946,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index e953011f70..ce9dcf18c4 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -5684,33 +5684,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 71feb7ce7c..d07bdfeeea 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -3806,8 +3806,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia in STR_VEHICLE_LIST_REPLACE_VEHICLES :Substituir veículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Manutenção STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Lucro anual: {CURRENCY_LONG} (último ano: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar para Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar para Garagem @@ -5583,33 +5581,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index 8d43316c4a..e8640a368f 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -5035,33 +5035,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index e6c0dfdc16..864f2a5951 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -3806,8 +3806,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia in STR_VEHICLE_LIST_REPLACE_VEHICLES :Substitueix vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Envia a fer revisió STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Benefici enguany: {CURRENCY_LONG} (darrer any: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Envia a la cotxera STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Envia a la cotxera @@ -5583,33 +5581,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/chuvash.txt b/src/lang/chuvash.txt index 09c6d2a796..cf6eb6e1a6 100644 --- a/src/lang/chuvash.txt +++ b/src/lang/chuvash.txt @@ -1820,33 +1820,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 461edb6a7a..6efb4d1453 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -5438,33 +5438,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 1dff393941..ee69c292d2 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -3895,8 +3895,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Poslat p STR_VEHICLE_LIST_REPLACE_VEHICLES :Vyměňování vozidel STR_VEHICLE_LIST_SEND_FOR_SERVICING :Provést údržbu STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Letošní zisk: {CURRENCY_LONG} (vloni: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Poslat do depa STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Poslat do depa @@ -5798,33 +5796,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 70dfb5b609..a648b53474 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -3827,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Udskift køretøjer STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send til eftersyn STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Afkast i år: {CURRENCY_LONG} (sidste år: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send til remise STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send til værksted @@ -5606,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 9fd7d3837f..a6f6c3f140 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -931,8 +931,22 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Kopieer # Game options window STR_GAME_OPTIONS_CAPTION :{WHITE}Spelopties - - +STR_GAME_OPTIONS_TAB_GENERAL :Algemeen +STR_GAME_OPTIONS_TAB_GENERAL_TT :{BLACK}Algemene instellingen kiezen +STR_GAME_OPTIONS_TAB_GRAPHICS :Grafische elementen +STR_GAME_OPTIONS_TAB_GRAPHICS_TT :{BLACK}Grafische instellingen kiezen +STR_GAME_OPTIONS_TAB_SOUND :Geluid +STR_GAME_OPTIONS_TAB_SOUND_TT :{BLACK}Geluids- en muziekinstellingen kiezen + +STR_GAME_OPTIONS_VOLUME :Volume +STR_GAME_OPTIONS_SFX_VOLUME :Geluidseffecten +STR_GAME_OPTIONS_MUSIC_VOLUME :Muziek + +STR_GAME_OPTIONS_VOLUME_0 :0% +STR_GAME_OPTIONS_VOLUME_25 :25% +STR_GAME_OPTIONS_VOLUME_50 :50% +STR_GAME_OPTIONS_VOLUME_75 :75% +STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Valuta kiezen @@ -3813,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Stuur in STR_VEHICLE_LIST_REPLACE_VEHICLES :Vervang voertuigen STR_VEHICLE_LIST_SEND_FOR_SERVICING :Stuur voor onderhoud STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Winst dit jaar: {CURRENCY_LONG} (vorig jaar: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Stuur naar depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Stuur naar garage @@ -5592,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index bc95ab563b..f06d0c8020 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -3827,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for Servicing STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send to Depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send to Depot @@ -5606,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 0c1c4e762e..b738947df7 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -3827,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for Maintenance STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send to Depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send to Depot @@ -5606,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 675a1235b1..5dc9b38a42 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -4447,33 +4447,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index aff88f9252..bb88f693f3 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -3857,8 +3857,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Saada ju STR_VEHICLE_LIST_REPLACE_VEHICLES :Asenda veovahendeid STR_VEHICLE_LIST_SEND_FOR_SERVICING :Saada hooldusesse STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Selle aasta kasum: {CURRENCY_LONG} (eelneval: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Saada depoose STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Saada depoose @@ -5622,33 +5620,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index bce313116a..1568dce43c 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -4588,33 +4588,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index b04e942303..dbcc5429b4 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -3827,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Ohjaa ka STR_VEHICLE_LIST_REPLACE_VEHICLES :Korvaa kulkuneuvoja STR_VEHICLE_LIST_SEND_FOR_SERVICING :Lähetä huoltoon STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Tuotto tänä vuonna: {CURRENCY_LONG} (viime vuonna: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Lähetä varikolle STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Lähetä varikolle @@ -5606,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/french.txt b/src/lang/french.txt index dad4f8758b..06ff368962 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -3810,8 +3810,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envoyer STR_VEHICLE_LIST_REPLACE_VEHICLES :Remplacer des véhicules STR_VEHICLE_LIST_SEND_FOR_SERVICING :Envoyer à l'entretien STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit cette année{NBSP}: {CURRENCY_LONG} (année précédente{NBSP}: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Envoyer au dépôt STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Envoyer au dépôt @@ -5588,33 +5586,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/frisian.txt b/src/lang/frisian.txt index c60d154388..44cbdeb333 100644 --- a/src/lang/frisian.txt +++ b/src/lang/frisian.txt @@ -4783,33 +4783,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 926e2248e1..36e4968fe6 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -5505,34 +5505,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_DATE_LONG_SMALL.dat :{TINY_FONT}{BLACK}{DATE_LONG.dat} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 1e18925e50..237271e217 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -3810,8 +3810,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia-la STR_VEHICLE_LIST_REPLACE_VEHICLES :Reemprazar vehículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para servizo STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Beneficio este ano: {CURRENCY_LONG} (ano pasado: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar ao depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar ao depósito @@ -5589,33 +5587,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/german.txt b/src/lang/german.txt index eeed9c4f32..eeae660b27 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -3803,8 +3803,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Aufträg STR_VEHICLE_LIST_REPLACE_VEHICLES :Fahrzeuge ersetzen STR_VEHICLE_LIST_SEND_FOR_SERVICING :Zur Wartung schicken STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Gewinn im laufenden Jahr: {CURRENCY_LONG} (vergangenes Jahr: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Ins Depot schicken STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Ins Depot schicken @@ -5580,33 +5578,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 20548625f3..ccea7e6e2f 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -3898,8 +3898,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Στεί STR_VEHICLE_LIST_REPLACE_VEHICLES :Αντικατάσταση οχημάτων STR_VEHICLE_LIST_SEND_FOR_SERVICING :Στείλτε για Επισκευή STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Κέρδος αυτό το έτος: {CURRENCY_LONG} (προηγούμενο έτος: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Στείλτε στο Υπόστεγο STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Στείλτε στο Αμαξοστάσιο @@ -5670,33 +5668,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 6f1b670dc8..781500d23c 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -3543,7 +3543,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}שלח STR_VEHICLE_LIST_REPLACE_VEHICLES :החלף כלי רכב STR_VEHICLE_LIST_SEND_FOR_SERVICING :שלח לטיפול STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}{1:CURRENCY_LONG} :בשנה שעברה{NBSP} {0:CURRENCY_LONG}) :רווח השנה -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :שלח רכבת למוסך STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :שלח כלי רכב למוסך @@ -5262,33 +5261,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/hindi.txt b/src/lang/hindi.txt index 2edf8eac4f..b01c519b19 100644 --- a/src/lang/hindi.txt +++ b/src/lang/hindi.txt @@ -1515,33 +1515,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_TRAIN :{BLACK}{TRAIN} diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index cd4c784450..55b306d289 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -3856,8 +3856,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}A listá STR_VEHICLE_LIST_REPLACE_VEHICLES :Járművek lecserélése STR_VEHICLE_LIST_SEND_FOR_SERVICING :Javításra küld STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Idei nyereség: {CURRENCY_LONG} (Tavalyi: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Elküldi járműtelepre STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Elküldi garázsba @@ -5659,33 +5657,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index dea7721b0a..4b13e27113 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -4831,33 +4831,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/ido.txt b/src/lang/ido.txt index 990c36b804..aa1579105f 100644 --- a/src/lang/ido.txt +++ b/src/lang/ido.txt @@ -1695,33 +1695,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index adc126cdaa..5430c15b18 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -3792,8 +3792,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Kirim pe STR_VEHICLE_LIST_REPLACE_VEHICLES :Ganti kendaraan STR_VEHICLE_LIST_SEND_FOR_SERVICING :Perintahkan untuk diperbaiki STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Laba tahun ini: {CURRENCY_LONG} (tahun lalu: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Perintahkan ke bengkel STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Perintahkan ke Bengkel @@ -5554,33 +5552,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 2481f97817..c96d59f467 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -5463,33 +5463,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/italian.txt b/src/lang/italian.txt index b6f4ac01b0..7615cb3bfe 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -3868,8 +3868,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Invia is STR_VEHICLE_LIST_REPLACE_VEHICLES :Rimpiazza veicoli STR_VEHICLE_LIST_SEND_FOR_SERVICING :Manutenzione STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profitto quest'anno: {CURRENCY_LONG} (anno scorso: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Manda al deposito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Manda al deposito @@ -5647,33 +5645,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index 73ce8f4e6b..56772ea119 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -344,7 +344,7 @@ STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}指令 ###length 31 STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}ゲームをポーズします STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}ゲーム進行速度を早くします -STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}ゲームオプションの設定画面を開きます +STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}ゲームオプションと設定 STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}ゲームのセーブ、ロード、中断、OpenTTDの終了ができます STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}地図の表示、ビューポートの表示、貨物流通、標識のリストの表示ができます STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}街の一覧を表示します @@ -354,7 +354,7 @@ STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_FINANCES :{BLACK}会社 STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_GENERAL :{BLACK}会社の一般的な情報を表示します STR_TOOLBAR_TOOLTIP_DISPLAY_STORY_BOOK :{BLACK}ゲームの背景となる物語を表示します STR_TOOLBAR_TOOLTIP_DISPLAY_GOALS_LIST :{BLACK}ゲームの目標一覧を表示します -STR_TOOLBAR_TOOLTIP_DISPLAY_GRAPHS :{BLACK}さまざまなグラフを表示します +STR_TOOLBAR_TOOLTIP_DISPLAY_GRAPHS :{BLACK}会社の業績グラフや運送報酬相場を表示します STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_LEAGUE :{BLACK}会社の業務成績表を表示します STR_TOOLBAR_TOOLTIP_FUND_CONSTRUCTION_OF_NEW :{BLACK}産業を調査、及び産業の開設に出資します STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS :{BLACK}社有の列車一覧とそのグループを表示します。Ctrl+クリックで一覧のみ表示します @@ -370,8 +370,8 @@ STR_TOOLBAR_TOOLTIP_BUILD_SHIP_DOCKS :{BLACK}埠頭 STR_TOOLBAR_TOOLTIP_BUILD_AIRPORTS :{BLACK}空港を建設します STR_TOOLBAR_TOOLTIP_LANDSCAPING :{BLACK}地形のツールバーを開きます。整地や植林などを行うことができます。 STR_TOOLBAR_TOOLTIP_SHOW_SOUND_MUSIC_WINDOW :{BLACK}音楽/効果音のウィンドウを表示します -STR_TOOLBAR_TOOLTIP_SHOW_LAST_MESSAGE_NEWS :{BLACK}最後のメッセージ/ニュースの表示と、メッセージオプションの設定ができます -STR_TOOLBAR_TOOLTIP_LAND_BLOCK_INFORMATION :{BLACK}地域の情報、コンソール、スクリプトのデバッグ、スクリーンショット、OpenTTDについて、などのツール群です +STR_TOOLBAR_TOOLTIP_SHOW_LAST_MESSAGE_NEWS :{BLACK}最新メッセージ/ニュースとメッセージ履歴を表示、メッセージをすべて削除 +STR_TOOLBAR_TOOLTIP_LAND_BLOCK_INFORMATION :{BLACK}地域の情報、スクリーンショット、OpenTTDについて、開発者ツール STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR :{BLACK}ツールバーを切り替えます # Extra tooltips for the scenario editor toolbar @@ -1730,7 +1730,7 @@ STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :一つのスク STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :最大信頼度を点検要件化: {STRING} -STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :次の点検が必要と判断される条件を設定します。無効の場合は、前の点検から指定の期間が経過した際に点検が必要と判断されます。有効にすると、輸送機器の最大信頼度が指定の値より落ち込んだ場合に次の点検が必要と判断されます +STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :有効にすると、輸送機器の信頼度が最大信頼度より指定の差分落ち込んだ場合に点検に行きます。{}{}例えば、輸送機器の最大信頼度が90%で点検間隔が20%だとすると、輸送機器の信頼度が72%を下回る場合に点検に行きます。 STR_CONFIG_SETTING_SERVINT_TRAINS :列車の点検周期: {STRING} STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT :個別に指定されていない場合の、列車の点検周期を設定します @@ -1935,6 +1935,10 @@ STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :変化なし STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :初期の都市サイズ乗数: {STRING} STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :ゲーム開始時に都市が普通の街に比べて平均して何倍の人口規模になるかを設定します +STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL :行先分配グラフを{STRING}秒毎に更新 +STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL_HELPTEXT :行先分配グラフの更新の間の待ち時間。各更新はグラフの一部だけのルートを再計算します。即ち、この設定を〇〇秒に指定する場合、全グラフが〇〇秒毎に更新されるのではありません。間隔が短ければ短いほどCPU時間を消費します。長ければ長いほど貨物流通の新規ルートの行先分配に時間がかかります。 +STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME :行先分配の更新に{STRING}秒を割り当て +STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME_HELPTEXT :行先分配グラフの更新に割り当てられる時間。更新が始まると、スレッドが生成されて、指定の時間に実行させられます。短ければ短いほど間に合わない可能性が高まります。その場合、ゲームは停止して計算完了を待ちます。長ければ長いほどルート変更の際に行先分配の更新に時間がかかります。 STR_CONFIG_SETTING_DISTRIBUTION_PAX :旅客の行先分配法: {STRING} STR_CONFIG_SETTING_DISTRIBUTION_PAX_HELPTEXT :旅客がどのように行き先別に分配されるかを設定します。「対称」ではAからBへ向かう乗客とほぼ同数が、BからAに向かうようになります。 「非対称」ではそれぞれの方向に向かう旅客数は独立に決められます。「無効」では行き先別分配をしなくなります。 @@ -3823,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}この STR_VEHICLE_LIST_REPLACE_VEHICLES :輸送機器更新 STR_VEHICLE_LIST_SEND_FOR_SERVICING :回送して点検 STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}収益(今年): {CURRENCY_LONG} (収益(去年): {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :列車庫へ回送 STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :車庫へ回送 @@ -4591,6 +4593,7 @@ STR_AI_CONFIG_RANDOM_AI :ランダムな STR_AI_CONFIG_NONE :(なし) STR_AI_CONFIG_NAME_VERSION :{STRING} {YELLOW}v{NUM} STR_AI_CONFIG_MAX_COMPETITORS :{LTBLUE}最大競争会社数: {ORANGE}{COMMA} +STR_AI_CONFIG_COMPETITORS_INTERVAL :{LTBLUE}競争会社の創業間隔: {ORANGE}{COMMA}分 STR_AI_CONFIG_MOVE_UP :{BLACK}上に移動 STR_AI_CONFIG_MOVE_UP_TOOLTIP :{BLACK}選択したAIの順位を上げる @@ -5601,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/korean.txt b/src/lang/korean.txt index b77b15c662..080bacb285 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -3828,8 +3828,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}이 목 STR_VEHICLE_LIST_REPLACE_VEHICLES :차량 교체 STR_VEHICLE_LIST_SEND_FOR_SERVICING :점검하러 보내기 STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}올해 이익: {CURRENCY_LONG} (작년: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :차량기지로 보내기 STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :차고지로 보내기 @@ -5607,33 +5605,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{G=m}{BLACK}1 STR_BLACK_2 :{G=f}{BLACK}2 diff --git a/src/lang/latin.txt b/src/lang/latin.txt index 2beef7f1c0..66554994b5 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -5457,33 +5457,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 30cf936de2..b5c54257cd 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -3808,8 +3808,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Sūtīt STR_VEHICLE_LIST_REPLACE_VEHICLES :Nomainīt transportlīdzekļus STR_VEHICLE_LIST_SEND_FOR_SERVICING :Sūtīt uz apkopi STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Peļņa šogad: {CURRENCY_LONG} (pērn: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Sūtīt uz depo STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Sūtīt uz depo @@ -5571,33 +5569,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index 26d135c9ec..f2d5ac4f1f 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -3954,7 +3954,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Siųsti STR_VEHICLE_LIST_REPLACE_VEHICLES :Keisti tr. priemones STR_VEHICLE_LIST_SEND_FOR_SERVICING :Siųsti techninės apžiūros STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Šių metų pelnas: {CURRENCY_LONG} (praėjusių metų: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Siųsti į depą STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Siųsti į depą @@ -6028,33 +6027,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 8c85afe85c..e10ac61b21 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -3800,8 +3800,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Schéckt STR_VEHICLE_LIST_REPLACE_VEHICLES :Gefierer ersetzen STR_VEHICLE_LIST_SEND_FOR_SERVICING :An d'Revisioun schécken STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit dëst Joer: {CURRENCY_LONG} (lescht Joer: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :An de Schapp schécken STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :An den Depot schécken @@ -5564,33 +5562,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/macedonian.txt b/src/lang/macedonian.txt index bf0efa52d4..0ab05ad98c 100644 --- a/src/lang/macedonian.txt +++ b/src/lang/macedonian.txt @@ -2238,33 +2238,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/malay.txt b/src/lang/malay.txt index b7e5433b31..c66ec92406 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -4739,33 +4739,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/maltese.txt b/src/lang/maltese.txt index 0dacd67a81..875fb118fe 100644 --- a/src/lang/maltese.txt +++ b/src/lang/maltese.txt @@ -1738,33 +1738,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/marathi.txt b/src/lang/marathi.txt index 99d362f958..376237398c 100644 --- a/src/lang/marathi.txt +++ b/src/lang/marathi.txt @@ -2108,33 +2108,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index a5db6c1e1b..12405d545e 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -5485,33 +5485,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 306b8cae03..b18b471f4a 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -4976,33 +4976,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/persian.txt b/src/lang/persian.txt index 96830e2a1c..77c3508342 100644 --- a/src/lang/persian.txt +++ b/src/lang/persian.txt @@ -4277,33 +4277,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/polish.txt b/src/lang/polish.txt index f91343c51a..dc16057939 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1081,7 +1081,7 @@ STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION :{BLACK}Pokaż o # Playlist window STR_PLAYLIST_MUSIC_SELECTION_SETNAME :{WHITE}Program muzyczny - „{STRING}” -STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTBLUE}{ZEROFILL_NUM} "{STRING}" +STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTBLUE}{ZEROFILL_NUM} „{STRING}” STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Wykaz ścieżek STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Program - „{STRING}” STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Wyczyść @@ -4207,8 +4207,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Wyślij STR_VEHICLE_LIST_REPLACE_VEHICLES :Zastąp pojazdy STR_VEHICLE_LIST_SEND_FOR_SERVICING :Wyślij do serwisu STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Zysk w tym roku: {CURRENCY_LONG} (ostatni rok: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Wyślij do warsztatów STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Wyślij do zajezdni @@ -6029,33 +6027,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 63d43f8f32..279b46dae8 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -3828,8 +3828,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Enviar i STR_VEHICLE_LIST_REPLACE_VEHICLES :Substituir Veículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Serviço STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Lucro deste ano: {CURRENCY_LONG} (último ano: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar para Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar para Depósito @@ -5607,33 +5605,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 5937dc2a2d..3b4dba8d42 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -3801,8 +3801,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Trimite STR_VEHICLE_LIST_REPLACE_VEHICLES :Înlocuiește vehiculele STR_VEHICLE_LIST_SEND_FOR_SERVICING :Trimite in service STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit anul acesta: {CURRENCY_LONG} (anul trecut: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Trimite la depou STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Trimite la depou @@ -5577,33 +5575,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 88eb16f643..6ecd782ee4 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -4002,8 +4002,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Упра STR_VEHICLE_LIST_REPLACE_VEHICLES :Замена транспорта STR_VEHICLE_LIST_SEND_FOR_SERVICING :Отправить на тех. обслуживание STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прибыль в этом году: {CURRENCY_LONG} (в прошлом году: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Отправить в депо STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Отправить в гараж @@ -5830,33 +5828,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 48284c5029..bc20e4454e 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -3987,8 +3987,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Pošalji STR_VEHICLE_LIST_REPLACE_VEHICLES :Obnovi vozila STR_VEHICLE_LIST_SEND_FOR_SERVICING :Pošalji na servis STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Ovogodišnja zarada: {CURRENCY_LONG} (prošle godine: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Pošalji u depo STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Pošalji u depo @@ -5765,33 +5763,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index dab40d810d..d550ddeb9d 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -3800,8 +3800,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}向所 STR_VEHICLE_LIST_REPLACE_VEHICLES :替换车辆/飞机/船只 STR_VEHICLE_LIST_SEND_FOR_SERVICING :进行保养 STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}今年利润:{CURRENCY_LONG} (去年利润:{CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :前往列车车库 STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :前往汽车车库 @@ -5574,33 +5572,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 3017735ebf..bea3ff1063 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -3873,8 +3873,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Zadať p STR_VEHICLE_LIST_REPLACE_VEHICLES :Vymeniť vozidlá STR_VEHICLE_LIST_SEND_FOR_SERVICING :Vykonať servis STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Zisk tento rok: {CURRENCY_LONG} (minulý rok: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Poslať do depa STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Poslať do garáže @@ -5651,33 +5649,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 50ca2ecf32..2ea7c48a7d 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -5276,33 +5276,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 8ae6ed6f05..a40b0552c7 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -3799,8 +3799,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia in STR_VEHICLE_LIST_REPLACE_VEHICLES :Reemplazar vehículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Mantenimiento STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Beneficio este año: {CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar a Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar a Depósito @@ -5561,33 +5559,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index f8e079e636..b01cb43e4a 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -3800,8 +3800,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Enviar i STR_VEHICLE_LIST_REPLACE_VEHICLES :Reemplazar vehículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar a mantenimiento STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Ganancias este año: {CURRENCY_LONG} (último año: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar a depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar a depósito @@ -5564,33 +5562,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 11d759b92f..1f3b4b0fa5 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -3802,8 +3802,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Skicka i STR_VEHICLE_LIST_REPLACE_VEHICLES :Byt ut fordon STR_VEHICLE_LIST_SEND_FOR_SERVICING :Skicka på service STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Vinst detta år: {CURRENCY_LONG} (förra året: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Skicka till depå STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Skicka till depå @@ -5578,33 +5576,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 28bf1d7b66..bc4655a735 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -5054,33 +5054,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/thai.txt b/src/lang/thai.txt index 8cb07fdf77..d960cd76a8 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -5190,33 +5190,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE} {CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index d71cea6b86..e95e67d371 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -3802,8 +3802,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}向清 STR_VEHICLE_LIST_REPLACE_VEHICLES :替換車輛 STR_VEHICLE_LIST_SEND_FOR_SERVICING :送去維護 STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}今年盈利:{CURRENCY_LONG} (去年盈利:{CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :送到機廠 STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :送到車廠 @@ -5578,33 +5576,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 5af62ef30e..22cbcd71e6 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -3828,8 +3828,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Listedek STR_VEHICLE_LIST_REPLACE_VEHICLES :Araçları Değiştir STR_VEHICLE_LIST_SEND_FOR_SERVICING :Bakıma Gönder STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Bu seneki kar: {CURRENCY_LONG} (geçen sene: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Garaja Gönder STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Garaja Gönder @@ -5617,33 +5615,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 7488fdd2e7..d0dfe09e2b 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -3923,8 +3923,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Дати STR_VEHICLE_LIST_REPLACE_VEHICLES :Оновлення STR_VEHICLE_LIST_SEND_FOR_SERVICING :Відправити на техогляд STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прибуток цього року: {CURRENCY_LONG} (торік: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Відправити до депо STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Відправити в гараж @@ -5724,33 +5722,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/urdu.txt b/src/lang/urdu.txt index 12bdf58589..47a96f74b9 100644 --- a/src/lang/urdu.txt +++ b/src/lang/urdu.txt @@ -3174,33 +3174,8 @@ STR_JUST_STRING_STRING :{STRING}{STRING STR_JUST_RAW_STRING :{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}۱ STR_BLACK_2 :{BLACK}۲ diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index f7df733a98..aba4254d97 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -931,8 +931,22 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Sao ché # Game options window STR_GAME_OPTIONS_CAPTION :{WHITE}Cấu Hình Trò Chơi - - +STR_GAME_OPTIONS_TAB_GENERAL :Tổng quát +STR_GAME_OPTIONS_TAB_GENERAL_TT :{BLACK}Điều chỉnh thiết lập tổng quát +STR_GAME_OPTIONS_TAB_GRAPHICS :Đồ họa +STR_GAME_OPTIONS_TAB_GRAPHICS_TT :{BLACK}Điều chỉnh thiết lập đồ họa +STR_GAME_OPTIONS_TAB_SOUND :Âm thanh +STR_GAME_OPTIONS_TAB_SOUND_TT :{BLACK}Lựa chọn thiết lập cho âm thanh và nhạc + +STR_GAME_OPTIONS_VOLUME :Âm lượng +STR_GAME_OPTIONS_SFX_VOLUME :Hiệu ứng âm thanh +STR_GAME_OPTIONS_MUSIC_VOLUME :Âm nhạc + +STR_GAME_OPTIONS_VOLUME_0 :0% +STR_GAME_OPTIONS_VOLUME_25 :25% +STR_GAME_OPTIONS_VOLUME_50 :50% +STR_GAME_OPTIONS_VOLUME_75 :75% +STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Đơn vị tiền tệ STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Lựa chọn đơn vị tiền tệ @@ -3813,8 +3827,6 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Gửi ch STR_VEHICLE_LIST_REPLACE_VEHICLES :Thay phương tiện STR_VEHICLE_LIST_SEND_FOR_SERVICING :Gửi về bảo trì STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Lợi nhuận năm nay: {CURRENCY_LONG} (năm ngoái: {CURRENCY_LONG}) -STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] -STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Gửi về xưởng STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Gửi về xưởng @@ -5592,33 +5604,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index 9df1ddf322..99838f5e96 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -5099,33 +5099,8 @@ STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} # Slightly 'raw' stringcodes with colour or size -STR_BLACK_COMMA :{BLACK}{COMMA} -STR_TINY_BLACK_COMMA :{TINY_FONT}{BLACK}{COMMA} -STR_TINY_COMMA :{TINY_FONT}{COMMA} -STR_BLUE_COMMA :{BLUE}{COMMA} -STR_RED_COMMA :{RED}{COMMA} -STR_WHITE_COMMA :{WHITE}{COMMA} -STR_TINY_BLACK_DECIMAL :{TINY_FONT}{BLACK}{DECIMAL} -STR_COMPANY_MONEY :{WHITE}{CURRENCY_LONG} -STR_BLACK_DATE_LONG :{BLACK}{DATE_LONG} -STR_WHITE_DATE_LONG :{WHITE}{DATE_LONG} -STR_SHORT_DATE :{WHITE}{DATE_TINY} -STR_DATE_LONG_SMALL :{TINY_FONT}{BLACK}{DATE_LONG} -STR_TINY_GROUP :{TINY_FONT}{GROUP} -STR_BLACK_INT :{BLACK}{NUM} -STR_ORANGE_INT :{ORANGE}{NUM} STR_WHITE_SIGN :{WHITE}{SIGN} -STR_TINY_BLACK_STATION :{TINY_FONT}{BLACK}{STATION} -STR_BLACK_STRING :{BLACK}{STRING} -STR_BLACK_RAW_STRING :{BLACK}{STRING} -STR_ORANGE_STRING :{ORANGE}{STRING} -STR_LTBLUE_STRING :{LTBLUE}{STRING} -STR_WHITE_STRING :{WHITE}{STRING} -STR_ORANGE_STRING1_WHITE :{ORANGE}{STRING}{WHITE} -STR_ORANGE_STRING1_LTBLUE :{ORANGE}{STRING}{LTBLUE} STR_TINY_BLACK_HEIGHT :{TINY_FONT}{BLACK}{HEIGHT} -STR_TINY_BLACK_VEHICLE :{TINY_FONT}{BLACK}{VEHICLE} -STR_TINY_RIGHT_ARROW :{TINY_FONT}{RIGHT_ARROW} STR_BLACK_1 :{BLACK}1 STR_BLACK_2 :{BLACK}2 From b67cf7f94a53327edb8d15ab1b76bd7b85d9faf9 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 6 May 2023 15:54:58 +0100 Subject: [PATCH 05/38] Change: Replace ScriptLog data array with std::deque. (#10770) Due to cyclic header dependency this requires moving the data types used by ScriptLog out of the ScriptLog class. --- src/script/api/CMakeLists.txt | 1 + src/script/api/script_controller.cpp | 4 +- src/script/api/script_log.cpp | 67 ++++++++-------------------- src/script/api/script_log.hpp | 34 +------------- src/script/api/script_log_types.hpp | 47 +++++++++++++++++++ src/script/api/script_object.cpp | 2 +- src/script/api/script_object.hpp | 3 +- src/script/script_gui.cpp | 54 +++++++++++----------- src/script/script_instance.cpp | 5 +-- src/script/script_instance.hpp | 3 +- src/script/script_storage.hpp | 7 +-- 11 files changed, 107 insertions(+), 120 deletions(-) create mode 100644 src/script/api/script_log_types.hpp diff --git a/src/script/api/CMakeLists.txt b/src/script/api/CMakeLists.txt index de559d2229..0cab134930 100644 --- a/src/script/api/CMakeLists.txt +++ b/src/script/api/CMakeLists.txt @@ -180,6 +180,7 @@ add_files( script_league.hpp script_list.hpp script_log.hpp + script_log_types.hpp script_map.hpp script_marine.hpp script_newgrf.hpp diff --git a/src/script/api/script_controller.cpp b/src/script/api/script_controller.cpp index 44a4b152b8..23568df621 100644 --- a/src/script/api/script_controller.cpp +++ b/src/script/api/script_controller.cpp @@ -53,7 +53,7 @@ char log_message[1024]; seprintf(log_message, lastof(log_message), "Break: %s", message); - ScriptLog::Log(ScriptLog::LOG_SQ_ERROR, log_message); + ScriptLog::Log(ScriptLogTypes::LOG_SQ_ERROR, log_message); /* Inform script developer that their script has been paused and * needs manual action to continue. */ @@ -66,7 +66,7 @@ /* static */ void ScriptController::Print(bool error_msg, const char *message) { - ScriptLog::Log(error_msg ? ScriptLog::LOG_SQ_ERROR : ScriptLog::LOG_SQ_INFO, message); + ScriptLog::Log(error_msg ? ScriptLogTypes::LOG_SQ_ERROR : ScriptLogTypes::LOG_SQ_INFO, message); } ScriptController::ScriptController(CompanyID company) : diff --git a/src/script/api/script_log.cpp b/src/script/api/script_log.cpp index 12c4533ca2..dd3a78c071 100644 --- a/src/script/api/script_log.cpp +++ b/src/script/api/script_log.cpp @@ -8,6 +8,7 @@ /** @file script_log.cpp Implementation of ScriptLog. */ #include "../../stdafx.h" +#include "script_log_types.hpp" #include "script_log.hpp" #include "../../core/alloc_func.hpp" #include "../../debug.h" @@ -18,75 +19,45 @@ /* static */ void ScriptLog::Info(const char *message) { - ScriptLog::Log(LOG_INFO, message); + ScriptLog::Log(ScriptLogTypes::LOG_INFO, message); } /* static */ void ScriptLog::Warning(const char *message) { - ScriptLog::Log(LOG_WARNING, message); + ScriptLog::Log(ScriptLogTypes::LOG_WARNING, message); } /* static */ void ScriptLog::Error(const char *message) { - ScriptLog::Log(LOG_ERROR, message); + ScriptLog::Log(ScriptLogTypes::LOG_ERROR, message); } -/* static */ void ScriptLog::Log(ScriptLog::ScriptLogType level, const char *message) +/* static */ void ScriptLog::Log(ScriptLogTypes::ScriptLogType level, const char *message) { - if (ScriptObject::GetLogPointer() == nullptr) { - ScriptObject::GetLogPointer() = new LogData(); - LogData *log = (LogData *)ScriptObject::GetLogPointer(); + ScriptLogTypes::LogData &logdata = ScriptObject::GetLogData(); - log->lines = CallocT(400); - log->type = CallocT(400); - log->count = 400; - log->pos = log->count - 1; - log->used = 0; - } - LogData *log = (LogData *)ScriptObject::GetLogPointer(); - - /* Go to the next log-line */ - log->pos = (log->pos + 1) % log->count; - - if (log->used != log->count) log->used++; + /* Limit the log to 400 lines. */ + if (logdata.size() >= 400U) logdata.pop_front(); - /* Free last message, and write new message */ - free(log->lines[log->pos]); - log->lines[log->pos] = stredup(message); - log->type[log->pos] = level; + auto &line = logdata.emplace_back(); + line.type = level; /* Cut string after first \n */ - char *p; - while ((p = strchr(log->lines[log->pos], '\n')) != nullptr) { - *p = '\0'; - break; - } + const char *newline = strchr(message, '\n'); + line.text = std::string(message, 0, newline == nullptr ? strlen(message) : newline - message); char logc; switch (level) { - case LOG_SQ_ERROR: logc = 'S'; break; - case LOG_ERROR: logc = 'E'; break; - case LOG_SQ_INFO: logc = 'P'; break; - case LOG_WARNING: logc = 'W'; break; - case LOG_INFO: logc = 'I'; break; - default: logc = '?'; break; + case ScriptLogTypes::LOG_SQ_ERROR: logc = 'S'; break; + case ScriptLogTypes::LOG_ERROR: logc = 'E'; break; + case ScriptLogTypes::LOG_SQ_INFO: logc = 'P'; break; + case ScriptLogTypes::LOG_WARNING: logc = 'W'; break; + case ScriptLogTypes::LOG_INFO: logc = 'I'; break; + default: logc = '?'; break; } /* Also still print to debug window */ - Debug(script, level, "[{}] [{}] {}", (uint)ScriptObject::GetRootCompany(), logc, log->lines[log->pos]); + Debug(script, level, "[{}] [{}] {}", (uint)ScriptObject::GetRootCompany(), logc, line.text); InvalidateWindowData(WC_SCRIPT_DEBUG, 0, ScriptObject::GetRootCompany()); } - -/* static */ void ScriptLog::FreeLogPointer() -{ - LogData *log = (LogData *)ScriptObject::GetLogPointer(); - - for (int i = 0; i < log->count; i++) { - free(log->lines[i]); - } - - free(log->lines); - free(log->type); - delete log; -} diff --git a/src/script/api/script_log.hpp b/src/script/api/script_log.hpp index b6767d3f86..b2acd1e171 100644 --- a/src/script/api/script_log.hpp +++ b/src/script/api/script_log.hpp @@ -22,32 +22,6 @@ class ScriptLog : public ScriptObject { friend class ScriptController; public: - /** - * Log levels; The value is also feed to Debug() lvl. - * This has no use for you, as script writer. - * @api -all - */ - enum ScriptLogType { - LOG_SQ_ERROR = 0, ///< Squirrel printed an error. - LOG_ERROR = 1, ///< User printed an error. - LOG_SQ_INFO = 2, ///< Squirrel printed some info. - LOG_WARNING = 3, ///< User printed some warning. - LOG_INFO = 4, ///< User printed some info. - }; - - /** - * Internal representation of the log-data inside the script. - * This has no use for you, as script writer. - * @api -all - */ - struct LogData { - char **lines; ///< The log-lines. - ScriptLog::ScriptLogType *type; ///< Per line, which type of log it was. - int count; ///< Total amount of log-lines possible. - int pos; ///< Current position in lines. - int used; ///< Total amount of used log-lines. - }; - /** * Print an Info message to the logs. * @param message The message to log. @@ -69,17 +43,11 @@ public: */ static void Error(const char *message); - /** - * Free the log pointer. - * @api -all - */ - static void FreeLogPointer(); - private: /** * Internal command to log the message in a common way. */ - static void Log(ScriptLog::ScriptLogType level, const char *message); + static void Log(ScriptLogTypes::ScriptLogType level, const char *message); }; #endif /* SCRIPT_LOG_HPP */ diff --git a/src/script/api/script_log_types.hpp b/src/script/api/script_log_types.hpp new file mode 100644 index 0000000000..b10ea0cea3 --- /dev/null +++ b/src/script/api/script_log_types.hpp @@ -0,0 +1,47 @@ +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file script_log_types.hpp Data types for script log messages. */ + +#ifndef SCRIPT_LOG_TYPES_HPP +#define SCRIPT_LOG_TYPES_HPP + +#include + +namespace ScriptLogTypes { + /** + * Log levels; The value is also feed to Debug() lvl. + * This has no use for you, as script writer. + * @api -all + */ + enum ScriptLogType { + LOG_SQ_ERROR = 0, ///< Squirrel printed an error. + LOG_ERROR = 1, ///< User printed an error. + LOG_SQ_INFO = 2, ///< Squirrel printed some info. + LOG_WARNING = 3, ///< User printed some warning. + LOG_INFO = 4, ///< User printed some info. + }; + + /** + * Internal representation of the log-data inside the script. + * This has no use for you, as script writer. + * @api -all + */ + struct LogLine { + std::string text; ///< The text + ScriptLogType type; ///< Text type + }; + + /** + * Internal representation of the log-data inside the script. + * This has no use for you, as script writer. + * @api -all + */ + using LogData = std::deque; ///< The log type +}; + +#endif /* SCRIPT_LOG_TYPES_HPP */ diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index f15b9d56ec..b0692c2aa7 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -213,7 +213,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->event_data; } -/* static */ void *&ScriptObject::GetLogPointer() +/* static */ ScriptLogTypes::LogData &ScriptObject::GetLogData() { return GetStorage()->log_data; } diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index a8d01d5c0d..606bc7c584 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -18,6 +18,7 @@ #include "../../core/random_func.hpp" #include "script_types.hpp" +#include "script_log_types.hpp" #include "../script_suspend.hpp" #include "../squirrel.hpp" @@ -276,7 +277,7 @@ protected: /** * Get the pointer to store log message in. */ - static void *&GetLogPointer(); + static ScriptLogTypes::LogData &GetLogData(); /** * Get an allocated string with all control codes stripped off. diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index aeec99445f..e77c1c7ede 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -704,10 +704,10 @@ struct ScriptDebugWindow : public Window { int highlight_row; ///< The output row that matches the given string, or -1 Scrollbar *vscroll; ///< Cache of the vertical scrollbar. - ScriptLog::LogData *GetLogPointer() const + ScriptLogTypes::LogData &GetLogData() const { - if (script_debug_company == OWNER_DEITY) return (ScriptLog::LogData *)Game::GetInstance()->GetLogPointer(); - return (ScriptLog::LogData *)Company::Get(script_debug_company)->ai_instance->GetLogPointer(); + if (script_debug_company == OWNER_DEITY) return Game::GetInstance()->GetLogData(); + return Company::Get(script_debug_company)->ai_instance->GetLogData(); } /** @@ -845,9 +845,9 @@ struct ScriptDebugWindow : public Window { /* If there are no active companies, don't display anything else. */ if (script_debug_company == INVALID_COMPANY) return; - ScriptLog::LogData *log = this->GetLogPointer(); + ScriptLogTypes::LogData &log = this->GetLogData(); - int scroll_count = (log == nullptr) ? 0 : log->used; + int scroll_count = (int)log.size(); if (this->vscroll->GetCount() != scroll_count) { this->vscroll->SetCount(scroll_count); @@ -855,15 +855,15 @@ struct ScriptDebugWindow : public Window { this->SetWidgetDirty(WID_SCRD_SCROLLBAR); } - if (log == nullptr) return; + if (log.empty()) return; /* Detect when the user scrolls the window. Enable autoscroll when the * bottom-most line becomes visible. */ if (this->last_vscroll_pos != this->vscroll->GetPosition()) { - this->autoscroll = this->vscroll->GetPosition() >= log->used - this->vscroll->GetCapacity(); + this->autoscroll = this->vscroll->GetPosition() >= log.size() - this->vscroll->GetCapacity(); } if (this->autoscroll) { - int scroll_pos = std::max(0, log->used - this->vscroll->GetCapacity()); + int scroll_pos = std::max(0, (int)log.size() - this->vscroll->GetCapacity()); if (this->vscroll->SetPosition(scroll_pos)) { /* We need a repaint */ this->SetWidgetDirty(WID_SCRD_SCROLLBAR); @@ -900,32 +900,31 @@ struct ScriptDebugWindow : public Window { if (widget != WID_SCRD_LOG_PANEL) return; - ScriptLog::LogData *log = this->GetLogPointer(); - if (log == nullptr) return; + ScriptLogTypes::LogData &log = this->GetLogData(); + if (log.empty()) return; Rect br = r.Shrink(WidgetDimensions::scaled.bevel); Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); - for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < log->used; i++) { - int pos = (i + log->pos + 1 - log->used + log->count) % log->count; - if (log->lines[pos] == nullptr) break; + for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && (size_t)i < log.size(); i++) { + const ScriptLogTypes::LogLine &line = log[i]; TextColour colour; - switch (log->type[pos]) { - case ScriptLog::LOG_SQ_INFO: colour = TC_BLACK; break; - case ScriptLog::LOG_SQ_ERROR: colour = TC_WHITE; break; - case ScriptLog::LOG_INFO: colour = TC_BLACK; break; - case ScriptLog::LOG_WARNING: colour = TC_YELLOW; break; - case ScriptLog::LOG_ERROR: colour = TC_RED; break; - default: colour = TC_BLACK; break; + switch (line.type) { + case ScriptLogTypes::LOG_SQ_INFO: colour = TC_BLACK; break; + case ScriptLogTypes::LOG_SQ_ERROR: colour = TC_WHITE; break; + case ScriptLogTypes::LOG_INFO: colour = TC_BLACK; break; + case ScriptLogTypes::LOG_WARNING: colour = TC_YELLOW; break; + case ScriptLogTypes::LOG_ERROR: colour = TC_RED; break; + default: colour = TC_BLACK; break; } /* Check if the current line should be highlighted */ - if (pos == this->highlight_row) { + if (i == this->highlight_row) { GfxFillRect(br.left, tr.top, br.right, tr.top + this->resize.step_height - 1, PC_BLACK); if (colour == TC_BLACK) colour = TC_WHITE; // Make black text readable by inverting it to white. } - DrawString(tr, log->lines[pos], colour, SA_LEFT | SA_FORCE); + DrawString(tr, line.text, colour, SA_LEFT | SA_FORCE); tr.top += this->resize.step_height; } } @@ -1041,11 +1040,11 @@ struct ScriptDebugWindow : public Window { * This needs to be done in gameloop-scope, so the AI is suspended immediately. */ if (!gui_scope && data == script_debug_company && this->IsValidDebugCompany(script_debug_company) && this->break_check_enabled && !this->break_string_filter.IsEmpty()) { /* Get the log instance of the active company */ - ScriptLog::LogData *log = this->GetLogPointer(); + ScriptLogTypes::LogData &log = this->GetLogData(); - if (log != nullptr) { + if (!log.empty()) { this->break_string_filter.ResetState(); - this->break_string_filter.AddLine(log->lines[log->pos]); + this->break_string_filter.AddLine(log.back().text); if (this->break_string_filter.GetState()) { /* Pause execution of script. */ if (!this->IsDead()) { @@ -1062,7 +1061,7 @@ struct ScriptDebugWindow : public Window { } /* Highlight row that matched */ - this->highlight_row = log->pos; + this->highlight_row = (int)(log.size() - 1); } } } @@ -1071,8 +1070,7 @@ struct ScriptDebugWindow : public Window { this->SelectValidDebugCompany(); - ScriptLog::LogData *log = script_debug_company != INVALID_COMPANY ? this->GetLogPointer() : nullptr; - this->vscroll->SetCount((log == nullptr) ? 0 : log->used); + this->vscroll->SetCount(script_debug_company != INVALID_COMPANY ? (int)this->GetLogData().size() : 0); /* Update company buttons */ for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) { diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index c6ab1d6008..b7a4497aae 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -36,7 +36,6 @@ ScriptStorage::~ScriptStorage() { /* Free our pointers */ if (event_data != nullptr) ScriptEventController::FreeEventPointer(); - if (log_data != nullptr) ScriptLog::FreeLogPointer(); } /** @@ -315,11 +314,11 @@ ScriptStorage *ScriptInstance::GetStorage() return this->storage; } -void *ScriptInstance::GetLogPointer() +ScriptLogTypes::LogData &ScriptInstance::GetLogData() { ScriptObject::ActiveInstance active(this); - return ScriptObject::GetLogPointer(); + return ScriptObject::GetLogData(); } /* diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 65a6414bb5..dae1f6940d 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -14,6 +14,7 @@ #include #include #include "script_suspend.hpp" +#include "script_log_types.hpp" #include "../command_type.h" #include "../company_type.h" @@ -95,7 +96,7 @@ public: /** * Get the log pointer of this script. */ - void *GetLogPointer(); + ScriptLogTypes::LogData &GetLogData(); /** * Return a true/false reply for a DoCommand. diff --git a/src/script/script_storage.hpp b/src/script/script_storage.hpp index 44d17af837..b7a16dcb15 100644 --- a/src/script/script_storage.hpp +++ b/src/script/script_storage.hpp @@ -17,6 +17,8 @@ #include "../goal_type.h" #include "../story_type.h" +#include "script_log_types.hpp" + #include "table/strings.h" #include @@ -54,7 +56,7 @@ private: RailType rail_type; ///< The current railtype we build. void *event_data; ///< Pointer to the event data storage. - void *log_data; ///< Pointer to the log data storage. + ScriptLogTypes::LogData log_data;///< Log data storage. public: ScriptStorage() : @@ -72,8 +74,7 @@ public: /* calback_value (can't be set) */ road_type (INVALID_ROADTYPE), rail_type (INVALID_RAILTYPE), - event_data (nullptr), - log_data (nullptr) + event_data (nullptr) { } ~ScriptStorage(); From 31d1a323ef8ed6a41f39669c69848bf25d9a7b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sat, 6 May 2023 16:58:47 +0200 Subject: [PATCH 06/38] Fix #10771, 3901ef9: GRFConfig.filename is now a std::string (#10774) --- src/saveload/newgrf_sl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/saveload/newgrf_sl.cpp b/src/saveload/newgrf_sl.cpp index 1c2fd7ff24..934a642741 100644 --- a/src/saveload/newgrf_sl.cpp +++ b/src/saveload/newgrf_sl.cpp @@ -63,7 +63,7 @@ void NewGRFMappingChunkHandler::Load() const static const SaveLoad _grfconfig_desc[] = { - SLE_STR(GRFConfig, filename, SLE_STR, 0x40), + SLE_SSTR(GRFConfig, filename, SLE_STR), SLE_VAR(GRFConfig, ident.grfid, SLE_UINT32), SLE_ARR(GRFConfig, ident.md5sum, SLE_UINT8, 16), SLE_CONDVAR(GRFConfig, version, SLE_UINT32, SLV_151, SL_MAX_VERSION), From 0fc21b56869f32d07d36741ba703f849f8672bbd Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sat, 6 May 2023 11:54:38 -0400 Subject: [PATCH 07/38] Fix: Engine age is in months, not days (#10773) --- src/engine.cpp | 6 +++--- src/engine_base.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine.cpp b/src/engine.cpp index 65d9d77379..0cc6e9cf52 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -611,8 +611,8 @@ void CalcEngineReliability(Engine *e, bool new_month) re = Engine::Get(re->info.variant_id); } - uint age = re->age; - if (new_month && re->index > e->index && age != MAX_DAY) age++; /* parent variant's age has not yet updated. */ + uint32 age = re->age; + if (new_month && re->index > e->index && age != INT32_MAX) age++; /* parent variant's age has not yet updated. */ /* Check for early retirement */ if (e->company_avail != 0 && !_settings_game.vehicle.never_expire_vehicles && e->info.base_life != 0xFF) { @@ -1094,7 +1094,7 @@ void EnginesMonthlyLoop() bool refresh = false; for (Engine *e : Engine::Iterate()) { /* Age the vehicle */ - if ((e->flags & ENGINE_AVAILABLE) && e->age != MAX_DAY) { + if ((e->flags & ENGINE_AVAILABLE) && e->age != INT32_MAX) { e->age++; CalcEngineReliability(e, true); refresh = true; diff --git a/src/engine_base.h b/src/engine_base.h index d1bb8a3e0a..a05e8ee98f 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -37,7 +37,7 @@ extern EnginePool _engine_pool; struct Engine : EnginePool::PoolItem<&_engine_pool> { std::string name; ///< Custom name of engine. TimerGameCalendar::Date intro_date; ///< Date of introduction of the engine. - TimerGameCalendar::Date age; ///< Age of the engine, in days. + int32 age; ///< Age of the engine in months. uint16 reliability; ///< Current reliability of the engine. uint16 reliability_spd_dec; ///< Speed of reliability decay between services (per day). uint16 reliability_start; ///< Initial reliability of the engine. From b14c5aff1f60980fd605fb5a7af104b22c8ced38 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 6 May 2023 18:15:40 +0200 Subject: [PATCH 08/38] Fix: [Win32] Text line breaking did not properly handle punctuation characters. (#10775) --- src/os/windows/string_uniscribe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index f1a859aa10..672c2dcd3d 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -341,13 +341,13 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF } /* Gather runs until the line is full. */ - while (last_run != this->ranges.end() && cur_width < max_width) { + while (last_run != this->ranges.end() && cur_width <= max_width) { cur_width += last_run->total_advance; ++last_run; } /* If the text does not fit into the available width, find a suitable breaking point. */ - int remaining_offset = (last_run - 1)->len; + int remaining_offset = (last_run - 1)->len + 1; int whitespace_count = 0; if (cur_width > max_width) { std::vector log_attribs; @@ -433,7 +433,7 @@ static std::vector UniscribeItemizeString(UniscribeParagraphLayoutF cur_pos += run.total_advance; } - if (remaining_offset + whitespace_count < (last_run - 1)->len) { + if (remaining_offset + whitespace_count - 1 < (last_run - 1)->len) { /* We didn't use up all of the last run, store remainder for the next line. */ this->cur_range_offset = remaining_offset + whitespace_count - 1; this->cur_range = last_run - 1; From 97b77f025127ffa09ca3d20bf2fb34ccb7a63075 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 6 May 2023 18:39:19 +0000 Subject: [PATCH 09/38] Update: Translations from eints english (au): 5 changes by krysclarke english (us): 5 changes by 2TallTyler korean: 5 changes by telk5093 italian: 5 changes by Rivarossi russian: 5 changes by Ln-Wolf finnish: 5 changes by hpiirai turkish: 5 changes by densxd portuguese: 5 changes by azulcosta --- src/lang/english_AU.txt | 5 +++++ src/lang/english_US.txt | 5 +++++ src/lang/finnish.txt | 5 +++++ src/lang/italian.txt | 5 +++++ src/lang/korean.txt | 5 +++++ src/lang/portuguese.txt | 5 +++++ src/lang/russian.txt | 5 +++++ src/lang/turkish.txt | 5 +++++ 8 files changed, 40 insertions(+) diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index f06d0c8020..8867f9a63f 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1170,6 +1170,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Expand a STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Collapse all STR_CONFIG_SETTING_RESET_ALL :{BLACK}Reset all values STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(no explanation available) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Default value: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Setting type: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Client setting (not stored in saves; affects all games) @@ -3827,6 +3828,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for Servicing STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send to Depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send to Depot @@ -5588,11 +5591,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index b738947df7..4a51f38edb 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1170,6 +1170,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Expand a STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Collapse all STR_CONFIG_SETTING_RESET_ALL :{BLACK}Reset all values STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(no explanation available) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Default value: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Setting type: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Client setting (not stored in saves; affects all games) @@ -3827,6 +3828,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for Maintenance STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send to Depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send to Depot @@ -5588,11 +5591,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index dbcc5429b4..22d0ed40b6 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1170,6 +1170,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Avaa kai STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Sulje kaikki STR_CONFIG_SETTING_RESET_ALL :{BLACK}Palauta oletukset STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(selitystä ei saatavilla) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Oletusarvo: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Asetuksen tyyppi: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Yleinen asetus (ei tallenneta tallennuksiin; vaikuttaa kaikkiin peleihin) @@ -3827,6 +3828,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Ohjaa ka STR_VEHICLE_LIST_REPLACE_VEHICLES :Korvaa kulkuneuvoja STR_VEHICLE_LIST_SEND_FOR_SERVICING :Lähetä huoltoon STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Tuotto tänä vuonna: {CURRENCY_LONG} (viime vuonna: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Lähetä varikolle STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Lähetä varikolle @@ -5588,11 +5591,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 7615cb3bfe..e740ac05fd 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1184,6 +1184,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Espandi STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Comprimi tutti STR_CONFIG_SETTING_RESET_ALL :{BLACK}Resetta tutti i valori STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(descrizione non disponibile) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valore predefinito: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Tipo impostazione: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Impostazione del client (non conservata nei salvataggi; influenza tutte le partite) @@ -3868,6 +3869,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Invia is STR_VEHICLE_LIST_REPLACE_VEHICLES :Rimpiazza veicoli STR_VEHICLE_LIST_SEND_FOR_SERVICING :Manutenzione STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profitto quest'anno: {CURRENCY_LONG} (anno scorso: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Manda al deposito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Manda al deposito @@ -5629,11 +5632,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 080bacb285..5358c016d7 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1171,6 +1171,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}모두 STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}모두 접기 STR_CONFIG_SETTING_RESET_ALL :{BLACK}모든 설정 초기화 STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(설명이 존재하지 않습니다) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}기본값: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}설정 종류: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :접속자 설정 (게임 저장 파일에 저장되지 않음; 모든 게임에 적용됨) @@ -3828,6 +3829,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}이 목 STR_VEHICLE_LIST_REPLACE_VEHICLES :차량 교체 STR_VEHICLE_LIST_SEND_FOR_SERVICING :점검하러 보내기 STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}올해 이익: {CURRENCY_LONG} (작년: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :차량기지로 보내기 STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :차고지로 보내기 @@ -5589,11 +5592,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 279b46dae8..2de20e0dc4 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1171,6 +1171,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Expandir STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Colapsar todas STR_CONFIG_SETTING_RESET_ALL :{BLACK}Repor todos os valores STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(sem explicação disponível) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valor por omissão: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Tipo de configuração: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Configuração de cliente (não guardado; afeta todos os jogos) @@ -3828,6 +3829,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Enviar i STR_VEHICLE_LIST_REPLACE_VEHICLES :Substituir Veículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Serviço STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Lucro deste ano: {CURRENCY_LONG} (último ano: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar para Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar para Depósito @@ -5589,11 +5592,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 6ecd782ee4..caa171ae33 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1319,6 +1319,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Разв STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Свернуть всё STR_CONFIG_SETTING_RESET_ALL :{BLACK}Сбросить все значения STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(нет описания) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Значение по умолчанию: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Тип настроек: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Настройки клиента (не содержатся в файлах сохранений; влияют на все игры) @@ -4002,6 +4003,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Упра STR_VEHICLE_LIST_REPLACE_VEHICLES :Замена транспорта STR_VEHICLE_LIST_SEND_FOR_SERVICING :Отправить на тех. обслуживание STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прибыль в этом году: {CURRENCY_LONG} (в прошлом году: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Отправить в депо STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Отправить в гараж @@ -5812,11 +5815,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 22cbcd71e6..87b78680d2 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1171,6 +1171,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Tümün STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Tümünü kısalt STR_CONFIG_SETTING_RESET_ALL :{BLACK}Tüm değerleri sıfırla STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(açıklama bulunmamaktadır) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Varsayılan değer: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Ayar türü: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Kullanıcı ayarları (kayıtlı dosyada saklanmaz; tüm oyunları etkilemektedir) @@ -3828,6 +3829,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Listedek STR_VEHICLE_LIST_REPLACE_VEHICLES :Araçları Değiştir STR_VEHICLE_LIST_SEND_FOR_SERVICING :Bakıma Gönder STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Bu seneki kar: {CURRENCY_LONG} (geçen sene: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Garaja Gönder STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Garaja Gönder @@ -5599,11 +5602,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} From 4a5a9f57c484437a49fececc715acb1c3d727a74 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Wed, 3 May 2023 06:05:07 +0200 Subject: [PATCH 10/38] Fix: conversion to smaller type warnings --- src/company_cmd.cpp | 13 +++++++++---- src/group_gui.cpp | 10 +++++----- src/industry_gui.cpp | 4 ++-- src/spriteloader/grf.cpp | 4 ++-- src/station_gui.cpp | 4 ++-- src/tgp.cpp | 2 +- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 9d41b4a3a9..d72b4aae18 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -268,14 +268,19 @@ void SubtractMoneyFromCompanyFract(CompanyID company, const CommandCost &cst) if (cost != 0) SubtractMoneyFromAnyCompany(c, CommandCost(cst.GetExpensesType(), cost)); } +static constexpr void UpdateLandscapingLimit(uint32_t &limit, uint64_t per_64k_frames, uint64_t burst) +{ + limit = static_cast(std::min(limit + per_64k_frames, burst << 16)); +} + /** Update the landscaping limits per company. */ void UpdateLandscapingLimits() { for (Company *c : Company::Iterate()) { - c->terraform_limit = std::min((uint64)c->terraform_limit + _settings_game.construction.terraform_per_64k_frames, (uint64)_settings_game.construction.terraform_frame_burst << 16); - c->clear_limit = std::min((uint64)c->clear_limit + _settings_game.construction.clear_per_64k_frames, (uint64)_settings_game.construction.clear_frame_burst << 16); - c->tree_limit = std::min((uint64)c->tree_limit + _settings_game.construction.tree_per_64k_frames, (uint64)_settings_game.construction.tree_frame_burst << 16); - c->build_object_limit = std::min((uint64)c->build_object_limit + _settings_game.construction.build_object_per_64k_frames, (uint64)_settings_game.construction.build_object_frame_burst << 16); + UpdateLandscapingLimit(c->terraform_limit, _settings_game.construction.terraform_per_64k_frames, _settings_game.construction.terraform_frame_burst); + UpdateLandscapingLimit(c->clear_limit, _settings_game.construction.clear_per_64k_frames, _settings_game.construction.clear_frame_burst); + UpdateLandscapingLimit(c->tree_limit, _settings_game.construction.tree_per_64k_frames, _settings_game.construction.tree_frame_burst); + UpdateLandscapingLimit(c->build_object_limit, _settings_game.construction.build_object_per_64k_frames, _settings_game.construction.build_object_frame_burst); } } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 429a25e49e..704c41ec91 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -606,13 +606,13 @@ public: case WID_GL_LIST_GROUP: { int y1 = r.top; - int max = std::min(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), this->groups.size()); - for (int i = this->group_sb->GetPosition(); i < max; ++i) { + size_t max = std::min(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), this->groups.size()); + for (size_t i = this->group_sb->GetPosition(); i < max; ++i) { const Group *g = this->groups[i]; assert(g->owner == this->owner); - DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * WidgetDimensions::scaled.hsep_indent, HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), g->folded || (i + 1 < (int)this->groups.size() && indents[i + 1] > this->indents[i])); + DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * WidgetDimensions::scaled.hsep_indent, HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), g->folded || (i + 1 < this->groups.size() && indents[i + 1] > this->indents[i])); y1 += this->tiny_step_height; } @@ -630,8 +630,8 @@ public: if (this->vli.index != ALL_GROUP && this->grouping == GB_NONE) { /* Mark vehicles which are in sub-groups (only if we are not using shared order coalescing) */ Rect mr = r.WithHeight(this->resize.step_height); - uint max = static_cast(std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehgroups.size())); - for (uint i = this->vscroll->GetPosition(); i < max; ++i) { + size_t max = std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehgroups.size()); + for (size_t i = this->vscroll->GetPosition(); i < max; ++i) { const Vehicle *v = this->vehgroups[i].GetSingleVehicle(); if (v->group_id != this->vli.index) { GfxFillRect(mr.Shrink(WidgetDimensions::scaled.bevel), _colour_gradient[COLOUR_GREY][3], FILLRECT_CHECKER); diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 959bcd84da..3308ac10b8 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1037,10 +1037,10 @@ public: case EA_MULTIPLIER: if (decrease) { if (i->prod_level <= PRODLEVEL_MINIMUM) return; - i->prod_level = std::max(i->prod_level / 2, PRODLEVEL_MINIMUM); + i->prod_level = static_cast(std::max(i->prod_level / 2, PRODLEVEL_MINIMUM)); } else { if (i->prod_level >= PRODLEVEL_MAXIMUM) return; - i->prod_level = std::min(i->prod_level * 2, PRODLEVEL_MAXIMUM); + i->prod_level = static_cast(std::min(i->prod_level * 2, PRODLEVEL_MAXIMUM)); } break; diff --git a/src/spriteloader/grf.cpp b/src/spriteloader/grf.cpp index bb678b053d..e1e79e57bd 100644 --- a/src/spriteloader/grf.cpp +++ b/src/spriteloader/grf.cpp @@ -165,7 +165,7 @@ bool DecodeSingleSprite(SpriteLoader::Sprite *sprite, SpriteFile &file, size_t f if (colour_fmt & SCC_PAL) { switch (sprite_type) { case SpriteType::Normal: data->m = file.NeedsPaletteRemap() ? _palmap_w2d[*dest] : *dest; break; - case SpriteType::Font: data->m = std::min(*dest, 2u); break; + case SpriteType::Font: data->m = std::min(*dest, 2u); break; default: data->m = *dest; break; } /* Magic blue. */ @@ -202,7 +202,7 @@ bool DecodeSingleSprite(SpriteLoader::Sprite *sprite, SpriteFile &file, size_t f if (colour_fmt & SCC_PAL) { switch (sprite_type) { case SpriteType::Normal: sprite->data[i].m = file.NeedsPaletteRemap() ? _palmap_w2d[*pixel] : *pixel; break; - case SpriteType::Font: sprite->data[i].m = std::min(*pixel, 2u); break; + case SpriteType::Font: sprite->data[i].m = std::min(*pixel, 2u); break; default: sprite->data[i].m = *pixel; break; } /* Magic blue. */ diff --git a/src/station_gui.cpp b/src/station_gui.cpp index a73252f685..052b5f2783 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -432,7 +432,7 @@ public: case WID_STL_LIST: { bool rtl = _current_text_dir == TD_RTL; - int max = std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size()); + size_t max = std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size()); Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); uint line_height = this->GetWidget(widget)->resize_y; /* Spacing between station name and first rating graph. */ @@ -440,7 +440,7 @@ public: /* Spacing between additional rating graphs. */ int rating_spacing = WidgetDimensions::scaled.hsep_normal; - for (int i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner + for (size_t i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner const Station *st = this->stations[i]; assert(st->xy != INVALID_TILE); diff --git a/src/tgp.cpp b/src/tgp.cpp index 931c2cc117..15a8da57ed 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -820,7 +820,7 @@ static void HeightMapSmoothCoastInDirection(int org_x, int org_y, int dir_x, int * Soften the coast slope */ for (depth = 0; IsValidXY(x, y) && depth <= max_coast_Smooth_depth; depth++, x += dir_x, y += dir_y) { h = _height_map.height(x, y); - h = std::min(h, h_prev + (4 + depth)); // coast softening formula + h = static_cast(std::min(h, h_prev + (4 + depth))); // coast softening formula _height_map.height(x, y) = h; h_prev = h; } From e33b2afd87379beb69cc7d488d52038e8f0921de Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 5 May 2023 11:37:17 +0200 Subject: [PATCH 11/38] Codechange: pass (uint) money as Money for CmdGiveMoney --- src/company_cmd.cpp | 2 +- src/company_cmd.h | 2 +- src/company_gui.cpp | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index d72b4aae18..b1bf880859 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -1187,7 +1187,7 @@ uint32 CompanyInfrastructure::GetTramTotal() const * @param dest_company the company to transfer the money to * @return the cost of this operation or an error */ -CommandCost CmdGiveMoney(DoCommandFlag flags, uint32 money, CompanyID dest_company) +CommandCost CmdGiveMoney(DoCommandFlag flags, Money money, CompanyID dest_company) { if (!_settings_game.economy.give_money) return CMD_ERROR; diff --git a/src/company_cmd.h b/src/company_cmd.h index 5ffac5cbde..4a44fa7077 100644 --- a/src/company_cmd.h +++ b/src/company_cmd.h @@ -18,7 +18,7 @@ enum ClientID : uint32; enum Colours : byte; CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id); -CommandCost CmdGiveMoney(DoCommandFlag flags, uint32 money, CompanyID dest_company); +CommandCost CmdGiveMoney(DoCommandFlag flags, Money money, CompanyID dest_company); CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text); CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text); CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf); diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 59603e105f..cbeca84679 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2646,10 +2646,8 @@ struct CompanyWindow : Window default: NOT_REACHED(); case WID_C_GIVE_MONEY: { - Money money = (Money)(std::strtoull(str, nullptr, 10) / _currency->rate); - uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 - - Command::Post(STR_ERROR_CAN_T_GIVE_MONEY, money_c, (CompanyID)this->window_number); + Money money = std::strtoull(str, nullptr, 10) / _currency->rate; + Command::Post(STR_ERROR_CAN_T_GIVE_MONEY, money, (CompanyID)this->window_number); break; } From 969a3dc0f3ae1a0a6df0a61e64cb41f0c5d9d452 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sat, 29 Apr 2023 08:54:24 +0200 Subject: [PATCH 12/38] Codechange: introduce generic ClampTo function to clamp to the range of a type --- src/core/math_func.hpp | 73 +++++++++++++++++++++++++++++++--- src/core/overflowsafe_type.hpp | 4 ++ src/tests/math_func.cpp | 45 +++++++++++++++++++++ 3 files changed, 116 insertions(+), 6 deletions(-) diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 8f9b5626c9..d11ef1ddd3 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -10,6 +10,9 @@ #ifndef MATH_FUNC_HPP #define MATH_FUNC_HPP +#include +#include + /** * Returns the absolute value of (scalar) variable. * @@ -124,6 +127,68 @@ static inline uint ClampU(const uint a, const uint min, const uint max) return Clamp(a, min, max); } +/** + * Clamp the given value down to lie within the requested type. + * + * For example ClampTo will return a value clamped to the range of 0 + * to 255. Anything smaller will become 0, anything larger will become 255. + * + * @param a The 64-bit value to clamp. + * @return The 64-bit value reduced to a value within the given allowed range + * for the return type. + * @see Clamp(int, int, int) + */ +template +constexpr To ClampTo(From value) +{ + static_assert(std::numeric_limits::is_integer, "Do not clamp from non-integer values"); + static_assert(std::numeric_limits::is_integer, "Do not clamp to non-integer values"); + + if (sizeof(To) >= sizeof(From) && std::numeric_limits::is_signed == std::numeric_limits::is_signed) { + /* Same signedness and To type is larger or equal than From type, no clamping is required. */ + return static_cast(value); + } + + if (sizeof(To) > sizeof(From) && std::numeric_limits::is_signed) { + /* Signed destination and a larger To type, no clamping is required. */ + return static_cast(value); + } + + /* Get the bigger of the two types based on essentially the number of bits. */ + using BiggerType = typename std::conditional= sizeof(To), From, To>::type; + + if constexpr (std::numeric_limits::is_signed) { + /* The output is a signed number. */ + if constexpr (std::numeric_limits::is_signed) { + /* Both input and output are signed. */ + return static_cast(std::clamp(value, + std::numeric_limits::lowest(), std::numeric_limits::max())); + } + + /* The input is unsigned, so skip the minimum check and use unsigned variant of the biggest type as intermediate type. */ + using BiggerUnsignedType = typename std::make_unsigned::type; + return static_cast(std::min(std::numeric_limits::max(), value)); + } + + /* The output is unsigned. */ + + if constexpr (std::numeric_limits::is_signed) { + /* Input is signed; account for the negative numbers in the input. */ + if constexpr (sizeof(To) >= sizeof(From)) { + /* If the output type is larger or equal to the input type, then only clamp the negative numbers. */ + return static_cast(std::max(value, 0)); + } + + /* The output type is smaller than the input type. */ + using BiggerSignedType = typename std::make_signed::type; + return static_cast(std::clamp(value, + std::numeric_limits::lowest(), std::numeric_limits::max())); + } + + /* The input and output are unsigned, just clamp at the high side. */ + return static_cast(std::min(value, std::numeric_limits::max())); +} + /** * Reduce a signed 64-bit int to a signed 32-bit one * @@ -140,7 +205,7 @@ static inline uint ClampU(const uint a, const uint min, const uint max) */ static inline int32 ClampToI32(const int64 a) { - return static_cast(Clamp(a, INT32_MIN, INT32_MAX)); + return ClampTo(a); } /** @@ -152,11 +217,7 @@ static inline int32 ClampToI32(const int64 a) */ static inline uint16 ClampToU16(const uint64 a) { - /* MSVC thinks, in its infinite wisdom, that int min(int, int) is a better - * match for min(uint64, uint) than uint64 min(uint64, uint64). As such we - * need to cast the UINT16_MAX to prevent MSVC from displaying its - * infinite loads of warnings. */ - return static_cast(std::min(a, static_cast(UINT16_MAX))); + return ClampTo(a); } /** diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp index 0c3957aaad..37eab29023 100644 --- a/src/core/overflowsafe_type.hpp +++ b/src/core/overflowsafe_type.hpp @@ -215,6 +215,10 @@ static_assert(OverflowSafeInt32(INT32_MAX) + 1 == OverflowSafeInt32(INT32_MAX)); static_assert(OverflowSafeInt32(INT32_MAX) * 2 == OverflowSafeInt32(INT32_MAX)); static_assert(OverflowSafeInt32(INT32_MIN) * 2 == OverflowSafeInt32(INT32_MIN)); +/* Specialisation of the generic ClampTo function for overflow safe integers to normal integers. */ +template +constexpr To ClampTo(OverflowSafeInt value) { return ClampTo(From(value)); } + #undef HAS_OVERFLOW_BUILTINS #endif /* OVERFLOWSAFE_TYPE_HPP */ diff --git a/src/tests/math_func.cpp b/src/tests/math_func.cpp index 6cc43f0146..8db813c105 100644 --- a/src/tests/math_func.cpp +++ b/src/tests/math_func.cpp @@ -75,3 +75,48 @@ TEST_CASE("IntSqrtTest - FindSqRt") CHECK(9 == IntSqrt(88)); CHECK(1696 == IntSqrt(2876278)); } + + +TEST_CASE("ClampTo") +{ + CHECK(0 == ClampTo(std::numeric_limits::lowest())); + CHECK(0 == ClampTo(-1)); + CHECK(0 == ClampTo(0)); + CHECK(1 == ClampTo(1)); + + CHECK(255 == ClampTo(std::numeric_limits::max())); + CHECK(255 == ClampTo(256)); + CHECK(255 == ClampTo(255)); + CHECK(254 == ClampTo(254)); + + CHECK(-128 == ClampTo(std::numeric_limits::lowest())); + CHECK(-128 == ClampTo(-129)); + CHECK(-128 == ClampTo(-128)); + CHECK(-127 == ClampTo(-127)); + + CHECK(127 == ClampTo(std::numeric_limits::max())); + CHECK(127 == ClampTo(128)); + CHECK(127 == ClampTo(127)); + CHECK(126 == ClampTo(126)); + + CHECK(126 == ClampTo(static_cast(126))); + CHECK(126 == ClampTo(static_cast(126))); + CHECK(0 == ClampTo(static_cast(-126))); + CHECK(0 == ClampTo(static_cast(-126))); + + /* The realm around 64 bits types is tricky as there is not one type/method that works for all. */ + + /* lowest/max uint64_t does not get clamped when clamping to uint64_t. */ + CHECK(std::numeric_limits::lowest() == ClampTo(std::numeric_limits::lowest())); + CHECK(std::numeric_limits::max() == ClampTo(std::numeric_limits::max())); + + /* negative int64_t get clamped to 0. */ + CHECK(0 == ClampTo(std::numeric_limits::lowest())); + CHECK(0 == ClampTo(int64_t(-1))); + /* positive int64_t remain the same. */ + CHECK(1 == ClampTo(int64_t(1))); + CHECK(static_cast(std::numeric_limits::max()) == ClampTo(std::numeric_limits::max())); + + /* max uint64_t gets clamped to max int64_t. */ + CHECK(std::numeric_limits::max() == ClampTo(std::numeric_limits::max())); +} From 19ec4e8beb78a4596edde94cf650e3f3b565c079 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sat, 29 Apr 2023 09:25:51 +0200 Subject: [PATCH 13/38] Codechange: replace ClampToI32/U16 with ClampTo --- src/build_vehicle_gui.cpp | 4 +-- src/core/math_func.hpp | 31 -------------------- src/ground_vehicle.cpp | 4 +-- src/newgrf_engine.cpp | 38 ++++++++++++------------- src/newgrf_town.cpp | 58 +++++++++++++++++++------------------- src/script/script_info.cpp | 16 +++++------ src/settings_gui.cpp | 2 +- src/strgen/strgen.cpp | 2 +- src/town_cmd.cpp | 2 +- src/vehicle_gui.cpp | 8 +++--- 10 files changed, 67 insertions(+), 98 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index ac5f854c0e..84ff30fb29 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -194,7 +194,7 @@ static bool EngineCostSorter(const GUIEngineListItem &a, const GUIEngineListItem { Money va = Engine::Get(a.engine_id)->GetCost(); Money vb = Engine::Get(b.engine_id)->GetCost(); - int r = ClampToI32(va - vb); + int r = ClampTo(va - vb); /* Use EngineID to sort instead since we want consistent sorting */ if (r == 0) return EngineNumberSorter(a, b); @@ -262,7 +262,7 @@ static bool EngineRunningCostSorter(const GUIEngineListItem &a, const GUIEngineL { Money va = Engine::Get(a.engine_id)->GetRunningCost(); Money vb = Engine::Get(b.engine_id)->GetRunningCost(); - int r = ClampToI32(va - vb); + int r = ClampTo(va - vb); /* Use EngineID to sort instead since we want consistent sorting */ if (r == 0) return EngineNumberSorter(a, b); diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index d11ef1ddd3..9f8c5f0179 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -189,37 +189,6 @@ constexpr To ClampTo(From value) return static_cast(std::min(value, std::numeric_limits::max())); } -/** - * Reduce a signed 64-bit int to a signed 32-bit one - * - * This function clamps a 64-bit integer to a 32-bit integer. - * If the 64-bit value is smaller than the smallest 32-bit integer - * value 0x80000000 this value is returned (the left one bit is the sign bit). - * If the 64-bit value is greater than the greatest 32-bit integer value 0x7FFFFFFF - * this value is returned. In all other cases the 64-bit value 'fits' in a - * 32-bits integer field and so the value is casted to int32 and returned. - * - * @param a The 64-bit value to clamps - * @return The 64-bit value reduced to a 32-bit value - * @see Clamp(int, int, int) - */ -static inline int32 ClampToI32(const int64 a) -{ - return ClampTo(a); -} - -/** - * Reduce an unsigned 64-bit int to an unsigned 16-bit one - * - * @param a The 64-bit value to clamp - * @return The 64-bit value reduced to a 16-bit value - * @see ClampU(uint, uint, uint) - */ -static inline uint16 ClampToU16(const uint64 a) -{ - return ClampTo(a); -} - /** * Returns the (absolute) difference between two (scalar) variables * diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index d627e0f80b..3de93fb668 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -175,10 +175,10 @@ int GroundVehicle::GetAcceleration() const * down hill will never slow down enough, and a vehicle that came up * a hill will never speed up enough to (eventually) get back to the * same (maximum) speed. */ - int accel = ClampToI32((force - resistance) / (mass * 4)); + int accel = ClampTo((force - resistance) / (mass * 4)); return force < resistance ? std::min(-1, accel) : std::max(1, accel); } else { - return ClampToI32(std::min(-force - resistance, -10000) / mass); + return ClampTo(std::min(-force - resistance, -10000) / mass); } } diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 1eae6e36d5..836a8948e7 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -519,7 +519,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, { const Vehicle *w = v->Next(); assert(w != nullptr); - uint16 altitude = ClampToU16(v->z_pos - w->z_pos); // Aircraft height - shadow height + uint16 altitude = ClampTo(v->z_pos - w->z_pos); // Aircraft height - shadow height byte airporttype = ATP_TTDP_LARGE; const Station *st = GetTargetAirportIfValid(Aircraft::From(v)); @@ -820,14 +820,14 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, case 0x39: return v->cargo_type; case 0x3A: return v->cargo_cap; case 0x3B: return GB(v->cargo_cap, 8, 8); - case 0x3C: return ClampToU16(v->cargo.StoredCount()); - case 0x3D: return GB(ClampToU16(v->cargo.StoredCount()), 8, 8); + case 0x3C: return ClampTo(v->cargo.StoredCount()); + case 0x3D: return GB(ClampTo(v->cargo.StoredCount()), 8, 8); case 0x3E: return v->cargo.Source(); case 0x3F: return ClampU(v->cargo.DaysInTransit(), 0, 0xFF); - case 0x40: return ClampToU16(v->age); - case 0x41: return GB(ClampToU16(v->age), 8, 8); - case 0x42: return ClampToU16(v->max_age); - case 0x43: return GB(ClampToU16(v->max_age), 8, 8); + case 0x40: return ClampTo(v->age); + case 0x41: return GB(ClampTo(v->age), 8, 8); + case 0x42: return ClampTo(v->max_age); + case 0x43: return GB(ClampTo(v->max_age), 8, 8); case 0x44: return Clamp(v->build_year, ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR) - ORIGINAL_BASE_YEAR; case 0x45: return v->unitnumber; case 0x46: return v->GetEngine()->grf_prop.local_id; @@ -845,20 +845,20 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, case 0x4F: return GB(v->reliability, 8, 8); case 0x50: return v->reliability_spd_dec; case 0x51: return GB(v->reliability_spd_dec, 8, 8); - case 0x52: return ClampToI32(v->GetDisplayProfitThisYear()); - case 0x53: return GB(ClampToI32(v->GetDisplayProfitThisYear()), 8, 24); - case 0x54: return GB(ClampToI32(v->GetDisplayProfitThisYear()), 16, 16); - case 0x55: return GB(ClampToI32(v->GetDisplayProfitThisYear()), 24, 8); - case 0x56: return ClampToI32(v->GetDisplayProfitLastYear()); - case 0x57: return GB(ClampToI32(v->GetDisplayProfitLastYear()), 8, 24); - case 0x58: return GB(ClampToI32(v->GetDisplayProfitLastYear()), 16, 16); - case 0x59: return GB(ClampToI32(v->GetDisplayProfitLastYear()), 24, 8); + case 0x52: return ClampTo(v->GetDisplayProfitThisYear()); + case 0x53: return GB(ClampTo(v->GetDisplayProfitThisYear()), 8, 24); + case 0x54: return GB(ClampTo(v->GetDisplayProfitThisYear()), 16, 16); + case 0x55: return GB(ClampTo(v->GetDisplayProfitThisYear()), 24, 8); + case 0x56: return ClampTo(v->GetDisplayProfitLastYear()); + case 0x57: return GB(ClampTo(v->GetDisplayProfitLastYear()), 8, 24); + case 0x58: return GB(ClampTo(v->GetDisplayProfitLastYear()), 16, 16); + case 0x59: return GB(ClampTo(v->GetDisplayProfitLastYear()), 24, 8); case 0x5A: return v->Next() == nullptr ? INVALID_VEHICLE : v->Next()->index; case 0x5B: break; // not implemented - case 0x5C: return ClampToI32(v->value); - case 0x5D: return GB(ClampToI32(v->value), 8, 24); - case 0x5E: return GB(ClampToI32(v->value), 16, 16); - case 0x5F: return GB(ClampToI32(v->value), 24, 8); + case 0x5C: return ClampTo(v->value); + case 0x5D: return GB(ClampTo(v->value), 8, 24); + case 0x5E: return GB(ClampTo(v->value), 16, 16); + case 0x5F: return GB(ClampTo(v->value), 24, 8); case 0x60: break; // not implemented case 0x61: break; // not implemented case 0x62: break; // vehicle specific, see below diff --git a/src/newgrf_town.cpp b/src/newgrf_town.cpp index a7671a8ac9..90eeede78d 100644 --- a/src/newgrf_town.cpp +++ b/src/newgrf_town.cpp @@ -46,21 +46,21 @@ /* Town properties */ case 0x80: return this->t->xy; case 0x81: return GB(this->t->xy, 8, 8); - case 0x82: return ClampToU16(this->t->cache.population); - case 0x83: return GB(ClampToU16(this->t->cache.population), 8, 8); + case 0x82: return ClampTo(this->t->cache.population); + case 0x83: return GB(ClampTo(this->t->cache.population), 8, 8); case 0x8A: return this->t->grow_counter / TOWN_GROWTH_TICKS; case 0x92: return this->t->flags; // In original game, 0x92 and 0x93 are really one word. Since flags is a byte, this is to adjust case 0x93: return 0; - case 0x94: return ClampToU16(this->t->cache.squared_town_zone_radius[0]); - case 0x95: return GB(ClampToU16(this->t->cache.squared_town_zone_radius[0]), 8, 8); - case 0x96: return ClampToU16(this->t->cache.squared_town_zone_radius[1]); - case 0x97: return GB(ClampToU16(this->t->cache.squared_town_zone_radius[1]), 8, 8); - case 0x98: return ClampToU16(this->t->cache.squared_town_zone_radius[2]); - case 0x99: return GB(ClampToU16(this->t->cache.squared_town_zone_radius[2]), 8, 8); - case 0x9A: return ClampToU16(this->t->cache.squared_town_zone_radius[3]); - case 0x9B: return GB(ClampToU16(this->t->cache.squared_town_zone_radius[3]), 8, 8); - case 0x9C: return ClampToU16(this->t->cache.squared_town_zone_radius[4]); - case 0x9D: return GB(ClampToU16(this->t->cache.squared_town_zone_radius[4]), 8, 8); + case 0x94: return ClampTo(this->t->cache.squared_town_zone_radius[0]); + case 0x95: return GB(ClampTo(this->t->cache.squared_town_zone_radius[0]), 8, 8); + case 0x96: return ClampTo(this->t->cache.squared_town_zone_radius[1]); + case 0x97: return GB(ClampTo(this->t->cache.squared_town_zone_radius[1]), 8, 8); + case 0x98: return ClampTo(this->t->cache.squared_town_zone_radius[2]); + case 0x99: return GB(ClampTo(this->t->cache.squared_town_zone_radius[2]), 8, 8); + case 0x9A: return ClampTo(this->t->cache.squared_town_zone_radius[3]); + case 0x9B: return GB(ClampTo(this->t->cache.squared_town_zone_radius[3]), 8, 8); + case 0x9C: return ClampTo(this->t->cache.squared_town_zone_radius[4]); + case 0x9D: return GB(ClampTo(this->t->cache.squared_town_zone_radius[4]), 8, 8); case 0x9E: return this->t->ratings[0]; case 0x9F: return GB(this->t->ratings[0], 8, 8); case 0xA0: return this->t->ratings[1]; @@ -79,24 +79,24 @@ case 0xAD: return GB(this->t->ratings[7], 8, 8); case 0xAE: return this->t->have_ratings; case 0xB2: return this->t->statues; - case 0xB6: return ClampToU16(this->t->cache.num_houses); + case 0xB6: return ClampTo(this->t->cache.num_houses); case 0xB9: return this->t->growth_rate / TOWN_GROWTH_TICKS; - case 0xBA: return ClampToU16(this->t->supplied[CT_PASSENGERS].new_max); - case 0xBB: return GB(ClampToU16(this->t->supplied[CT_PASSENGERS].new_max), 8, 8); - case 0xBC: return ClampToU16(this->t->supplied[CT_MAIL].new_max); - case 0xBD: return GB(ClampToU16(this->t->supplied[CT_MAIL].new_max), 8, 8); - case 0xBE: return ClampToU16(this->t->supplied[CT_PASSENGERS].new_act); - case 0xBF: return GB(ClampToU16(this->t->supplied[CT_PASSENGERS].new_act), 8, 8); - case 0xC0: return ClampToU16(this->t->supplied[CT_MAIL].new_act); - case 0xC1: return GB(ClampToU16(this->t->supplied[CT_MAIL].new_act), 8, 8); - case 0xC2: return ClampToU16(this->t->supplied[CT_PASSENGERS].old_max); - case 0xC3: return GB(ClampToU16(this->t->supplied[CT_PASSENGERS].old_max), 8, 8); - case 0xC4: return ClampToU16(this->t->supplied[CT_MAIL].old_max); - case 0xC5: return GB(ClampToU16(this->t->supplied[CT_MAIL].old_max), 8, 8); - case 0xC6: return ClampToU16(this->t->supplied[CT_PASSENGERS].old_act); - case 0xC7: return GB(ClampToU16(this->t->supplied[CT_PASSENGERS].old_act), 8, 8); - case 0xC8: return ClampToU16(this->t->supplied[CT_MAIL].old_act); - case 0xC9: return GB(ClampToU16(this->t->supplied[CT_MAIL].old_act), 8, 8); + case 0xBA: return ClampTo(this->t->supplied[CT_PASSENGERS].new_max); + case 0xBB: return GB(ClampTo(this->t->supplied[CT_PASSENGERS].new_max), 8, 8); + case 0xBC: return ClampTo(this->t->supplied[CT_MAIL].new_max); + case 0xBD: return GB(ClampTo(this->t->supplied[CT_MAIL].new_max), 8, 8); + case 0xBE: return ClampTo(this->t->supplied[CT_PASSENGERS].new_act); + case 0xBF: return GB(ClampTo(this->t->supplied[CT_PASSENGERS].new_act), 8, 8); + case 0xC0: return ClampTo(this->t->supplied[CT_MAIL].new_act); + case 0xC1: return GB(ClampTo(this->t->supplied[CT_MAIL].new_act), 8, 8); + case 0xC2: return ClampTo(this->t->supplied[CT_PASSENGERS].old_max); + case 0xC3: return GB(ClampTo(this->t->supplied[CT_PASSENGERS].old_max), 8, 8); + case 0xC4: return ClampTo(this->t->supplied[CT_MAIL].old_max); + case 0xC5: return GB(ClampTo(this->t->supplied[CT_MAIL].old_max), 8, 8); + case 0xC6: return ClampTo(this->t->supplied[CT_PASSENGERS].old_act); + case 0xC7: return GB(ClampTo(this->t->supplied[CT_PASSENGERS].old_act), 8, 8); + case 0xC8: return ClampTo(this->t->supplied[CT_MAIL].old_act); + case 0xC9: return GB(ClampTo(this->t->supplied[CT_MAIL].old_act), 8, 8); case 0xCA: return this->t->GetPercentTransported(CT_PASSENGERS); case 0xCB: return this->t->GetPercentTransported(CT_MAIL); case 0xCC: return this->t->received[TE_FOOD].new_act; diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp index 79f4982fb6..59e49bc358 100644 --- a/src/script/script_info.cpp +++ b/src/script/script_info.cpp @@ -146,42 +146,42 @@ SQInteger ScriptInfo::AddSetting(HSQUIRRELVM vm) } else if (strcmp(key, "min_value") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.min_value = ClampToI32(res); + config.min_value = ClampTo(res); items |= 0x004; } else if (strcmp(key, "max_value") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.max_value = ClampToI32(res); + config.max_value = ClampTo(res); items |= 0x008; } else if (strcmp(key, "easy_value") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.easy_value = ClampToI32(res); + config.easy_value = ClampTo(res); items |= 0x010; } else if (strcmp(key, "medium_value") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.medium_value = ClampToI32(res); + config.medium_value = ClampTo(res); items |= 0x020; } else if (strcmp(key, "hard_value") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.hard_value = ClampToI32(res); + config.hard_value = ClampTo(res); items |= 0x040; } else if (strcmp(key, "random_deviation") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.random_deviation = ClampToI32(abs(res)); + config.random_deviation = ClampTo(abs(res)); items |= 0x200; } else if (strcmp(key, "custom_value") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.custom_value = ClampToI32(res); + config.custom_value = ClampTo(res); items |= 0x080; } else if (strcmp(key, "step_size") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; - config.step_size = ClampToI32(res); + config.step_size = ClampTo(res); } else if (strcmp(key, "flags") == 0) { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 6e51539b5e..70494b3849 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2434,7 +2434,7 @@ struct GameSettingsWindow : Window { /* Save the correct currency-translated value */ if (sd->flags & SF_GUI_CURRENCY) llvalue /= _currency->rate; - value = (int32)ClampToI32(llvalue); + value = ClampTo(llvalue); } else { value = sd->def; } diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 3407a3e441..a52b6c20ed 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -99,7 +99,7 @@ struct FileStringReader : StringReader { char *ReadLine(char *buffer, const char *last) override { - return fgets(buffer, ClampToU16(last - buffer + 1), this->fh); + return fgets(buffer, ClampTo(last - buffer + 1), this->fh); } void HandlePragma(char *str) override; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 5f84fbf4f3..6ff0784e56 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2957,7 +2957,7 @@ CommandCost CmdExpandTown(DoCommandFlag flags, TownID town_id, uint32 grow_amoun if (flags & DC_EXEC) { /* The more houses, the faster we grow */ if (grow_amount == 0) { - uint amount = RandomRange(ClampToU16(t->cache.num_houses / 10)) + 3; + uint amount = RandomRange(ClampTo(t->cache.num_houses / 10)) + 3; t->cache.num_houses += amount; UpdateTownRadius(t); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 384357137b..80c9e7218b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1359,14 +1359,14 @@ static bool VehicleAgeSorter(const Vehicle * const &a, const Vehicle * const &b) /** Sort vehicles by this year profit */ static bool VehicleProfitThisYearSorter(const Vehicle * const &a, const Vehicle * const &b) { - int r = ClampToI32(a->GetDisplayProfitThisYear() - b->GetDisplayProfitThisYear()); + int r = ClampTo(a->GetDisplayProfitThisYear() - b->GetDisplayProfitThisYear()); return (r != 0) ? r < 0 : VehicleNumberSorter(a, b); } /** Sort vehicles by last year profit */ static bool VehicleProfitLastYearSorter(const Vehicle * const &a, const Vehicle * const &b) { - int r = ClampToI32(a->GetDisplayProfitLastYear() - b->GetDisplayProfitLastYear()); + int r = ClampTo(a->GetDisplayProfitLastYear() - b->GetDisplayProfitLastYear()); return (r != 0) ? r < 0 : VehicleNumberSorter(a, b); } @@ -1419,7 +1419,7 @@ static bool VehicleValueSorter(const Vehicle * const &a, const Vehicle * const & for (u = a; u != nullptr; u = u->Next()) diff += u->value; for (u = b; u != nullptr; u = u->Next()) diff -= u->value; - int r = ClampToI32(diff); + int r = ClampTo(diff); return (r != 0) ? r < 0 : VehicleNumberSorter(a, b); } @@ -1433,7 +1433,7 @@ static bool VehicleLengthSorter(const Vehicle * const &a, const Vehicle * const /** Sort vehicles by the time they can still live */ static bool VehicleTimeToLiveSorter(const Vehicle * const &a, const Vehicle * const &b) { - int r = ClampToI32((a->max_age - a->age) - (b->max_age - b->age)); + int r = ClampTo((a->max_age - a->age) - (b->max_age - b->age)); return (r != 0) ? r < 0 : VehicleNumberSorter(a, b); } From fb856e16c14c80c885adaec532dd3a4e96587169 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sat, 29 Apr 2023 10:19:43 +0200 Subject: [PATCH 14/38] Codechange: replace some min/clamp constructs to ClampTo --- src/economy.cpp | 8 ++++---- src/highscore.cpp | 2 +- src/industry_cmd.cpp | 12 ++++++------ src/industry_gui.cpp | 2 +- src/newgrf_airport.cpp | 2 +- src/newgrf_commons.cpp | 2 +- src/newgrf_engine.cpp | 12 ++++++------ src/newgrf_house.cpp | 9 ++++----- src/newgrf_industries.cpp | 28 ++++++++++++++-------------- src/newgrf_object.cpp | 4 ++-- src/newgrf_roadstop.cpp | 4 ++-- src/newgrf_station.cpp | 4 ++-- src/saveload/afterload.cpp | 2 +- src/script/api/script_rail.cpp | 2 +- src/station_cmd.cpp | 10 +++++----- src/textfile_gui.cpp | 4 ++-- src/timetable_gui.cpp | 8 ++++---- src/vehicle.cpp | 4 ++-- 18 files changed, 59 insertions(+), 60 deletions(-) diff --git a/src/economy.cpp b/src/economy.cpp index 820a033d9d..b4d9f59aaa 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -938,7 +938,7 @@ Money GetTransportedGoodsIncome(uint num_pieces, uint dist, uint16 transit_days, /* Use callback to calculate cargo profit, if available */ if (HasBit(cs->callback_mask, CBM_CARGO_PROFIT_CALC)) { - uint32 var18 = std::min(dist, 0xFFFFu) | (std::min(num_pieces, 0xFFu) << 16) | (std::min(transit_days, 0xFFu) << 24); + uint32 var18 = ClampTo(dist) | (ClampTo(num_pieces) << 16) | (ClampTo(transit_days) << 24); uint16 callback = GetCargoCallback(CBID_CARGO_PROFIT_CALC, 0, var18, cs); if (callback != CALLBACK_FAILED) { int result = GB(callback, 0, 14); @@ -1126,7 +1126,7 @@ static void TriggerIndustryProduction(Industry *i) if (cargo_waiting == 0) continue; for (uint ci_out = 0; ci_out < lengthof(i->produced_cargo_waiting); ci_out++) { - i->produced_cargo_waiting[ci_out] = std::min(i->produced_cargo_waiting[ci_out] + (cargo_waiting * indspec->input_cargo_multiplier[ci_in][ci_out] / 256), 0xFFFFu); + i->produced_cargo_waiting[ci_out] = ClampTo(i->produced_cargo_waiting[ci_out] + (cargo_waiting * indspec->input_cargo_multiplier[ci_in][ci_out] / 256)); } i->incoming_cargo_waiting[ci_in] = 0; @@ -1728,8 +1728,8 @@ static void LoadUnloadVehicle(Vehicle *front) } /* if last speed is 0, we treat that as if no vehicle has ever visited the station. */ - ge->last_speed = std::min(t, 255); - ge->last_age = std::min(TimerGameCalendar::year - front->build_year, 255); + ge->last_speed = ClampTo(t); + ge->last_age = ClampTo(TimerGameCalendar::year - front->build_year); assert(v->cargo_cap >= v->cargo.StoredCount()); /* Capacity available for loading more cargo. */ diff --git a/src/highscore.cpp b/src/highscore.cpp index e371b4054b..e48ed5e01b 100644 --- a/src/highscore.cpp +++ b/src/highscore.cpp @@ -132,7 +132,7 @@ void SaveToHighScore() for (i = 0; i < SP_SAVED_HIGHSCORE_END; i++) { for (hs = _highscore_table[i]; hs != endof(_highscore_table[i]); hs++) { /* First character is a command character, so strlen will fail on that */ - byte length = std::min(sizeof(hs->company), StrEmpty(hs->company) ? 0 : strlen(&hs->company[1]) + 1); + byte length = ClampTo(std::min(sizeof(hs->company), StrEmpty(hs->company) ? 0 : strlen(&hs->company[1]) + 1)); if (fwrite(&length, sizeof(length), 1, fp) != 1 || // write away string length fwrite(hs->company, length, 1, fp) > 1 || // Yes... could be 0 bytes too diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 67860ebfd4..3c3c6d8068 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -532,7 +532,7 @@ static bool TransportIndustryGoods(TileIndex tile) bool moved_cargo = false; for (uint j = 0; j < lengthof(i->produced_cargo_waiting); j++) { - uint cw = std::min(i->produced_cargo_waiting[j], 255u); + uint cw = ClampTo(i->produced_cargo_waiting[j]); if (cw > indspec->minimal_cargo && i->produced_cargo[j] != CT_INVALID) { i->produced_cargo_waiting[j] -= cw; @@ -1141,7 +1141,7 @@ static void ChopLumberMillTrees(Industry *i) TileIndex tile = i->location.tile; if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, nullptr)) { // 40x40 tiles to search. - i->produced_cargo_waiting[0] = std::min(0xffff, i->produced_cargo_waiting[0] + 45); // Found a tree, add according value to waiting cargo. + i->produced_cargo_waiting[0] = ClampTo(i->produced_cargo_waiting[0] + 45); // Found a tree, add according value to waiting cargo. } } @@ -1173,7 +1173,7 @@ static void ProduceIndustryGoods(Industry *i) IndustryBehaviour indbehav = indsp->behaviour; for (size_t j = 0; j < lengthof(i->produced_cargo_waiting); j++) { - i->produced_cargo_waiting[j] = std::min(0xffff, i->produced_cargo_waiting[j] + i->production_rate[j]); + i->produced_cargo_waiting[j] = ClampTo(i->produced_cargo_waiting[j] + i->production_rate[j]); } if ((indbehav & INDUSTRYBEH_PLANT_FIELDS) != 0) { @@ -1784,7 +1784,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, /* Randomize inital production if non-original economy is used and there are no production related callbacks. */ if (!indspec->UsesOriginalEconomy()) { for (size_t ci = 0; ci < lengthof(i->production_rate); ci++) { - i->production_rate[ci] = std::min((RandomRange(256) + 128) * i->production_rate[ci] >> 8, 255u); + i->production_rate[ci] = ClampTo((RandomRange(256) + 128) * i->production_rate[ci] >> 8); } } @@ -2422,7 +2422,7 @@ static void UpdateIndustryStatistics(Industry *i) byte pct = 0; if (i->this_month_production[j] != 0) { i->last_prod_year = TimerGameCalendar::year; - pct = std::min(i->this_month_transported[j] * 256 / i->this_month_production[j], 255); + pct = ClampTo(i->this_month_transported[j] * 256 / i->this_month_production[j]); } i->last_month_pct_transported[j] = pct; @@ -2446,7 +2446,7 @@ void Industry::RecomputeProductionMultipliers() /* Rates are rounded up, so e.g. oilrig always produces some passengers */ for (size_t i = 0; i < lengthof(this->production_rate); i++) { - this->production_rate[i] = std::min(CeilDiv(indspec->production_rate[i] * this->prod_level, PRODLEVEL_DEFAULT), 0xFFu); + this->production_rate[i] = ClampTo(CeilDiv(indspec->production_rate[i] * this->prod_level, PRODLEVEL_DEFAULT)); } } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 3308ac10b8..3c9081f442 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1052,7 +1052,7 @@ public: if (i->production_rate[line - IL_RATE1] >= 255) return; /* a zero production industry is unlikely to give anything but zero, so push it a little bit */ int new_prod = i->production_rate[line - IL_RATE1] == 0 ? 1 : i->production_rate[line - IL_RATE1] * 2; - i->production_rate[line - IL_RATE1] = std::min(new_prod, 255); + i->production_rate[line - IL_RATE1] = ClampTo(new_prod); } break; diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index b5e0b40a53..2dc2f2d847 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -212,7 +212,7 @@ void AirportOverrideManager::SetEntitySpec(AirportSpec *as) case 0x7C: return (this->st->airport.psa != nullptr) ? this->st->airport.psa->GetValue(parameter) : 0; case 0xF0: return this->st->facilities; - case 0xFA: return Clamp(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); + case 0xFA: return ClampTo(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR); } return this->st->GetNewGRFVariable(this->ro, variable, parameter, available); diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index a44d4662e2..2da03dc5b5 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -437,7 +437,7 @@ uint32 GetNearbyTileInformation(TileIndex tile, bool grf_version8) /* Return 0 if the tile is a land tile */ byte terrain_type = (HasTileWaterClass(tile) ? (GetWaterClass(tile) + 1) & 3 : 0) << 5 | GetTerrainType(tile) << 2 | (tile_type == MP_WATER ? 1 : 0) << 1; if (grf_version8) z /= TILE_HEIGHT; - return tile_type << 24 | Clamp(z, 0, 0xFF) << 16 | terrain_type << 8 | tileh; + return tile_type << 24 | ClampTo(z) << 16 | terrain_type << 8 | tileh; } /** diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 836a8948e7..b276cb1385 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -528,7 +528,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, airporttype = st->airport.GetSpec()->ttd_airport_type; } - return (Clamp(altitude, 0, 0xFF) << 8) | airporttype; + return (ClampTo(altitude) << 8) | airporttype; } case 0x45: { // Curvature info @@ -766,8 +766,8 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, } return (variable - 0x80) == 0x10 ? ticks : GB(ticks, 8, 8); } - case 0x12: return Clamp(v->date_of_last_service - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 0xFFFF); - case 0x13: return GB(Clamp(v->date_of_last_service - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 0xFFFF), 8, 8); + case 0x12: return ClampTo(v->date_of_last_service - DAYS_TILL_ORIGINAL_BASE_YEAR); + case 0x13: return GB(ClampTo(v->date_of_last_service - DAYS_TILL_ORIGINAL_BASE_YEAR), 8, 8); case 0x14: return v->GetServiceInterval(); case 0x15: return GB(v->GetServiceInterval(), 8, 8); case 0x16: return v->last_station_visited; @@ -823,7 +823,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, case 0x3C: return ClampTo(v->cargo.StoredCount()); case 0x3D: return GB(ClampTo(v->cargo.StoredCount()), 8, 8); case 0x3E: return v->cargo.Source(); - case 0x3F: return ClampU(v->cargo.DaysInTransit(), 0, 0xFF); + case 0x3F: return ClampTo(v->cargo.DaysInTransit()); case 0x40: return ClampTo(v->age); case 0x41: return GB(ClampTo(v->age), 8, 8); case 0x42: return ClampTo(v->max_age); @@ -973,8 +973,8 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, case 0x48: return Engine::Get(this->self_type)->flags; // Vehicle Type Info case 0x49: return TimerGameCalendar::year; // 'Long' format build year case 0x4B: return TimerGameCalendar::date; // Long date of last service - case 0x92: return Clamp(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 0xFFFF); // Date of last service - case 0x93: return GB(Clamp(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 0xFFFF), 8, 8); + case 0x92: return ClampTo(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR); // Date of last service + case 0x93: return GB(ClampTo(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR), 8, 8); case 0xC4: return Clamp(TimerGameCalendar::year, ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR) - ORIGINAL_BASE_YEAR; // Build year case 0xC6: return Engine::Get(this->self_type)->grf_prop.local_id; case 0xC7: return GB(Engine::Get(this->self_type)->grf_prop.local_id, 8, 8); diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index 53ff4b8f72..b6fcdccc50 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -152,13 +152,12 @@ void DecreaseBuildingCount(Town *t, HouseID house_id) static uint32 GetNumHouses(HouseID house_id, const Town *town) { - uint8 map_id_count, town_id_count, map_class_count, town_class_count; HouseClassID class_id = HouseSpec::Get(house_id)->class_id; - map_id_count = ClampU(_building_counts.id_count[house_id], 0, 255); - map_class_count = ClampU(_building_counts.class_count[class_id], 0, 255); - town_id_count = ClampU(town->cache.building_counts.id_count[house_id], 0, 255); - town_class_count = ClampU(town->cache.building_counts.class_count[class_id], 0, 255); + uint8_t map_id_count = ClampTo(_building_counts.id_count[house_id]); + uint8_t map_class_count = ClampTo(_building_counts.class_count[class_id]); + uint8_t town_id_count = ClampTo(town->cache.building_counts.id_count[house_id]); + uint8_t town_class_count = ClampTo(town->cache.building_counts.class_count[class_id]); return map_class_count << 24 | town_class_count << 16 | map_id_count << 8 | town_id_count; } diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 6606c29972..0ace93b0e2 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -141,7 +141,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout /* If the filter is 0, it could be because none was specified as well as being really a 0. * In either case, just do the regular var67 */ closest_dist = GetClosestIndustry(current->location.tile, ind_index, current); - count = std::min(Industry::GetIndustryTypeCount(ind_index), UINT8_MAX); // clamp to 8 bit + count = ClampTo(Industry::GetIndustryTypeCount(ind_index)); } else { /* Count only those who match the same industry type and layout filter * Unfortunately, we have to do it manually */ @@ -181,16 +181,16 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout case 0x88: return GetTownRadiusGroup(this->industry->town, this->tile); /* Manhattan distance of the closest town */ - case 0x89: return std::min(DistanceManhattan(this->industry->town->xy, this->tile), 255u); + case 0x89: return ClampTo(DistanceManhattan(this->industry->town->xy, this->tile)); /* Lowest height of the tile */ - case 0x8A: return Clamp(GetTileZ(this->tile) * (this->ro.grffile->grf_version >= 8 ? 1 : TILE_HEIGHT), 0, 0xFF); + case 0x8A: return ClampTo(GetTileZ(this->tile) * (this->ro.grffile->grf_version >= 8 ? 1 : TILE_HEIGHT)); /* Distance to the nearest water/land tile */ case 0x8B: return GetClosestWaterDistance(this->tile, (GetIndustrySpec(this->industry->type)->behaviour & INDUSTRYBEH_BUILT_ONWATER) == 0); /* Square of Euclidian distance from town */ - case 0x8D: return std::min(DistanceSquare(this->industry->town->xy, this->tile), 65535u); + case 0x8D: return ClampTo(DistanceSquare(this->industry->town->xy, this->tile)); /* 32 random bits */ case 0x8F: return this->random_bits; @@ -214,9 +214,9 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout if (HasBit(callback, CBM_IND_PRODUCTION_CARGO_ARRIVAL) || HasBit(callback, CBM_IND_PRODUCTION_256_TICKS)) { if ((indspec->behaviour & INDUSTRYBEH_PROD_MULTI_HNDLING) != 0) { if (this->industry->prod_level == 0) return 0; - return std::min(this->industry->incoming_cargo_waiting[variable - 0x40] / this->industry->prod_level, 0xFFFFu); + return ClampTo(this->industry->incoming_cargo_waiting[variable - 0x40] / this->industry->prod_level); } else { - return std::min(this->industry->incoming_cargo_waiting[variable - 0x40], 0xFFFFu); + return ClampTo(this->industry->incoming_cargo_waiting[variable - 0x40]); } } else { return 0; @@ -285,7 +285,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout case 0x65: { if (this->tile == INVALID_TILE) break; TileIndex tile = GetNearbyTile(parameter, this->tile, true); - return GetTownRadiusGroup(this->industry->town, tile) << 16 | std::min(DistanceManhattan(tile, this->industry->town->xy), 0xFFFFu); + return GetTownRadiusGroup(this->industry->town, tile) << 16 | ClampTo(DistanceManhattan(tile, this->industry->town->xy)); } /* Get square of Euclidian distance of closest town */ case 0x66: { @@ -396,16 +396,16 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout case 0xA6: return indspec->grf_prop.local_id; case 0xA7: return this->industry->founder; case 0xA8: return this->industry->random_colour; - case 0xA9: return Clamp(this->industry->last_prod_year - ORIGINAL_BASE_YEAR, 0, 255); + case 0xA9: return ClampTo(this->industry->last_prod_year - ORIGINAL_BASE_YEAR); case 0xAA: return this->industry->counter; case 0xAB: return GB(this->industry->counter, 8, 8); case 0xAC: return this->industry->was_cargo_delivered; - case 0xB0: return Clamp(this->industry->construction_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // Date when built since 1920 (in days) + case 0xB0: return ClampTo(this->industry->construction_date - DAYS_TILL_ORIGINAL_BASE_YEAR); // Date when built since 1920 (in days) case 0xB3: return this->industry->construction_type; // Construction type case 0xB4: { TimerGameCalendar::Date *latest = std::max_element(this->industry->last_cargo_accepted_at, endof(this->industry->last_cargo_accepted_at)); - return Clamp((*latest) - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // Date last cargo accepted since 1920 (in days) + return ClampTo((*latest) - DAYS_TILL_ORIGINAL_BASE_YEAR); // Date last cargo accepted since 1920 (in days) } } @@ -643,22 +643,22 @@ void IndustryProductionCallback(Industry *ind, int reason) if (group->version < 2) { /* Callback parameters map directly to industry cargo slot indices */ for (uint i = 0; i < group->num_input; i++) { - ind->incoming_cargo_waiting[i] = Clamp(ind->incoming_cargo_waiting[i] - DerefIndProd(group->subtract_input[i], deref) * multiplier, 0, 0xFFFF); + ind->incoming_cargo_waiting[i] = ClampTo(ind->incoming_cargo_waiting[i] - DerefIndProd(group->subtract_input[i], deref) * multiplier); } for (uint i = 0; i < group->num_output; i++) { - ind->produced_cargo_waiting[i] = Clamp(ind->produced_cargo_waiting[i] + std::max(DerefIndProd(group->add_output[i], deref), 0) * multiplier, 0, 0xFFFF); + ind->produced_cargo_waiting[i] = ClampTo(ind->produced_cargo_waiting[i] + std::max(DerefIndProd(group->add_output[i], deref), 0) * multiplier); } } else { /* Callback receives list of cargos to apply for, which need to have their cargo slots in industry looked up */ for (uint i = 0; i < group->num_input; i++) { int cargo_index = ind->GetCargoAcceptedIndex(group->cargo_input[i]); if (cargo_index < 0) continue; - ind->incoming_cargo_waiting[cargo_index] = Clamp(ind->incoming_cargo_waiting[cargo_index] - DerefIndProd(group->subtract_input[i], deref) * multiplier, 0, 0xFFFF); + ind->incoming_cargo_waiting[cargo_index] = ClampTo(ind->incoming_cargo_waiting[cargo_index] - DerefIndProd(group->subtract_input[i], deref) * multiplier); } for (uint i = 0; i < group->num_output; i++) { int cargo_index = ind->GetCargoProducedIndex(group->cargo_output[i]); if (cargo_index < 0) continue; - ind->produced_cargo_waiting[cargo_index] = Clamp(ind->produced_cargo_waiting[cargo_index] + std::max(DerefIndProd(group->add_output[i], deref), 0) * multiplier, 0, 0xFFFF); + ind->produced_cargo_waiting[cargo_index] = ClampTo(ind->produced_cargo_waiting[cargo_index] + std::max(DerefIndProd(group->add_output[i], deref), 0) * multiplier); } } diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp index 076c89ca15..60c0684303 100644 --- a/src/newgrf_object.cpp +++ b/src/newgrf_object.cpp @@ -249,7 +249,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte local_id, uint32 grfid, /* If the object type is invalid, there is none and the closest is far away. */ if (idx >= NUM_OBJECTS) return 0 | 0xFFFF; - return Object::GetTypeCount(idx) << 16 | std::min(GetClosestObject(tile, idx, current), 0xFFFFu); + return Object::GetTypeCount(idx) << 16 | ClampTo(GetClosestObject(tile, idx, current)); } /** Used by the resolver to get values for feature 0F deterministic spritegroups. */ @@ -324,7 +324,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte local_id, uint32 grfid, case 0x44: return GetTileOwner(this->tile); /* Get town zone and Manhattan distance of closest town */ - case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | std::min(DistanceManhattan(this->tile, t->xy), 0xFFFFu); + case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | ClampTo(DistanceManhattan(this->tile, t->xy)); /* Get square of Euclidian distance of closest town */ case 0x46: return DistanceSquare(this->tile, t->xy); diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index d59457d94b..b746f2ffe8 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -105,7 +105,7 @@ uint32 RoadStopScopeResolver::GetVariable(byte variable, uint32 parameter, bool case 0x45: { if (this->tile == INVALID_TILE) return HZB_TOWN_EDGE << 16; const Town *t = (this->st == nullptr) ? ClosestTownFromTile(this->tile, UINT_MAX) : this->st->town; - return t != nullptr ? (GetTownRadiusGroup(t, this->tile) << 16 | std::min(DistanceManhattan(this->tile, t->xy), 0xFFFFu)) : HZB_TOWN_EDGE << 16; + return t != nullptr ? (GetTownRadiusGroup(t, this->tile) << 16 | ClampTo(DistanceManhattan(this->tile, t->xy))) : HZB_TOWN_EDGE << 16; } /* Get square of Euclidian distance of closest town */ @@ -176,7 +176,7 @@ uint32 RoadStopScopeResolver::GetVariable(byte variable, uint32 parameter, bool case 0xF0: return this->st == nullptr ? 0 : this->st->facilities; // facilities - case 0xFA: return Clamp((this->st == nullptr ? TimerGameCalendar::date : this->st->build_date) - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // build date + case 0xFA: return ClampTo((this->st == nullptr ? TimerGameCalendar::date : this->st->build_date) - DAYS_TILL_ORIGINAL_BASE_YEAR); // build date } if (this->st != nullptr) return this->st->GetNewGRFVariable(this->ro, variable, parameter, available); diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index b40674250b..f13f09974a 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -294,7 +294,7 @@ TownScopeResolver *StationResolverObject::GetTown() } break; - case 0xFA: return Clamp(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // Build date, clamped to a 16 bit value + case 0xFA: return ClampTo(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR); // Build date, clamped to a 16 bit value } *available = false; @@ -384,7 +384,7 @@ TownScopeResolver *StationResolverObject::GetTown() case 0x84: return this->st->string_id; case 0x86: return 0; case 0xF0: return this->st->facilities; - case 0xFA: return Clamp(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); + case 0xFA: return ClampTo(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR); } return this->st->GetNewGRFVariable(this->ro, variable, parameter, available); diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 822de66802..0731865b06 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1923,7 +1923,7 @@ bool AfterLoadGame() /* Replace "house construction year" with "house age" */ if (IsTileType(t, MP_HOUSE) && IsHouseCompleted(t)) { - t.m5() = Clamp(TimerGameCalendar::year - (t.m5() + ORIGINAL_BASE_YEAR), 0, 0xFF); + t.m5() = ClampTo(TimerGameCalendar::year - (t.m5() + ORIGINAL_BASE_YEAR)); } } } diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp index e9bdbd0658..fbbb2038f9 100644 --- a/src/script/api/script_rail.cpp +++ b/src/script/api/script_rail.cpp @@ -182,7 +182,7 @@ 0, source_industry, goal_industry, - std::min(255, distance / 2), + ClampTo(distance / 2), AICE_STATION_GET_STATION_ID, source_station ? 0 : 1, std::min(15u, num_platforms) << 4 | std::min(15u, platform_length), diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index e3b2e632f4..0ca841e26c 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3660,9 +3660,9 @@ static void UpdateStationRating(Station *st) /* NewGRFs expect last speed to be 0xFF when no vehicle has arrived yet. */ uint last_speed = ge->HasVehicleEverTriedLoading() ? ge->last_speed : 0xFF; - uint32 var18 = std::min(ge->time_since_pickup, 0xFFu) - | (std::min(ge->max_waiting_cargo, 0xFFFFu) << 8) - | (std::min(last_speed, 0xFFu) << 24); + uint32 var18 = ClampTo(ge->time_since_pickup) + | (ClampTo(ge->max_waiting_cargo) << 8) + | (ClampTo(last_speed) << 24); /* Convert to the 'old' vehicle types */ uint32 var10 = (st->last_vehicle_type == VEH_INVALID) ? 0x0 : (st->last_vehicle_type + 0x10); uint16 callback = GetCargoCallback(CBID_CARGO_STATION_RATING_CALC, var10, var18, cs); @@ -3705,7 +3705,7 @@ static void UpdateStationRating(Station *st) int or_ = ge->rating; // old rating /* only modify rating in steps of -2, -1, 0, 1 or 2 */ - ge->rating = rating = or_ + Clamp(Clamp(rating, 0, 255) - or_, -2, 2); + ge->rating = rating = or_ + Clamp(ClampTo(rating) - or_, -2, 2); /* if rating is <= 64 and more than 100 items waiting on average per destination, * remove some random amount of goods from the station */ @@ -4019,7 +4019,7 @@ void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint rad GoodsEntry *ge = &st->goods[i]; if (ge->status != 0) { - ge->rating = Clamp(ge->rating + amount, 0, 255); + ge->rating = ClampTo(ge->rating + amount); } } } diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 86a370045f..89a5747bb4 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -124,11 +124,11 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) if (IsWidgetLowered(WID_TF_WRAPTEXT)) { /* Reflow is mandatory if text wrapping is on */ uint height = this->ReflowContent(); - this->vscroll->SetCount(std::min(UINT16_MAX, height)); + this->vscroll->SetCount(ClampTo(height)); this->hscroll->SetCount(0); } else { uint height = force_reflow ? this->ReflowContent() : this->GetContentHeight(); - this->vscroll->SetCount(std::min(UINT16_MAX, height)); + this->vscroll->SetCount(ClampTo(height)); this->hscroll->SetCount(this->max_length + WidgetDimensions::scaled.frametext.Horizontal()); } diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 2f924f3cf1..40106e8a65 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -675,9 +675,9 @@ struct TimetableWindow : Window { val = ConvertDisplaySpeedToKmhishSpeed(val, v->type); if (this->change_timetable_all) { - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, mtf, std::min(val, UINT16_MAX)); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, mtf, ClampTo(val)); } else { - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, std::min(val, UINT16_MAX)); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, ClampTo(val)); } break; } @@ -686,9 +686,9 @@ struct TimetableWindow : Window { if (!_settings_client.gui.timetable_in_ticks) val *= DAY_TICKS; if (this->change_timetable_all) { - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, mtf, std::min(val, UINT16_MAX)); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, mtf, ClampTo(val)); } else { - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, std::min(val, UINT16_MAX)); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, ClampTo(val)); } break; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 96e9871f4d..31d01af038 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1279,7 +1279,7 @@ void CheckVehicleBreakdown(Vehicle *v) /* increase chance of failure */ int chance = v->breakdown_chance + 1; if (Chance16I(1, 25, r)) chance += 25; - v->breakdown_chance = std::min(255, chance); + v->breakdown_chance = ClampTo(chance); /* calculate reliability value to use in comparison */ rel = v->reliability; @@ -1289,7 +1289,7 @@ void CheckVehicleBreakdown(Vehicle *v) if (_settings_game.difficulty.vehicle_breakdowns == 1) rel += 0x6666; /* check if to break down */ - if (_breakdown_chance[(uint)std::min(rel, 0xffff) >> 10] <= v->breakdown_chance) { + if (_breakdown_chance[ClampTo(rel) >> 10] <= v->breakdown_chance) { v->breakdown_ctr = GB(r, 16, 6) + 0x3F; v->breakdown_delay = GB(r, 24, 7) + 0x80; v->breakdown_chance = 0; From a836edd5a78c7a5018bd58dfb74e9cfbc5cf89a1 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 6 May 2023 20:45:32 +0100 Subject: [PATCH 15/38] Codechange: Scrollbar::UpdatePosition() will tell if the position changed. (#10777) So we don't need to check this manually. --- src/widgets/dropdown.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 73bc203c83..1c7a7492e7 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -280,14 +280,9 @@ struct DropdownWindow : Window { IntervalTimer scroll_interval = {std::chrono::milliseconds(30), [this](auto) { if (this->scrolling == 0) return; - int pos = this->vscroll->GetPosition(); + if (this->vscroll->UpdatePosition(this->scrolling)) this->SetDirty(); - this->vscroll->UpdatePosition(this->scrolling); this->scrolling = 0; - - if (pos != this->vscroll->GetPosition()) { - this->SetDirty(); - } }}; void OnMouseLoop() override From 8bf62dac818e20070db1c7c61da1eeaebff0fe93 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sun, 7 May 2023 08:19:09 +0100 Subject: [PATCH 16/38] Codechange: Clean up build industry window. (#10779) * Remove left-over code that treated an invalid list selection as 'fund many', which is actually implemented as a separate button. * Manual list management replaced with std::vector. * Enabled state is only needed for the current selection. * Selected index is not required only selected type. --- src/industry_gui.cpp | 116 +++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 70 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 3c9081f442..1d85abbe8e 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -282,25 +282,23 @@ static WindowDesc _build_industry_desc( /** Build (fund or prospect) a new industry, */ class BuildIndustryWindow : public Window { - int selected_index; ///< index of the element in the matrix IndustryType selected_type; ///< industry corresponding to the above index - uint16 count; ///< How many industries are loaded - IndustryType index[NUM_INDUSTRYTYPES + 1]; ///< Type of industry, in the order it was loaded - bool enabled[NUM_INDUSTRYTYPES + 1]; ///< availability state, coming from CBID_INDUSTRY_PROBABILITY (if ever) + std::vector list; ///< List of industries. + bool enabled; ///< Availability state of the selected industry. Scrollbar *vscroll; Dimension legend; ///< Dimension of the legend 'blob'. /** The largest allowed minimum-width of the window, given in line heights */ static const int MAX_MINWIDTH_LINEHEIGHTS = 20; - void SetupArrays() + void UpdateAvailability() { - this->count = 0; + this->enabled = this->selected_type != INVALID_INDUSTRYTYPE && (_game_mode == GM_EDITOR || GetIndustryProbabilityCallback(this->selected_type, IACT_USERCREATION, 1) > 0); + } - for (uint i = 0; i < lengthof(this->index); i++) { - this->index[i] = INVALID_INDUSTRYTYPE; - this->enabled[i] = false; - } + void SetupArrays() + { + this->list.clear(); /* Fill the arrays with industries. * The tests performed after the enabled allow to load the industries @@ -314,32 +312,27 @@ class BuildIndustryWindow : public Window { * and raw ones are loaded only when setting allows it */ if (_game_mode != GM_EDITOR && indsp->IsRawIndustry() && _settings_game.construction.raw_industry_construction == 0) { /* Unselect if the industry is no longer in the list */ - if (this->selected_type == ind) this->selected_index = -1; + if (this->selected_type == ind) this->selected_type = INVALID_INDUSTRYTYPE; continue; } - this->index[this->count] = ind; - this->enabled[this->count] = (_game_mode == GM_EDITOR) || GetIndustryProbabilityCallback(ind, IACT_USERCREATION, 1) > 0; - /* Keep the selection to the correct line */ - if (this->selected_type == ind) this->selected_index = this->count; - this->count++; + + this->list.push_back(ind); } } - /* first industry type is selected if the current selection is invalid. - * I'll be damned if there are none available ;) */ - if (this->selected_index == -1) { - this->selected_index = 0; - this->selected_type = this->index[0]; - } + /* First industry type is selected if the current selection is invalid. */ + if (this->selected_type == INVALID_INDUSTRYTYPE && !this->list.empty()) this->selected_type = this->list[0]; - this->vscroll->SetCount(this->count); + this->UpdateAvailability(); + + this->vscroll->SetCount((int)this->list.size()); } /** Update status of the fund and display-chain widgets. */ void SetButtons() { - this->SetWidgetDisabledState(WID_DPI_FUND_WIDGET, this->selected_type != INVALID_INDUSTRYTYPE && !this->enabled[this->selected_index]); - this->SetWidgetDisabledState(WID_DPI_DISPLAY_WIDGET, this->selected_type == INVALID_INDUSTRYTYPE && this->enabled[this->selected_index]); + this->SetWidgetDisabledState(WID_DPI_FUND_WIDGET, this->selected_type != INVALID_INDUSTRYTYPE && !this->enabled); + this->SetWidgetDisabledState(WID_DPI_DISPLAY_WIDGET, this->selected_type == INVALID_INDUSTRYTYPE && this->enabled); } /** @@ -392,7 +385,6 @@ class BuildIndustryWindow : public Window { public: BuildIndustryWindow() : Window(&_build_industry_desc) { - this->selected_index = -1; this->selected_type = INVALID_INDUSTRYTYPE; this->CreateNestedTree(); @@ -423,9 +415,8 @@ public: switch (widget) { case WID_DPI_MATRIX_WIDGET: { Dimension d = GetStringBoundingBox(STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES); - for (uint16 i = 0; i < this->count; i++) { - if (this->index[i] == INVALID_INDUSTRYTYPE) continue; - d = maxdim(d, GetStringBoundingBox(GetIndustrySpec(this->index[i])->name)); + for (const auto &indtype : this->list) { + d = maxdim(d, GetStringBoundingBox(GetIndustrySpec(indtype)->name)); } resize->height = std::max(this->legend.height, FONT_HEIGHT_NORMAL) + padding.height; d.width += this->legend.width + WidgetDimensions::scaled.hsep_wide + padding.width; @@ -442,14 +433,12 @@ public: uint extra_lines_newgrf = 0; uint max_minwidth = FONT_HEIGHT_NORMAL * MAX_MINWIDTH_LINEHEIGHTS; Dimension d = {0, 0}; - for (uint16 i = 0; i < this->count; i++) { - if (this->index[i] == INVALID_INDUSTRYTYPE) continue; - - const IndustrySpec *indsp = GetIndustrySpec(this->index[i]); + for (const auto &indtype : this->list) { + const IndustrySpec *indsp = GetIndustrySpec(indtype); CargoSuffix cargo_suffix[lengthof(indsp->accepts_cargo)]; /* Measure the accepted cargoes, if any. */ - GetAllCargoSuffixes(CARGOSUFFIX_IN, CST_FUND, nullptr, this->index[i], indsp, indsp->accepts_cargo, cargo_suffix); + GetAllCargoSuffixes(CARGOSUFFIX_IN, CST_FUND, nullptr, indtype, indsp, indsp->accepts_cargo, cargo_suffix); std::string cargostring = this->MakeCargoListString(indsp->accepts_cargo, cargo_suffix, lengthof(indsp->accepts_cargo), STR_INDUSTRY_VIEW_REQUIRES_N_CARGO); Dimension strdim = GetStringBoundingBox(cargostring.c_str()); if (strdim.width > max_minwidth) { @@ -459,7 +448,7 @@ public: d = maxdim(d, strdim); /* Measure the produced cargoes, if any. */ - GetAllCargoSuffixes(CARGOSUFFIX_OUT, CST_FUND, nullptr, this->index[i], indsp, indsp->produced_cargo, cargo_suffix); + GetAllCargoSuffixes(CARGOSUFFIX_OUT, CST_FUND, nullptr, indtype, indsp, indsp->produced_cargo, cargo_suffix); cargostring = this->MakeCargoListString(indsp->produced_cargo, cargo_suffix, lengthof(indsp->produced_cargo), STR_INDUSTRY_VIEW_PRODUCES_N_CARGO); strdim = GetStringBoundingBox(cargostring.c_str()); if (strdim.width > max_minwidth) { @@ -503,8 +492,8 @@ public: /* We've chosen many random industries but no industries have been specified */ SetDParam(0, STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY); } else { - if (count > 0) { - const IndustrySpec *indsp = GetIndustrySpec(this->index[this->selected_index]); + if (this->selected_type != INVALID_INDUSTRYTYPE) { + const IndustrySpec *indsp = GetIndustrySpec(this->selected_type); SetDParam(0, (_settings_game.construction.raw_industry_construction == 2 && indsp->IsRawIndustry()) ? STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY : STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY); } else { SetDParam(0, STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY); @@ -527,19 +516,15 @@ public: icon.top = r.top + (this->resize.step_height - this->legend.height + 1) / 2; icon.bottom = icon.top + this->legend.height - 1; - for (uint16 i = 0; i < this->vscroll->GetCapacity() && i + this->vscroll->GetPosition() < this->count; i++) { - bool selected = this->selected_index == i + this->vscroll->GetPosition(); + for (uint16 i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) { + bool selected = this->selected_type == this->list[i]; - if (this->index[i + this->vscroll->GetPosition()] == INVALID_INDUSTRYTYPE) { - DrawString(text, STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES, selected ? TC_WHITE : TC_ORANGE); - } else { - const IndustrySpec *indsp = GetIndustrySpec(this->index[i + this->vscroll->GetPosition()]); + const IndustrySpec *indsp = GetIndustrySpec(this->list[i]); - /* Draw the name of the industry in white is selected, otherwise, in orange */ - DrawString(text, indsp->name, selected ? TC_WHITE : TC_ORANGE); - GfxFillRect(icon, selected ? PC_WHITE : PC_BLACK); - GfxFillRect(icon.Shrink(WidgetDimensions::scaled.bevel), indsp->map_colour); - } + /* Draw the name of the industry in white is selected, otherwise, in orange */ + DrawString(text, indsp->name, selected ? TC_WHITE : TC_ORANGE); + GfxFillRect(icon, selected ? PC_WHITE : PC_BLACK); + GfxFillRect(icon.Shrink(WidgetDimensions::scaled.bevel), indsp->map_colour); text = text.Translate(0, this->resize.step_height); icon = icon.Translate(0, this->resize.step_height); @@ -646,24 +631,23 @@ public: case WID_DPI_MATRIX_WIDGET: { int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_DPI_MATRIX_WIDGET); - if (y < this->count) { // Is it within the boundaries of available data? - this->selected_index = y; - this->selected_type = this->index[y]; - const IndustrySpec *indsp = (this->selected_type == INVALID_INDUSTRYTYPE) ? nullptr : GetIndustrySpec(this->selected_type); + if (y != INT_MAX) { // Is it within the boundaries of available data? + this->selected_type = this->list[y]; + this->UpdateAvailability(); + + const IndustrySpec *indsp = GetIndustrySpec(this->selected_type); this->SetDirty(); if (_thd.GetCallbackWnd() == this && - ((_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && indsp != nullptr && indsp->IsRawIndustry()) || - this->selected_type == INVALID_INDUSTRYTYPE || - !this->enabled[this->selected_index])) { + ((_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && indsp != nullptr && indsp->IsRawIndustry()) || !this->enabled)) { /* Reset the button state if going to prospecting or "build many industries" */ this->RaiseButtons(); ResetObjectToPlace(); } this->SetButtons(); - if (this->enabled[this->selected_index] && click_count > 1) this->OnClick(pt, WID_DPI_FUND_WIDGET, 1); + if (this->enabled && click_count > 1) this->OnClick(pt, WID_DPI_FUND_WIDGET, 1); } break; } @@ -727,18 +711,13 @@ public: IntervalTimer update_interval = {std::chrono::seconds(3), [this](auto) { if (_game_mode == GM_EDITOR) return; - if (this->count == 0) return; - const IndustrySpec *indsp = GetIndustrySpec(this->selected_type); + if (this->selected_type == INVALID_INDUSTRYTYPE) return; - if (indsp->enabled) { - bool call_back_result = GetIndustryProbabilityCallback(this->selected_type, IACT_USERCREATION, 1) > 0; - - /* Only if result does match the previous state would it require a redraw. */ - if (call_back_result != this->enabled[this->selected_index]) { - this->enabled[this->selected_index] = call_back_result; - this->SetButtons(); - this->SetDirty(); - } + bool enabled = this->enabled; + this->UpdateAvailability(); + if (enabled != this->enabled) { + this->SetButtons(); + this->SetDirty(); } }}; @@ -761,9 +740,6 @@ public: { if (!gui_scope) return; this->SetupArrays(); - - const IndustrySpec *indsp = (this->selected_type == INVALID_INDUSTRYTYPE) ? nullptr : GetIndustrySpec(this->selected_type); - if (indsp == nullptr) this->enabled[this->selected_index] = _settings_game.difficulty.industry_density != ID_FUND_ONLY; this->SetButtons(); this->SetDirty(); } From 98d809c33bdf1133b521038bfc52b2f4362178aa Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 7 May 2023 05:25:24 -0400 Subject: [PATCH 17/38] Codechange: Don't use macros for DAYS_TILL and friends (#10746) --- src/company_gui.cpp | 4 ++-- src/console_cmds.cpp | 4 ++-- src/date_type.h | 30 ++++++++++-------------------- src/newgrf_profiling.cpp | 2 +- src/rail.cpp | 4 ++-- src/road.cpp | 6 +++--- src/table/object_land.h | 2 +- src/timer/timer_game_calendar.cpp | 2 +- src/timetable_cmd.cpp | 4 ++-- src/town_cmd.cpp | 2 +- src/vehicle.cpp | 2 +- 11 files changed, 26 insertions(+), 36 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index cbeca84679..37de4a8625 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1866,7 +1866,7 @@ struct CompanyInfrastructureWindow : Window } /* Get the date introduced railtypes as well. */ - this->railtypes = AddDateIntroducedRailTypes(this->railtypes, MAX_DAY); + this->railtypes = AddDateIntroducedRailTypes(this->railtypes, MAX_DATE); /* Find the used roadtypes. */ for (const Engine *e : Engine::IterateType(VEH_ROAD)) { @@ -1876,7 +1876,7 @@ struct CompanyInfrastructureWindow : Window } /* Get the date introduced roadtypes as well. */ - this->roadtypes = AddDateIntroducedRoadTypes(this->roadtypes, MAX_DAY); + this->roadtypes = AddDateIntroducedRoadTypes(this->roadtypes, MAX_DATE); this->roadtypes &= ~_roadtypes_hidden_mask; } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 267fa1b5d7..b3dff03c03 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -2293,7 +2293,7 @@ DEF_CONSOLE_CMD(ConNewGRFProfile) GetString(datestrbuf, STR_JUST_DATE_ISO, lastof(datestrbuf)); IConsolePrint(CC_DEBUG, "Profiling will automatically stop on game date {}.", datestrbuf); } else { - _newgrf_profile_end_date = MAX_DAY; + _newgrf_profile_end_date = MAX_DATE; } } else if (_newgrf_profilers.empty()) { IConsolePrint(CC_ERROR, "No GRFs selected for profiling, did not start."); @@ -2314,7 +2314,7 @@ DEF_CONSOLE_CMD(ConNewGRFProfile) for (NewGRFProfiler &pr : _newgrf_profilers) { pr.Abort(); } - _newgrf_profile_end_date = MAX_DAY; + _newgrf_profile_end_date = MAX_DATE; return true; } diff --git a/src/date_type.h b/src/date_type.h index ce77eddd8d..1544f71d87 100644 --- a/src/date_type.h +++ b/src/date_type.h @@ -51,32 +51,22 @@ static const TimerGameCalendar::Year ORIGINAL_END_YEAR = 2051; /** The maximum year of the original TTD */ static const TimerGameCalendar::Year ORIGINAL_MAX_YEAR = 2090; -/** - * Calculate the number of leap years till a given year. - * - * Each passed leap year adds one day to the 'day count'. - * - * A special case for the year 0 as no year has been passed, - * but '(year - 1) / 4' does not yield '-1' to counteract the - * '+1' at the end of the formula as divisions round to zero. - * - * @param year the year to get the leap years till. - * @return the number of leap years. - */ -#define LEAP_YEARS_TILL(year) ((year) == 0 ? 0 : ((year) - 1) / 4 - ((year) - 1) / 100 + ((year) - 1) / 400 + 1) - /** * Calculate the date of the first day of a given year. * @param year the year to get the first day of. * @return the date. */ -#define DAYS_TILL(year) (DAYS_IN_YEAR * (year) + LEAP_YEARS_TILL(year)) +static inline TimerGameCalendar::Date DateAtStartOfYear(TimerGameCalendar::Year year) +{ + uint number_of_leap_years = (year == 0) ? 0 : ((year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400 + 1); + + return (DAYS_IN_YEAR * year) + number_of_leap_years; +} /** - * The offset in days from the 'TimerGameCalendar::date == 0' till - * 'TimerGameCalendar::ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)' + * The date of the first day of the original base year. */ -#define DAYS_TILL_ORIGINAL_BASE_YEAR DAYS_TILL(ORIGINAL_BASE_YEAR) +static const TimerGameCalendar::Date DAYS_TILL_ORIGINAL_BASE_YEAR = DateAtStartOfYear(ORIGINAL_BASE_YEAR); /** The absolute minimum & maximum years in OTTD */ static const TimerGameCalendar::Year MIN_YEAR = 0; @@ -92,8 +82,8 @@ static const TimerGameCalendar::Year DEF_END_YEAR = ORIGINAL_END_YEAR - 1; */ static const TimerGameCalendar::Year MAX_YEAR = 5000000; -/** The number of days till the last day */ -#define MAX_DAY (DAYS_TILL(MAX_YEAR + 1) - 1) +/** The date of the last day of the max year. */ +static const TimerGameCalendar::Date MAX_DATE = DateAtStartOfYear(MAX_YEAR + 1) - 1; static const TimerGameCalendar::Year INVALID_YEAR = -1; ///< Representation of an invalid year static const TimerGameCalendar::Date INVALID_DATE = -1; ///< Representation of an invalid date diff --git a/src/newgrf_profiling.cpp b/src/newgrf_profiling.cpp index 15d9c8fd9b..e0ea3925e1 100644 --- a/src/newgrf_profiling.cpp +++ b/src/newgrf_profiling.cpp @@ -156,7 +156,7 @@ uint32 NewGRFProfiler::FinishAll() IConsolePrint(CC_DEBUG, "Total NewGRF callback processing: {} microseconds over {} ticks.", total_microseconds, max_ticks); } - _newgrf_profile_end_date = MAX_DAY; + _newgrf_profile_end_date = MAX_DATE; return total_microseconds; } diff --git a/src/rail.cpp b/src/rail.cpp index af406bca0a..8f05c09785 100644 --- a/src/rail.cpp +++ b/src/rail.cpp @@ -225,7 +225,7 @@ RailTypes AddDateIntroducedRailTypes(RailTypes current, TimerGameCalendar::Date if (rti->label == 0) continue; /* Not date introduced. */ - if (!IsInsideMM(rti->introduction_date, 0, MAX_DAY)) continue; + if (!IsInsideMM(rti->introduction_date, 0, MAX_DATE)) continue; /* Not yet introduced at this date. */ if (rti->introduction_date > date) continue; @@ -298,7 +298,7 @@ RailTypes GetRailTypes(bool introduces) } } - if (introduces) return AddDateIntroducedRailTypes(rts, MAX_DAY); + if (introduces) return AddDateIntroducedRailTypes(rts, MAX_DATE); return rts; } diff --git a/src/road.cpp b/src/road.cpp index 8195ba2518..b5c4963333 100644 --- a/src/road.cpp +++ b/src/road.cpp @@ -163,7 +163,7 @@ RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, TimerGameCalendar::Date if (rti->label == 0) continue; /* Not date introduced. */ - if (!IsInsideMM(rti->introduction_date, 0, MAX_DAY)) continue; + if (!IsInsideMM(rti->introduction_date, 0, MAX_DATE)) continue; /* Not yet introduced at this date. */ if (rti->introduction_date > date) continue; @@ -231,7 +231,7 @@ RoadTypes GetRoadTypes(bool introduces) } } - if (introduces) return AddDateIntroducedRoadTypes(rts, MAX_DAY); + if (introduces) return AddDateIntroducedRoadTypes(rts, MAX_DATE); return rts; } @@ -292,7 +292,7 @@ RoadTypes ExistingRoadTypes(CompanyID c) } /* Get the date introduced roadtypes as well. */ - known_roadtypes = AddDateIntroducedRoadTypes(known_roadtypes, MAX_DAY); + known_roadtypes = AddDateIntroducedRoadTypes(known_roadtypes, MAX_DATE); return known_roadtypes; } diff --git a/src/table/object_land.h b/src/table/object_land.h index e5371712e7..4c4dcf95a1 100644 --- a/src/table/object_land.h +++ b/src/table/object_land.h @@ -121,7 +121,7 @@ static const DrawTileSprites _object_hq[] = { #undef TILE_SPRITE_LINE -#define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) { GRFFilePropsBase<2>(), {0, 0, 0, 0}, INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, MAX_DAY + 1, flags, 0, height, 1, gen_amount } +#define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) { GRFFilePropsBase<2>(), {0, 0, 0, 0}, INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, MAX_DATE + 1, flags, 0, height, 1, gen_amount } /* Climates * T = Temperate diff --git a/src/timer/timer_game_calendar.cpp b/src/timer/timer_game_calendar.cpp index 7ca331bab4..dd72187bd5 100644 --- a/src/timer/timer_game_calendar.cpp +++ b/src/timer/timer_game_calendar.cpp @@ -131,7 +131,7 @@ static const uint16 _accum_days_for_month[] = { /* Account for the missing of the 29th of February in non-leap years */ if (!TimerGameCalendar::IsLeapYear(year) && days >= ACCUM_MAR) days--; - return DAYS_TILL(year) + days; + return DateAtStartOfYear(year) + days; } /** diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 6e07381898..3b07c91adc 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -303,11 +303,11 @@ CommandCost CmdSetTimetableStart(DoCommandFlag flags, VehicleID veh_id, bool tim int total_duration = v->orders->GetTimetableTotalDuration(); /* Don't let a timetable start more than 15 years into the future or 1 year in the past. */ - if (start_date < 0 || start_date > MAX_DAY) return CMD_ERROR; + if (start_date < 0 || start_date > MAX_DATE) return CMD_ERROR; if (start_date - TimerGameCalendar::date > MAX_TIMETABLE_START_YEARS * DAYS_IN_LEAP_YEAR) return CMD_ERROR; if (TimerGameCalendar::date - start_date > DAYS_IN_LEAP_YEAR) return CMD_ERROR; if (timetable_all && !v->orders->IsCompleteTimetable()) return CommandCost(STR_ERROR_TIMETABLE_INCOMPLETE); - if (timetable_all && start_date + total_duration / DAY_TICKS > MAX_DAY) return CMD_ERROR; + if (timetable_all && start_date + total_duration / DAY_TICKS > MAX_DATE) return CMD_ERROR; if (flags & DC_EXEC) { std::vector vehs; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 6ff0784e56..aee1b329bb 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -873,7 +873,7 @@ RoadType GetTownRoadType(const Town *t) if (!HasBit(rti->flags, ROTF_TOWN_BUILD)) continue; /* Not yet introduced at this date. */ - if (IsInsideMM(rti->introduction_date, 0, MAX_DAY) && rti->introduction_date > TimerGameCalendar::date) continue; + if (IsInsideMM(rti->introduction_date, 0, MAX_DATE) && rti->introduction_date > TimerGameCalendar::date) continue; if (best != nullptr) { if ((rti->max_speed == 0 ? assume_max_speed : rti->max_speed) < (best->max_speed == 0 ? assume_max_speed : best->max_speed)) continue; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 31d01af038..cb34349214 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1370,7 +1370,7 @@ bool Vehicle::HandleBreakdown() */ void AgeVehicle(Vehicle *v) { - if (v->age < MAX_DAY) { + if (v->age < MAX_DATE) { v->age++; if (v->IsPrimaryVehicle() && v->age == VEHICLE_PROFIT_MIN_AGE + 1) GroupStatistics::VehicleReachedMinAge(v); } From 3375f25b707c7d2b911352e16ba22a0725e87255 Mon Sep 17 00:00:00 2001 From: kiwitreekor Date: Mon, 8 May 2023 03:04:34 +0900 Subject: [PATCH 18/38] Fix: Var68 for station and roadstop was broken (#10784) --- src/newgrf_roadstop.cpp | 2 +- src/newgrf_station.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index b746f2ffe8..bafd66a529 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -157,7 +157,7 @@ uint32 RoadStopScopeResolver::GetVariable(byte variable, uint32 parameter, bool if (IsCustomRoadStopSpecIndex(nearby_tile)) { const RoadStopSpecList ssl = BaseStation::GetByTile(nearby_tile)->roadstop_speclist[GetCustomRoadStopSpecIndex(nearby_tile)]; - res |= 1 << (ssl.grfid != grfid ? 9 : 8) | std::max(ssl.localidx, 0xFF); + res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ClampTo(ssl.localidx); } return res; } diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index f13f09974a..9dc117d5b8 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -364,7 +364,7 @@ TownScopeResolver *StationResolverObject::GetTown() if (IsCustomStationSpecIndex(nearby_tile)) { const StationSpecList ssl = BaseStation::GetByTile(nearby_tile)->speclist[GetCustomStationSpecIndex(nearby_tile)]; - res |= 1 << (ssl.grfid != grfid ? 9 : 8) | std::max(ssl.localidx, 0xFF); + res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ClampTo(ssl.localidx); } return res; } From 923d1b08467f3cddf213aa9537c2c1af610f7924 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 7 May 2023 18:39:28 +0000 Subject: [PATCH 19/38] Update: Translations from eints vietnamese: 5 changes by KhoiCanDev --- src/lang/vietnamese.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index aba4254d97..13f3a7ef02 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -1170,6 +1170,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Mở xu STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Đóng lại tất cả STR_CONFIG_SETTING_RESET_ALL :{BLACK}Thiết lập lại tất cả STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(hiện không có giải thích nào) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Giá trị mặc định: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Kiểu thiết lập: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Cấu hình máy khách (không được lưu trong save; tác động tới tất cả các ván chơi) @@ -3827,6 +3828,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Gửi ch STR_VEHICLE_LIST_REPLACE_VEHICLES :Thay phương tiện STR_VEHICLE_LIST_SEND_FOR_SERVICING :Gửi về bảo trì STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Lợi nhuận năm nay: {CURRENCY_LONG} (năm ngoái: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Gửi về xưởng STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Gửi về xưởng @@ -5588,11 +5591,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} From d2034d9c38923a0ce48d2caf22f3651edb3e64b1 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 7 May 2023 16:10:56 +0100 Subject: [PATCH 20/38] Codechange: Scrollbar methods now accept size_t. This clears up a lot of casts from size_t to int. --- src/autoreplace_gui.cpp | 4 ++-- src/bridge_gui.cpp | 2 +- src/build_vehicle_gui.cpp | 2 +- src/depot_gui.cpp | 2 +- src/fios_gui.cpp | 2 +- src/game/game_gui.cpp | 2 +- src/graph_gui.cpp | 2 +- src/group_gui.cpp | 8 ++++---- src/industry_gui.cpp | 4 ++-- src/network/network_content_gui.cpp | 2 +- src/network/network_gui.cpp | 2 +- src/newgrf_debug_gui.cpp | 2 +- src/newgrf_gui.cpp | 4 ++-- src/object_gui.cpp | 4 ++-- src/rail_gui.cpp | 4 ++-- src/road_gui.cpp | 4 ++-- src/script/script_gui.cpp | 8 ++++---- src/signs_gui.cpp | 2 +- src/station_gui.cpp | 4 ++-- src/town_gui.cpp | 2 +- src/vehicle_gui.cpp | 2 +- src/widget_type.h | 15 +++++++-------- src/widgets/dropdown.cpp | 4 ++-- 23 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 69fc99e44b..fede79ef85 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -217,7 +217,7 @@ class ReplaceVehicleWindow : public Window { if (this->engines[0].NeedRebuild()) { /* We need to rebuild the left engines list */ this->GenerateReplaceVehList(true); - this->vscroll[0]->SetCount((uint)this->engines[0].size()); + this->vscroll[0]->SetCount(this->engines[0].size()); if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].size() != 0) { this->sel_engine[0] = this->engines[0][0].engine_id; } @@ -237,7 +237,7 @@ class ReplaceVehicleWindow : public Window { } /* Regenerate the list on the right. Note: This resets sel_engine[1] to INVALID_ENGINE, if it is no longer available. */ this->GenerateReplaceVehList(false); - this->vscroll[1]->SetCount((uint)this->engines[1].size()); + this->vscroll[1]->SetCount(this->engines[1].size()); if (this->reset_sel_engine && this->sel_engine[1] != INVALID_ENGINE) { int position = 0; for (const auto &item : this->engines[1]) { diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 0ed9ea78cc..f2e20c7b21 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -167,7 +167,7 @@ public: this->bridges->NeedResort(); this->SortBridgeList(); - this->vscroll->SetCount((uint)bl->size()); + this->vscroll->SetCount(bl->size()); } ~BuildBridgeWindow() diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 84ff30fb29..0e9a7d727a 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1787,7 +1787,7 @@ struct BuildVehicleWindow : Window { void OnPaint() override { this->GenerateBuildList(); - this->vscroll->SetCount((uint)this->eng_list.size()); + this->vscroll->SetCount(this->eng_list.size()); this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD, WIDGET_LIST_END); diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index fa8aca26ec..e05682c5a5 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -735,7 +735,7 @@ struct DepotWindow : Window { max_width = std::max(max_width, width); } /* Always have 1 empty row, so people can change the setting of the train */ - this->vscroll->SetCount((uint)this->vehicle_list.size() + (uint)this->wagon_list.size() + 1); + this->vscroll->SetCount(this->vehicle_list.size() + this->wagon_list.size() + 1); /* Always make it longer than the longest train, so you can attach vehicles at the end, and also see the next vertical tile separator line */ this->hscroll->SetCount(max_width + ScaleSpriteTrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1)); } else { diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index bfe14e486d..07e55384d7 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -821,7 +821,7 @@ public: _fios_path_changed = true; this->fios_items.BuildFileList(this->abstract_filetype, this->fop); - this->vscroll->SetCount((uint)this->fios_items.size()); + this->vscroll->SetCount(this->fios_items.size()); this->selected = nullptr; _load_check_data.Clear(); diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index 0885f38db6..5ce1c3d7eb 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -127,7 +127,7 @@ struct GSConfigWindow : public Window { } } - this->vscroll->SetCount((int)this->visible_settings.size()); + this->vscroll->SetCount(this->visible_settings.size()); } void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 47e596177a..57d6cc9192 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -892,7 +892,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_CPR_MATRIX_SCROLLBAR); - this->vscroll->SetCount(static_cast(_sorted_standard_cargo_specs.size())); + this->vscroll->SetCount(_sorted_standard_cargo_specs.size()); /* Initialise the dataset */ this->UpdatePaymentRates(); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 704c41ec91..f6521c34a9 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -364,7 +364,7 @@ public: this->groups.ForceRebuild(); this->groups.NeedResort(); this->BuildGroupList(vli.company); - this->group_sb->SetCount((uint)this->groups.size()); + this->group_sb->SetCount(this->groups.size()); this->GetWidget(WID_GL_CAPTION)->widget_data = STR_VEHICLE_LIST_TRAIN_CAPTION + this->vli.vtype; this->GetWidget(WID_GL_LIST_VEHICLE)->tool_tip = STR_VEHICLE_LIST_TRAIN_LIST_TOOLTIP + this->vli.vtype; @@ -506,8 +506,8 @@ public: this->BuildGroupList(this->owner); - this->group_sb->SetCount(static_cast(this->groups.size())); - this->vscroll->SetCount(static_cast(this->vehgroups.size())); + this->group_sb->SetCount(this->groups.size()); + this->vscroll->SetCount(this->vehgroups.size()); /* The drop down menu is out, *but* it may not be used, retract it. */ if (this->vehicles.size() == 0 && this->IsWidgetLowered(WID_GL_MANAGE_VEHICLES_DROPDOWN)) { @@ -1087,7 +1087,7 @@ public: } this->groups.ForceRebuild(); this->BuildGroupList(this->owner); - this->group_sb->SetCount((uint)this->groups.size()); + this->group_sb->SetCount(this->groups.size()); id_g = find_index(this->groups, g); } this->group_sb->ScrollTowards(id_g); diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 1d85abbe8e..0b419637ba 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -325,7 +325,7 @@ class BuildIndustryWindow : public Window { this->UpdateAvailability(); - this->vscroll->SetCount((int)this->list.size()); + this->vscroll->SetCount(this->list.size()); } /** Update status of the fund and display-chain widgets. */ @@ -1419,7 +1419,7 @@ protected: IndustryDirectoryWindow::produced_cargo_filter = this->cargo_filter[this->produced_cargo_filter_criteria]; this->industries.Sort(); - this->vscroll->SetCount((uint)this->industries.size()); // Update scrollbar as well. + this->vscroll->SetCount(this->industries.size()); // Update scrollbar as well. this->SetDirty(); } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 7d53329069..18b5470051 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -423,7 +423,7 @@ class NetworkContentListWindow : public Window, ContentCallback { this->content.RebuildDone(); this->SortContentList(); - this->vscroll->SetCount((int)this->content.size()); // Update the scrollbar + this->vscroll->SetCount(this->content.size()); // Update the scrollbar this->ScrollToSelected(); } diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 63f2284247..72d3d7d94b 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -279,7 +279,7 @@ protected: this->servers.shrink_to_fit(); this->servers.RebuildDone(); - this->vscroll->SetCount((int)this->servers.size()); + this->vscroll->SetCount(this->servers.size()); /* Sort the list of network games as requested. */ this->servers.Sort(); diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index ff927c2952..026768f15e 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -1055,7 +1055,7 @@ struct SpriteAlignerWindow : Window { if (data == 1) { /* Sprite picker finished */ this->RaiseWidget(WID_SA_PICKER); - this->vscroll->SetCount((uint)_newgrf_debug_sprite_picker.sprites.size()); + this->vscroll->SetCount(_newgrf_debug_sprite_picker.sprites.size()); } } diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 663de441c2..a4323dc98f 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1490,7 +1490,7 @@ private: } } - this->vscroll2->SetCount((uint)this->avails.size()); // Update the scrollbar + this->vscroll2->SetCount(this->avails.size()); // Update the scrollbar } /** @@ -2068,7 +2068,7 @@ struct SavePresetWindow : public Window { this->vscroll = this->GetScrollbar(WID_SVP_SCROLLBAR); this->FinishInitNested(0); - this->vscroll->SetCount((uint)this->presets.size()); + this->vscroll->SetCount(this->presets.size()); this->SetFocusedWidget(WID_SVP_EDITBOX); if (initial_text != nullptr) this->presetname_editbox.text.Assign(initial_text); } diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 414d930e5d..a598853e5b 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -125,7 +125,7 @@ public: ResetObjectToPlace(); - this->vscroll->SetCount((int)this->object_classes.size()); + this->vscroll->SetCount(this->object_classes.size()); EnsureSelectedObjectClassIsVisible(); @@ -166,7 +166,7 @@ public: this->object_classes.RebuildDone(); this->object_classes.Sort(); - this->vscroll->SetCount((uint)this->object_classes.size()); + this->vscroll->SetCount(this->object_classes.size()); } /** diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 71f7bd5a8a..54e7443825 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -929,7 +929,7 @@ private: if (station_class == _railstation.station_class) break; pos++; } - this->vscroll->SetCount((int)this->station_classes.size()); + this->vscroll->SetCount(this->station_classes.size()); this->vscroll->ScrollTowards(pos); } @@ -1075,7 +1075,7 @@ public: this->station_classes.RebuildDone(); this->station_classes.Sort(); - this->vscroll->SetCount((uint)this->station_classes.size()); + this->vscroll->SetCount(this->station_classes.size()); } } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 2dc7ec39f9..4731f2e606 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -1135,7 +1135,7 @@ private: if (rs_class == _roadstop_gui_settings.roadstop_class) break; pos++; } - this->vscrollList->SetCount((int)this->roadstop_classes.size()); + this->vscrollList->SetCount(this->roadstop_classes.size()); this->vscrollList->ScrollTowards(pos); } @@ -1281,7 +1281,7 @@ public: this->roadstop_classes.RebuildDone(); this->roadstop_classes.Sort(); - this->vscrollList->SetCount((uint)this->roadstop_classes.size()); + this->vscrollList->SetCount(this->roadstop_classes.size()); } } diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index e77c1c7ede..673747f2cd 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -77,7 +77,7 @@ struct ScriptListWindow : public Window { this->vscroll = this->GetScrollbar(WID_SCRL_SCROLLBAR); this->FinishInitNested(); // Initializes 'this->line_height' as side effect. - this->vscroll->SetCount((int)this->info_list->size() + 1); + this->vscroll->SetCount(this->info_list->size() + 1); /* Try if we can find the currently selected AI */ this->selected = -1; @@ -231,7 +231,7 @@ struct ScriptListWindow : public Window { if (!gui_scope) return; - this->vscroll->SetCount((int)this->info_list->size() + 1); + this->vscroll->SetCount(this->info_list->size() + 1); /* selected goes from -1 .. length of ai list - 1. */ this->selected = std::min(this->selected, this->vscroll->GetCount() - 2); @@ -332,7 +332,7 @@ struct ScriptSettingsWindow : public Window { } } - this->vscroll->SetCount((int)this->visible_settings.size()); + this->vscroll->SetCount(this->visible_settings.size()); } void SetStringParameters(int widget) const override @@ -1070,7 +1070,7 @@ struct ScriptDebugWindow : public Window { this->SelectValidDebugCompany(); - this->vscroll->SetCount(script_debug_company != INVALID_COMPANY ? (int)this->GetLogData().size() : 0); + this->vscroll->SetCount(script_debug_company != INVALID_COMPANY ? this->GetLogData().size() : 0); /* Update company buttons */ for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) { diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 925956b93f..070ee6261a 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -308,7 +308,7 @@ struct SignListWindow : Window, SignList { { if (this->signs.NeedRebuild()) { this->BuildSignsList(); - this->vscroll->SetCount((uint)this->signs.size()); + this->vscroll->SetCount(this->signs.size()); this->SetWidgetDirty(WID_SIL_CAPTION); } this->SortSignsList(); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 052b5f2783..e206aec033 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -252,7 +252,7 @@ protected: this->stations.shrink_to_fit(); this->stations.RebuildDone(); - this->vscroll->SetCount((uint)this->stations.size()); // Update the scrollbar + this->vscroll->SetCount(this->stations.size()); // Update the scrollbar } /** Sort stations by their name */ @@ -2345,7 +2345,7 @@ struct SelectStationWindow : Window { { if (!gui_scope) return; FindStationsNearby(this->area, true); - this->vscroll->SetCount((uint)_stations_nearby_list.size() + 1); + this->vscroll->SetCount(_stations_nearby_list.size() + 1); this->SetDirty(); } diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 54142d1207..c42b92f58c 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -736,7 +736,7 @@ private: this->towns.shrink_to_fit(); this->towns.RebuildDone(); - this->vscroll->SetCount((uint)this->towns.size()); // Update scrollbar as well. + this->vscroll->SetCount(this->towns.size()); // Update scrollbar as well. } /* Always sort the towns. */ this->towns.Sort(); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 80c9e7218b..50c5267ea9 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -224,7 +224,7 @@ void BaseVehicleListWindow::BuildVehicleList() } this->vehgroups.RebuildDone(); - this->vscroll->SetCount(static_cast(this->vehgroups.size())); + this->vscroll->SetCount(this->vehgroups.size()); } diff --git a/src/widget_type.h b/src/widget_type.h index 7643537aa5..0e8f940c60 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -704,10 +704,11 @@ public: * Set the distance to scroll when using the buttons or the wheel. * @param stepsize Scrolling speed. */ - void SetStepSize(uint16 stepsize) + void SetStepSize(size_t stepsize) { assert(stepsize > 0); - this->stepsize = stepsize; + + this->stepsize = ClampTo(stepsize); } /** @@ -715,12 +716,11 @@ public: * @param num the number of elements in the list * @note updates the position if needed */ - void SetCount(int num) + void SetCount(size_t num) { - assert(num >= 0); assert(num <= MAX_UVALUE(uint16)); - this->count = num; + this->count = ClampTo(num); num -= this->cap; if (num < 0) num = 0; if (num < this->pos) this->pos = num; @@ -731,12 +731,11 @@ public: * @param capacity the new capacity * @note updates the position if needed */ - void SetCapacity(int capacity) + void SetCapacity(size_t capacity) { - assert(capacity > 0); assert(capacity <= MAX_UVALUE(uint16)); - this->cap = capacity; + this->cap = ClampTo(capacity); if (this->cap + this->pos > this->count) this->pos = std::max(0, this->count - this->cap); } diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 1c7a7492e7..a9eb238453 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -172,8 +172,8 @@ struct DropdownWindow : Window { } /* Capacity is the average number of items visible */ - this->vscroll->SetCapacity(size.height * (uint16)this->list.size() / list_height); - this->vscroll->SetCount((uint16)this->list.size()); + this->vscroll->SetCapacity(size.height * this->list.size() / list_height); + this->vscroll->SetCount(this->list.size()); this->parent_wnd_class = parent->window_class; this->parent_wnd_num = parent->window_number; From 6202eae9d56c39a58c5f0699128a83b166035e2e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 7 May 2023 09:55:21 +0100 Subject: [PATCH 21/38] Codechange: Rely on Scrollbar::SetPosition to clamp. Manually clamping scrollbar bounds before calling `SetPosition()` is doubling up work that the function already does. --- src/script/script_gui.cpp | 5 ++--- src/window.cpp | 11 ++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index 673747f2cd..2546083ded 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -860,11 +860,10 @@ struct ScriptDebugWindow : public Window { /* Detect when the user scrolls the window. Enable autoscroll when the * bottom-most line becomes visible. */ if (this->last_vscroll_pos != this->vscroll->GetPosition()) { - this->autoscroll = this->vscroll->GetPosition() >= log.size() - this->vscroll->GetCapacity(); + this->autoscroll = this->vscroll->GetPosition() + this->vscroll->GetCapacity() >= (int)log.size(); } if (this->autoscroll) { - int scroll_pos = std::max(0, (int)log.size() - this->vscroll->GetCapacity()); - if (this->vscroll->SetPosition(scroll_pos)) { + if (this->vscroll->SetPosition((int)log.size())) { /* We need a repaint */ this->SetWidgetDirty(WID_SCRD_SCROLLBAR); this->SetWidgetDirty(WID_SCRD_LOG_PANEL); diff --git a/src/window.cpp b/src/window.cpp index 16a43e0fdd..c12aab6e37 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2379,13 +2379,10 @@ static void HandleScrollbarScrolling(Window *w) return; } - /* Find the item we want to move to and make sure it's inside bounds. */ - int pos = std::min(RoundDivSU(std::max(0, i + _scrollbar_start_pos) * sb->GetCount(), _scrollbar_size), std::max(0, sb->GetCount() - sb->GetCapacity())); - if (rtl) pos = std::max(0, sb->GetCount() - sb->GetCapacity() - pos); - if (pos != sb->GetPosition()) { - sb->SetPosition(pos); - w->SetDirty(); - } + /* Find the item we want to move to. SetPosition will make sure it's inside bounds. */ + int pos = RoundDivSU((i + _scrollbar_start_pos) * sb->GetCount(), _scrollbar_size); + if (rtl) pos = sb->GetCount() - sb->GetCapacity() - pos; + if (sb->SetPosition(pos)) w->SetDirty(); } /** From 878c5d8d850cd1b94ead3e270782e8ea8f73508b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 7 May 2023 10:44:50 +0100 Subject: [PATCH 22/38] Codechange: Use SetPosition() to clamp after changing count/capacity. --- src/widget_type.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widget_type.h b/src/widget_type.h index 0e8f940c60..e697b3ea5d 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -721,9 +721,8 @@ public: assert(num <= MAX_UVALUE(uint16)); this->count = ClampTo(num); - num -= this->cap; - if (num < 0) num = 0; - if (num < this->pos) this->pos = num; + /* Ensure position is within bounds */ + this->SetPosition(this->pos); } /** @@ -736,7 +735,8 @@ public: assert(capacity <= MAX_UVALUE(uint16)); this->cap = ClampTo(capacity); - if (this->cap + this->pos > this->count) this->pos = std::max(0, this->count - this->cap); + /* Ensure position is within bounds */ + this->SetPosition(this->pos); } void SetCapacityFromWidget(Window *w, int widget, int padding = 0); From 2955ff33d7dcdf675511f405e8c1547dd462d0b3 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 21 Apr 2023 20:10:31 +0200 Subject: [PATCH 23/38] Change: use precompiled headers for stdafx.h and 3rdparty/fmt/format.h --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ae67f5280..27b7b0e7d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.16) if(NOT BINARY_NAME) set(BINARY_NAME openttd) @@ -6,6 +6,7 @@ endif() project(${BINARY_NAME} VERSION 14.0 + LANGUAGES CXX ) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) @@ -149,6 +150,8 @@ if(NOT OPTION_DEDICATED) endif() endif() if(APPLE) + enable_language(OBJCXX) + find_package(Iconv) find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox) @@ -243,6 +246,12 @@ if(MSVC) target_sources(openttd PRIVATE "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest") endif() +target_precompile_headers(openttd_lib + PRIVATE + src/stdafx.h + src/3rdparty/fmt/format.h +) + add_subdirectory(${CMAKE_SOURCE_DIR}/bin) add_subdirectory(${CMAKE_SOURCE_DIR}/src) add_subdirectory(${CMAKE_SOURCE_DIR}/media) From 192ed55462cc39bef8245e432bee592b11131e59 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 7 May 2023 19:22:30 +0200 Subject: [PATCH 24/38] Change: disable precompiled headers on Linux (GCC - Dedicated) target to ensure those still build --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 29fb6db54d..7892bf53d0 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -88,7 +88,7 @@ jobs: - name: GCC - Dedicated compiler: gcc cxxcompiler: g++ - extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" + extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON # Compile without SDL / SDL2, as that should compile fine too. name: Linux (${{ matrix.name }}) From 68ff3fd062bce9ad0f193087a0eda5d46c47031b Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 7 May 2023 21:54:36 +0200 Subject: [PATCH 25/38] Change: include fmt.h C++ headers in stdafx.h This to prevent compilation issues between runs with and without precompiled headers. Also remove the headers from the rest of the code base as they are not needed there anymore, although they do relatively little harm. --- src/base_consist.h | 1 - src/bitmap_type.h | 1 - src/cargotype.h | 1 - src/command_type.h | 1 - src/company_base.h | 1 - src/console_gui.cpp | 1 - src/core/kdtree.hpp | 2 -- src/core/math_func.hpp | 2 -- src/core/overflowsafe_type.hpp | 1 - src/core/smallvec_type.hpp | 1 - src/dedicated.cpp | 1 - src/driver.cpp | 1 - src/fileio_func.h | 2 -- src/fios.cpp | 2 -- src/framerate_gui.cpp | 1 - src/game/game_text.cpp | 1 - src/gamelog.h | 1 - src/gfx_layout.h | 3 --- src/group.h | 1 - src/industrytype.h | 1 - src/ini_type.h | 2 -- src/linkgraph/linkgraph_gui.h | 1 - src/linkgraph/mcf.h | 1 - src/linkgraph/refresh.h | 1 - src/misc/dbg_helpers.h | 1 - src/misc/endian_buffer.hpp | 1 - src/misc/lrucache.hpp | 2 -- src/music/midifile.hpp | 2 -- src/music_gui.cpp | 1 - src/network/core/address.h | 1 - src/network/core/config.cpp | 1 - src/network/core/http_curl.cpp | 1 - src/network/core/packet.h | 2 -- src/network/core/tcp_content_type.h | 2 -- src/newgrf_class.h | 1 - src/newgrf_config.h | 1 - src/newgrf_profiling.h | 3 --- src/newgrf_text.h | 2 -- src/newgrf_townname.h | 1 - src/os/macosx/font_osx.cpp | 1 - src/os/macosx/string_osx.cpp | 1 - src/os/macosx/string_osx.h | 1 - src/os/windows/string_uniscribe.cpp | 1 - src/os/windows/string_uniscribe.h | 1 - src/pathfinder/yapf/yapf_costrail.hpp | 1 - src/random_access_file_type.h | 1 - src/road.h | 1 - src/saveload/engine_sl.cpp | 1 - src/saveload/oldloader.cpp | 1 - src/saveload/saveload.cpp | 2 -- src/saveload/saveload.h | 3 --- src/script/api/script_admin.hpp | 1 - src/script/api/script_priorityqueue.hpp | 1 - src/script/script_storage.hpp | 1 - src/script/squirrel_helper_type.hpp | 1 - src/settings_gui.cpp | 2 -- src/signs_base.h | 1 - src/station_gui.cpp | 1 - src/station_gui.h | 1 - src/stdafx.h | 21 +++++++++++++++++---- src/strgen/strgen.cpp | 1 - src/string_type.h | 2 -- src/tar_type.h | 1 - src/textfile_gui.h | 1 - src/timer/timer.h | 1 - src/timetable_gui.cpp | 1 - src/townname_type.h | 1 - src/vehicle_gui_base.h | 1 - src/video/video_driver.hpp | 2 -- src/window_gui.h | 2 -- 70 files changed, 17 insertions(+), 94 deletions(-) diff --git a/src/base_consist.h b/src/base_consist.h index b048ff2887..0249182dfb 100644 --- a/src/base_consist.h +++ b/src/base_consist.h @@ -12,7 +12,6 @@ #include "order_type.h" #include "timer/timer_game_calendar.h" -#include /** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */ struct BaseConsist { diff --git a/src/bitmap_type.h b/src/bitmap_type.h index 3aff869724..3ff0297910 100644 --- a/src/bitmap_type.h +++ b/src/bitmap_type.h @@ -10,7 +10,6 @@ #ifndef BITMAP_TYPE_HPP #define BITMAP_TYPE_HPP -#include /** Represents a tile area containing containing individually set tiles. * Each tile must be contained within the preallocated area. diff --git a/src/cargotype.h b/src/cargotype.h index 6e73f36958..76d5aa5cf2 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -17,7 +17,6 @@ #include "landscape_type.h" #include "core/bitmath_func.hpp" #include "core/span_type.hpp" -#include /** Globally unique label of a cargo type. */ typedef uint32 CargoLabel; diff --git a/src/command_type.h b/src/command_type.h index b33b815e6a..174120fb91 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -13,7 +13,6 @@ #include "economy_type.h" #include "strings_type.h" #include "tile_type.h" -#include struct GRFFile; diff --git a/src/company_base.h b/src/company_base.h index 9f0daa138c..d41da57f45 100644 --- a/src/company_base.h +++ b/src/company_base.h @@ -17,7 +17,6 @@ #include "timer/timer_game_calendar.h" #include "settings_type.h" #include "group.h" -#include #include /** Statistics about the economy. */ diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 270d005d0e..b5f5fa5d02 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -23,7 +23,6 @@ #include "timer/timer.h" #include "timer/timer_window.h" #include -#include #include "widgets/console_widget.h" diff --git a/src/core/kdtree.hpp b/src/core/kdtree.hpp index cb864e04d7..7da2aad2b9 100644 --- a/src/core/kdtree.hpp +++ b/src/core/kdtree.hpp @@ -11,8 +11,6 @@ #define KDTREE_HPP #include "../stdafx.h" -#include -#include /** * K-dimensional tree, specialised for 2-dimensional space. diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 9f8c5f0179..254496a733 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -10,8 +10,6 @@ #ifndef MATH_FUNC_HPP #define MATH_FUNC_HPP -#include -#include /** * Returns the absolute value of (scalar) variable. diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp index 37eab29023..53057008b2 100644 --- a/src/core/overflowsafe_type.hpp +++ b/src/core/overflowsafe_type.hpp @@ -12,7 +12,6 @@ #include "math_func.hpp" -#include #ifdef __has_builtin # if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 087f217971..086e2b531f 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -11,7 +11,6 @@ #define SMALLVEC_TYPE_HPP #include "mem_func.hpp" -#include /** * Helper function to append an item to a vector if it is not already contained diff --git a/src/dedicated.cpp b/src/dedicated.cpp index 92cead038c..df457f2559 100644 --- a/src/dedicated.cpp +++ b/src/dedicated.cpp @@ -10,7 +10,6 @@ #include "stdafx.h" #include "fileio_func.h" #include "debug.h" -#include std::string _log_file; ///< File to reroute output of a forked OpenTTD to std::unique_ptr _log_fd; ///< File to reroute output of a forked OpenTTD to diff --git a/src/driver.cpp b/src/driver.cpp index b6bf486427..1e4f5e0bd9 100644 --- a/src/driver.cpp +++ b/src/driver.cpp @@ -16,7 +16,6 @@ #include "video/video_driver.hpp" #include "string_func.h" #include "table/strings.h" -#include #include #include "safeguards.h" diff --git a/src/fileio_func.h b/src/fileio_func.h index c6d2a8ef0e..93b6123dca 100644 --- a/src/fileio_func.h +++ b/src/fileio_func.h @@ -12,8 +12,6 @@ #include "core/enum_type.hpp" #include "fileio_type.h" -#include -#include void FioFCloseFile(FILE *f); FILE *FioFOpenFile(const std::string &filename, const char *mode, Subdirectory subdir, size_t *filesize = nullptr); diff --git a/src/fios.cpp b/src/fios.cpp index 6bc09d3619..265a333c61 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -20,8 +20,6 @@ #include "strings_func.h" #include "tar_type.h" #include -#include -#include #include #ifndef _WIN32 diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 4727a587a5..eaa8fbf772 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -29,7 +29,6 @@ #include #include -#include #include "safeguards.h" diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index de3847e292..dc78e6a927 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -22,7 +22,6 @@ #include "table/strgen_tables.h" #include -#include #include "../safeguards.h" diff --git a/src/gamelog.h b/src/gamelog.h index 98ed13d693..8505c0a170 100644 --- a/src/gamelog.h +++ b/src/gamelog.h @@ -10,7 +10,6 @@ #ifndef GAMELOG_H #define GAMELOG_H -#include #include "newgrf_config.h" /** The actions we log. */ diff --git a/src/gfx_layout.h b/src/gfx_layout.h index 47eb60544e..504bd51a9b 100644 --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -15,11 +15,8 @@ #include "core/smallmap_type.hpp" #include -#include #include #include -#include -#include /** * Text drawing parameters, which can change while drawing a line, but are kept between multiple parts diff --git a/src/group.h b/src/group.h index 7cba5ac538..d901a48676 100644 --- a/src/group.h +++ b/src/group.h @@ -16,7 +16,6 @@ #include "vehicle_type.h" #include "engine_type.h" #include "livery.h" -#include typedef Pool GroupPool; extern GroupPool _group_pool; ///< Pool of groups. diff --git a/src/industrytype.h b/src/industrytype.h index d5f1ba96a7..79635baaed 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -11,7 +11,6 @@ #define INDUSTRYTYPE_H #include -#include #include "map_type.h" #include "slope_type.h" #include "industry_type.h" diff --git a/src/ini_type.h b/src/ini_type.h index 607e8940b4..0d50b58347 100644 --- a/src/ini_type.h +++ b/src/ini_type.h @@ -11,8 +11,6 @@ #define INI_TYPE_H #include "fileio_type.h" -#include -#include /** Types of groups */ enum IniGroupType { diff --git a/src/linkgraph/linkgraph_gui.h b/src/linkgraph/linkgraph_gui.h index 31cbafbb08..226cd6b265 100644 --- a/src/linkgraph/linkgraph_gui.h +++ b/src/linkgraph/linkgraph_gui.h @@ -16,7 +16,6 @@ #include "../window_gui.h" #include "linkgraph_base.h" #include -#include /** * Monthly statistics for a link between two stations. diff --git a/src/linkgraph/mcf.h b/src/linkgraph/mcf.h index e1e83e3898..a2e85243d5 100644 --- a/src/linkgraph/mcf.h +++ b/src/linkgraph/mcf.h @@ -4,7 +4,6 @@ #define MCF_H #include "linkgraphjob_base.h" -#include typedef std::vector PathVector; diff --git a/src/linkgraph/refresh.h b/src/linkgraph/refresh.h index 0202fd7239..097a3577c6 100644 --- a/src/linkgraph/refresh.h +++ b/src/linkgraph/refresh.h @@ -12,7 +12,6 @@ #include "../cargo_type.h" #include "../vehicle_base.h" -#include #include #include diff --git a/src/misc/dbg_helpers.h b/src/misc/dbg_helpers.h index b807ef25f1..a024b9dd2e 100644 --- a/src/misc/dbg_helpers.h +++ b/src/misc/dbg_helpers.h @@ -12,7 +12,6 @@ #include #include -#include #include "../direction_type.h" #include "../signal_type.h" diff --git a/src/misc/endian_buffer.hpp b/src/misc/endian_buffer.hpp index 87d527d9d8..0579a9b7f4 100644 --- a/src/misc/endian_buffer.hpp +++ b/src/misc/endian_buffer.hpp @@ -10,7 +10,6 @@ #ifndef ENDIAN_BUFFER_HPP #define ENDIAN_BUFFER_HPP -#include #include #include "../core/span_type.hpp" #include "../core/bitmath_func.hpp" diff --git a/src/misc/lrucache.hpp b/src/misc/lrucache.hpp index b0e950b2fc..2c474c2a84 100644 --- a/src/misc/lrucache.hpp +++ b/src/misc/lrucache.hpp @@ -12,9 +12,7 @@ #include #include -#include #include -#include /** * Size limited cache with a least recently used eviction strategy. diff --git a/src/music/midifile.hpp b/src/music/midifile.hpp index d786bf0078..254fda9af0 100644 --- a/src/music/midifile.hpp +++ b/src/music/midifile.hpp @@ -13,8 +13,6 @@ #include "../stdafx.h" #include "../core/smallvec_type.hpp" #include "midi.h" -#include -#include struct MusicSongInfo; diff --git a/src/music_gui.cpp b/src/music_gui.cpp index c10979041e..8e4fb39465 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -8,7 +8,6 @@ /** @file music_gui.cpp GUI for the music playback. */ #include "stdafx.h" -#include #include "openttd.h" #include "base_media_base.h" #include "music/music_driver.hpp" diff --git a/src/network/core/address.h b/src/network/core/address.h index f9c2eaef66..7cf159fb5e 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -16,7 +16,6 @@ #include "../../string_func.h" #include "../../core/smallmap_type.hpp" -#include class NetworkAddress; typedef std::vector NetworkAddressList; ///< Type for a list of addresses. diff --git a/src/network/core/config.cpp b/src/network/core/config.cpp index c2f4467d8e..21de508ccf 100644 --- a/src/network/core/config.cpp +++ b/src/network/core/config.cpp @@ -11,7 +11,6 @@ #include "../../stdafx.h" -#include #include "../../string_func.h" #include "../../safeguards.h" diff --git a/src/network/core/http_curl.cpp b/src/network/core/http_curl.cpp index 3781eb2d4f..4b8337b411 100644 --- a/src/network/core/http_curl.cpp +++ b/src/network/core/http_curl.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/src/network/core/packet.h b/src/network/core/packet.h index 04a232e1ca..8056ca00fa 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -16,8 +16,6 @@ #include "config.h" #include "core.h" #include "../../string_type.h" -#include -#include typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint8 PacketType; ///< Identifier for the packet diff --git a/src/network/core/tcp_content_type.h b/src/network/core/tcp_content_type.h index 7ac64c6e35..b74271ea92 100644 --- a/src/network/core/tcp_content_type.h +++ b/src/network/core/tcp_content_type.h @@ -12,8 +12,6 @@ #ifndef NETWORK_CORE_TCP_CONTENT_TYPE_H #define NETWORK_CORE_TCP_CONTENT_TYPE_H -#include - /** The values in the enum are important; they are used as database 'keys' */ enum ContentType { CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types diff --git a/src/newgrf_class.h b/src/newgrf_class.h index 8946f84350..fe94b173c5 100644 --- a/src/newgrf_class.h +++ b/src/newgrf_class.h @@ -12,7 +12,6 @@ #include "strings_type.h" -#include /** * Struct containing information relating to NewGRF classes for stations and airports. diff --git a/src/newgrf_config.h b/src/newgrf_config.h index cc7b899ea1..db4b492a1d 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -17,7 +17,6 @@ #include "fileio_type.h" #include "textfile_type.h" #include "newgrf_text.h" -#include /** GRF config bit flags */ enum GCF_Flags { diff --git a/src/newgrf_profiling.h b/src/newgrf_profiling.h index f20cf62e7a..34f1d0959e 100644 --- a/src/newgrf_profiling.h +++ b/src/newgrf_profiling.h @@ -17,9 +17,6 @@ #include "newgrf_callbacks.h" #include "newgrf_spritegroup.h" -#include -#include -#include /** * Callback profiler for NewGRF development diff --git a/src/newgrf_text.h b/src/newgrf_text.h index dc33710a43..82b27a57eb 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -15,8 +15,6 @@ #include "core/smallvec_type.hpp" #include "table/control_codes.h" #include -#include -#include /** This character, the thorn ('þ'), indicates a unicode string to NFO. */ static const WChar NFO_UTF8_IDENTIFIER = 0x00DE; diff --git a/src/newgrf_townname.h b/src/newgrf_townname.h index c2fc94a53b..df72656d84 100644 --- a/src/newgrf_townname.h +++ b/src/newgrf_townname.h @@ -13,7 +13,6 @@ #ifndef NEWGRF_TOWNNAME_H #define NEWGRF_TOWNNAME_H -#include #include "strings_type.h" struct NamePart { diff --git a/src/os/macosx/font_osx.cpp b/src/os/macosx/font_osx.cpp index 7a46d8f3b1..521e766024 100644 --- a/src/os/macosx/font_osx.cpp +++ b/src/os/macosx/font_osx.cpp @@ -18,7 +18,6 @@ #include "../../strings_func.h" #include "../../zoom_func.h" #include "macos.h" -#include #include "../../table/control_codes.h" diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 206baf7580..f089c630c5 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -15,7 +15,6 @@ #include "../../fontcache.h" #include "../../zoom_func.h" #include "macos.h" -#include #include diff --git a/src/os/macosx/string_osx.h b/src/os/macosx/string_osx.h index 3e29b16f5c..bd6abd6d10 100644 --- a/src/os/macosx/string_osx.h +++ b/src/os/macosx/string_osx.h @@ -12,7 +12,6 @@ #include "../../gfx_layout.h" #include "../../string_base.h" -#include /** String iterator using CoreText as a backend. */ class OSXStringIterator : public StringIterator { diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index 672c2dcd3d..47975af7ad 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -16,7 +16,6 @@ #include "../../table/control_codes.h" #include "../../zoom_func.h" #include "win32.h" -#include #include #include diff --git a/src/os/windows/string_uniscribe.h b/src/os/windows/string_uniscribe.h index 7ec7ca6708..e5fc0a6c59 100644 --- a/src/os/windows/string_uniscribe.h +++ b/src/os/windows/string_uniscribe.h @@ -12,7 +12,6 @@ #include "../../gfx_layout.h" #include "../../string_base.h" -#include void UniscribeResetScriptCache(FontSize size); diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp index 908814c8cd..042ccf9275 100644 --- a/src/pathfinder/yapf/yapf_costrail.hpp +++ b/src/pathfinder/yapf/yapf_costrail.hpp @@ -10,7 +10,6 @@ #ifndef YAPF_COSTRAIL_HPP #define YAPF_COSTRAIL_HPP -#include #include "../../pbs.h" diff --git a/src/random_access_file_type.h b/src/random_access_file_type.h index ce0e9e3584..8e66cf0f69 100644 --- a/src/random_access_file_type.h +++ b/src/random_access_file_type.h @@ -11,7 +11,6 @@ #define RANDOM_ACCESS_FILE_TYPE_H #include "fileio_type.h" -#include /** * A file from which bytes, words and double words are read in (potentially) a random order. diff --git a/src/road.h b/src/road.h index 936566c879..a9ff16f656 100644 --- a/src/road.h +++ b/src/road.h @@ -19,7 +19,6 @@ #include "newgrf.h" #include "economy_func.h" -#include enum RoadTramType : bool { RTT_ROAD, diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 52afe8b015..f5efe9f753 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -15,7 +15,6 @@ #include "saveload_internal.h" #include "../engine_base.h" #include "../string_func.h" -#include #include "../safeguards.h" diff --git a/src/saveload/oldloader.cpp b/src/saveload/oldloader.cpp index a6f2d55cee..6f11d17c28 100644 --- a/src/saveload/oldloader.cpp +++ b/src/saveload/oldloader.cpp @@ -19,7 +19,6 @@ #include "saveload_internal.h" #include "oldloader.h" -#include #include "../safeguards.h" diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 2db6efa1ae..7221b7d779 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -44,8 +44,6 @@ #include "../error.h" #include #include -#include -#include #ifdef __EMSCRIPTEN__ # include #endif diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index a00171abd7..1f07c1bb99 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -14,9 +14,6 @@ #include "../fileio_type.h" #include "../fios.h" #include "../core/span_type.hpp" -#include -#include -#include /** SaveLoad versions * Previous savegame versions, the trunk revision where they were diff --git a/src/script/api/script_admin.hpp b/src/script/api/script_admin.hpp index 95b7218eb0..b96b58abf2 100644 --- a/src/script/api/script_admin.hpp +++ b/src/script/api/script_admin.hpp @@ -10,7 +10,6 @@ #ifndef SCRIPT_ADMIN_HPP #define SCRIPT_ADMIN_HPP -#include #include "script_object.hpp" /** diff --git a/src/script/api/script_priorityqueue.hpp b/src/script/api/script_priorityqueue.hpp index ac4bbfa6f0..43c173b350 100644 --- a/src/script/api/script_priorityqueue.hpp +++ b/src/script/api/script_priorityqueue.hpp @@ -13,7 +13,6 @@ #include "script_object.hpp" #include -#include /** * Class that creates a queue which keeps its items ordered by an item priority. diff --git a/src/script/script_storage.hpp b/src/script/script_storage.hpp index b7a16dcb15..626c62f025 100644 --- a/src/script/script_storage.hpp +++ b/src/script/script_storage.hpp @@ -20,7 +20,6 @@ #include "script_log_types.hpp" #include "table/strings.h" -#include /** * The callback function for Mode-classes. diff --git a/src/script/squirrel_helper_type.hpp b/src/script/squirrel_helper_type.hpp index 05f3824fd9..3cb2c2a142 100644 --- a/src/script/squirrel_helper_type.hpp +++ b/src/script/squirrel_helper_type.hpp @@ -10,7 +10,6 @@ #ifndef SQUIRREL_HELPER_TYPE_HPP #define SQUIRREL_HELPER_TYPE_HPP -#include /** Definition of a simple array. */ template diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 70494b3849..af0c90e17b 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -42,8 +42,6 @@ #include "gui.h" #include "mixer.h" -#include -#include #include "safeguards.h" #include "video/video_driver.hpp" diff --git a/src/signs_base.h b/src/signs_base.h index 795f3b8e58..2791afa8a0 100644 --- a/src/signs_base.h +++ b/src/signs_base.h @@ -14,7 +14,6 @@ #include "viewport_type.h" #include "core/pool_type.hpp" #include "company_type.h" -#include typedef Pool SignPool; extern SignPool _sign_pool; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index e206aec033..13c4fb469b 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -38,7 +38,6 @@ #include "table/strings.h" #include -#include #include "safeguards.h" diff --git a/src/station_gui.h b/src/station_gui.h index 9bed30b672..503f2f88ab 100644 --- a/src/station_gui.h +++ b/src/station_gui.h @@ -14,7 +14,6 @@ #include "tilearea_type.h" #include "window_type.h" #include "station_type.h" -#include /** Types of cargo to display for station coverage. */ diff --git a/src/stdafx.h b/src/stdafx.h index cfbf724bf6..bb803d74cf 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -53,15 +53,28 @@ #endif #include -#include -#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include #include -#include -#include +#include +#include +#include +#include +#include #include +#include +#include #include +#include +#include #if defined(UNIX) || defined(__MINGW32__) # include diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index a52b6c20ed..bd32b4f352 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -17,7 +17,6 @@ #include "strgen.h" -#include #if !defined(_WIN32) || defined(__CYGWIN__) #include diff --git a/src/string_type.h b/src/string_type.h index b8705e403f..4483b7474c 100644 --- a/src/string_type.h +++ b/src/string_type.h @@ -11,8 +11,6 @@ #define STRING_TYPE_H #include "core/enum_type.hpp" -#include -#include /** A non-breaking space. */ #define NBSP u8"\u00a0" diff --git a/src/tar_type.h b/src/tar_type.h index 4266f23623..56f6224fcc 100644 --- a/src/tar_type.h +++ b/src/tar_type.h @@ -11,7 +11,6 @@ #define TAR_TYPE_H #include -#include #include #include "fileio_type.h" diff --git a/src/textfile_gui.h b/src/textfile_gui.h index d7d0a8391d..5e0a7180f7 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -14,7 +14,6 @@ #include "strings_func.h" #include "textfile_type.h" #include "window_gui.h" -#include std::optional GetTextfile(TextfileType type, Subdirectory dir, const std::string &filename); diff --git a/src/timer/timer.h b/src/timer/timer.h index 3c45df55a9..d49d60aaff 100644 --- a/src/timer/timer.h +++ b/src/timer/timer.h @@ -12,7 +12,6 @@ #include "timer_manager.h" -#include /** * The base where every other type of timer is derived from. diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 40106e8a65..0d2207aefd 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -24,7 +24,6 @@ #include "settings_type.h" #include "timetable_cmd.h" #include "timetable.h" -#include #include "widgets/timetable_widget.h" diff --git a/src/townname_type.h b/src/townname_type.h index 2dc23567f0..45290bc046 100644 --- a/src/townname_type.h +++ b/src/townname_type.h @@ -17,7 +17,6 @@ #include "town_type.h" #include "string_type.h" #include -#include typedef std::set TownNames; diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index dec9c9b1d6..8e6c272448 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -20,7 +20,6 @@ #include "window_gui.h" #include "widgets/dropdown_type.h" -#include #include typedef GUIList GUIVehicleList; diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index b81ec6e2fb..27e1dcc976 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -21,8 +21,6 @@ #include #include #include -#include -#include extern std::string _ini_videodriver; extern std::vector _resolutions; diff --git a/src/window_gui.h b/src/window_gui.h index cf9f542cff..253292455d 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -11,8 +11,6 @@ #define WINDOW_GUI_H #include -#include -#include #include "vehiclelist.h" #include "vehicle_type.h" From c4e6d80ecf06913d307aa638f705431a137eb335 Mon Sep 17 00:00:00 2001 From: J0anJosep Date: Sun, 7 May 2023 10:23:33 +0200 Subject: [PATCH 26/38] Cleanup: Remove unnecessary hangar check. --- src/aircraft_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 9f144be413..8dd421bb0d 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1587,7 +1587,7 @@ static void AircraftEventHandler_AtTerminal(Aircraft *v, const AirportFTAClass * return; default: // orders have been deleted (no orders), goto depot and don't bother us v->current_order.Free(); - go_to_hangar = Station::Get(v->targetairport)->airport.HasHangar(); + go_to_hangar = true; } if (go_to_hangar && Station::Get(v->targetairport)->airport.HasHangar()) { From bc6a4b1d08aa403f797c4996c886bbc056dc84f7 Mon Sep 17 00:00:00 2001 From: PeterN Date: Mon, 8 May 2023 16:42:01 +0100 Subject: [PATCH 27/38] Fix: Set up default station/waypoint classes properly. (#10789) --- src/newgrf_roadstop.cpp | 11 ++++------- src/newgrf_station.cpp | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index bafd66a529..a03ff256ee 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -31,13 +31,10 @@ template void NewGRFClass::InsertDefaults() { /* Set up initial data */ - classes[0].global_id = 'DFLT'; - classes[0].name = STR_STATION_CLASS_DFLT; - classes[0].Insert(nullptr); - - classes[1].global_id = 'WAYP'; - classes[1].name = STR_STATION_CLASS_WAYP; - classes[1].Insert(nullptr); + RoadStopClass::Get(RoadStopClass::Allocate('DFLT'))->name = STR_STATION_CLASS_DFLT; + RoadStopClass::Get(RoadStopClass::Allocate('DFLT'))->Insert(nullptr); + RoadStopClass::Get(RoadStopClass::Allocate('WAYP'))->name = STR_STATION_CLASS_WAYP; + RoadStopClass::Get(RoadStopClass::Allocate('WAYP'))->Insert(nullptr); } template diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 9dc117d5b8..9d43bd857c 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -32,13 +32,10 @@ template /* static */ void NewGRFClass::InsertDefaults() { /* Set up initial data */ - classes[0].global_id = 'DFLT'; - classes[0].name = STR_STATION_CLASS_DFLT; - classes[0].Insert(nullptr); - - classes[1].global_id = 'WAYP'; - classes[1].name = STR_STATION_CLASS_WAYP; - classes[1].Insert(nullptr); + StationClass::Get(StationClass::Allocate('DFLT'))->name = STR_STATION_CLASS_DFLT; + StationClass::Get(StationClass::Allocate('DFLT'))->Insert(nullptr); + StationClass::Get(StationClass::Allocate('WAYP'))->name = STR_STATION_CLASS_WAYP; + StationClass::Get(StationClass::Allocate('WAYP'))->Insert(nullptr); } template From aed36a609c6163df378e7e266d470c8986b854ec Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Mon, 8 May 2023 18:09:47 +0200 Subject: [PATCH 28/38] Fix: [ICU] crash when trying to break a non-breaking run (#10791) Clusters from harfbuzz are indexed from the start of the buffer, not from the start of the run analyzed. This confuses other parts of the code that do assume they are from the start of the run. --- src/gfx_layout_icu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfx_layout_icu.cpp b/src/gfx_layout_icu.cpp index c7bdf1016f..12bf5d28b2 100644 --- a/src/gfx_layout_icu.cpp +++ b/src/gfx_layout_icu.cpp @@ -208,7 +208,7 @@ void ICURun::Shape(UChar *buff, size_t buff_length) { x_advance = glyph_pos[i].x_advance / FONT_SCALE; } - this->glyph_to_char.push_back(glyph_info[i].cluster); + this->glyph_to_char.push_back(glyph_info[i].cluster - this->start); this->advance.push_back(x_advance); advance += x_advance; } From 61d1b330d1457453c817e3893fc96587c90eb45c Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Mon, 8 May 2023 13:21:29 -0400 Subject: [PATCH 29/38] Change: Add padding to build vehicle text filter (#10792) --- src/build_vehicle_gui.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 0e9a7d727a..685a49472f 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -62,17 +62,17 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = { NWidget(WWT_DEFSIZEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), - NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_VERTICAL), - NWidget(NWID_HORIZONTAL), - NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BV_SORT_ASCENDING_DESCENDING), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER), - NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_BV_SORT_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_SORT_CRITERIA), - EndContainer(), - NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BV_SHOW_HIDDEN_ENGINES), - NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_BV_CARGO_FILTER_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_FILTER_CRITERIA), - EndContainer(), - NWidget(WWT_EDITBOX, COLOUR_GREY, WID_BV_FILTER), SetMinimalSize(128, 0), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), + NWidget(NWID_VERTICAL), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BV_SORT_ASCENDING_DESCENDING), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER), + NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_BV_SORT_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_SORT_CRITERIA), + EndContainer(), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BV_SHOW_HIDDEN_ENGINES), + NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_BV_CARGO_FILTER_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_FILTER_CRITERIA), + EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY), + NWidget(WWT_EDITBOX, COLOUR_GREY, WID_BV_FILTER), SetResize(1, 0), SetFill(1, 0), SetPadding(2), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), EndContainer(), EndContainer(), /* Vehicle list. */ From 60399e17bd1571943f67e52ff694021cf1270c8e Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 6 May 2023 19:53:02 +0200 Subject: [PATCH 30/38] Codechange: C++-ify the Layouter and related functions They all now access a std::string_view, instead of a "const char *" or std::string (in some cases). Additionally, GetCharAtPosition and friends now return an index instead of a "const char *", as it makes for a more clear interface. --- src/console_gui.cpp | 4 +- src/gfx.cpp | 85 ++++++---------------------------- src/gfx_func.h | 31 ++++--------- src/gfx_layout.cpp | 88 +++++++++++++++++------------------- src/gfx_layout.h | 10 ++-- src/misc_gui.cpp | 6 +-- src/querystring_gui.h | 2 +- src/video/cocoa/cocoa_wnd.mm | 7 +-- src/window.cpp | 6 +-- src/window_gui.h | 2 +- 10 files changed, 84 insertions(+), 157 deletions(-) diff --git a/src/console_gui.cpp b/src/console_gui.cpp index b5f5fa5d02..c9d91b8fe4 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -318,11 +318,11 @@ struct IConsoleWindow : Window return r; } - const char *GetTextCharacterAtPosition(const Point &pt) const override + ptrdiff_t GetTextCharacterAtPosition(const Point &pt) const override { int delta = std::min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); - if (!IsInsideMM(pt.y, this->height - this->line_height, this->height)) return nullptr; + if (!IsInsideMM(pt.y, this->height - this->line_height, this->height)) return -1; return GetCharAtPosition(_iconsole_cmdline.buf, pt.x - delta); } diff --git a/src/gfx.cpp b/src/gfx.cpp index 8799bdbc95..53ca6ab349 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -642,7 +642,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left, * @return In case of left or center alignment the right most pixel we have drawn to. * In case of right alignment the left most pixel we have drawn to. */ -int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize) +int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize) { /* The string may contain control chars to change the font, just use the biggest font for clipping. */ int max_height = std::max({FONT_HEIGHT_SMALL, FONT_HEIGHT_NORMAL, FONT_HEIGHT_LARGE, FONT_HEIGHT_MONO}); @@ -661,28 +661,6 @@ int DrawString(int left, int right, int top, const char *str, TextColour colour, return DrawLayoutLine(*layout.front(), top, left, right, align, underline, true); } -/** - * Draw string, possibly truncated to make it fit in its allocated space - * - * @param left The left most position to draw on. - * @param right The right most position to draw on. - * @param top The top most position to draw on. - * @param str String to draw. - * @param colour Colour used for drawing the string, for details see _string_colourmap in - * table/palettes.h or docs/ottd-colourtext-palette.png or the enum TextColour in gfx_type.h - * @param align The alignment of the string when drawing left-to-right. In the - * case a right-to-left language is chosen this is inverted so it - * will be drawn in the right direction. - * @param underline Whether to underline what has been drawn or not. - * @param fontsize The size of the initial characters. - * @return In case of left or center alignment the right most pixel we have drawn to. - * In case of right alignment the left most pixel we have drawn to. - */ -int DrawString(int left, int right, int top, const std::string &str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize) -{ - return DrawString(left, right, top, str.c_str(), colour, align, underline, fontsize); -} - /** * Draw string, possibly truncated to make it fit in its allocated space * @@ -713,7 +691,7 @@ int DrawString(int left, int right, int top, StringID str, TextColour colour, St * @param maxw maximum string width * @return height of pixels of string when it is drawn */ -int GetStringHeight(const char *str, int maxw, FontSize fontsize) +int GetStringHeight(std::string_view str, int maxw, FontSize fontsize) { Layouter layout(str, maxw, TC_FROMSTRING, fontsize); return layout.GetBounds().height; @@ -765,7 +743,7 @@ Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestio * @param suggestion Suggested bounding box. * @return Bounding box for the multi-line string, may be bigger than \a suggestion. */ -Dimension GetStringMultiLineBoundingBox(const char *str, const Dimension &suggestion) +Dimension GetStringMultiLineBoundingBox(std::string_view str, const Dimension &suggestion) { Dimension box = {suggestion.width, (uint)GetStringHeight(str, suggestion.width)}; return box; @@ -787,7 +765,7 @@ Dimension GetStringMultiLineBoundingBox(const char *str, const Dimension &sugges * * @return If \a align is #SA_BOTTOM, the top to where we have written, else the bottom to where we have written. */ -int DrawStringMultiLine(int left, int right, int top, int bottom, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize) +int DrawStringMultiLine(int left, int right, int top, int bottom, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize) { int maxw = right - left + 1; int maxh = bottom - top + 1; @@ -833,28 +811,6 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, const char *st return ((align & SA_VERT_MASK) == SA_BOTTOM) ? first_line : last_line; } - -/** - * Draw string, possibly over multiple lines. - * - * @param left The left most position to draw on. - * @param right The right most position to draw on. - * @param top The top most position to draw on. - * @param bottom The bottom most position to draw on. - * @param str String to draw. - * @param colour Colour used for drawing the string, for details see _string_colourmap in - * table/palettes.h or docs/ottd-colourtext-palette.png or the enum TextColour in gfx_type.h - * @param align The horizontal and vertical alignment of the string. - * @param underline Whether to underline all strings - * @param fontsize The size of the initial characters. - * - * @return If \a align is #SA_BOTTOM, the top to where we have written, else the bottom to where we have written. - */ -int DrawStringMultiLine(int left, int right, int top, int bottom, const std::string &str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize) -{ - return DrawStringMultiLine(left, right, top, bottom, str.c_str(), colour, align, underline, fontsize); -} - /** * Draw string, possibly over multiple lines. * @@ -888,30 +844,15 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, * @param start_fontsize Fontsize to start the text with * @return string width and height in pixels */ -Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize) +Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize) { Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize); return layout.GetBounds(); } -/** - * Return the string dimension in pixels. The height and width are returned - * in a single Dimension value. TINYFONT, BIGFONT modifiers are only - * supported as the first character of the string. The returned dimensions - * are therefore a rough estimation correct for all the current strings - * but not every possible combination - * @param str string to calculate pixel-width - * @param start_fontsize Fontsize to start the text with - * @return string width and height in pixels - */ -Dimension GetStringBoundingBox(const std::string &str, FontSize start_fontsize) -{ - return GetStringBoundingBox(str.c_str(), start_fontsize); -} - /** * Get bounding box of a string. Uses parameters set by #SetDParam if needed. - * Has the same restrictions as #GetStringBoundingBox(const char *str, FontSize start_fontsize). + * Has the same restrictions as #GetStringBoundingBox(std::string_view str, FontSize start_fontsize). * @param strid String to examine. * @return Width and height of the bounding box for the string in pixels. */ @@ -946,10 +887,14 @@ uint GetStringListWidth(const StringID *list, FontSize fontsize) * @param start_fontsize Font size to start the text with. * @return Upper left corner of the glyph associated with the character. */ -Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsize) +Point GetCharPosInString(std::string_view str, const char *ch, FontSize start_fontsize) { + /* Ensure "ch" is inside "str" or at the exact end. */ + assert(ch >= str.data() && (ch - str.data()) <= static_cast(str.size())); + auto it_ch = str.begin() + (ch - str.data()); + Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize); - return layout.GetCharPosition(ch); + return layout.GetCharPosition(it_ch); } /** @@ -957,11 +902,11 @@ Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsiz * @param str String to test. * @param x Position relative to the start of the string. * @param start_fontsize Font size to start the text with. - * @return Pointer to the character at the position or nullptr if there is no character at the position. + * @return Index of the character position or -1 if there is no character at the position. */ -const char *GetCharAtPosition(const char *str, int x, FontSize start_fontsize) +ptrdiff_t GetCharAtPosition(std::string_view str, int x, FontSize start_fontsize) { - if (x < 0) return nullptr; + if (x < 0) return -1; Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize); return layout.GetCharAtPosition(x); diff --git a/src/gfx_func.h b/src/gfx_func.h index 78891e1dc7..2d212c066c 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -95,11 +95,9 @@ void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub void DrawSpriteIgnorePadding(SpriteID img, PaletteID pal, const Rect &r, bool clicked, StringAlignment align); /* widget.cpp */ std::unique_ptr DrawSpriteToRgbaBuffer(SpriteID spriteId, ZoomLevel zoom = ZOOM_LVL_GUI); -int DrawString(int left, int right, int top, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); -int DrawString(int left, int right, int top, const std::string &str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); +int DrawString(int left, int right, int top, std::string_view str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); int DrawString(int left, int right, int top, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); -int DrawStringMultiLine(int left, int right, int top, int bottom, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL); -int DrawStringMultiLine(int left, int right, int top, int bottom, const std::string &str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL); +int DrawStringMultiLine(int left, int right, int top, int bottom, std::string_view str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL); int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL); void DrawCharCentered(WChar c, const Rect &r, TextColour colour); @@ -110,12 +108,7 @@ void GfxDrawLine(int left, int top, int right, int bottom, int colour, int width void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3); /* Versions of DrawString/DrawStringMultiLine that accept a Rect instead of separate left, right, top and bottom parameters. */ -static inline int DrawString(const Rect &r, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL) -{ - return DrawString(r.left, r.right, r.top, str, colour, align, underline, fontsize); -} - -static inline int DrawString(const Rect &r, const std::string &str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL) +static inline int DrawString(const Rect &r, std::string_view str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL) { return DrawString(r.left, r.right, r.top, str, colour, align, underline, fontsize); } @@ -125,12 +118,7 @@ static inline int DrawString(const Rect &r, StringID str, TextColour colour = TC return DrawString(r.left, r.right, r.top, str, colour, align, underline, fontsize); } -static inline int DrawStringMultiLine(const Rect &r, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL) -{ - return DrawStringMultiLine(r.left, r.right, r.top, r.bottom, str, colour, align, underline, fontsize); -} - -static inline int DrawStringMultiLine(const Rect &r, const std::string &str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL) +static inline int DrawStringMultiLine(const Rect &r, std::string_view str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL) { return DrawStringMultiLine(r.left, r.right, r.top, r.bottom, str, colour, align, underline, fontsize); } @@ -145,18 +133,17 @@ static inline void GfxFillRect(const Rect &r, int colour, FillRectMode mode = FI GfxFillRect(r.left, r.top, r.right, r.bottom, colour, mode); } -Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize = FS_NORMAL); -Dimension GetStringBoundingBox(const std::string &str, FontSize start_fontsize = FS_NORMAL); +Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize = FS_NORMAL); Dimension GetStringBoundingBox(StringID strid, FontSize start_fontsize = FS_NORMAL); uint GetStringListWidth(const StringID *list, FontSize fontsize = FS_NORMAL); -int GetStringHeight(const char *str, int maxw, FontSize fontsize = FS_NORMAL); +int GetStringHeight(std::string_view str, int maxw, FontSize fontsize = FS_NORMAL); int GetStringHeight(StringID str, int maxw); int GetStringLineCount(StringID str, int maxw); Dimension GetStringMultiLineBoundingBox(StringID str, const Dimension &suggestion); -Dimension GetStringMultiLineBoundingBox(const char *str, const Dimension &suggestion); +Dimension GetStringMultiLineBoundingBox(std::string_view str, const Dimension &suggestion); void LoadStringWidthTable(bool monospace = false); -Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsize = FS_NORMAL); -const char *GetCharAtPosition(const char *str, int x, FontSize start_fontsize = FS_NORMAL); +Point GetCharPosInString(std::string_view str, const char *ch, FontSize start_fontsize = FS_NORMAL); +ptrdiff_t GetCharAtPosition(std::string_view str, int x, FontSize start_fontsize = FS_NORMAL); void DrawDirtyBlocks(); void AddDirtyBlock(int left, int top, int right, int bottom); diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 6ddb0c4b85..5e149dc38f 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -59,7 +59,7 @@ Font::Font(FontSize size, TextColour colour) : * @tparam T The type of layouter we want. */ template -static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str, FontState &state) +static inline void GetLayouter(Layouter::LineCacheItem &line, std::string_view str, FontState &state) { if (line.buffer != nullptr) free(line.buffer); @@ -72,15 +72,18 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str, line.buffer = buff_begin; fontMapping.clear(); + auto cur = str.begin(); + /* * Go through the whole string while adding Font instances to the font map * whenever the font changes, and convert the wide characters into a format * usable by ParagraphLayout. */ - for (; buff < buffer_last;) { - WChar c = Utf8Consume(const_cast(&str)); + for (; buff < buffer_last && cur != str.end();) { + WChar c = Utf8Consume(cur); if (c == '\0' || c == '\n') { - break; + /* Caller should already have filtered out these characters. */ + NOT_REACHED(); } else if (c >= SCC_BLUE && c <= SCC_BLACK) { state.SetColour((TextColour)(c - SCC_BLUE)); } else if (c == SCC_PUSH_COLOUR) { @@ -123,65 +126,51 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str, * @param colour The colour of the font. * @param fontsize The size of font to use. */ -Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsize) : string(str) +Layouter::Layouter(std::string_view str, int maxw, TextColour colour, FontSize fontsize) : string(str) { FontState state(colour, fontsize); - WChar c = 0; - do { - /* Scan string for end of line */ - const char *lineend = str; - for (;;) { - size_t len = Utf8Decode(&c, lineend); - if (c == '\0' || c == '\n') break; - lineend += len; - } + while (true) { + auto line_length = str.find_first_of('\n'); + auto str_line = str.substr(0, line_length); - LineCacheItem& line = GetCachedParagraphLayout(str, lineend - str, state); + LineCacheItem &line = GetCachedParagraphLayout(str_line, state); if (line.layout != nullptr) { - /* Line is in cache */ - str = lineend + 1; state = line.state_after; line.layout->Reflow(); } else { /* Line is new, layout it */ FontState old_state = state; -#if (defined(WITH_ICU_I18N) && defined(WITH_HARFBUZZ)) || defined(WITH_UNISCRIBE) || defined(WITH_COCOA) - const char *old_str = str; -#endif #if defined(WITH_ICU_I18N) && defined(WITH_HARFBUZZ) if (line.layout == nullptr) { - GetLayouter(line, str, state); + GetLayouter(line, str_line, state); if (line.layout == nullptr) { state = old_state; - str = old_str; } } #endif #ifdef WITH_UNISCRIBE if (line.layout == nullptr) { - GetLayouter(line, str, state); + GetLayouter(line, str_line, state); if (line.layout == nullptr) { state = old_state; - str = old_str; } } #endif #ifdef WITH_COCOA if (line.layout == nullptr) { - GetLayouter(line, str, state); + GetLayouter(line, str_line, state); if (line.layout == nullptr) { state = old_state; - str = old_str; } } #endif if (line.layout == nullptr) { - GetLayouter(line, str, state); + GetLayouter(line, str_line, state); } } @@ -191,7 +180,15 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi if (l == nullptr) break; this->push_back(std::move(l)); } - } while (c != '\0'); + + /* Break out if this was the last line. */ + if (line_length == std::string_view::npos) { + break; + } + + /* Go to the next line. */ + str.remove_prefix(line_length + 1); + } } /** @@ -210,21 +207,18 @@ Dimension Layouter::GetBounds() /** * Get the position of a character in the layout. - * @param ch Character to get the position of. + * @param ch Character to get the position of. Must be an iterator of the string passed to the constructor. * @return Upper left corner of the character relative to the start of the string. * @note Will only work right for single-line strings. */ -Point Layouter::GetCharPosition(const char *ch) const +Point Layouter::GetCharPosition(std::string_view::const_iterator ch) const { /* Find the code point index which corresponds to the char * pointer into our UTF-8 source string. */ size_t index = 0; - const char *str = this->string; - while (str < ch) { - WChar c; - size_t len = Utf8Decode(&c, str); - if (c == '\0' || c == '\n') break; - str += len; + auto str = this->string.begin(); + while (str < ch && str != this->string.end()) { + WChar c = Utf8Consume(str); index += this->front()->GetInternalCharLength(c); } @@ -233,7 +227,7 @@ Point Layouter::GetCharPosition(const char *ch) const const auto &line = this->front(); /* Pointer to the end-of-string/line marker? Return total line width. */ - if (*ch == '\0' || *ch == '\n') { + if (ch == this->string.end() || *ch == '\0' || *ch == '\n') { Point p = { line->GetWidth(), 0 }; return p; } @@ -259,9 +253,9 @@ Point Layouter::GetCharPosition(const char *ch) const /** * Get the character that is at a position. * @param x Position in the string. - * @return Pointer to the character at the position or nullptr if no character is at the position. + * @return Index of the position or -1 if no character is at the position. */ -const char *Layouter::GetCharAtPosition(int x) const +ptrdiff_t Layouter::GetCharAtPosition(int x) const { const auto &line = this->front(); @@ -280,17 +274,18 @@ const char *Layouter::GetCharAtPosition(int x) const size_t index = run.GetGlyphToCharMap()[i]; size_t cur_idx = 0; - for (const char *str = this->string; *str != '\0'; ) { - if (cur_idx == index) return str; + int char_index = 0; + for (auto str = this->string.begin(); str != this->string.end(); char_index++) { + if (cur_idx == index) return char_index; - WChar c = Utf8Consume(&str); + WChar c = Utf8Consume(str); cur_idx += line->GetInternalCharLength(c); } } } } - return nullptr; + return -1; } /** @@ -332,18 +327,17 @@ void Layouter::ResetFontCache(FontSize size) * Get reference to cache item. * If the item does not exist yet, it is default constructed. * @param str Source string of the line (including colour and font size codes). - * @param len Length of \a str in bytes (no termination). * @param state State of the font at the beginning of the line. * @return Reference to cache item. */ -Layouter::LineCacheItem &Layouter::GetCachedParagraphLayout(const char *str, size_t len, const FontState &state) +Layouter::LineCacheItem &Layouter::GetCachedParagraphLayout(std::string_view str, const FontState &state) { if (linecache == nullptr) { /* Create linecache on first access to avoid trouble with initialisation order of static variables. */ linecache = new LineCache(); } - if (auto match = linecache->find(LineCacheQuery{state, std::string_view{str, len}}); + if (auto match = linecache->find(LineCacheQuery{state, str}); match != linecache->end()) { return match->second; } @@ -351,7 +345,7 @@ Layouter::LineCacheItem &Layouter::GetCachedParagraphLayout(const char *str, siz /* Create missing entry */ LineCacheKey key; key.state_before = state; - key.str.assign(str, len); + key.str.assign(str); return (*linecache)[key]; } diff --git a/src/gfx_layout.h b/src/gfx_layout.h index 504bd51a9b..ec983ee89e 100644 --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -124,7 +124,7 @@ public: * It also accounts for the memory allocations and frees. */ class Layouter : public std::vector> { - const char *string; ///< Pointer to the original string. + std::string_view string; ///< Pointer to the original string. /** Key into the linecache */ struct LineCacheKey { @@ -168,17 +168,17 @@ private: typedef std::map LineCache; static LineCache *linecache; - static LineCacheItem &GetCachedParagraphLayout(const char *str, size_t len, const FontState &state); + static LineCacheItem &GetCachedParagraphLayout(std::string_view str, const FontState &state); typedef SmallMap FontColourMap; static FontColourMap fonts[FS_END]; public: static Font *GetFont(FontSize size, TextColour colour); - Layouter(const char *str, int maxw = INT32_MAX, TextColour colour = TC_FROMSTRING, FontSize fontsize = FS_NORMAL); + Layouter(std::string_view str, int maxw = INT32_MAX, TextColour colour = TC_FROMSTRING, FontSize fontsize = FS_NORMAL); Dimension GetBounds(); - Point GetCharPosition(const char *ch) const; - const char *GetCharAtPosition(int x) const; + Point GetCharPosition(std::string_view::const_iterator ch) const; + ptrdiff_t GetCharAtPosition(int x) const; static void ResetFontCache(FontSize size); static void ResetLineCache(); diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 351fd087e4..c25cea77a4 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -896,9 +896,9 @@ Rect QueryString::GetBoundingRect(const Window *w, int wid, const char *from, co * @param w Window the edit box is in. * @param wid Widget index. * @param pt Position to test. - * @return Pointer to the character at the position or nullptr if no character is at the position. + * @return Index of the character position or -1 if no character is at the position. */ -const char *QueryString::GetCharAtPosition(const Window *w, int wid, const Point &pt) const +ptrdiff_t QueryString::GetCharAtPosition(const Window *w, int wid, const Point &pt) const { const NWidgetLeaf *wi = w->GetWidget(wid); @@ -910,7 +910,7 @@ const char *QueryString::GetCharAtPosition(const Window *w, int wid, const Point Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WidgetDimensions::scaled.framerect); - if (!IsInsideMM(pt.y, r.top, r.bottom)) return nullptr; + if (!IsInsideMM(pt.y, r.top, r.bottom)) return -1; /* Clamp caret position to be inside our current width. */ const Textbuf *tb = &this->text; diff --git a/src/querystring_gui.h b/src/querystring_gui.h index 1556334c3d..79eadc7993 100644 --- a/src/querystring_gui.h +++ b/src/querystring_gui.h @@ -54,7 +54,7 @@ public: Point GetCaretPosition(const Window *w, int wid) const; Rect GetBoundingRect(const Window *w, int wid, const char *from, const char *to) const; - const char *GetCharAtPosition(const Window *w, int wid, const Point &pt) const; + ptrdiff_t GetCharAtPosition(const Window *w, int wid, const Point &pt) const; /** * Get the current text. diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm index d4fc5b292e..445d412303 100644 --- a/src/video/cocoa/cocoa_wnd.mm +++ b/src/video/cocoa/cocoa_wnd.mm @@ -1057,10 +1057,11 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel Point pt = { (int)view_pt.x, (int)[ self frame ].size.height - (int)view_pt.y }; - const char *ch = _focused_window->GetTextCharacterAtPosition(pt); - if (ch == nullptr) return NSNotFound; + auto index = _focused_window->GetTextCharacterAtPosition(pt); + if (index == -1) return NSNotFound; - return CountUtf16Units(_focused_window->GetFocusedText(), ch); + auto text = _focused_window->GetFocusedText(); + return CountUtf16Units(text, text + index); } /** Get the bounding rect for the given range. */ diff --git a/src/window.cpp b/src/window.cpp index c12aab6e37..ae4d35ef4f 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -440,15 +440,15 @@ void Window::UpdateQueryStringSize() /** * Get the character that is rendered at a position by the focused edit box. * @param pt The position to test. - * @return Pointer to the character at the position or nullptr if no character is at the position. + * @return Index of the character position or -1 if no character is at the position. */ -/* virtual */ const char *Window::GetTextCharacterAtPosition(const Point &pt) const +/* virtual */ ptrdiff_t Window::GetTextCharacterAtPosition(const Point &pt) const { if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) { return this->GetQueryString(this->nested_focus->index)->GetCharAtPosition(this, this->nested_focus->index, pt); } - return nullptr; + return -1; } /** diff --git a/src/window_gui.h b/src/window_gui.h index 253292455d..7784c2dc8a 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -281,7 +281,7 @@ public: virtual const char *GetMarkedText(size_t *length) const; virtual Point GetCaretPosition() const; virtual Rect GetTextBoundingRect(const char *from, const char *to) const; - virtual const char *GetTextCharacterAtPosition(const Point &pt) const; + virtual ptrdiff_t GetTextCharacterAtPosition(const Point &pt) const; void InitNested(WindowNumber number = 0); void CreateNestedTree(bool fill_nested = true); From a05ae2497f193e7179ff2cb56f0a92cb5436eeb9 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 6 May 2023 20:19:15 +0200 Subject: [PATCH 31/38] Codechange: simplify how GetCharPosition() works --- src/gfx_layout.cpp | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 5e149dc38f..2c4e0d3ed4 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -213,41 +213,44 @@ Dimension Layouter::GetBounds() */ Point Layouter::GetCharPosition(std::string_view::const_iterator ch) const { + const auto &line = this->front(); + + /* Pointer to the end-of-string marker? Return total line width. */ + if (ch == this->string.end()) { + Point p = { line->GetWidth(), 0 }; + return p; + } + /* Find the code point index which corresponds to the char * pointer into our UTF-8 source string. */ size_t index = 0; auto str = this->string.begin(); - while (str < ch && str != this->string.end()) { + while (str < ch) { WChar c = Utf8Consume(str); - index += this->front()->GetInternalCharLength(c); + index += line->GetInternalCharLength(c); } - if (str == ch) { - /* Valid character. */ - const auto &line = this->front(); + /* We couldn't find the code point index. */ + if (str != ch) { + return { 0, 0 }; + } - /* Pointer to the end-of-string/line marker? Return total line width. */ - if (ch == this->string.end() || *ch == '\0' || *ch == '\n') { - Point p = { line->GetWidth(), 0 }; - return p; - } + /* Valid character. */ - /* Scan all runs until we've found our code point index. */ - for (int run_index = 0; run_index < line->CountRuns(); run_index++) { - const ParagraphLayouter::VisualRun &run = line->GetVisualRun(run_index); + /* Scan all runs until we've found our code point index. */ + for (int run_index = 0; run_index < line->CountRuns(); run_index++) { + const ParagraphLayouter::VisualRun &run = line->GetVisualRun(run_index); - for (int i = 0; i < run.GetGlyphCount(); i++) { - /* Matching glyph? Return position. */ - if ((size_t)run.GetGlyphToCharMap()[i] == index) { - Point p = { (int)run.GetPositions()[i * 2], (int)run.GetPositions()[i * 2 + 1] }; - return p; - } + for (int i = 0; i < run.GetGlyphCount(); i++) { + /* Matching glyph? Return position. */ + if ((size_t)run.GetGlyphToCharMap()[i] == index) { + Point p = { (int)run.GetPositions()[i * 2], (int)run.GetPositions()[i * 2 + 1] }; + return p; } } } - Point p = { 0, 0 }; - return p; + NOT_REACHED(); } /** From 882f06bf14416960ee15538c9d91fcd4eaa2e22f Mon Sep 17 00:00:00 2001 From: PeterN Date: Mon, 8 May 2023 19:09:33 +0100 Subject: [PATCH 32/38] Fix: Support more than 256 stations/waypoints/roadstops per class. (#10793) It was already possible to define more than 256 per class, but not possible to use them as the index used in GUI and passed through commands was limited to a byte. --- src/rail_gui.cpp | 18 +++++++++--------- src/road_cmd.h | 2 +- src/road_gui.cpp | 12 ++++++------ src/station_cmd.cpp | 8 ++++---- src/station_cmd.h | 4 ++-- src/waypoint_cmd.cpp | 2 +- src/waypoint_cmd.h | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 54e7443825..45e672ca0b 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -53,8 +53,8 @@ static RailType _cur_railtype; ///< Rail type of the current build-rail toolbar. static bool _remove_button_clicked; ///< Flag whether 'remove' toggle-button is currently enabled static DiagDirection _build_depot_direction; ///< Currently selected depot direction -static byte _waypoint_count = 1; ///< Number of waypoint types -static byte _cur_waypoint_type; ///< Currently selected waypoint type +static uint16_t _waypoint_count = 1; ///< Number of waypoint types +static uint16_t _cur_waypoint_type; ///< Currently selected waypoint type static bool _convert_signal_button; ///< convert signal button in the signal GUI pressed static SignalVariant _cur_signal_variant; ///< set the signal variant (for signal GUI) static SignalType _cur_signal_type; ///< set the signal type (for signal GUI) @@ -64,8 +64,8 @@ struct RailStationGUISettings { bool newstations; ///< Are custom station definitions available? StationClassID station_class; ///< Currently selected custom station class (if newstations is \c true ) - byte station_type; ///< %Station type within the currently selected custom station class (if newstations is \c true ) - byte station_count; ///< Number of custom stations (if newstations is \c true ) + uint16_t station_type; ///< %Station type within the currently selected custom station class (if newstations is \c true ) + uint16_t station_count; ///< Number of custom stations (if newstations is \c true ) }; static RailStationGUISettings _railstation; ///< Settings of the station builder GUI @@ -711,7 +711,7 @@ struct BuildRailToolbarWindow : Window { TileArea ta(start_tile, end_tile); Axis axis = select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y; bool adjacent = _ctrl_pressed; - byte waypoint_type = _cur_waypoint_type; + uint16_t waypoint_type = _cur_waypoint_type; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { @@ -1290,7 +1290,7 @@ public: } case WID_BRAS_IMAGE: { - byte type = GB(widget, 16, 16); + uint16_t type = GB(widget, 16, 16); assert(type < _railstation.station_count); /* Check station availability callback */ const StationSpec *statspec = StationClass::Get(_railstation.station_class)->GetSpec(type); @@ -1478,7 +1478,7 @@ public: } case WID_BRAS_IMAGE: { - int y = GB(widget, 16, 16); + uint16_t y = GB(widget, 16, 16); if (y >= _railstation.station_count) return; /* Check station availability callback */ @@ -2041,7 +2041,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { { switch (GB(widget, 0, 16)) { case WID_BRW_WAYPOINT: { - byte type = GB(widget, 16, 16); + uint16_t type = GB(widget, 16, 16); const StationSpec *statspec = StationClass::Get(STAT_CLASS_WAYP)->GetSpec(type); DrawPixelInfo tmp_dpi; @@ -2063,7 +2063,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { { switch (GB(widget, 0, 16)) { case WID_BRW_WAYPOINT: { - byte type = GB(widget, 16, 16); + uint16_t type = GB(widget, 16, 16); this->GetWidget(WID_BRW_WAYPOINT_MATRIX)->SetClicked(_cur_waypoint_type); /* Check station availability callback */ diff --git a/src/road_cmd.h b/src/road_cmd.h index fbe05ef33d..ef3d8f364b 100644 --- a/src/road_cmd.h +++ b/src/road_cmd.h @@ -34,6 +34,6 @@ DEF_CMD_TRAIT(CMD_CONVERT_ROAD, CmdConvertRoad, 0, CommandCallback CcPlaySound_CONSTRUCTION_OTHER; CommandCallback CcBuildRoadTunnel; void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, RoadType rt, DiagDirection dir); -void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, uint8 width, uint8 length, RoadStopType, bool is_drive_through, DiagDirection dir, RoadType, RoadStopClassID spec_class, byte spec_index, StationID, bool); +void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, uint8 width, uint8 length, RoadStopType, bool is_drive_through, DiagDirection dir, RoadType, RoadStopClassID spec_class, uint16_t spec_index, StationID, bool); #endif /* ROAD_CMD_H */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 4731f2e606..a6147f7451 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -66,8 +66,8 @@ struct RoadStopGUISettings { DiagDirection orientation; RoadStopClassID roadstop_class; - byte roadstop_type; - byte roadstop_count; + uint16_t roadstop_type; + uint16_t roadstop_count; }; static RoadStopGUISettings _roadstop_gui_settings; @@ -181,7 +181,7 @@ void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, RoadTy * @see CmdBuildRoadStop */ void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, uint8 width, uint8 length, RoadStopType, bool is_drive_through, - DiagDirection dir, RoadType, RoadStopClassID spec_class, byte spec_index, StationID, bool) + DiagDirection dir, RoadType, RoadStopClassID spec_class, uint16_t spec_index, StationID, bool) { if (result.Failed()) return; @@ -221,7 +221,7 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, RoadStopType bool drive_through = ddir >= DIAGDIR_END; if (drive_through) ddir = static_cast(ddir - DIAGDIR_END); // Adjust picker result to actual direction. RoadStopClassID spec_class = _roadstop_gui_settings.roadstop_class; - byte spec_index = _roadstop_gui_settings.roadstop_type; + uint16_t spec_index = _roadstop_gui_settings.roadstop_type; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { @@ -1459,7 +1459,7 @@ public: } case WID_BROS_IMAGE: { - byte type = GB(widget, 16, 16); + uint16_t type = GB(widget, 16, 16); assert(type < _roadstop_gui_settings.roadstop_count); const RoadStopSpec *spec = RoadStopClass::Get(_roadstop_gui_settings.roadstop_class)->GetSpec(type); @@ -1555,7 +1555,7 @@ public: } case WID_BROS_IMAGE: { - int y = GB(widget, 16, 16); + uint16_t y = GB(widget, 16, 16); if (y >= _roadstop_gui_settings.roadstop_count) return; const RoadStopSpec *spec = RoadStopClass::Get(_roadstop_gui_settings.roadstop_class)->GetSpec(y); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 0ca841e26c..5d92b3c963 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -877,7 +877,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo * @param numtracks Number of platforms. * @return The cost in case of success, or an error code if it failed. */ -static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, std::vector &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks) +static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, std::vector &affected_vehicles, StationClassID spec_class, uint16_t spec_index, byte plat_len, byte numtracks) { CommandCost cost(EXPENSES_CONSTRUCTION); int allowed_z = -1; @@ -1261,7 +1261,7 @@ static void RestoreTrainReservation(Train *v) * @param numtracks Number of platforms. * @return The cost in case of success, or an error code if it failed. */ -static CommandCost CalculateRailStationCost(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, std::vector &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks) +static CommandCost CalculateRailStationCost(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, std::vector &affected_vehicles, StationClassID spec_class, uint16_t spec_index, byte plat_len, byte numtracks) { CommandCost cost(EXPENSES_CONSTRUCTION); bool length_price_ready = true; @@ -1310,7 +1310,7 @@ static CommandCost CalculateRailStationCost(TileArea tile_area, DoCommandFlag fl * @param adjacent allow stations directly adjacent to other stations. * @return the cost of this operation or an error */ -CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) +CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent) { /* Does the authority allow this? */ CommandCost ret = CheckIfAuthorityAllowsNewStation(tile_org, flags); @@ -1917,7 +1917,7 @@ static CommandCost CalculateRoadStopCost(TileArea tile_area, DoCommandFlag flags * @return The cost of this operation or an error. */ CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, - DiagDirection ddir, RoadType rt, RoadStopClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) + DiagDirection ddir, RoadType rt, RoadStopClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent) { if (!ValParamRoadType(rt) || !IsValidDiagDirection(ddir) || stop_type >= ROADSTOP_END) return CMD_ERROR; bool reuse = (station_to_join != NEW_STATION); diff --git a/src/station_cmd.h b/src/station_cmd.h index 50a08bbd24..9eb4277301 100644 --- a/src/station_cmd.h +++ b/src/station_cmd.h @@ -21,9 +21,9 @@ extern uint8 GetAirportNoiseLevelForDistance(const struct AirportSpec *as, uint CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, byte airport_type, byte layout, StationID station_to_join, bool allow_adjacent); CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent); -CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent); +CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent); CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail); -CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, RoadStopClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent); +CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, RoadStopClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent); CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 height, RoadStopType stop_type, bool remove_road); CommandCost CmdRenameStation(DoCommandFlag flags, StationID station_id, const std::string &text); CommandCost CmdOpenCloseAirport(DoCommandFlag flags, StationID station_id); diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 35bcf978d8..e6e7291cb7 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -172,7 +172,7 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, * @param adjacent allow waypoints directly adjacent to other waypoints. * @return the cost of this operation or an error */ -CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis axis, byte width, byte height, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) +CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis axis, byte width, byte height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent) { if (!IsValidAxis(axis)) return CMD_ERROR; /* Check if the given station class is valid */ diff --git a/src/waypoint_cmd.h b/src/waypoint_cmd.h index 29855be2c8..213bd8d6c6 100644 --- a/src/waypoint_cmd.h +++ b/src/waypoint_cmd.h @@ -15,7 +15,7 @@ enum StationClassID : byte; -CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis axis, byte width, byte height, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent); +CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis axis, byte width, byte height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent); CommandCost CmdRemoveFromRailWaypoint(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail); CommandCost CmdBuildBuoy(DoCommandFlag flags, TileIndex tile); CommandCost CmdRenameWaypoint(DoCommandFlag flags, StationID waypoint_id, const std::string &text); From cccf4953f7c1f6ee2706208e73ac4e4b6bcf1448 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 9 May 2023 12:50:06 +0100 Subject: [PATCH 33/38] Fix: Incorrect padding on industry cargo window. --- src/industry_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 0b419637ba..6e06888501 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1872,7 +1872,7 @@ static const NWidgetPart _nested_industry_cargoes_widgets[] = { NWidget(WWT_STICKYBOX, COLOUR_BROWN), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_PANEL, COLOUR_BROWN, WID_IC_PANEL), SetResize(1, 10), SetMinimalSize(200, 90), SetScrollbar(WID_IC_SCROLLBAR), EndContainer(), + NWidget(WWT_PANEL, COLOUR_BROWN, WID_IC_PANEL), SetResize(1, 10), SetScrollbar(WID_IC_SCROLLBAR), EndContainer(), NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, WID_IC_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), @@ -2924,17 +2924,17 @@ struct IndustryCargoesWindow : public Window { { if (widget != WID_IC_PANEL) return; - Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); DrawPixelInfo tmp_dpi; if (!FillDrawPixelInfo(&tmp_dpi, ir.left, ir.top, ir.Width(), ir.Height())) return; AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi); - int left_pos = ir.left; + int left_pos = WidgetDimensions::scaled.frametext.left - WidgetDimensions::scaled.bevel.left; if (this->ind_cargo >= NUM_INDUSTRYTYPES) left_pos += (CargoesField::industry_width + CargoesField::cargo_field_width) / 2; int last_column = (this->ind_cargo < NUM_INDUSTRYTYPES) ? 4 : 2; const NWidgetBase *nwp = this->GetWidget(WID_IC_PANEL); - int vpos = -this->vscroll->GetPosition() * nwp->resize_y; + int vpos = WidgetDimensions::scaled.frametext.top - WidgetDimensions::scaled.bevel.top - this->vscroll->GetPosition() * nwp->resize_y; for (uint i = 0; i < this->fields.size(); i++) { int row_height = (i == 0) ? CargoesField::small_height : CargoesField::normal_height; if (vpos + row_height >= 0) { From d68c4bbd2fce3fb67a96660c9cbdc0b6e5f5ac7b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 9 May 2023 12:50:37 +0100 Subject: [PATCH 34/38] Change: Use iterator when drawing industry cargo window. --- src/industry_gui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 6e06888501..9b05beaddf 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2935,8 +2935,8 @@ struct IndustryCargoesWindow : public Window { const NWidgetBase *nwp = this->GetWidget(WID_IC_PANEL); int vpos = WidgetDimensions::scaled.frametext.top - WidgetDimensions::scaled.bevel.top - this->vscroll->GetPosition() * nwp->resize_y; - for (uint i = 0; i < this->fields.size(); i++) { - int row_height = (i == 0) ? CargoesField::small_height : CargoesField::normal_height; + int row_height = CargoesField::small_height; + for (const auto &field : this->fields) { if (vpos + row_height >= 0) { int xpos = left_pos; int col, dir; @@ -2948,13 +2948,14 @@ struct IndustryCargoesWindow : public Window { dir = 1; } while (col >= 0 && col <= last_column) { - this->fields[i].columns[col].Draw(xpos, vpos); + field.columns[col].Draw(xpos, vpos); xpos += (col & 1) ? CargoesField::cargo_field_width : CargoesField::industry_width; col += dir; } } vpos += row_height; if (vpos >= height) break; + row_height = CargoesField::normal_height; } } From 6998fbf71de9aaa153670b4685d08888b94d96b3 Mon Sep 17 00:00:00 2001 From: PeterN Date: Tue, 9 May 2023 18:23:37 +0100 Subject: [PATCH 35/38] Fix: WWT_TEXT with SetTextStyle did not work. (#10797) FontSize was passed to incorrect parameter of DrawString function. --- src/widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget.cpp b/src/widget.cpp index 1e013a6d44..debfd79e88 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -510,7 +510,7 @@ static inline void DrawText(const Rect &r, TextColour colour, StringID str, Stri { Dimension d = GetStringBoundingBox(str, fs); Point p = GetAlignedPosition(r, d, align); - if (str != STR_NULL) DrawString(r.left, r.right, p.y, str, colour, align, fs); + if (str != STR_NULL) DrawString(r.left, r.right, p.y, str, colour, align, false, fs); } /** From 90529ea48ba4632a6953825f44b3670856215592 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 9 May 2023 18:44:36 +0000 Subject: [PATCH 36/38] Update: Translations from eints catalan: 30 changes by J0anJosep french: 25 changes by glx22 polish: 5 changes by pAter-exe --- src/lang/catalan.txt | 35 ++++++++++++++++++++++++++++++++--- src/lang/french.txt | 30 +++++++++++++++++++++++++++--- src/lang/polish.txt | 5 +++++ 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 864f2a5951..8fb144e603 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -932,8 +932,22 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Copia el # Game options window STR_GAME_OPTIONS_CAPTION :{WHITE}Opcions de la partida - - +STR_GAME_OPTIONS_TAB_GENERAL :General +STR_GAME_OPTIONS_TAB_GENERAL_TT :{BLACK}Trieu la configuració general. +STR_GAME_OPTIONS_TAB_GRAPHICS :Gràfics +STR_GAME_OPTIONS_TAB_GRAPHICS_TT :{BLACK}Trieu la configuració dels gràfics. +STR_GAME_OPTIONS_TAB_SOUND :So +STR_GAME_OPTIONS_TAB_SOUND_TT :{BLACK}Escolliu la configuració de so i de música. + +STR_GAME_OPTIONS_VOLUME :Volum +STR_GAME_OPTIONS_SFX_VOLUME :Efectes de so +STR_GAME_OPTIONS_MUSIC_VOLUME :Música + +STR_GAME_OPTIONS_VOLUME_0 :0{NBSP}% +STR_GAME_OPTIONS_VOLUME_25 :25{NBSP}% +STR_GAME_OPTIONS_VOLUME_50 :50{NBSP}% +STR_GAME_OPTIONS_VOLUME_75 :75{NBSP}% +STR_GAME_OPTIONS_VOLUME_100 :100{NBSP}% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Moneda STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selecció de la unitat monetària @@ -988,6 +1002,10 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Seleccio # Autosave dropdown ###length 5 STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Inactiu +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_10_MINUTES :Cada 10 minuts +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_30_MINUTES :Cada 30 minuts +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_60_MINUTES :Cada 60 minuts +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_120_MINUTES :Cada 120 minuts STR_GAME_OPTIONS_LANGUAGE :{BLACK}Idioma STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Selecciona l'idioma de la interfície @@ -1153,6 +1171,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Desplega STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Plega-ho tot STR_CONFIG_SETTING_RESET_ALL :{BLACK}Restableix tots els valors STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(cap explicació disponible) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valor per defecte: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Tipus de paràmetre: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Paràmetre del client (no s'emmagatzema a les partides; afecta a totes les partides) @@ -1713,7 +1732,7 @@ STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :Quantitat de me STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA}{NBSP}MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :Els intervals de revisions es mostren en percentatges: {STRING} -STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Escull si les revisions dels vehicles depenen del temps passat des de la darrera revisió o de la caiguda d'un cert percentatge de la fiabilitat màxima +STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Quan l'opció està activada, els vehicles intenten fer les seves revisions quan la seva fiabilitat baixa d'un cert percentatge de la fiabilitat màxima.{}{}Per exemple, si la fiabilitat màxima d'un vehicle és del 90{NBSP}% i l'interval de revisions és del 20{NBSP}%, el vehicle mirarà de fer la revisió quan arribi a un 72{NBSP}% de fiabilitat. STR_CONFIG_SETTING_SERVINT_TRAINS :Interval per defecte de servei per als trens: {STRING} STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT :Estableix l'interval de revisió predeterminat pels nous ferrocarrils, si no hi ha un interval de revisió explícit pel vehicle @@ -1918,6 +1937,10 @@ STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :Cap STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Multiplicador de mida inicial de ciutats: {STRING} STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :La grandària mitjana de les ciutats en relació als pobles a l'inici de la partida. +STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL :Actualitza el graf de distribució cada {STRING}{NBSP}segon{P 0:2 "" s} +STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL_HELPTEXT :Temps entre actualitzacions de les arestes del graf de distribució. Cada vegada es calcularan els plans d'un dels components del graf. Això vol dir que un valor X d'aquesta opció no significa que es recalculi el graf sencer cada X segons. Només ho farà algun component. Com més curt sigui, farà falta més temps de CPU per a calcular-lo. Com més llarg sigui, més es trigarà a què la distribució de càrrega s'apliqui a les rutes noves. +STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME :Triga {STRING}{NBSP}segon{P 0:2 "" s} per a recalcular el graf de distribució +STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME_HELPTEXT :Temps emprat per a cada actualització del component d'una aresta del graf. Quan comença el recàlcul, s'inicia un fil que pot executar-se durant aquests segons. Com més curt sigui, més probable és que el fil no acabi a temps. Llavors, la partida para fins que finalitzi, provocant una interrupció del desenvolupament de la partida. Com més llarg sigui, més es trigarà a actualitzar el graf de distribució quan es facin canvis de rutes. STR_CONFIG_SETTING_DISTRIBUTION_PAX :Mode de distribució per passatgers: {STRING} STR_CONFIG_SETTING_DISTRIBUTION_PAX_HELPTEXT :"Simètric" vol dir que aproximadament el mateix nombre de passatgers aniran des de l'estació A a la B que de B a A. "Asimètric" significa que un nombre arbitrari de passatgers poden anar en qualsevol dels dos sentits. "Manual" vol dir que no s'aplicarà una distribució automàtica pels passatgers. @@ -3806,6 +3829,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia in STR_VEHICLE_LIST_REPLACE_VEHICLES :Substitueix vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Envia a fer revisió STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Benefici enguany: {CURRENCY_LONG} (darrer any: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Envia a la cotxera STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Envia a la cotxera @@ -4572,6 +4597,7 @@ STR_AI_CONFIG_RANDOM_AI :IA aleatòria STR_AI_CONFIG_NONE :(cap) STR_AI_CONFIG_NAME_VERSION :{STRING} {YELLOW}v{NUM} STR_AI_CONFIG_MAX_COMPETITORS :{LTBLUE}Nombre màxim de competidors: {ORANGE}{COMMA} +STR_AI_CONFIG_COMPETITORS_INTERVAL :{LTBLUE}Interval entre l'inici de competidors: {ORANGE}{COMMA} minut{P "" s} STR_AI_CONFIG_MOVE_UP :{BLACK}Mou amunt STR_AI_CONFIG_MOVE_UP_TOOLTIP :{BLACK}Desplaça la IA seleccionada una posició cap amunt @@ -5086,6 +5112,7 @@ STR_ERROR_NO_BUOY :{WHITE}No hi ha STR_ERROR_CAN_T_TIMETABLE_VEHICLE :{WHITE}Impossible establir l'horari del vehicle... STR_ERROR_TIMETABLE_ONLY_WAIT_AT_STATIONS :{WHITE}Els vehicles només poden esperar a les estacions STR_ERROR_TIMETABLE_NOT_STOPPING_HERE :{WHITE}Aquest vehicle no para en aquesta estació +STR_ERROR_TIMETABLE_INCOMPLETE :{WHITE}... l'horari està incomplet. # Sign related errors STR_ERROR_TOO_MANY_SIGNS :{WHITE}... massa senyals @@ -5565,11 +5592,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/french.txt b/src/lang/french.txt index 06ff368962..60651b27ba 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -932,8 +932,22 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Copier l # Game options window STR_GAME_OPTIONS_CAPTION :{WHITE}Options du jeu - - +STR_GAME_OPTIONS_TAB_GENERAL :Général +STR_GAME_OPTIONS_TAB_GENERAL_TT :{BLACK}Régler les paramètres généraux +STR_GAME_OPTIONS_TAB_GRAPHICS :Graphiques +STR_GAME_OPTIONS_TAB_GRAPHICS_TT :{BLACK}Régler les paramètres graphiques +STR_GAME_OPTIONS_TAB_SOUND :Son +STR_GAME_OPTIONS_TAB_SOUND_TT :{BLACK}Régler les paramètres de son et de musique + +STR_GAME_OPTIONS_VOLUME :Volume +STR_GAME_OPTIONS_SFX_VOLUME :Effets sonores +STR_GAME_OPTIONS_MUSIC_VOLUME :Musique + +STR_GAME_OPTIONS_VOLUME_0 :0% +STR_GAME_OPTIONS_VOLUME_25 :25% +STR_GAME_OPTIONS_VOLUME_50 :50% +STR_GAME_OPTIONS_VOLUME_75 :75% +STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Devise STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Sélectionner l'unité monétaire @@ -988,6 +1002,10 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Sélecti # Autosave dropdown ###length 5 STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Désactivée +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_10_MINUTES :Toutes les 10 minutes +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_30_MINUTES :Toutes les 30 minutes +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_60_MINUTES :Toutes les 60 minutes +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_120_MINUTES :Toutes les 120 minutes STR_GAME_OPTIONS_LANGUAGE :{BLACK}Langue STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Sélectionner la langue à utiliser pour l'interface @@ -1153,6 +1171,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Tout dé STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Tout réduire STR_CONFIG_SETTING_RESET_ALL :{BLACK}Réinitialiser tous les réglages STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(pas d'explication disponible) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valeur par défaut{NBSP}: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Type de paramètre{NBSP}: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Paramètre du client (n'est pas enregistré dans les sauvegardes{NBSP}; affecte toutes les parties) @@ -1713,7 +1732,7 @@ STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :Quantité de m STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} Mio STR_CONFIG_SETTING_SERVINT_ISPERCENT :Les intervalles de service sont en pourcentage{NBSP}: {STRING} -STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Choisir si l'entretien des véhicule est activé par le temps passé depuis le dernier entretien ou par la fiabilité passant sous un pourcentage de la fiabilité maximum +STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Lorsqu'il est activé, les véhicules essaient d'être entretenus quand leur fiabilité passe sous le pourcentage donné de la fiabilité maximum.{}{}Par exemple, si la fiabilité maximum d'un véhicule est 90% et l'intervalle d'entretien 20%, le véhicule essayera d'être entretenu quand sa fiabilité atteindra 72%. STR_CONFIG_SETTING_SERVINT_TRAINS :Intervalle d'entretien par défaut pour les trains{NBSP}: {STRING} STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT :Définit l'intervalle d'entretien par défaut des nouveaux véhicules ferroviaires, si aucun intervalle d'entretien n'est défini pour le véhicule @@ -3810,6 +3829,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envoyer STR_VEHICLE_LIST_REPLACE_VEHICLES :Remplacer des véhicules STR_VEHICLE_LIST_SEND_FOR_SERVICING :Envoyer à l'entretien STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit cette année{NBSP}: {CURRENCY_LONG} (année précédente{NBSP}: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Envoyer au dépôt STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Envoyer au dépôt @@ -5091,6 +5112,7 @@ STR_ERROR_NO_BUOY :{WHITE}Il n'y a STR_ERROR_CAN_T_TIMETABLE_VEHICLE :{WHITE}Impossible d'affecter un horaire au véhicule... STR_ERROR_TIMETABLE_ONLY_WAIT_AT_STATIONS :{WHITE}Les véhicules ne peuvent attendre qu'aux stations STR_ERROR_TIMETABLE_NOT_STOPPING_HERE :{WHITE}Ce véhicule ne s'arrête pas à cette station +STR_ERROR_TIMETABLE_INCOMPLETE :{WHITE}... l'horaire est incomplet # Sign related errors STR_ERROR_TOO_MANY_SIGNS :{WHITE}... trop de panneaux @@ -5570,11 +5592,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index dc16057939..d6eb756bc0 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1550,6 +1550,7 @@ STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Otwórz STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Zamknij wszystko STR_CONFIG_SETTING_RESET_ALL :{BLACK}Zresetuj wszystkie ustawienia STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(wyjaśnienie niedostępne) +STR_CONFIG_SETTING_VALUE :{PUSH_COLOUR}{ORANGE}{STRING}{POP_COLOUR} STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Domyślna wartość: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Typ ustawienia: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Ustawienie klienta (nie przechowywane w plikach zapisu; ma wpływ na wszystkie gry) @@ -4207,6 +4208,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Wyślij STR_VEHICLE_LIST_REPLACE_VEHICLES :Zastąp pojazdy STR_VEHICLE_LIST_SEND_FOR_SERVICING :Wyślij do serwisu STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Zysk w tym roku: {CURRENCY_LONG} (ostatni rok: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Wyślij do warsztatów STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Wyślij do zajezdni @@ -6011,11 +6014,13 @@ STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} STR_JUST_CARGO :{CARGO_LONG} +STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} STR_JUST_CHECKMARK :{CHECKMARK} STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} From febe3948063a14fc636b2feb506e4064608e559c Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 9 May 2023 21:35:50 +0200 Subject: [PATCH 37/38] Codechange: replace C-style strings with C++-style strings in textfile (#10772) --- src/string.cpp | 11 ++++++--- src/string_func.h | 2 +- src/string_type.h | 8 ++++++- src/strings.cpp | 12 ++++++---- src/strings_func.h | 4 ++-- src/textfile_gui.cpp | 55 ++++++++++++++++++++------------------------ src/textfile_gui.h | 24 +++++++++---------- 7 files changed, 63 insertions(+), 53 deletions(-) diff --git a/src/string.cpp b/src/string.cpp index 35b3dc5b3d..89ee7bad9d 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -221,9 +221,14 @@ static void StrMakeValidInPlace(T &dst, const char *str, const char *last, Strin str += len; continue; } - /* Replace the undesirable character with a question mark */ str += len; - if ((settings & SVS_REPLACE_WITH_QUESTION_MARK) != 0) *dst++ = '?'; + if ((settings & SVS_REPLACE_TAB_CR_NL_WITH_SPACE) != 0 && (c == '\r' || c == '\n' || c == '\t')) { + /* Replace the tab, carriage return or newline with a space. */ + *dst++ = ' '; + } else if ((settings & SVS_REPLACE_WITH_QUESTION_MARK) != 0) { + /* Replace the undesirable character with a question mark */ + *dst++ = '?'; + } } } @@ -263,7 +268,7 @@ void StrMakeValidInPlace(char *str, StringValidationSettings settings) * @param str The string to validate. * @param settings The settings for the string validation. */ -std::string StrMakeValid(const std::string &str, StringValidationSettings settings) +std::string StrMakeValid(std::string_view str, StringValidationSettings settings) { auto buf = str.data(); auto last = buf + str.size(); diff --git a/src/string_func.h b/src/string_func.h index c03101c213..192ed6a8fb 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -40,7 +40,7 @@ int CDECL seprintf(char *str, const char *last, const char *format, ...) WARN_FO std::string FormatArrayAsHex(span data); void StrMakeValidInPlace(char *str, const char *last, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK) NOACCESS(2); -[[nodiscard]] std::string StrMakeValid(const std::string &str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK); +[[nodiscard]] std::string StrMakeValid(std::string_view str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK); void StrMakeValidInPlace(char *str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK); void str_fix_scc_encoded(char *str, const char *last) NOACCESS(2); diff --git a/src/string_type.h b/src/string_type.h index 4483b7474c..841097516e 100644 --- a/src/string_type.h +++ b/src/string_type.h @@ -47,8 +47,14 @@ static const WChar CHAR_TD_PDF = 0x202C; ///< Restore the text-direction state t enum StringValidationSettings { SVS_NONE = 0, ///< Allow nothing and replace nothing. SVS_REPLACE_WITH_QUESTION_MARK = 1 << 0, ///< Replace the unknown/bad bits with question marks. - SVS_ALLOW_NEWLINE = 1 << 1, ///< Allow newlines. + SVS_ALLOW_NEWLINE = 1 << 1, ///< Allow newlines; replaces '\r\n' with '\n' during processing. SVS_ALLOW_CONTROL_CODE = 1 << 2, ///< Allow the special control codes. + /** + * Replace tabs ('\t'), carriage returns ('\r') and newlines ('\n') with spaces. + * When #SVS_ALLOW_NEWLINE is set, a '\n' or '\r\n' combination are not replaced with a space. A lone '\r' is replaced with a space. + * When #SVS_REPLACE_WITH_QUESTION_MARK is set, this replacement runs first. + */ + SVS_REPLACE_TAB_CR_NL_WITH_SPACE = 1 << 3, }; DECLARE_ENUM_AS_BIT_SET(StringValidationSettings) diff --git a/src/strings.cpp b/src/strings.cpp index 840b064e5a..32e34ad5f1 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2103,9 +2103,13 @@ bool MissingGlyphSearcher::FindMissingGlyphs() } this->Reset(); - for (const char *text = this->NextString(); text != nullptr; text = this->NextString()) { + for (auto text = this->NextString(); text.has_value(); text = this->NextString()) { + auto src = text->cbegin(); + FontSize size = this->DefaultSize(); - for (WChar c = Utf8Consume(&text); c != '\0'; c = Utf8Consume(&text)) { + while (src != text->cend()) { + WChar c = Utf8Consume(src); + if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) { size = (FontSize)(c - SCC_FIRST_FONT); } else if (!IsInsideMM(c, SCC_SPRITE_START, SCC_SPRITE_END) && IsPrintable(c) && !IsTextDirectionChar(c) && c != '?' && GetGlyph(size, c) == question_mark[size]) { @@ -2144,9 +2148,9 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher { return FS_NORMAL; } - const char *NextString() override + std::optional NextString() override { - if (this->i >= TEXT_TAB_END) return nullptr; + if (this->i >= TEXT_TAB_END) return std::nullopt; const char *ret = _langpack.offsets[_langpack.langtab_start[this->i] + this->j]; diff --git a/src/strings_func.h b/src/strings_func.h index 760931d1a9..12f414961a 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -261,9 +261,9 @@ public: /** * Get the next string to search through. - * @return The next string or nullptr if there is none. + * @return The next string or nullopt if there is none. */ - virtual const char *NextString() = 0; + virtual std::optional NextString() = 0; /** * Get the default (font) size of the string. diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 89a5747bb4..ba067daead 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -70,11 +70,6 @@ TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc) this->hscroll->SetStepSize(10); // Speed up horizontal scrollbar } -/* virtual */ TextfileWindow::~TextfileWindow() -{ - free(this->text); -} - /** * Get the total height of the content displayed in this window, if wrapping is disabled. * @return the height in pixels @@ -199,9 +194,9 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) return FS_MONO; } -/* virtual */ const char *TextfileWindow::NextString() +/* virtual */ std::optional TextfileWindow::NextString() { - if (this->search_iterator >= this->lines.size()) return nullptr; + if (this->search_iterator >= this->lines.size()) return std::nullopt; return this->lines[this->search_iterator++].text; } @@ -344,48 +339,48 @@ static void Xunzip(byte **bufp, size_t *sizep) FILE *handle = FioFOpenFile(textfile, "rb", dir, &filesize); if (handle == nullptr) return; - this->text = ReallocT(this->text, filesize); - size_t read = fread(this->text, 1, filesize, handle); + char *buf = MallocT(filesize); + size_t read = fread(buf, 1, filesize, handle); fclose(handle); - if (read != filesize) return; + if (read != filesize) { + free(buf); + return; + } #if defined(WITH_ZLIB) /* In-place gunzip */ - if (StrEndsWith(textfile, ".gz")) Gunzip((byte**)&this->text, &filesize); + if (StrEndsWith(textfile, ".gz")) Gunzip((byte**)&buf, &filesize); #endif #if defined(WITH_LIBLZMA) /* In-place xunzip */ - if (StrEndsWith(textfile, ".xz")) Xunzip((byte**)&this->text, &filesize); + if (StrEndsWith(textfile, ".xz")) Xunzip((byte**)&buf, &filesize); #endif - if (!this->text) return; + if (buf == nullptr) return; - /* Add space for trailing \0 */ - this->text = ReallocT(this->text, filesize + 1); - this->text[filesize] = '\0'; - - /* Replace tabs and line feeds with a space since StrMakeValidInPlace removes those. */ - for (char *p = this->text; *p != '\0'; p++) { - if (*p == '\t' || *p == '\r') *p = ' '; - } + std::string_view sv_buf(buf, filesize); /* Check for the byte-order-mark, and skip it if needed. */ - char *p = this->text + (strncmp(u8"\ufeff", this->text, 3) == 0 ? 3 : 0); + if (StrStartsWith(sv_buf, u8"\ufeff")) sv_buf.remove_prefix(3); - /* Make sure the string is a valid UTF-8 sequence. */ - StrMakeValidInPlace(p, this->text + filesize, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE); + /* Replace any invalid characters with a question-mark. This copies the buf in the process. */ + this->text = StrMakeValid(sv_buf, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE | SVS_REPLACE_TAB_CR_NL_WITH_SPACE); + free(buf); /* Split the string on newlines. */ + std::string_view p(this->text); int row = 0; - this->lines.emplace_back(row, p); - for (; *p != '\0'; p++) { - if (*p == '\n') { - *p = '\0'; - this->lines.emplace_back(++row, p + 1); - } + auto next = p.find_first_of('\n'); + while (next != std::string_view::npos) { + this->lines.emplace_back(row, p.substr(0, next)); + p.remove_prefix(next + 1); + + row++; + next = p.find_first_of('\n'); } + this->lines.emplace_back(row, p); /* Calculate maximum text line length. */ uint max_length = 0; diff --git a/src/textfile_gui.h b/src/textfile_gui.h index 5e0a7180f7..c233aba638 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -19,25 +19,14 @@ std::optional GetTextfile(TextfileType type, Subdirectory dir, cons /** Window for displaying a textfile */ struct TextfileWindow : public Window, MissingGlyphSearcher { - struct Line { - int top; ///< Top scroll position. - int bottom; ///< Bottom scroll position. - const char *text; ///< Pointer to text buffer. - - Line(int top, const char *text) : top(top), bottom(top + 1), text(text) {} - }; - TextfileType file_type; ///< Type of textfile to view. Scrollbar *vscroll; ///< Vertical scrollbar. Scrollbar *hscroll; ///< Horizontal scrollbar. - char *text; ///< Lines of text from the NewGRF's textfile. - std::vector lines; ///< #text, split into lines in a table with lines. uint search_iterator; ///< Iterator for the font check search. uint max_length; ///< Maximum length of unwrapped text line. TextfileWindow(TextfileType file_type); - ~TextfileWindow(); void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override; void OnClick(Point pt, int widget, int click_count) override; @@ -47,13 +36,24 @@ struct TextfileWindow : public Window, MissingGlyphSearcher { void Reset() override; FontSize DefaultSize() override; - const char *NextString() override; + std::optional NextString() override; bool Monospace() override; void SetFontNames(FontCacheSettings *settings, const char *font_name, const void *os_data) override; virtual void LoadTextfile(const std::string &textfile, Subdirectory dir); private: + struct Line { + int top; ///< Top scroll position. + int bottom; ///< Bottom scroll position. + std::string_view text; ///< Pointer to text buffer. + + Line(int top, std::string_view text) : top(top), bottom(top + 1), text(text) {} + }; + + std::string text; ///< Lines of text from the NewGRF's textfile. + std::vector lines; ///< #text, split into lines in a table with lines. + uint ReflowContent(); uint GetContentHeight(); void SetupScrollbars(bool force_reflow); From 644e310506fdf0aedaebbe38b84003588defe49d Mon Sep 17 00:00:00 2001 From: PeterN Date: Tue, 9 May 2023 22:02:06 +0100 Subject: [PATCH 38/38] Fix: Incorrect y-position of monospace glyphs. (#10794) --- media/baseset/openttd.grf | Bin 509868 -> 509868 bytes media/baseset/openttd/mono.nfo | 450 ++++++++++++++++----------------- 2 files changed, 225 insertions(+), 225 deletions(-) diff --git a/media/baseset/openttd.grf b/media/baseset/openttd.grf index 9e08fb17c3a801a57391f8f6656f9240f5e3d2f0..dd8acf3e8217fd37af9b7895ee970cde8d033a6a 100644 GIT binary patch delta 2397 zcmeHJ*=w9t6wl@yNirWvlgXrMCX>xZ(ZMi|jFJZ3u$@|j zm&H!q0&m*6`GlQ2p8u6IJ7=eDN-c|Vvytf>v_&X89JE8=VTCU_z;w<*+c$E3?V#oj zp~gu@A#8Jk^FAj%BILLe+^3z?E96T`?rEkL_M?+ph4N1)4GUappl+@7!YyyKs#;G~ zRaIPf%!QIXz{uuY2)O0~zweZ>er&_Ztd%UQzKR4#$7nz#FL(0upB=*iuPEhoE19&? zp|ZOoAZ(zm%;cs<5w*ijy95T@=z#3v88=$XxwWxR-AE}dKe@>u+@;0bK{{skAQ9(p zV9$AAmRzzP1fKMuRTn)t)R!KVtn-5SE-&-}C7)6_@5RL~c@ck~>v8ovebgpc9Pr^X zZu)rbSCvwmB2&|1-|V5qv5G@;7kT4%ed?Utn+^Fv_nls9XGi>`iKIC{rcdNy3rhK! zpB@#)U;N)cNnGONuK2bc8!}FbZze>(Um7Z@4PhJ|9GD zCW9zz>7*{LbnqW1dOgMmW<@0_gviVu4&f@=LTK>85YEbt@{Z?1$hsK9G~ElK!CS`p zJB!}eH8aaN@5<)GesP=+@un!=`Tt_&*8A^uL(Fj^jA!*`7;|$yjJdfT#(e7|n5!ov zn4ds|2Kv|5YxzQ3tu5yy`{aSk@svBbA3KSyRn|XkMJcVXHFl*&g+X( z|K^StJTg&yC(dw-kUxo{-t8z}MMDg{hGTe?!5Db+mmxRe`!RfXmSg;J$T6lkYMJ7Q zIG`{S#}=QB(;iWYV;fsm&UfRqS15ZDcs7;g61XpkxTz%k z|K9LA_HmM$gy&KcL?0w^pq>;OJeoqpD=FB|rC?uD@`DsE;5R*RbOH=sn}Gj?3HXu-}~6lYu4Q@U)Nslm#ynA?b;0yF~JKa zBbi~kiH75V5%{KoAS8rKykJaBzz+*121g8tm*52?ep0+3{+{#lA~F62#xLvpJm;L> z`JKyi&W?7xN;6zc>m#S6EE06W^VK0Pk95)V3U)q zytaW{{MK@)q#MY~xh^vA@sNQp)KM?_wxXIFyCn4j{;Pvj(L1N0MGa;W_Kf*G|1{k4QNdx`LvtK5?H>_ zNCli*4etjUsf4dM@C89GUu*=%-$z4`oJ!Ba{vh;fSCgHiL7J(lq-WA}-Wh~{5xgA) zMHQujvhe3YvS~i#nArqmfhtp9lB-os-8q!iQZTdW%GMYV6dbPpzxN% z*VOTu8o(PvRHl|_!hF4#W@~gFw&Qi)xg}_t-gjp_6gg|Y)7G}3|f%36Bf~kdX zgvhPwZL*Rr!_67h5Q$BFvu0!CbhAdu%uq7%RX2*bzZnitTpOQNQefM7+=(g(Kwkll zo-iDIQ2;gz!&IhJij2dy3*M<}&Ts)+(lQ<~|L+LmOM+S6ck(Rw~t8Ruw{k z$`vZ-Iee)VN8tiNK2zI2om&j&9{eE0U(Q1uXj9_mHa%$J_q;m7rG-Ooa%K+KX(8Wq zq8g)JWaLW>dzqO$nLJ>#evUZ&@j%JRwtEZzLmad$~qwV)`%Hb33U@SphP_{BC z{%8j~0WDsykBpV;@pyl%K~M(|XB&9SdL;PYrr6%Y+2;F(+W*J@ST@of`n-Lu11m^hpPDhpyD*1EuwW4e+_znL2RP<&b{r~# zQW4j;+uFFkoVLc1EIb-BzY(W7+C1JH2i{a1oI%pczsL2}J-3@?snxxvo2u0Bwr-lw zi=6Ouq8kY<^?=*8ZYotWa}U+1-(@}YfaZRC4@S~>9R}dO5d6K{L-|T!vWF`8j0;S& zddaPBN_w&WMv9>m?j^sv+1{(`9J{MCi5n&PrI+Svtg-z{*zZBGu|6tPvgi7AtK}Ay z|D8Szgk2UWe51aE?eqkBm1<=Ikx2Gp38Y_IV^>0RemsH9f}owhOOOlNdy-V9j4G1g zDa*2IUz`@;V5NNMNre8|qsYnB#OjEgv?n;{Gt6!kcVE+KZ7vnVpI{U2y5Nxueo`=+( z?##-cDrH$Q@?YG~14y}qwbTz!zCkKhxJw369Y9+7$w3X$#_xN{Xd26#Dm>;pUC$*} p7@i$OYSD)#w))WUHwMvY0_IzYHpkw*yZ;{DEd6$B+h$r6`3sU?|8D>Q diff --git a/media/baseset/openttd/mono.nfo b/media/baseset/openttd/mono.nfo index f855e8f0ec..e17b6aae14 100644 --- a/media/baseset/openttd/mono.nfo +++ b/media/baseset/openttd/mono.nfo @@ -5,233 +5,233 @@ // -1 * 0 0C "Monospaced characters (Liberation Mono)" -1 * 0 12 01 03 60 20 00 - -1 sprites/mono.png 8bpp 10 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 30 7 13 0 0 normal - -1 sprites/mono.png 8bpp 10 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 50 7 13 0 0 normal - -1 sprites/mono.png 8bpp 10 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 70 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 70 7 13 0 0 normal + -1 sprites/mono.png 8bpp 10 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 30 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 10 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 50 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 10 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 70 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 70 7 13 0 -2 normal -1 * 0 12 01 03 80 80 00 - -1 sprites/mono.png 8bpp 10 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 90 7 13 0 0 normal - -1 sprites/mono.png 8bpp 10 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 110 7 13 0 0 normal - -1 sprites/mono.png 8bpp 10 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 130 7 13 0 0 normal - -1 sprites/mono.png 8bpp 10 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 25 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 40 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 55 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 70 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 85 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 100 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 115 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 130 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 145 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 160 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 175 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 190 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 205 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 220 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 235 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 250 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 265 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 280 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 295 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 310 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 325 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 340 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 355 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 370 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 385 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 400 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 415 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 430 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 445 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 460 150 7 13 0 0 normal - -1 sprites/mono.png 8bpp 475 150 7 13 0 0 normal + -1 sprites/mono.png 8bpp 10 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 90 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 10 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 110 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 10 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 130 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 10 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 25 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 40 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 55 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 70 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 85 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 100 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 115 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 130 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 145 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 160 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 175 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 190 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 205 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 220 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 235 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 250 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 265 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 280 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 295 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 310 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 325 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 340 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 355 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 370 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 385 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 400 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 415 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 430 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 445 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 460 150 7 13 0 -2 normal + -1 sprites/mono.png 8bpp 475 150 7 13 0 -2 normal //U+0178 Latin Capital Letter Y With Diaeresis (only needed for mono as it is in the base set, but relocated by some code) -1 * 0 12 01 03 01 78 01 - -1 sprites/mono.png 8bpp 370 230 7 13 0 0 normal + -1 sprites/mono.png 8bpp 370 230 7 13 0 -2 normal