From 394c749b6b0fa3e185734b7e5b92ad71420fdf2c Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 25 Sep 2021 13:48:03 +0200 Subject: [PATCH 001/710] Change: Heading for 13 now (#9573) --- CMakeLists.txt | 2 +- bin/ai/compat_12.nut | 2 ++ bin/ai/compat_13.nut | 6 ++++++ bin/game/compat_12.nut | 2 ++ bin/game/compat_13.nut | 6 ++++++ regression/regression/info.nut | 2 +- regression/stationlist/info.nut | 2 +- src/ai/ai_info.cpp | 2 +- src/game/game_info.cpp | 2 +- src/saveload/saveload.h | 2 +- src/script/api/ai_changelog.hpp | 4 +++- src/script/api/game_changelog.hpp | 4 +++- 12 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 bin/ai/compat_13.nut create mode 100644 bin/game/compat_13.nut diff --git a/CMakeLists.txt b/CMakeLists.txt index 37e8697e40..4dc733777d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(NOT BINARY_NAME) endif() project(${BINARY_NAME} - VERSION 12.0 + VERSION 13.0 ) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) diff --git a/bin/ai/compat_12.nut b/bin/ai/compat_12.nut index 3081fb58e8..2ff41f8b4f 100644 --- a/bin/ai/compat_12.nut +++ b/bin/ai/compat_12.nut @@ -4,3 +4,5 @@ * 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 . */ + +AILog.Info("12 API compatibility in effect."); diff --git a/bin/ai/compat_13.nut b/bin/ai/compat_13.nut new file mode 100644 index 0000000000..3081fb58e8 --- /dev/null +++ b/bin/ai/compat_13.nut @@ -0,0 +1,6 @@ +/* + * 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 . + */ diff --git a/bin/game/compat_12.nut b/bin/game/compat_12.nut index 3081fb58e8..df08583914 100644 --- a/bin/game/compat_12.nut +++ b/bin/game/compat_12.nut @@ -4,3 +4,5 @@ * 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 . */ + +GSLog.Info("12 API compatibility in effect."); diff --git a/bin/game/compat_13.nut b/bin/game/compat_13.nut new file mode 100644 index 0000000000..3081fb58e8 --- /dev/null +++ b/bin/game/compat_13.nut @@ -0,0 +1,6 @@ +/* + * 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 . + */ diff --git a/regression/regression/info.nut b/regression/regression/info.nut index 1a52cfebbb..8799d98628 100644 --- a/regression/regression/info.nut +++ b/regression/regression/info.nut @@ -4,7 +4,7 @@ class Regression extends AIInfo { function GetShortName() { return "REGR"; } function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; } function GetVersion() { return 1; } - function GetAPIVersion() { return "12"; } + function GetAPIVersion() { return "13"; } function GetDate() { return "2007-03-18"; } function CreateInstance() { return "Regression"; } function UseAsRandomAI() { return false; } diff --git a/regression/stationlist/info.nut b/regression/stationlist/info.nut index ad91c7645c..099a7d12ec 100644 --- a/regression/stationlist/info.nut +++ b/regression/stationlist/info.nut @@ -4,7 +4,7 @@ class StationList extends AIInfo { function GetShortName() { return "REGS"; } function GetDescription() { return "This runs stationlist-tests on some commands. On the same map the result should always be the same."; } function GetVersion() { return 1; } - function GetAPIVersion() { return "12"; } + function GetAPIVersion() { return "13"; } function GetDate() { return "2007-03-18"; } function CreateInstance() { return "StationList"; } function UseAsRandomAI() { return false; } diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 17ad012579..fcd1b5a1a9 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -25,7 +25,7 @@ */ static bool CheckAPIVersion(const char *api_version) { - static const std::set versions = { "0.7", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12" }; + static const std::set versions = { "0.7", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12", "13" }; return versions.find(api_version) != versions.end(); } diff --git a/src/game/game_info.cpp b/src/game/game_info.cpp index 98818e8dd1..5f7ba259b6 100644 --- a/src/game/game_info.cpp +++ b/src/game/game_info.cpp @@ -23,7 +23,7 @@ */ static bool CheckAPIVersion(const char *api_version) { - static const std::set versions = { "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12" }; + static const std::set versions = { "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12", "13" }; return versions.find(api_version) != versions.end(); } diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index ad8b368c8f..bd0613e554 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -337,7 +337,7 @@ enum SaveLoadVersion : uint16 { SLV_TABLE_CHUNKS, ///< 295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE. SLV_SCRIPT_INT64, ///< 296 PR#9415 SQInteger is 64bit but was saved as 32bit. - SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 Store travel time in the linkgraph. + SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 v12 Store travel time in the linkgraph. SL_MAX_VERSION, ///< Highest possible saveload version }; diff --git a/src/script/api/ai_changelog.hpp b/src/script/api/ai_changelog.hpp index c1ea5e152e..2f99ac864f 100644 --- a/src/script/api/ai_changelog.hpp +++ b/src/script/api/ai_changelog.hpp @@ -13,10 +13,12 @@ * functions may still be available if you return an older API version * in GetAPIVersion() in info.nut. * - * \b 12.0 + * \b 13.0 * * This version is not yet released. The following changes are not set in stone yet. * + * \b 12.0 + * * API additions: * \li AINewGRF * \li AINewGRFList diff --git a/src/script/api/game_changelog.hpp b/src/script/api/game_changelog.hpp index 741d3f56d0..8041e779d4 100644 --- a/src/script/api/game_changelog.hpp +++ b/src/script/api/game_changelog.hpp @@ -13,10 +13,12 @@ * functions may still be available if you return an older API version * in GetAPIVersion() in info.nut. * - * \b 12.0 + * \b 13.0 * * This version is not yet released. The following changes are not set in stone yet. * + * \b 12.0 + * * API additions: * \li GSNewGRF * \li GSNewGRFList From 9b1651a267c7a812ed4f88dddfe5f56fa669173a Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 25 Sep 2021 18:46:38 +0000 Subject: [PATCH 002/710] Update: Translations from eints swedish: 8 changes by Abbin44 norwegian (bokmal): 14 changes by Anolitt chinese (traditional): 6 changes by SiderealArt slovenian: 4 changes by Matej1245 vietnamese: 14 changes by KhoiCanDev luxembourgish: 24 changes by phreeze83 hungarian: 1 change by baliball serbian: 29 changes by nkrs german: 1 change by SecretIdetity russian: 2 changes by SecretIdetity, 1 change by Ln-Wolf catalan: 1 change by J0anJosep turkish: 1 change by ahmetlii french: 1 change by glx22 --- src/lang/catalan.txt | 1 + src/lang/french.txt | 1 + src/lang/german.txt | 1 + src/lang/hungarian.txt | 1 + src/lang/luxembourgish.txt | 26 ++++++++++++++++++++++++-- src/lang/norwegian_bokmal.txt | 16 ++++++++++++++-- src/lang/russian.txt | 4 +++- src/lang/serbian.txt | 29 +++++++++++++++++++++++++++++ src/lang/slovenian.txt | 4 ++++ src/lang/swedish.txt | 8 ++++++++ src/lang/traditional_chinese.txt | 6 ++++++ src/lang/turkish.txt | 1 + src/lang/vietnamese.txt | 16 ++++++++++++++-- 13 files changed, 107 insertions(+), 7 deletions(-) diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 271939d6b2..4faf47f9ed 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -2413,6 +2413,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Equip] a {STRI STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] a {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Tothom] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Posa el text pel xat de xarxa # Network messages diff --git a/src/lang/french.txt b/src/lang/french.txt index a6e38ff364..7d02f7f2e0 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -2413,6 +2413,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Équipe] À {S STR_NETWORK_CHAT_CLIENT :[Privé] {STRING}{NBSP}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privé] À {STRING}{NBSP}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Tous] {STRING}{NBSP}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}{NBSP}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Entrer le texte du clavardage # Network messages diff --git a/src/lang/german.txt b/src/lang/german.txt index 83ff4f0f02..c842c5c572 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -2413,6 +2413,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Team] an {STRI STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] an {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Alle] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Chattext eingeben # Network messages diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 5862d7b62e..c6d6202a1a 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1631,6 +1631,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Egyszeres katti STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Egyszeres kattintás (azonnal) ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Soha STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Jobb egérgomb emuláció: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Jobb egérgomb emulálási módszerének kiválasztása diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index d922ceb43d..2579e2d731 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -326,6 +326,7 @@ STR_GROUP_BY_NONE :Keng STR_GROUP_BY_SHARED_ORDERS :Gedeelten Opträg # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Opträg # Tooltips for the main toolbar ###length 31 @@ -1152,6 +1153,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Astellun STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filter-String: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Alles erweideren STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Alles reduzéiren +STR_CONFIG_SETTING_RESET_ALL :{BLACK}All Wäerter zerécksetzen STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(keng Erklärung verfügbar) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Standardwäert: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Astellungstyp: {ORANGE}{STRING} @@ -1160,6 +1162,7 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Spillastellung STR_CONFIG_SETTING_TYPE_GAME_INGAME :Spillastellung (am Save gespäichert; betrëfft just aktuellt Spill) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Firmenastellung (am Save gespäichert; betrëfft just nei Spiller) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Firmenastellung (am Save gespäichert; betrëfft just déi aktuell Firma) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Des Aktioun setzt all Wäerter op hier Standardastellungen zeréck.{}Bass du sécher, fir weiderzefueren? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Kategorie: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Typ: @@ -1551,6 +1554,8 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Ee Klick (wann STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Ee Klick (direkt) ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Nie +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Erlaben STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Rietsklickemulatioun: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Wiel d'Method aus fir déi riets Maustast ze emuléiren @@ -2196,6 +2201,8 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Krawatt # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Lokal +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Effentlech # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Multiplayer @@ -2257,6 +2264,7 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}Den Numm STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Passwuert setzen STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}En Passwuert fir d'Spill setzen, dass et net Public accessibel ass +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Sichtbarkeet STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} Spiller STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Maximal Spiller: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Maximal Unzuel vun de Clients. Et muss net all Slot gefëllt sinn. @@ -2292,11 +2300,20 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Firma as STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Spillerlëscht # Network client list +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Servernumm +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Verbindungstyp +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK} Däin Spillernumm +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Desem Spiller e Message schécken # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Lokal +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Effentlech +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Läschen +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Password entspären +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Bass du sécher, dass du de Spiller '{STRING}' banne wëlls? STR_NETWORK_SPECTATORS :Zuschauer @@ -2337,6 +2354,7 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Netzwier STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Konnt de Spillstand net lueden STR_NETWORK_ERROR_SERVER_START :{WHITE}Konnt de Server net starten STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}En Protokolfehler ass entstaanen an d'Connectioun ass getrennt ginn +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}De Servernumm gouf net definéiert. Den Numm kann iwwert der Multiplayerfënster gesat ginn. STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}D'Versioun vum Client stëmmt net mat däer vum Server iwwereneen STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Falscht Passwuert STR_NETWORK_ERROR_SERVER_FULL :{WHITE}De Server ass voll @@ -2350,14 +2368,14 @@ STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Däin Co STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}Du hues ze laang gebraucht fir d'Kaart rofzelueden STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Du hues ze laang gebraucht fir dem Server bäizetrieden -STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Méiglechen Verbindungsverloscht +STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Méigleche Verbindungsverloscht STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}Déi lescht {NUM} Sekonnen{P "" s} sinn keng Daten vum Server komm ###length 21 STR_NETWORK_ERROR_CLIENT_GENERAL :generellen Fehler STR_NETWORK_ERROR_CLIENT_DESYNC :desync Fehler STR_NETWORK_ERROR_CLIENT_SAVEGAME :konnt d'Kaart net lueden -STR_NETWORK_ERROR_CLIENT_CONNECTION_LOST :Connectioun verluer +STR_NETWORK_ERROR_CLIENT_CONNECTION_LOST :Verbindung verluer STR_NETWORK_ERROR_CLIENT_PROTOCOL_ERROR :Protokollfehler STR_NETWORK_ERROR_CLIENT_NEWGRF_MISMATCH :NewGRF ënnerscheedlech STR_NETWORK_ERROR_CLIENT_NOT_AUTHORIZED :net authoriséiert @@ -2374,6 +2392,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :krut keen Passw STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :generellen Timeout STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :Kaart rofzelueden huet ze laang gedauert STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :Kaart ze verarbëschten huet ze laang gedauert +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :Falschen Numm vum Client # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2405,6 +2424,8 @@ STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}De Serve STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}De Server gëtt nei gestart...{}W.e.g. waarden... STR_NETWORK_MESSAGE_KICKED :*** {STRING} gouf gekickt. Grond: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Server Registration huet net geklappt +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Aner Spiller wäerte sech net op de Server verbanne kënnen # Content downloading window STR_CONTENT_TITLE :{WHITE}Lueden Inhalt erof @@ -4045,6 +4066,7 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Ennerwe STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Ennerwee an den {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Revisioun am {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Kann den {DEPOT} net erreechen, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 88c96f988b..0e529b86b1 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -328,6 +328,8 @@ STR_GROUP_BY_NONE :Ingen STR_GROUP_BY_SHARED_ORDERS :Delte ordre # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Ordrer +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Åpne ordrevisningen # Tooltips for the main toolbar ###length 31 @@ -1820,12 +1822,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Bygg vingesigna STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Angi året når elektriske signal vil bi tatt i bruk for spor. Før dette året vil ikke-elektriske signal bli brukt (som har nøyaktig samme funksjon, men forskjellig utseende) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Bla gjennom signaltyper: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Velg hvilke signaltyper å gå gjennom når Ctrl+trykke på et bygg signal med signal-verktøyet +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Velg hvilke signaltyper å gå gjennom når Ctrl+klikke på et bygd signal med signalverktøyet ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Kun avanserte signaler -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Alle +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Alle synlige +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Vis signaltyper: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Velg hvilke signaltyper som vises i verktøylinjen for signaler ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Kun sporsignaler +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Alle signaler STR_CONFIG_SETTING_TOWN_LAYOUT :Veiløsning for nye byer: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Løsning for veinettverket i byer @@ -2325,6 +2331,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Firmaet # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Påloggede spillere +STR_NETWORK_COMPANY_LIST_SPECTATE :Se # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Påloggede Spillere @@ -2409,6 +2416,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Lag] Til {STRI STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] Til {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Alle] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Skriv inn tekst for nettverkssamtale # Network messages @@ -4139,6 +4147,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Har kur STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}På vei til {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Vedlikehold ved {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Kan ikke nå {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Kan ikke nå {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Kan ikke nå {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Kan ikke nå {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/russian.txt b/src/lang/russian.txt index bb52997eaf..ec02604eda 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -452,6 +452,8 @@ STR_GROUP_BY_NONE :Нет STR_GROUP_BY_SHARED_ORDERS :Общие задания # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Заданий +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Показать просмотр заданий # Tooltips for the main toolbar ###length 31 @@ -2590,7 +2592,7 @@ STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Ваш STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Неверно указано имя игрока STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Подключение утеряно -STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}В течение {NUM} секунд{P ы "" ""} не получено никаких данных со стороны сервера +STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}За последн{P 0 юю ие ие} {NUM} секунд{P у ы ""} от сервера не получено никаких данных ###length 21 STR_NETWORK_ERROR_CLIENT_GENERAL :общая ошибка diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 84c7db029a..3efeee8160 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -514,6 +514,7 @@ STR_GROUP_BY_NONE :Nijedan STR_GROUP_BY_SHARED_ORDERS :Deljene naredbe # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Naredbe # Tooltips for the main toolbar ###length 31 @@ -987,6 +988,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * P STR_STATUSBAR_AUTOSAVE :{RED}AUTO-ČUVANJE STR_STATUSBAR_SAVING_GAME :{RED}* * ČUVAM PARTIJU * * +STR_STATUSBAR_SPECTATOR :{WHITE}(posmatrač) # News message history STR_MESSAGE_HISTORY :{WHITE}Arhiva Vesti @@ -1195,6 +1197,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :Svakih 12 mesec STR_GAME_OPTIONS_LANGUAGE :{BLACK}Jezik STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Odaberite jezik koji će se koristiti +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% završeno) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Ceo ekran STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Pritisnite ovde kako biste igrali OpenTTD na celom ekranu @@ -1746,6 +1749,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Klik (ako je u STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Klik (odmah) ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Nikada STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Oponašanje desnog klika: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Odaberite metodu imitiranja klika na desnu dirku miša @@ -1996,7 +2000,9 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Ciklični izbor STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Samo putna STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Sva +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Postavi tip signala koji će se prikazati na traci sa alatima ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Svi signali STR_CONFIG_SETTING_TOWN_LAYOUT :Plan gradnje novih puteva u naseljima: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Menja način izgradnje puteva u naseljima @@ -2391,6 +2397,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Promena # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Javno # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Mrežna partija @@ -2426,6 +2433,7 @@ STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Trenutn STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Zaštićeno šifrom! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER JE VAN MREŽE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER JE POPUNJEN +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SERVER VAS JE BLOKIRAO STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}NEODGOVARAJUĆA VERZIJA STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF NEPOKLAPANJE @@ -2443,6 +2451,7 @@ STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Pokreni STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Pokrenite sopstveni server STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Unesite Vaše ime +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Unesi adresu servera ili kod pozivnice # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Pokreni novu mrežnu partiju @@ -2485,14 +2494,29 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Preduze # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Spisak klijenata +STR_NETWORK_COMPANY_LIST_SPECTATE :Posmatranje # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Prisutni igrači +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Naziv +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Naziv servera na kojem igraš +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Kod pozivnice +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Igrač +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Ime igrača +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Pošalji poruku svim posmatračima # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Lokalno +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Zabrana +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Obriši +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Administratorska akcija +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Da li sigurno želite da promenite lozinku kompanije '{COMPANY}'? +STR_NETWORK_ASK_RELAY_NO :{BLACK}Ne STR_NETWORK_SPECTATORS :Posmatrači @@ -2532,6 +2556,7 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Veza sa STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Neuspešno učitavanje sačuvane partije STR_NETWORK_ERROR_SERVER_START :{WHITE}Neuspešno pokretanje servera STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Nastala je greška u protokolu i veza je zatvorena +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Ime igrača nije podešeno. Ono se može podesiti na vrhu prozora Partija preko mreže STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Revizija igre ovog klijenta se ne poklapa sa revizijom servera STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Pogrešna lozinka STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Server je pun @@ -2600,6 +2625,7 @@ STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Server j STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server se ponovo pokreće...{}Molimo sačekajte... STR_NETWORK_MESSAGE_KICKED :*** {STRING} je izvačen. Razlog: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Neuspešna registracija na serveru # Content downloading window STR_CONTENT_TITLE :{WHITE}Dodaci za preuzimanje @@ -3405,6 +3431,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Upozorenje STR_NEWGRF_ERROR_MSG_ERROR :{RED}Greška: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Kobno: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Došlo je do neotklonljive NewGRF greške:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}Dogodila se greška kod NewGRF-a:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} neće raditi sa TTDPatch verzijom prema prijavi OpenTTD-a STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} je za {STRING} verziju TTD-a STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} je napravljen za korišćenje sa {STRING} @@ -4256,6 +4283,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Ide ka STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Ide ka {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Servisiranje u {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Ne može dostići {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Ne može dostići {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 443121e567..5f5d5e9dfa 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -803,6 +803,7 @@ STR_MUSIC_EFFECTS_VOLUME :{TINY_FONT}{BLA STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}-- STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM} STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------ +STR_MUSIC_TITLE_NOMUSIC :{TINY_FONT}{DKGREEN}Glasba ni na voljo STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}"{STRING}" STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Skladba STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Naslov @@ -2335,6 +2336,7 @@ STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Seznam gostov ###length 5 +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Zagotovo želiš brcniti igralca '{STRING}'? STR_NETWORK_SPECTATORS :Gledalci @@ -2514,6 +2516,7 @@ STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}OpenTTD STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Da, prenesi grafike STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Ne, zapusti OpenTTD +STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Prenos ni uspel # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Nastavitve prozornega pogleda @@ -3226,6 +3229,7 @@ STR_EDIT_SIGN_SIGN_OSKTITLE :{BLACK}Vpiši i STR_TOWN_DIRECTORY_CAPTION :{WHITE}Mesta STR_TOWN_DIRECTORY_NONE :{ORANGE}- Brez - STR_TOWN_DIRECTORY_TOWN :{ORANGE}{TOWN}{BLACK} ({COMMA}) +STR_TOWN_DIRECTORY_CITY :{ORANGE}{TOWN}{YELLOW} (Mesto){BLACK} ({COMMA}) STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Imena mest - klikni na ime za pogled na mesto. Ctrl+Klik odpre nov pogled na lokaciji mesta STR_TOWN_POPULATION :{BLACK}Svetovno prebivalstvo: {COMMA} diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 4b51227ba7..95ca573700 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -326,6 +326,8 @@ STR_GROUP_BY_NONE :Ingen STR_GROUP_BY_SHARED_ORDERS :Delade order # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Ordrar +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Öppna order vyn # Tooltips for the main toolbar ###length 31 @@ -2325,6 +2327,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Företag # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Spelare online +STR_NETWORK_COMPANY_LIST_SPECTATE :Beskåda # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Spelare online @@ -2409,6 +2412,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Företaget] Ti STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] Till {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Alla] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Mata in text för nätverkschat # Network messages @@ -4139,6 +4143,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}På vä STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}På väg mot {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Service vid {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE} Kan inte nå {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Kan inte nå {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Kan inte nå {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Kan inte nå {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index ae24b09ca3..84ae5cd816 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -2293,6 +2293,7 @@ STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1 :遊戲暫停中 STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2 :遊戲暫停中 ({STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3 :遊戲暫停中 ({STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_4 :遊戲暫停中({STRING}, {STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_5 :遊戲暫停中 ({STRING}, {STRING}, {STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED :遊戲取消暫停 ({STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS :玩家數量 STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS :連線用戶端中 @@ -2832,6 +2833,7 @@ STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} STR_FRAMERATE_BYTES_GOOD :{LTBLUE}{BYTES} ###length 15 +STR_FRAMERATE_GAMESCRIPT :{BLACK} 遊戲腳本: STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} ###length 15 @@ -2878,6 +2880,7 @@ STR_MAPGEN_DATE :{BLACK}日期 STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}工業數量: STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}將沙漠覆蓋率提高10% +STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_LAND_GENERATOR :{BLACK}地形產生器: STR_MAPGEN_TERRAIN_TYPE :{BLACK}地形種類: STR_MAPGEN_QUANTITY_OF_SEA_LAKES :{BLACK}海平面: @@ -3182,6 +3185,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}冒著 # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} 遊戲目標 STR_GOALS_SPECTATOR_CAPTION :{WHITE}全局目標 +STR_GOALS_GLOBAL_BUTTON_HELPTEXT :{BLACK}顯示全局目標 STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- 當前無目標 - STR_GOALS_PROGRESS :{ORANGE}{STRING} @@ -3503,6 +3507,7 @@ STR_GROUP_REMOVE_ALL_VEHICLES :移去所有運 STR_GROUP_RENAME_CAPTION :{BLACK}重新命名群組 +STR_GROUP_PROFIT_THIS_YEAR :今年盈利: # Build vehicle window ###length 4 @@ -3810,6 +3815,7 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}正前 STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}正前往 {DEPOT},{VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}正在維護於 {DEPOT},{VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}無法前往{WAYPOINT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}無法前往{DEPOT},{VELOCITY} # Vehicle stopped/started animations diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 7d56e6b5a2..63a2ce34a4 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1824,6 +1824,7 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Yalnızca yol s STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Hepsi ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Yalnızca yol sinyalleri STR_CONFIG_SETTING_TOWN_LAYOUT :Yeni kasabalar için yol yerleşimi: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Şehirlerin karayolu ağlarını gösteren şema diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 8532200b10..dd79e5490c 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -326,6 +326,8 @@ STR_GROUP_BY_NONE :Không STR_GROUP_BY_SHARED_ORDERS :Lộ trình chia sẻ # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Lộ trình +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Mở bảng lộ trình # Tooltips for the main toolbar ###length 31 @@ -1817,12 +1819,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Xây cờ hiệ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Thiết lập thời điểm đèn hiệu điện sẽ được sử dụng. Trước thời điểm này chỉ có cờ hiệu được sử dụng (chúng cùng chức năng, chỉ khác hình thức) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Đổi tuần hoàn các kiểu đèn báo: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Chọn kiểu đèn báo để tuần hoàn, khi Ctrl+click vào một đèn báo đã được xây bằng công cụ đèn báo +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Chọn kiểu đèn báo để tuần hoàn khi Ctrl+click vào một đèn báo đã được xây bằng công cụ đèn báo ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Đèn hiệu giành đường -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Tất cả +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Tất cả có thể thấy +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Hiển thị các kiểu đèn báo: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Chọn kiểu đèn báo hiển thị trên thanh công cụ đèn báo ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Chỉ đèn hiệu giành đường +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Tất cả đèn báo STR_CONFIG_SETTING_TOWN_LAYOUT :Kiểu đường sá của đô thị mới: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Kiểu đường sá của đô thị @@ -2321,6 +2327,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Công ty # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Người chơi trực tuyến +STR_NETWORK_COMPANY_LIST_SPECTATE :Quan sát # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Chế độ nhiều người chơi @@ -2405,6 +2412,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Nhóm] tới { STR_NETWORK_CHAT_CLIENT :[Riêng] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Riêng] Tới {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Chung] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Nhập thông điệp tán gẫu # Network messages @@ -4135,6 +4143,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Nhắm STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Nhắm tới {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Phục vụ tại {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Không thể đi tới {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Không thể đi tới {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Không thể đi tới {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Không thể đi tới {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 From 14ad42447003550a985e7886606d165408c43c53 Mon Sep 17 00:00:00 2001 From: r-a-sattarov <51679282+r-a-sattarov@users.noreply.github.com> Date: Sun, 26 Sep 2021 12:12:35 +0300 Subject: [PATCH 003/710] Add: use of Intel Intrinsics & RDTSC on e2k (MCST Elbrus 2000) (#9575) MCST e2k (Elbrus 2000) architecture has half native / half software support of most Intel/AMD SIMD e.g. MMX/SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2/AES/AVX/AVX2 & 3DNow!/SSE4a/XOP/FMA4 E2K - this is VLIW/EPIC architecture, like Intel Itanium (IA-64) architecture. Ref: https://en.wikipedia.org/wiki/Elbrus_2000 Co-authored-by: Alexander Troosh @troosh, Konstantin Ivlev @sse4 and Dmitry Shcherbakov @crypto-das --- src/cpu.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/cpu.cpp b/src/cpu.cpp index b93f0fa5ed..d95c704e2a 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -73,6 +73,18 @@ uint64 ottd_rdtsc() # define RDTSC_AVAILABLE #endif +/* rdtsc for MCST Elbrus 2000 */ +#if defined(__e2k__) && !defined(RDTSC_AVAILABLE) +uint64 ottd_rdtsc() +{ + uint64_t dst; +# pragma asm_inline + asm("rrd %%clkr, %0" : "=r" (dst)); + return dst; +} +# define RDTSC_AVAILABLE +#endif + #if defined(__EMSCRIPTEN__) && !defined(RDTSC_AVAILABLE) /* On emscripten doing TIC/TOC would be ill-advised */ uint64 ottd_rdtsc() {return 0;} @@ -131,6 +143,24 @@ void ottd_cpuid(int info[4], int type) ); #endif /* i386 PIC */ } +#elif defined(__e2k__) /* MCST Elbrus 2000*/ +void ottd_cpuid(int info[4], int type) +{ + info[0] = info[1] = info[2] = info[3] = 0; + if (type == 0) { + info[0] = 1; + } else if (type == 1) { +#if defined(__SSE4_1__) + info[2] |= (1<<19); /* HasCPUIDFlag(1, 2, 19) */ +#endif +#if defined(__SSSE3__) + info[2] |= (1<<9); /* HasCPUIDFlag(1, 2, 9) */ +#endif +#if defined(__SSE2__) + info[3] |= (1<<26); /* HasCPUIDFlag(1, 3, 26) */ +#endif + } +} #else void ottd_cpuid(int info[4], int type) { From 11dece205c83b530d7ddaa1290efde04f4dfdeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sun, 26 Sep 2021 18:41:41 +0200 Subject: [PATCH 004/710] Revert 7ca1793: Using Trackdir keyed node is not required, Exitdir keyed node still have the correct trackdir (#9576) --- src/pathfinder/yapf/yapf_ship.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index d47afe5dfd..3a54ddb3eb 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -337,16 +337,6 @@ struct CYapfShip1 : CYapfT > {}; -static inline bool RequireTrackdirKey() -{ - /* If the two curve penalties are not equal, then it is not possible to use the - * ExitDir keyed node list, as it there will be key overlap. Using Trackdir keyed - * nodes means potentially more paths are tested, which would be wasteful if it's - * not necessary. - */ - return _settings_game.pf.yapf.ship_curve45_penalty != _settings_game.pf.yapf.ship_curve90_penalty; -} - /** Ship controller helper - path finder invoker */ Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, ShipPathCache &path_cache) { @@ -355,7 +345,7 @@ Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, PfnChooseShipTrack pfnChooseShipTrack = CYapfShip2::ChooseShipTrack; // default: ExitDir /* check if non-default YAPF type needed */ - if (_settings_game.pf.yapf.disable_node_optimization || RequireTrackdirKey()) { + if (_settings_game.pf.yapf.disable_node_optimization) { pfnChooseShipTrack = &CYapfShip1::ChooseShipTrack; // Trackdir } @@ -373,7 +363,7 @@ bool YapfShipCheckReverse(const Ship *v) PfnCheckReverseShip pfnCheckReverseShip = CYapfShip2::CheckShipReverse; // default: ExitDir /* check if non-default YAPF type needed */ - if (_settings_game.pf.yapf.disable_node_optimization || RequireTrackdirKey()) { + if (_settings_game.pf.yapf.disable_node_optimization) { pfnCheckReverseShip = &CYapfShip1::CheckShipReverse; // Trackdir } From 38a64eb2aab6a70f749403ad2c20ebc53f84581f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sun, 26 Sep 2021 19:31:55 +0200 Subject: [PATCH 005/710] Change: Allow all tiles around docks to be docking tiles (#9578) --- src/saveload/afterload.cpp | 8 ++++---- src/saveload/saveload.h | 3 ++- src/station_cmd.cpp | 12 ++---------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index df1b4e44f1..02a221bb60 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3106,14 +3106,14 @@ bool AfterLoadGame() } } - if (IsSavegameVersionBeforeOrAt(SLV_ENDING_YEAR)) { - /* Update station docking tiles. Was only needed for pre-SLV_MULTITLE_DOCKS - * savegames, but a bug in docking tiles touched all savegames between - * SLV_MULTITILE_DOCKS and SLV_ENDING_YEAR. */ + if (IsSavegameVersionBefore(SLV_DOCK_DOCKINGTILES)) { + /* All tiles around docks may be docking tiles. */ for (Station *st : Station::Iterate()) { if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st); } + } + if (IsSavegameVersionBeforeOrAt(SLV_ENDING_YEAR)) { /* Reset roadtype/streetcartype info for non-road bridges. */ for (TileIndex t = 0; t < map_size; t++) { if (IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) != TRANSPORT_ROAD) { diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index bd0613e554..382d77f1a5 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -337,7 +337,8 @@ enum SaveLoadVersion : uint16 { SLV_TABLE_CHUNKS, ///< 295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE. SLV_SCRIPT_INT64, ///< 296 PR#9415 SQInteger is 64bit but was saved as 32bit. - SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 v12 Store travel time in the linkgraph. + SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 v12.0-RC1 Store travel time in the linkgraph. + SLV_DOCK_DOCKINGTILES, ///< 298 PR#9578 v12.0 All tiles around docks may be docking tiles. SL_MAX_VERSION, ///< Highest possible saveload version }; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index ab21d44245..1a188252ce 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2635,23 +2635,15 @@ void ClearDockingTilesCheckingNeighbours(TileIndex tile) /** * Check if a dock tile can be docked from the given direction. * @param t Tile index of dock. - * @param d DiagDirection adjacent to dock being tested. + * @param d DiagDirection adjacent to dock being tested. (unused) * @return True iff the dock can be docked from the given direction. */ bool IsValidDockingDirectionForDock(TileIndex t, DiagDirection d) { assert(IsDockTile(t)); - /** Bitmap of valid directions for each dock tile part. */ - static const uint8 _valid_docking_tile[] = { - 0, 0, 0, 0, // No docking against the slope part. - 1 << DIAGDIR_NE | 1 << DIAGDIR_SW, // Docking permitted at the end - 1 << DIAGDIR_NW | 1 << DIAGDIR_SE, // of the flat piers. - }; - StationGfx gfx = GetStationGfx(t); - assert(gfx < lengthof(_valid_docking_tile)); - return HasBit(_valid_docking_tile[gfx], d); + return gfx >= GFX_DOCK_BASE_WATER_PART; } /** From 7aacb2ed8ea0842310f57739b3550b4ea304da9c Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 26 Sep 2021 18:47:33 +0000 Subject: [PATCH 006/710] Update: Translations from eints japanese: 18 changes by akaregi, 10 changes by clzls slovenian: 17 changes by Matej1245 czech: 33 changes by CzechRepublic98 chinese (simplified): 27 changes by clzls arabic (egypt): 17 changes by AviationGamerX luxembourgish: 99 changes by phreeze83 hungarian: 24 changes by pnpBrumi, 6 changes by baliball serbian: 107 changes by nkrs romanian: 16 changes by kneekoo, 2 changes by ALEX11BR irish: 229 changes by temuchie ukrainian: 113 changes by StepanIvasyn latvian: 8 changes by lexuslatvia lithuanian: 41 changes by devbotas polish: 1 change by yazalo --- src/lang/arabic_egypt.txt | 19 ++- src/lang/czech.txt | 34 ++++- src/lang/hungarian.txt | 34 ++++- src/lang/irish.txt | 243 ++++++++++++++++++++++++++++++-- src/lang/japanese.txt | 32 ++++- src/lang/latvian.txt | 8 ++ src/lang/lithuanian.txt | 43 +++++- src/lang/luxembourgish.txt | 118 +++++++++++++--- src/lang/polish.txt | 2 +- src/lang/romanian.txt | 21 ++- src/lang/serbian.txt | 141 +++++++++++++----- src/lang/simplified_chinese.txt | 33 ++++- src/lang/slovenian.txt | 19 ++- src/lang/ukrainian.txt | 124 ++++++++++++++-- 14 files changed, 768 insertions(+), 103 deletions(-) diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index dc604cb302..35288f9b2e 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -1163,6 +1163,7 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS ::تعطلات +STR_CONFIG_SETTING_CITY_APPROVAL :موقف مجلس المدينة من إعادة هيكلة المنطقة: {STRING} STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :حد ارتفاع الخريطة:{STRING} ###setting-zero-is-special @@ -1335,6 +1336,7 @@ STR_CONFIG_SETTING_SERVICEATHELIPAD :صيانة ال STR_CONFIG_SETTING_LINK_TERRAFORM_TOOLBAR :اربط اداة التضاريس الى اداة السكة /الطرق / اموانئ / المطارات{STRING} STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR :لون الارضية المستخدم للخرائط الصغيرة: {STRING} +STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_HELPTEXT :لون الارضية في الخرائط الصغيرة ###length 3 STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :اخضر STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :اخضر غامق @@ -1559,6 +1561,7 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :مسموح STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :مسموح - نمط مدينة قابل للتعديل ###length 2 +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :تربيعي (أصلي) STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :اضافة الاشجار اثناء اللعب: {STRING} ###length 4 @@ -1597,10 +1600,12 @@ STR_CONFIG_SETTING_LINKGRAPH_INTERVAL_HELPTEXT :الوقت بي ###length 3 +STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :كلما قمت بتعليت هذا بشكل اكثر، كلما ازداد وقت الCPU في حساب الرسم البياني الرابط. إذا استغرق الأمر وقتًا طويلاً فقد تلاحظ تأخير في الاستجبة. إذا قمت بتغيره إلى قيمة منخفضة، فسيكون التوزيع غير دقيق، وقد تلاحظ عدم إرسال البضائع إلى الأماكن التي تتوقع أن تذهب إليها. STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :ضبط هذا إلى أقل من 100٪ يؤدي إلى جعل التوزيع المتماثل يتصرف مثل التوزيع غير المتماثل. سيتم إعادة شحنات أقل غصبا إذا تم إرسال مبلغ معين إلى المحطة. إذا قمت بتعيينه على 0٪ ، فإن التوزيع المتماثل يتصرف تمامًا مثل التوزيع غير المتماثل +STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :وحدات السرعة: {STRING} ###length 4 STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :(متري (كم / ساعة @@ -1643,6 +1648,7 @@ STR_CONFIG_SETTING_AI_NPC :{ORANGE} لاع STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :موجد الطريق- قصاص الطريق - للقطارات:{STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_ROAD_VEHICLES :موجد الطريق (قصاص الأثر) للعربات: {STRING} +STR_CONFIG_SETTING_PATHFINDER_FOR_ROAD_VEHICLES_HELPTEXT :مكتشف المسار لاستخدامه لعربات الطرق STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS :موجد طريق العبور للسفن: {STRING} STR_CONFIG_SETTING_REVERSE_AT_SIGNALS :العكس عند الإشارات: {STRING} ###length 2 @@ -1833,7 +1839,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}غير ###length 3 # Network server list -STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}تعدد اللاعبين +STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}لعب جماعي STR_NETWORK_SERVER_LIST_PLAYER_NAME :{BLACK}أسم اللاعب STR_NETWORK_SERVER_LIST_ENTER_NAME_TOOLTIP :{BLACK}هذا الآسم الذي ستعرف به في اللعبة @@ -1970,11 +1976,13 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}انقط STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}لايمكن تحميل اللعبة المخزنة STR_NETWORK_ERROR_SERVER_START :{WHITE}لايمكن بدء الخادم STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}حدث خطأ في البروتوكول و انقطع الاتصال +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}لم يتم تحديد اسم اللاعب الخاص بك. يمكنك تحديد الاسم في الجزء العلوي من نافذة العب الجماعي STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}نسخة اللاعب غير مطابقة لنسخة الخادم STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}رقم سري خاطئ STR_NETWORK_ERROR_SERVER_FULL :{WHITE}الخادم ممتلئ STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}أنت ممنوع من هذا الخادم STR_NETWORK_ERROR_KICKED :{WHITE}لقد طردت من اللعبة +STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}السبب: {STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}الغش ليس مسموحا به في هذه اللعبة STR_NETWORK_ERROR_TOO_MANY_COMMANDS :{WHITE}أنت تقوم بإرسال العديد من الأوامر للخادم @@ -2332,7 +2340,8 @@ STR_PLANT_TREE_TOOLTIP :{BLACK} اخت STR_TREES_RANDOM_TYPE :{BLACK}شجر عشوائي STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}ضع شجر عشوائي STR_TREES_RANDOM_TREES_BUTTON :{BLACK}زراعة اشجار عشوائيا -STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}زراعة اشجار عشوائيا في المنظر +STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}زراعة اشجار عشوائيا في الأرض +STR_TREES_MODE_NORMAL_TOOLTIP :زراعة شجرات منفصلة بالسحب فوق الارض # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}بناء المسطحات الأرضية @@ -2580,6 +2589,8 @@ STR_MAPGEN_BY :{BLACK}* STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}عدد المدن: STR_MAPGEN_DATE :{BLACK}التاريخ: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}عدد المصانع: +STR_MAPGEN_HEIGHTMAP_HEIGHT_UP :{BLACK}قم بزيادة أقصى ارتفاع لأعلى قمة على الخريطة بواحد +STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}تقليل تغطية الثلوج بنسبة عشرة بالمائة STR_MAPGEN_DESERT_COVERAGE :{BLACK}مدى تغطيت السحراء: STR_MAPGEN_LAND_GENERATOR :{BLACK}مولد الخريطة: STR_MAPGEN_TERRAIN_TYPE :{BLACK} نوع التضاريس @@ -2898,6 +2909,7 @@ STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}اضغط # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY}كتاب القصص +STR_STORY_BOOK_GENERIC_PAGE_ITEM :الصفحة {NUM} # Station list window STR_STATION_LIST_TOOLTIP :{BLACK}اسم المحطة - اضغط على اسم المحطة لتوسيطها في الشاشة. اضغط + كنترول لفتح شاشة عرض جديدة بمنطقة المحطة. @@ -3342,6 +3354,7 @@ STR_ENGINE_PREVIEW_SHIP :سفينة STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK} التكلفة: {CURRENCY_LONG} الوزن: {WEIGHT_SHORT}{} السرعة: {VELOCITY} الطاقة: {POWER}{} كلفة التشغيل: {CURRENCY_LONG} / سنة{} السعة: {CARGO_LONG} STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}التكلفة {CURRENCY_LONG} الوزن {WEIGHT_SHORT}{}السرعة {VELOCITY} Power: {POWER}قوة السحب {6:FORCE}{}التكلفة التشغيلية {4:CURRENCY_LONG}/سنة{}السعة: {5:CARGO_LONG} STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK} التكلفة {CURRENCY_LONG} السرعة القصوى {VELOCITY}{} السعة {CARGO_LONG}{} كلفة التشغيل {CURRENCY_LONG} / سنة +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK} التكلفة: {CURRENCY_LONG} السرعة القصوى: {VELOCITY}{} نوع الطائرة: {STRING} المدى: {COMMA} مربعات{}السعة: {CARGO_LONG}{}كلفة التشغيل: {CURRENCY_LONG}\السنة # Autoreplace window STR_REPLACE_VEHICLES_WHITE :{WHITE}تبديل {STRING} - {STRING} @@ -3441,6 +3454,7 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}متو STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}يتوجة الى {DEPOT} , {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}الصيانة في {DEPOT} , {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}لا يمكن الوصول إلى {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -4665,6 +4679,7 @@ STR_FORMAT_DATE_ISO :{2:NUM}-{1:STRI STR_FORMAT_COMPANY_NUM :شركة {COMMA} STR_FORMAT_GROUP_NAME :مجموعة{COMMA} +STR_FORMAT_GROUP_VEHICLE_NAME :{GROUP} #{COMMA} STR_FORMAT_INDUSTRY_NAME :{TOWN} {STRING} ###length 2 diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 00a82d36ae..d39203e5ed 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -879,6 +879,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * P STR_STATUSBAR_AUTOSAVE :{RED}Automatické ukládání STR_STATUSBAR_SAVING_GAME :{RED}* * HRA SE UKLÁDÁ * * +STR_STATUSBAR_SPECTATOR :{WHITE}(spectator) # News message history STR_MESSAGE_HISTORY :{WHITE}Historie zpráv @@ -1048,7 +1049,7 @@ STR_GAME_OPTIONS_CURRENCY_MYR :Malajsijský Ri STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Vlevo STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Vpravo -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Jména měst +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Názvy měst STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Výběr stylu jmen měst ###length 21 @@ -1087,6 +1088,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :Každých 12 m STR_GAME_OPTIONS_LANGUAGE :{BLACK}Jazyk STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Zvolit jazyk uživatelského rozhraní +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% dokončeno) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Na celou obrazovku STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Zaškrtnutím této volby poběží OpenTTD na celé obrazovce @@ -1100,6 +1102,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Hardwaro STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Zaškrtni, pokud chceš OpenTTD povolit použití hardwarové akcelerace. Změněné nastavení bude aplikováno po restartu hry STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Nastavení vstoupí v platnost pouze po restartu hry +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Velikost rozhraní STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolit velikost prvků uživatelského rozhraní @@ -1247,6 +1250,7 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Nastavení hry STR_CONFIG_SETTING_TYPE_GAME_INGAME :Nastavení hry (uchováno v uložené hře; ovlivní pouze stávající hru) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Nastavení společnosti (uchováno v uložených hrách; ovlivní pouze nové hry) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Nastavení společnosti (uchováno v uložené hře; ovlivní pouze stávající společnost) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Pozor! STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Tato akce resetuje všechna nastavení hry na výchozí hodnoty.{}Jste si jistý, že chcete pokračovat? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Kategorie: @@ -1310,8 +1314,10 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Určuje jak ča STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Výše dotací: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Nastavuje jak moc jsou dotovaná spojení dotována +STR_CONFIG_SETTING_SUBSIDY_DURATION :Doba trvání dotace: {STRING} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Žádné dotace STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Cena výstavby: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Nastav cenu výstavby a nákupu @@ -1639,6 +1645,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Jedno kliknutí STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Jedno kliknutí (okamžitě) ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Povolit STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Emulace pravého tlačítka: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Vybrat metodu emulování stisknutí pravého tlačítka myši @@ -1890,6 +1897,7 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :pouze dokonalej STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :všechna ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Všechny signály STR_CONFIG_SETTING_TOWN_LAYOUT :Rozvržení silnic pro nová města: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Rozložení silniční sítě ve městech @@ -2316,9 +2324,12 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Verze h STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Adresa serveru: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Počáteční datum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Současné datum: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Herní skript: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Chráněno heslem! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER JE OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER JE PLNÝ +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}BYL JSI ZABANOVÁN +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVER JE PŘÍLIŠ STARÝ STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}NESOUHLASÍ VERZE STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NESOUHLASÍ GRAFIKY @@ -2336,6 +2347,7 @@ STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Spustit STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Spustit vlastní server STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Zadej své jméno +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Zadej adresu serveru nebo pozvánkový kód # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Začít novou hru @@ -2345,6 +2357,7 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}Jméno h STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Nastavit heslo STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Svoji hru si můžeš ochránit heslem, když nechceš, aby se ti do ni hlásili jiní lidé +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Viditelnost STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} klient{P "" i ů} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Nejvyšší počet hráčů: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Zvol nejvyšší počet hráčů. Může se jich připojit i méně @@ -2378,22 +2391,35 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Společn # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Seznam hráčů +STR_NETWORK_COMPANY_LIST_SPECTATE :Dívat se # Network client list +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Jméno STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Název serveru, na kterém hrajete STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Upravte název svého serveru STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Název serveru +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Viditelnost +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Pozvánkový kód +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Pozvánkový kód, který mohou ostatní hráči použít k připojení k tomuto serveru. STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Jméno vašeho hráče STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Připojit se a hrát za tuto společnost STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Poslat zprávu tomuto hráči STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Poslat zprávu všem hráčům této firmy +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Nová společnost) +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Tohle jsi ty # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Veřejný +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Vyhodit +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Opravdu chceš vyhodit hráče '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Opravdu chceš zabanovat hráče '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Jste si jisti, že chcete smazat společnost '{COMPANY}'? +STR_NETWORK_ASK_RELAY_NO :{BLACK}Ne STR_NETWORK_SPECTATORS :Pozorovatelé @@ -2433,6 +2459,7 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Síť - STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Nelze nahrát uloženou hru ze serveru STR_NETWORK_ERROR_SERVER_START :{WHITE}Nelze spustit server STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Vznikla chyba v protokolu a naše spojení je přerušeno +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Tvé herní jméno nebylo nastaveno. Jméno může být nastaveno v horní části okna pro více hráčů. STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Revize hry tohoto klienta neodpovídá revizi hry na serveru STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Špatné heslo STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Server je plný @@ -2471,6 +2498,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :neobdrženo ž STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :všeobecný timeout STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :stahování mapy trvalo příliš dlouho STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :zpracování mapy trvalo příliš dlouho +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :neplatné jméno klienta # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2502,7 +2530,9 @@ STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Server u STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server se restartuje...{}Počkejte prosím... STR_NETWORK_MESSAGE_KICKED :*** {STRING} byl vyhozen. Důvod: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Registrace serveru selhala STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Váš server neumožňuje vzdálené připojení +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Ostatní hráči se nebudou moci k tvému serveru připojit # Content downloading window STR_CONTENT_TITLE :{WHITE}Součásti ke stažení @@ -4152,6 +4182,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Míří STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Míří do {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Údržba v {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nelze dosáhnout {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nelze dosáhnout {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index c6d6202a1a..adfc01d823 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -389,6 +389,8 @@ STR_GROUP_BY_NONE :Nincs STR_GROUP_BY_SHARED_ORDERS :Megosztott utasítások # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Utasítások +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Nyisd meg az utasítás nézetet # Tooltips for the main toolbar ###length 31 @@ -1630,8 +1632,12 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dupla kattintá STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Egyszeres kattintás (amikor előtérben van) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Egyszeres kattintás (azonnal) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Közvetítő szolgáltatás használata: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Ha egy szerverhez nem lehet közvetlenül csatlakozni, próbáljon-e közvetítő szolgáltatást használni a csatlakozáshoz. "Soha" esetén ez meg van tiltva, "Kérdezzen rá" esetén használat előtt rá fog kérdezni, "Mindig engedélyezve" esetén pedig kérdés nélkül használni fogja a szolgáltatást, amennyiben szükség van rá. ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Soha +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Kérdezzen rá +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Mindig engedélyezve STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Jobb egérgomb emuláció: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Jobb egérgomb emulálási módszerének kiválasztása @@ -1877,12 +1883,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Automatikusan a STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Az év beállítása, melytől fényjelzők kerülnek alkalmazásra. Azelőtt alakjelzők használatosak (melyek funkciója ugyanaz, csak máshogy néznek ki) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Jelzők típusa átalakításkor: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Jelzőtípusok kiválasztása, melyek között a csere történik Ctrl+kattintással a jelzőépítő eszközzel +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Válaszd ki meg jelzőtípusok közül válassz Ctrl-kattintással egy felépített jelzésen a jelzőépítő eszközzel ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Csak irányjelzők -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Mind +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Mind látható +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Vasúti jelzők mutatása: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Mely jelzők legyenek láthatóak a vasúti jelzők eszköztáron. ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Csak irányjelzők +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Minden jelző STR_CONFIG_SETTING_TOWN_LAYOUT :Új települések úthálózati elrendezése: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Települési úthálózat elrendezése @@ -2336,6 +2346,7 @@ STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Szerver STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Saját szervert indít STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Add meg a neved +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Írd be a szerver címét vagy meghívókódját # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Új játékot kezd @@ -2380,6 +2391,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}A válla # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Online játékosok +STR_NETWORK_COMPANY_LIST_SPECTATE :Csatlakozás a megfigyelőkhöz # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Online játékosok @@ -2401,7 +2413,7 @@ STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}A játé STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Játékos neve STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Adminisztrátori műveletek ehhez a vállalathoz STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Adminisztrátori műveletek ehhez a vállalathoz -STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :Csatlakozz ehhez a vállalathoz +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Csatlakozz ehhez a vállalathoz STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Üzenet küldése ennek a játékosnak STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Üzenet küldése az összes játékosnak ebben a vállalatban STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Üzenet küldése az összes megfigyelőnek @@ -2418,6 +2430,7 @@ STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Helyi STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Távoli játékosok nem tudnak csatlakozni STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Nyilvános STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}NAT mögött +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Közvetítőn keresztül STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Kirúgás STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Tiltás @@ -2430,6 +2443,11 @@ STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Biztos STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Biztos ki akarod törölni a '{COMPANY}' vállalatot? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Biztos vissza akarod állítani a '{COMPANY}' vállalat jelszavát? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Közvetítő használata +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Nem sikerült csatalkozni a '{STRING}' szerverhez.{}Szeretnél igénybe venni közvetítő szolgáltatást a következőn keresztül? '{STRING}' +STR_NETWORK_ASK_RELAY_NO :{BLACK}Nem +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Igen, most az egyszer +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Igen, ne kérdezd újra STR_NETWORK_SPECTATORS :Megfigyelők @@ -2442,7 +2460,7 @@ STR_COMPANY_PASSWORD_MAKE_DEFAULT_TOOLTIP :{BLACK}Ez a jel # Network company info join/password STR_COMPANY_VIEW_JOIN :{BLACK}Csatlakozás -STR_COMPANY_VIEW_JOIN_TOOLTIP :{BLACK}Csatlakozz és vezetsd a vállalatot +STR_COMPANY_VIEW_JOIN_TOOLTIP :{BLACK}Csatlakozz és vezesd a vállalatot STR_COMPANY_VIEW_PASSWORD :{BLACK}Jelszó STR_COMPANY_VIEW_PASSWORD_TOOLTIP :{BLACK}Védd le a vállalatodat jelszóval ha nem akarod hogy mások csatlakozzanak hozzá STR_COMPANY_VIEW_SET_PASSWORD :{BLACK}Vállalati jelszó beállítása @@ -2458,6 +2476,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Csapat] {STRIN STR_NETWORK_CHAT_CLIENT :[Privát] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privát] {STRING} számára: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Mindenkinek] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Add meg a hálózati beszélgetéshez a neved # Network messages @@ -2541,7 +2560,10 @@ STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}A szerve STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}A szerver újraindul...{}Türelem... STR_NETWORK_MESSAGE_KICKED :*** {STRING} ki lett rúgva. Oka: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}A szerver regisztrációja sikertelen STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Egy másik szerver már regisztrált ugyanezzel a meghívókóddal. Átváltás a "helyi" kapcsolati módra. +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}A szerveredhez nem lehet távolról csatlakozni +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Más játékosok nem fognak tudni csatlakozni a szerveredhez # Content downloading window STR_CONTENT_TITLE :{WHITE}Tartalom letöltés @@ -4185,6 +4207,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Útban STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Útban {DEPOT} felé, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Javítás {DEPOT}ban, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nem elérhető {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Nem elérhető {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nem elérhető {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nem elérhető {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 1fc0e98720..961d87cf9f 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -170,6 +170,7 @@ STR_LITERS :{COMMA}{NBSP}l STR_ITEMS :{COMMA}{NBSP}{P m mh m m m}ír STR_CRATES :{COMMA}{NBSP}{P ch ch ch gc c}ráta +STR_COLOUR_DEFAULT :Réamhshocraithe ###length 17 STR_COLOUR_DARK_BLUE :Gorm Dorcha STR_COLOUR_PALE_GREEN :Liathuaine @@ -233,6 +234,7 @@ STR_TOOLTIP_SORT_ORDER :{BLACK}Roghnaig STR_TOOLTIP_SORT_CRITERIA :{BLACK}Roghnaigh critéir sórtála STR_TOOLTIP_FILTER_CRITERIA :{BLACK}Roghnaigh critéir scagtha STR_BUTTON_SORT_BY :{BLACK}Sórtáil de réir +STR_BUTTON_CATCHMENT :{BLACK}Clúdach STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Dún an fhuinneog STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Teideal fuinneoige - tarraing é seo chun fuinneog a bhogadh @@ -263,6 +265,7 @@ STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT_TOOLTIP :{BLACK}Ach an c STR_BUTTON_DEFAULT :{BLACK}Réamhshocrú STR_BUTTON_CANCEL :{BLACK}Cuir ar ceal STR_BUTTON_OK :{BLACK}OK +STR_WARNING_PASSWORD_SECURITY :{YELLOW}Rabhadh: D'fhéadfadh sé go mbeidh riarthóirí an fhreastalaí in ann aon téacs a chuirtear isteach anseo a léamh # On screen keyboard window STR_OSK_KEYBOARD_LAYOUT :`1234567890-=\qwertyuiop[]asdfghjkl;' zxcvbnm,./ . @@ -311,12 +314,19 @@ STR_SORT_BY_CARGO_CAPACITY :Méid an Lastai STR_SORT_BY_RANGE :Raon STR_SORT_BY_POPULATION :Daonra STR_SORT_BY_RATING :Rátáil +STR_SORT_BY_NUM_VEHICLES :Líon na bhfeithiclí STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Brabús iomlán anuraidh +STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Brabús iomlán i mbliana +STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Meán-bhrabús anuraidh +STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Meáb-bhrabús i mbliana # Group by options for vehicle list STR_GROUP_BY_NONE :Rud ar bith +STR_GROUP_BY_SHARED_ORDERS :Orduithe comhroinnte # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Orduithe +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Oscail amharc na n-orduite # Tooltips for the main toolbar ###length 31 @@ -343,6 +353,7 @@ STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN :{BLACK}Zúmáil STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT :{BLACK}Zúmáil amach STR_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Tóg iarnród STR_TOOLBAR_TOOLTIP_BUILD_ROADS :{BLACK}Tóg bóithre +STR_TOOLBAR_TOOLTIP_BUILD_TRAMWAYS :{BLACK}Tóg trambhealaí STR_TOOLBAR_TOOLTIP_BUILD_SHIP_DOCKS :{BLACK}Tóg duganna STR_TOOLBAR_TOOLTIP_BUILD_AIRPORTS :{BLACK}Tóg aerfoirt STR_TOOLBAR_TOOLTIP_LANDSCAPING :{BLACK}Oscail an barra uirlisí tírdhreacha chun talamh a ardú/ísliú, crainnte a chur, srl. @@ -474,6 +485,7 @@ STR_TOOLBAR_SOUND_MUSIC :Fuaim/ceol ###length 3 STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Teachtaireacht/tuairisc nuachta deiridh STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Stair na dteachtaireachtaí +STR_NEWS_MENU_DELETE_ALL_MESSAGES :Scrios gach teachtaireacht # About menu ###length 10 @@ -676,11 +688,14 @@ STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE :{BLACK}Scorána STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION :{BLACK}Taispeáin an fhuinneogh chun rianta ceoil a roghnú # Playlist window +STR_PLAYLIST_MUSIC_SELECTION_SETNAME :{WHITE}An Clár Ceoil - '{STRING}' STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTBLUE}{ZEROFILL_NUM} "{STRING}" STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Innéacs na Rianta STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Clár - '{STRING}' STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Glan +STR_PLAYLIST_CHANGE_SET :{BLACK}Tacar athruithe STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}Glan an clár reatha (Saincheaptha1 nó Saincheaptha2 amháin) +STR_PLAYLIST_TOOLTIP_CHANGE_SET :{BLACK}Athraigh an rogha cheoil chuig tacar eile atá suiteáilte STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Cliceáil ar rian ceoil chun é a chur leis an gclár reatha (Saincheaptha1 nó Saincheaptha2 amháin) STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Cliceáil ar rian ceoil chun é a bhaint ón gclár reatha (Saincheaptha1 nó Sainche @@ -778,6 +793,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * A STR_STATUSBAR_AUTOSAVE :{RED}UATHSHÁBHÁIL STR_STATUSBAR_SAVING_GAME :{RED}* * CLUICHE Á SHÁBHÁIL * * +STR_STATUSBAR_SPECTATOR :{WHITE}(ag féachaint) # News message history STR_MESSAGE_HISTORY :{WHITE}Stair na dteachtaireachtaí @@ -798,7 +814,7 @@ STR_NEWS_FIRST_AIRCRAFT_ARRIVAL :{BIG_FONT}{BLAC STR_NEWS_TRAIN_CRASH :{BIG_FONT}{BLACK}Tubaiste Traenach!{}Maraítear {COMMA} i liathróid tine tar éis imbhuailte STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Tubaiste Feithicle Bóthair!{}Maraítear an tiománaí i liathróid tine tar éis imbhuailte STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLACK}Tubaiste Feithicle Bóthair!{}Maraítear {COMMA} i liathróid tine tar éis imbhuailte -STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLACK}Tuaiste Eitleáin!{}Maraítear {COMMA} i liathróid tine ag {STATION} +STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLACK}Tubaiste Eitleáin!{}Maraítear {COMMA} i liathróid tine ag {STATION} STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}Timpiste Eitleáin!{}Rith an t-aerártha amach as breosla, maraítear {COMMA} i liathróid tine STR_NEWS_DISASTER_ZEPPELIN :{BIG_FONT}{BLACK}Tubaiste Seipilín ag {STATION}! @@ -821,6 +837,7 @@ STR_NEWS_MERGER_TAKEOVER_TITLE :{BIG_FONT}{BLAC STR_PRESIDENT_NAME_MANAGER :{BLACK}{PRESIDENT_NAME}{}(Bainisteoir) STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}Rinne {STRING} urraíocht chun baile nua a thógáil, {TOWN}! +STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}Tógadh baile nua darb ainm {TOWN}! STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLACK}{STRING} nua á thógáil in aice le {TOWN}! STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}{STRING} nua á chur in aice le {TOWN}! @@ -879,7 +896,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}Glacann STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Fóirdheontas a tairiscíodh imithe as dáta:{}{}Ní thabharfar fóirdheontas ar {STRING} ó {STRING} go {STRING} anois. STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Fóirdheontas tarraingte siar:{}{}Ní thabharfar fóirdheontas ar sheirbhís {STRING} ó {STRING} go {STRING} a thuilleadh. +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Déantar fóirdheontas seirbhíse a thairiscint:{}{}Tabharfaidh an t-údarás aitiúil fóirdheontas don chéad seirbhís {STRING} ó {STRING} go {STRING} ar feadh {NUM} {P "bhliain amháin" "bhliain" "bliana" "mbliana" "bliain" }! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Bronnadh fóirdheontas seirbhíse ar {STRING}!{}{}Tabharfar 50% breise don tseirbhís {STRING} ó {STRING} go {STRING} ar feadh {NUM} {P "bhliain amháin" "bhliain eile" "bliana eile" "mbliana eile" "bliain eile"}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Bronnadh fóirdheontas seirbhíse ar {STRING}!{}{}Íocfar rátaí dúbailte ar feadh bliana don tseirbhís {STRING} ó {STRING} go {STRING} as seo go ceann {NUM} {P "bhliain amháin" "bhliain" "bliana" "mbliana" "bliain"}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Bronnadh fóirdheontas seirbhíse ar {STRING}!{}{}Íocfar rátaí trí oiread níos mó don tseirbhís {STRING} ó {STRING} go {STRING} ar feadh {NUM} {P "bhliain amháin" "bhliain" "bliana" "mbliana" "bliain" } eile! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Bronnadh fóirdheontas seirbhíse ar {STRING}!{}{}Íocfar rátaí ceithre oiread níos mó don tseirbhís {STRING} ó {STRING} go {STRING} ar feadh {NUM} {P "bhliain amháin" "bhliain" "bliana" "mbliana" "bliain" } eile! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Anord tráchta in {TOWN}!{}{}Beidh 6 mhí de chrá croí do thiománaithe de bharr clár atógáil bóithre arna maoiniú ag {STRING}! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Monaplacht ar iompar! @@ -934,14 +956,18 @@ STR_GAME_OPTIONS_CURRENCY_GEL :Lari na Seoirsi STR_GAME_OPTIONS_CURRENCY_IRR :Rial na hIaráine (IRR) STR_GAME_OPTIONS_CURRENCY_RUB :Rúbal Nua na Rúise (RUB) STR_GAME_OPTIONS_CURRENCY_MXN :Peso Mheicsiceo (MXN) +STR_GAME_OPTIONS_CURRENCY_NTD :Dollar Nua na Téaváine (NTD) STR_GAME_OPTIONS_CURRENCY_CNY :Renminbi na Síne (CNY) STR_GAME_OPTIONS_CURRENCY_HKD :Dollar Hong Cong (HKD) +STR_GAME_OPTIONS_CURRENCY_INR :Rúipí na hIndia (INR) +STR_GAME_OPTIONS_CURRENCY_IDR :Rupiah na hIndinéise (IDR) +STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit na Malaeisia (MYR) ###length 2 STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Tiomáin ar chlé STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Tiomáin ar dheis -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Ainmneacha na mbailte +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Ainmneacha na mbailte: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Roghnaigh stíl d'ainmneacha na mbailte ###length 21 @@ -988,22 +1014,37 @@ STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Cuir tic STR_GAME_OPTIONS_RESOLUTION :{BLACK}Taifeach scáileáin STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Roghnaigh an taifeach scáileáin le húsáid STR_GAME_OPTIONS_RESOLUTION_OTHER :eile +STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} +STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Luasghéarú crua-earraí +STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Cuir tic sa bhosca seo chun cead a thabhairt do OpenTTD iarracht a dhéanamh luasghéarú crua-earraí a úsáid. Má athraítear an socrú seo, ní chuirfear i bhfeidhm é ach tar éis an cluiche a atosú. +STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Ní chuirfear an socrú i bhfeidhm go dtí go ndéanfar an cluiche a atosú +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Cuir tic sa bhosca seo chun v-shioncronú (v-sync) a úsáid ar an scáileán. Má athraítear an socrú seo, ní chuirfear i bhfeidhm é ach tar éis an cluiche a atosú. Ní oibríonn seo ach amháin má tá luasghéarú crua-earraí cumasaithe STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Méid an chomhéadain STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Roghnaigh méid na heiliminte comhéadain a úsáidfear +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(uath-aimsiú) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Gnáth STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Méid dúbailte STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Méid cheathrúil +STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Méid na clófhoirne +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Roghnaigh méid na clófhoirne don chomhéadan a úsáidfear +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(uath-aimsiú) STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Gnáthmhéid STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Méid dúbailte +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :4x +STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafaicí +STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Ráta athnuachana na taispeána +STR_GAME_OPTIONS_REFRESH_RATE_TOOLTIP :{BLACK}Roghnaigh ráta athnuachana an scáileán atá le húsáid STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{NUM}Hz +STR_GAME_OPTIONS_REFRESH_RATE_WARNING :{WHITE}D'fhéadfadh rátaí athnuacha os cionn 60Hz tionchar a bheith acu ar an bhfeidhmíocht. STR_GAME_OPTIONS_BASE_GRF :{BLACK}Sraith graifice bunaidh STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Roghnaigh an sraith grafaice bunaidh le húsáid @@ -1105,6 +1146,7 @@ STR_TERRAIN_TYPE_FLAT :Réidh STR_TERRAIN_TYPE_HILLY :Cnocach STR_TERRAIN_TYPE_MOUNTAINOUS :Sléibhtiúil STR_TERRAIN_TYPE_ALPINIST :Ailpíneach +STR_TERRAIN_TYPE_CUSTOM :Airde shaincheaptha ###length 3 STR_CITY_APPROVAL_PERMISSIVE :Tugtar cead @@ -1118,6 +1160,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Socruith STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Teaghrán scagtha: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Fairsingigh gach ceann STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Leacaigh gach ceann +STR_CONFIG_SETTING_RESET_ALL :{BLACK}Athshocraigh gach luach STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(níl aon mhíniú ar fáil) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Luach réamhshocraithe: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Cineál socrú: {ORANGE}{STRING} @@ -1126,6 +1169,7 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Socrú cluiche STR_CONFIG_SETTING_TYPE_GAME_INGAME :Socrú cluiche (stóráilte i gcluiche sábháilte; tionchar ar an gcluiche reatha amháin) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Socrú cuideachta (stóráilte i gcluiche sábháilte; tionchar ar chluichí nua amháin) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Socrú cuideachta (stóráilte i gcluiche sábháilte; tionchar ar an gcuideachta reatha amháin) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Rabhadh! STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Catagóir: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Cineál: @@ -1191,7 +1235,9 @@ STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Socraigh an mé STR_CONFIG_SETTING_SUBSIDY_DURATION :Fad na bhfóirdheontas: {STRING} STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Socraigh líon na mblianta a bhronnfar fóirdheontas ina leith +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} {P "bliain amháin" "bhliain" "bliana" "mbliana" "bliain"} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Gan fóirdheontas STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Costais tógála: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Socraigh leibhéal na gcostas tógála agus ceannaigh @@ -1208,9 +1254,11 @@ STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Cuir tubaistí, STR_CONFIG_SETTING_CITY_APPROVAL :Dearcadh chomhairle an bhaile i leith athstruchtúrú limistéir: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Roghnaigh a mhéid a mbeidh tionchar ag torann agus damáiste don chomhshaol a dhéanann cuideachtaí ar a rátáil sa bhaile agus ar imeachtaí tógála eile sa cheantar +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :Teorainn uasta na léarscáile: {STRING} STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE :{NUM} ###setting-zero-is-special -STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}Ní féidir leat airde uasta na léarscáile a shocrú ag an luach seo. Tá sliabh amháin ar a laghad ar an léarscáil níos airde +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_AUTO :(uath-theorainn) +STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}Ní féidir leat teorainn airde na léarscáile a shocrú ag an luach seo. Tá sliabh amháin ar a laghad ar an léarscáil níos airde STR_CONFIG_SETTING_AUTOSLOPE :Ceadaigh athrú talún faoi fhoirgnimh, ráillí iarnróid srl.: {STRING} STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Ceadaigh tírdhreachú faoi fhoirgneamh agus ráillí gan iad a bhaint @@ -1388,6 +1436,7 @@ STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Taispeáin daon STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Tiús na línte sna graif: {STRING} STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Leithead na líne sna graif. Is féidir líne thanaí a léamh go beacht, agus tá líne níos tiubhe níos éasca le feiceáil agus tá sé níos éasca na dathanna a idirdhealú óna gcéile +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Taispeáin ainm an NewGRF i bhfuinneog tógála na bhfeithiclí: {STRING} STR_CONFIG_SETTING_LANDSCAPE :Tírdhreach: {STRING} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Sonraíonn na tírdhreacha an cúlra bunúsach don imirt, le lastais éagsúla agus riachtanais éagsúla d'fhás na mbailte. Is féidir é sin a mhionathrú tuilleadh le NewGRFanna agus Scripteanna Cluiche mar sin féin @@ -1408,10 +1457,12 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Uasfhad ón tao STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Ní thógtar scaglanna ola ach in aice le teorainn na léarscáile, sé sin ag an gcósta i gcás léarscáileanna ar oileán iad STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Airde na líne sneachta: {STRING} -STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Rialaigh an leibhéal ar a dtosaíonn sneachta ar thírdhreach fo-artach. Bíonn tionchar ag sneachta freisin ar ghiniúint tionscail agus riachtanais bailte ó thaobh fáis de +STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Rialaigh an leibhéal ar a dtosaíonn sneachta ar thírdhreach fo-artach. Bíonn tionchar ag sneachta freisin ar ghiniúint tionscail agus riachtanais bailte ó thaobh fáis de. Ní féidir é a athrú ach in Eagarthóir na Scéalta nó murach sin déantar é a ríomh le "clúdach sneachta" +STR_CONFIG_SETTING_SNOW_COVERAGE :Clúdach sneachta: {STRING} STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% +STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Chomh garbh agus atá an tír-raon: {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(TerraGenesis amháin) Roghnaigh minicíocht na gcnoc: Tá níos lú cnoic ag tírdhreacha míne, agus iad níos scaipthe amach. Bíonn go leor cnoic ar thírdhreacha garbha, agus d'fhéadfadh an chuma a bheith air go bhfuil an tírdhreach ar fad mar a chéile @@ -1464,7 +1515,12 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Ciaruaine STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Corcairghorm STR_CONFIG_SETTING_SCROLLMODE :An cineál scrollála san fhuinneog amhairc: {STRING} +STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT :An rud a dhéantar agus an léarscáil á scrollú ###length 4 +STR_CONFIG_SETTING_SCROLLMODE_DEFAULT :Bog an léarscáil le cnaipe deas na luchóige, suíomh na luchóige faoi ghlas +STR_CONFIG_SETTING_SCROLLMODE_RMB_LOCKED :Bog an léarscáil le cnaipe deas na luchóige, suíomh na luchóige faoi ghlas +STR_CONFIG_SETTING_SCROLLMODE_RMB :Bog an léarscáil le cnaipe deas na luchóige +STR_CONFIG_SETTING_SCROLLMODE_LMB :Bog an léarscáil le cnaipe clé na luchóige STR_CONFIG_SETTING_SMOOTH_SCROLLING :Scrollú mín do na fuinneoga amhairc: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Roghnaigh an chaoi a scrollóidh an príomhamharc chuig suíomh ar leith má chliceálann tú ar an léarscáil bheag nó má thugann tú ordú scrollú chuig oibiacht ar leith ar an léarscáil. Má tá sé cumasaithe, scrollóidh an fhuinneog amhairc go mín, má tá sé díchumasaithe léimfidh sé go díreach chuig an suíomh sin. @@ -1500,7 +1556,9 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Cliceáil dhúb STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Cliceáil amháin (agus fócas aige) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Cliceáil amháin (láithreach) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Úsáid seirbhís athsheachadta: {STRING} ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Ná húsáid riamh STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Iarr STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Ceadaigh @@ -1511,6 +1569,8 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_COMMAND :Ordú+Cliceáil STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL :Ctrl+Cliceáil STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :As +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Dún an fhuinneog le deas-chliceáil: {STRING} +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Dúntar fuinneog trí dheas-chliceáil laistigh de. Díchumasaítear leis seo na leideanna uirlise deas-cliceála! STR_CONFIG_SETTING_AUTOSAVE :Uathshábháil: {STRING} STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Roghnaigh an t-eatramh idir uathshábhálacha cluichí @@ -1568,6 +1628,7 @@ STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :Bain comhartha STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% de ghnáthluas an chluiche ###setting-zero-is-special +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Gan teorainn (chomh tapa agus a ligeann do ríomhaire duit é) STR_CONFIG_SETTING_SOUND_TICKER :Ticear nuachta: {STRING} STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Seinn fuaim do na teachtaireachtaí nuachta achomair @@ -1629,6 +1690,8 @@ STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :Ceadaigh do rí STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :tá #opcodes roimh scripteanna curtha ar fionraí: {STRING} STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES_HELPTEXT :Uaslíon na gcéimeanna ríofa is féidir le script a dhéanamh in aon chasadh amháin +STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY :Úsáid uasta cuimhne in aghaidh na scripte: {STRING} +STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :Eatraimh seirbhísithe i gcéatadán: {STRING} STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Roghnaigh an ndéanfar seirbhísiú feithiclí bunaithe ar an am atá imithe thart ón seirbhísiú deireanach nó bunaithe ar iontaofacht a bheith tite céatadán áirithe ón iontaofacht uasta @@ -1707,11 +1770,14 @@ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Bíonn nuacht d STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :An bhliain a thosaítear ar fhógraí nuachtáin daite a chlóbhualadh. Roimh an bhliain sin, úsáidtear dubh/bán monacrómach STR_CONFIG_SETTING_STARTING_YEAR :Bliain tosaigh: {STRING} +STR_CONFIG_SETTING_ENDING_YEAR :Bliain deiridh na scórála: {STRING} STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Riamh +STR_CONFIG_SETTING_ECONOMY_TYPE :Cineál geilleagair: {STRING} ###length 3 +STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Bunaidh STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Mín STR_CONFIG_SETTING_ALLOW_SHARES :Ceadaigh scaireanna a cheannach ó chuideachtaí eile: {STRING} @@ -1739,6 +1805,7 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Gach ceann infh STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Taispeáin cineálacha comharthaí: {STRING} STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Roghnaigh cad iad na cineálacha comharthaí a thaispeánfar i mbarra uirlisí na gcomharthaí ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Comharthaí cosán amháin STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Gach comhartha STR_CONFIG_SETTING_TOWN_LAYOUT :Leagan amach na mbóithre do bhailte nua: {STRING} @@ -1766,13 +1833,18 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :ceadaithe STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :ceadaithe, leagan amach bailte saincheaptha STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Giniúint lastais na mbailte: {STRING} +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :An méid lastais a chruthaíonn tithe sna bailte, i gcomparáid le daonra iomlán an bhaile.{}Fás cearnach: Cruthaíonn baile atá dhá oiread níos mó ceithre oiread líon na bpaisinéirí.{}Fás líneach: Cruthaíonn baile atá dhá oiread níos mó dhá oiread líon na bpaisinéirí. ###length 2 +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Cearnach (bunaidh) +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Líneach STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Áit a chuirtear crainnte sa chluiche: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Rialaigh an áit a gcuirfear na crainn go fánach i rith an chluiche. D'fhéadfadh tionchar a bheith aige seo ar thionscail a bhíonn ag brath ar fhás na gcrann, muilte adhmaid mar shampla ###length 4 STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Fás ach ná leathnaigh amach {RED}(bristear an muileann adhmaid) STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Fás agus ná leathnaigh amach ach i bhforaoisí báistí +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Fás agus leathnaigh gach áit +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_GROWTH_NO_SPREAD :Ná fás, ná leathnaigh amach {RED}(bristear an muileann adhmaid) STR_CONFIG_SETTING_TOOLBAR_POS :Suíomh an phríomhbharra uirlisí: {STRING} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Suíomh cothrománach an phríomhbharra uirlise ag barr an scáileáin @@ -1802,6 +1874,7 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x ###length 3 +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_NORMAL :1x @@ -1955,6 +2028,7 @@ STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}Teipeadh # Video initalization errors STR_VIDEO_DRIVER_ERROR :{WHITE}Earráid leis na socruithe físeáin... +STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... níor aimsaíodh GPU comhoiriúnach. Luasghéarú cura-earraí díchumasaithe # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -2029,6 +2103,7 @@ STR_CHEAT_SWITCH_CLIMATE_SUB_TROPICAL_LANDSCAPE :Tírdhreach fo- STR_CHEAT_SWITCH_CLIMATE_TOYLAND_LANDSCAPE :Tírdhreach thír na mbréagán # Livery window +STR_LIVERY_CAPTION :{WHITE}{COMPANY} - Scéim Dathanna STR_LIVERY_GENERAL_TOOLTIP :{BLACK}Taispeáin scéimeanna dathanna ginearálta STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Taispeáin scéimeanna dathanna na dtraenacha @@ -2125,6 +2200,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Athraigh # Matches ServerGameType ###length 3 STR_NETWORK_SERVER_VISIBILITY_LOCAL :Logánta +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Poiblí # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Ilimreoirí @@ -2157,9 +2233,11 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Leagan STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Seoladh an fhreastalaí: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Dáta tosaigh: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Dáta reatha: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script Cluiche: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Faoi chosaint ag pasfhocal! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}FREASTALAÍ AS LÍNE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}FREASTALAÍ LÁN +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}CUIREADH COSC ORT ÓN bhFREASTALAÍ STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}FREASTALAÍ RÓSHEAN STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}MÍMHEAITSEÁIL LEAGAIN STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}MÍMHEAITSEÁIL NEWGRF @@ -2169,13 +2247,16 @@ STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}Athnuaig STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}Athnuaigh faisnéis an fhreastalaí STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET :{BLACK}Cuardaigh ar an Idirlíon +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Cuardaigh ar an idirlíon le haghaidh freastalaithe poiblí STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Cuardaigh LAN +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Cuardaigh ar an líonra achair logánta le haghaidh freastalaithe STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Cuir freastalaí leis STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Cuirtear freastalaí leis an liosta a sheiceálfar i gcónaí le haghaidh cluichí ar rith. STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Tosaigh freastalaí STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Tosaigh d'fhreastalaí féin STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Iontráil d'ainm +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Iontráil seoladh an fhreastalaí nó cód an chuiridh # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Tosaigh cluiche ilimreora nua @@ -2186,6 +2267,7 @@ STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Socraigh STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Cosain do chluiche le pasfhocal más mian leat nach mbeidh rochtain phoiblí air STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Infheictheacht +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Cibé an féidir nó nach féidir le daoine eile d'fhreastalaí a fheiceáil sa liosta poiblí STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} {P ch ch ch gc c}lia{P "" "" "" "" i}nt STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Cliaint uasta: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Roghnaigh uaslíon na gcliant. Ní gá gach áit a líonadh @@ -2219,16 +2301,35 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Tá an c # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Liosta na gcliant +STR_NETWORK_COMPANY_LIST_SPECTATE :Féach air # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Imreoirí Ar Líne +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Freastalaí STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Ainm +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Ainm an fhreastalaí ar an bhfuil tú ag imirt +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Ainm an fhreastalaí +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Infheictheacht +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Cibé an féidir nó nach féidir le daoine eile d'fhreastalaí a fheiceáil sa liosta poiblí +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Cód an chuiridh +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Cód an chuiridh a mbeidh imreoirí eile in ann é a úsáid le dul isteach sa fhreastalaí seo +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}An cineál naisc +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}An féidir le daoine eile teacht ar d'fhreastalaí, agus an chaoi le sin a dhéanamh +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Imreoir +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Ainm STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}D'ainm imreora STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}D'ainm imreora a chur in eagar +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :D'ainm imreora +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Na bearta riaracháin atá le déanamh don chliant seo STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Bearta riaracháin is féidir a dhéanamh don chuideachta seo STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Téigh isteach sa chuideachta seo STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Teachtaireacht a sheoladh chuig an imreoir seo +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Seol teachtaireacht chuig gach duine sa lucht féachana STR_NETWORK_CLIENT_LIST_SPECTATORS :Lucht féachana +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Cuideachta nua) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Cruthaigh cuideachta nua agus téigh isteach ann STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Seo tusa +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Is é seo óstach an chluiche STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P ch ch ch gc c}liant / {NUM} {P ch ch ch gc c}uideachta # Matches ConnectionType @@ -2236,14 +2337,20 @@ STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Ní féidir le himreoirí cianda nascadh STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Poiblí STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Taobh thiar de NAT +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Trí athsheachadadh +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Ciceáil STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Cuir cosc air STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Scrios +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Díghlasáil le pasfhocal STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}An bhfuil tú cinnte gur mhaith leat an t-imreoir '{STRING}' a chiceáil? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}An bhfuil tú cinnte gur mhaith leat an chuideachta '{COMPANY}' a scriosadh? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}An bhfuil tú cinnte gur mhaith leat pasfhocal na cuideachta '{COMPANY}' a athshocrú? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Níorbh fhéidir nasc a bhunú idir tú féin agus an freastaláí '{STRING}'.{}Ar mhaith leat an seisiún seo a athsheachadadh trí '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Níl +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Tá, an uair seo STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Tá, ná fiafraigh díom arís STR_NETWORK_SPECTATORS :Féachadóirí @@ -2273,6 +2380,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Foireann] Chui STR_NETWORK_CHAT_CLIENT :[Príobháideach] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Príobháideach] Chuig {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Gach duine] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Iontráil téacs don chomhrá líonra # Network messages @@ -2284,17 +2392,21 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Caillead STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Níorbh fhéidir cluiche sábháilte a lódáil STR_NETWORK_ERROR_SERVER_START :{WHITE}Níorbh fhéidir an freastalaí a thosú STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Aimsíodh earráid prótacail agus dúnadh an nasc +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Níor socraíodh d'ainm imreora. Is féidir an t-ainm a shocrú ag barr na fuinneoige Ilimreoirí +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Níor socraíodh ainm d'fhreastalaí. Is féidir an t-ainm a shocrú ag barr na fuinneoige Ilimreoirí STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Ní hionann leasú an chliaint seo agus leasú an fhreastalaí STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Pasfhocal mícheart STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Tá an freastalaí lán STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Tá cosc ort ón bhfreastalaí seo STR_NETWORK_ERROR_KICKED :{WHITE}Ciceáladh amach as an gcluiche thú +STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}An chúis: {STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}Ní cheadaítear caimiléireacht ar an bhfreastalaí seo STR_NETWORK_ERROR_TOO_MANY_COMMANDS :{WHITE}Bhí tú ag seoladh an iomarca orduithe chuig an bhfreastalaí STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Thóg tú an iomarca ama an pasfhocal a chur isteach STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Tá do ríomhaire rómhall le coinneáil suas leis an bhfreastalaí STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}Thóg do ríomhaire rófhada chun an léarscáil a íoslódáil STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Thóg do ríomhaire rófhada chun dul isteach sa fhreastalaí +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Níl d'ainm imreora bailí STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Seans gur cailleadh an nasc STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}Le {NUM} {P sh sh s s s} ní bhfuarthas aon sonraí ón bhfreastalaí @@ -2320,6 +2432,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :ní bhfuarthas STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :am istigh ginearálta STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :thóg sé rófhada chun an léarscáil a íoslódáil STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :thóg sé rófhada chun an léarscáil a phróiseáil +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :ainm an chliaint neamhbhailí # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2349,7 +2462,11 @@ STR_NETWORK_MESSAGE_NAME_CHANGE :*** D'athraigh STR_NETWORK_MESSAGE_GIVE_MONEY :*** Thug {STRING} {2:CURRENCY_LONG} do {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Dhún an freastalaí an seisiún STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Tá an freastalaí á atosú...{}Fan go fóill... +STR_NETWORK_MESSAGE_KICKED :*** Ciceáladh {STRING}. An chúis: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Níorbh fhéidir an freastalaí a chlárú +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Ní cheadaíonn d'fhreastalaí naisc chianda +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Ní bheidh imreoirí eile in ann nascadh le d'fhreastalaí # Content downloading window STR_CONTENT_TITLE :{WHITE}Inneachar á íoslódáil @@ -2427,6 +2544,7 @@ STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Tugann, STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Ní thugann, scoir de OpenTTD STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Theip ar an íoslódáil +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Téigh amach as OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Roghanna Trédhearcachta @@ -2470,6 +2588,7 @@ STR_JOIN_WAYPOINT_CAPTION :{WHITE}Ceangail STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT :{YELLOW}Tóg pointe bealaigh ar leithligh # Generic toolbar +STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE :{BLACK}Díchumasaithe toisc nach bhfuil aon fheithicil ar fáil faoi láthair don bhonneagar seo # Rail construction toolbar STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION :Tógáil Iarnróid @@ -2573,6 +2692,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL :{BLACK}Tóg tol STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Tóg tollán trambhealaigh STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD :{BLACK}Athraigh idir tógáil/baint agus bóithre á dtógáil STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}Athraigh idir tógáil/baint agus trambhealaí á dtógáil +STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD :{BLACK}Tiontaigh/Uasghrádaigh an cineál bóthair. Le Shift is féidir athrú idir bheith ag tógáil agus an costas measta a thaispeáint STR_ROAD_NAME_ROAD :Bóthar STR_ROAD_NAME_TRAM :Trambhealach @@ -2603,7 +2723,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Tóg dug STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Cuir síos baoi is féidir a úsáid mar phointe bealaigh STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Tóg uiscerian STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Sainigh limistéar uisce.{}Déan canáil, ach amháin má dhéantar Ctrl a choinneáil síos ag leibhéal na farraige. Sa chás sin, déanfar tuilleadh mórthimpeall ina áit -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Cuir síos aibhneacha. +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Cuir síos aibhneacha. Le Ctrl roghnaítear an limistéar ar fiar # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Treosuíomh an Iosta Long @@ -2663,7 +2783,12 @@ STR_TREES_RANDOM_TYPE :{BLACK}Crainnte STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}Cuir crainnte de chineálacha randamacha STR_TREES_RANDOM_TREES_BUTTON :{BLACK}Crainnte Randamacha STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}Cuir crainnte go randamacha ar an tírdhreach +STR_TREES_MODE_NORMAL_BUTTON :{BLACK}Mar is gnáth STR_TREES_MODE_NORMAL_TOOLTIP :{BLACK}Crainnte aonair a chur tríd an cursóir a tharraingt thar an tírdhreach. +STR_TREES_MODE_FOREST_SM_BUTTON :{BLACK}Garrán +STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}Foraisí beaga a chur tríd an cursóir a tharraingt thar an tírdhreach. +STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}Foraois +STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Foraisí móra a chur tríd an cursóir a tharraingt thar an tírdhreach. # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}Talamh a Chruthú @@ -2714,7 +2839,7 @@ STR_FOUND_TOWN_SELECT_LAYOUT_RANDOM :{BLACK}Randamac # Fund new industry window STR_FUND_INDUSTRY_CAPTION :{WHITE}Tabhair maoiniú do thionscal nua STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}Roghnaigh an tionscal is mian leat ón liosta seo -STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :Go leor tionscal randamach +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :{BLACK}Cruthaigh tionscail randamacha STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}Clúdaigh an léarscáil le tionscail a chuirtear síos go randamach STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_CAPTION :{WHITE}Cruthaigh tionscail randamacha STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_QUERY :{YELLOW}An bhfuil tú cinnte gur mhaith leat go leor tionscal randamach a chruthú? @@ -2723,6 +2848,8 @@ STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}Dóigh STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Tóg STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}Maoinigh STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}Bain gach tionscal +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_TOOLTIP :{BLACK}Bain gach tionscal atá ar an léarscáil faoi láthair +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_CAPTION :{WHITE}Bain gach tionscal STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :An bhfuil tú cinnte gur mhaith leat gach tionscail a bhaint? # Industry cargoes window @@ -2744,6 +2871,7 @@ STR_INDUSTRY_CARGOES_SELECT_INDUSTRY_TOOLTIP :{BLACK}Roghnaig # Land area window STR_LAND_AREA_INFORMATION_CAPTION :{WHITE}Faisnéis faoin bPíosa Talún +STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Láraigh an príomh-amharc ar shuíomh na tíle. Ctrl+Cliceáil chun fuinneog amhairc nua a oscailt ar shuíomh na tíle STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A :{BLACK}Costas le glanadh: {LTBLUE}N/B STR_LAND_AREA_INFORMATION_COST_TO_CLEAR :{BLACK}Costas le glanadh: {RED}{CURRENCY_LONG} STR_LAND_AREA_INFORMATION_REVENUE_WHEN_CLEARED :{BLACK}Ioncam má ghlantar: {LTBLUE}{CURRENCY_LONG} @@ -2765,6 +2893,7 @@ STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Lastas a ghlactar leis: {LTBLUE} STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING}) STR_LANG_AREA_INFORMATION_ROAD_TYPE :{BLACK}Cineál bóthair: {LTBLUE}{STRING} +STR_LANG_AREA_INFORMATION_TRAM_TYPE :{BLACK}Cineál tram: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Teorainn luais iarnróid: {LTBLUE}{VELOCITY} STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Teorainn luais na mbóithre: {LTBLUE}{VELOCITY} STR_LANG_AREA_INFORMATION_TRAM_SPEED_LIMIT :{BLACK}Teorainn luais tramanna: {LTBLUE}{VELOCITY} @@ -2869,21 +2998,48 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Ráta ionsamhlúcháin: {STRING} +STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Líon ticeanna an chluiche a dhéantar a ionshamhlú in aghaidh an tsoicind. STR_FRAMERATE_RATE_BLITTER :{BLACK}Ráta frámaí na ngraificí: {STRING} +STR_FRAMERATE_CURRENT :{WHITE}Faoi láthair +STR_FRAMERATE_AVERAGE :{WHITE}Meán-ráta +STR_FRAMERATE_MEMORYUSE :{WHITE}Cuimhne STR_FRAMERATE_DATA_POINTS :{BLACK}Sonraí bunaithe ar thomhaiseanna {COMMA} STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms +STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL} ms +STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} fráma/s +STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} fráma/s STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} fráma/s STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms +STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ###length 15 +STR_FRAMERATE_GAMELOOP :{BLACK}Iomlán lúb an chluiche: +STR_FRAMERATE_GL_ECONOMY :{BLACK} Láimhseáil lastais: +STR_FRAMERATE_GL_TRAINS :{BLACK} Ticeanna na dtraenacha: +STR_FRAMERATE_GL_ROADVEHS :{BLACK} Ticeanna na bhfeithiclí bóthair: STR_FRAMERATE_GL_SHIPS :{BLACK} Ticeanna na long: +STR_FRAMERATE_GL_AIRCRAFT :{BLACK} Ticeanna na n-aerárthach: STR_FRAMERATE_GL_LANDSCAPE :{BLACK} Ticeanna an domhain: +STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Fuinneoga amhairc an domhain: STR_FRAMERATE_VIDEO :{BLACK}Aschur físe: STR_FRAMERATE_SOUND :{BLACK}Meascadh fuaime: +STR_FRAMERATE_ALLSCRIPTS :{BLACK} Scripteanna cluiche/AInna iomlán: +STR_FRAMERATE_GAMESCRIPT :{BLACK} Script cluiche: +STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} ###length 15 +STR_FRAMETIME_CAPTION_GAMELOOP :Lúb an chluiche +STR_FRAMETIME_CAPTION_GL_ECONOMY :Láimhseáil lastais STR_FRAMETIME_CAPTION_GL_TRAINS :Ticeanna na dtraenacha +STR_FRAMETIME_CAPTION_GL_ROADVEHS :Ticeanna na bhfeithiclí bóthair +STR_FRAMETIME_CAPTION_GL_AIRCRAFT :Ticeanna na n-aerárthach +STR_FRAMETIME_CAPTION_GL_LANDSCAPE :Ticeanna an domhain +STR_FRAMETIME_CAPTION_DRAWING :Rindreáil na ngrafaicí +STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Rindreáil fhuinneog amhairc an domhain +STR_FRAMETIME_CAPTION_VIDEO :Aschur físe: +STR_FRAMETIME_CAPTION_SOUND :Meascán fuaime +STR_FRAMETIME_CAPTION_ALLSCRIPTS :# iomlán na scripteanna cluichí/AI STR_FRAMETIME_CAPTION_GAMESCRIPT :Script an chluiche STR_FRAMETIME_CAPTION_AI :AI {NUM} {STRING} @@ -2925,8 +3081,16 @@ STR_MAPGEN_BY :{BLACK}* STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Líon na mbailte: STR_MAPGEN_DATE :{BLACK}Dáta: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Líon na dtionscal: +STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}An beann is airde: +STR_MAPGEN_HEIGHTMAP_HEIGHT_UP :{BLACK}Méadaigh airde uasta an bhinn is airde ar an léarscáil d'aon leibhéal amháin +STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN :{BLACK}Laghdaigh airde uasta an bhinn is airde ar an léarscáil d'aon leibhéal amháin STR_MAPGEN_SNOW_COVERAGE :{BLACK}Clúdach sneachta: +STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}éadaigh clúdach an tsneachta deich faoin gcéad +STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}Laghdaigh clúdach an tsneachta deich faoin gcéad +STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% +STR_MAPGEN_DESERT_COVERAGE :{BLACK}Clúdach an fhásaigh: STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}Méadaigh clúdach an fhásaigh deich faoin gcéad +STR_MAPGEN_DESERT_COVERAGE_DOWN :{BLACK}Laghdaigh clúdach an fhásaigh deich faoin gcéad STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_LAND_GENERATOR :{BLACK}Talamh a chruthú: STR_MAPGEN_TERRAIN_TYPE :{BLACK}Cineál tír-raoin: @@ -2953,7 +3117,10 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}Ainm an STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}Méid: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} +STR_MAPGEN_TERRAIN_TYPE_QUERY_CAPT :{WHITE}Airde sprice na mbeann +STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT :{WHITE}An beann is airde STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT :{WHITE}Clúdach sneachta (i %) +STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}Clúdach an fhásaigh (i %) STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}Athraigh an bhliain tosaigh # SE Map generation @@ -3026,6 +3193,9 @@ STR_NEWGRF_SETTINGS_MIN_VERSION :{BLACK}Leagan i STR_NEWGRF_SETTINGS_MD5SUM :{BLACK}MD5sum: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Pailéad: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE_DEFAULT :Réamhshocrú (R) +STR_NEWGRF_SETTINGS_PALETTE_DEFAULT_32BPP :Réamhshocrú (D) / 32 bpp +STR_NEWGRF_SETTINGS_PALETTE_LEGACY :Oidhreachta (W) +STR_NEWGRF_SETTINGS_PALETTE_LEGACY_32BPP :Oidhreachta (L) / 32 bpp STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Paraiméadair: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PARAMETER_NONE :Ceann ar bith @@ -3089,6 +3259,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Rabhadh: { STR_NEWGRF_ERROR_MSG_ERROR :{RED}Earráid: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Marfach: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Tharla earráid mharfach NewGRF:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}Tharla earráid NewGRF:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :Ní oibreoidh {1:STRING} leis an leagan de TTDPatch a thuairiscigh OpenTTD. STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING}: Is don leagan {STRING} de TTD é STR_NEWGRF_ERROR_UNSET_SWITCH :Tá {1:STRING} deartha le húsáid le {STRING} @@ -3108,6 +3279,8 @@ STR_NEWGRF_ERROR_READ_BOUNDS :Léadh tar éis STR_NEWGRF_ERROR_GRM_FAILED :Níl na hacmhainní GRF a iarradh ar fáil (sprid {3:NUM}) STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :Bhí {1:STRING} díchumasaithe ag {2:STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Formáid neamhbhailí/anaithnid do leagan amach na spride (sprid {3:NUM}) +STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :An iomarca eilimintí i liosta luachanna an airí (sprít {3:NUM}, airí {4:HEX}) +STR_NEWGRF_ERROR_INDPROD_CALLBACK :Aisghlach neamhbhailí le haghaidh táirgeadh tionscail (sprít {3:NUM}, "{2:STRING}") # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Rabhadh! @@ -3164,6 +3337,7 @@ STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Scorána # Sign window STR_EDIT_SIGN_CAPTION :{WHITE}Cuir téacs an chomhartha in eagar +STR_EDIT_SIGN_LOCATION_TOOLTIP :{BLACK}Láraigh an príomhamharc ar shuíomh an chomhartha. Osclaítear amharc nua ar shuíomh an chomhartha le Ctrl+Cliceáil STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP :{BLACK}Gabh chuig an chéad chomhartha eile STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP :{BLACK}Gabh chuig an comhartha roimhe @@ -3236,7 +3410,10 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Tabhair # Goal window STR_GOALS_CAPTION :{WHITE}Spriocanna {COMPANY} STR_GOALS_SPECTATOR_CAPTION :{WHITE}Spriocanna Uilíocha +STR_GOALS_SPECTATOR :Spriocanna Uilíocha STR_GOALS_GLOBAL_BUTTON :{BLACK}Domhanda +STR_GOALS_GLOBAL_BUTTON_HELPTEXT :{BLACK}Taispeáin na spriocanna uilíocha +STR_GOALS_COMPANY_BUTTON :{BLACK}Cuideachta STR_GOALS_COMPANY_BUTTON_HELPTEXT :{BLACK}Spriocanna na cuideachta a thaispeáint STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- Ceann ar bith - @@ -3245,10 +3422,10 @@ STR_GOALS_PROGRESS_COMPLETE :{GREEN}{STRING} STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Cliceáil ar an sprioc chun an príomhamharc a lárú ar an tionscal/baile/tíle. Ctrl+Cliceáil chun fuinneog amhairc nua a oscailt ar shuíomh an tionscail/an bhaile/na tíle # Goal question window -STR_GOAL_QUESTION_CAPTION_QUESTION :Ceist -STR_GOAL_QUESTION_CAPTION_INFORMATION :Faisnéis -STR_GOAL_QUESTION_CAPTION_WARNING :Rabhadh -STR_GOAL_QUESTION_CAPTION_ERROR :Earráid +STR_GOAL_QUESTION_CAPTION_QUESTION :{BLACK}Ceist +STR_GOAL_QUESTION_CAPTION_INFORMATION :{BLACK}Faisnéis +STR_GOAL_QUESTION_CAPTION_WARNING :{BLACK}Rabhadh +STR_GOAL_QUESTION_CAPTION_ERROR :{YELLOW}Earráid # Goal Question button list ###length 18 @@ -3440,6 +3617,7 @@ STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS :{BLACK}Tóg cea STR_COMPANY_VIEW_INFRASTRUCTURE_BUTTON :{BLACK}Sonraí STR_COMPANY_VIEW_INFRASTRUCTURE_TOOLTIP :{BLACK}Taispeáin líon mionsonraithe na bpíosaí bonneagair STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}Tabhair airgead +STR_COMPANY_VIEW_GIVE_MONEY_TOOLTIP :{BLACK}Tabhair airgead don chuideachta seo STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}Aghaigh Nua STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}Roghnaigh aghaidh nua don bhainisteoir @@ -3465,6 +3643,7 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_CAPTION :{WHITE}Bonneaga STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT :{GOLD}Píosaí iarnróid: STR_COMPANY_INFRASTRUCTURE_VIEW_SIGNALS :{WHITE}Comharthaí STR_COMPANY_INFRASTRUCTURE_VIEW_ROAD_SECT :{GOLD}Píosaí bóthair: +STR_COMPANY_INFRASTRUCTURE_VIEW_TRAM_SECT :{GOLD}Píosaí tram: STR_COMPANY_INFRASTRUCTURE_VIEW_WATER_SECT :{GOLD}Tíleanna uisce: STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS :{WHITE}Canálacha STR_COMPANY_INFRASTRUCTURE_VIEW_STATION_SECT :{GOLD}Stáisiúin: @@ -3477,7 +3656,9 @@ STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Tionscai STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Ceann ar bith - STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{STRING}{YELLOW} (Iompraíodh {COMMA}%){BLACK} STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} +STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUSTRY} {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} +STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} agus {NUM} sa bhreis... STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Ainmneacha na dtionscal - cliceáil ar ainm chun an príomh-amharc a lárú ar thionscal. Osclaítear amharc nua ar shuíomh an tionscail le Ctrl+Cliceáil STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Lastas a ghlactar leis: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Lastas a tháirgtear: {SILVER}{STRING} @@ -3495,6 +3676,8 @@ STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}D'fhóg STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Ag teastáil: {YELLOW}{STRING}{STRING} STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} +STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Ag teastáil: +STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} STR_CONFIG_GAME_PRODUCTION :{WHITE}Athraigh táirgeacht (iolra de 8, suas go 2040) STR_CONFIG_GAME_PRODUCTION_LEVEL :{WHITE}Athraigh an ráta táirgeachta (céatadán, suas go 800%) @@ -3567,6 +3750,7 @@ STR_GROUP_RENAME_CAPTION :{BLACK}Athainmn STR_GROUP_PROFIT_THIS_YEAR :Brabús i mbliana: STR_GROUP_PROFIT_LAST_YEAR :Brabús anuraidh: STR_GROUP_OCCUPANCY :Úsáid reatha: +STR_GROUP_OCCUPANCY_VALUE :{NUM}% # Build vehicle window ###length 4 @@ -3586,6 +3770,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Longa Nua STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Aerárthaigh Nua STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Costas: {GOLD}{CURRENCY_LONG}{BLACK} Meáchan: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Costas: {GOLD}{CURRENCY_LONG}{BLACK} (Costas Athfheistithe: {GOLD}{CURRENCY_LONG}{BLACK}) Meáchan: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Luas: {GOLD}{VELOCITY}{BLACK} Cumhacht: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Luas: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Luas ar aigéan: {GOLD}{VELOCITY} @@ -3603,6 +3788,8 @@ STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Toillead STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vaigíní faoi Chumhacht: {GOLD}+{POWER}{BLACK} Meáchan: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Is féidir athfheistiú go: {GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :Gach cineál lastais +STR_PURCHASE_INFO_NONE :Rud ar bith +STR_PURCHASE_INFO_ENGINES_ONLY :Innill amháin STR_PURCHASE_INFO_ALL_BUT :Gach rud seachas {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Iarracht uasta tarraingthe: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Raon: {GOLD}{COMMA} tíl @@ -3621,7 +3808,10 @@ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Ceannaig STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Ceannaigh Aerárthach ###length VEHICLE_TYPES +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Ceannaigh agus Athfheistigh Feithicil STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Ceannaigh agus Athfheistigh Feithicil +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Ceannaigh agus Athfheistigh Long +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Ceannaigh agus Athfheitigh Aerárthach ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an fheithicil traenach aibhsithe @@ -3630,6 +3820,9 @@ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaig STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an t-aerárthach aibhsithe ###length VEHICLE_TYPES +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an fheithicil bóthair aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan í a cheannach +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an long aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan í a cheannach +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an t-aerárthach aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan é a cheannach ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Athainmnigh @@ -3772,6 +3965,8 @@ STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Costas: STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Costas: {CURRENCY_LONG} Luas Uasta: {VELOCITY}{}Toilleadh: {CARGO_LONG}{}Costas Coinneála: {CURRENCY_LONG}/bl STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Costas: {CURRENCY_LONG} Luas Uasta: {VELOCITY}{}Cineál aerárthaigh: {STRING}{}Toilleadh: {CARGO_LONG}, {CARGO_LONG}{}Costas Coinneála: {CURRENCY_LONG}/bl STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Costas: {CURRENCY_LONG} Luas Uasta: {VELOCITY}{}Cineál aerárthaigh: {STRING}{}Capacity: {CARGO_LONG}{}Costas Coinneála: {CURRENCY_LONG}/bl +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Costas: {CURRENCY_LONG} Luas Uasta: {VELOCITY}{}Cineál aerárthaigh: {STRING} Raon: {COMMA} tíl{}Toilleadh: {CARGO_LONG}, {CARGO_LONG}{}Costas Coinneála: {CURRENCY_LONG}/bl +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}Costas: {CURRENCY_LONG} Luas Uasta: {VELOCITY}{}Cineál aerárthaigh: {STRING} Raon: {COMMA} tíl{}Toilleadh: {CARGO_LONG}{}Costas Coinneála: {CURRENCY_LONG}/bl # Autoreplace window STR_REPLACE_VEHICLES_WHITE :{WHITE}Ionadaigh{STRING} - {STRING} @@ -3815,6 +4010,7 @@ STR_REPLACE_ELRAIL_VEHICLES :Feithiclí Iarn STR_REPLACE_MONORAIL_VEHICLES :Feithiclí Aonráille STR_REPLACE_MAGLEV_VEHICLES :Feithiclí Maglev +STR_REPLACE_TRAM_VEHICLES :Feithiclí Trambhealaigh STR_REPLACE_REMOVE_WAGON :{BLACK}Vaigíní a bhaint ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Ceangail ar uath-athsholáthar fad na traenach a choinneáil mar an gcéanna trí vaigíní a bhaint (ag tosú ag an tosach), má tharlaíonn sé go mbeadh an traein níos faide tar éis an t-inneall a athsholáthar. @@ -3824,6 +4020,10 @@ STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+ STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} ###length VEHICLE_TYPES +STR_VEHICLE_VIEW_TRAIN_CENTER_TOOLTIP :{BLACK}Láraigh an príomh-amharc ar shuíomh na traenach. Má chliceáltar faoi dhó, leanfar an traein sa phríomh-amharc. Le Ctrl+Cliceáil oscailtear amharc nua ag suíomh na traenach +STR_VEHICLE_VIEW_ROAD_VEHICLE_CENTER_TOOLTIP :{BLACK}Láraigh an príomh-amharc ar shuíomh na feithicle. Má chliceáltar faoi dhó, leanfar an fheithicil sa phríomh-amharc. Le Ctrl+Cliceáil oscailtear amharc nua ag suíomh na feithicle +STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Láraigh an príomh-amharc ar shuíomh na loinge. Má chliceáltar faoi dhó, leanfar an long sa phríomh-amharc. Le Ctrl+Cliceáil oscailtear fuinneog amhairc nua ag suíomh na loinge +STR_VEHICLE_VIEW_AIRCRAFT_CENTER_TOOLTIP :{BLACK}Láraigh an príomh-amharc ar shuíomh an aerárthaigh. Má chliceáltar faoi dhó, leanfar an t-aerárthach sa phríomh-amharc. Le Ctrl+Cliceáil oscailtear amharc nua ag suíomh an aerárthaigh ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_SEND_TO_DEPOT_TOOLTIP :{BLACK}Seol an traein chuig an iosta. Ní dhéanfar ach seirbhísiú le Ctrl+Cliceáil @@ -3861,6 +4061,9 @@ STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Taispeá ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}A bhfuil ar siúl ag an traein faoi láthair - cliceáil chun an traein a stopadh/a thosú +STR_VEHICLE_VIEW_ROAD_VEHICLE_STATUS_START_STOP_TOOLTIP :{BLACK}A bhfuil ar siúl ag an bhfeithicil reatha - cliceáil chun an fheithicil a stopadh/a thosú +STR_VEHICLE_VIEW_SHIP_STATE_STATUS_STOP_TOOLTIP :{BLACK}A bhfuil ar siúl ag an long faoi láthair - cliceáil chun an long a stopadh/a thosú +STR_VEHICLE_VIEW_AIRCRAFT_STATUS_START_STOP_TOOLTIP :{BLACK}A bhfuil ar siúl ag an aerárthach faoi láthair - cliceáil chun an t-aerárthach a stopadh/a thosú # Messages in the start stop button in the vehicle view STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}Ag Lódáil / Dílódáil @@ -3880,7 +4083,9 @@ STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Ag dul STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Seirbhís ag {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Ní féidir {STATION} a bhaint amach, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Ní féidir {WAYPOINT} a bhaint amach, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Ní féidir {DEPOT} a bhaint amach, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Ní féidir {DEPOT} a bhaint amach, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -4102,6 +4307,7 @@ STR_ORDER_REFIT_STOP_ORDER :(Athfheistigh g STR_ORDER_STOP_ORDER :(Stop) STR_ORDER_GO_TO_STATION :{STRING} {STATION} {STRING} +STR_ORDER_GO_TO_STATION_CAN_T_USE_STATION :{PUSH_COLOUR}{RED}(Ní féidir an stáisiún a úsáid){POP_COLOUR} {STRING} {STATION} {STRING} STR_ORDER_IMPLICIT :(Uathoibríoch) @@ -4285,6 +4491,7 @@ STR_SCREENSHOT_SCREENSHOT :{BLACK}Gnáth-s STR_SCREENSHOT_ZOOMIN_SCREENSHOT :{BLACK}Seat scáileáin zúmáilte isteach go hiomlán STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT :{BLACK}Seat scáileáin le zúmáil réamhshocraithe STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Seat scáileáin den mhapa airde +STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Seat scáileáin den mhion-léarscáil # AI Parameters STR_AI_SETTINGS_CAPTION :{WHITE}Paraiméadair {STRING} @@ -4345,6 +4552,7 @@ STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :Rinneadh an clu STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE :Níl an comhad inléite STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE :Níl an comhad inscríofa STR_GAME_SAVELOAD_ERROR_DATA_INTEGRITY_CHECK_FAILED :Theip ar seiceáil sláine na sonraí +STR_GAME_SAVELOAD_ERROR_PATCHPACK :Rinneadh an cluiche sábháilte le leagan a modhnaíodh STR_GAME_SAVELOAD_NOT_AVAILABLE : STR_WARNING_LOADGAME_REMOVED_TRAMS :{WHITE}Sábháladh an cluiche i leagan gan tacaíocht do thramanna. Baineadh gach tram. @@ -4552,6 +4760,8 @@ STR_ERROR_DEPOT_WRONG_DEPOT_TYPE :Cineál iosta m STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}Tá {VEHICLE} rófhada tar éis athsholáthair STR_ERROR_AUTOREPLACE_NOTHING_TO_DO :{WHITE}Níor cuireadh aon riail uathionadú/athnuachan i bhfeidhm. STR_ERROR_AUTOREPLACE_MONEY_LIMIT :(teorainn airgid) +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_CARGO :{WHITE}Ní féidir leis an bhfeithicil nua {STRING} a iompar +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_REFIT :{WHITE}Ní féidir le feithicil nua athfheistiú a dhéanamh in ordú {NUM} # Rail construction errors STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION :{WHITE}Comhcheangal ráillí dodhéanta @@ -4560,6 +4770,7 @@ STR_ERROR_NO_SUITABLE_RAILROAD_TRACK :{WHITE}Níl rá STR_ERROR_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Ní mór na ráillí iarnróid a bhaint ar dtús STR_ERROR_CROSSING_ON_ONEWAY_ROAD :{WHITE}Is bóthar aonbhealaigh nó blocáilte é STR_ERROR_CROSSING_DISALLOWED_RAIL :{WHITE}Ní cheadaítear crosairí comhréidh don chineál ráille seo +STR_ERROR_CROSSING_DISALLOWED_ROAD :{WHITE}Ní cheadaítear crosairí comhréidh don chineál bóthair seo STR_ERROR_CAN_T_BUILD_SIGNALS_HERE :{WHITE}Ní féidir comharthaí a thógáil anseo... STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK :{WHITE}Ní féidir ráillí iarnróid a thógáil anseo... STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK :{WHITE}Ní féidir ráillí iarnróid a bhaint as seo... @@ -4580,6 +4791,8 @@ STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM :{WHITE}Ní féi STR_ERROR_THERE_IS_NO_ROAD :{WHITE}... níl aon bhóthar ann STR_ERROR_THERE_IS_NO_TRAMWAY :{WHITE}... níl aon trambhealach ann STR_ERROR_CAN_T_CONVERT_ROAD :{WHITE}Ní féidir an cineál bóthair a thiontú anseo... +STR_ERROR_CAN_T_CONVERT_TRAMWAY :{WHITE}Ní féidir an cineál tram a thiontú anseo... +STR_ERROR_NO_SUITABLE_ROAD :{WHITE}Níl aon bhóthar oiriúnach ann STR_ERROR_NO_SUITABLE_TRAMWAY :{WHITE}Níl aon trambhealach oiriúnach # Waterway construction errors @@ -4633,6 +4846,7 @@ STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Ní féi STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Ní féidir an grúpa seo a scriosadh... STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Ní féidir an grúpa a athainmniú... STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Ní féidir máthairghrúpa a shocrú... +STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION :{WHITE}... ní cheadaítear lúba in ordlathas an ghrúpa STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Ní féidir gach feithicil a bhaint ón ngrúpa seo... STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Ní féidir an fheithicil a chur leis an ngrúpa seo... STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Ní féidir feithiclí comhroinnte a chur le grúpa... @@ -4755,6 +4969,7 @@ STR_BASESOUNDS_DOS_DESCRIPTION :Fuaimeanna buna STR_BASESOUNDS_WIN_DESCRIPTION :Fuaimeanna bunaidh Transport Tycoon Deluxe, eagrán Windows. STR_BASESOUNDS_NONE_DESCRIPTION :Pacáiste fuaimeanna gan aon fhuaimeanna ann. STR_BASEMUSIC_WIN_DESCRIPTION :Ceol bunaidh Transport Tycoon Deluxe, eagrán Windows. +STR_BASEMUSIC_DOS_DESCRIPTION :Ceol bunaidh Transport Tycoon Deluxe, eagrán DOS. STR_BASEMUSIC_TTO_DESCRIPTION :Ceol bunaidh Transport Tycoon (Bunaidh/Eagarthóir an Domhain), eagrán DOS STR_BASEMUSIC_NONE_DESCRIPTION :Pacáiste ceoil gan aon cheol iarbhír ann. @@ -4840,10 +5055,10 @@ STR_INDUSTRY_NAME_SUGAR_MINE :Mianach Siúcra ##id 0x6000 STR_SV_EMPTY : STR_SV_UNNAMED :Gan ainm -STR_SV_TRAIN_NAME :Traein {COMMA} -STR_SV_ROAD_VEHICLE_NAME :Feithicil Bóthair {COMMA} -STR_SV_SHIP_NAME :Long {COMMA} -STR_SV_AIRCRAFT_NAME :Aerárthach {COMMA} +STR_SV_TRAIN_NAME :Traein #{COMMA} +STR_SV_ROAD_VEHICLE_NAME :Feithicil Bóthair #{COMMA} +STR_SV_SHIP_NAME :Long #{COMMA} +STR_SV_AIRCRAFT_NAME :Aerárthach #{COMMA} ###length 27 STR_SV_STNAME :{STRING} diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index d2180ee6f8..b7ef4ad2ed 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -326,6 +326,8 @@ STR_GROUP_BY_NONE :(なし) STR_GROUP_BY_SHARED_ORDERS :共有注文 # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}指令 +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}指令表示を開けます # Tooltips for the main toolbar ###length 31 @@ -896,7 +898,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}助成金交付案失効:{}{1:STRING}から{2:STRING}に{0:STRING}を運ぶ便の{}助成金交付案は失効しました STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}助成金支払満了:{}{1:STRING}から{2:STRING}に{0:STRING}を運ぶ便の{}助成金は終了しました +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}助成金交付案:{}{}最初に{STRING}から{STRING}へ{STRING}を運んだ会社には地元当局より{NUM}年間助成金を交付されます! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}{STRING}が助成金を獲得!{}{}{STRING} から {STRING} に {STRING} を運ぶ便の収入は次の {NUM} 年間50%増えます!! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}{STRING}が助成金を獲得!{}{}{STRING} から {STRING} に {STRING} を運ぶ便の収入は次の {NUM} 年間2倍になります! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}{STRING}が助成金を獲得!{}{}{STRING} から {STRING} に {STRING} を運ぶ便の収入は次の {NUM} 年間3倍になります! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}{STRING}が助成金を獲得!{}{}{STRING} から {STRING} に {STRING} を運ぶ便の収入は次の {NUM} 年間4倍になります! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}混乱する道路交通!{}{}{1:STRING}が{0:TOWN}の街路補修に出資{}地元ドライバーには悪夢の半年に! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}輸送独占! @@ -1562,9 +1569,11 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :クリック( STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :クリック(即時) STR_CONFIG_SETTING_USE_RELAY_SERVICE :中継サービスを利用: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :サーバーへの接続に失敗した場合、その人は接続するためにリレーサービスを利用できます。「拒否」でこれを拒絶、「尋ねる」で都度確認、「許可」で確認なしに容認します。 ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :二度と STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :聞く +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :許可 STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :右クリックのエミュレーション: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :右クリックをエミュレートする方法を指定します @@ -1816,8 +1825,10 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :パス・一方 STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :すべて STR_CONFIG_SETTING_SIGNAL_GUI_MODE :信号の種類: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :信号のツールバーに表示される信号の種類を選択します ###length 2 STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :パス信号のみ +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :全ての信号 STR_CONFIG_SETTING_TOWN_LAYOUT :街の道路配置: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :街での道路区画計画を設定します @@ -2266,7 +2277,7 @@ STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}イン STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}LANで探す STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}ローカルエリアネットワークでサーバーを検索する STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}サーバーを追加 -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}検索時、常に稼働確認するサーバーのリストに追加します +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}サーバーをリストに追加します。これはサーバーのアドレスか招待コードのいずれかです。 STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}サーバーを開始 STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}自分でサーバーを立ち上げます @@ -2316,9 +2327,10 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}この # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :オンラインのプレイヤー +STR_NETWORK_COMPANY_LIST_SPECTATE :観戦 # Network client list -STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}マルチプレイヤー +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}オンラインのプレイヤー STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}サーバー STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}名前 STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}あなたがプレイしているサーバー名 @@ -2329,6 +2341,7 @@ STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}他の STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}招待コード STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}他のプレイヤーがこのサーバーに参加するための招待コード STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}接続タイプ +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}他のプレイヤーがあなたのサーバにたどり着けるか、またどのようにたどり着けるか STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}プレイヤー STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}名前 STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}あなたのプレイヤー名 @@ -2345,12 +2358,15 @@ STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(新規会社 STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}新しく会社を設立し参画します STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}これはあなたです STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}ゲームのホストです +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} 個のクライアント / {NUM} 個の企業 # Matches ConnectionType ###length 5 STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}ローカル STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}リモートプレイヤーが接続できません STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}公開 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}NATの向こう側 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}中継サービスて STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :キック STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :BAN @@ -2363,7 +2379,9 @@ STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}プレ STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}会社 '{COMPANY}' を削除してもよろしいですか? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}会社 '{COMPANY}'のパスワードをリセットしてもよろしいですか? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}中継サービスを利用しますか? STR_NETWORK_ASK_RELAY_TEXT :{YELLOW} '{STRING}'サーバーとの接続の確立に失敗しました.{}'{STRING}'を経由して中継しますか? +STR_NETWORK_ASK_RELAY_NO :{BLACK}拒否 STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}一度だけ STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}はい、二度と聞かないでください @@ -2394,11 +2412,12 @@ STR_NETWORK_CHAT_TO_COMPANY :『チーム』 STR_NETWORK_CHAT_CLIENT :『個人』{STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :『個人』{STRING}へ: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :『全員』{STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}チャットメッセージを入力 # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}ネットワークデバイスが見つかりませんでした。ENABLE_NETWORKなしでゲームがコンパイルされた可能性もあります -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}サーバが応答しませんでした +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}サーバーへの接続がタイムアウトしたか拒絶されました。 STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}NewGRFの不一致によって接続できませんでした STR_NETWORK_ERROR_DESYNC :{WHITE}ネットワークゲームの同期が失敗しました STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}ネットワークゲームへの接続が切断しました @@ -2478,6 +2497,7 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}この STR_NETWORK_MESSAGE_KICKED :*** {STRING}がキックされました。理由: ({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}サーバーの登録に失敗しました +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}他のサーバーは同じ招待コードを登録していた。「ローカル」ゲームタイプに入ります。 STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}サーバーがリモート接続を許可していません STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}他のプレイヤーはあなたのサーバーに接続できなくなります @@ -3771,7 +3791,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}新規 STR_GROUP_DELETE_TOOLTIP :{BLACK}選択したグループを削除します STR_GROUP_RENAME_TOOLTIP :{BLACK}選択したグループの名称を変更します STR_GROUP_LIVERY_TOOLTIP :{BLACK}選択したグループのカラーリングを変更する -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}このグループ内の輸送機器を全体を対象とする自動交換の際も交換されないようにします +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}このグループ内の輸送機器を全体を対象とする自動交換の際も交換されないようにします。Ctrl+クリックでサブグループも対象に含みます。 STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}グループを削除 STR_GROUP_DELETE_QUERY_TEXT :{WHITE}このグループとそれに属するすべてを削除してもよろしいですか? @@ -4052,7 +4072,9 @@ STR_REPLACE_MAGLEV_VEHICLES :リニア車両 STR_REPLACE_ROAD_VEHICLES :車両 STR_REPLACE_TRAM_VEHICLES :路面電車の車両 +STR_REPLACE_REMOVE_WAGON :{BLACK}列車の短縮({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}機関車の交換で列車長が長くなる場合、列車長を維持する為に客車/貨車を減らすことができます。外されるのは従属部分の先頭からになります +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+クリックでサブグループにも適用 # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} @@ -4121,6 +4143,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}{WAYPOI STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}{DEPOT}へ回送中です {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}{DEPOT}へ保守回送中です {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}{STATION}に到達できません, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}{WAYPOINT}に到達できません, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE} {DEPOT}車両基地に到達できません, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE} {DEPOT}車両基地に到達できません, {VELOCITY} diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 6f34659959..365e283afb 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -328,6 +328,8 @@ STR_GROUP_BY_NONE :Nav STR_GROUP_BY_SHARED_ORDERS :Koplietojamie rīkojumi # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Pasūtījumi +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Atvērt pasūtījumu skatu # Tooltips for the main toolbar ###length 31 @@ -2329,6 +2331,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Uzņēmu # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Spēlētāji tiešsaistē +STR_NETWORK_COMPANY_LIST_SPECTATE :Skatīt # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Tiešsaistes spēlētāji @@ -2413,6 +2416,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Komanda] Uz {S STR_NETWORK_CHAT_CLIENT :[Privāti] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privāti] Uz {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Visiem] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Ievadīt tekstu tīkla tērzēšanai # Network messages @@ -4150,6 +4154,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Dodas u STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Dodas uz {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Veikt apkopi {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nevar sasniegt {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Nevar sasniegt {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nevar sasniegt {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nevar sasniegt {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index f098ce994c..bad8e906c3 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1100,7 +1100,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Subsidijų pasiūlymas baigėsi:{}{}{STRING.ko} pervežimas iš {STRING.ko} į {STRING.ka} daugiau nebesubsidijuojamas. STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subsidijų laikas baigėsi:{}{}{STRING.ko} transportavimas iš {STRING} į {STRING} daugiau nebesubsidijuojamas. +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Subsidijų pasiūlymas:{}{}Pirmasis pervežęs {STRING.ka} iš {STRING} į {STRING} gaus {NUM} metų vietinės valdžios subsidiją! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subsidijos suteiktos {STRING}!{}{}{STRING} pervežimas iš {STRING} į {STRING} artimiausius {NUM} met{P us us ų} bus apmokamas 50% daugiau! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subsidijos suteiktos {STRING}!{}{}{STRING} pervežimas iš {STRING} į {STRING} artimiausius {NUM} met{P us us ų} bus apmokamas dvigubai! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subsidijos suteiktos {STRING}!{}{}{STRING} pervežimas iš {STRING} į {STRING} artimiausius {NUM} met{P us us ų} bus apmokamas trigubai! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subsidijos suteiktos {STRING}!{}{}{STRING} pervežimas iš {STRING} į {STRING} artimiausius {NUM} met{P us us ų} bus apmokamas keturgubai! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}{TOWN}: Sutriko susisiekimas keliais!{}{}Kelių rekonstrukcija, finansuojama {STRING}, sutrigdė susisiekimą keliais 6 mėnesiams! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transporto monopolija! @@ -1166,7 +1171,7 @@ STR_GAME_OPTIONS_CURRENCY_MYR :Malaizijos ring STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Kairiąja puse STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Dešiniąja puse -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Miestų pavadinimai +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Miestų pavadinimai: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Pasirink miestų pavadinimų tipą ###length 21 @@ -1205,6 +1210,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :Kas 12 mėnesi STR_GAME_OPTIONS_LANGUAGE :{BLACK}Kalba STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Pasirinkite aplinkos kalbą +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% baigtumas) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Per visą ekraną STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Pažymėkite šį langelį, jeigu norite OpenTTD žaisti visame ekrane @@ -1218,6 +1224,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Aparatin STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Pažymėkite šį langelį, jei norite, kad OpenTTD taikytų aparatinį spartinimą. Kad nuostata įsigaliotų, reiks perkrauti OpenTTD STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Kad pakeitimai įsigaliotų, reikia paleisti OpenTTD iš naujo +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}Vertikalioji sinchronizacija (VSync) STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Sąsajos elementų dydis STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Pasirinkite vartotojo sąsajos elementų santykinį dydį @@ -1427,8 +1434,12 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Nurodo, kaip da STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Subsidijų daugiklis: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Nustato, kiek kartų maršruto įplaukos bus padidintos, gavus subsidiją +STR_CONFIG_SETTING_SUBSIDY_DURATION :Subsidijų trukmė: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Pasirinkite vietinės valdžios subsidijų trukmę metais +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} met{P ai ai ų} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Be subsidijų STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Statybos kaštų lygis: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Nustatykite statybos kaštų lygmenį @@ -1755,7 +1766,12 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dvikartis spust STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Vienkartis spustelėjimas (jei židinyje) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Vienkartis spustelėjimas (iškart) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Naudojimasis perdavimo paslauga: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Nepavykus prisijungti prie serverio tiesiogiai, žaidėjas gali pasinaudoti tarpinio perdavimo paslauga ir prisijungti prie serverio per kitą žaidėją. ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Neleisti +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Paklausti +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Leisti STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Dešiniojo pelės mygtuko emuliacija: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Pasirinkite būdą, kurį atliks dešinio pelės klavišo paspaudimas @@ -2004,9 +2020,13 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Pereiti tam tik STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Pasirinkite, kurie signalų tipai vykdys ciklą, kai Ctrl+paspaudę statyti signalą signalų įrankiuose ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Kelio signalų -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Visus +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Visus matomus +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Rodyti signalus: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Pasirinkite, kuriuos signalų tipus rodyti įrankių juostoje ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Tik kelio signalus +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Visus STR_CONFIG_SETTING_TOWN_LAYOUT :Kelių išdėstymas naujiems miestams: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Kelių tinklų planas miestuose @@ -2206,6 +2226,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Gamyklo STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Krovinių pasiskirstymas STR_CONFIG_SETTING_AI :{ORANGE}Konkurentai STR_CONFIG_SETTING_AI_NPC :{ORANGE}Kompiuterio žaidėjai +STR_CONFIG_SETTING_NETWORK :{ORANGE}Žaidimas tinkle STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Traukinių maršrutų paieškos algoritmas: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Maršruto naudojamas ieškotojas traukiniams @@ -2415,6 +2436,9 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Pakeisti # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Vietinis +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Viešas +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Tik su kvietimais # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Žaidimas tinkle @@ -2450,6 +2474,7 @@ STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Dabarti STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Apsaugota slaptazodžiu! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVERIS IŠJUNGTAS STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVERIS PILNAS +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}Serveris jus atjungė (BAN) STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIJŲ NESUTAPIMAS STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEATITINKA PLĖTINYS @@ -2467,6 +2492,7 @@ STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Sukurti STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Sukurti savo serverį STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Įrašykite savo vardą +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Įveskite serverio adresą arba pakvietimo kodą # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Pradėti naują daugiažaidėjinį žaidimą @@ -2476,6 +2502,8 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}Žaidimo STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Nustatyti slaptažodi STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Apsaugokite savo žaidimą slaptažodžiu, jei nenorite, kad jis būtų viešai prieinamas +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Matomumas +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :Serverio matomumo nuostata STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} klient{P as ai ų} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Didžiausias klientų skaičius: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Pasirinkite didžiausią klientų skaičių. Nebūtinai visos jungtys turi būti užpildytos @@ -2511,12 +2539,19 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Kompanij STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Žaidėjų sąrašas # Network client list +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Įveskite žaidėjo pavadinimą # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Atjungti +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Naudotis tarpiniu perdavimu? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Nepavyko prisijungti prie serverio '{STRING}'.{}Ar norite pabandyti jungtis per tarpinę stotelę '{STRING}'? +STR_NETWORK_ASK_RELAY_NO :{BLACK}Ne +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Taip, bet tik šįkart +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Taip, ir prašau nebeklausti STR_NETWORK_SPECTATORS :Stebėtojai @@ -2556,6 +2591,7 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Nutruko STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Negali atverti išsaugoto žaidimo STR_NETWORK_ERROR_SERVER_START :{WHITE}Negali paleisti serverio STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Protokolo klaida. Prisijungimas baigtas +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE} Įveskite žaidėjo pavadinimą lango viršuje STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Žaidimo versija neatitinka serverio žaidimo versijos STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Blogas slaptažodis STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Serveris pilnas @@ -4233,6 +4269,7 @@ STR_REPLACE_MAGLEV_VEHICLES :„Maglev“ tr STR_REPLACE_ROAD_VEHICLES :Automobilius STR_REPLACE_TRAM_VEHICLES :Tramvajinės transporto priemonės +STR_REPLACE_REMOVE_WAGON :{BLACK}Vagono pašalinimas ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Pakeitimo metu išlaikyti traukinio ilgį atjungiant vagonus (pradedant nuo priekio), jeigu pakeitus garvežį traukinys pailgėtų # Vehicle view @@ -4302,6 +4339,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Vyksta STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Vyksta į „{DEPOT}“, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Vyksta techninei apžiūrai į „{DEPOT}“, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nepavyksta pasiekti {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nepavyksta pasiekti {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 2579e2d731..7a9d843cf0 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -327,6 +327,7 @@ STR_GROUP_BY_SHARED_ORDERS :Gedeelten Optr # Order button in shared orders vehicle list STR_GOTO_ORDER_VIEW :{BLACK}Opträg +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Optragsusiicht opmaachen # Tooltips for the main toolbar ###length 31 @@ -336,7 +337,7 @@ STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Optioune STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Spill späicheren, Spill ophalen, Eraus STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}Weis d'Kaart, extra Usiicht oder d'Lëscht vun den Zeeschen STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Weis d'Stiedverzeeschnëss -STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Subventiounen uweisen +STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Subsiden uweisen STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_STATIONS :{BLACK}Weis d'Lëscht vun de Firmestatiounen STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_FINANCES :{BLACK}Informatiounen zu de Firmefinanzen STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_GENERAL :{BLACK}Generell Firmeninformatioun @@ -428,7 +429,7 @@ STR_TOWN_MENU_FOUND_TOWN :Stad grënnen # Subsidies menu ###length 1 -STR_SUBSIDIES_MENU_SUBSIDIES :Subventiounen +STR_SUBSIDIES_MENU_SUBSIDIES :Subside # Graph menu ###length 6 @@ -793,6 +794,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * P STR_STATUSBAR_AUTOSAVE :{RED}AUTOSPÄICHEREN STR_STATUSBAR_SAVING_GAME :{RED}* * SPÄICHERT D'SPILL * * +STR_STATUSBAR_SPECTATOR :{WHITE}(Zuschauer) # News message history STR_MESSAGE_HISTORY :{WHITE}Meldungshistorie @@ -894,9 +896,14 @@ STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO_OR_CARGO :{WHITE}{STATION STR_NEWS_STATION_NOW_ACCEPTS_CARGO :{WHITE}{STATION} akzeptéiert elo {STRING} STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION} akzeptéiert elo {STRING} an {STRING} -STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Subventioun ofgelaaf:{}{}{STRING} vun {STRING} op {STRING} gëtt net méi subventionéiert -STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subventioun entzunn:{}{}{STRING} Service vun {STRING} op {STRING} gëtt net méi subventionéiert +STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Subside ofgelaaf:{}{}{STRING} vun {STRING} op {STRING} gëtt net méi subventionéiert +STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subside entzunn:{}{}{STRING} Service vun {STRING} op {STRING} gëtt net méi subventionéiert +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Subside offréiert:{}{}Eischten {STRING} Service vun {STRING} op {STRING} gëtt mat engem Subside vun {NUM} Joer belount! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subside geet un {STRING}!{}{}{STRING} Service vun {STRING} op {STRING} gëtt déi nächst {NUM} Joer mat 50% Bonus bezuelt! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subside geet un {STRING}!{}{}{STRING} Service vun {STRING} op {STRING} gëtt déi nächst {NUM} Joer duebel bezuelt! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subside geet un {STRING}!{}{}{STRING} Service vun {STRING} op {STRING} gëtt déi nächst {NUM} Joer dräifach bezuelt! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subside geet un {STRING}!{}{}{STRING} Service vun {STRING} op {STRING} gëtt déi nächst {NUM} Joer véierfach bezuelt! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Trafficchaos an {TOWN}!{}{}Stroossenneibau deen vun {STRING} finanzéiert ginn ass bréngt 6 Méint Misère fir d'Autosfuerer! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transportmonopol! @@ -962,7 +969,7 @@ STR_GAME_OPTIONS_CURRENCY_MYR :Malaysesche Rin STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Lénks fueren STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Riets fueren -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Stiednimm +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Stiednimm: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Stil vun de Stiednimm wielen ###length 21 @@ -1001,6 +1008,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :All 12 Méint STR_GAME_OPTIONS_LANGUAGE :{BLACK}Sprooch STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Wielt d'Interfacesprooch aus +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% fäerdeg) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Vollbild STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Klick dës Optioun un fir OpenTTD am Vollbild ze spillen @@ -1014,6 +1022,8 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Hardware STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Dës Optioun wielen, dass OpenTTD Hardwarebeschleunigung dierf notzen. Wäert just geännert ginn wann d'Spill nei gestart gëtt STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}D'Astellung huet réicht en Afloss no engem Neistart vum Spill +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Wiel des Optioun fir de V-Sync unzeman. Des gëtt eréit no engem Neistart benotzt. Funktionéiert nëmmen wann Hardwarebeschleunigung un ass STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interfacegréisst STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Wiel d'Gréisst déi fir den Interface soll benotzt ginn @@ -1162,6 +1172,7 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Spillastellung STR_CONFIG_SETTING_TYPE_GAME_INGAME :Spillastellung (am Save gespäichert; betrëfft just aktuellt Spill) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Firmenastellung (am Save gespäichert; betrëfft just nei Spiller) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Firmenastellung (am Save gespäichert; betrëfft just déi aktuell Firma) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Opgepasst! STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Des Aktioun setzt all Wäerter op hier Standardastellungen zeréck.{}Bass du sécher, fir weiderzefueren? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Kategorie: @@ -1222,11 +1233,15 @@ STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Limitéier d'Un STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Gefierpannen: {STRING} STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Kontrolléirt wéi oft Gefierer eng Pann hunn déi net ordentlech an der Revisioun waren -STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Subventiounemultiplikator: {STRING} +STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Subsidemultiplikator: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Fixéiert wéivill fir subsidéiert Verbindunge bezuelt gëtt +STR_CONFIG_SETTING_SUBSIDY_DURATION :Subsidendauer: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Unzuel u Joren fir déi et e Subside gëtt +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} Jo{P er er} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Keng Subsiden STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Konstruktiounskäschten: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Bestëmm den Niveau vu Bau- a Kafkäschten @@ -1553,8 +1568,11 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Duebelklick STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Ee Klick (wann fokusséiert) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Ee Klick (direkt) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Relay-service benotzen: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Wann d'Verbindung op Server net klappt, kann een e Relay-Service benotzen fir eng Verbindung opzebauen. "Nie" verbidd dat, "froen" freed fir d'Eischt no, "erlaben" erlabt et ouni nozefroen. ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Nie +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Froen STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Erlaben STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Rietsklickemulatioun: {STRING} @@ -1755,8 +1773,8 @@ STR_CONFIG_SETTING_NEWS_NEW_VEHICLES_HELPTEXT :Weis d'Zeitung STR_CONFIG_SETTING_NEWS_CHANGES_ACCEPTANCE :Ännerung vun akzeptéierte Luedungen: {STRING} STR_CONFIG_SETTING_NEWS_CHANGES_ACCEPTANCE_HELPTEXT :Weis Messagen wa Statiounen Gidder akzeptéiren / net méi akzeptéiren -STR_CONFIG_SETTING_NEWS_SUBSIDIES :Subventiounen: {STRING} -STR_CONFIG_SETTING_NEWS_SUBSIDIES_HELPTEXT :Weis d'Zeitung a Relatioun mat Subventiounen +STR_CONFIG_SETTING_NEWS_SUBSIDIES :Subside: {STRING} +STR_CONFIG_SETTING_NEWS_SUBSIDIES_HELPTEXT :Weis d'Zeitung a Relatioun mat Subside STR_CONFIG_SETTING_NEWS_GENERAL_INFORMATION :Generell Informatiounen: {STRING} STR_CONFIG_SETTING_NEWS_GENERAL_INFORMATION_HELPTEXT :Weis Zeitung iwwert generell Evenementer, wéi z.b de Kaf vun exklusiven Transportrechter oder Stroosserenovéierungen @@ -1800,13 +1818,17 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Wielt d'Verhale STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Automatesch Diksen bauen firun: {STRING} STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Definéiert d'Joer wou elektresch Signaler benotzt ginn. Firun dësem Joer ginn nët-elektresch Signaler benotzt (déi déi selwescht Funktioun hunn, an just anescht ausgesinn) -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Wiessel duerch Signal-Typen: {STRING} +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Wiessel duerch Signaltypen: {STRING} STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Wielt Signaltypen déi durchgewielt ginn, wann ee mat Ctrl op e gebaute Signal dréckt ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Nëmmen Wee-Signaler -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Alleguerten +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Alleguerte sichtbar +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Signalltypen uweisen: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Wielt aus wéi eng Signaltypen an der Signaltoolbar ugewise ginn ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Nëmme Wee-Signaler +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :All Signaler STR_CONFIG_SETTING_TOWN_LAYOUT :Stroosselayout an neie Stied: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Layout fir d'Stroossennetz vun enger Stad @@ -1992,6 +2014,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Wuereverdeelung STR_CONFIG_SETTING_AI :{ORANGE}Géigner STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computerspiller +STR_CONFIG_SETTING_NETWORK :{ORANGE}Netzwierk STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Pfadfinder fir Zich: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Pfadfinder dee fir Zich benotzt gëtt @@ -2203,6 +2226,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Krawatt ###length 3 STR_NETWORK_SERVER_VISIBILITY_LOCAL :Lokal STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Effentlech +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Nemmen mat Invitatiounen # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Multiplayer @@ -2235,9 +2259,12 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Serverv STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Serveradress: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Startdatum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Momentanen Datum: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Spill-Script: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Passwuertgeschützt! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER VOLL +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SERVER HUET DECH GEBANNT +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVER ZE AAL STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIOUNSËNNERSCHEED STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF ËNNERSCHEEDLECH @@ -2250,11 +2277,12 @@ STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Am Inter STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Am LAN sichen STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Am LAN no Server sichen STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Server bäisetzen -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Setzt en Server op d'Lëscht wou ëmmer no enger Partie gesicht gëtt +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Setzt en Server op d'Lëscht. Des kann entweder eng Serveradress oder Invitatiounscode sinn STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Server starten STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Eegenen Server starten STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Gëff däin Numm an +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Server Adress oder Invitatiounscode aginn # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Nei Multiplayerpartie starten @@ -2265,6 +2293,7 @@ STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Passwuer STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}En Passwuert fir d'Spill setzen, dass et net Public accessibel ass STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Sichtbarkeet +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Ob aner Leit de Server an der ëffentlecher Lëscht gesinn STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} Spiller STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Maximal Spiller: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Maximal Unzuel vun de Clients. Et muss net all Slot gefëllt sinn. @@ -2297,24 +2326,64 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Server a STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Firma ass geschützt. Passwuert aginn # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Spillerlëscht +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Online Spiller +STR_NETWORK_COMPANY_LIST_SPECTATE :Nokucken # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Online Spiller +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Numm +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Numm vum Server op dem's du spills +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Den Numm vun dengem Server änneren STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Servernumm +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Sichtbarkeet +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Ob aner Leit de Server an der ëffentlecher Lëscht gesinn +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Invitatiounscode +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Mat dem Invitatiounscode kënnen aner Spliier dem Server bäitrieden STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Verbindungstyp +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Ob a wéi de Server vu bausse kann vun aneren erreecht ginn +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Spiller +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Numm STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK} Däin Spillernumm +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Spillernumm änneren +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Däi Spillernumm +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Administrativ Actiounen déi fir dese Client ze man sinn +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Administrativ Actiounen déi ze man sinn fir des Firma +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Deser Firma bäitrieden STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Desem Spiller e Message schécken +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Send e Message un all d'Leit vun deser Firma +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}E Message un all Zuschauer schécken +STR_NETWORK_CLIENT_LIST_SPECTATORS :Zuschauer +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Nei Firma) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Eng nei Firma erstellen an hier bäitrieden +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Dat bass du +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Dest ass den Host vun der Partie +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} Client{P "" en} / {NUM} Firm{P a en} # Matches ConnectionType ###length 5 STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Lokal +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Remote Spiller kënnen sech net connectéiren STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Effentlech +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Hannert NAT +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Via e Relay +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Kicken +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Bannen STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Läschen STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Password entspären +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Administrativ Actioun +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Bassde sécher dass du de Spiller '{STRING}' kicke wëlls? STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Bass du sécher, dass du de Spiller '{STRING}' banne wëlls? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Bass du sécher, dass du d'Firma '{COMPANY}' läsche wëlls? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Bassde sécher dass du d'Password vun der Firma '{COMPANY}' wëlls reseten? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Relay benotzen? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Konnt keng Verbindung tëschend dir an dem Server '{STRING}' opbauen.{}Wëlls du des Verbindung iwwert de Relay '{STRING}' man? +STR_NETWORK_ASK_RELAY_NO :{BLACK}Nee +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Jo, des Kéier +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Jo, fro net nach eng Kéier STR_NETWORK_SPECTATORS :Zuschauer @@ -2343,18 +2412,20 @@ STR_NETWORK_CHAT_TO_COMPANY :[Team] Un: {STR STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] Un: {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[All] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Text fir Chat aginn # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Keng Netzwierkgeräter fonnt -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}De Server huet net op d'Ufro geäntwert +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Verbindung op de Server krut en Timeout oder gouf refuséiert STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Konnt sech wéinst ënnerscheedlechen NewGRF net connectéieren STR_NETWORK_ERROR_DESYNC :{WHITE}Netzwierksyncronisatiouns-Fehler STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Netzwierkverbindung verluer STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Konnt de Spillstand net lueden STR_NETWORK_ERROR_SERVER_START :{WHITE}Konnt de Server net starten STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}En Protokolfehler ass entstaanen an d'Connectioun ass getrennt ginn -STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}De Servernumm gouf net definéiert. Den Numm kann iwwert der Multiplayerfënster gesat ginn. +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Däi Spillernumm gouf net definéiert. Den Numm kann iwwert der Multiplayerfënster gesat ginn +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}De Servernumm gouf net definéiert. Den Numm kann iwwert der Multiplayerfënster gesat ginn STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}D'Versioun vum Client stëmmt net mat däer vum Server iwwereneen STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Falscht Passwuert STR_NETWORK_ERROR_SERVER_FULL :{WHITE}De Server ass voll @@ -2367,6 +2438,7 @@ STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Du hues STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Däin Computer brauch ze laang fir bäizetrieden STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}Du hues ze laang gebraucht fir d'Kaart rofzelueden STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Du hues ze laang gebraucht fir dem Server bäizetrieden +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Däi Spillernumm ass ongülteg STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Méigleche Verbindungsverloscht STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}Déi lescht {NUM} Sekonnen{P "" s} sinn keng Daten vum Server komm @@ -2425,6 +2497,8 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}De Serve STR_NETWORK_MESSAGE_KICKED :*** {STRING} gouf gekickt. Grond: ({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Server Registration huet net geklappt +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}En anere Server mat dem selweschten Invitatiounscode huet sech registréiert. Wiesselen op Spilltyp "lokal". +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}De Server erlabt keng remote Verbindungen STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Aner Spiller wäerte sech net op de Server verbanne kënnen # Content downloading window @@ -2684,7 +2758,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Schëffs STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Plazéiert eng Boje, déi als Weepunkt kann benotzt ginn. Shift wiesselt tëscht bauen/ongeféier Käschten uweisen STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Aquadukt bauen. Shift wiesselt tëscht bauen/ongeféier Käschten uweisen STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Waasserareal definéieren.{}Mécht en Kanal. Mat Ctrl gedréckt halen um Mieresspigel klicken, iwwerflut d'Géigent -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Plazéier Flëss +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Plazéier Flëss. Ctrl wielt d'Land diagonal aus # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Schëffsschapp Ausriichtung @@ -3231,6 +3305,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Warnung: { STR_NEWGRF_ERROR_MSG_ERROR :{RED}Fehler: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatal: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}E fatalen NewGRF Fehler ass geschitt:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}En NewGRF Fehler ass geschitt:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} wärt net mat der TTDPatch Versioun déi vun OpenTTD erkannt gouf funktionéiren STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} ass fir {STRING} Versioun vun TTD STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} ass designed fir mat {STRING} benotzt ze ginn @@ -3423,11 +3498,11 @@ STR_GOAL_QUESTION_BUTTON_SURRENDER :Opginn STR_GOAL_QUESTION_BUTTON_CLOSE :Zouman # Subsidies window -STR_SUBSIDIES_CAPTION :{WHITE}Subventiounen -STR_SUBSIDIES_OFFERED_TITLE :{BLACK}Subventiounen fir de Service: +STR_SUBSIDIES_CAPTION :{WHITE}Subside +STR_SUBSIDIES_OFFERED_TITLE :{BLACK}Subside fir de Service: STR_SUBSIDIES_OFFERED_FROM_TO :{ORANGE}{STRING} vun {STRING} op {STRING}{YELLOW} (bis {DATE_SHORT}) STR_SUBSIDIES_NONE :{ORANGE}- Keng - -STR_SUBSIDIES_SUBSIDISED_TITLE :{BLACK}Servicer mat Subventiounen: +STR_SUBSIDIES_SUBSIDISED_TITLE :{BLACK}Servicer mat Subside: STR_SUBSIDIES_SUBSIDISED_FROM_TO :{ORANGE}{STRING} vun {STRING} op {STRING}{YELLOW} ({COMPANY}{YELLOW}, bis {DATE_SHORT}) STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Klick op de Service fir d'Usiicht op d'Industrie/Stad ze zentréieren. Ctrl+Klick erstellt eng nei Usiicht op d'Industrie/Stad @@ -3716,7 +3791,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Klick fi STR_GROUP_DELETE_TOOLTIP :{BLACK}Déi ungewielte Grupp läschen STR_GROUP_RENAME_TOOLTIP :{BLACK}Déi ungewielte Grupp ëmbenennen STR_GROUP_LIVERY_TOOLTIP :{BLACK}Wiessel d'Faarwschema vun dem ausgewielte Grupp -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Klick fir déi Grupp vum globalen "Autoersetzen" auszeschléissen +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Klick fir déi Grupp vum globalen "Autoersetzen" auszeschléissen. Ctrl+klick protegéiert och Ennergruppen STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Grupp läschen STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Bassde sécher, dass du des Grupp an all Ennergruppen läsche wëlls? @@ -3997,7 +4072,9 @@ STR_REPLACE_MAGLEV_VEHICLES :Magnéitbunn Ge STR_REPLACE_ROAD_VEHICLES :Stroossegefierer STR_REPLACE_TRAM_VEHICLES :Tram-Gefierer +STR_REPLACE_REMOVE_WAGON :{BLACK}Waggon raushuelen: ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Mécht dass d'automatescht Austauschen d'Längt vum Zuch behält, an dem e Waggonen (vu lénks un) wechhëllt, wann d'Lok den Zuch ze laang mécht +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+Klick fir och ob Ennergruppen ze applizéiren # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} @@ -4066,6 +4143,9 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Ennerwe STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Ennerwee an den {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Revisioun am {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Kann {STATION} net erreechen, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Kann {WAYPOINT} net erreechen, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Kann {DEPOT} net erreechen, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Kann den {DEPOT} net erreechen, {VELOCITY} # Vehicle stopped/started animations diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 2062d50174..a3246b72b1 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -3137,7 +3137,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP :{BLACK}Wybuduj STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Zbuduj port. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Ustaw boję, która może być użyta jako pkt. orientacyjny. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Zbuduj akwedukt. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów -STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Stwórz akwen wodny.{}Tworzy kanał, chyba że przyrzymany jest CTRL na poziomie morza, wtedy pobliski teren zostanie zatopiony +STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Stwórz akwen wodny.{}Tworzy kanał, chyba że przytrzymany jest CTRL na poziomie morza, wtedy pobliski teren zostanie zatopiony STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Umieszczanie rzek. Ctrl zaznacza obszar po przekątnej. # Ship depot construction window diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index ea10458d7f..e3a9c8aad3 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -685,6 +685,7 @@ STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE :{BLACK}Comutato STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION :{BLACK}Afișează fereastra pentru selecția melodiilor # Playlist window +STR_PLAYLIST_MUSIC_SELECTION_SETNAME :{WHITE}Program muzical - '{STRING}' STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTBLUE}{ZEROFILL_NUM} "{STRING}" STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Lista melodiilor STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Program - '{STRING}' @@ -952,6 +953,7 @@ STR_GAME_OPTIONS_CURRENCY_RUB :Ruble rusești STR_GAME_OPTIONS_CURRENCY_MXN :Peso Mexican (MXN) STR_GAME_OPTIONS_CURRENCY_NTD :Noul Dolar Taiwanez (NTD) STR_GAME_OPTIONS_CURRENCY_CNY :Renminbi Chinezesc (CNY) +STR_GAME_OPTIONS_CURRENCY_HKD :Dolar Hong Kong (HKD) STR_GAME_OPTIONS_CURRENCY_INR :Rupia Indiană (INR) STR_GAME_OPTIONS_CURRENCY_IDR :Rupia indoneziană (IDR) STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit Malaysian (MYR) @@ -1009,6 +1011,7 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :(alta/nespecifi STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Accelerare hardware +STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Bifați căsuța ca OpenTTD să încerce utilizarea accelerației hardware. Modificarea setării va avea efect după repornirea jocului STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Setarea va avea efect doar după repornirea jocului STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync @@ -1149,6 +1152,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Setări STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filtru: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Extinde toate STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Colapsează toate +STR_CONFIG_SETTING_RESET_ALL :{BLACK}Resetează toate valorile STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(descrierea nu este disponibilă) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valoare implicită: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Tip setare: {ORANGE}{STRING} @@ -1219,6 +1223,7 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Controlează c STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Multiplicator al subvențiilor: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Alege cât de mult se plătește pentru conexiuni subvenționate +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Stabilește numărul de ani pentru care se acordă o subvenție STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} {P an ani "de ani"} ###setting-zero-is-special @@ -1787,7 +1792,7 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Ciclu prin tipu STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Selectează între care tipuri de semnale să se cicleze când se apasă Ctrl+Click pe un semnal folosind unealta de construcţie ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Doar avansat -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Toate +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Toate vizibile ###length 2 @@ -1802,7 +1807,7 @@ STR_CONFIG_SETTING_TOWN_LAYOUT_RANDOM :aleator STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :Oraşele pot construi drumuri: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite ca orașele să construiască șosele pentru a se dezvolta. Dezactivează pentru a nu permite orașelor să construiască independent șosele -STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Oraşele au voie să construiască treceri la nivel cu calea ferată: {STRING} +STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Orașele au voie să construiască treceri la nivel cu calea ferată: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Dacă este activată, orașele vor putea să construiască treceri la nivel cu calea ferată STR_CONFIG_SETTING_NOISE_LEVEL :Permite controlarea nivelului de zgomot al aeroportului de către oras: {STRING} @@ -2272,13 +2277,17 @@ STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Jucători conec # Network client list STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Nume STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Modifică numele serverului tău STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Vizibilitate STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Dacă alți oameni îți pot vedea serverul în lista publică +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Cod de invitație +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Nume STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Modifică-ți numele STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Numele tău de jucător STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Trimite un mesaj tuturor jucătorilor acestei companii STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Trimite un mesaj tuturor spectatorilor +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Creează o nouă companie și intră în ea # Matches ConnectionType ###length 5 @@ -2323,7 +2332,7 @@ STR_NETWORK_CHAT_OSKTITLE :{BLACK}Introdu # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nu am detectat o placă de reţea sau jocul a fost compilat fără ENABLE_NETWORK -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Serverul nu a răspuns cererii +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Conexiunea la server nu s-a efectuat în timp util sau a fost refuzată STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Nu m-am putut conecta din cauza unei nepotriviri NewGRF STR_NETWORK_ERROR_DESYNC :{WHITE}Sincronizarea jocului în reţea a eşuat STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Conexiunea jocului în reţea a fost întreruptă @@ -2341,6 +2350,7 @@ STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}A expira STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Calculatorul dvs. este prea lent pentru a se sincroniza cu serverul STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}A expirat timpul pentru descărcarea hărţii STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}A expirat timpul pentru conectarea la server +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Numele tău de jucător nu este valid STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Posibilă pierdere a conexiunii STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}În ultimele {NUM} secunde nu s-au mai primit date de la server @@ -3359,6 +3369,7 @@ STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Click pe # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY} Carte de poveste STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}Cartea de poveste globală +STR_STORY_BOOK_SPECTATOR :Cartea de poveste globală STR_STORY_BOOK_TITLE :{YELLOW}{STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :Pagina {NUM} STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Sari la o pagină specifică selectând-o din lista derulantă @@ -3570,6 +3581,7 @@ STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nivelul STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Industria a anunţat închiderea iminentă! STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Necesită: {YELLOW}{STRING}{STRING} +STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Produce: {YELLOW}{STRING}{STRING} STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Necesită: @@ -3688,6 +3700,7 @@ STR_PURCHASE_INFO_NONE :Niciunul STR_PURCHASE_INFO_ALL_BUT :Toate, cu excepţia {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Efort tractor max.: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Rază acțiune: {GOLD}{COMMA} pătrățele +STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Tip de aeronavă: {GOLD}{STRING} ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Lista de selectie a componentelor trenului - clic pe vehicule pt. informatii @@ -3704,6 +3717,7 @@ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Cumpăr ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și adaptează vehiculul STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și repară vehiculul +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și recondiționează nava STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și schimbă marfa transportată de aeronavă ###length VEHICLE_TYPES @@ -4655,6 +4669,7 @@ STR_ERROR_NO_SUITABLE_RAILROAD_TRACK :{WHITE}Cale fer STR_ERROR_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Mai întâi trebuie înlăturată calea ferată STR_ERROR_CROSSING_ON_ONEWAY_ROAD :{WHITE}Drum cu sens unic sau blocat STR_ERROR_CROSSING_DISALLOWED_RAIL :{WHITE}Trecerea la nivel nu este permisă pentru acest tip de cale ferată +STR_ERROR_CROSSING_DISALLOWED_ROAD :{WHITE}Trecerea la nivel cu calea ferată nu este permisă pe acest tip de drum STR_ERROR_CAN_T_BUILD_SIGNALS_HERE :{WHITE}Nu se pot plasa semafoare aici... STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK :{WHITE}Nu se poate construi cale ferată aici... STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK :{WHITE}Nu se poate înlătura calea ferată... diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 3efeee8160..f3728f7dcb 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -430,7 +430,7 @@ STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Naslov - STR_TOOLTIP_SHADE :{BLACK}Zamotaj prozor - prikazuje se samo naslov STR_TOOLTIP_DEBUG :{BLACK}Prikazuje NewGRF podatake o otklanjanju grešaka STR_TOOLTIP_DEFSIZE :{BLACK}Menja veličinu prozora na podrazumevanu. Ctrl+Klik da sačuvate tekuću veličinu kao podrazumevanu -STR_TOOLTIP_STICKY :{BLACK}Markirajte ovaj prozor kao ne za zatvaranje tipkom 'Zatvaranje svih prozora'. Uz Ctrl+Click to stanje će biti zapamćeno. +STR_TOOLTIP_STICKY :{BLACK}Markirajte ovaj prozor kao ne za zatvaranje tipkom 'Zatvaranje svih prozora'. Uz Ctrl+klik to stanje će biti zapamćeno. STR_TOOLTIP_RESIZE :{BLACK}Pritisnite i povucite kako bi prozor promenio veličinu STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW :{BLACK}Izbor velikog/malog prozora STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST :{BLACK}Skrol - pomera spisak gore/dole @@ -515,6 +515,7 @@ STR_GROUP_BY_SHARED_ORDERS :Deljene naredbe # Order button in shared orders vehicle list STR_GOTO_ORDER_VIEW :{BLACK}Naredbe +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Otvori pregled naredbi # Tooltips for the main toolbar ###length 31 @@ -533,7 +534,7 @@ STR_TOOLBAR_TOOLTIP_DISPLAY_GOALS_LIST :{BLACK}Pokaži STR_TOOLBAR_TOOLTIP_DISPLAY_GRAPHS :{BLACK}Prikaži grafikone STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_LEAGUE :{BLACK}Prikaži tabele lige preduzeća STR_TOOLBAR_TOOLTIP_FUND_CONSTRUCTION_OF_NEW :{BLACK}Finansiranje izgradnje nove fabrike, spisak svih fabrika -STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS :{BLACK}Prikaži spisak svih vozova preduzeća. Ctrl+Klik uključuje prikaz spiska grupe/vozila +STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS :{BLACK}Prikaži spisak svih vozova preduzeća. Ctrl+klik uključuje prikaz spiska grupe/vozila STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_ROAD_VEHICLES :{BLACK}Prikaži spisak svih drumskih vozila preduzeća. Ctrl+Klik uključuje otvaranje spiska grupe/vozila STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_SHIPS :{BLACK}Prikaži spisak svih brodova preduzeća. Ctrl+Klik uključuje otvaranje spiska grupe/vozila STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_AIRCRAFT :{BLACK}Prikaži spisak svih letelica preduzeća. Ctrl+Klik uključuje otvaranje spiska grupe/vozila @@ -680,7 +681,7 @@ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Obriši sve por STR_ABOUT_MENU_LAND_BLOCK_INFO :Podaci o zemljištu STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Uključi/isključi konzolu -STR_ABOUT_MENU_AI_DEBUG :Korekcija veštačke inteligencije / skripte partije +STR_ABOUT_MENU_AI_DEBUG :Korekcija veštačke inteligencije / skripte igre STR_ABOUT_MENU_SCREENSHOT :Sačuvaj sliku STR_ABOUT_MENU_SHOW_FRAMERATE :Prikaži brzinu smenjivaja slika STR_ABOUT_MENU_ABOUT_OPENTTD :O OpenTTD-u @@ -1092,7 +1093,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Ponuda subvencije istekla:{}{}Prevoz {STRING.gen} iz {STRING} u {STRING} se više neće stimulisati STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subvencija povučena:{}{}Usluga prevoza {STRING.gen} između stanica {STRING} i {STRING} više nije u opticaju +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Ponuda subvencije:{}{}Preduzeće koje prvo preveze {STRING.aku} od {STRING} do {STRING} stiče pravo na subvenciju u trajanju od {NUM} godina! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subvencija odobrena preduzeću {STRING}!{}{}Za prevoz {STRING.gen} između stanica {STRING} i {STRING} zarada će vredeti 50% više u narednih {NUM} godina! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subvencija odobrena preduzeću {STRING}!{}{}Za prevoz {STRING.gen} između stanica {STRING} i {STRING} zarada će vredeti dvostruko narednih {NUM} godina! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subvencija odobrena preduzeću {STRING}!{}{}Za prevoz {STRING.gen} između stanica {STRING} i {STRING} zarada će vredeti trostruko narednih {NUM} godina! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subvencija odobrena preduzeću {STRING}!{}{}Za prevoz {STRING.gen} između stanica {STRING} i {STRING} zarada će vredeti četvorostruko narednih {NUM} godina! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}{TOWN} - haos na ulicama!{}{}Program rekonstrukcije puteva sponzorisan od strane preduzeća {STRING} donosi vozačima 6 meseci agonije! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Prevoznički monopol! @@ -1158,8 +1164,8 @@ STR_GAME_OPTIONS_CURRENCY_MYR :Malezijski ring STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Levom stranom STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Desnom stranom -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Imena naselja -STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Izaberi stil imena gradova +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Imena naselja: +STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Izaberi stil imena naselja ###length 21 STR_GAME_OPTIONS_TOWN_NAME_ORIGINAL_ENGLISH :Engleska (Originalna) @@ -1211,6 +1217,8 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Hardvers STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Označavanje ove opcije čini da OpenTTD pokuša da koristi hardversko ubrzanje. Promena ovog podešavanja će imati efekta tek nakon ponvnog pokretanja igre STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Podešavanje će imati efekta tek nakon ponovnog pokretanja igre +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Štikliranjem se uključuje v-sync. Promena ovog podešavanja će biti vidljiva tek nakon ponovnog pokretanja igre. Radi jedino sa uključenim hardverskim ubrzanjem. STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Veličina interfejsa STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Izaberite većinu elementa koja će se koristiti @@ -1350,6 +1358,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Podešav STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filtriraj po: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Proširi sve STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Skupi sve +STR_CONFIG_SETTING_RESET_ALL :{BLACK}Resetuj sve vrednosti STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(nema objašnjenja) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Podrazumevana vrednost: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Vrsta podešavanja: {ORANGE}{STRING} @@ -1358,6 +1367,8 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Podešavanja ig STR_CONFIG_SETTING_TYPE_GAME_INGAME :Podešavanja igre (čuvaju se prilikom snimanja; utiču samo na tekuću igru) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Podešavanja preduzeća (čuvaju se prilikom snimanja; utiču samo na nove igre) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Podešavanja preduzeća (čuvaju se prilikom snimanja; utiču samo tekuće preduzeće) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Oprez! +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Ovo će resetovati sva podešavanja igre na početne vrednosti{}Da li ste sigurni da želite da nastavite? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Kategorija: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Vrsta: @@ -1420,8 +1431,12 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Koliko često m STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Množilac subvencije: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Podešava koliko se plaća za subvencionisane konekcije +STR_CONFIG_SETTING_SUBSIDY_DURATION :Trajanje subvencije: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Odredi broj godina trajanja subvencije +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} godina ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Bez subvencija STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Troškovi gradnje: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Podešava nivo troškova gradnje i kupovine @@ -1748,8 +1763,12 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dupli klik STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Klik (ako je u fokusu) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Klik (odmah) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Koristi relejni servis: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Ako uspostavljanje konekcije ka serveru ne uspe, moguće je koristiti relejni servis za uspostavljanje konekcije. Opcija "nikada" ovo ne dozvoljava, "pitaj" traži dozvolu od igrača, "dozvoli" dozvoljava bez pitanja. ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Nikada +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Pitaj +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Dozvoli STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Oponašanje desnog klika: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Odaberite metodu imitiranja klika na desnu dirku miša @@ -1995,13 +2014,15 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Automatsko post STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Postavite godinu za početak korištenja električnih signala za pruge. Prije ove godine, koristiti će se neelektrični signali (imaju iste funkcije samo izgledaju drugačije) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Ciklični izbor vrste signalizacije: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Ciklični izbor vrste signalizacije, kada Ctrl+Klik na izgradnju signala sa alatom signala +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Ciklični izbor vrste signalizacije kada Ctrl+klik na izgradnju signala sa alatom signala ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Samo putna -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Sva +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Sve vidljivo +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Prikaži vrste signala: {STRING} STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Postavi tip signala koji će se prikazati na traci sa alatima ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Samo putna signalizacija STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Svi signali STR_CONFIG_SETTING_TOWN_LAYOUT :Plan gradnje novih puteva u naseljima: {STRING} @@ -2188,6 +2209,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distribucija Tovara STR_CONFIG_SETTING_AI :{ORANGE}Suparnici STR_CONFIG_SETTING_AI_NPC :{ORANGE}Računar +STR_CONFIG_SETTING_NETWORK :{ORANGE}Mreža STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Pretraživanje putanja vozova: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Algoritam pronalaženja puta za vozove @@ -2277,7 +2299,7 @@ STR_QUIT_NO :{BLACK}Ne # Abandon game STR_ABANDON_GAME_CAPTION :{WHITE}Napuštanje partije STR_ABANDON_GAME_QUERY :{YELLOW}Da li stvarno želite da napustite ovu partiju? -STR_ABANDON_SCENARIO_QUERY :{YELLOW}Da li ste sigurni da želite da izađete iz ovog scenarija? +STR_ABANDON_SCENARIO_QUERY :{YELLOW}Da li stvarno želite da izađete iz ovog scenarija? # Cheat window STR_CHEATS :{WHITE}Varanja @@ -2397,7 +2419,9 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Promena # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Lokalno STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Javno +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Samo uz pozivnicu # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Mrežna partija @@ -2430,10 +2454,12 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Verzija STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Adresa servera: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Početni datum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Trenutni datum: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Skripta igre: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Zaštićeno šifrom! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER JE VAN MREŽE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER JE POPUNJEN STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SERVER VAS JE BLOKIRAO +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVER JE ZASTAREO STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}NEODGOVARAJUĆA VERZIJA STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF NEPOKLAPANJE @@ -2446,7 +2472,7 @@ STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Pretraž STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Pretraži LAN STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Pronađi servere na lokalnoj mreži STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Dodaj server -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Dodaje server na spisak na kojem se uvek proverava za aktivne partije +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Dodaje server na spisak. Može biti adresa servera ili kod pozivnice STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Pokreni server STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Pokrenite sopstveni server @@ -2461,6 +2487,8 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}Naziv pa STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Postavi lozinku STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Ukoliko ne želite da bude javno dostupna zaštitite Vašu partiju lozinkom +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Vidljivost +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Da li drugi igrači mogu videti tvoj server na javnom spisku STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} igrač{P "" a a} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Najviše igrača: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Odaberite koliko najviše može da ima igrača. Nemoraju sva mesta da budu popunjena @@ -2493,7 +2521,7 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Server j STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Preduzeće je zaštićeno. Unesite lozinku # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Spisak klijenata +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Prisutni igrači STR_NETWORK_COMPANY_LIST_SPECTATE :Posmatranje # Network client list @@ -2501,22 +2529,56 @@ STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Prisutni STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Naziv STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Naziv servera na kojem igraš +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Promeni naziv servera +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Naziv servera +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Vidljivost +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Da li drugi igrači mogu videti tvoj server na javnom spisku STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Kod pozivnice +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Kod pozivnice koji drugi igrači mogu koristiti da se povežu na server +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Vrsta konekcije +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Da li i na koji način drugi mogu pristupiti serveru STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Igrač +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Ime STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Ime igrača +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Promeni svoje ime +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Ime igrača +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Administratorske akcije za ovaj klijent +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Administratorske akcije za ovu kompaniju +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Priključi se ovoj kompaniji +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Pošalji poruku ovom igraču +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Pošalji poruku svim igračima ove kompanije STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Pošalji poruku svim posmatračima +STR_NETWORK_CLIENT_LIST_SPECTATORS :Posmatrači +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(nova kompanija) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Napravi novu kompaniju i pridruži joj se +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Ovo si ti +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Ovo je domaćin igre +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} klijen{P t ata ata} / {NUM} kompanij{P e a a} # Matches ConnectionType ###length 5 STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Lokalno +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Spoljni igrači se ne mogu priključiti +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Javno +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Iza NAT-a +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Preko releja +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Izbaci STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Zabrana STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Obriši +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Otključavanje lozinkom STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Administratorska akcija -STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Da li sigurno želite da promenite lozinku kompanije '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Da li stvarno želite da izbacite igrača '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Da li stvarno želite da blokirate igrača '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Da li stvarno želite da obrišete kompaniju '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Da li stvarno želite da promenite lozinku kompanije '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Koristi relej? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Neuspelo uspostavljanje konekcije sa serverom '{STRING}'.{}Da li želite da uspostavite relejnu konekciju preko '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Ne +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Da, jednom +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Da, ne pitaj ponovo STR_NETWORK_SPECTATORS :Posmatrači @@ -2545,11 +2607,12 @@ STR_NETWORK_CHAT_TO_COMPANY :[Ekipi] Za {STR STR_NETWORK_CHAT_CLIENT :[Privatno] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privatno] Za {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Svima] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Unesite tekst poruke za razgovor # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Nijedan mrežni uređaj nije nađen ili je igra kompajlirana bez ENABLE_NETWORK -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Server nije odgovorio na zahtev +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Konekcija ka serveru je istekla ili nije dozvoljena STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Povezivanje je neuspešno zbog nepoklapanja NewGRF-ova STR_NETWORK_ERROR_DESYNC :{WHITE}Neuspešna sinhronizacija mrežne partije STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Veza sa mrežnom partijom je pukla @@ -2557,6 +2620,7 @@ STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Neuspeš STR_NETWORK_ERROR_SERVER_START :{WHITE}Neuspešno pokretanje servera STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Nastala je greška u protokolu i veza je zatvorena STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Ime igrača nije podešeno. Ono se može podesiti na vrhu prozora Partija preko mreže +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Naziv tvog servera nije podešen. Naziv može biti promenjen na vrhu prozora Partija preko mreže STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Revizija igre ovog klijenta se ne poklapa sa revizijom servera STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Pogrešna lozinka STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Server je pun @@ -2569,6 +2633,7 @@ STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Trebalo STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Računar je suviše spor da bi ispratio rad servera STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}Računaru je suviše dugo trebalo da preuzme mapu STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Računaru je suviše dugo trebalo da se priključi serveru +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Vaš naziv igrača nije ispravan STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Moguć gubitak veze STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}U poslednj{P 0 oj e ih} {NUM} sekund{P i e i} nije primljen nijedan podatak sa servera @@ -2594,6 +2659,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :lozinka nije pr STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :istekao veremnski rok STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :preuzimanje terena je previše dugo trajalo STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :obrađivanje terena je previše dugo trajalo +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :neispravan naziv klijenta # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2626,6 +2692,9 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server s STR_NETWORK_MESSAGE_KICKED :*** {STRING} je izvačen. Razlog: ({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Neuspešna registracija na serveru +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Drugi server sa istim kodom pozivnice je već registrovan. Tip igre je promenjen na "lokalno". +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Vaš server ne dozvoljava spoljne konekcije +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Drugi igrači neće moći da pristupe serveru # Content downloading window STR_CONTENT_TITLE :{WHITE}Dodaci za preuzimanje @@ -2811,7 +2880,7 @@ STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Izlazna STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Kombinovana Signalizacija (svetlosni semafor){}Kombinovana signalizacija se ponaša kao ulazna i izlazna signalizacija. Ovim se omogućava gradnja velikih "stabala" predsignalizacije STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Putna Signalizacija (svetlosni semafor){}Putna signalizacija omogućava da više vozova istovremeno uđe u istu deonicu, ukoliko mogu da obezbede put do zasebnog zaustavnog koloseka. Standardnu putnu signalizaciju moguće je proći i sa suprotnog smera STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Jednosmerna Putna Signalizacija (svetlosni semafor){}Putna signalizacija omogućava da više vozova istovremeno uđe u istu deonicu, ukoliko mogu da obezbede put do zasebnog zaustavnog koloseka. Jednosmerna putna signalizacija zabranjuje prolaz sa suprotnog smera -STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Promena Signalizacije{}Kada je označeno, klikom na postojeću signalizaciju promeniće je na izabranu vrstu i podvrstu, sa Ctrl+Klik će se označiti postojeća podvrsta. Shift+Klik prikazuje procenu troškova promene +STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Promena Signalizacije{}Kada je označeno, klikom na postojeću signalizaciju promeniće je na izabranu vrstu i podvrstu, sa Ctrl+klik će se označiti postojeća podvrsta. Shift+klik prikazuje procenu troškova promene STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Razmak između signalizacija tokom povlačenja STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Smanjivanje razmaka između signalizacija STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Povećavanje razmaka između signalizacija @@ -2884,7 +2953,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Gradnja STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Postavlja bovu kako bi služila kao putokaz. Shift prebacuje između postavljanja i prikaza procene troškova STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Izgradnja akvadukta. Shift prebacuje između izgradnje i prikaza procene troškova STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Vodena površina.{}Napravite kanal, ukoliko držite i Ctrl dok ste na nivou mora, tada popunjavate okolinu vodom -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Postavljanje reka +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Postavljanje reka. Ctrl obeležava dijagonalno područje # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Orijentacija brodskog hangara @@ -2963,7 +3032,7 @@ STR_TERRAFORM_RESET_LANDSCAPE :{BLACK}Obnovi r STR_TERRAFORM_RESET_LANDSCAPE_TOOLTIP :{BLACK}Uklanja sve objekte u vlasništvu preduzeća sa terena STR_QUERY_RESET_LANDSCAPE_CAPTION :{WHITE}Obnovi reljef -STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Da li sigurno želite da uklonite sve objekte u vlasništvu preduzeća? +STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Da li stvarno želite da uklonite sve objekte u vlasništvu preduzeća? # Town generation window (SE) STR_FOUND_TOWN_CAPTION :{WHITE}Stvaranje naselja @@ -3510,7 +3579,7 @@ STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Uključu # Sign window STR_EDIT_SIGN_CAPTION :{WHITE}Unos teksta znaka -STR_EDIT_SIGN_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju znaka. Ctrl+Klik otvara novi pogled na znak +STR_EDIT_SIGN_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju znaka. Ctrl+klik otvara novi pogled na znak STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP :{BLACK}Položaj sledećeg znaka STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP :{BLACK}Položaj prethodnog znaka @@ -3723,7 +3792,7 @@ STR_STATION_VIEW_CLOSE_AIRPORT_TOOLTIP :{BLACK}Spreči STR_WAYPOINT_VIEW_CAPTION :{WHITE}{WAYPOINT} STR_WAYPOINT_VIEW_CENTER_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju čvorišta. Ctrl+Klik otvara novi pogled na čvorište STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME :{BLACK}Promena naziva putanje -STR_BUOY_VIEW_CENTER_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju bove. Ctrl+Klik otvara novi pogled na bovu +STR_BUOY_VIEW_CENTER_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju bove. Ctrl+klik otvara novi pogled na bovu STR_BUOY_VIEW_CHANGE_BUOY_NAME :{BLACK}Promeni naziv bove STR_EDIT_WAYPOINT_NAME :{WHITE}Promena naziva putanje @@ -3805,8 +3874,8 @@ STR_COMPANY_VIEW_PRESIDENT_NAME_TOOLTIP :{BLACK}Promena STR_COMPANY_VIEW_BUY_SHARE_BUTTON :{BLACK}Otkupi 25% udela u preduzeću STR_COMPANY_VIEW_SELL_SHARE_BUTTON :{BLACK}Prodaj 25% udela u preduzeću -STR_COMPANY_VIEW_BUY_SHARE_TOOLTIP :{BLACK}Otkup 25% udela u ovom preduzeću. Shift+Klik prikazuje procenu troškova bez kupovine udela -STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Prodaja 25% udela u ovom preduzeću. Shift+Klik prikazuje procenu zarade bez prodaje udela +STR_COMPANY_VIEW_BUY_SHARE_TOOLTIP :{BLACK}Otkup 25% udela u ovom preduzeću. Shift+klik prikazuje procenu troškova bez kupovine udela +STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Prodaja 25% udela u ovom preduzeću. Shift+klik prikazuje procenu zarade bez prodaje udela STR_COMPANY_VIEW_COMPANY_NAME_QUERY_CAPTION :Ime Preduzeća STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :Ime vlasnika @@ -3917,10 +3986,10 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Klikom s STR_GROUP_DELETE_TOOLTIP :{BLACK}Briše se označena grupa STR_GROUP_RENAME_TOOLTIP :{BLACK}Preimenovanje označene grupe STR_GROUP_LIVERY_TOOLTIP :{BLACK}Promena boja odabrane grupe -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Klikom se ova grupa štiti od globalne automatske zamene +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Klikom se ova grupa štiti od globalne automatske zamene. Ctrl+klik da se zaštite i podgrupe. STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Izbriši grupu -STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Da li ste sigurni da elite izbrisati ovu grupu i sve podgrupe? +STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Da li stvarno želite da izbrišete ovu grupu i sve podgrupe? STR_GROUP_ADD_SHARED_VEHICLE :Dodaj deljeno vozilo STR_GROUP_REMOVE_ALL_VEHICLES :Ukloni sva vozila @@ -4054,7 +4123,7 @@ STR_DEPOT_VEHICLE_TOOLTIP_CHAIN :{BLACK}{NUM} vo STR_DEPOT_VEHICLE_TOOLTIP_CARGO :{}{CARGO_LONG} ({CARGO_SHORT}) ###length VEHICLE_TYPES -STR_DEPOT_TRAIN_LIST_TOOLTIP :{BLACK}Vozovi - prevlačenjem se vozila dodaju/uklanjaju iz kompozicije, desni klik na voz za podatke o njemu, CTRL i desni klik za podatke o kompoziciji +STR_DEPOT_TRAIN_LIST_TOOLTIP :{BLACK}Vozovi - prevlačenjem se vozila dodaju/uklanjaju iz kompozicije, desni klik na voz za podatke o njemu, Drži Ctrl da primeniš obe funkcije na ceo lanac STR_DEPOT_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Vozila - desni klik na vozilo za podatke o njemu STR_DEPOT_SHIP_LIST_TOOLTIP :{BLACK}Brodovi - desni klik na brod za podatke o njemu STR_DEPOT_AIRCRAFT_LIST_TOOLTIP :{BLACK}Letilice - desni klik na letilicu za podatke o njoj @@ -4096,16 +4165,16 @@ STR_DEPOT_CLONE_SHIP :{BLACK}Kopiraj STR_DEPOT_CLONE_AIRCRAFT :{BLACK}Kopiraj Letilicu ###length VEHICLE_TYPES -STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Ovim ćete kupiti istu kompoziciju. Kliknite na dugme i potom na voz koji je u ili van depoa. Sa Ctrl+Klik će imati zajedničke naredbe. Shift+Klik prikazuje procenu troškova bez kupovine -STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Ovim ćete kupiti isto drumsko vozilo. Kliknite na dugme i potom na drumsko vozilo koje je u ili van depoa. Sa Ctrl+Klik će imati zajedničke naredbe. Shift+Klik prikazuje procenu troškova bez kupovine -STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Ovim ćete kupiti isti brod. Kliknite na dugme i potom na brod koji je u ili van depoa. Sa Ctrl+Klik će imati zajedničke naredbe. Shift+Klik prikazuje procenu troškova bez kupovine -STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Ovim ćete kupiti istu letilicu. Kliknite na dugme i potom na letilicu koje je u ili van depoa. Sa Ctrl+Klik će imati zajedničke naredbe. Shift+Klik prikazuje procenu troškova bez kupovine +STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Ovim ćete kupiti istu kompoziciju. Kliknite na dugme i potom na voz koji je u ili van depoa. Sa Ctrl+klik će imati zajedničke naredbe. Shift+klik prikazuje procenu troškova bez kupovine +STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Ovim ćete kupiti isto drumsko vozilo. Kliknite na dugme i potom na drumsko vozilo koje je u ili van depoa. Sa Ctrl+klik će imati zajedničke naredbe. Shift+klik prikazuje procenu troškova bez kupovine +STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Ovim ćete kupiti isti brod. Kliknite na dugme i potom na brod koji je u ili van depoa. Sa Ctrl+klik će imati zajedničke naredbe. Shift+klik prikazuje procenu troškova bez kupovine +STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Ovim ćete kupiti istu letilicu. Kliknite na dugme i potom na letilicu koje je u ili van depoa. Sa Ctrl+klik će imati zajedničke naredbe. Shift+klik prikazuje procenu troškova bez kupovine ###length VEHICLE_TYPES -STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju železničkog depoa. Ctrl+Klik otvara novi pogled na železnički depo -STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju drumskog depoa. Ctrl+Klik otvara novi pogled na drumski depo -STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju brodskog depoa. Ctrl+Klik otvara novi pogled na brodski depo -STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju hangara. Ctrl+Klik otvara novi pogled na hangar +STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju železničkog depoa. Ctrl+klik otvara novi pogled na železnički depo +STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju drumskog depoa. Ctrl+klik otvara novi pogled na drumski depo +STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju brodskog depoa. Ctrl+klik otvara novi pogled na brodski depo +STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Prebacuje glavni pogled na lokaciju hangara. Ctrl+klik otvara novi pogled na hangar ###length VEHICLE_TYPES STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TOOLTIP :{BLACK}Dohvata spisak svih vozova sa ovim depoom u naredbama @@ -4214,7 +4283,9 @@ STR_REPLACE_MAGLEV_VEHICLES :Magnetnošinska STR_REPLACE_ROAD_VEHICLES :Drumska vozila STR_REPLACE_TRAM_VEHICLES :Tramvajska vozila +STR_REPLACE_REMOVE_WAGON :{BLACK}Uklanjanje vagona ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Ukoliko bi se zamenom kompozicija produžila, automatska obnova će ukloniti vagone (sa početka) kako bi se zadržala dužina kompozicije +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+klik da se primeni i na podgrupe # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} @@ -4284,6 +4355,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Ide ka STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Servisiranje u {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Ne može dostići {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Ne može dostići {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Ne može dostići {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Ne može dostići {DEPOT}, {VELOCITY} # Vehicle stopped/started animations @@ -4648,8 +4721,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Jedna od STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}Prozor za korigovanje VI / Skripte Partije je dostupan samo na serveru # AI configuration window -STR_AI_CONFIG_CAPTION :{WHITE}Podešavanja VI / Skripte Partije -STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Skripta parije koja će biti pokrenuta u sledećoj partiji +STR_AI_CONFIG_CAPTION :{WHITE}Podešavanja VI / skripte igre +STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Skripta igre koja će biti pokrenuta u sledećoj partiji STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}Veštačke inteligencije koje će biti pokrenute u sledećoj partiji STR_AI_CONFIG_HUMAN_PLAYER :Ljudsko biće STR_AI_CONFIG_RANDOM_AI :Proizvoljna VI @@ -4660,13 +4733,13 @@ STR_AI_CONFIG_MOVE_UP_TOOLTIP :{BLACK}Pomera o STR_AI_CONFIG_MOVE_DOWN :{BLACK}Pomeri Naniže STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Pomera obeleženu VI naniže u listi -STR_AI_CONFIG_GAMESCRIPT :{SILVER}Skripta Partije +STR_AI_CONFIG_GAMESCRIPT :{SILVER}Skripta igre STR_AI_CONFIG_AI :{SILVER}VIe STR_AI_CONFIG_CHANGE :{BLACK}Izaberi {STRING} STR_AI_CONFIG_CHANGE_NONE : STR_AI_CONFIG_CHANGE_AI :VI -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Skripta Partije +STR_AI_CONFIG_CHANGE_GAMESCRIPT :Skripta igre STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Učitava drugu skriptu STR_AI_CONFIG_CONFIGURE :{BLACK}Podešavanje STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Podešavanje parametara skripte diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 82b49c7022..412f56baf7 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -326,6 +326,8 @@ STR_GROUP_BY_NONE :无 STR_GROUP_BY_SHARED_ORDERS :共享调度计划 # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}命令 +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}打开调度计划视图 # Tooltips for the main toolbar ###length 31 @@ -896,7 +898,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}财政补贴项目到期:{}{}将 {STRING} 从 {STRING} 运送到 {STRING} 将不再获得财政补贴。 STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}财政补贴项目流标:{}{}将 {STRING} 从 {STRING} 运送到 {STRING} 将不是财政补贴项目。 +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}财政补贴项目招标:{}{}第一个将 {STRING} 从 {STRING} 运送到 {STRING} 的公司将获得地方政府为期 {NUM} 年的财政补贴! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}{STRING} 获得财政补贴!{}{}今后 {4:NUM} 年中将 {1:STRING} 从 {2:STRING} 运送到 {3:STRING} 将获得 50% 的额外报酬! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}{STRING} 获得财政补贴!{}{}今后 {4:NUM} 年中将 {1:STRING} 从 {2:STRING} 运送到 {3:STRING} 将获得双倍的报酬! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}{STRING} 获得财政补贴!{}{}今后 {4:NUM} 年中将 {1:STRING} 从 {2:STRING} 运送到 {3:STRING} 将获得三倍的报酬! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}{STRING} 获得财政补贴!{}{}今后 {4:NUM} 年中将 {1:STRING} 从 {2:STRING} 运送到 {3:STRING} 将获得四倍的报酬! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}{TOWN}的交通陷入混乱!{}{}由 {STRING} 资助的市政道路重建导致市内交通瘫痪 6 个月! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}垄断运输! @@ -1812,12 +1819,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :在 {STRING} STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :设置电子信号灯出现的时间,在此之前,使用悬臂信号灯(功能相同,外观不同) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :在以下信号类型中循环: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :选择用Ctrl+点击的方式切换信号灯时的切换类型 +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :选择用Ctrl+点击的方式切换信号灯类型时的备选类型 ###length 2 -STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :仅有路径信号灯 -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :全部 +STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :仅路径信号灯 +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :全部可见 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :显示信号类型: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :选择在信号工具栏里显示哪些信号灯类型 ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :仅路径信号灯 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :所有信号 STR_CONFIG_SETTING_TOWN_LAYOUT :新建城镇道路自动延伸: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :选择城市道路网络的建设方式 @@ -2252,6 +2263,8 @@ STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}游戏 STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}有密码保护! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}服务器离线 STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}服务器满员 +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}您已被该服务器封禁 +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}服务器版本太旧 STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}版本不匹配 STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF 不匹配 @@ -2314,6 +2327,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}公司 # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :在线玩家 +STR_NETWORK_COMPANY_LIST_SPECTATE :观赛 # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}在线玩家 @@ -2366,6 +2380,7 @@ STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}你确 STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}你确定要重置 {COMPANY} 的公司密码吗? STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}使用中继? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW} 无法建立你与服务器 {STRING} 的连接。{}你是否想通过 {STRING} 中继此次会话? STR_NETWORK_ASK_RELAY_NO :{BLACK}否 STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}是,本次请求 STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}是,不要再次询问 @@ -2397,11 +2412,12 @@ STR_NETWORK_CHAT_TO_COMPANY :[团队]{STRING STR_NETWORK_CHAT_CLIENT :[私聊] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[私聊]{STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[全体] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}请输入联机聊天内容 # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}未找到网络设备 -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}服务器没有响应 +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}服务器连接超时或被拒绝 STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}因为 NewGRF 不匹配而无法连接 STR_NETWORK_ERROR_DESYNC :{WHITE}联机游戏同步失败 STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}联机游戏被断开 @@ -2413,7 +2429,7 @@ STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}你没 STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}此客户端版本与服务器端不匹配 STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}密码错误 STR_NETWORK_ERROR_SERVER_FULL :{WHITE}服务器已经满员 -STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}您的IP已被该服务器封禁(ban) +STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}您已被该服务器封禁 STR_NETWORK_ERROR_KICKED :{WHITE}您已被踢出服务器 STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}原因:{STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}此服务器不允许作弊 @@ -2481,6 +2497,7 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}服务 STR_NETWORK_MESSAGE_KICKED :*** {STRING} 被踢出服务器。原因:({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}服务器注册失败 +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}另一个设置了同样邀请码的服务器已经注册。切换到“本地”游戏模式。 STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}您的服务器不允许远程连接 STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{BLACK}其他玩家将无法连接你的服务器 @@ -2668,7 +2685,7 @@ STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}出口 STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}复合信号(电子){}复合信号灯是入口和出口信号灯的组合,这样允许建立大型“树状”预警信号灯系统 STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}路径信号灯(电子){}路径信号灯为列车预留一条到安全停车位的路径,而其它路径仍然可以使用,从而允许一列以上的列车同时进入一个信号区间 STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}单向路径信号灯(电子){}路径信号灯为列车预留一条到安全停车位的路径,而其它路径仍然可以使用,从而允许一列以上的列车同时进入一个信号区间 -STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}信号灯转换工具{}按下此按钮,可以将已经存在的信号灯转化为选择的信号灯类型,按下CTRL键盘再点击,可以在电子和悬臂型之间转换 +STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}信号灯转换工具{}按下此按钮,可以将已存在的信号灯转化为选择的信号灯类型,按下Ctrl键单击,可以在电子信号和悬臂信号之间转换。按下Shift键单击,将显示估计的转换费用。 STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}拖拽布置信号灯的间隔距离 STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}减少拖拽布置信号灯的间隔距离 STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}增加拖拽布置信号灯的间隔距离 @@ -4126,6 +4143,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}正在 STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}正前往 {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}正在服务于 {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}不能到达 {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}不能到达路点 {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}不能到达 {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}不能到达 {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 5f5d5e9dfa..a43347d7b6 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1079,6 +1079,7 @@ STR_GAME_OPTIONS_CURRENCY_ZAR :Južnoafriški STR_GAME_OPTIONS_CURRENCY_CUSTOM :Po meri... STR_GAME_OPTIONS_CURRENCY_GEL :Gruzijski Lari (GEL) STR_GAME_OPTIONS_CURRENCY_IRR :Iranski Rial (IRR) +STR_GAME_OPTIONS_CURRENCY_HKD :Hong Kongški dolar (HKD) ###length 2 STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Vožnja po levi @@ -1141,6 +1142,7 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvojna velikost STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Velikost kvadrata +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(samodejno zaznaj) @@ -1598,6 +1600,7 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Temno zelena STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Vijolična ###length 4 +STR_CONFIG_SETTING_SCROLLMODE_RMB :Premikaj zemljevid z desnim klikom STR_CONFIG_SETTING_SMOOTH_SCROLLING :Gladek premik pogleda: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Način pomika pogleda na določen objekt majhnega zemljevida (centriranje pogleda). Omogočeno - pogled drsi, onemogočeno - pogled preskoči. @@ -1697,6 +1700,7 @@ STR_CONFIG_SETTING_EXPENSES_LAYOUT :Prikaži stroš STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Definiraj obliko za okno stroškov podjetja +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% normalne hitrosti igre ###setting-zero-is-special STR_CONFIG_SETTING_SOUND_TICKER :Povzetek novic: {STRING} @@ -1889,6 +1893,7 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Prepovedano STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Dovoljeno STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Dovoljeno, oblika mesta po meri +STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Ustvarjanje mestnega tovora: {STRING} ###length 2 STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Sajenje dreves znotraj igre: {STRING} @@ -1968,7 +1973,7 @@ STR_CONFIG_SETTING_DEMAND_SIZE :Količina zavrn STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :Nastavitev pod 100% naredi simetrično razporeditev bolj podobno asimetrični. Manj tovora bo zavrnjenega, če je do postaje poslana določena količina. Nastavljeno na 0% se vede kot asimetrična. STR_CONFIG_SETTING_SHORT_PATH_SATURATION :Nasičenje kratkih poti pred uporabo zmogljivejših: {STRING} -STR_CONFIG_SETTING_SHORT_PATH_SATURATION_HELPTEXT :Večkrat je več možnih poti med postajami. Razpored tovora bo nasičil vedno najkrajšo pot, potem drugo najkrajšo itd... Nasičenje se izračuna glede ne zmogljivost in planirano rabo poti. Če bodo vse zasičene, jih bo prekomerno nasičil. Algoritem ni vedno natančen. Nastavitve določijo procent, do katerega se nasiči pot, preden se išče naslednja. Nastavi procent pod 100, da se izogneš prekomernemu nasičenju postaj. +STR_CONFIG_SETTING_SHORT_PATH_SATURATION_HELPTEXT :Pogosto je več možnih poti med postajami. Razpored tovora bo nasičil vedno najkrajšo pot, potem drugo najkrajšo itd... Nasičenje se izračuna glede na zmogljivost in planirano rabo poti. Če bodo vse zasičene, jih bo prekomerno nasičil. Algoritem ni vedno natančen. Nastavitve določijo procent, do katerega se nasiči pot, preden se išče naslednja. Nastavi procent pod 100, da se izogneš prekomernemu nasičenju postaj. STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :Enote hitrosti: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Ko bo prikazana hitrost vozil na vmesniku, bodo uporabljene izbrane enote. @@ -1976,6 +1981,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Ko bo prikazana STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_IMPERIAL :Colsko (mph) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :Metrično (km/h) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_SI :SI (m/s) +STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_GAMEUNITS :Igralne enote (kvadratov/day) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :Moč vozila: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :Ko bo prikazana moč vozil na vmesniku, bodo uporabljene izbrane enote. @@ -2281,6 +2287,7 @@ STR_NETWORK_SERVER_LIST_JOIN_GAME :{BLACK}Pridruž STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}Osveži strežnik STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}Osveži informacije strežnika +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Išči LAN STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Dodaj strežnik STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Doda strežnik na seznam, ki bo vedno preverjen za pognane igre STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Poženi strežnik @@ -2331,6 +2338,8 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Podjetje STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Seznam gostov # Network client list +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Koda za povabilo, katero lahko uporabijo drugi igralci za pridružitev temu strežniku +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Spremeni ime igralca # Matches ConnectionType ###length 5 @@ -2517,6 +2526,7 @@ STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Da, pren STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Ne, zapusti OpenTTD STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Prenos ni uspel +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Zapuusti OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Nastavitve prozornega pogleda @@ -2663,6 +2673,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Zgradi p STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD :{BLACK}Preklopi gradnja/rušenje cestnih konstrukcij STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}Preklop gradi/odstrani za tramvaj progo +STR_ROAD_NAME_ROAD :Cesta # Road depot construction window STR_BUILD_DEPOT_ROAD_ORIENTATION_CAPTION :{WHITE}Smer garaže @@ -2976,6 +2987,7 @@ STR_SAVELOAD_DETAIL_CAPTION :{BLACK}Podrobno STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}Ni informacij na voljo STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: {WHITE}{STRING} +STR_SAVELOAD_DIRECTORY :{STRING} (Imenik) STR_SAVELOAD_OSKTITLE :{BLACK}Vpiši ime za shranjeno igro @@ -3164,6 +3176,7 @@ STR_NEWGRF_ERROR_READ_BOUNDS :Prebrana datote STR_NEWGRF_ERROR_GRM_FAILED :Zahtevani viri GRF niso na voljo (sprite {3:NUM}) STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} je bil izklopljen zaradi {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Neveljaven/neznan format zapisa sličic (sprite {3:NUM}) +STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Preveč elementov v seznamu vrednosti lastnine (sprite {3:NUM}, lastnina {4:HEX}) # NewGRF related 'general' warnings STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Pozor! @@ -3190,7 +3203,7 @@ STR_NEWGRF_BROKEN :{WHITE}Ozadje N STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Vozilo '{1:ENGINE}' je spremenilo status obratovanja, ko ni znotraj garaže STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Spremenila se je dolžina vozila za '{1:ENGINE}' ko ni v garaži STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Spremenila se je zmogljivost vozila za '{1:ENGINE}' ko ni v garaži ali predelavi -STR_BROKEN_VEHICLE_LENGTH :{WHITE}Vlak '{VEHICLE}' , ki pripada družbi '{COMPANY}', ima neveljavno dolžino. Najbrž vsebuje probleme povezane z NewGRF. Igra se lahko sesuje +STR_BROKEN_VEHICLE_LENGTH :{WHITE}Vlak '{VEHICLE}' , ki pripada družbi '{COMPANY}', ima neveljavno dolžino. Verjetno vsebuje probleme povezane z NewGRF. Igra se lahko sesuje STR_NEWGRF_BUGGY :{WHITE}NewGRF '{STRING}' javlja napačno informacijo STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Informacija o preureditvi tovornih zmogljivosti za '{1:ENGINE}' je različna od seznama nakupa po konstrukciji. To lahko povzroči, da bi samoobnova ne uspela pravilno @@ -3527,6 +3540,7 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}{CURRENC STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industrije STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Brez - STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} +STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Imena industrij - klikni na ime za pogled na industrijo. Ctrl+Klik odpre nov pogled na lokaciji industrije # Industry view @@ -5214,6 +5228,7 @@ STR_FORMAT_DATE_ISO :{2:NUM}-{1:STRI STR_FORMAT_COMPANY_NUM :(Podjetje {COMMA}) STR_FORMAT_GROUP_NAME :Skupina {COMMA} +STR_FORMAT_GROUP_VEHICLE_NAME :{GROUP} #{COMMA} STR_FORMAT_INDUSTRY_NAME :{TOWN} {STRING} ###length 2 diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index e27cc7216d..7a9a12bb63 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -451,6 +451,8 @@ STR_GROUP_BY_NONE :Нема STR_GROUP_BY_SHARED_ORDERS :Спільні накази # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Накази +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Відкрити вікно завдань # Tooltips for the main toolbar ###length 31 @@ -920,6 +922,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * П STR_STATUSBAR_AUTOSAVE :{RED}АВТОЗБЕРЕЖЕННЯ STR_STATUSBAR_SAVING_GAME :{RED}* * ЗБЕРЕЖЕННЯ ГРИ * * +STR_STATUSBAR_SPECTATOR :{WHITE}(спостерігач) # News message history STR_MESSAGE_HISTORY :{WHITE}Історія повідомлень @@ -1023,7 +1026,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Субсидія більше не пропонується:{}{}Перевезення {STRING.r} з {STRING} до {STRING} STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Субсидію скасовано:{}{}Перевезення {STRING.r} з {STRING.r} до {STRING.r} +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Пропонується субсидія:{}{}компанії, яка першою привезе {STRING.z} з {STRING} до {STRING} платитимуть субсидію впродовж {NUM} рок{P у ів ів}! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Субсидію надано {STRING}!{}{}Перевезення {STRING.r} з {STRING} до {STRING} принесе додатково 50% впродовж {NUM} рок{P у ів ів}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Субсидію надано {STRING}!{}{}Перевезення {STRING.r} з {STRING} до {STRING} принесе вдвічі більше прибутків впродовж {NUM} рок{P у ів ів}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Субсидію надано {STRING}!{}{}Перевезення {STRING.r} з {STRING} до {STRING} принесе втричі більше прибутків впродовж {NUM} рок{P у ів ів}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Субсидію надано {STRING}!{}{}Перевезення {STRING.r} з {STRING} до {STRING} принесе вчетверо більше прибутків впродовж {NUM} рок{P у ів ів}! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Транспортний безлад у місті {TOWN}!{}{}Реконструкція доріг, фінансована компанією {STRING} принесе транспорту незручності протягом 6 місяців! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Транспортна монополія! @@ -1089,7 +1097,7 @@ STR_GAME_OPTIONS_CURRENCY_MYR :Малайзі STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :лівосторонній рух STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :правосторонній рух -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Назви міст +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Назви міст: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Виберіть стиль назв міст ###length 21 @@ -1128,6 +1136,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :щороку STR_GAME_OPTIONS_LANGUAGE :{BLACK}Мова STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Виберіть мову інтерфейса користувача +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% виконано) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}На весь екран STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Натисніть цю кнопку щоб грати на весь екран @@ -1141,6 +1150,8 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Прис STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Увімкнутий прапорець дозволить використання грою прискорення апаратного забезпечення. Налаштування запрацює тільки після перезапуску гри STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Налаштування запрацює тільки після перезапуску гри +STR_GAME_OPTIONS_VIDEO_VSYNC :Вертикальна синхронізація +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Увімкнутий прапорець дозволить вертикальну синхронізацію екрану. Налаштування запрацює тільки після перезапуску гри. Працює тільки за увімкнутого прискорення апаратного забезпечення. STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Розмір інтерфейсу STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Оберіть розмір елементів інтерфейсу @@ -1280,6 +1291,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Нала STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Фільтр: 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_DEFAULT_VALUE :{LTBLUE}Стандартне значення: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Тип: {ORANGE}{STRING} @@ -1288,6 +1300,8 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Налашту STR_CONFIG_SETTING_TYPE_GAME_INGAME :Налаштування гри (залишаються при збереженні; впливають тільки на поточну гру) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Налаштування компанії (залишаються при збереженні; впливають тільки на нові ігри) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Налаштування компанії (знаходяться в збережених іграх; впливають тільки на поточну гру) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Обережно! +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Це скине усі налаштування гри до базових значень.{}Дійсно продовжити? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Категорія: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Тип: @@ -1350,8 +1364,12 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Встанов STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Множник субсидій: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Встановіть множник оплати за субсидовані перевезення +STR_CONFIG_SETTING_SUBSIDY_DURATION :Тривалість субсидії: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Встановити кількість років, впродовж яких доступна субсидія +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} {P рік роки років} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Без субсидій STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Вартість будівництва: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Встановити рівень витрат на будівництво та придбання @@ -1678,7 +1696,12 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Подвійн STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Одиночний клац мишою (коли виділено) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Одиночний клац мишою (негайно) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Використати мережеве реле: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Якщо не вдалося з'єднатися з сервером, можна скористатися мережевим реле. Якщо обрано "Ніколи" цього не буде, якщо обрано "Питати" буде запитано дозвіл, якщо обрано "Дозволити" буде з'єднуватися без підтвердження. ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Ніколи +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Питати +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Дозволити STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Емуляція правого клацу миші: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Задає спосіб емуляції правого клацу миші @@ -1924,12 +1947,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Автомат STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Налаштування року впровадження світлофорів замість семафорів. До цього року будуть встановлюватись лише семафори. STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Сигнали, доступні при циклічному переборі: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Налаштування типу сигналів, що доступні при зміні типу за допомогою Ctrl+клацання мишою +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Налаштування типу сигналів, що доступні при зміні типу за допомогою Ctrl+клац мишою ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :тільки маршрутні -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :всі +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :всі видимі +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Показувати типи сигналів: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Обрати тип сигналів для показу в панелі сигналів ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Тільки маршрутні сигнали +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Усі сигнали STR_CONFIG_SETTING_TOWN_LAYOUT :Тип дорожньої сітки для нових міст: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Тип дорожньої сітки міста. @@ -2115,6 +2142,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Під STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Розподіл вантажів STR_CONFIG_SETTING_AI :{ORANGE}Конкуренти STR_CONFIG_SETTING_AI_NPC :{ORANGE}Віртуальні гравці +STR_CONFIG_SETTING_NETWORK :{ORANGE}Мережа STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Алгоритм пошуку шляху для поїздів: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Вибір алгоритма пошуку шляху для залізничного транспорту. @@ -2324,6 +2352,9 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Змін # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Місцевий +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Загальний +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Тільки запрошення # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Мережева гра @@ -2356,9 +2387,12 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Вер STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Адреса серверу: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Дата початку: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Поточна дата: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Ігровий скрипт: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Захищено паролем! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}Сервер відключений STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}Сервер зайнятий +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}ТЕБЕ ЗАБЛОКОВАНО НА СЕРВЕРІ +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}СЕРЕВЕР НЕЙМОВІРНО СТАРИЙ STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}Версія не співпадає STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF ПОМИЛКА @@ -2371,11 +2405,12 @@ STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Пошу STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Пошук локальної мережі STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Пошук серверів у локальній мережі STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Додати сервер -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Додає сервер до списку, який завжди буде перевірятись на поточні ігри +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Додає сервер до списку, з адресами серверів або кодами запрошень STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Створити сервер STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Створити ваш власний сервер STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Введіть ваше ім'я +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Ввести адресу сервера або код запрошення # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Створити нову мережеву гру @@ -2385,6 +2420,8 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}Назв STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Встановити пароль STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Захистіть вашу гру паролем, якщо не бажаєте загального доступу +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Видимість +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Чи бачитимуть інші твій сервер у загальному списку STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} клієнт{P "" а ів} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Макс. клієнтів: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Виберіть максимальну кількість клієнтів. Не всі слоти мають бути зайняті @@ -2417,15 +2454,64 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Серв STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Компанія захищена паролем. Введіть пароль # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Список клієнтів +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Гравців у мережі +STR_NETWORK_COMPANY_LIST_SPECTATE :Огляд # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Гравців у мережі +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Сервер +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Назва +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Назва серверу, на якому ти граєш +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Зміна назви сервера +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Назва сервера +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Видимість +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Чи бачитимуть інші твій сервер у загальному списку +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Код запрошення +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Код запрошення інших гравців для приєднання до цього сервера +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Тип з'єднання +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Чи можливий доступ до твого вервера і як саме +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Гравець +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Ім'я +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Ім'я граця +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Зміна імені гравця +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Ім'я граця +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Адміністративні дії для цього клієнта +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Адміністративні дії для цієї компанії +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Приєднатись до компанії +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Написати цьому гравцю +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Написати усім гравцям з цієї компанії +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Написати усім спостерігачам +STR_NETWORK_CLIENT_LIST_SPECTATORS :Спостерігачі +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Нова компанія) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Створити нову компанію і приєднатись до неї +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Це ти +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Організатор гри +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} клієнт{P "" и ів} / {NUM} компан{P ія ії ій} # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Місцевий +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Гравці не можуть приєднатись +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Загальний +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Поза NAT +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}З мережевим реле +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Викинути +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Бан +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Видалити +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Розблокувати пароль +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Дія адміністратора +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Дійсно бажаєте викинути гравця '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Дійсно бажаєш заблокувати гравця '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Дійсно бажаєш видалити компанію '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Дійсно бажаєш скинути пароль компанії '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Використати мережеве реле? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Не вдалося з'єднатися з сервером '{STRING}'.{}Чи бажаєш використати мережеве реле '{STRING}'? +STR_NETWORK_ASK_RELAY_NO :{BLACK}Ні +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Так, тільки раз +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Так, більше не питати STR_NETWORK_SPECTATORS :Спостерігачі @@ -2454,18 +2540,21 @@ STR_NETWORK_CHAT_TO_COMPANY :[Команда STR_NETWORK_CHAT_CLIENT :[Приватно] {STRING}:{WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Приватно] до {STRING}:{WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Всім] {STRING}:{WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Введіть текст для мережевого чату # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Не знайдено мережевого пристрою -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Сервер не відповів на запит +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}З'єднання з сервером затяглося або скасоване STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Не можна з'єднатись внаслідок неспівпадання NewGRF STR_NETWORK_ERROR_DESYNC :{WHITE}Помилка синхронізації з мережевою грою STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}З'єднання втрачено STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Неможливо завантажити гру STR_NETWORK_ERROR_SERVER_START :{WHITE}Неможливо запустити сервер STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Помилка протоколу - з'єднання розірвано -STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Версія клієнта не співпадає з версією сервера +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Не вказане ім'я гравця. Ім'я має вказуватись нагорі вікна багатокористувацької гри. +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Не вказано назву сервера. Назва має вказуватись нагорі вікна багатокористувацької гри. +STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Версія клієнта не збігається з версією сервера STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Пароль невірний STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Сервер переповнений STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Вас відключено від цього серверу @@ -2477,6 +2566,7 @@ STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Ви з STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Ви дуже довго приєднувалися STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}Ви дуже довго завантажували карту STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Ви дуже довго приєднувалися до серверу +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Неприпустиме ім'я гравця STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Можлива втрата з'єднання STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}На протязі {NUM} секунд{P и "" ""} не надійшло жодної інформації від сервера @@ -2502,6 +2592,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :пароль н STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :час вийшов STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :карта дуже довго завантажувалась STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :карта дуже довго оброблювалась +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :неприпустима назва клієєнта # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2527,12 +2618,16 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {STRING} п STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} став спостерігачем STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} заснував нову компанію (№{2:NUM}) STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} покинув гру ({2:STRING}) -STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} змінив(-ла) своє ім'я на {STRING} +STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} змінив(-ла) ім'я на {STRING} STR_NETWORK_MESSAGE_GIVE_MONEY :*** Від {STRING} передано {1:STRING} {2:CURRENCY_LONG} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Сервер закрив сеанс STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Перезавантаження сервера...{}Зачекайте... STR_NETWORK_MESSAGE_KICKED :*** {STRING} відключено. Причина: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Не вдалося зареєструвати сервер +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Існує інший сервер з тотожним кодом запрошення. Перемикання на позамережеву гру. +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Сервер не дозволяє віддалене з'єднання +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Інші гравці не можуть приєднатися до твого сервера # Content downloading window STR_CONTENT_TITLE :{WHITE}Завантаження вмісту @@ -2721,7 +2816,7 @@ STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Вихі STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Комбінований сигнал (електричний){}Комбінований сигнал працює як об'єднаний вхідний-вихідний сигнал. Це дозволяє будувати великі "дерева" пре-сигналів STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Розширений сигнал (електричний){}Розширений сигнал дозволяє більше ніж одному поїзду одночасно заходити до блоку сигналів, якщо поїзд може зарезервувати шлях до безпечної точки зупинки. Розширені сигнали дозволяють проїжджати їх з обох сторін STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Односторонній розширений сигнал (електричний){}Розширений сигнал дозволяє більше ніж одному поїзду одночасно заходити до блоку сигналів, якщо поїзд може зарезервувати шлях до безпечної точки зупинки. Односторонні розширені сигнали не дозволяють вїжджати з іншої сторони -STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Заміна сигналів{}Коли обрано, натискання на існуючому сигналі замінить його на обраний тип і варіант сигналу, CTRL+натискання замінить існуючий варіант. Утримуйте Shift для показу витрат на заміну +STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Заміна сигналів{}Коли обрано, клац на поточному сигналі замінить його на обраний тип і варіант сигналу, Ctrl+клац замінить поточний варіант. Утримуйте Shift для показу витрат на заміну STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Відстань між сигналами при перетаскуванні STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Зменшити відстань між сигналами STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Збільшити відстань між сигналами @@ -2794,7 +2889,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Буду STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Розмістити бакен, який можна використовувати як точку маршруту. Утримуйте Shift для показу витрат на розміщення STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Побудувати акведук. Утримуйте Shift для показу витрат на будівництво STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Позначити, де буде вода.{}Робити канал, поки не натиснений Ctrl на рівні моря, - тоді будуть затоплені околиці -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Прокласти річки +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Прокласти річки. Ctrl для вибору діагональних ділянок # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Орієнтація депо @@ -3341,6 +3436,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Попер STR_NEWGRF_ERROR_MSG_ERROR :{RED}Помилка: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Збій: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Фатальна помилка NewGRF:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}Помилка NewGRF:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} не буде працювати з версією TTDPatch, вказаною OpenTTD STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} для {STRING}-версії TTD STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} розроблено для {STRING} @@ -3826,7 +3922,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Клац STR_GROUP_DELETE_TOOLTIP :{BLACK}Стерти вибрану групу STR_GROUP_RENAME_TOOLTIP :{BLACK}Перейменувати вибрану групу STR_GROUP_LIVERY_TOOLTIP :{BLACK}Змінити колір вибраної групи -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Клацніть мишою, щоб захистити групу від глобальної автозаміни +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Клацніть мишою, щоб захистити групу від глобальної автозаміни. Ctrl + клац також діє на підгрупи. STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Видалити групу STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Ви впевнені, що хочете видалити цю групу та всі вкладені групи? @@ -4107,7 +4203,9 @@ STR_REPLACE_MAGLEV_VEHICLES :Магнітн STR_REPLACE_ROAD_VEHICLES :Авто STR_REPLACE_TRAM_VEHICLES :Трамвайні транспортні засоби +STR_REPLACE_REMOVE_WAGON :{BLACK}Ліквідація зайвих вагонів: ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Дозволити автооновленню видаляти вагони, зберігаючи довжину потягу (починаючи спереду), якщо оновлення робить поїзд довшим +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl + клац також діє на підгрупи # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} @@ -4176,6 +4274,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Пря STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Прямує до {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Техогляд у {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Неможливо досягти {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Неможливо досягти {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Неможливо досягти {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Неможливо досягти {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 From 5e3ed3a05e4ca46d454901f2f50b214dffd18c7b Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 26 Sep 2021 23:11:22 +0200 Subject: [PATCH 007/710] Add: Console command to list search directories for various things --- src/console_cmds.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 8963c47517..5cdb744abc 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1975,6 +1975,71 @@ DEF_CONSOLE_CMD(ConNewGRFReload) return true; } +DEF_CONSOLE_CMD(ConListDirs) +{ + struct SubdirNameMap { + Subdirectory subdir; ///< Index of subdirectory type + const char *name; ///< UI name for the directory + bool default_only; ///< Whether only the default (first existing) directory for this is interesting + }; + static const SubdirNameMap subdir_name_map[] = { + /* Game data directories */ + { BASESET_DIR, "baseset", false }, + { NEWGRF_DIR, "newgrf", false }, + { AI_DIR, "ai", false }, + { AI_LIBRARY_DIR, "ailib", false }, + { GAME_DIR, "gs", false }, + { GAME_LIBRARY_DIR, "gslib", false }, + { SCENARIO_DIR, "scenario", false }, + { HEIGHTMAP_DIR, "heightmap", false }, + /* Default save locations for user data */ + { SAVE_DIR, "save", true }, + { AUTOSAVE_DIR, "autosave", true }, + { SCREENSHOT_DIR, "screenshot", true }, + }; + + if (argc != 2) { + IConsolePrint(CC_HELP, "List all search paths or default directories for various categories."); + IConsolePrint(CC_HELP, "Usage: list_dirs "); + std::string cats = subdir_name_map[0].name; + bool first = true; + for (const SubdirNameMap &sdn : subdir_name_map) { + if (!first) cats = cats + ", " + sdn.name; + first = false; + } + IConsolePrint(CC_HELP, "Valid categories: {}", cats); + return true; + } + + std::set seen_dirs; + for (const SubdirNameMap &sdn : subdir_name_map) { + if (strcasecmp(argv[1], sdn.name) != 0) continue; + bool found = false; + for (Searchpath sp : _valid_searchpaths) { + /* Get the directory */ + std::string path = FioGetDirectory(sp, sdn.subdir); + /* Check it hasn't already been listed */ + if (seen_dirs.find(path) != seen_dirs.end()) continue; + seen_dirs.insert(path); + /* Check if exists and mark found */ + bool exists = FileExists(path); + found |= exists; + /* Print */ + if (!sdn.default_only || exists) { + IConsolePrint(exists ? CC_DEFAULT : CC_INFO, "{} {}", path, exists ? "[ok]" : "[not found]"); + if (sdn.default_only) break; + } + } + if (!found) { + IConsolePrint(CC_ERROR, "No directories exist for category {}", argv[1]); + } + return true; + } + + IConsolePrint(CC_ERROR, "Invalid category name: {}", argv[1]); + return false; +} + DEF_CONSOLE_CMD(ConNewGRFProfile) { if (argc == 0) { @@ -2344,6 +2409,7 @@ void IConsoleStdLibRegister() IConsole::CmdRegister("list_settings", ConListSettings); IConsole::CmdRegister("gamelog", ConGamelogPrint); IConsole::CmdRegister("rescan_newgrf", ConRescanNewGRF); + IConsole::CmdRegister("list_dirs", ConListDirs); IConsole::AliasRegister("dir", "ls"); IConsole::AliasRegister("del", "rm %+"); From 7a48b5597d8ce1b633a625cfb416f3b13d956f6b Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 27 Sep 2021 18:49:51 +0000 Subject: [PATCH 008/710] Update: Translations from eints czech: 40 changes by LubosKolouch, 27 changes by CzechRepublic98 hungarian: 1 change by pnpBrumi turkish: 13 changes by ahmetlii --- src/lang/czech.txt | 75 +++++++++++++++++++++++++++++++++++++----- src/lang/hungarian.txt | 2 +- src/lang/turkish.txt | 15 +++++++-- 3 files changed, 81 insertions(+), 11 deletions(-) diff --git a/src/lang/czech.txt b/src/lang/czech.txt index d39203e5ed..1ef97fa2a4 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -401,6 +401,8 @@ STR_GROUP_BY_NONE :Neseskupovat STR_GROUP_BY_SHARED_ORDERS :Sdílené příkazy # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Pokyny +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Otevřít okno s úkolem # Tooltips for the main toolbar ###length 31 @@ -983,7 +985,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Nabídka dotace přepravy vypršela:{}{}Dotace dopravy {STRING.gen} z{NBSP}{STRING.gen} do {STRING.gen} nebude dále nabízena STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Ukončení dotování dopravy:{}{}Dotace pro {STRING} z{NBSP}{STRING.gen} do {STRING.gen} již nebude dále poskytována +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Nabídka dotace:{}{}Doprava {STRING} z{STRING} do {STRING} bude {NUM} rok dotována místní správou! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Dotace přidělena společnosti {STRING}.{}{}Doprava {STRING.gen} z{NBSP}{STRING.gen} do {STRING.gen} bude po {NUM} rok{P “” ů ů} vynášet 150{NBSP}% normální ceny +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Dotace přidělena společnosti {STRING}!{}{} Doprava {STRING} z{NBSP}{STRING} do {STRING} bude po {NUM} rok{P “” “” ů} vynášet dvojnásobek normální ceny! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Dotace přidělena společnosti {STRING}.{}{}Doprava {STRING.gen} z{NBSP}{STRING.gen} do {STRING.gen} bude po {NUM} rok{P “” ů ů} vynášet trojnásobek normální ceny! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Dotace přidělena společnosti {STRING}.{}{}Doprava {STRING.gen} z{NBSP}{STRING.gen} do {STRING.gen} bude po {NUM} rok{P “” ů ů} vynášet čtyřnásobek normální ceny! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}{TOWN} zažívá dopravní chaos!{}{}Program přestavby ulic sponzorovaný {STRING} přináší motoristům 6 měsíců utrpení! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transportní monopol! @@ -1103,6 +1110,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Zaškrtn STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Nastavení vstoupí v platnost pouze po restartu hry STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Zaškrtní tento box pro v-sync obrazovky. Změna se projeví po znovu spuštění hry. Funguje to pouze pro povolenou hardwarovou akceleraci. STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Velikost rozhraní STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolit velikost prvků uživatelského rozhraní @@ -1242,6 +1250,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Nastaven STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filtrovat podle: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Rozbalit vše STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Sbalit vše +STR_CONFIG_SETTING_RESET_ALL :{BLACK}Vymazat všechny hodnoty STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(žádné vysvětlení není k dispozici) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Výchozí hodnota: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Typ nastavení: {ORANGE}{STRING} @@ -1315,7 +1324,9 @@ STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Výše dotací: STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Nastavuje jak moc jsou dotovaná spojení dotována STR_CONFIG_SETTING_SUBSIDY_DURATION :Doba trvání dotace: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Nastav počet roků, po které je dotace přiznaná +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} rok{P "" y y} ###setting-zero-is-special STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Žádné dotace @@ -1644,7 +1655,11 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dvojklik STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Jedno kliknutí (je-li zaměřen) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Jedno kliknutí (okamžitě) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Použít relay službu: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Pokud selže spojení k serveru, je možné použít relay službu pro vytvoření spojení. "Never" to zakáže, "ask" se nejprve zeptá, "allow" to povolí bez ptaní ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Nikdy +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Zeptat se STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Povolit STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Emulace pravého tlačítka: {STRING} @@ -1894,9 +1909,12 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Vybírat dokola STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Vyber které semafory budou nabízeny při Ctrl+klikání při jejich stavbě. ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :pouze dokonalejší (PBS) -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :všechna +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Vše viditelné +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Zobraz signály typu: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Vyber, které signály jsou zobrazené v panelu nástrojů signálů ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Pouze Path signály STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Všechny signály STR_CONFIG_SETTING_TOWN_LAYOUT :Rozvržení silnic pro nová města: {STRING} @@ -2083,6 +2101,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Průmys STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distribuce nákladu STR_CONFIG_SETTING_AI :{ORANGE}Konkurenti STR_CONFIG_SETTING_AI_NPC :{ORANGE}Umělá inteligence +STR_CONFIG_SETTING_NETWORK :{ORANGE}Síť STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Hledač cesty pro vlaky: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Hledač cesty pro vlaky @@ -2292,6 +2311,9 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Změnit # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Místní +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Veřejný +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Pouze pozvánky # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Multiplayer @@ -2342,12 +2364,12 @@ STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Hledat v STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Prohledat místní siť STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Hledat servery v místní síti STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Přidat server -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Přidá server do seznamu, ve kterém se budou hledat běžící hry +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Přidá server do seznamu. Může to být adresa serveru nebo kód pozvánky. STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Spustit server STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Spustit vlastní server STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Zadej své jméno -STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Zadej adresu serveru nebo pozvánkový kód +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Zadej adresu serveru nebo kód pozvánky # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Začít novou hru @@ -2358,6 +2380,7 @@ STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Nastavit STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Svoji hru si můžeš ochránit heslem, když nechceš, aby se ti do ni hlásili jiní lidé STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Viditelnost +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Jestli ostatní mohou vidět tvůj server ve veřejném seznamu STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} klient{P "" i ů} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Nejvyšší počet hráčů: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Zvol nejvyšší počet hráčů. Může se jich připojit i méně @@ -2394,32 +2417,60 @@ STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Seznam hráčů STR_NETWORK_COMPANY_LIST_SPECTATE :Dívat se # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Online hráči STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Jméno STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Název serveru, na kterém hrajete STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Upravte název svého serveru STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Název serveru STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Viditelnost +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Zda mohou ostatní hráči vidět váš server ve veřejném seznamu STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Pozvánkový kód -STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Pozvánkový kód, který mohou ostatní hráči použít k připojení k tomuto serveru. +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Kód pozvánky, který mohou ostatní hráči použít k připojení k tomuto serveru. +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Typ spojení +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Jestli a jak může být tvůj server dostupný pro ostatní +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Hráč +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Jméno STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Jméno vašeho hráče +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Uprav své hráčské jméno +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Tvé herní jméno +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Administrativní akce pro tohoto klienta +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Administrativní akce pro tuto firmu STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Připojit se a hrát za tuto společnost STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Poslat zprávu tomuto hráči STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Poslat zprávu všem hráčům této firmy +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Poslat zprávu všem divákům +STR_NETWORK_CLIENT_LIST_SPECTATORS :Diváci STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Nová společnost) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Vytvořit novou společnost a připojit se do ní STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Tohle jsi ty +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Toto je hostitel hry +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} klient{P "" i i} / {NUM} společnost{P “” i i} # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Místní +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Vzdálení hráči se nemohou připojit STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Veřejný +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Za NATem +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Přes relay STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Vyhodit +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Ban +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Smazat +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Odemčení hesla +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Administrátorská akce STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Opravdu chceš vyhodit hráče '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Opravdu chceš zabanovat hráče '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Jste si jisti, že chcete smazat společnost '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Opravdu chcete obnovit heslo společnosti '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Použít relay? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Nepodařilo se vytvořit spojení mezi tebou a serverem '{STRING}'.{}Chceš propojit toto sezení přes relay '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Ne +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Ano, toto jednou +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Ano, znovu se neptat STR_NETWORK_SPECTATORS :Pozorovatelé @@ -2448,6 +2499,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Tým] pro {STR STR_NETWORK_CHAT_CLIENT :[Osobní] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Osobní] pro {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Všichni] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Zadej zprávu # Network messages @@ -2460,6 +2512,7 @@ STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Nelze na STR_NETWORK_ERROR_SERVER_START :{WHITE}Nelze spustit server STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Vznikla chyba v protokolu a naše spojení je přerušeno STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Tvé herní jméno nebylo nastaveno. Jméno může být nastaveno v horní části okna pro více hráčů. +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Název tvého serveru nebyl nastaven. Název je možné nastavit na horním okraji Multiplayer okna. STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Revize hry tohoto klienta neodpovídá revizi hry na serveru STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Špatné heslo STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Server je plný @@ -2524,13 +2577,14 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {STRING} se STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} se stává pozorovatelem STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} zakládá novou společnost (č. {2:NUM}) STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} opouští hru ({2:STRING}) -STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} si mění jméno na {STRING} +STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} si změnil jméno na {STRING} STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} poslal(a) {2:CURRENCY_LONG} společnosti {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Server ukončil relaci STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server se restartuje...{}Počkejte prosím... STR_NETWORK_MESSAGE_KICKED :*** {STRING} byl vyhozen. Důvod: ({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Registrace serveru selhala +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}S tímto zvacím kódem se už zaregistroval jiný server. Přepínám na lokální typ hry. STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Váš server neumožňuje vzdálené připojení STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Ostatní hráči se nebudou moci k tvému serveru připojit @@ -2791,7 +2845,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Postavit STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Umístit bójku použitelnou pro navádění. Stisknutý Shift pro zobrazení odhadu ceny STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Postavit akvadukt. Stisknutý Shift pro zobrazení odhadu ceny STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Vytvořit vodní plochu.{}Pokud není držen Ctrl, vytvoří se na úrovni moře průplav; v opačném případě se zaplaví ostatní dílky -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Vytvořit řeky +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Vytvořit řeky. Ctrl vybere oblast diagonálně # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Orientace lodního depa @@ -3344,6 +3398,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Varování STR_NEWGRF_ERROR_MSG_ERROR :{RED}Chyba: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Závažná chyba: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Vyskytla se kritická chyba v NewGRF:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}Došlo k chybě v NewGRF:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} nebude fungovat s verzí TTDPatche, kterou OpenTTD hlásí STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} je pro TTD verzi {STRING} STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} je navržen pro práci s {STRING} @@ -3829,7 +3884,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Kliknut STR_GROUP_DELETE_TOOLTIP :{BLACK}Vymazat vybranou skupinu STR_GROUP_RENAME_TOOLTIP :{BLACK}Přejmenovat vybranou skupinu STR_GROUP_LIVERY_TOOLTIP :{BLACK}Změnit nátěr vozidel vybrané skupiny -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Kliknutím nebude na tuto skupinu mít vliv automatická výměna vozidel +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Kliknutím se bude chránit tato skupina před globálním automatickým nahrazením. Ctrl+kliknutí chrání také podskupiny. STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Smazat Skupinu STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Jste si jist, že chcete smazat tuto skupinu a všechny její podskupiny? @@ -4113,7 +4168,9 @@ STR_REPLACE_MAGLEV_VEHICLES :Lokomotivy Magl STR_REPLACE_ROAD_VEHICLES :Silniční vozidla STR_REPLACE_TRAM_VEHICLES :Tramvaje +STR_REPLACE_REMOVE_WAGON :{BLACK}Odstranění vagonu ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Funkce automatického vylepšování vlaků může udržovat stejnou délku vlaku odstraňovaním vagonů (od začátku vlaku), pokud by změna mašiny vlak prodloužila +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+Click pro použití také na pod-skupinách # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} @@ -4183,6 +4240,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Míří STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Údržba v {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nelze dosáhnout {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Nelze dosáhnout {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nelze dosáhnout {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nelze dosáhnout {DEPOT}, {VELOCITY} # Vehicle stopped/started animations @@ -4969,7 +5028,7 @@ STR_ERROR_AIRCRAFT_IN_THE_WAY :{WHITE}Letadlo ###length VEHICLE_TYPES STR_ERROR_RAIL_VEHICLE_NOT_AVAILABLE :{WHITE}Vozidlo není dostupné -STR_ERROR_ROAD_VEHICLE_NOT_AVAILABLE :{WHITE}Vůz není dostupné +STR_ERROR_ROAD_VEHICLE_NOT_AVAILABLE :{WHITE}Vozidlo není dostupné STR_ERROR_SHIP_NOT_AVAILABLE :{WHITE}Loď není dostupná STR_ERROR_AIRCRAFT_NOT_AVAILABLE :{WHITE}Letadlo není dostupné diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index adfc01d823..8d5f16125a 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -390,7 +390,7 @@ STR_GROUP_BY_SHARED_ORDERS :Megosztott utas # Order button in shared orders vehicle list STR_GOTO_ORDER_VIEW :{BLACK}Utasítások -STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Nyisd meg az utasítás nézetet +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}A járművek utasításainak mutatása # Tooltips for the main toolbar ###length 31 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 63a2ce34a4..4518a50809 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -327,6 +327,8 @@ STR_GROUP_BY_NONE :Hiçbiri STR_GROUP_BY_SHARED_ORDERS :Paylaşılan talimatlar # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Talimatlar +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Emir görünümünü aç # Tooltips for the main toolbar ###length 31 @@ -1818,13 +1820,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Bu tarihten ön STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Raylar için elektrikli sinyallerin kullanılmaya başlanacağı yılı belirler. Bu tarihe kadar elektriksiz sinyaller kullanılır (bunlar da aynı işi görür, sadece görünüşleri farklıdır) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Sinyal türleri arasında dön: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Ctrl+Tıklama ile sinyal inşa ederken hangi sinyal türlerinin kullanılacağını seç +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Sinyal aracı ile inşa edilmiş bir sinyalin üzerine CTRL+tıklarken hangi sinyal türlerinin kullanılacağını seç ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Yalnızca yol sinyalleri -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Hepsi +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Hepsi görünür +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Sinyal türlerini göster: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Sinyal araç çubuğunda hangi sinyal türlerinin gösterileceğini seç ###length 2 STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Yalnızca yol sinyalleri +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Tüm sinyaller STR_CONFIG_SETTING_TOWN_LAYOUT :Yeni kasabalar için yol yerleşimi: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Şehirlerin karayolu ağlarını gösteren şema @@ -2323,6 +2328,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Şirket # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Aktif oyuncular +STR_NETWORK_COMPANY_LIST_SPECTATE :Seyret # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Çok Oyunculu{WHITE}Çevrim İçi Oyuncular @@ -2407,6 +2413,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Takım] -> {ST STR_NETWORK_CHAT_CLIENT :[Özel] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Özel] -> {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Herkes] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Ağ sohbeti için yazı girin # Network messages @@ -4137,6 +4144,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Gidilen STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}{DEPOT} istikametine gidiyor, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}{DEPOT}'nda bakıma gir, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}{STATION} istasyonuna ulaşılamıyor, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}{WAYPOINT} yerimine ulaşılamıyor, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}{DEPOT} garajına ulaşılamıyor, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}{DEPOT} garajına ulaşılamıyor, {VELOCITY} # Vehicle stopped/started animations ###length 2 From b4bacff4fe77fcd5a722507df79b61953635e530 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 28 Sep 2021 18:47:22 +0000 Subject: [PATCH 009/710] Update: Translations from eints hungarian: 4 changes by pnpBrumi indonesian: 41 changes by bsuseno italian: 28 changes by CoderLel romanian: 46 changes by kneekoo slovak: 18 changes by ApplePie420 danish: 279 changes by nielsmh --- src/lang/danish.txt | 340 +++++++++++++++++++++++++++++++++------- src/lang/hungarian.txt | 8 +- src/lang/indonesian.txt | 70 +++++---- src/lang/italian.txt | 28 ++++ src/lang/romanian.txt | 57 +++++-- src/lang/slovak.txt | 19 ++- 6 files changed, 416 insertions(+), 106 deletions(-) diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 80433a555e..1725c8c5f7 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -194,6 +194,7 @@ STR_COLOUR_RANDOM :Tilfældig STR_UNITS_VELOCITY_IMPERIAL :{COMMA} miles/t STR_UNITS_VELOCITY_METRIC :{COMMA} km/t STR_UNITS_VELOCITY_SI :{COMMA} m/s +STR_UNITS_VELOCITY_GAMEUNITS :{DECIMAL}{NBSP}felter/dag STR_UNITS_POWER_IMPERIAL :{COMMA}hk STR_UNITS_POWER_METRIC :{COMMA}hk @@ -313,11 +314,20 @@ STR_SORT_BY_POWER_VS_RUNNING_COST :Ydelse/Omkostni STR_SORT_BY_CARGO_CAPACITY :Lasteevne STR_SORT_BY_RANGE :Interval STR_SORT_BY_POPULATION :Indbyggertal -STR_SORT_BY_RATING :Værdi +STR_SORT_BY_RATING :Bedømmelse +STR_SORT_BY_NUM_VEHICLES :Antal fartøjer +STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Samlet afkast sidste år +STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Samlet afkast dette år +STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Gennemsnit afkast sidste år +STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Gennemsnit afkast dette år # Group by options for vehicle list +STR_GROUP_BY_NONE :Ingen +STR_GROUP_BY_SHARED_ORDERS :Delte ordrer # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Ordrer +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Åbn ordrevisningen # Tooltips for the main toolbar ###length 31 @@ -609,7 +619,7 @@ STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR :Trafikkoordinat STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR :Routesuperviser STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR :Direktør STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE :Administrerende direktør -STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN :Formand +STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN :Forretningschef STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT :Præsident STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON :Matador @@ -694,7 +704,7 @@ STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Klik på STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED :{BIG_FONT}{BLACK}Bedste virksomheder, som har nået {NUM} STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME :{BIG_FONT}{BLACK}Selskabsoversigt i {NUM} STR_HIGHSCORE_POSITION :{BIG_FONT}{BLACK}{COMMA}. -STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN :Forretningsmand +STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN :Forretningsdriver STR_HIGHSCORE_PERFORMANCE_TITLE_ENTREPRENEUR :Entreprenør STR_HIGHSCORE_PERFORMANCE_TITLE_INDUSTRIALIST :Industrialist STR_HIGHSCORE_PERFORMANCE_TITLE_CAPITALIST :Kapitalist @@ -748,6 +758,7 @@ STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_ROUGH_LAND :{TINY_FONT}{BLACK}Hårdt terræn STR_SMALLMAP_LEGENDA_GRASS_LAND :{TINY_FONT}{BLACK}Græs STR_SMALLMAP_LEGENDA_BARE_LAND :{TINY_FONT}{BLACK}Bart terræn +STR_SMALLMAP_LEGENDA_RAINFOREST :{TINY_FONT}{BLACK}Regnskov STR_SMALLMAP_LEGENDA_FIELDS :{TINY_FONT}{BLACK}Marker STR_SMALLMAP_LEGENDA_TREES :{TINY_FONT}{BLACK}Træer STR_SMALLMAP_LEGENDA_ROCKS :{TINY_FONT}{BLACK}Klipper @@ -779,9 +790,11 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}Hvis alt STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}Vis seneste besked eller nyhedsrapport STR_STATUSBAR_COMPANY_NAME :{SILVER}- - {COMPANY} - - STR_STATUSBAR_PAUSED :{YELLOW}* * PAUSE * * +STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * PAUSE (afventer forbindelsesgraf opdatering) * * STR_STATUSBAR_AUTOSAVE :{RED}AUTOGEM STR_STATUSBAR_SAVING_GAME :{RED}* * GEMMER SPIL * * +STR_STATUSBAR_SPECTATOR :{WHITE}(tilskuer) # News message history STR_MESSAGE_HISTORY :{WHITE}Beskedhistorik @@ -800,8 +813,8 @@ STR_NEWS_FIRST_SHIP_ARRIVAL :{BIG_FONT}{BLAC STR_NEWS_FIRST_AIRCRAFT_ARRIVAL :{BIG_FONT}{BLACK}Indbyggerne fester . . .{}Første fly ankommer til {STATION}! STR_NEWS_TRAIN_CRASH :{BIG_FONT}{BLACK}Tog forulykket!{}{COMMA} døde i flammerne efter kollision -STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Lastbil forulykket!{}Chauffør dør i flammerne efter sammenstød med tog -STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLACK}Bus forulykket!{}{COMMA} dør i flammerne efter kollision med et tog +STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Lastbil forulykket!{}Chauffør dør i flammehav efter sammenstød med tog +STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLACK}Bus forulykket!{}{COMMA} dør i flammehav efter kollision med et tog STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLACK}Flystyrt!{}{COMMA} dør i flammerne ved {STATION} STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}Flystyrt!{}Fly løb tør for brændstof, {COMMA} døde i ildhelvede! @@ -884,8 +897,13 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO :{WHITE}{STATION STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION} accepterer nu {STRING} og {STRING} STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Licitation af tilskudsordning udløbet:{}{}{STRING} fra {STRING} til {STRING} vil ikke længere udløse tilskud. -STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Tilskudsordning tilbagetrukket:{}{}{STRING} fragt fra {STRING} til {STRING} modtager ikke længere tilskud. +STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Tilskudsordning tilbagetrukket:{}{}{STRING} fra {STRING} til {STRING} modtager ikke længere tilskud. +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Tilskudsordning i licitation:{}{}Første {STRING} tjeneste fra {STRING} til {STRING} vil udløse {NUM} års tilskud fra de lokale myndigheder! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Tilskudsordning tildelt {STRING}!{}{}{STRING} fra {STRING} til {STRING} vil give {NUM} års 50% forøget udbytte! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Tilskudsordning tildelt {STRING}!{}{}{STRING} fra {STRING} til {STRING} vil give {NUM} års dobbelt udbytte! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Tilskudsordning tildelt {STRING}!{}{}{STRING} fra {STRING} til {STRING} vil give {NUM} års tredobbelt udbytte! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Tilskudsordning tildelt {STRING}!{}{}{STRING} fra {STRING} til {STRING} vil give {NUM} års firedobbelt udbytte! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Trafikkaos i byen {TOWN}!{}{}Vejfornyelse betalt af {STRING} forårsager 6 måneders kaos i trafikken! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transportmonopol! @@ -944,12 +962,14 @@ STR_GAME_OPTIONS_CURRENCY_NTD :Ny Taiwan dolla STR_GAME_OPTIONS_CURRENCY_CNY :Kinesisk Renminbi (CNY) STR_GAME_OPTIONS_CURRENCY_HKD :Hong Kong Dollar (HKD) STR_GAME_OPTIONS_CURRENCY_INR :Indisk rupi (INR) +STR_GAME_OPTIONS_CURRENCY_IDR :Indonesisk Rupiah (IDR) +STR_GAME_OPTIONS_CURRENCY_MYR :Malaysisk Ringgit (MYR) ###length 2 STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Kør i venstre side STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Kør i højre side -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Bynavne +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Bynavne: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Vælg stil for bynavne ###length 21 @@ -988,6 +1008,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :Hver 12. måned STR_GAME_OPTIONS_LANGUAGE :{BLACK}Sprog STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Vælg sprog til brugerfladen +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% færdig) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Fuld skærm STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Afkryds for at spille OpenTTD i fuld skærm @@ -995,13 +1016,19 @@ STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Afkryds STR_GAME_OPTIONS_RESOLUTION :{BLACK}Skærmopløsning STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Vælg ønsket skærmopløsning STR_GAME_OPTIONS_RESOLUTION_OTHER :andet +STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Hardware-acceleration +STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Marker dette felt for at tillade at OpenTTD forsøger at bruge hardwareacceleration. Ændringer af indstillingen er først effektiv efter spillet er genstartet. +STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Indstillingen er først effektiv efter spillet er genstartet. +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Afmærk dette felt for at v-synkronisere skærmen. Ændringer af indstillingen er først effektiv efter spillet er genstartet. Fungerer kun med hardware-acceleration aktiveret. STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}grænseflade størrelse STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vælg den grænseflade størrelse du ønsker at benytte +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-bestem) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobbelt størrelse STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad (4x) størrelse @@ -1009,11 +1036,17 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad (4x) stør STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Skriftstørrelse STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vælg skriftstørrelsen du ønsker i grænsefladen +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-bestem) STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dobbelt størrelse STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quad (4x) størrelse +STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafik +STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Skærm opdateringshastighed +STR_GAME_OPTIONS_REFRESH_RATE_TOOLTIP :{BLACK}Vælg den opdateringshastighed der skal bruges på skærmen +STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{NUM}Hz +STR_GAME_OPTIONS_REFRESH_RATE_WARNING :{WHITE}Opdateringshastigheder over 60Hz kan påvirke ydeevnen. STR_GAME_OPTIONS_BASE_GRF :{BLACK}Basis-grafiksæt STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Vælg det basis-grafiksæt der skal bruges @@ -1115,6 +1148,8 @@ STR_TERRAIN_TYPE_FLAT :Fladt STR_TERRAIN_TYPE_HILLY :Bakket STR_TERRAIN_TYPE_MOUNTAINOUS :Bjergrigt STR_TERRAIN_TYPE_ALPINIST :Alpinist +STR_TERRAIN_TYPE_CUSTOM :Brugerdefineret højde +STR_TERRAIN_TYPE_CUSTOM_VALUE :Brugerdefineret højde ({NUM}) ###length 3 STR_CITY_APPROVAL_PERMISSIVE :Passiv @@ -1128,6 +1163,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Indstill STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filter streng: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Udvid alle STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Skjul alle +STR_CONFIG_SETTING_RESET_ALL :{BLACK}Nulstil alle værdier STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(ingen forklaring tilgængelig) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Standard: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Indstillingstype: {ORANGE}{STRING} @@ -1136,6 +1172,8 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Spil indstillin STR_CONFIG_SETTING_TYPE_GAME_INGAME :Firma indstilling (lagret i gemt spil, påvirker kun det aktuelle spil) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Firma indstilling (lagret i gemt spil; påvirker kun nye spil) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Firma indstilling (lagret i gemt spil; påvirker kun aktuelt selskab) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Advarsel! +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Denne handling vil nulstille alle spilindstillinger til deres standardværdier.{}Ønsker du at fortsætte? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Kategori: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Type: @@ -1195,11 +1233,15 @@ STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Begræns antall STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Køretøjs nedbrud: {STRING} STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Indstil hvor tit uservicerede kørertøjer må bryde ned -STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Tilskudmultiplikator: {STRING} +STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Tilskudrate: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Indstil, hvor meget der bliver betalt for tilskudsordninger +STR_CONFIG_SETTING_SUBSIDY_DURATION :Varighed på tilskudsordning: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Styrer hvor mange år tilskudsordninger tildeles for +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} år ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Ingen tilskudsordninger STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Konstruktionspriser: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Indstil prisniveau for køb og konstruktion @@ -1216,8 +1258,12 @@ STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Slå katastrofe STR_CONFIG_SETTING_CITY_APPROVAL :Byrådets holdning til omstrukturering: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Vælg hvor meget selskaber støj og miljømæssige skader påvirker byvurdering og fremtidige byggeretigheder i området +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :Højdegrænse for kortet: {STRING} +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT :Indstil den maksimale højde af kortets landskab. Med "(auto)" bliver en god værdi valgt efter landskabsgenerering +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE :{NUM} ###setting-zero-is-special -STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}Du kan ikke sætte den maksimale kortet højde for denne værdi. Mindst et bjerg på kortet er højere +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_AUTO :(auto) +STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}Du kan ikke sætte kortets højdegrænse til denne værdi. Mindst ét bjerg på kortet er højere. STR_CONFIG_SETTING_AUTOSLOPE :Tillad landskabsformning under bygninger, spor, etc. (autoslope): {STRING} STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Tillad landskabsformning under bygninger og spor uden at fjerne dem @@ -1264,7 +1310,7 @@ STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH :Maksimal bro l STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH_HELPTEXT :Maksimal længde af broer STR_CONFIG_SETTING_MAX_BRIDGE_HEIGHT :Maksimal bro højde: {STRING} -STR_CONFIG_SETTING_MAX_BRIDGE_HEIGHT_HELPTEXT :Maksimal højde for at bygge bro +STR_CONFIG_SETTING_MAX_BRIDGE_HEIGHT_HELPTEXT :Maksimal højde der kan bygges bro over STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH :Maksimal tunnel længde: {STRING} STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH_HELPTEXT :Maksimal længde af tunneler @@ -1402,7 +1448,7 @@ STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Vis navn på Ne STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Tilføjer en linje til byg fartøj vinduet som viser, hvilken NewGRF det valgte fartøj stammer fra. STR_CONFIG_SETTING_LANDSCAPE :Landskab: {STRING} -STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landskaber definerer grundlæggende gameplay-scenarier med forskellige laster og krav by vækst. NewGRF og spil Scripts tillader finere kontrol selv +STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landskaber definerer grundlæggende gameplay-scenarier med forskellige godstyper og krav for byers vækst. NewGRF og spilscripts giver dog mulighed for yderligere styring. STR_CONFIG_SETTING_LAND_GENERATOR :Landskabs generator: {STRING} STR_CONFIG_SETTING_LAND_GENERATOR_HELPTEXT :Den oprindelige generator afhænger af basen grafik sæt, og komponerer faste landskab former. TerraGenesis er en Perlin baseret generator med finere kontrol indstillinger @@ -1411,7 +1457,7 @@ STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL :Original STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS :TerraGenesis STR_CONFIG_SETTING_TERRAIN_TYPE :Terræn type: {STRING} -STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(TerraGenesis only) Hilliness af landskabet +STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(Kun TerraGenesis) Størrelse af højderygge STR_CONFIG_SETTING_INDUSTRY_DENSITY :Industri tæthed: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Angiv hvor mange industrier skal genereres og hvilket niveau der bevares i løbet af spillet @@ -1420,9 +1466,15 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maksimal afstan STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Grænse for hvor langt fra kortets kant olieraffinaderier kan blive bygget. På ø-kort sikrer dette at de er nær kysten. På kort større end 256 felter bliver denne værdi automatisk skaleret op. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Snelinjehøjden: {STRING} -STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Kontrol med på hvilket højde sneen begynder i sub-arktiske landskab. Sne påvirker også industrien generation og betingelser by vækst +STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Styrer ved hvilken højde sneen starter i det sub-arktiske landskab. Sne påvirker også industri-generering og byers krav for at vokse.Kan kun ændres i Scenarieeditoren, og beregnes ellers via "snedække". +STR_CONFIG_SETTING_SNOW_COVERAGE :Snedække: {STRING} +STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Styrer den omtrentlige mængde sne i det sub-arktiske landskab. Sne påvirker også industri-generering og byernes krav for at vokse. Anvendes kun under landskabsgenerering. Land lige over havniveau er altid snefrit. +STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% +STR_CONFIG_SETTING_DESERT_COVERAGE :Ørkendækning: {STRING} +STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT :Styrer den omtrentlige mængde ørken i det tropiske landskab. Ørken påvirker også industri-generering. Anvendes kun under landskabsgenerering. +STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Tærrenets hårdhed (kun TerraGenesis) : {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(TerraGenesis kun) Vælg frekvensen af bakkerne: Glatte landskaber har færre, mere udbredt bakker. Ujævne landskaber har mange bakker, der kan se gentaget ud @@ -1516,7 +1568,12 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dobbelt click STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Enkelt click (når fokuseret) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Enkelt click (umiddelbart) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Anvend relæ-tjeneste: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Hvis det mislykkes at skabe forbindelse til serveren, er det muligt at anvende en relæ-tjeneste til at skabe en forbindelse. "Aldrig" forbyder dette, "spørg" vil spørge først, "tillad" vil tillade det uden at spørge. ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Aldrig +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Spørg +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Tillad STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Højreklik-emulering: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Vælg metode til at emulere højre muse-knap klik @@ -1580,9 +1637,14 @@ STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Hold bygnings-v STR_CONFIG_SETTING_EXPENSES_LAYOUT :Grupper udgifter i firmaets finansvindue: {STRING} STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Definer layout for firmaets udgifter-vindue +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :Fjern automatisk signaler under jernbane-bygning: {STRING} +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :Fjerner automatisk signaler under jernbane-bygning, hvis signalerne er i vejen. Bemærk at dette potentielt kan føre til togsammenstød. +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Hurtig kørsel hastighedsgrænse: {STRING} +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT :Begrænser hvor hurtigt spillet kører, når hurtig kørsel er aktiveret. 0 = ingen grænse (så hurtigt som din computer er i stand til.) Værdier under 100% sænker spillets hastighed. Den øvre grænse afhænger af din computers specifikationer og kan variere afhængig af spillet. STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% normal simulationshastighed ###setting-zero-is-special +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Ingen grænse (så hurtigt din computer er i stand til) STR_CONFIG_SETTING_SOUND_TICKER :Nyhedssymbol: {STRING} STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Afspil lyd for opsummerede nyheds beskeder @@ -1731,8 +1793,12 @@ STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Aldrig +STR_CONFIG_SETTING_ECONOMY_TYPE :Økonomitype: {STRING} +STR_CONFIG_SETTING_ECONOMY_TYPE_HELPTEXT :Udjævnet økonomi ændrer produktionsniveauet oftere, og i mindre trin. Frossen økonomi forhindrer ændringer i produktionsniveauet og industrilukninger. Denne indstilling kan muligvis ikke have nogen effekt hvis industrityperne stammer fra en NewGRF. ###length 3 -STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Smooth +STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Original +STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Udjævnet +STR_CONFIG_SETTING_ECONOMY_TYPE_FROZEN :Frossen STR_CONFIG_SETTING_ALLOW_SHARES :Tillad at købe aktier i andre selskaber: {STRING} STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Hvis aktiveret, tillades køb og salg af selskabsaktier. Aktier vil kun være tilgængelige for selskaber der er nået en hvis alder @@ -1753,12 +1819,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Byg automatisk STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Sæt året hvor elektriske signaler vil blive brugt på spor. Før dette år vil ikke-elektriske signaler blive brugt (hvilket har den fuldstændig same funktion, men anderledes udseende) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Bladr gennem signaltyper: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Vælg hvilke signaltyper et vælge imellem, når der Ctrl+klikkes på byg signal med signalværktøjet +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Vælg hvilke signaltyper et vælge imellem, når der Ctrl+klikkes på et bygget signal med signalværktøjet ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Kun togvejssignaler -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Alle +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Alle viste +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Vis signaltyper: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Vælg hvilke signaltyper der vises i signal-værktøjslinjen ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Kun togvejssignaler +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Alle signaler STR_CONFIG_SETTING_TOWN_LAYOUT :Vej-layout for nye byer: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Layout for vejnettet i byer @@ -1791,9 +1861,12 @@ STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Kvadratisk (ori STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Lineær STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Placering af træer i spillet: {STRING} -STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Kontroller den tilfældige fremkomst af træer i løbet af spillet. Dette vil påvirke industrier der afhænger træers vækst, f.eks. savværker +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Kontroller den tilfældige fremkomst af træer i løbet af spillet. Dette vil påvirke industrier der er afhængige af træers vækst, f.eks. skovhuggerier. ###length 4 +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Vokser men spreder ikke {RED}(ødelægger skovhuggeri) +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Vokser men spreder kun i regnskove STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Voks og spred ud overalt +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_GROWTH_NO_SPREAD :Vokser ikke, spreder ikke {RED}(ødelægger skovhuggeri) STR_CONFIG_SETTING_TOOLBAR_POS :Placering af værktøjslinje: {STRING} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Horisontal placering af hovedværktøjlinjen i toppen af skærmen @@ -1822,7 +1895,12 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_2X :2x STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN :Højeste sprite-opløsning der må anvendes: {STRING} +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN_HELPTEXT :Begrænser den maksimale opløsning for sprites. Denne begrænsning vil forhindre brug af højopløsningsgrafik selv når den er tilgængelig. Dette kan bevare en ensartet fremtoning af spillet når der er en blanding af GRF filer med og uden højopløsningsgrafik. ###length 3 +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_NORMAL :1x STR_CONFIG_SETTING_TOWN_GROWTH :Byvækst tempo: {STRING} STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :Hastigheden af by vækst @@ -1876,6 +1954,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Når en hastigh STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_IMPERIAL :Imperisk (mph) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :Metrisk (km/t) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_SI :SI (m/s) +STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_GAMEUNITS :Spil-enheder (felter/dag) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :Køretøjskraftenheder: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :Når et køretøjs kraft er vist i brugergrænsefladen, så vis dem i de valgte enheder @@ -1935,6 +2014,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Fragtdistribution STR_CONFIG_SETTING_AI :{ORANGE}Modstandere STR_CONFIG_SETTING_AI_NPC :{ORANGE}Computerstyrede spillere +STR_CONFIG_SETTING_NETWORK :{ORANGE}Netværk STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Stifinder til tog: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Stifinder til brug for toge @@ -1971,6 +2051,7 @@ STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}Utilstr STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}Allokering af {BYTES} spritecache fejlede. Spritecachen blev indskrænket til {BYTES}. Dette vil sænke OpenTTDs ydelse. Du kan forsøge at slå 32bpp grafik og/eller zoom-ind niveauer for at reducere hukommelseskravet # Video initalization errors +STR_VIDEO_DRIVER_ERROR :{WHITE}Fejl med grafikindstillinger... STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... ingen kompatibel GPU fundet. Hardware-acceleration deaktiveret # Intro window @@ -2016,6 +2097,7 @@ STR_INTRO_TRANSLATION :{BLACK}Denne ov # Quit window STR_QUIT_CAPTION :{WHITE}Afslut +STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}Er du sikker på du vil afslutte OpenTTD? STR_QUIT_YES :{BLACK}Ja STR_QUIT_NO :{BLACK}Nej @@ -2027,6 +2109,7 @@ STR_ABANDON_SCENARIO_QUERY :{YELLOW}Er du s # Cheat window STR_CHEATS :{WHITE}Snydefunktioner STR_CHEATS_TOOLTIP :{BLACK}Checkbokse viser, om du har brugt denne snydefunktion før +STR_CHEATS_NOTE :{BLACK}Bemærk: Al anvendelse af disse indstillinger bliver registreret i det gemte spil STR_CHEAT_MONEY :{LTBLUE}Forøg kassebeholdning med {CURRENCY_LONG} STR_CHEAT_CHANGE_COMPANY :{LTBLUE}Spiller som firmaet: {ORANGE}{COMMA} STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Magisk bulldozer (nedriv ting, som normalt ikke kan fjernes): {ORANGE}{STRING} @@ -2141,6 +2224,9 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Ændre s # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Lokal +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Offentlig +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Kun inviterede # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Netværksspil @@ -2173,9 +2259,12 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Server STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Serveradresse: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Start dato: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Nuværende dato: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Spilscript: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Beskyttet af kodeord! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVEREN ER OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVEREN ER FULD +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SERVER HAR UDELUKKET DIG +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVER ER FOR GAMMEL STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}Din og serverens version passer ikke sammen STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF ULIGHED @@ -2183,12 +2272,17 @@ STR_NETWORK_SERVER_LIST_JOIN_GAME :{BLACK}Tilslut STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}Genopfrisk server STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}Genopfrisk serverens info +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET :{BLACK}Søg på internettet +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Søg på internettet efter offentlige servere +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Søg på LAN +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Søg på det lokale netværk efter servere STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Tilføj server -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Tilføjer en server til listen, som altid vil blive tjekket for kørerende spil. +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Tilføjer en server til listen. Dette kan enten være en server-adresse eller en invitationskode. STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Start server STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Start en ny server STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Indtast dit navn +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Indtast server-adresse eller invitationskode # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Start et nyt netværksspil @@ -2198,6 +2292,8 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}Navnet v STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Sæt kodeord STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Beskyt dit spil med et kodeord hvis du ikke vil have fremmede med +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Synlighed +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Hvorvidt andre kan se din server i den offentlige liste STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} klient{P "" er} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Maksimalt antal tilladte klienter: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Vælg det maksimale antal klienter. Det er ikke nødvendigt at fylde dem alle @@ -2230,15 +2326,64 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Serveren STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Selskabet er beskyttet. Indtast kodeord # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Klient liste +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Online spillere +STR_NETWORK_COMPANY_LIST_SPECTATE :Bliv tilskuer # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Online Spillere +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Navn +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Navn på serveren du spiller på +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Rediger navnet på din server +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Navn på server +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Synlighed +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Hvorvidt andre folk kan se din server på den offentlige liste +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Invitationskode +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Invitationskode som andre spillere kan bruge til at tilslutte denne server +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Forbindelsestype +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Hvorvidt og hvordan din server kan nås af andre +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Spiller +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Navn +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Dit spillernavn +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Rediger dit spillernavn +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Dit spillernavn +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Administrative handlinger der kan udføres for denne klient +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Administrative handlinger der kan udføres for dette selskab +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Tilslut dette selskab +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Send en besked til denne spiller +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Send en besked til alle spillere i dette selskab +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Send en besked til alle tilskuere +STR_NETWORK_CLIENT_LIST_SPECTATORS :Tilskuere +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Nyt selskab) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Etabler et nyt selskab og tilslut dig det +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Dette er dig +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Dette er værten for dette spil +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} klient{P "" er} / {NUM} selskab{P "" er} # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Lokal +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Spillere udefra kan ikke forbinde +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Offentlig +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Bag NAT +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Via relæ +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Smid ud +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Udeluk +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Slet +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Lås adgangskode op +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Admin handling +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Er du sikker på du ønsker at smide spilleren '{STRING}' ud? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Er du sikker på du ønsker at udelukke spilleren '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Er du sikker på du ønsker at slette selskabet '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Er du sikker på du ønsker at nulstille adgangskoden til selskabet '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Anvend relæ? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Det lykkedes ikke at etablere en forbindelse mellem dig og serveren '{STRING}'.{}Ønsker du at anvende '{STRING}' som relæ for denne gang? +STR_NETWORK_ASK_RELAY_NO :{BLACK}Nej +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Ja, denne gang +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Ja, spørg ikke igen STR_NETWORK_SPECTATORS :Tilskuere @@ -2267,21 +2412,24 @@ STR_NETWORK_CHAT_TO_COMPANY :[Hold] Til {STR STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] Til {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Alle] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Skriv tekst i netværks-chat # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Ingen netværksheder fundet -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Serveren besvarede ikke denne forspørgsel +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Serveren besvarede ikke forbindelsen i tide eller afviste forbindelsen STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Kunne ikke tilslutte grundet NewGRF ulighed STR_NETWORK_ERROR_DESYNC :{WHITE}Netværks synkroniseringsfejl STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Netværksforbindelse mistet STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Kunne ikke hente gemt spil STR_NETWORK_ERROR_SERVER_START :{WHITE}Kunne ikke starte serveren STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Der opstod en protokol-fejl og forbindelsen blev lukket +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Dit spillernavn er ikke registreret. Navnet kan sættes i toppen af Netværksspil vinduet. +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Dit servernavn er ikke indstillet. Navnet kan indstilles øverst i Netværksspil vinduet STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Revisionen af denne klient passer ikke sammen med serverens revision STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Forkert kodeord STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Serveren er fuld -STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Du er bandlyst fra denne server +STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Du er udelukket fra denne server STR_NETWORK_ERROR_KICKED :{WHITE}Du blev smidt ud af spillet STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}Grund: {STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}Snyderi er ikke tilladt på denne server @@ -2290,6 +2438,7 @@ STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Du tog f STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}Din computer er for langsom at holde trit med serveren STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}Din computer tog for lang tid om at downloade kortet STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}Din computer var for længe om at forbinde til serveren +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}Dit spillernavn er ikke gyldigt STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Mulig forbindelses tab STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}De{P 0 t ""} sidste {NUM} sekund{P "" er} er der ikke ankommet data fra serveren @@ -2315,6 +2464,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :modtog ingen ad STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :generel timeout STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :det tog for lang tid at downloade kortet STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :det tog for lang tid at bearbejde kortet +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :ugyldigt klientnavn # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2322,14 +2472,16 @@ STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} ###length 12 STR_NETWORK_SERVER_MESSAGE_GAME_PAUSED :Spillet er pauset ({STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1 :Spillet er stadig pauset ({STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2 :Spillet er stadig pauset. ({STRING}, {STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3 :Spillet er stadig pauset. ({STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2 :Spillet er stadig pauset ({STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3 :Spillet er stadig pauset ({STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_4 :Spillet er stadig pauset ({STRING}, {STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_5 :Spillet er stadig pauset ({STRING}, {STRING}, {STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED :Spillet er sat igang ({STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS :antal spillere spillere STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS :forbinder klienter STR_NETWORK_SERVER_MESSAGE_GAME_REASON_MANUAL :manuelt STR_NETWORK_SERVER_MESSAGE_GAME_REASON_GAME_SCRIPT :spil script +STR_NETWORK_SERVER_MESSAGE_GAME_REASON_LINK_GRAPH :afventer forbindelsesgraf opdatering STR_NETWORK_MESSAGE_CLIENT_LEAVING :forlader STR_NETWORK_MESSAGE_CLIENT_JOINED :*** {STRING} har tilsluttet sig spillet @@ -2339,10 +2491,15 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} ha STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} har startet et nyt selskab (#{2:NUM}) STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} har forladt spillet ({2:STRING}) STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} har ændret sit navn til {STRING} +STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} gav {2:CURRENCY_LONG} til {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Serveren har lukket ned for dette spil STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Serveren genstarter...{}Vent venligst... -STR_NETWORK_MESSAGE_KICKED :*** {STRING} blev sparket ud. Grund: ({STRING}) +STR_NETWORK_MESSAGE_KICKED :*** {STRING} blev smidt ud. Grund: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Server registrering mislykkedes +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}En anden server har registreret sig med samme invitationskode. Skifter til "lokal" spiltype. +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Din server tillader ikke forbindelser udefra +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Andre spillere vil ikke kunne forbinde til din server # Content downloading window STR_CONTENT_TITLE :{WHITE}Download af indhold @@ -2419,6 +2576,9 @@ STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}Grafikfi STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Ja, download grafikfilerne STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Nej, afslut OpenTTD +STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Download mislykkedes +STR_MISSING_GRAPHICS_ERROR :{BLACK}Download af grafikfiler mislykkedes.{}Venligst hent grafikfilerne manuelt. +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Afslut OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Gennemsigtighedsvalg @@ -2462,6 +2622,7 @@ STR_JOIN_WAYPOINT_CAPTION :{WHITE}Forbind STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT :{YELLOW}Byg et separat waypoint # Generic toolbar +STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE :{BLACK}Deaktiveret da der aktuelt ikke er nogen fartøjer tilgængelige for denne infrastruktur # Rail construction toolbar STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION :Jernbanekonstruktion @@ -2530,14 +2691,14 @@ STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Forminds STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Forøg træk-og-slip signalafstand # Bridge selection window -STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}Vælg togbro +STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}Vælg jernbanebro STR_SELECT_ROAD_BRIDGE_CAPTION :{WHITE}Vælg vejbro -STR_SELECT_BRIDGE_SELECTION_TOOLTIP :{BLACK}Valg af bro - klik på din yndlings bro for at bygge den +STR_SELECT_BRIDGE_SELECTION_TOOLTIP :{BLACK}Valg af bro - klik på din foretrukne brotype for at bygge den STR_SELECT_BRIDGE_INFO :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY_LONG} STR_SELECT_BRIDGE_SCENEDIT_INFO :{GOLD}{STRING},{} {VELOCITY} STR_BRIDGE_NAME_SUSPENSION_STEEL :Hængebro, stål STR_BRIDGE_NAME_GIRDER_STEEL :Bjælkebro, stål -STR_BRIDGE_NAME_CANTILEVER_STEEL :Frithængende bro, stål +STR_BRIDGE_NAME_CANTILEVER_STEEL :Gerberbro, stål STR_BRIDGE_NAME_SUSPENSION_CONCRETE :Hængebro, beton STR_BRIDGE_NAME_WOODEN :Træ STR_BRIDGE_NAME_CONCRETE :Beton @@ -2597,7 +2758,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Byg en h STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Placer en bøje, der kan bruges som yderligere navigationspunkt. Shift skifter mellem at bygge og vise prisoverslag. STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Byg akvædukt. Shift skifter mellem at bygge og vise prisoverslag. STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Definer vandområde.{}Lav en kanal, med mindre CTRL-tasten bruges ved havniveau, da omgivelserne i stedet vil blive oversvømmet -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Placér floder. +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Placér floder. Ctrl markerer området diagonalt. # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Retning af skibsdok @@ -2657,6 +2818,12 @@ STR_TREES_RANDOM_TYPE :{BLACK}Træer a STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}Placer træer af tilfældig type. Shift skifter mellem at bygge og vise prisoverslag. STR_TREES_RANDOM_TREES_BUTTON :{BLACK}Tilfældige træer STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}Plant træer tilfældigt i landskabet +STR_TREES_MODE_NORMAL_BUTTON :{BLACK}Normal +STR_TREES_MODE_NORMAL_TOOLTIP :{BLACK}Plant individuelle træer ved at trække hen over landskabet. +STR_TREES_MODE_FOREST_SM_BUTTON :{BLACK}Lund +STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}Plant små skove ved at trække hen over landskabet. +STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}Skov +STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Plant store skove ved at trække hen over landskabet # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}Land-generering @@ -2707,12 +2874,18 @@ STR_FOUND_TOWN_SELECT_LAYOUT_RANDOM :{BLACK}Tilfæld # Fund new industry window STR_FUND_INDUSTRY_CAPTION :{WHITE}Finansiér ny industri STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}Vælg passende industri fra denne liste -STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :Mange tilfældige industrier +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :{BLACK}Skab tilfældige industrier STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}Dæk kortet med tilfældigt placerede industrier +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_CAPTION :{WHITE}Skab tilfældige industrier +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_QUERY :{YELLOW}Er du sikker på du ønsker at skabe mange tilfældige industrier? STR_FUND_INDUSTRY_INDUSTRY_BUILD_COST :{BLACK}Pris: {YELLOW}{CURRENCY_LONG} STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}Efterforsk STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Byg STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}Finansiér +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}Fjern alle industrier +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_TOOLTIP :{BLACK}Fjern alle industrier der nuværende er på kortet +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_CAPTION :{WHITE}Fjern alle industrier +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :{YELLOW}Er du sikker på du ønsker at fjerne alle industrier? # Industry cargoes window STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION :{WHITE}Industrikæde for {STRING} industri @@ -2733,6 +2906,7 @@ STR_INDUSTRY_CARGOES_SELECT_INDUSTRY_TOOLTIP :{BLACK}Vælg in # Land area window STR_LAND_AREA_INFORMATION_CAPTION :{WHITE}Landområde-information +STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Centrer hovedvinduet over feltets placering. Ctrl+klik åbner et nye vindue over feltet. STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A :{BLACK}Pris for at rydde: {LTBLUE}N/A STR_LAND_AREA_INFORMATION_COST_TO_CLEAR :{BLACK}Pris for at rydde: {RED}{CURRENCY_LONG} STR_LAND_AREA_INFORMATION_REVENUE_WHEN_CLEARED :{BLACK}Indtægt ved rydning: {LTBLUE}{CURRENCY_LONG} @@ -2828,21 +3002,21 @@ STR_LAI_WATER_DESCRIPTION_SHIP_DEPOT :Skibsdok STR_LAI_TUNNEL_DESCRIPTION_RAILROAD :Jernbanetunnel STR_LAI_TUNNEL_DESCRIPTION_ROAD :Tunnel -STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_STEEL :Jernbanehængebro af stål -STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL :Jernbanebjælkebro af stål -STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL :Frithængende jernbanebro af stål -STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_CONCRETE :Forstærket jernbanehængebro af beton -STR_LAI_BRIDGE_DESCRIPTION_RAIL_WOODEN :Jernbanebro af træ -STR_LAI_BRIDGE_DESCRIPTION_RAIL_CONCRETE :Jernbanebro af beton -STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL :Rørformet jernbanebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_STEEL :Stål-jernbanehængebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL :Stålbjælke jernbanebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL :Stålgerber jernbanebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_CONCRETE :Armeret beton jernbanehængebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_WOODEN :Træ-jernbanebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_CONCRETE :Beton-jernbanebro +STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL :Stålrør-jernbanebro -STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_STEEL :Hængebro af stål -STR_LAI_BRIDGE_DESCRIPTION_ROAD_GIRDER_STEEL :Bjælkebro af stål -STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL :Frithængende bro af stål -STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_CONCRETE :Forstærket hængebro af beton -STR_LAI_BRIDGE_DESCRIPTION_ROAD_WOODEN :Bro af træ -STR_LAI_BRIDGE_DESCRIPTION_ROAD_CONCRETE :Bro af beton -STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL :Rørformet bro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_STEEL :Stål-vejhængebro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_GIRDER_STEEL :Stålbjælke vejbro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL :Stålgerber vejbro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_CONCRETE :Armeret beton vejhængebro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_WOODEN :Træ-vejbro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_CONCRETE :Beton-vejbro +STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL :Stålrør-vejbro STR_LAI_BRIDGE_DESCRIPTION_AQUEDUCT :Akvædukt @@ -2940,6 +3114,8 @@ STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: STR_SAVELOAD_FILTER_TITLE :{BLACK}Filter-udtryk: STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}Overskriv fil STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}Er du sikker på du vil overskrive den eksisterende fil? +STR_SAVELOAD_DIRECTORY :{STRING} (Mappe) +STR_SAVELOAD_PARENT_DIRECTORY :{STRING} (Overmappe) STR_SAVELOAD_OSKTITLE :{BLACK}Skriv et navn til det gemte spil @@ -2951,6 +3127,17 @@ STR_MAPGEN_BY :{BLACK}* STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Antal byer: STR_MAPGEN_DATE :{BLACK}Dato: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Antal industrier: +STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Højeste bjergtop: +STR_MAPGEN_HEIGHTMAP_HEIGHT_UP :{BLACK}Forøger den maksimale højde på højeste bjergtop på kortet med én +STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN :{BLACK}Sænker den maksimale højde på højeste bjergtop på kortet med én +STR_MAPGEN_SNOW_COVERAGE :{BLACK}Snedække: +STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}Forøger snedækket med ti procent +STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}Sænker snedækket med ti procent +STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% +STR_MAPGEN_DESERT_COVERAGE :{BLACK}Ørkendækning: +STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}Forøger ørkendækningen med ti procent +STR_MAPGEN_DESERT_COVERAGE_DOWN :{BLACK}Sænker ørkendækningen med ti procent +STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_LAND_GENERATOR :{BLACK}Terrængenerator: STR_MAPGEN_TERRAIN_TYPE :{BLACK}Terræntype: STR_MAPGEN_QUANTITY_OF_SEA_LAKES :{BLACK}Havniveau @@ -2976,6 +3163,10 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}Højdeko STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}Størrelse: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} +STR_MAPGEN_TERRAIN_TYPE_QUERY_CAPT :{WHITE}Ønsket højeste bjergtop +STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT :{WHITE}Højeste bjergtop +STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT :{WHITE}Snedække (i %) +STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}Ørkendækning (i %) STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}Ændre startår # SE Map generation @@ -3114,6 +3305,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Advarsel: STR_NEWGRF_ERROR_MSG_ERROR :{RED}Fejl: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatalt: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}En fatal NewGRF-fejl er opstået:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}Der er opstået en NewGRF-fejl:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} virker ikke med TTDPatch-versionen rapporteret af OpenTTD. STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} er beregnet til {STRING}-versionen af TTD. STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} er designet til brug sammen med {STRING} @@ -3182,7 +3374,7 @@ STR_INVALID_VEHICLE : STR_WARNING_LOADGAME_REMOVED_TRAMS :{WHITE}Spillet er gemt i en version uden sporveje. Alle sporveje er blevet fjernet. @@ -4429,6 +4643,7 @@ STR_WARNING_FALLBACK_SOUNDSET :{WHITE}Kun nød STR_WARNING_SCREENSHOT_SIZE_CAPTION :{WHITE}Kæmpe skærmbillede STR_WARNING_SCREENSHOT_SIZE_MESSAGE :{YELLOW}Skærmbilledet vil få en opløsning på {COMMA} x {COMMA} pixels. Det kan tage et stykke tid at tage skærmbilledet, ønsker du at forstætte? +STR_MESSAGE_HEIGHTMAP_SUCCESSFULLY :{WHITE}Højdekort er blevet gemt som '{STRING}'. Højeste bjergtop er {NUM} STR_MESSAGE_SCREENSHOT_SUCCESSFULLY :{WHITE}Skærmbilledet blev gemt som '{STRING}' STR_ERROR_SCREENSHOT_FAILED :{WHITE}Fejl under tagning af skærmbillede! @@ -4482,6 +4697,7 @@ STR_ERROR_LOAN_ALREADY_REPAYED :{WHITE}... inge STR_ERROR_CURRENCY_REQUIRED :{WHITE}... {CURRENCY_LONG} krævet STR_ERROR_CAN_T_REPAY_LOAN :{WHITE}Kan ikke tilbagebetale lån... STR_ERROR_INSUFFICIENT_FUNDS :{WHITE}Du kan ikke forære penge væk, som du har lånt i banken... +STR_ERROR_CAN_T_GIVE_MONEY :{WHITE}Kan ikke give penge til dette selskab... STR_ERROR_CAN_T_BUY_COMPANY :{WHITE}Kan ikke købe selskab... STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS :{WHITE}Kan ikke bygge selskabets hovedkvarter... STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS :{WHITE}Kan ikke købe 25% aktier i dette selskab... @@ -4608,6 +4824,7 @@ STR_ERROR_DEPOT_WRONG_DEPOT_TYPE :Forkert depotty STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE} er blevet for langt efter udskiftning STR_ERROR_AUTOREPLACE_NOTHING_TO_DO :{WHITE}Ingen autoudskiftning/-fornyelse foretaget. STR_ERROR_AUTOREPLACE_MONEY_LIMIT :(ikke penge nok) +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_CARGO :{WHITE}Nyt fartøj kan ikke transportere {STRING} STR_ERROR_AUTOREPLACE_INCOMPATIBLE_REFIT :{WHITE}Nyt køretøj kan ikke auto-tilpasses i ordren{NUM} # Rail construction errors @@ -4883,7 +5100,7 @@ STR_INDUSTRY_NAME_WATER_SUPPLY :Vandværk STR_INDUSTRY_NAME_WATER_TOWER :Vandtårn STR_INDUSTRY_NAME_FACTORY_2 :Fabrik STR_INDUSTRY_NAME_FARM_2 :Bondegård -STR_INDUSTRY_NAME_LUMBER_MILL :Træfabrik +STR_INDUSTRY_NAME_LUMBER_MILL :Skovhuggeri STR_INDUSTRY_NAME_COTTON_CANDY_FOREST :Candyfloss Skov STR_INDUSTRY_NAME_CANDY_FACTORY :Slikfabrik STR_INDUSTRY_NAME_BATTERY_FARM :Batterigård @@ -4902,10 +5119,10 @@ STR_INDUSTRY_NAME_SUGAR_MINE :Sukkermine ##id 0x6000 STR_SV_EMPTY : STR_SV_UNNAMED :Ikke navngivet -STR_SV_TRAIN_NAME :Tog {COMMA} -STR_SV_ROAD_VEHICLE_NAME :Vejkøretøj {COMMA} -STR_SV_SHIP_NAME :Skib {COMMA} -STR_SV_AIRCRAFT_NAME :Fly {COMMA} +STR_SV_TRAIN_NAME :Tog #{COMMA} +STR_SV_ROAD_VEHICLE_NAME :Vejkøretøj #{COMMA} +STR_SV_SHIP_NAME :Skib #{COMMA} +STR_SV_AIRCRAFT_NAME :Fly #{COMMA} ###length 27 STR_SV_STNAME :{STRING} @@ -5214,6 +5431,7 @@ STR_FORMAT_DATE_ISO :{2:NUM}-{1:STRI STR_FORMAT_COMPANY_NUM :(Firma {COMMA}) STR_FORMAT_GROUP_NAME :Gruppe {COMMA} +STR_FORMAT_GROUP_VEHICLE_NAME :{GROUP} #{COMMA} STR_FORMAT_INDUSTRY_NAME :{TOWN} {STRING} ###length 2 diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 8d5f16125a..3ce26b338c 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -4207,10 +4207,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Útban STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Útban {DEPOT} felé, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Javítás {DEPOT}ban, {VELOCITY} -STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nem elérhető {STATION}, {VELOCITY} -STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Nem elérhető {WAYPOINT}, {VELOCITY} -STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nem elérhető {DEPOT}, {VELOCITY} -STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nem elérhető {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}{STATION} nem elérhető, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}{WAYPOINT} nem elérhető, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}{DEPOT} nem elérhető, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}{DEPOT} nem elérhető, {VELOCITY} # Vehicle stopped/started animations ###length 2 diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 27f5ee18f0..821538d76f 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -48,11 +48,11 @@ STR_CARGO_PLURAL_WHEAT :Gandum STR_CARGO_PLURAL_RUBBER :Karet STR_CARGO_PLURAL_SUGAR :Gula STR_CARGO_PLURAL_TOYS :Mainan -STR_CARGO_PLURAL_SWEETS :Manisan +STR_CARGO_PLURAL_SWEETS :Gula-gula STR_CARGO_PLURAL_COLA :Kola STR_CARGO_PLURAL_CANDYFLOSS :Arum Manis STR_CARGO_PLURAL_BUBBLES :Gelembung -STR_CARGO_PLURAL_TOFFEE :Gula-gula +STR_CARGO_PLURAL_TOFFEE :Permen STR_CARGO_PLURAL_BATTERIES :Baterai STR_CARGO_PLURAL_PLASTIC :Plastik STR_CARGO_PLURAL_FIZZY_DRINKS :Minuman Ringan @@ -82,11 +82,11 @@ STR_CARGO_SINGULAR_WHEAT :Gandum STR_CARGO_SINGULAR_RUBBER :Karet STR_CARGO_SINGULAR_SUGAR :Gula STR_CARGO_SINGULAR_TOY :Mainan -STR_CARGO_SINGULAR_SWEETS :Manisan +STR_CARGO_SINGULAR_SWEETS :Gula-gula STR_CARGO_SINGULAR_COLA :Kola STR_CARGO_SINGULAR_CANDYFLOSS :Arum Manis STR_CARGO_SINGULAR_BUBBLE :Gelembung -STR_CARGO_SINGULAR_TOFFEE :Gula-gula +STR_CARGO_SINGULAR_TOFFEE :Permen STR_CARGO_SINGULAR_BATTERY :Baterai STR_CARGO_SINGULAR_PLASTIC :Plastik STR_CARGO_SINGULAR_FIZZY_DRINK :Minuman Ringan @@ -116,11 +116,11 @@ STR_QUANTITY_WHEAT :{WEIGHT_LONG} g STR_QUANTITY_RUBBER :{VOLUME_LONG} karet STR_QUANTITY_SUGAR :{WEIGHT_LONG} gula STR_QUANTITY_TOYS :{COMMA}{NBSP}mainan -STR_QUANTITY_SWEETS :{COMMA}{NBSP}kantong manisan +STR_QUANTITY_SWEETS :{COMMA}{NBSP}kantong gula-gula STR_QUANTITY_COLA :{VOLUME_LONG} kola STR_QUANTITY_CANDYFLOSS :{WEIGHT_LONG} arum manis STR_QUANTITY_BUBBLES :{COMMA} gelembung -STR_QUANTITY_TOFFEE :{WEIGHT_LONG} gula-gula +STR_QUANTITY_TOFFEE :{WEIGHT_LONG} permen STR_QUANTITY_BATTERIES :{COMMA} baterai STR_QUANTITY_PLASTIC :{VOLUME_LONG} plastik STR_QUANTITY_FIZZY_DRINKS :{COMMA} minuman ringan @@ -151,11 +151,11 @@ STR_ABBREV_WHEAT :{TINY_FONT}TG STR_ABBREV_RUBBER :{TINY_FONT}KR STR_ABBREV_SUGAR :{TINY_FONT}GL STR_ABBREV_TOYS :{TINY_FONT}MA -STR_ABBREV_SWEETS :{TINY_FONT}MN +STR_ABBREV_SWEETS :{TINY_FONT}GG STR_ABBREV_COLA :{TINY_FONT}KL STR_ABBREV_CANDYFLOSS :{TINY_FONT}AM STR_ABBREV_BUBBLES :{TINY_FONT}GL -STR_ABBREV_TOFFEE :{TINY_FONT}GG +STR_ABBREV_TOFFEE :{TINY_FONT}PM STR_ABBREV_BATTERIES :{TINY_FONT}BA STR_ABBREV_PLASTIC :{TINY_FONT}PL STR_ABBREV_FIZZY_DRINKS :{TINY_FONT}MR @@ -182,7 +182,7 @@ STR_COLOUR_GREEN :Hijau STR_COLOUR_DARK_GREEN :Hijau tua STR_COLOUR_BLUE :Biru STR_COLOUR_CREAM :Krim -STR_COLOUR_MAUVE :Lembayung muda +STR_COLOUR_MAUVE :Ungu Muda STR_COLOUR_PURPLE :Ungu STR_COLOUR_ORANGE :Oranye STR_COLOUR_BROWN :Coklat @@ -326,6 +326,8 @@ STR_GROUP_BY_NONE :Tidak ada STR_GROUP_BY_SHARED_ORDERS :Perintah bersama # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Perintah +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Buka tampilan perintah # Tooltips for the main toolbar ###length 31 @@ -491,7 +493,7 @@ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Hapus semua pes STR_ABOUT_MENU_LAND_BLOCK_INFO :Informasi area daratan STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Hidup/matikan Layar Konsol -STR_ABOUT_MENU_AI_DEBUG :Debug skrip AI +STR_ABOUT_MENU_AI_DEBUG :Debug skrip AI/Permainan STR_ABOUT_MENU_SCREENSHOT :Ambil gambar STR_ABOUT_MENU_SHOW_FRAMERATE :Tampilkan laju bingkai STR_ABOUT_MENU_ABOUT_OPENTTD :Tentang 'OpenTTD' @@ -915,7 +917,7 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW :{BLACK}Tampilan STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Perlihatkan di peta lokasi yang terlihat di viewport # Game options window -STR_GAME_OPTIONS_CAPTION :{WHITE}Pengaturan permainan +STR_GAME_OPTIONS_CAPTION :{WHITE}Opsi permainan STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Mata uang STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Pilih mata uang @@ -1017,7 +1019,7 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :lainnya STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Akselerasi perangkat keras -STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK} Centang kotak ini untuk mengizinkan OpenTTD mencoba menggunakan akselerasi perangkat keras. Pengaturan yang diubah hanya akan diterapkan saat game dimulai ulang. +STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK} Centang kotak ini untuk mengizinkan OpenTTD mencoba menggunakan akselerasi perangkat keras. Pengaturan yang diubah hanya akan diterapkan saat permainan dimulai ulang. STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Pengaturan hanya akan berlaku setelah game dimulai ulang STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync @@ -1817,12 +1819,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Gunakan sinyal STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Setel tahun saat sinyal elektris digunakan untuk kereta. Sebelum tahun ini, sinyal non-elektris akan digunakan (fungsinya sama, tapi dengan penampilan berbeda) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Pergantian jenis sinyal: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Pilih tipe sinyal untuk berganti secara memutar, Ctrl+klik saat membangun sinyal +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Pilih jenis sinyal mana yang akan digilir saat Ctrl+klik pada sinyal yang dibangun dengan alat sinyal ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Hanya sinyal jalur STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Semua +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Tampilkan jenis sinyal: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Pilih jenis sinyal yang ditampilkan di bilah alat sinyal ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Hanya sinyal jalur +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Semua sinyal STR_CONFIG_SETTING_TOWN_LAYOUT :Tampilan jalan untuk kota baru: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Rancangan bentuk jaringan jalan di kota @@ -2051,27 +2057,27 @@ STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... tida # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} -STR_INTRO_NEW_GAME :{BLACK}Permainan baru +STR_INTRO_NEW_GAME :{BLACK}Permainan Baru STR_INTRO_LOAD_GAME :{BLACK}Buka Permainan STR_INTRO_PLAY_SCENARIO :{BLACK}Mainkan Skenario STR_INTRO_PLAY_HEIGHTMAP :{BLACK}Mainkan Heightmap STR_INTRO_SCENARIO_EDITOR :{BLACK}Editor Skenario -STR_INTRO_MULTIPLAYER :{BLACK}Bermain bersama +STR_INTRO_MULTIPLAYER :{BLACK}Multi Pemain STR_INTRO_GAME_OPTIONS :{BLACK}Pengaturan Permainan -STR_INTRO_HIGHSCORE :{BLACK}Tabel nilai tertinggi +STR_INTRO_HIGHSCORE :{BLACK}Tabel Nilai Tertinggi STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Pengaturan STR_INTRO_NEWGRF_SETTINGS :{BLACK}Pengaturan NewGRF -STR_INTRO_ONLINE_CONTENT :{BLACK}Cari konten -STR_INTRO_SCRIPT_SETTINGS :{BLACK}Pengaturan AI / Permainan +STR_INTRO_ONLINE_CONTENT :{BLACK}Cari Konten Daring +STR_INTRO_SCRIPT_SETTINGS :{BLACK}Pengaturan Skrip AI/Permainan STR_INTRO_QUIT :{BLACK}Keluar -STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Mulai permainan baru. Ctrl-klik untuk melewati pengaturan peta +STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Mulai permainan baru. Ctrl-Klik melewatkan konfigurasi peta STR_INTRO_TOOLTIP_LOAD_GAME :{BLACK}Membuka permainan yang telah disimpan STR_INTRO_TOOLTIP_PLAY_HEIGHTMAP :{BLACK}Mulai permainan baru, menggunakan heightmap sebagai datarannya STR_INTRO_TOOLTIP_PLAY_SCENARIO :{BLACK}Mulai permainan baru, menggunakan skenario kustomisasi STR_INTRO_TOOLTIP_SCENARIO_EDITOR :{BLACK}Buat kustomisasi skenario permainan -STR_INTRO_TOOLTIP_MULTIPLAYER :{BLACK}Memulai permainan bersama +STR_INTRO_TOOLTIP_MULTIPLAYER :{BLACK}Memulai permainan multi pemain STR_INTRO_TOOLTIP_TEMPERATE :{BLACK}Pilih gaya lansekap 'sederhana' STR_INTRO_TOOLTIP_SUB_ARCTIC_LANDSCAPE :{BLACK}Pilih gaya lansekap 'Sub Antartika' @@ -2081,7 +2087,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Pilih ga STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Tampilkan opsi permainan STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Tampilkan tabel nilai tertinggi STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Tampilkan pengaturan -STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Tampilkan setelan NewGRF +STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Tampilkan pengaturan NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Cari konten baru dan pembaruan untuk diunduh STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Tampilkan pengaturan permainan dan AI STR_INTRO_TOOLTIP_QUIT :{BLACK}Keluar OpenTTD @@ -2098,7 +2104,7 @@ STR_QUIT_NO :{BLACK}Tidak # Abandon game STR_ABANDON_GAME_CAPTION :{WHITE}Batalkan Permainan STR_ABANDON_GAME_QUERY :{YELLOW}Apakah anda yakin untuk meninggalkan permainan? -STR_ABANDON_SCENARIO_QUERY :{YELLOW}Apa anda yakin mau keluar dari skenario ini ? +STR_ABANDON_SCENARIO_QUERY :{YELLOW}Apakan anda yakin untuk mengabaikan skenario ini ? # Cheat window STR_CHEATS :{WHITE}Kode Curang @@ -2321,6 +2327,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Perusaha # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Pemain Dalam Jaringan +STR_NETWORK_COMPANY_LIST_SPECTATE :Menonton # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Pemain Online @@ -2405,6 +2412,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Tim] Ke {STRIN STR_NETWORK_CHAT_CLIENT :[Privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privat] Ke {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Semua] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Masukkan teks untuk perbincangan jaringan # Network messages @@ -4135,6 +4143,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Menuju STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Menuju ke {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Perbaikan pada {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Tidak dapat mencapai {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Tidak dapat mencapai {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Tidak dapat mencapai {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Tidak dapat mencapai {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -5098,7 +5110,7 @@ STR_INDUSTRY_NAME_TOY_FACTORY :Pabrik Mainan STR_INDUSTRY_NAME_PLASTIC_FOUNTAINS :Sumber Mata Air Plastik STR_INDUSTRY_NAME_FIZZY_DRINK_FACTORY :Pabrik Minuman Ringan STR_INDUSTRY_NAME_BUBBLE_GENERATOR :Pembangkit Gelembung -STR_INDUSTRY_NAME_TOFFEE_QUARRY :Tambang gula-gula +STR_INDUSTRY_NAME_TOFFEE_QUARRY :Tambang Permen STR_INDUSTRY_NAME_SUGAR_MINE :Tambang Gula ############ WARNING, using range 0x6000 for strings that are stored in the savegame @@ -5193,7 +5205,7 @@ STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_FRUIT_TRUCK :Gerbong Buah STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_RUBBER_TRUCK :Gerbong Karet STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_SUGAR_TRUCK :Gerbong Gula STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COTTON_CANDY_HOPPER :Gerbong Harum Manis -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_TOFFEE_HOPPER :Gerbong Kopi Toffee +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_TOFFEE_HOPPER :Gerbong Permen STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_BUBBLE_VAN :Gerbong Gelembung STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COLA_TANKER :Gerbong Tangki Cola STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_CANDY_VAN :Gerbong Manisan @@ -5223,7 +5235,7 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_FRUIT_TRUCK :Gerbong Buah STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_RUBBER_TRUCK :Gerbong Karet STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_SUGAR_TRUCK :Gerbong Gula STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COTTON_CANDY_HOPPER :Gerbong Harum Manis -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_TOFFEE_HOPPER :Gerbong Toffee +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_TOFFEE_HOPPER :Gerbong Permen STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_BUBBLE_VAN :Gerbong Gelembung STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COLA_TANKER :Gerbong Cola STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_CANDY_VAN :Gerbong Manisan @@ -5255,7 +5267,7 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_FRUIT_TRUCK :Gerbong Buah STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_RUBBER_TRUCK :Gerbong Karet STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_SUGAR_TRUCK :Gerbong Gula STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COTTON_CANDY_HOPPER :Gerbong Harum Manis -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_TOFFEE_HOPPER :Gerbong Kopi Toffee +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_TOFFEE_HOPPER :Gerbong Permen STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_BUBBLE_VAN :Gerbong Gelembung STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COLA_TANKER :Gerbong Cola STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_CANDY_VAN :Gerbong Manisan @@ -5332,9 +5344,9 @@ STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_COLA_TRUCK :Truk Cola Wizzo STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_COTTON_CANDY :Truk Harum Manis MightyMover STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_COTTON_CANDY :Truk Harum Manis Powernaught STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_COTTON_CANDY_TRUCK :Truk Harum Manis Wizzowow -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_TOFFEE_TRUCK :Truk Toffee MightyMover -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOFFEE_TRUCK :Truk Toffee Powernaught -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOFFEE_TRUCK :Truk Toffee Wizzowow +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_TOFFEE_TRUCK :Truk Permen MightyMover +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOFFEE_TRUCK :Truk Permen Powernaught +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOFFEE_TRUCK :Truk Permen Wizzowow STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_TOY_VAN :Truk Mainan MightyMover STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOY_VAN :Truk Mainan Powernaught STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOY_VAN :Truk Mainan Wizzowow diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 8e4d817e34..5acd638d7a 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1015,6 +1015,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Accelera STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Seleziona questa opzione per consentire a OpenTTD di utilizzare l'accelerazione hardware. Eventuali cambiamenti avranno effetto solo dopo un riavvio del gioco STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Le nuove impostazioni avranno effetto solo dopo un riavvio del gioco +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Dimensione interfaccia STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleziona la dimensione deglie elementi dell'interfaccia grafica @@ -1154,6 +1155,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Impostaz STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filtro: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Espandi tutti 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_DEFAULT_VALUE :{LTBLUE}Valore predefinito: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Tipo impostazione: {ORANGE}{STRING} @@ -1249,6 +1251,7 @@ STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Imposta quanto ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Niente sussidi STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Costi di costruzione: {STRING.mp} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Imposta il livello dei costi di costruzione e acquisto @@ -1572,7 +1575,9 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Doppio clic STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Clic (con casella di testo attiva) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Clic (immediato) +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Se creare una connessione con il server fallisce, si può usare un servizio di relay per creare una connessione. "Mai" lo disattiverà, "Chiedi" chiederà prima, "Attiva" lo attiverà senza chiedere ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Mai STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Chiedi STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Consenti @@ -2011,6 +2016,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distribuzione dei carichi STR_CONFIG_SETTING_AI :{ORANGE}Avversari STR_CONFIG_SETTING_AI_NPC :{ORANGE}Giocatori controllati dal computer +STR_CONFIG_SETTING_NETWORK :{ORANGE}Rete STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Pathfinder per i treni: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Pathfinder da utilizzare per i treni @@ -2253,9 +2259,11 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Version STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Indirizzo del server: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data di inizio: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data corrente: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script di gioco: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Protetto da password! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER PIENO +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SEI STATO BANDITO DA QUESTO SERVER STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIONE DIFFERENTE STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF DIFFERENTI @@ -2318,16 +2326,32 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Compagni STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Elenco dei client # Network client list +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Nome +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Visibilità +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Se e come i tuoi server possono essere raggiunti da altri STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Giocatore +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Il nome del tuo personaggio STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP : {BLACK}Modifica il nome del tuo personaggio +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Manda un messaggio a tutti gli spettatori +STR_NETWORK_CLIENT_LIST_SPECTATORS :Spettatori STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Crea una nuova compagnia e controllala +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Questo è l'host del gioco +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} client{P "" s} / {NUM} compan{P y ies} # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}I giocatori remoti non possono connettersi +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Dietro NAT +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Elimina +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Sblocco con password +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Sei sicuro di voler cacciare il giocatore '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Sei sicuro di voler bannare il giocatore '{STRING}' STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Sei sicuro di voler eliminare la compagnia '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Usare il relay? +STR_NETWORK_ASK_RELAY_NO :{BLACK}No STR_NETWORK_SPECTATORS :Spettatori @@ -2404,6 +2428,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :nessuna passwor STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :timeout generico STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :il download della mappa ha richiesto troppo tempo STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :l'elaborazione della mappa ha richiesto troppo tempo +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :Nome del client non valido # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -4079,6 +4104,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Diretto STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Diretto {G "al " all' "alla "}{DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Manutenzione {G "al " all' "alla "}{DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Impossibile raggiungere {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Impossibile raggiungere {WAYPOINT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -4575,6 +4602,7 @@ STR_WARNING_FALLBACK_SOUNDSET :{WHITE}È stato STR_WARNING_SCREENSHOT_SIZE_CAPTION :{WHITE}Screenshot di grandi dimensioni STR_WARNING_SCREENSHOT_SIZE_MESSAGE :{YELLOW}Lo screenshot avrà una risoluzione di {COMMA} x {COMMA} pixel. La creazione dello screenshot può richiedere molto tempo. Continuare? +STR_MESSAGE_HEIGHTMAP_SUCCESSFULLY :{WHITE}Mappa dell'altezza salvata con successo come '{STRING}'. Il picco massimo è {NUM} STR_MESSAGE_SCREENSHOT_SUCCESSFULLY :{WHITE}Screenshot salvato con successo come '{STRING}' STR_ERROR_SCREENSHOT_FAILED :{WHITE}Screenshot non riuscito! diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index e3a9c8aad3..9bcec92e81 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -883,6 +883,7 @@ STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE :{BIG_FONT}{BLAC STR_NEWS_NEW_VEHICLE_TYPE :{BIG_FONT}{BLACK}{ENGINE} STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE :{BLACK}Un nou tip de {STRING} este acum disponibil! - {ENGINE} +STR_NEWS_SHOW_VEHICLE_GROUP_TOOLTIP :{BLACK}Deschide fereastra grupului fixată pe grupul vehiculului STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO :{WHITE}{STATION} nu mai acceptă {STRING} STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO_OR_CARGO :{WHITE}{STATION} nu mai acceptă {STRING} sau {STRING} @@ -1162,6 +1163,7 @@ STR_CONFIG_SETTING_TYPE_GAME_INGAME :Setări joc (st STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Setări companie (stocate în fişierele de salvare; afectează doar jocurile noi) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Setări companie (stocate în fişierul de salvare; afectează doar compania curentă) STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Atenție! +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Această acțiune va reface toate setările jocului la valorile implicite.{}Sigur vrei să continui? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Categorie: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Tip: @@ -1184,6 +1186,7 @@ STR_CONFIG_SETTINGS_NONE :{WHITE}- Nespec ###length 3 STR_CONFIG_SETTING_CATEGORY_HIDES :{BLACK}Arată toate rezultatele de căutare setând{}{SILVER}Categoria {BLACK}în {WHITE}{STRING} STR_CONFIG_SETTING_TYPE_HIDES :{BLACK}Arată toate rezultatele de căutare setând{}{SILVER}Tipul {BLACK}în {WHITE}Toate tipurile de setări +STR_CONFIG_SETTING_CATEGORY_AND_TYPE_HIDES :{BLACK}Arată toate rezultatele de căutare setând{}{SILVER}Categoria {BLACK}în {WHITE}{STRING} {BLACK}și {SILVER}Tipul {BLACK}ca {WHITE}Toate tipurile de setări ###length 3 STR_CONFIG_SETTING_OFF :Inactiv @@ -1309,7 +1312,7 @@ STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Zonă plată î STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Suprafaţa zonei plate din jurul industriilor. Aceasta asigură că există spaţiu liber în jurul industriilor pentru construcţia de şine, etc STR_CONFIG_SETTING_MULTIPINDTOWN :Permite mai multe industrii similare în acelaşi oras: {STRING} -STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :De obicei, un oraş nu doreşte mai multe industrii de acelaşi tip. Cu această setare, se permin mai multe industrii de acelaşi tip în acelaşi oraş +STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :De obicei, un oraș nu dorește mai multe industrii de același tip. Cu această setare, se permit mai multe industrii de același tip în același oraș STR_CONFIG_SETTING_SIGNALSIDE :Arată semnalele: {STRING} STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Selectează pe care parte a şinei să fie plasate semnalele @@ -1331,8 +1334,8 @@ STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :capătul apropi STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :mijlocul STR_CONFIG_SETTING_STOP_LOCATION_FAR_END :capătul îndepartat al -STR_CONFIG_SETTING_AUTOSCROLL :Mută imaginea când mouse-ul este la marginea ecranului: {STRING} -STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Cand este activată, ecranele se vor deplasa cînd mouse-ul este aproape de margine +STR_CONFIG_SETTING_AUTOSCROLL :Derulează imaginea când mausul este la marginea ecranului: {STRING} +STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Când este activată, vizoarele vor începe derularea când mausul este aproape de marginea ferestrei ###length 4 STR_CONFIG_SETTING_AUTOSCROLL_DISABLED :dezactivat STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT_FULLSCREEN :ecranul principal, doar în mod ecran-complet @@ -1506,6 +1509,7 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :Verde STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Verde închis STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Mov +STR_CONFIG_SETTING_SCROLLMODE :Comportament derulare vizor: {STRING} STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT :Comportamentul derulării hărții ###length 4 STR_CONFIG_SETTING_SCROLLMODE_DEFAULT :Mută fereastra de vizualizare ținând apăsat click dreapta, poziția cursorului rămânând fixă @@ -1513,7 +1517,7 @@ STR_CONFIG_SETTING_SCROLLMODE_RMB_LOCKED :Mută harta ți STR_CONFIG_SETTING_SCROLLMODE_RMB :Mută harta cu clic dreapta STR_CONFIG_SETTING_SCROLLMODE_LMB :Mută harta cu clic stânga -STR_CONFIG_SETTING_SMOOTH_SCROLLING :Derulare uşoară ecran: {STRING} +STR_CONFIG_SETTING_SMOOTH_SCROLLING :Derulare ușoară vizor: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Controlează modul de deplasare a imaginii din ecranul principal când se face click pe harta mică sau când se execută o comandă de deplasare către un obiect anume de pe hartă. Dacă este activată, imaginea se deplasează în mod fluid, altfel imaginea sare direct la zona dorită STR_CONFIG_SETTING_MEASURE_TOOLTIP :Arată o indicaţie de distanţă la folosirea uneltelor de construcţie: {STRING} @@ -1547,6 +1551,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Click dublu STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Un singur click (când este în focus) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Un singur click (instant) +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Dacă nu se poate crea conexiunea la server, poți folosi un serviciu de redirecționare pentru crearea conexiunii. „Niciodată” interzice asta, „întreabă” va întreba mai întâi, iar „permite” va accepta fără confirmare ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Permite @@ -1616,6 +1621,7 @@ STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :Elimină automa STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :Elimină automat semnalele când construiești căi ferate dacă ele îți vin în cale. Nu uita că asta ar putea conduce la accidente feroviare. STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Limita de viteză pentru trecerea timpului: {STRING} +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT :Limitează progresul jocului când este activată trecerea rapidă a timpului. 0 = fără limită (atât de rapid pe cât permite calculatorul tău). Valorile sub 100% încetinesc jocul. Plafonul vitezei depinde de specificațiile calculatorului tău și pot varia în funcție de joc. STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% din viteza normală a jocului ###setting-zero-is-special STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Fără limită (atât de rapid pe cât permite calculatorul tău) @@ -1794,6 +1800,7 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Selectează în STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Doar avansat STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Toate vizibile +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Arată tipurile de semnal: {STRING} ###length 2 STR_CONFIG_SETTING_TOWN_LAYOUT :Modelul drumurilor pentru oraşele noi: {STRING} @@ -1838,6 +1845,7 @@ STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Poziţia orizon STR_CONFIG_SETTING_STATUSBAR_POS :Poziţia barei de stare: {STRING} STR_CONFIG_SETTING_STATUSBAR_POS_HELPTEXT :Poziţia orizontală a barei principale în partea de jos a ecranului STR_CONFIG_SETTING_SNAP_RADIUS :Raza "magnetică" a ferestrelor: {STRING} +STR_CONFIG_SETTING_SNAP_RADIUS_HELPTEXT :Distanța dintre ferestre înainte ca fereastra mutată să fie alipită automat de ferestrele învecinate STR_CONFIG_SETTING_SNAP_RADIUS_VALUE :{COMMA} {P 0 pixel pixeli "de pixeli"} ###setting-zero-is-special STR_CONFIG_SETTING_SNAP_RADIUS_DISABLED :Dezactivat @@ -1861,6 +1869,7 @@ STR_CONFIG_SETTING_SPRITE_ZOOM_MIN :Rezoluția maxi ###length 3 STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_NORMAL :1x STR_CONFIG_SETTING_TOWN_GROWTH :Viteza de dezvoltare a oraşului: {STRING} STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :Viteza creşterii oraşelor @@ -1900,6 +1909,7 @@ STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :Acurateţea dis STR_CONFIG_SETTING_DEMAND_DISTANCE :Efectul distanţei asupra cererii: {STRING} STR_CONFIG_SETTING_DEMAND_DISTANCE_HELPTEXT :Dacă setezi această valoare peste 0, distanța dintre stația origine A al mărfii și o posibilă stație B va afecta cantitatea de marfă trimisă din punctul A în B. Cu cât e mai departe B de A cu atât va fi mai mică cantitatea de marfă transportată. Cu cât mărești această valoare, cu atât mai puțină marfă se livrează spre destinațiile îndepărtate si cu atât mai multă la cele mai apropiate. STR_CONFIG_SETTING_DEMAND_SIZE :Cantitatea de cargo la întoarcere pentru modul simetric: {STRING} +STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :O valoare sub 100% face distribuția simetrică să se comporte mai mult ca una asimetrică. Mai puțină marfă va fi trimisă forțat înapoi dacă o anumită cantitate este trimisă spre o stație. Dacă o setezi la 0%, distribuția simetrică se va comporta la fel ca cea asimetrică. STR_CONFIG_SETTING_SHORT_PATH_SATURATION :Saturaţia căilor de capacitate mică înainte de a utiliza căi de capacitate mare: {STRING} @@ -2043,7 +2053,7 @@ STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Setări STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Afişează setările NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Verifică dacă există resurse noi sau actualizate pentru descărcare STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Afişează setările pentru Inteligența Artificială şi pentru Scripturi Joc -STR_INTRO_TOOLTIP_QUIT :{BLACK}Ieşi din 'OpenTTD' +STR_INTRO_TOOLTIP_QUIT :{BLACK}Ieși din 'OpenTTD' STR_INTRO_BASESET :{BLACK}Setul grafic actual are lipsă {NUM} {P sprite spriteuri "de spriteuri"}. Verificați actualizările pentru setul de bază. STR_INTRO_TRANSLATION :{BLACK}Acestei traduceri îi lipse{P 0 "şte" "sc" "sc"} {NUM} {P text texte "de texte"}. Te rugăm să ajuti la îmbunătățirea OpenTTD înrolându-te ca traducător. Citește fișierul readme.txt pentru detalii. @@ -2177,6 +2187,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Schimbă # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Local STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Public # Network server list @@ -2213,6 +2224,7 @@ STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data cu STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Protejat cu parolă! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER PLIN +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SERVERUL ȚI-A INTERZIS ACCESUL STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIUNE DIFERITĂ STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEPOTRIVIRE NEWGRF @@ -2282,12 +2294,18 @@ STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Modific STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Vizibilitate STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Dacă alți oameni îți pot vedea serverul în lista publică STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Cod de invitație +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Dacă și cum poate fi găsit serverul tău de alții +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Jucător STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Nume +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Numele tău în joc STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Modifică-ți numele -STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Numele tău de jucător +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Numele tău în joc STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Trimite un mesaj tuturor jucătorilor acestei companii STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Trimite un mesaj tuturor spectatorilor +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Companie nouă) STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Creează o nouă companie și intră în ea +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Aici ești tu +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P client clienți "de clienți"} / {NUM}{P companie companii "de companii"} # Matches ConnectionType ###length 5 @@ -2299,7 +2317,10 @@ STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Sigur v STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Sigur vrei să blochezi jucătorul '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Sigur dorești ștergerea companiei '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Folosești releul? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Conexiunea la server nu s-a putut realiza '{STRING}'.{}Doriți să redirecționați această sesiune prin '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Nu +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Da, nu mă mai întreba STR_NETWORK_SPECTATORS :Spectatori @@ -2339,6 +2360,7 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Conexiun STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Nu am reuşit să încarc jocul salvat STR_NETWORK_ERROR_SERVER_START :{WHITE}Serverul nu a putut fi pornit STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Eroare de protocol. Conexiunea a fost închisă +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Nu ți-ai setat numele în joc. Numele se poate seta din partea de sus a ferestrei Multiplayer STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Versiunea acestui client este diferită de cea a serverului STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Parolă greşită STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Serverul este plin @@ -2484,6 +2506,7 @@ STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Nu, ieș STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Descărcarea a eșuat STR_MISSING_GRAPHICS_ERROR :{BLACK}Descărcarea graficii a eșuat.{}Vă rugăm descărcați manual grafica. +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Ieșire din OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Optiuni transparenţă @@ -2579,14 +2602,14 @@ STR_STATION_CLASS_WAYP :Puncte de tranz STR_BUILD_SIGNAL_CAPTION :{WHITE}Alegere semnal STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Semnal standard (semafor){}Acesta este cel mai simplu tip de semnal, permiţând numai unui tren să fie în acelaşi bloc, la un moment dat STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Semnal de intrare (semafor){}Verde, atat timp cât există unul sau mai multe semnale verzi de ieşire din secţiunea următoare a căii ferate. Altfel indică roşu -STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Semnal de ieşire (semafor){}Se comportă în acelaşi fel ca semnalul normal, dar este necesar pentru declanşarea culorii corecte la presemnalizatoarele de intrare şi cele combinate -STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP :{BLACK}Semnal combinat (semafor){}Semnalul combinat se comportă atât ca semnal de intrare, cât şi de ieşire. Acest lucru permite construcţia "arborilor" mari de presemnalizare +STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Semnal de ieșire (semafor){}Se comportă în același fel ca semnalul normal, dar este necesar pentru declanșarea culorii corecte la presemnalizatoarele de intrare și cele combinate +STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP :{BLACK}Semnal combinat (semafor){}Semnalul combinat se comportă atât ca semnal de intrare, cât și de ieșire. Acest lucru permite construcția „arborilor” mari de presemnalizare STR_BUILD_SIGNAL_SEMAPHORE_PBS_TOOLTIP :{BLACK}Semnal de cale (semafor){}Un semnal de cale va permite trecerea în acelaşi timp în blocurile de semnale a mai multor trenuri, dacă trenurile pot găsi o cale până la un punct sigur pentru oprire. Semnalele standard de cale permit trecerea din ambele sensuri STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TOOLTIP :{BLACK}Semnal de cale cu sens unic (semafor){}Un semnal de cale permite trecerea simultană a mai multor trenuri prin blocurile de semnale, dacă trenul poate rezerva o cale până la un punct sigur de oprire. Semnalele de cale cu sens unic permit trecerea intr-un singur sens STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP :{BLACK}Semnal standard (electric){}Acesta este cel mai simplu tip de semnal, permiţând numai unui tren să fie în acelaşi bloc, la un moment dat STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}Semnal de intrare (electric){}Verde, atat timp cât există unul sau mai multe semnale verzi de ieşire din secţiunea următoare a căii ferate. Altfel indică roşu -STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Semnal de ieşire (electric){}Se comportă în acelaşi fel ca semnalul normal, dar este necesar pentru declanşarea culorii corecte la presemnalizatoarele de intrare şi cele combinate -STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Semnal combinat (electric){}Semnalul combinat se comportă atât ca semnal de intrare cât şi de ieşire. Acest lucru permite construcţia "arborilor" mari de presemnalizare +STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Semnal de ieșire (electric){}Se comportă în același fel ca semnalul normal, dar este necesar pentru declanșarea culorii corecte la presemnalizatoarele de intrare și cele combinate +STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Semnal combinat (electric){}Semnalul combinat se comportă atât ca semnal de intrare, cât și de ieșire. Acest lucru permite construcția „arborilor” mari de presemnalizare STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Semnal de cale (electric){}Un semnal de cale va permite trecerea în acelaşi timp în blocurile de semnale a mai multor trenuri, dacă trenurile pot găsi o cale până la un punct sigur pentru oprire. Semnalele standard de cale permit trecerea din ambele sensuri STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Semnal de cale cu sens unic (electric){}Un semnal de cale permite trecerea simultană a mai multor trenuri prin blocurile de semnale, dacă trenul poate rezerva o cale până la un punct sigur de oprire. Semnalele de cale cu sens unic permit trecerea intr-un singur sens STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Conversie semnal{}Când este selectat, click-ul pe un semafor existent îl va converti în tipul şi varianta selectată de semnalizare. Ctrl+Click va comuta varianta existentă. Shift+Click afişează costul estimat al conversiei @@ -2633,6 +2656,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}Comută STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD :{BLACK}Convertește/Modernizează tipul drumului. Shift comută construcția/afișarea costului estimat STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM :{BLACK}Convertește/Modernizează tipul tramvaiului. Shift comută construcția/afișarea costului estimat +STR_ROAD_NAME_ROAD :Drum STR_ROAD_NAME_TRAM :Șină de tramvai # Road depot construction window @@ -2779,6 +2803,7 @@ STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}Alege in STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :{BLACK}Creează multe industrii aleatoare STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}Umple harta cu industrii generate aleator STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_CAPTION :{WHITE}Creează multe industrii aleatoare +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_QUERY :{YELLOW}Sigure vrei să creezi multe industrii aleatoare? STR_FUND_INDUSTRY_INDUSTRY_BUILD_COST :{BLACK}Cost: {YELLOW}{CURRENCY_LONG} STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}Prospectează STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Construieşte @@ -2961,6 +2986,7 @@ STR_FRAMETIME_CAPTION_GL_ECONOMY :Manipularea în STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Decalaj grafic de conexiuni STR_FRAMETIME_CAPTION_DRAWING :Randare grafică STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Randarea vizorului global +STR_FRAMETIME_CAPTION_VIDEO :Ieșire video STR_FRAMETIME_CAPTION_SOUND :Mixaj de sunet STR_FRAMETIME_CAPTION_ALLSCRIPTS :Totalul de scripturi GS/AI STR_FRAMETIME_CAPTION_AI :IA {NUM} {STRING} @@ -3005,6 +3031,7 @@ STR_MAPGEN_DATE :{BLACK}Data: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Nr. de industrii: STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Cel mai înalt vârf: STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}Mărește acoperirea cu zăpadă cu zece procente +STR_MAPGEN_DESERT_COVERAGE :{BLACK}Acoperire cu deșert: STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}Mărește întinderea deșertului cu zece procente STR_MAPGEN_DESERT_COVERAGE_DOWN :{BLACK}Reduce întinderea deșertului cu zece procente STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% @@ -3077,7 +3104,7 @@ STR_NEWGRF_SETTINGS_PRESET_LIST_TOOLTIP :{BLACK}Încarc STR_NEWGRF_SETTINGS_PRESET_SAVE :{BLACK}Salvează presetare STR_NEWGRF_SETTINGS_PRESET_SAVE_TOOLTIP :{BLACK}Salvează lista curentă ca presetare STR_NEWGRF_SETTINGS_PRESET_DELETE :{BLACK}Şterge presetarea -STR_NEWGRF_SETTINGS_PRESET_DELETE_TOOLTIP :{BLACK}Şterge presetarea selectată +STR_NEWGRF_SETTINGS_PRESET_DELETE_TOOLTIP :{BLACK}Șterge presetarea selectată STR_NEWGRF_SETTINGS_ADD :{BLACK}Adaugă STR_NEWGRF_SETTINGS_ADD_FILE_TOOLTIP :{BLACK}Adaugă fişierul NewGRF ales în configuraţie STR_NEWGRF_SETTINGS_RESCAN_FILES :{BLACK}Redetectează fişierele @@ -3122,6 +3149,7 @@ STR_NEWGRF_SETTINGS_INCOMPATIBLE :{RED}Incompatib STR_SAVE_PRESET_CAPTION :{WHITE}Salvează presetarea STR_SAVE_PRESET_LIST_TOOLTIP :{BLACK}Lista presetărilor disponibile; alegeți una pentru salvare cu numele de mai jos STR_SAVE_PRESET_TITLE :{BLACK}Adaugă denumire presetare +STR_SAVE_PRESET_EDITBOX_TOOLTIP :{BLACK}Numele selectat pentru salvarea presetării STR_SAVE_PRESET_CANCEL :{BLACK}Anulează STR_SAVE_PRESET_CANCEL_TOOLTIP :{BLACK}Nu schimba setarea implicită STR_SAVE_PRESET_SAVE :{BLACK}Salvează @@ -3172,6 +3200,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Atenţie: STR_NEWGRF_ERROR_MSG_ERROR :{RED}Eroare: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatal: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}O eroare fatală NewGRF a avut loc:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}O eroare NewGRF a avut loc:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} nu va funcţiona cu versiunea TTDPatch raportată de OpenTTD STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} este pentru versiunea {STRING} a TTD STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} este conceput pentru a fi folosit cu {STRING} @@ -3563,6 +3592,7 @@ STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industri STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Nimic- STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{STRING}{YELLOW} ({COMMA}% transportat){BLACK} STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} +STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUSTRY} {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PROD2 :{ORANGE}{INDUSTRY} {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} și încă {NUM}... @@ -3692,6 +3722,7 @@ STR_PURCHASE_INFO_RELIABILITY :{BLACK}Eficien STR_PURCHASE_INFO_COST :{BLACK}Cost: {GOLD}{CURRENCY_LONG} STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Greutate: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Viteză: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost de reparații: {GOLD}{CURRENCY_LONG}{BLACK}) Viteză: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacitate: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vagoane electrificate: {GOLD}+{POWER}{BLACK} Greutate: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Modificabil pentru: {GOLD}{STRING} @@ -3729,6 +3760,7 @@ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpăr ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară trenul selectat. Shift+clic arată costul estimat fără achiziție STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară autovehiculul selectat. Shift+clic arată costul estimat fără achiziție +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară nava selectată. Shift+clic afișează costul estimat fără achiziție STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară aeronava selectată. Shift+clic afișează costul estimat fără achiziție ###length VEHICLE_TYPES @@ -3946,6 +3978,7 @@ STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Acest bu STR_VEHICLE_VIEW_TRAIN_IGNORE_SIGNAL_TOOLTIP :{BLACK}Forţează trenul să ignore semnalizarea de oprire STR_VEHICLE_VIEW_TRAIN_REVERSE_TOOLTIP :{BLACK}Schimbă sensul de circulaţie al trenului STR_VEHICLE_VIEW_ROAD_VEHICLE_REVERSE_TOOLTIP :{BLACK}Forţează vehiculul să întoarcă +STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}Centrează vizorul principal pe destinația comenzii. Ctrl+clic deschide un nou vizor pe locația de destinație a comenzii ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_REFIT_TOOLTIP :{BLACK}Schimba tipul încãrcãturii cãratã de acest tren @@ -3987,6 +4020,7 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Merge s STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Merge către {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Service la {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nu pot ajunge la {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -4661,6 +4695,7 @@ STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE STR_ERROR_AUTOREPLACE_NOTHING_TO_DO :{WHITE}Nicio regulă autoînlocuire/reînnoire aplicată STR_ERROR_AUTOREPLACE_MONEY_LIMIT :(fonduri limitate) STR_ERROR_AUTOREPLACE_INCOMPATIBLE_CARGO :{WHITE}Noul vehicul nu poate transporta {STRING} +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_REFIT :{WHITE}Noul vehicul nu poate fi reparat în comanda {NUM} # Rail construction errors STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION :{WHITE}Combinaţie de linii imposibilă diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 54321840a5..7e11f3eb4f 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -390,6 +390,8 @@ STR_GROUP_BY_NONE :Žiadne STR_GROUP_BY_SHARED_ORDERS :Zdieľané príkazy # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Príkazy +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Otvoriť okno s príkazmi # Tooltips for the main toolbar ###length 31 @@ -860,6 +862,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * P STR_STATUSBAR_AUTOSAVE :{RED}AUTOULOŽENIE STR_STATUSBAR_SAVING_GAME :{RED}* * HRA SA UKLADÁ * * +STR_STATUSBAR_SPECTATOR :{WHITE}(sledujúci) # News message history STR_MESSAGE_HISTORY :{WHITE}Archív správ @@ -1889,7 +1892,11 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Výber návesti STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Iba trasové návestidlá STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Všetky +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Zobraziť typy signálu: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Zvoliť, aké typy signálu sú zobrazené v menu signálov ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Iba Path signály +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Všetky signály STR_CONFIG_SETTING_TOWN_LAYOUT :Návrh ciest pre nové mestá: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Rozloženie cestnej siete v mestách. @@ -2324,6 +2331,8 @@ STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Herný STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Heslo: STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER JE OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER JE PLNÝ +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}DOSTAL SI BAN +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVER PRÍLIŠ STARÝ STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}RÔZNE VERZIE STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF Chyba @@ -2386,9 +2395,10 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Spoločn # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Zoznam pripojených klientov +STR_NETWORK_COMPANY_LIST_SPECTATE :Sledovať # Network client list -STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Hra pre viacerých hráčov +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Online hráči STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Meno STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Názov servra, na ktorom práve hráte @@ -2438,6 +2448,7 @@ STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Ste si STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Ste si istý, že chcete zresetovať heslo pre spoločnosť '{COMPANY}'? STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Použiť presmerovanie? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Nepodarilo sa uskutočniť pripojenie medzi Vami a servrom '{STRING}'.{}Chceli by ste presmerovať toto pripojenie cez '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Nie STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Áno, tentokrát STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Áno, znova sa nepýtať @@ -2469,6 +2480,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Tim] pre {STRI STR_NETWORK_CHAT_CLIENT :[Osobny] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privatny] pre {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Všetkým] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Zadajte text pre sieťový chat # Network messages @@ -2553,6 +2565,7 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server s STR_NETWORK_MESSAGE_KICKED :*** Hráč {STRING} bol vyhodený. Dôvod: ({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Registrácia servra zlyhala +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Iný server s rovnakým kódom pozvánky už existuje. Mením na typ hry na lokálnu. STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Váš server nepovoľuje vzdialené pripojenia STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Ostatní hráči sa nebudú môcť pripojiť k vašemu servru @@ -4198,6 +4211,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Smeruje STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Smeruje do {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Servis v {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nedostanem sa do {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Nedostanem sa do {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nedostanem sa do {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nedostanem sa do {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 From e89be8d97ae1cb3244d5f956863d0822994f2866 Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 29 Sep 2021 18:47:12 +0000 Subject: [PATCH 010/710] Update: Translations from eints indonesian: 28 changes by bsuseno romanian: 49 changes by kneekoo --- src/lang/indonesian.txt | 56 ++++++++++++++++++------------------ src/lang/romanian.txt | 63 ++++++++++++++++++++++++++++++++--------- 2 files changed, 77 insertions(+), 42 deletions(-) diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 821538d76f..407b998248 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -172,14 +172,14 @@ STR_CRATES :{COMMA}{NBSP}pe STR_COLOUR_DEFAULT :Standar ###length 17 -STR_COLOUR_DARK_BLUE :Biru tua -STR_COLOUR_PALE_GREEN :Hijau pucat -STR_COLOUR_PINK :Merah muda +STR_COLOUR_DARK_BLUE :Biru Tua +STR_COLOUR_PALE_GREEN :Hijau Pucat +STR_COLOUR_PINK :Merah Muda STR_COLOUR_YELLOW :Kuning STR_COLOUR_RED :Merah -STR_COLOUR_LIGHT_BLUE :Biru terang +STR_COLOUR_LIGHT_BLUE :Biru Muda STR_COLOUR_GREEN :Hijau -STR_COLOUR_DARK_GREEN :Hijau tua +STR_COLOUR_DARK_GREEN :Hijau Tua STR_COLOUR_BLUE :Biru STR_COLOUR_CREAM :Krim STR_COLOUR_MAUVE :Ungu Muda @@ -616,7 +616,7 @@ STR_COMPANY_LEAGUE_COMPANY_NAME :{ORANGE}{COMPAN STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER :Insinyur STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER :Manajer Lalu lintas STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR :Koordinator trasportasi -STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR :Supervisor rute +STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR :Supervisor Rute STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR :Direktur STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE :Kepala Eksekutif STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN :Pimpinan @@ -789,8 +789,8 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}Tampilka # Status bar messages STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}Tampilkan pesan atau laporan berita terakhir STR_STATUSBAR_COMPANY_NAME :{SILVER}- - {COMPANY} - - -STR_STATUSBAR_PAUSED :{YELLOW}* * BERHENTI * * -STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * PAUSED (menunggu pembaruan grafik tautan) * * +STR_STATUSBAR_PAUSED :{YELLOW}* * DIJEDA * * +STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * DIJEDA (menunggu pembaruan grafik tautan) * * STR_STATUSBAR_AUTOSAVE :{RED}SIMPAN OTOMATIS STR_STATUSBAR_SAVING_GAME :{RED}* * MENYIMPAN PERMAINAN * * @@ -1152,7 +1152,7 @@ STR_TERRAIN_TYPE_CUSTOM :Ketinggian Kust STR_TERRAIN_TYPE_CUSTOM_VALUE :Ketinggian Kustom ({NUM}) ###length 3 -STR_CITY_APPROVAL_PERMISSIVE :Selalu boleh +STR_CITY_APPROVAL_PERMISSIVE :Selalu Boleh STR_CITY_APPROVAL_TOLERANT :Toleran STR_CITY_APPROVAL_HOSTILE :Bermusuhan @@ -2396,7 +2396,7 @@ STR_COMPANY_PASSWORD_MAKE_DEFAULT_TOOLTIP :{BLACK}Pergunak # Network company info join/password STR_COMPANY_VIEW_JOIN :{BLACK}Gabung -STR_COMPANY_VIEW_JOIN_TOOLTIP :{BLACK}Gabung dan bermain sebagai perush. ini +STR_COMPANY_VIEW_JOIN_TOOLTIP :{BLACK}Gabung dan bermain sebagai perusahaan ini STR_COMPANY_VIEW_PASSWORD :{BLACK}Kata Sandi STR_COMPANY_VIEW_PASSWORD_TOOLTIP :{BLACK}Kata Sandi-Melindungi perusahaanmu dari pemakai yang tidak bewenang untuk bergabung STR_COMPANY_VIEW_SET_PASSWORD :{BLACK}Atur Kata Sandi Perusahaan @@ -2470,12 +2470,12 @@ STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :nama yang dihub STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} ###length 12 -STR_NETWORK_SERVER_MESSAGE_GAME_PAUSED :Permainan dihentikan ({STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1 :Permainan masih dihentikan ({STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2 :Permainan masih dihentikan ({STRING}, {STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3 :Permainan masih dihentikan ({STRING}, {STRING}, {STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_4 :Permainan masih dihentikan ({STRING}, {STRING}, {STRING}, {STRING}) -STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_5 :Permainan masih dijeda({STRING}, {STRING}, {STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_PAUSED :Permainan dijeda ({STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1 :Permainan masih dijeda ({STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2 :Permainan masih dijeda ({STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3 :Permainan masih dijeda ({STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_4 :Permainan masih dijeda ({STRING}, {STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_5 :Permainan masih dijeda ({STRING}, {STRING}, {STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED :Permainan dilanjutkan ({STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS :jumlah pemain STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS :menghubungkan ke klien @@ -3578,7 +3578,7 @@ STR_CARGO_RATING_MEDIOCRE :Sedang STR_CARGO_RATING_GOOD :Baik STR_CARGO_RATING_VERY_GOOD :Sangat Baik STR_CARGO_RATING_EXCELLENT :Sempurna -STR_CARGO_RATING_OUTSTANDING :Diatas Sempurna +STR_CARGO_RATING_OUTSTANDING :Luar Biasa STR_STATION_VIEW_CENTER_TOOLTIP :{BLACK}Arahkan pandangan utama pada lokasi stasiun. Ctrl+Click akan membuka viewport baru pada lokasi stasiun STR_STATION_VIEW_RENAME_TOOLTIP :{BLACK}Ganti nama stasiun @@ -3637,10 +3637,10 @@ STR_FINANCES_INFRASTRUCTURE_BUTTON :{BLACK}Infrastr # Company view STR_COMPANY_VIEW_CAPTION :{WHITE}{COMPANY} {BLACK}{COMPANY_NUM} -STR_COMPANY_VIEW_PRESIDENT_MANAGER_TITLE :{WHITE}{PRESIDENT_NAME}{}{GOLD}(Pimpinan) +STR_COMPANY_VIEW_PRESIDENT_MANAGER_TITLE :{WHITE}{PRESIDENT_NAME}{}{GOLD}(Manajer) -STR_COMPANY_VIEW_INAUGURATED_TITLE :{GOLD}Dilantik : {WHITE}{NUM} -STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Warna tema: +STR_COMPANY_VIEW_INAUGURATED_TITLE :{GOLD}Dilantik: {WHITE}{NUM} +STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Tema Warna: STR_COMPANY_VIEW_VEHICLES_TITLE :{GOLD}Kendaraan: STR_COMPANY_VIEW_TRAINS :{WHITE}{COMMA} kereta STR_COMPANY_VIEW_ROAD_VEHICLES :{WHITE}{COMMA} kendaraan jalan raya @@ -3659,8 +3659,8 @@ STR_COMPANY_VIEW_INFRASTRUCTURE_NONE :{WHITE}nihil STR_COMPANY_VIEW_BUILD_HQ_BUTTON :{BLACK}Kantor Pusat STR_COMPANY_VIEW_BUILD_HQ_TOOLTIP :{BLACK}Membangun kantor pusat -STR_COMPANY_VIEW_VIEW_HQ_BUTTON :{BLACK}Lokasi Kantor -STR_COMPANY_VIEW_VIEW_HQ_TOOLTIP :{BLACK}Tampilkan kantor pusat +STR_COMPANY_VIEW_VIEW_HQ_BUTTON :{BLACK}Lokasi Kantor Pusat +STR_COMPANY_VIEW_VIEW_HQ_TOOLTIP :{BLACK}Tampilkan kantor pusat perusahaan STR_COMPANY_VIEW_RELOCATE_HQ :{BLACK}Pindah Kantor Pusat STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS :{BLACK}Membangun kembali kantor pusat perusahaan di tempat lain dengan 1% ongkos dari nilai perusahaan. Shift untuk menampilkan perkiraan biaya STR_COMPANY_VIEW_INFRASTRUCTURE_BUTTON :{BLACK}Detail @@ -3670,12 +3670,12 @@ STR_COMPANY_VIEW_GIVE_MONEY_TOOLTIP :{BLACK}Berikan STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}Ganti Wajah STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}Pilih wajah baru pimpinan -STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON :{BLACK}Warna tema +STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON :{BLACK}Tema Warna STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP :{BLACK}Ubah warna kendaraan perusahaan STR_COMPANY_VIEW_COMPANY_NAME_BUTTON :{BLACK}Nama Perusahaan STR_COMPANY_VIEW_COMPANY_NAME_TOOLTIP :{BLACK}Ubah nama perusahaan -STR_COMPANY_VIEW_PRESIDENT_NAME_BUTTON :{BLACK}Nama Pimpinan -STR_COMPANY_VIEW_PRESIDENT_NAME_TOOLTIP :{BLACK}Ubah nama pimpinan +STR_COMPANY_VIEW_PRESIDENT_NAME_BUTTON :{BLACK}Nama Manajer +STR_COMPANY_VIEW_PRESIDENT_NAME_TOOLTIP :{BLACK}Ubah nama manajer STR_COMPANY_VIEW_BUY_SHARE_BUTTON :{BLACK}Beli 25% saham perusahaan STR_COMPANY_VIEW_SELL_SHARE_BUTTON :{BLACK}Jual 25% saham perusahaan @@ -3683,8 +3683,8 @@ STR_COMPANY_VIEW_BUY_SHARE_TOOLTIP :{BLACK}Beli 25% STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Jual 25% saham perusahaan ini. Shift untuk menampilkan perkiraan biaya tanpa menjual saham STR_COMPANY_VIEW_COMPANY_NAME_QUERY_CAPTION :Nama Perusahaan -STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :Nama Pimpinan -STR_COMPANY_VIEW_GIVE_MONEY_QUERY_CAPTION :Masukkan jumlah uang yang ingin Anda berikan +STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :Nama Manajer +STR_COMPANY_VIEW_GIVE_MONEY_QUERY_CAPTION :Masukkan jumlah uang yang ingin anda berikan STR_BUY_COMPANY_MESSAGE :{WHITE}Kami mencari perusahaan transporasi untuk mengambil alih perusahaan kami.{}{}Anda ingin membeli {COMPANY} senilai {CURRENCY_LONG}? @@ -4669,7 +4669,7 @@ STR_ERROR_CLEARING_LIMIT_REACHED :{WHITE}... bata STR_ERROR_TREE_PLANT_LIMIT_REACHED :{WHITE}... batas penanaman pohon tercapai STR_ERROR_NAME_MUST_BE_UNIQUE :{WHITE}Nama haruslah unik STR_ERROR_GENERIC_OBJECT_IN_THE_WAY :terhalang {WHITE}{1:STRING} -STR_ERROR_NOT_ALLOWED_WHILE_PAUSED :{WHITE}Tidak diijinkan saat berhenti +STR_ERROR_NOT_ALLOWED_WHILE_PAUSED :{WHITE}Tidak diijinkan saat dijeda # Local authority errors STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS :{WHITE}Pemkot {TOWN} tidak mengijinkan anda melakukan ini diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 9bcec92e81..e88ece8e00 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -324,6 +324,7 @@ STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Profit mediu î STR_GROUP_BY_SHARED_ORDERS :Comenzi comune # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Comenzi # Tooltips for the main toolbar ###length 31 @@ -754,6 +755,7 @@ STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_ROUGH_LAND :{TINY_FONT}{BLACK}Teren pietros STR_SMALLMAP_LEGENDA_GRASS_LAND :{TINY_FONT}{BLACK}Pajişte STR_SMALLMAP_LEGENDA_BARE_LAND :{TINY_FONT}{BLACK}Teren viran +STR_SMALLMAP_LEGENDA_RAINFOREST :{TINY_FONT}{BLACK}Pădure tropicală STR_SMALLMAP_LEGENDA_FIELDS :{TINY_FONT}{BLACK}Teren agricol STR_SMALLMAP_LEGENDA_TREES :{TINY_FONT}{BLACK}Copaci STR_SMALLMAP_LEGENDA_ROCKS :{TINY_FONT}{BLACK}Pietre @@ -1002,6 +1004,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :La fiecare 12 l STR_GAME_OPTIONS_LANGUAGE :{BLACK}Limba STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Alege limba în care doreşti afişată interfaţa +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% finalizat) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Ecran întreg STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Bifează această căsuţă pentru a juca pe tot ecranul @@ -1139,6 +1142,7 @@ STR_TERRAIN_TYPE_FLAT :Plat STR_TERRAIN_TYPE_HILLY :Deluros STR_TERRAIN_TYPE_MOUNTAINOUS :Muntos STR_TERRAIN_TYPE_ALPINIST :Alpinist +STR_TERRAIN_TYPE_CUSTOM :Înălțime personalizată STR_TERRAIN_TYPE_CUSTOM_VALUE :Înălțime personalizată ({NUM}) ###length 3 @@ -1159,7 +1163,7 @@ STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valoare STR_CONFIG_SETTING_TYPE :{LTBLUE}Tip setare: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE_CLIENT :Setare client (nu se stochează în salvări; se aplică pentru toate jocurile) STR_CONFIG_SETTING_TYPE_GAME_MENU :Setări joc (stocate în fişierele de salvare; afectează doar jocurile noi) -STR_CONFIG_SETTING_TYPE_GAME_INGAME :Setări joc (stocate în fişierul de salvare; afectează doar jocul curent) +STR_CONFIG_SETTING_TYPE_GAME_INGAME :Setări joc (stocate în fișierul de salvare; afectează doar jocul curent) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Setări companie (stocate în fişierele de salvare; afectează doar jocurile noi) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Setări companie (stocate în fişierul de salvare; afectează doar compania curentă) STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Atenție! @@ -1230,6 +1234,7 @@ STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Stabilește num STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} {P an ani "de ani"} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Fără subvenții STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Costuri de construcție: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Alege nivelul de construcție și costurile de achiziție @@ -1247,6 +1252,7 @@ STR_CONFIG_SETTING_CITY_APPROVAL :Atitudinea cons STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Alege în ce măsură poluarea fonică si deranjamentul local provocat de o companie va afecta impresia orașului despre aceasta, si viitoarele planuri de construcție in zonă STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :Înălțimea limită a hărții: {STRING} +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT :Setează înălțimea maximă a terenului de pe hartă. Cu „(auto)” se va alege automat o valoare bună după generarea terenului STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_AUTO :(auto) @@ -1325,10 +1331,10 @@ STR_CONFIG_SETTING_SHOWFINANCES :Afişează fina STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Dacă este activat, fereastra de finanţe apare automat la sfârşitul fiecărui an pentru a permite inspectarea facilă a stării financiale a companiei STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Ordinele noi sunt implicit 'fără oprire': {STRING} -STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :În mod obişnuit, un vehicul va opri în fiecare staţie prin care trece. Prin activarea acestei setări, va trece prin toate staţiile în drumul către destinaţia finală, fără a oprii. Notă: această setare are efect doar asupra valorii implicite pentru comenzile noi. Comenzile individuale pot fi configurate explicit cu oricare din variante +STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :În mod normal, un vehicul va opri în fiecare stație prin care trece. Prin activarea acestei setări, va trece fără oprire prin toate stațiile în drumul către destinația finală. Notă: această setare are efect doar asupra valorii implicite pentru comenzile noi. Comenzile individuale pot fi configurate explicit cu oricare din variante STR_CONFIG_SETTING_STOP_LOCATION :Ordinele noi pentru trenuri opresc implicit la {STRING} platformei -STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Locul unde un tren va oprii pe platformă. La 'capătul apropiat' inseamnă că trenul va oprii aproape de locul de intrare, 'mijloc' inseamnă mijlocul platformei, iar 'capătul îndepărtat' înseamnă departe de locul de intrare. Notă: această setare are efect doar pentru comenzile noi. Comenzile individuale pot fi configurate explicit cu oricare din variante +STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Locul în care oprește trenul pe platformă. La „capătul apropiat” înseamnă că trenul va opri aproape de locul de intrare, „mijloc” înseamnă mijlocul platformei, iar „capătul îndepărtat” înseamnă departe de punctul de intrare. Notă: această setare are efect doar pentru comenzile noi. Comenzile individuale pot fi configurate explicit cu oricare din variante ###length 3 STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :capătul apropiat al STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :mijlocul @@ -1380,6 +1386,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Schimbar STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mentenanță infrastructură: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Cand este activă, infrastructura necesita cheltuieli cu intreținerea. Costurile cresc proporțional cu rețeaua de transport, afectând companiile mari mai mult decât companiile mici +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Culoarea de început a companiei: {STRING} STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Alegeți culoarea de început pentru companie STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroporturile nu expiră niciodată: {STRING} @@ -1430,6 +1437,7 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Grosimea liniil STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Grosimea liniilor din grafice. O linie subțire este mai informativă, o linie mai groasă este mai ușor de văzut și are culorile mai usor de distins STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Afișează numele NewGRF în fereastra de construcție a vehiculului: {STRING} +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Adaugă o linie în fereastra de construcție a vehiculului, afișând din care NewGRF vine vehiculul selectat. STR_CONFIG_SETTING_LANDSCAPE :Peisaj: {STRING} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Peisajele definesc scenariile de bază a jocului cu cerințe diferite pentru încărcături și dezvoltare a orașelor. NewGRF și scripturile de joc permit un control mai fin @@ -1553,6 +1561,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Un singur click STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Dacă nu se poate crea conexiunea la server, poți folosi un serviciu de redirecționare pentru crearea conexiunii. „Niciodată” interzice asta, „întreabă” va întreba mai întâi, iar „permite” va accepta fără confirmare ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Niciodată STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Permite STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Emulare click-dreapta: {STRING} @@ -1598,7 +1607,7 @@ STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :Arată timpii d STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Afişează plecările şi sosirile în orare: {STRING} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Arată timpii estimați de plecare și sosire în orar -STR_CONFIG_SETTING_QUICKGOTO :Creare rapidă a ordinelor pentru vehicule: {STRING} +STR_CONFIG_SETTING_QUICKGOTO :Creare rapidă a comenzilor pentru vehicule: {STRING} STR_CONFIG_SETTING_QUICKGOTO_HELPTEXT :Preselectează cursorul "mergi la" când se deschide fereastra de comenzi STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE :Tipul implicit de şină (după joc nou/încarcare joc): {STRING} @@ -1790,6 +1799,7 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :Când se trage STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_HELPTEXT :Configurează distanța la care se vor construi semnale pe șină până la următorul obstacol (semnal, intersecție), dacă se trage cu mausul STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_VALUE :{COMMA} {P 0 pătrățel pătrățele "de pătrățele"} STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE :La plasarea mai multor semale, păstrează distanţa fixă între acestea: {STRING} +STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Alege modul plasării de semnale la Ctrl+tragerea semnalelor. Dacă este dezactivat, semnalele sunt plasate în jurul tunelelor sau podurilor, pentru evitarea segmentelor lungi fără semnale. Dacă este activat, semnalele sunt plasate la fiecare n dale, ușurând alinierea semnalelor pe linii paralele STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Construieşte automat semafoare înainte de: {STRING} STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Alege anul din care se vor folosi semnale electrice pe calea feroviară. Înainte de acest an, se vor folosi semnale non-electrice care au aceeasi funcționalitate dar arată diferit @@ -1802,6 +1812,7 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Toate vizibile STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Arată tipurile de semnal: {STRING} ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Toate semnalele STR_CONFIG_SETTING_TOWN_LAYOUT :Modelul drumurilor pentru oraşele noi: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Poziţionarea sistemului rutier în oraşe @@ -1839,6 +1850,7 @@ STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Controlează ap STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Cresc dar nu se extind {RED}(strică fabrica de cherestea) STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Cresc dar se extind doar în păduri tropicale STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Cresc și se extind peste tot +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_GROWTH_NO_SPREAD :Nu cresc, nu se extind {RED}(strică fabrica de cherestea) STR_CONFIG_SETTING_TOOLBAR_POS :Poziţia barei principale de instrumente: {STRING} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Poziţia orizontală a barei principale în partea de sus a ecranului @@ -1979,6 +1991,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distribuţie cargo STR_CONFIG_SETTING_AI :{ORANGE}Concurenţi STR_CONFIG_SETTING_AI_NPC :{ORANGE}Jucători virtuali +STR_CONFIG_SETTING_NETWORK :{ORANGE}Rețea STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Algoritm de rutare pentru trenuri: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Algoritm de rutare pentru trenuri @@ -2189,6 +2202,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Schimbă ###length 3 STR_NETWORK_SERVER_VISIBILITY_LOCAL :Local STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Public +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Doar cu invitație # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Multiplayer @@ -2242,6 +2256,7 @@ STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Porneşt STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Porneşte un server propriu STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Introduceţi numele dvs. +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Introdu adresa serverului sau codul invitației # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Începe un joc nou @@ -2288,6 +2303,7 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Companie STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Jucători conectați # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Jucători conectați STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Nume STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Modifică numele serverului tău @@ -2300,6 +2316,8 @@ STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Nume STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Numele tău în joc STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Modifică-ți numele STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Numele tău în joc +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Acțiuni administrative de efectuat pentru acest client +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Intră în această companie STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Trimite un mesaj tuturor jucătorilor acestei companii STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Trimite un mesaj tuturor spectatorilor STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Companie nouă) @@ -2309,8 +2327,10 @@ STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Jucătorii de la distanță nu se pot conecta STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Public +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Blochează STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Deblocare cu parolă STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Sigur vrei să dai afară jucătorul '{STRING}'? @@ -2329,7 +2349,7 @@ STR_COMPANY_PASSWORD_CANCEL :{BLACK}Parola i STR_COMPANY_PASSWORD_OK :{BLACK}Schimbarea parolei pentru companie STR_COMPANY_PASSWORD_CAPTION :{WHITE}Parola pentru companie STR_COMPANY_PASSWORD_MAKE_DEFAULT :{BLACK}Parola implicită pentru companie -STR_COMPANY_PASSWORD_MAKE_DEFAULT_TOOLTIP :{BLACK}Foloseşte implicit parola acestei comanii pentru cele nou create +STR_COMPANY_PASSWORD_MAKE_DEFAULT_TOOLTIP :{BLACK}Folosește implicit parola acestei companii pentru cele nou create # Network company info join/password STR_COMPANY_VIEW_JOIN :{BLACK}Intră @@ -2349,6 +2369,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[Echipă] Cătr STR_NETWORK_CHAT_CLIENT :[Mesaj privat] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Mesaj privat] Către {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Toţi] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Introdu textul pentru chat în retea # Network messages @@ -2414,6 +2435,7 @@ STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS :număr de jucă STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS :conectare clienţi STR_NETWORK_SERVER_MESSAGE_GAME_REASON_MANUAL :manual STR_NETWORK_SERVER_MESSAGE_GAME_REASON_GAME_SCRIPT :script-ul jocului +STR_NETWORK_SERVER_MESSAGE_GAME_REASON_LINK_GRAPH :se așteaptă pentru actualizarea graficului conexiunilor STR_NETWORK_MESSAGE_CLIENT_LEAVING :iese STR_NETWORK_MESSAGE_CLIENT_JOINED :*** {STRING} a intrat în joc @@ -2428,6 +2450,7 @@ STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Serverul STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Serverul este repornit...{}Vă rugăm aşteptaţi... STR_NETWORK_MESSAGE_KICKED :*** {STRING} a fost dat afară. Motiv: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Serverul tău nu permite conexiuni la distanță # Content downloading window STR_CONTENT_TITLE :{WHITE}Descărcare resurse online @@ -2559,10 +2582,10 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Construcţie pe STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Construieşte cale ferată. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afişare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Construieşte cale ferată în modul automat. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afişare cost estimat -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Construieşte un depou feroviar (pentru achiziţie şi service de trenuri). Shift comută între construire/afişare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Construiește un depou feroviar (pentru achiziție și service de trenuri). Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Converteşte linia în punct de tranzit. Ctrl permite alipirea punctelor de tranzit distante. Shift comută între convertire/afişare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Construieşte gară. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Plasează semnale feroviare. Ctrl comută între semafoare/semnale electrice{}Trage cu mouse-ul pentru a construi semnale automat pe o porţiune de şină dreaptă. Apasă Ctrl pentru a construi semnale până la următoarea joncţiune{}Ctrl+Click comută deschiderea ferestrei de selectie a tipului semnalului. Shift comută între construire/afişare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Plasează semnale feroviare. Ctrl comută între semafoare/semnale electrice{}Trage cu mausul pentru a construi automat semnale pe o porțiune de șină dreaptă. Apasă Ctrl pentru a construi semnale până la următoarea joncțiune{}Ctrl+Clic comută deschiderea ferestrei de selecție a tipului de semnal. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Construieşte pod de cale ferată. Shift comută între construire/afişare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Construieşte tunel feroviar. Shift comută între construire/afişare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Comută construcţia/înlăturarea căilor ferate, semnalelor, punctelor de tranzit şi a staţiilor. Ctrl+Click înlătură şinele din punctele de tranzit şi din staţii @@ -2607,7 +2630,7 @@ STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP :{BLACK}Semnal c STR_BUILD_SIGNAL_SEMAPHORE_PBS_TOOLTIP :{BLACK}Semnal de cale (semafor){}Un semnal de cale va permite trecerea în acelaşi timp în blocurile de semnale a mai multor trenuri, dacă trenurile pot găsi o cale până la un punct sigur pentru oprire. Semnalele standard de cale permit trecerea din ambele sensuri STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TOOLTIP :{BLACK}Semnal de cale cu sens unic (semafor){}Un semnal de cale permite trecerea simultană a mai multor trenuri prin blocurile de semnale, dacă trenul poate rezerva o cale până la un punct sigur de oprire. Semnalele de cale cu sens unic permit trecerea intr-un singur sens STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP :{BLACK}Semnal standard (electric){}Acesta este cel mai simplu tip de semnal, permiţând numai unui tren să fie în acelaşi bloc, la un moment dat -STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}Semnal de intrare (electric){}Verde, atat timp cât există unul sau mai multe semnale verzi de ieşire din secţiunea următoare a căii ferate. Altfel indică roşu +STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}Semnal de intrare (electric){}Verde, atât timp cât există unul sau mai multe semnale verzi de ieșire în secțiunea următoare a căii ferate. Altfel indică roșu STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Semnal de ieșire (electric){}Se comportă în același fel ca semnalul normal, dar este necesar pentru declanșarea culorii corecte la presemnalizatoarele de intrare și cele combinate STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Semnal combinat (electric){}Semnalul combinat se comportă atât ca semnal de intrare, cât și de ieșire. Acest lucru permite construcția „arborilor” mari de presemnalizare STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Semnal de cale (electric){}Un semnal de cale va permite trecerea în acelaşi timp în blocurile de semnale a mai multor trenuri, dacă trenurile pot găsi o cale până la un punct sigur pentru oprire. Semnalele standard de cale permit trecerea din ambele sensuri @@ -2640,8 +2663,8 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Construi STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Construieşte şină de tramvai. Ctrl comută construirea/eliminarea şinei. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Construieşte secţiune de şosea folosind modul Auto-şosea. Ctrl comută construirea/eliminarea şoselei. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Construieşte secţiune de şină de tramvai folosind modul Auto-tramvai. Ctrl comută construirea/eliminarea şinei. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Construieşte o autobază (pentru achiziţie şi service vehicule). Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Construieşte depou tramvaie (pentru achiziţie şi service vehicule). Shift comută între construire/afişare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Construiește o autobază (pentru achiziție și service vehicule). Shift comută între construire/afișare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Construiește depou tramvaie (pentru achiziție și service vehicule). Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Construieşte staţie de autobuz. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construieşte staţie de tramvai pentru călători. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construieşte platformă pentru camioane. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat @@ -2809,6 +2832,7 @@ STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}Prospect STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Construieşte STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}Finanţează STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}Elimină toate industriile +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_TOOLTIP :{BLACK}Elimină toate industriile prezente acum pe hartă STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :{YELLOW}Sigur vrei să elimini toate industriile? # Industry cargoes window @@ -2852,6 +2876,7 @@ STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Încărcături acceptate: {LTBLUE} STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING}) STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Tip șină: {LTBLUE}{STRING} +STR_LANG_AREA_INFORMATION_ROAD_TYPE :{BLACK}Tip de drum: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_TRAM_TYPE :{BLACK}Tip de tramvai: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Limită viteză pe calea ferată: {LTBLUE}{VELOCITY} STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Viteza limită a drumului: {LTBLUE}{VELOCITY} @@ -2961,11 +2986,13 @@ STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Viteza s STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Număr de evenimente de joc simulate per secundă. STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Numărul de cadre video randate per secundă. STR_FRAMERATE_SPEED_FACTOR :{BLACK}Factorul actual de viteză a jocului: {DECIMAL}x +STR_FRAMERATE_CURRENT :{WHITE}Curent STR_FRAMERATE_AVERAGE :{WHITE}Medie STR_FRAMERATE_MEMORYUSE :{WHITE}Memorie STR_FRAMERATE_DATA_POINTS :{BLACK}Date bazate pe măsurători {COMMA} STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL} ms +STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} cadre/s STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} cadre/s STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} cadre/s @@ -2977,6 +3004,7 @@ STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Decala STR_FRAMERATE_DRAWING :{BLACK}Randare grafică: STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Vizoare globale: STR_FRAMERATE_VIDEO :{BLACK}Ieșire video: +STR_FRAMERATE_ALLSCRIPTS :{BLACK} Total GS/AI: STR_FRAMERATE_GAMESCRIPT :{BLACK} Script joc: STR_FRAMERATE_AI :{BLACK} IA {NUM} {STRING} @@ -2989,6 +3017,7 @@ STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Randarea vizoru STR_FRAMETIME_CAPTION_VIDEO :Ieșire video STR_FRAMETIME_CAPTION_SOUND :Mixaj de sunet STR_FRAMETIME_CAPTION_ALLSCRIPTS :Totalul de scripturi GS/AI +STR_FRAMETIME_CAPTION_GAMESCRIPT :Script joc STR_FRAMETIME_CAPTION_AI :IA {NUM} {STRING} @@ -3031,6 +3060,8 @@ STR_MAPGEN_DATE :{BLACK}Data: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Nr. de industrii: STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Cel mai înalt vârf: STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}Mărește acoperirea cu zăpadă cu zece procente +STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}Reduce acoperirea cu zăpadă cu zece procente +STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_DESERT_COVERAGE :{BLACK}Acoperire cu deșert: STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}Mărește întinderea deșertului cu zece procente STR_MAPGEN_DESERT_COVERAGE_DOWN :{BLACK}Reduce întinderea deșertului cu zece procente @@ -3433,6 +3464,7 @@ STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPAN STR_STATION_VIEW_RATINGS_BUTTON :{BLACK}Evaluări STR_STATION_VIEW_RATINGS_TOOLTIP :{BLACK}Afişează evaluările staţiei +STR_STATION_VIEW_SUPPLY_RATINGS_TITLE :{BLACK}Aprovizionare lunară și evaluare locală: STR_STATION_VIEW_CARGO_SUPPLY_RATING :{WHITE}{STRING}: {YELLOW}{COMMA} / {STRING} ({COMMA}%) STR_STATION_VIEW_GROUP :{BLACK}Grupează după @@ -3580,6 +3612,7 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_CAPTION :{WHITE}Infrastr STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT :{GOLD}Pătrățele de cale ferată: STR_COMPANY_INFRASTRUCTURE_VIEW_SIGNALS :{WHITE}Semnale STR_COMPANY_INFRASTRUCTURE_VIEW_ROAD_SECT :{GOLD}Pătrățele cu drumuri: +STR_COMPANY_INFRASTRUCTURE_VIEW_TRAM_SECT :{GOLD}Secțiuni de tramvai: STR_COMPANY_INFRASTRUCTURE_VIEW_WATER_SECT :{GOLD}Suprafață apă: STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS :{WHITE}Canale STR_COMPANY_INFRASTRUCTURE_VIEW_STATION_SECT :{GOLD}Stații: @@ -3789,7 +3822,7 @@ STR_BUY_VEHICLE_AIRCRAFT_SHOW_TOGGLE_BUTTON :{BLACK}Afișeaz ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comută ascunderea/afișarea tipului de tren -STR_BUY_VEHICLE_ROAD_VEHICLE_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutator pentru afişarea tipului de autovehicul +STR_BUY_VEHICLE_ROAD_VEHICLE_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comută ascunderea/afișarea tipului de autovehicul STR_BUY_VEHICLE_SHIP_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutator pentru afişarea tipului de navă STR_BUY_VEHICLE_AIRCRAFT_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutator pentru afişarea tipului de aeronavă @@ -3878,8 +3911,8 @@ STR_DEPOT_MASS_STOP_HANGAR_TOOLTIP :{BLACK}Click pt ###length VEHICLE_TYPES STR_DEPOT_MASS_START_DEPOT_TRAIN_TOOLTIP :{BLACK}Clic pentru pornirea tuturor trenurilor din depou -STR_DEPOT_MASS_START_DEPOT_ROAD_VEHICLE_TOOLTIP :{BLACK}Click pt pornirea tuturor autovehiculelor din depou -STR_DEPOT_MASS_START_DEPOT_SHIP_TOOLTIP :{BLACK}Click pt pornirea tuturor vaselor din depou +STR_DEPOT_MASS_START_DEPOT_ROAD_VEHICLE_TOOLTIP :{BLACK}Clic pentru pornirea tuturor autovehiculelor din depou +STR_DEPOT_MASS_START_DEPOT_SHIP_TOOLTIP :{BLACK}Clic pentru pornirea tuturor vaselor din depou STR_DEPOT_MASS_START_HANGAR_TOOLTIP :{BLACK}Click pt pornirea tuturor aeronavelor din hangar STR_DEPOT_DRAG_WHOLE_TRAIN_TO_SELL_TOOLTIP :{BLACK}Trage locomotiva aici pentru a vinde întregul tren @@ -4001,6 +4034,7 @@ STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Afişeaz ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}Acțiunea trenului curent - clic pentru oprirea/pornirea trenului STR_VEHICLE_VIEW_ROAD_VEHICLE_STATUS_START_STOP_TOOLTIP :{BLACK}Acțiunea vehiculului curent - clic pentru oprirea/pornirea vehiculului +STR_VEHICLE_VIEW_SHIP_STATE_STATUS_STOP_TOOLTIP :{BLACK}Acțiunea navei curente - clic pentru oprirea/pornirea navei STR_VEHICLE_VIEW_AIRCRAFT_STATUS_START_STOP_TOOLTIP :{BLACK}Acțiunea avionului curent - clic pentru oprirea/pornirea avionului # Messages in the start stop button in the vehicle view @@ -4214,7 +4248,7 @@ STR_ORDER_GO_TO_NEAREST_DEPOT :Du-te la cel ma STR_ORDER_GO_TO_NEAREST_HANGAR :Du-te la cel mai apropiat hangar STR_ORDER_CONDITIONAL :Salt în ordine condiţionată STR_ORDER_SHARE :Sincronizează ordinele -STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Adaugă o comandă înaintea celei selectate, sau la sfârşitul listei. Ctrl-Click transformă comenzile pentru staţii în 'încarcă orice tip de marfă', pentru punctele de tranzit în 'non-stop' şi pentru depouri în 'service'. 'Sincronizarea ordinelor' sau Ctrl permite acestui vehicul să îşi partajeze ordinele cu vehiculul selectat. Click pe un vehicul pentru a copia ordinele de la el. Un ordin de depou anulează service-ul automat pentru vehicul +STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Adaugă o comandă înaintea celei selectate sau la sfârșitul listei. Ctrl-clic transformă comenzile pentru stații în „încarcă orice tip de marfă”, pentru punctele de tranzit în „non-stop” și pentru depouri în „service”. „Sincronizarea comenzilor” sau Ctrl permite acestui vehicul să își partajeze comenzile cu vehiculul selectat. Click pe un vehicul pentru a copia ordinele de la el. O comandă de depou anulează service-ul automat pentru vehicul STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP :{BLACK}Arata toate vehiculele care se incadreaza in acest program @@ -4779,6 +4813,7 @@ STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Nu pot c STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Nu pot şterge grup... STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Nu pot redenumi grup... STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Nu pot seta grupul predecesor... +STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION :{WHITE}... nu sunt permise buclele în ierarhia de grup STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Nu pot elimina toate vehiculele din acest grup... STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Nu pot adauga vehiculul in acest grup... STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Nu pot adauga vehicule partajate in grup... From 41094b6a4a685550a1ae024a906bb5a4bca7bd59 Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 30 Sep 2021 18:48:12 +0000 Subject: [PATCH 011/710] Update: Translations from eints spanish: 14 changes by MontyMontana --- src/lang/spanish.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 1161f2650d..00bdddfede 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -32,7 +32,7 @@ STR_CARGO_PLURAL_MAIL :{G=m}Correo STR_CARGO_PLURAL_OIL :{G=m}Petróleo STR_CARGO_PLURAL_LIVESTOCK :{G=m}Ganado STR_CARGO_PLURAL_GOODS :{G=f}Mercancías -STR_CARGO_PLURAL_GRAIN :{G=m}Grano +STR_CARGO_PLURAL_GRAIN :{G=m}Cereal STR_CARGO_PLURAL_WOOD :{G=f}Madera STR_CARGO_PLURAL_IRON_ORE :{G=m}Mineral de Hierro STR_CARGO_PLURAL_STEEL :{G=m}Acero @@ -66,7 +66,7 @@ STR_CARGO_SINGULAR_MAIL :{G=m}Correo STR_CARGO_SINGULAR_OIL :{G=m}Petróleo STR_CARGO_SINGULAR_LIVESTOCK :{G=m}Ganado STR_CARGO_SINGULAR_GOODS :{G=f}Mercancía -STR_CARGO_SINGULAR_GRAIN :{G=m}Grano +STR_CARGO_SINGULAR_GRAIN :{G=m}Cereal STR_CARGO_SINGULAR_WOOD :{G=f}Madera STR_CARGO_SINGULAR_IRON_ORE :{G=m}Mineral de Hierro STR_CARGO_SINGULAR_STEEL :{G=m}Acero @@ -100,7 +100,7 @@ STR_QUANTITY_MAIL :{COMMA}{NBSP}bo STR_QUANTITY_OIL :{VOLUME_LONG} de petróleo STR_QUANTITY_LIVESTOCK :{COMMA}{NBSP}cabeza{P "" s} de ganado STR_QUANTITY_GOODS :{COMMA}{NBSP}caja{P "" s} de mercancías -STR_QUANTITY_GRAIN :{WEIGHT_LONG} de grano +STR_QUANTITY_GRAIN :{WEIGHT_LONG} de cereal STR_QUANTITY_WOOD :{WEIGHT_LONG} de madera STR_QUANTITY_IRON_ORE :{WEIGHT_LONG} de mineral de hierro STR_QUANTITY_STEEL :{WEIGHT_LONG} de acero @@ -5193,9 +5193,9 @@ STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COAL_CAR :Vagón de Carb STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_OIL_TANKER :Cisterna de Petróleo STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_LIVESTOCK_VAN :Vagón de Ganado STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_GOODS_VAN :Vagón de Mercancías -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_GRAIN_HOPPER :Vagoneta de Grano +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_GRAIN_HOPPER :Tolva de Cereal STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_WOOD_TRUCK :Vagón de Madera -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_IRON_ORE_HOPPER :Vagoneta de Mineral de Hierro +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_IRON_ORE_HOPPER :Tolva de Mineral de Hierro STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_STEEL_TRUCK :Vagón de Acero STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_ARMORED_VAN :Vagón Blindado STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_FOOD_VAN :Vagón de Alimentos @@ -5206,7 +5206,7 @@ STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_FRUIT_TRUCK :Vagón de Fruta STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_RUBBER_TRUCK :Vagón de Caucho STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_SUGAR_TRUCK :Vagón de Azúcar STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COTTON_CANDY_HOPPER :Vagón tolva de Algodón de Azúcar -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_TOFFEE_HOPPER :Vagoneta de Tofe +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_TOFFEE_HOPPER :Tolva de Tofe STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_BUBBLE_VAN :Vagón de Burbujas STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COLA_TANKER :Cisterna de Cola STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_CANDY_VAN :Vagón de Caramelos @@ -5223,9 +5223,9 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COAL_CAR :Vagón de Carb STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_OIL_TANKER :Cisterna de Petróleo STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_LIVESTOCK_VAN :Vagón de Ganado STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_GOODS_VAN :Vagón de Mercancías -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_GRAIN_HOPPER :Vagoneta de Grano +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_GRAIN_HOPPER :Tolva de Cereal STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_WOOD_TRUCK :Vagón de Madera -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_IRON_ORE_HOPPER :Vagoneta de Mineral de Hierro +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_IRON_ORE_HOPPER :Tolva de Mineral de Hierro STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_STEEL_TRUCK :Vagón de Acero STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_ARMORED_VAN :Vagón Blindado STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_FOOD_VAN :Vagón de Alimentos @@ -5236,7 +5236,7 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_FRUIT_TRUCK :Vagón de Fruta STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_RUBBER_TRUCK :Vagón de Caucho STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_SUGAR_TRUCK :Vagón de Azúcar STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COTTON_CANDY_HOPPER :Vagón tolva de Algodón de Azúcar -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_TOFFEE_HOPPER :Vagoneta de Tofe +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_TOFFEE_HOPPER :Tolva de Tofe STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_BUBBLE_VAN :Vagón de Burbujas STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COLA_TANKER :Cisterna de Cola STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_CANDY_VAN :Vagón de Caramelos @@ -5255,9 +5255,9 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COAL_CAR :Vagón de Carb STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_OIL_TANKER :Cisterna de Petróleo STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_LIVESTOCK_VAN :Vagón de Ganado STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_GOODS_VAN :Vagón de Mercancías -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_GRAIN_HOPPER :Vagoneta de Grano +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_GRAIN_HOPPER :Tolva de Cereal STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_WOOD_TRUCK :Vagón de Madera -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_IRON_ORE_HOPPER :Vagoneta de Mineral de Hierro +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_IRON_ORE_HOPPER :Tolva de Mineral de Hierro STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_STEEL_TRUCK :Vagón de Acero STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_ARMORED_VAN :Vagón Blindado STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_FOOD_VAN :Vagón de Alimentos @@ -5303,9 +5303,9 @@ STR_VEHICLE_NAME_ROAD_VEHICLE_FOSTER_LIVESTOCK_VAN :Camión de Gana STR_VEHICLE_NAME_ROAD_VEHICLE_BALOGH_GOODS_TRUCK :Camión de Mercancías Balogh STR_VEHICLE_NAME_ROAD_VEHICLE_CRAIGHEAD_GOODS_TRUCK :Camión de Mercancías Craighead STR_VEHICLE_NAME_ROAD_VEHICLE_GOSS_GOODS_TRUCK :Camión de Mercancías Goss -STR_VEHICLE_NAME_ROAD_VEHICLE_HEREFORD_GRAIN_TRUCK :Camión de Grano Hereford -STR_VEHICLE_NAME_ROAD_VEHICLE_THOMAS_GRAIN_TRUCK :Camión de Grano Thomas -STR_VEHICLE_NAME_ROAD_VEHICLE_GOSS_GRAIN_TRUCK :Camión de Grano Goss +STR_VEHICLE_NAME_ROAD_VEHICLE_HEREFORD_GRAIN_TRUCK :Camión de Cereal Hereford +STR_VEHICLE_NAME_ROAD_VEHICLE_THOMAS_GRAIN_TRUCK :Camión de Cereal Thomas +STR_VEHICLE_NAME_ROAD_VEHICLE_GOSS_GRAIN_TRUCK :Camión de Cereal Goss STR_VEHICLE_NAME_ROAD_VEHICLE_WITCOMBE_WOOD_TRUCK :Camión Maderero Witcombe STR_VEHICLE_NAME_ROAD_VEHICLE_FOSTER_WOOD_TRUCK :Camión Maderero Foster STR_VEHICLE_NAME_ROAD_VEHICLE_MORELAND_WOOD_TRUCK :Camión Maderero Moreland From 78d66b77325ee7f6af0627ce88ca2e83a8048241 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 1 Oct 2021 18:45:29 +0000 Subject: [PATCH 012/710] Update: Translations from eints romanian: 145 changes by kneekoo --- src/lang/romanian.txt | 235 ++++++++++++++++++++++++++---------------- 1 file changed, 145 insertions(+), 90 deletions(-) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index e88ece8e00..786d4251d0 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -124,7 +124,7 @@ STR_QUANTITY_TOFFEE :{WEIGHT_LONG} d STR_QUANTITY_BATTERIES :{COMMA} {P baterie baterii "de baterii"} STR_QUANTITY_PLASTIC :{VOLUME_LONG} de plastic STR_QUANTITY_FIZZY_DRINKS :{COMMA} {P bidon bidoane "de bidoane"} cu suc -STR_QUANTITY_N_A :N/A +STR_QUANTITY_N_A :indisponibilă # Two letter abbreviation of cargo name STR_ABBREV_NOTHING : @@ -317,14 +317,17 @@ STR_SORT_BY_POPULATION :Populaţia STR_SORT_BY_RATING :Cotaţie STR_SORT_BY_NUM_VEHICLES :Număr de vehicule STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Profit total în anul trecut +STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Profit total în acest an STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Profit mediu în anul trecut STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Profit mediu în acest an # Group by options for vehicle list +STR_GROUP_BY_NONE :Niciunul STR_GROUP_BY_SHARED_ORDERS :Comenzi comune # Order button in shared orders vehicle list STR_GOTO_ORDER_VIEW :{BLACK}Comenzi +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Deschide lista comenzilor # Tooltips for the main toolbar ###length 31 @@ -864,11 +867,11 @@ STR_NEWS_AIRCRAFT_IS_WAITING :{WHITE}{VEHICLE ###next-name-looks-similar # Order review system / warnings -STR_NEWS_VEHICLE_HAS_TOO_FEW_ORDERS :{WHITE}{VEHICLE} are prea puţine ordine în program +STR_NEWS_VEHICLE_HAS_TOO_FEW_ORDERS :{WHITE}{VEHICLE} are prea puține comenzi în program STR_NEWS_VEHICLE_HAS_VOID_ORDER :{WHITE}{VEHICLE} nu are nici un ordin -STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}{VEHICLE} are ordine duplicate -STR_NEWS_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE} are o staţie invalidă în ordine -STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} are în ordinele sale un aeroport a cărui pistă este prea scurtă +STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}{VEHICLE} are comenzi duplicat +STR_NEWS_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE} are o stație nevalidă în comenzi +STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} are în comenzile sale un aeroport a cărui pistă este prea scurtă STR_NEWS_VEHICLE_IS_GETTING_OLD :{WHITE}{VEHICLE} este vechi STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD :{WHITE}{VEHICLE} este foarte vechi @@ -1230,6 +1233,7 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Controlează c STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Multiplicator al subvențiilor: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Alege cât de mult se plătește pentru conexiuni subvenționate +STR_CONFIG_SETTING_SUBSIDY_DURATION :Durată subvenție: {STRING} STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Stabilește numărul de ani pentru care se acordă o subvenție STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} {P an ani "de ani"} @@ -1330,10 +1334,10 @@ STR_CONFIG_SETTING_SIGNALSIDE_RIGHT :Pe partea dreap STR_CONFIG_SETTING_SHOWFINANCES :Afişează finanţele la sfârşitul fiecărui an: {STRING} STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Dacă este activat, fereastra de finanţe apare automat la sfârşitul fiecărui an pentru a permite inspectarea facilă a stării financiale a companiei -STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Ordinele noi sunt implicit 'fără oprire': {STRING} +STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Comenzile noi sunt implicit „fără oprire”: {STRING} STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :În mod normal, un vehicul va opri în fiecare stație prin care trece. Prin activarea acestei setări, va trece fără oprire prin toate stațiile în drumul către destinația finală. Notă: această setare are efect doar asupra valorii implicite pentru comenzile noi. Comenzile individuale pot fi configurate explicit cu oricare din variante -STR_CONFIG_SETTING_STOP_LOCATION :Ordinele noi pentru trenuri opresc implicit la {STRING} platformei +STR_CONFIG_SETTING_STOP_LOCATION :La comenzile noi ale trenurilor, oprirea implicită la platformă se face la {STRING} STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Locul în care oprește trenul pe platformă. La „capătul apropiat” înseamnă că trenul va opri aproape de locul de intrare, „mijloc” înseamnă mijlocul platformei, iar „capătul îndepărtat” înseamnă departe de punctul de intrare. Notă: această setare are efect doar pentru comenzile noi. Comenzile individuale pot fi configurate explicit cu oricare din variante ###length 3 STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :capătul apropiat al @@ -1387,7 +1391,7 @@ STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mentenanță in STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Cand este activă, infrastructura necesita cheltuieli cu intreținerea. Costurile cresc proporțional cu rețeaua de transport, afectând companiile mari mai mult decât companiile mici STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Culoarea de început a companiei: {STRING} -STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Alegeți culoarea de început pentru companie +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Alege culoarea de început pentru companie STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroporturile nu expiră niciodată: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activarea acestei opțiuni determina ca fiecare tip de aeroport sa fie disponibil permanent, după ce a fost introdus. @@ -1395,8 +1399,8 @@ STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activarea acest STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Avertisment dacă vehiculul s-a pierdut: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Afișează mesaje despre vehiculele care nu pot găsi o cale către destinația curentă -STR_CONFIG_SETTING_ORDER_REVIEW :Verificarea ordinelor vehiculelor: {STRING} -STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Dacaă este activată, ordinele vehiculelor sunt verificate periodic, iar unele probleme evidente sunt raportate printr-o notificare +STR_CONFIG_SETTING_ORDER_REVIEW :Verifică comenzile vehiculelor: {STRING} +STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Dacă este activată, comenzile vehiculelor sunt verificate periodic, iar unele probleme evidente sunt raportate printr-o notificare ###length 3 STR_CONFIG_SETTING_ORDER_REVIEW_OFF :nu STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :da, dar exclude vehiculele oprite @@ -1559,9 +1563,11 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Click dublu STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Un singur click (când este în focus) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Un singur click (instant) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Folosește serviciul releu: {STRING} STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Dacă nu se poate crea conexiunea la server, poți folosi un serviciu de redirecționare pentru crearea conexiunii. „Niciodată” interzice asta, „întreabă” va întreba mai întâi, iar „permite” va accepta fără confirmare ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Niciodată +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Întreabă STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Permite STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Emulare click-dreapta: {STRING} @@ -1811,7 +1817,9 @@ STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Doar avansat STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Toate vizibile STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Arată tipurile de semnal: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Alege ce tipuri de semnal sunt afișate în bara semnalelor ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Doar semnale de cale STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Toate semnalele STR_CONFIG_SETTING_TOWN_LAYOUT :Modelul drumurilor pentru oraşele noi: {STRING} @@ -2028,6 +2036,7 @@ STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}Fără m STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}Nu s-au putut rezerva {BYTES} pentru cache al sprite-urilor. Mărimea cache-ului a fost redusă la {BYTES}. Performanța OpenTTD va fi redusă. Pentru a micșora cerințele jocului cu privire la memorie, poți încerca să dezactivezi modul grafic 32bpp și/sau reducerea numărului de nivele zoom # Video initalization errors +STR_VIDEO_DRIVER_ERROR :{WHITE}Eroare în setările video... STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... GPU incompatibil. Accelerarea hardware este dezactivată # Intro window @@ -2088,7 +2097,7 @@ STR_CHEATS_TOOLTIP :{BLACK}Bifa vă STR_CHEATS_NOTE :{BLACK}Notă: utilizarea acestor setări va fi memorată în salvarea jocului STR_CHEAT_MONEY :{LTBLUE}Măreşte fondurile cu {CURRENCY_LONG} STR_CHEAT_CHANGE_COMPANY :{LTBLUE}Joacă drept compania: {ORANGE}{COMMA} -STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Buldozer magic (demolează industrii şi lucruri amovibile): {ORANGE}{STRING} +STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Buldozer magic (demolează industrii și lucruri amovibile): {ORANGE}{STRING} STR_CHEAT_CROSSINGTUNNELS :{LTBLUE}Tunelele se pot intersecta: {ORANGE}{STRING} STR_CHEAT_NO_JETCRASH :{LTBLUE}Avioanele cu reacţie nu se vor prăbuşi (frecvent) pe aeroporturile mici: {ORANGE}{STRING} STR_CHEAT_EDIT_MAX_HL :{LTBLUE}Schimbă înălțimea maximă a hărții: {ORANGE}{NUM} @@ -2235,10 +2244,12 @@ STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versiun STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Adresa serverului: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data de început: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data curentă: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script Joc: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Protejat cu parolă! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVER OFFLINE STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVER PLIN STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}SERVERUL ȚI-A INTERZIS ACCESUL +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVER PREA VECHI STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIUNE DIFERITĂ STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEPOTRIVIRE NEWGRF @@ -2301,15 +2312,19 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Companie # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Jucători conectați +STR_NETWORK_COMPANY_LIST_SPECTATE :Intră ca spectator # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Jucători conectați STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Server STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Nume +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Numele serverului pe care joci STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Modifică numele serverului tău +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Numele serverului STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Vizibilitate STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Dacă alți oameni îți pot vedea serverul în lista publică STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Cod de invitație +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Tipul conexiunii STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Dacă și cum poate fi găsit serverul tău de alții STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Jucător STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Nume @@ -2317,9 +2332,11 @@ STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}Numele t STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Modifică-ți numele STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Numele tău în joc STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Acțiuni administrative de efectuat pentru acest client +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Acțiuni administrative de efectuat pentru această companie STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Intră în această companie STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Trimite un mesaj tuturor jucătorilor acestei companii STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Trimite un mesaj tuturor spectatorilor +STR_NETWORK_CLIENT_LIST_SPECTATORS :Spectatori STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Companie nouă) STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Creează o nouă companie și intră în ea STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Aici ești tu @@ -2327,19 +2344,27 @@ STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Local STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Jucătorii de la distanță nu se pot conecta STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Public +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}În spatele NAT +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Prin releu +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Dă afară STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Blochează +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Șterge STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Deblocare cu parolă +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Acțiune administrativă STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Sigur vrei să dai afară jucătorul '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Sigur vrei să blochezi jucătorul '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Sigur dorești ștergerea companiei '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Sigur vrei să resetezi parola companiei '{COMPANY}'? STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Folosești releul? STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Conexiunea la server nu s-a putut realiza '{STRING}'.{}Doriți să redirecționați această sesiune prin '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Nu +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Da, de data asta STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Da, nu mă mai întreba STR_NETWORK_SPECTATORS :Spectatori @@ -2381,12 +2406,14 @@ STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Conexiun STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Nu am reuşit să încarc jocul salvat STR_NETWORK_ERROR_SERVER_START :{WHITE}Serverul nu a putut fi pornit STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Eroare de protocol. Conexiunea a fost închisă -STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Nu ți-ai setat numele în joc. Numele se poate seta din partea de sus a ferestrei Multiplayer +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Nu ți-ai setat numele în joc. Numele se setează din partea de sus a ferestrei Multiplayer +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Nu ai setat numele serverului. Numele se setează din partea de sus a ferestrei Multiplayer STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Versiunea acestui client este diferită de cea a serverului STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Parolă greşită STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Serverul este plin STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Accesul tău este interzis pe acest server STR_NETWORK_ERROR_KICKED :{WHITE}Ai fost dat afară din joc +STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}Motiv: {STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}Cheat-urile nu sunt permise pe acest server STR_NETWORK_ERROR_TOO_MANY_COMMANDS :{WHITE}Trimiteai prea multe comenzi către server STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}A expirat timpul pentru introducerea unei parole @@ -2419,6 +2446,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :a expirat timpu STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :a expirat timpul alocat STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :a expirat timpul alocat descărcării hărţii STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :a expirat timpul alocat procesării hărţii +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :numele clientului nu este valid # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2450,7 +2478,10 @@ STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Serverul STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Serverul este repornit...{}Vă rugăm aşteptaţi... STR_NETWORK_MESSAGE_KICKED :*** {STRING} a fost dat afară. Motiv: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Înregistrarea serverului a eșuat +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Alt server cu același cod de invitație este deja înregistrat. Comut pe tipul de joc „local”. STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Serverul tău nu permite conexiuni la distanță +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Alți jucători nu se vor putea conecta la serverul tău # Content downloading window STR_CONTENT_TITLE :{WHITE}Descărcare resurse online @@ -2517,7 +2548,7 @@ STR_CONTENT_DOWNLOAD_COMPLETE :{WHITE}Descărc STR_CONTENT_DOWNLOAD_PROGRESS_SIZE :{WHITE}{BYTES} din {BYTES} descărcaţi ({NUM}%) # Content downloading error messages -STR_CONTENT_ERROR_COULD_NOT_CONNECT :{WHITE}Conectare la server eşuată... +STR_CONTENT_ERROR_COULD_NOT_CONNECT :{WHITE}Conectarea la serverul de conținut a eșuat... STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD :{WHITE}Descărcare eșuată STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE :{WHITE}... fişierul nu poate fi scris STR_CONTENT_ERROR_COULD_NOT_EXTRACT :{WHITE}Fişierul descărcat nu a putut fi decompresat @@ -2563,7 +2594,7 @@ STR_STATION_BUILD_COVERAGE_ON :{BLACK}Activ STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP :{BLACK}Nu arăta aria de acoperire a locaţiei propuse STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP :{BLACK}Arată aria de acoperire a locaţiei propuse STR_STATION_BUILD_ACCEPTS_CARGO :{BLACK}Acceptă: {GOLD}{CARGO_LIST} -STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Resurse: {GOLD}{CARGO_LIST} +STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Furnizează: {GOLD}{CARGO_LIST} # Join station window STR_JOIN_STATION_CAPTION :{WHITE}Uneşte staţia @@ -2573,6 +2604,7 @@ STR_JOIN_WAYPOINT_CAPTION :{WHITE}Uneşte STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT :{YELLOW}Construieşte un punct de tranzit separat # Generic toolbar +STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE :{BLACK}Dezactivat, deoarece momentan nu sunt vehicule disponibile pentru acest tip de infrastructură # Rail construction toolbar STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION :Construcţie cale ferată @@ -2581,10 +2613,10 @@ STR_RAIL_TOOLBAR_MONORAIL_CONSTRUCTION_CAPTION :Construcţie mo STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Construcţie pernă magnetică STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Construieşte cale ferată. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afişare cost estimat -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Construieşte cale ferată în modul automat. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afişare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Construiește cale ferată în modul automat. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Construiește un depou feroviar (pentru achiziție și service de trenuri). Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Converteşte linia în punct de tranzit. Ctrl permite alipirea punctelor de tranzit distante. Shift comută între convertire/afişare cost estimat -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Construieşte gară. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Construiește gară. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Plasează semnale feroviare. Ctrl comută între semafoare/semnale electrice{}Trage cu mausul pentru a construi automat semnale pe o porțiune de șină dreaptă. Apasă Ctrl pentru a construi semnale până la următoarea joncțiune{}Ctrl+Clic comută deschiderea ferestrei de selecție a tipului de semnal. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Construieşte pod de cale ferată. Shift comută între construire/afişare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Construieşte tunel feroviar. Shift comută între construire/afişare cost estimat @@ -2629,13 +2661,13 @@ STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Semnal d STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP :{BLACK}Semnal combinat (semafor){}Semnalul combinat se comportă atât ca semnal de intrare, cât și de ieșire. Acest lucru permite construcția „arborilor” mari de presemnalizare STR_BUILD_SIGNAL_SEMAPHORE_PBS_TOOLTIP :{BLACK}Semnal de cale (semafor){}Un semnal de cale va permite trecerea în acelaşi timp în blocurile de semnale a mai multor trenuri, dacă trenurile pot găsi o cale până la un punct sigur pentru oprire. Semnalele standard de cale permit trecerea din ambele sensuri STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TOOLTIP :{BLACK}Semnal de cale cu sens unic (semafor){}Un semnal de cale permite trecerea simultană a mai multor trenuri prin blocurile de semnale, dacă trenul poate rezerva o cale până la un punct sigur de oprire. Semnalele de cale cu sens unic permit trecerea intr-un singur sens -STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP :{BLACK}Semnal standard (electric){}Acesta este cel mai simplu tip de semnal, permiţând numai unui tren să fie în acelaşi bloc, la un moment dat +STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP :{BLACK}Semnal standard (electric){}Acesta este cel mai simplu tip de semnal, permițând numai unui tren să fie în același bloc, la un moment dat STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}Semnal de intrare (electric){}Verde, atât timp cât există unul sau mai multe semnale verzi de ieșire în secțiunea următoare a căii ferate. Altfel indică roșu STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Semnal de ieșire (electric){}Se comportă în același fel ca semnalul normal, dar este necesar pentru declanșarea culorii corecte la presemnalizatoarele de intrare și cele combinate STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Semnal combinat (electric){}Semnalul combinat se comportă atât ca semnal de intrare, cât și de ieșire. Acest lucru permite construcția „arborilor” mari de presemnalizare STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Semnal de cale (electric){}Un semnal de cale va permite trecerea în acelaşi timp în blocurile de semnale a mai multor trenuri, dacă trenurile pot găsi o cale până la un punct sigur pentru oprire. Semnalele standard de cale permit trecerea din ambele sensuri STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Semnal de cale cu sens unic (electric){}Un semnal de cale permite trecerea simultană a mai multor trenuri prin blocurile de semnale, dacă trenul poate rezerva o cale până la un punct sigur de oprire. Semnalele de cale cu sens unic permit trecerea intr-un singur sens -STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Conversie semnal{}Când este selectat, click-ul pe un semafor existent îl va converti în tipul şi varianta selectată de semnalizare. Ctrl+Click va comuta varianta existentă. Shift+Click afişează costul estimat al conversiei +STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Conversie semnal{}Când este selectat, clicul pe un semafor existent îl va converti în tipul și varianta selectată de semnalizare. Ctrl+clic va comuta varianta existentă. Shift+clic afișează costul estimat al conversiei STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Densitatea semnalelor plasate prin tragerea cu mouse-ul STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Redu distanța semnalelor plasate prin tragerea cu mouse-ul STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Creşte densitatea semnalelor plasate prin tragerea cu mouse-ul @@ -2660,15 +2692,15 @@ STR_BRIDGE_TUBULAR_SILICON :Tubular, Silico STR_ROAD_TOOLBAR_ROAD_CONSTRUCTION_CAPTION :{WHITE}Construcţii rutiere STR_ROAD_TOOLBAR_TRAM_CONSTRUCTION_CAPTION :{WHITE}Construcţie tramvai STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Construieşte secţiune de şosea. Ctrl comută construirea/eliminarea şoselei. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Construieşte şină de tramvai. Ctrl comută construirea/eliminarea şinei. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Construieşte secţiune de şosea folosind modul Auto-şosea. Ctrl comută construirea/eliminarea şoselei. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Construieşte secţiune de şină de tramvai folosind modul Auto-tramvai. Ctrl comută construirea/eliminarea şinei. Shift comută între construire/afişare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Construiește șină de tramvai. Ctrl comută construirea/eliminarea șinei. Shift comută între construire/afișare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Construiește secțiune de șosea folosind modul Auto-șosea. Ctrl comută construirea/eliminarea șoselei. Shift comută între construire/afișare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Construiește secțiune de șină de tramvai folosind modul Auto-tramvai. Ctrl comută construirea/eliminarea șinei. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Construiește o autobază (pentru achiziție și service vehicule). Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Construiește depou tramvaie (pentru achiziție și service vehicule). Shift comută între construire/afișare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Construieşte staţie de autobuz. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construieşte staţie de tramvai pentru călători. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construieşte platformă pentru camioane. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Construieşte staţie pentru tramvai de marfă. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Construiește staţie de autobuz. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construiește stație de tramvai pentru călători. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construiește platformă pentru camioane. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Construiește stație pentru tramvai de marfă. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Activare/Dezactivare sensuri unice STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Construieşte pod rutier. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_BRIDGE :{BLACK}Construieşte pod pentru tramvaie. Shift comută între construire/afişare cost estimat @@ -2703,7 +2735,7 @@ STR_WATERWAYS_TOOLBAR_CAPTION :{WHITE}Construc STR_WATERWAYS_TOOLBAR_CAPTION_SE :{WHITE}Rute acvatice STR_WATERWAYS_TOOLBAR_BUILD_CANALS_TOOLTIP :{BLACK}Construieşte canale. Shift comută între construire/afişare cost estimat STR_WATERWAYS_TOOLBAR_BUILD_LOCKS_TOOLTIP :{BLACK}Construieşte ecluză. Shift comută între construire/afişare cost estimat -STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP :{BLACK}Construieşte şantier naval (pentru achiziţionare şi service nave). Shift comută între construire/afişare cost estimat +STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP :{BLACK}Construiește șantier naval (pentru achiziționare și service nave). Shift comută între construire/afișare cost estimat STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Construieşte port. Ctrl permite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Amplasează o baliză ce poate fi utilizată pentru direcţionare. Shift comută între amplasare/afişare cost estimat STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Construieşte apeduct. Shift comută între construire/afişare cost estimat @@ -2719,7 +2751,7 @@ STR_STATION_BUILD_DOCK_CAPTION :{WHITE}Port # Airport toolbar STR_TOOLBAR_AIRCRAFT_CAPTION :{WHITE}Aeroporturi -STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP :{BLACK}Construieşte aeroport. Ctrl pemite alipirea staţiilor distante. Shift comută între construire/afişare cost estimat +STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP :{BLACK}Construiește aeroport. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat # Airport construction window STR_STATION_BUILD_AIRPORT_CAPTION :{WHITE}Alege tipul de aeroport @@ -2771,6 +2803,7 @@ STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}Planteaz STR_TREES_MODE_NORMAL_BUTTON :{BLACK}Normal STR_TREES_MODE_NORMAL_TOOLTIP :{BLACK}Plantează copaci trăgându-i peste peisaj. STR_TREES_MODE_FOREST_SM_BUTTON :{BLACK}Dumbravă +STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}Plantează păduri mici trăgându-le peste peisaj. STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}Pădure STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Plantează păduri întinse prin tragerea peste peisaj. @@ -2833,6 +2866,7 @@ STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Construi STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}Finanţează STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}Elimină toate industriile STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_TOOLTIP :{BLACK}Elimină toate industriile prezente acum pe hartă +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_CAPTION :{WHITE}Elimină toate industriile STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :{YELLOW}Sigur vrei să elimini toate industriile? # Industry cargoes window @@ -2996,10 +3030,12 @@ STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} cadre/s STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} cadre/s STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} cadre/s +STR_FRAMERATE_BYTES_GOOD :{LTBLUE}{BYTES} STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ###length 15 +STR_FRAMERATE_GL_ECONOMY :{BLACK} Manipularea încărcăturilor: STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Decalaj grafic de conexiuni: STR_FRAMERATE_DRAWING :{BLACK}Randare grafică: STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Vizoare globale: @@ -3047,6 +3083,7 @@ STR_SAVELOAD_FILTER_TITLE :{BLACK}Filtrare STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}Suprascrie fișierul STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}Sigur vrei să suprascrii fișierul existent? STR_SAVELOAD_DIRECTORY :{STRING} (listă) +STR_SAVELOAD_PARENT_DIRECTORY :{STRING} (Director părinte) STR_SAVELOAD_OSKTITLE :{BLACK}Introduceţi un nume pentru salvare @@ -3059,6 +3096,7 @@ STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Nr. de o STR_MAPGEN_DATE :{BLACK}Data: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Nr. de industrii: STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Cel mai înalt vârf: +STR_MAPGEN_SNOW_COVERAGE :{BLACK}Acoperire cu zăpadă: STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}Mărește acoperirea cu zăpadă cu zece procente STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}Reduce acoperirea cu zăpadă cu zece procente STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% @@ -3287,11 +3325,11 @@ STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Execuți STR_NEWGRF_INVALID_CARGO : STR_NEWGRF_INVALID_CARGO_ABBREV :?? STR_NEWGRF_INVALID_CARGO_QUANTITY :{COMMA} de -STR_NEWGRF_INVALID_ENGINE : +STR_NEWGRF_INVALID_ENGINE : STR_NEWGRF_INVALID_INDUSTRYTYPE : # Placeholders for other invalid stuff, e.g. vehicles that have gone (Game Script). -STR_INVALID_VEHICLE : +STR_INVALID_VEHICLE : # NewGRF scanning window STR_NEWGRF_SCAN_CAPTION :{WHITE}Scanez resursele NewGRF @@ -3343,13 +3381,14 @@ STR_TOWN_VIEW_RENAME_TOOLTIP :{BLACK}Schimbă STR_TOWN_VIEW_EXPAND_BUTTON :{BLACK}Extinde STR_TOWN_VIEW_EXPAND_TOOLTIP :{BLACK}Măreşte dimensiunile oraşului STR_TOWN_VIEW_DELETE_BUTTON :{BLACK}Şterge -STR_TOWN_VIEW_DELETE_TOOLTIP :{BLACK}Şterge acest oraş +STR_TOWN_VIEW_DELETE_TOOLTIP :{BLACK}Șterge acest oraș STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Redenumire oraş # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}Autoritatea locală din {TOWN} STR_LOCAL_AUTHORITY_ZONE :{BLACK}Zonă +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Arată zona de acoperire a autorităților locale STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Evaluarea companiilor de transport: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Acţiuni disponibile: @@ -3381,6 +3420,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Mituie STR_GOALS_CAPTION :{WHITE}{COMPANY} Scopuri STR_GOALS_SPECTATOR_CAPTION :{WHITE}Obiective globale STR_GOALS_SPECTATOR :Obiective globale +STR_GOALS_GLOBAL_BUTTON :{BLACK}Globale STR_GOALS_GLOBAL_BUTTON_HELPTEXT :{BLACK}Afișează obiectivele globale STR_GOALS_COMPANY_BUTTON :{BLACK}Companie STR_GOALS_COMPANY_BUTTON_HELPTEXT :{BLACK}Afișează obiectivele companiei @@ -3516,8 +3556,8 @@ STR_STATION_VIEW_CLOSE_AIRPORT_TOOLTIP :{BLACK}Nu permi # Waypoint/buoy view window STR_WAYPOINT_VIEW_CAPTION :{WHITE}{WAYPOINT} STR_WAYPOINT_VIEW_CENTER_TOOLTIP :{BLACK}Centrază fereasta principală pe punctul de tranzit. Ctrl+Click deshide o fereastra cu locaţia punctului de tranzit -STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME :{BLACK}Schimba numele haltei -STR_BUOY_VIEW_CENTER_TOOLTIP :{BLACK}Centrează fereastra principală pe locaţia balizei. Ctrl+Click deshide o fereastra cu locaţia balizei +STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME :{BLACK}Schimbă numele haltei +STR_BUOY_VIEW_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația balizei. Ctrl+clic deschide un nou vizor cu locația balizei STR_BUOY_VIEW_CHANGE_BUOY_NAME :{BLACK}Schimbă numele balizei STR_EDIT_WAYPOINT_NAME :{WHITE}Editează numele haltei @@ -3595,15 +3635,16 @@ STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP :{BLACK}Schimbă STR_COMPANY_VIEW_COMPANY_NAME_BUTTON :{BLACK}Nume companie STR_COMPANY_VIEW_COMPANY_NAME_TOOLTIP :{BLACK}Schimbă numele companiei STR_COMPANY_VIEW_PRESIDENT_NAME_BUTTON :{BLACK}Nume preşedinte -STR_COMPANY_VIEW_PRESIDENT_NAME_TOOLTIP :{BLACK}Schimbă numele preşedintelui +STR_COMPANY_VIEW_PRESIDENT_NAME_TOOLTIP :{BLACK}Schimbă numele președintelui STR_COMPANY_VIEW_BUY_SHARE_BUTTON :{BLACK}Cumpără 25% din acţiunile companiei STR_COMPANY_VIEW_SELL_SHARE_BUTTON :{BLACK}Vinde 25% din acţiunile companiei -STR_COMPANY_VIEW_BUY_SHARE_TOOLTIP :{BLACK}Cumpără 25% din acţiunile acestei companii. Shift+Click arată costul estimat fără să cumpere acţiuni -STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Vinde 25% din acţiunile acestei companii. Shift+Click arată costul estimat fără să efectueze vânzarea +STR_COMPANY_VIEW_BUY_SHARE_TOOLTIP :{BLACK}Cumpără 25% din acțiunile acestei companii. Shift+clic arată costul estimat fără să cumpere acțiuni +STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Vinde 25% din acțiunile acestei companii. Shift+clic arată costul estimat fără să efectueze vânzarea STR_COMPANY_VIEW_COMPANY_NAME_QUERY_CAPTION :Noul nume al companiei STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :Noul nume al preşedintelui +STR_COMPANY_VIEW_GIVE_MONEY_QUERY_CAPTION :Introdu suma de bani pe care vrei să o dai STR_BUY_COMPANY_MESSAGE :{WHITE}Căutăm o companie de transport care să preia societatea noastră{}{}Doriţi să cumpăraţi {COMPANY} la preţul de {CURRENCY_LONG}? @@ -3707,12 +3748,12 @@ STR_GROUP_COUNT_WITH_SUBGROUP :{TINY_FONT}{COM STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Grupuri - apasă pe un grup pentru lista completă a vehiculelor acestuia STR_GROUP_CREATE_TOOLTIP :{BLACK}Apasă pentru a crea un grup -STR_GROUP_DELETE_TOOLTIP :{BLACK}Şterge grupul selectat +STR_GROUP_DELETE_TOOLTIP :{BLACK}Șterge grupul selectat STR_GROUP_RENAME_TOOLTIP :{BLACK}Redenumeşte grupul selectat STR_GROUP_LIVERY_TOOLTIP :{BLACK}Schimbă uniforma grupului selectat STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Apasă aici pentru a proteja acest grup de înlocuirile automate globale -STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Şterge Grup +STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Șterge grupul STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Sigur dorești ștergerea grupului și a descendenților lui? STR_GROUP_ADD_SHARED_VEHICLE :Adaugă vehicule partajate @@ -3728,7 +3769,7 @@ STR_GROUP_OCCUPANCY_VALUE :{NUM}% # Build vehicle window ###length 4 STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Noi vehicule feroviare -STR_BUY_VEHICLE_TRAIN_ELRAIL_CAPTION :Noi Vehicule Electrice pe Sine +STR_BUY_VEHICLE_TRAIN_ELRAIL_CAPTION :Noi vehicule electrice pe șine STR_BUY_VEHICLE_TRAIN_MONORAIL_CAPTION :Noi vehicule monoşină STR_BUY_VEHICLE_TRAIN_MAGLEV_CAPTION :Noi vehicule pe Pernă Magnetică @@ -3737,12 +3778,13 @@ STR_BUY_VEHICLE_TRAM_VEHICLE_CAPTION :Tramvaie noi # Vehicle availability ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_ALL_CAPTION :Vehicule pe şine +STR_BUY_VEHICLE_TRAIN_ALL_CAPTION :Noi vehicule pe șine STR_BUY_VEHICLE_ROAD_VEHICLE_ALL_CAPTION :Autovehicule noi STR_BUY_VEHICLE_SHIP_CAPTION :Nave noi STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Aeronavă nouă STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Greutate: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost reparații: {GOLD}{CURRENCY_LONG}{BLACK}) Greutate: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Viteză: {GOLD}{VELOCITY}{BLACK} Putere: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Viteză: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Viteza pe ocean: {GOLD}{VELOCITY} @@ -3753,6 +3795,7 @@ STR_PURCHASE_INFO_REFITTABLE :(suportă alte STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}An apariţie: {GOLD}{NUM}{BLACK} Durata de viaţă: {GOLD}{COMMA} ani STR_PURCHASE_INFO_RELIABILITY :{BLACK}Eficienţă max.: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Cost: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost reparații: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Greutate: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Viteză: {GOLD}{VELOCITY} STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost de reparații: {GOLD}{CURRENCY_LONG}{BLACK}) Viteză: {GOLD}{VELOCITY} @@ -3761,6 +3804,7 @@ STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vagoane STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Modificabil pentru: {GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :Toate tipurile de mărfuri STR_PURCHASE_INFO_NONE :Niciunul +STR_PURCHASE_INFO_ENGINES_ONLY :Doar motoare STR_PURCHASE_INFO_ALL_BUT :Toate, cu excepţia {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Efort tractor max.: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Rază acțiune: {GOLD}{COMMA} pătrățele @@ -3781,7 +3825,7 @@ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Cumpăr ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și adaptează vehiculul STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și repară vehiculul -STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și recondiționează nava +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și convertește nava STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Cumpără și schimbă marfa transportată de aeronavă ###length VEHICLE_TYPES @@ -3791,10 +3835,10 @@ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpăr STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Cumpără aeronava selectată. Shift+Click arată costul estimativ fără a efectua achiziţia ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară trenul selectat. Shift+clic arată costul estimat fără achiziție -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară autovehiculul selectat. Shift+clic arată costul estimat fără achiziție -STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară nava selectată. Shift+clic afișează costul estimat fără achiziție -STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și repară aeronava selectată. Shift+clic afișează costul estimat fără achiziție +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și convertește trenul selectat. Shift+clic arată costul estimat fără achiziție +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și convertește autovehiculul selectat. Shift+clic arată costul estimat fără achiziție +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și convertește nava selectată. Shift+clic afișează costul estimat fără achiziție +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Cumpără și convertește aeronava selectată. Shift+clic afișează costul estimat fără achiziție ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Nume nou @@ -3803,8 +3847,8 @@ STR_BUY_VEHICLE_SHIP_RENAME_BUTTON :{BLACK}Nume nou STR_BUY_VEHICLE_AIRCRAFT_RENAME_BUTTON :{BLACK}Redenumire ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_RENAME_TOOLTIP :{BLACK}Redenumeste modelul vehiculului -STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_TOOLTIP :{BLACK}Redenumeşte modelul de autovehicul +STR_BUY_VEHICLE_TRAIN_RENAME_TOOLTIP :{BLACK}Redenumește modelul vehiculului feroviar +STR_BUY_VEHICLE_ROAD_VEHICLE_RENAME_TOOLTIP :{BLACK}Redenumește modelul de autovehicul STR_BUY_VEHICLE_SHIP_RENAME_TOOLTIP :{BLACK}Redenumeşte modelul de navă STR_BUY_VEHICLE_AIRCRAFT_RENAME_TOOLTIP :{BLACK}Redenumeşte modelul de aeronavă @@ -3827,15 +3871,15 @@ STR_BUY_VEHICLE_SHIP_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutato STR_BUY_VEHICLE_AIRCRAFT_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutator pentru afişarea tipului de aeronavă ###length VEHICLE_TYPES -STR_QUERY_RENAME_TRAIN_TYPE_CAPTION :{WHITE}Redenumeste modelul vehiculului feroviar -STR_QUERY_RENAME_ROAD_VEHICLE_TYPE_CAPTION :{WHITE}Redenumeşte modelul de autovehicul +STR_QUERY_RENAME_TRAIN_TYPE_CAPTION :{WHITE}Redenumește modelul vehiculului feroviar +STR_QUERY_RENAME_ROAD_VEHICLE_TYPE_CAPTION :{WHITE}Redenumește modelul de autovehicul STR_QUERY_RENAME_SHIP_TYPE_CAPTION :{WHITE}Redenumeşte modelul de navă STR_QUERY_RENAME_AIRCRAFT_TYPE_CAPTION :{WHITE}Redenumeşte modelul de aeronavă # Depot window STR_DEPOT_CAPTION :{WHITE}{DEPOT} -STR_DEPOT_RENAME_TOOLTIP :{BLACK}Schimba numele depoului +STR_DEPOT_RENAME_TOOLTIP :{BLACK}Schimbă numele depoului STR_DEPOT_RENAME_DEPOT_CAPTION :Redenumire depou STR_DEPOT_NO_ENGINE :{BLACK}- @@ -3856,7 +3900,7 @@ STR_DEPOT_SHIP_SELL_TOOLTIP :{BLACK}Trage na STR_DEPOT_AIRCRAFT_SELL_TOOLTIP :{BLACK}Trage aeronava aici pentru a o vinde ###length VEHICLE_TYPES -STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TOOLTIP :{BLACK}Vinde toate trenurile din the depou +STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TOOLTIP :{BLACK}Vinde toate trenurile din depou STR_DEPOT_SELL_ALL_BUTTON_ROAD_VEHICLE_TOOLTIP :{BLACK}Vinde toate autovehiculele din depou STR_DEPOT_SELL_ALL_BUTTON_SHIP_TOOLTIP :{BLACK}Vinde toate vasele din depou STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TOOLTIP :{BLACK}Vinde toate aeronavele din hangar @@ -3886,27 +3930,27 @@ STR_DEPOT_CLONE_SHIP :{BLACK}Clonare STR_DEPOT_CLONE_AIRCRAFT :{BLACK}Clonare aeronavă ###length VEHICLE_TYPES -STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Acest buton va crea o copie a trenului, cu tot cu vagoane. Apasă acest buton, apoi fă click pe un tren din interiorul sau exteriorul depoului. Ctrl+Click va sincroniza comenzile. Shift+Click arată costul estimativ fără a efectua achiziţia -STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Acest buton va crea o copie a autovehiculului. Apasă acest buton, apoi fă click pe un autovehicul din interiorul sau afara depoului. Ctrl+Click va sincroniza comenzile. Shift+Click arată costul estimativ fără a efectua achiziţia -STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Acest buton va crea o copie a navei. Apasă acest buton, apoi fă click pe o navă din interiorul sau exteriorul depoului. Ctrl+Click va sincroniza comenzile. Shift+Click arată costul estimativ fără a efectua achiziţia -STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Acest buton va crea o copie a aeronavei. Apasă acest buton, apoi fă clic pe o aeronavă din interiorul sau exteriorul hangarului. Ctrl+Click va sincroniza comenzile. Shift+Click arată costul estimativ fără a efectua achiziţia +STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Acest buton va crea o copie a trenului, cu tot cu vagoane. Apasă acest buton, apoi fă click pe un tren din interiorul sau exteriorul depoului. Ctrl+clic va sincroniza comenzile. Shift+clic arată costul estimativ fără a efectua achiziția +STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Acest buton va crea o copie a autovehiculului. Apasă acest buton, apoi fă click pe un autovehicul din interiorul sau afara depoului. Ctrl+clic va sincroniza comenzile. Shift+clic arată costul estimativ fără a efectua achiziția +STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Acest buton va crea o copie a navei. Apasă acest buton, apoi fă click pe o navă din interiorul sau exteriorul depoului. Ctrl+clic va sincroniza comenzile. Shift+clic arată costul estimativ fără a efectua achiziția +STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Acest buton va crea o copie a aeronavei. Apasă acest buton, apoi fă clic pe o aeronavă din interiorul sau exteriorul hangarului. Ctrl+clic va sincroniza comenzile. Shift+clic arată costul estimativ fără a efectua achiziția ###length VEHICLE_TYPES STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia depoului. Ctrl+Click deshide o fereastra cu locaţia depoului STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia acestei autobaze. Ctrl+Click deshide o fereastra cu locaţia autobazei STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia şantierului. Ctrl+Click deshide o fereastra cu locaţia şantierului -STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia hangarului. Ctrl+Click deshide o fereastra cu locaţia hangarului +STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Centrează vizorul principal pe locația hangarului. Ctrl+clic deschide un vizor nou cu locația hangarului ###length VEHICLE_TYPES -STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TOOLTIP :{BLACK}Obtine o lista ordonata a tuturor trenurilor din depoul actual -STR_DEPOT_VEHICLE_ORDER_LIST_ROAD_VEHICLE_TOOLTIP :{BLACK}Obtine o lista ordonata a tuturor autovehiculelor din depoul actual -STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TOOLTIP :{BLACK}Obtine o lista ordonata a tuturor vaselor din depoul actual -STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TOOLTIP :{BLACK}Obtine o lista ordonata a tuturor aeronavelor din orice hangar al acestui aeroport +STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TOOLTIP :{BLACK}Obține o listă a tuturor trenurilor care au comenzi în depoul actual +STR_DEPOT_VEHICLE_ORDER_LIST_ROAD_VEHICLE_TOOLTIP :{BLACK}Obține o listă a tuturor autovehiculelor care au comenzi în depoul actual +STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TOOLTIP :{BLACK}Obține o listă a tuturor vaselor care au comenzi în depoul actual +STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TOOLTIP :{BLACK}Obține o listă a tuturor aeronavelor care au comenzi în aeroportul actual ###length VEHICLE_TYPES -STR_DEPOT_MASS_STOP_DEPOT_TRAIN_TOOLTIP :{BLACK}Click pt oprirea tuturor trenurilor din depou -STR_DEPOT_MASS_STOP_DEPOT_ROAD_VEHICLE_TOOLTIP :{BLACK}Click pt oprirea tuturor autovehiculelor din depou -STR_DEPOT_MASS_STOP_DEPOT_SHIP_TOOLTIP :{BLACK}Click pt oprirea tuturor vaselor din depou +STR_DEPOT_MASS_STOP_DEPOT_TRAIN_TOOLTIP :{BLACK}Click pentru oprirea tuturor trenurilor din depou +STR_DEPOT_MASS_STOP_DEPOT_ROAD_VEHICLE_TOOLTIP :{BLACK}Click pentru oprirea tuturor autovehiculelor din depou +STR_DEPOT_MASS_STOP_DEPOT_SHIP_TOOLTIP :{BLACK}Click pentru oprirea tuturor vaselor din depou STR_DEPOT_MASS_STOP_HANGAR_TOOLTIP :{BLACK}Click pt oprirea tuturor aeronavelor din hangar ###length VEHICLE_TYPES @@ -3933,11 +3977,13 @@ STR_ENGINE_PREVIEW_TRAM_VEHICLE :tramvai STR_ENGINE_PREVIEW_AIRCRAFT :aeronavă STR_ENGINE_PREVIEW_SHIP :navă -STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Cost: {CURRENCY_LONG} Greutate: {WEIGHT_SHORT}{}Vitezã: {VELOCITY} Putere: {POWER}{}Cost de rulare: {CURRENCY_LONG}/an{}Capacitate: {CARGO_LONG} -STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Cost: {CURRENCY_LONG} Greutate: {WEIGHT_SHORT}{}Viteză: {VELOCITY} Putere: {POWER} Ef. T. Max.: {6:FORCE}{}Cost rulaj: {4:CURRENCY_LONG}/an{}Capacitate: {5:CARGO_LONG} +STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Cost: {CURRENCY_LONG} Greutate: {WEIGHT_SHORT}{}Viteză: {VELOCITY} Putere: {POWER}{}Mentenanță: {CURRENCY_LONG}/an{}Capacitate: {CARGO_LONG} +STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Cost: {CURRENCY_LONG} Greutate: {WEIGHT_SHORT}{}Viteză: {VELOCITY} Putere: {POWER} Ef. T. Max.: {6:FORCE}{}Mentenanță: {4:CURRENCY_LONG}/an{}Capacitate: {5:CARGO_LONG} STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteză max.: {VELOCITY}{}Capacitate: {CARGO_LONG}{}Mentenanță: {CURRENCY_LONG}/an -STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteză max.: {VELOCITY}{}Tip avion: {STRING}{}Capacitate: {CARGO_LONG}, {CARGO_LONG}{}Mentenanță: {CURRENCY_LONG}/an +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteză max.: {VELOCITY}{}Tip de aeronavă: {STRING}{}Capacitate: {CARGO_LONG}, {CARGO_LONG}{}Mentenanță: {CURRENCY_LONG}/an +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteză max.: {VELOCITY}{}Tip aeronavă: {STRING}{}Capacitate: {CARGO_LONG}{}Mentenanță: {CURRENCY_LONG}/an STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteza maximă: {VELOCITY}{}Tip avion: {STRING} Rază: {COMMA} pătrățele{}Capacitate: {CARGO_LONG}, {CARGO_LONG}{}Mentenanță: {CURRENCY_LONG}/an +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Viteză max.: {VELOCITY}{}Tip aeronavă: {STRING} Autonomie: {COMMA} dale{}Capacitate: {CARGO_LONG}{}Mentenanță: {CURRENCY_LONG}/an # Autoreplace window STR_REPLACE_VEHICLES_WHITE :{WHITE}Înlocuieşte {STRING} - {STRING} @@ -3973,13 +4019,13 @@ STR_REPLACE_ALL_RAILTYPE :Toate vehiculel STR_REPLACE_ALL_ROADTYPE :Toate vehiculele rutiere ###length 2 -STR_REPLACE_HELP_RAILTYPE :{BLACK}Alege un tip de cale ferată pentru care doreşti să înlocuieşti locomotivele +STR_REPLACE_HELP_RAILTYPE :{BLACK}Alege un tip de cale ferată pentru care dorești să înlocuiești locomotivele STR_REPLACE_HELP_ROADTYPE :{BLACK}Alege tipul de drum pentru care vrei să înlocuiești motoarele ###next-name-looks-similar STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Arată locomotiva ceva înlocui locomotiva selectată în stânga STR_REPLACE_RAIL_VEHICLES :Vehicule feroviare -STR_REPLACE_ELRAIL_VEHICLES :Vehicule Electrificate pe Sine +STR_REPLACE_ELRAIL_VEHICLES :Vehicule electrificate pe șine STR_REPLACE_MONORAIL_VEHICLES :Vehicule Monorail STR_REPLACE_MAGLEV_VEHICLES :Vehicule Pernă Magnetică @@ -3988,11 +4034,13 @@ STR_REPLACE_TRAM_VEHICLES :Tramvaie STR_REPLACE_REMOVE_WAGON :{BLACK}Retragere vagoane ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Fă optiunea de autoînlocuire să păstreze identică lungimea unui tren prin eliminarea vagoanelor (începând din faţă) dacă înlocuirea locomotivei ar face trenul mai lung +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+clic pentru aplicare și la sub-grupuri # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} ###length VEHICLE_TYPES +STR_VEHICLE_VIEW_TRAIN_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația trenului. Dublu-clic va urmări trenul în vizorul principal. Ctrl+clic deschide un nou vizor cu locație trenului STR_VEHICLE_VIEW_ROAD_VEHICLE_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația vehiculului. Dublu-clic va urmări vehiculul în vizorul principal. Ctrl+clic deschide un nou vizor cu locația vehiculului STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Centrează imaginea pe locația navei. Dublu clic va urmări nava în vizorul principal. Ctrl+Clic deschide un nou vizor pe locația navei @@ -4005,8 +4053,8 @@ STR_VEHICLE_VIEW_AIRCRAFT_SEND_TO_DEPOT_TOOLTIP :{BLACK}Trimite ###length VEHICLE_TYPES STR_VEHICLE_VIEW_CLONE_TRAIN_INFO :{BLACK}Acest buton va crea o copie a întregului tren. Ctrl+Click va sincroniza comenzile. Shift+Click va afișa costul estimat fără a achiziționa trenul STR_VEHICLE_VIEW_CLONE_ROAD_VEHICLE_INFO :{BLACK}Acest buton va crea o copie a autovehiculului. Ctrl+Click va sincroniza comenzile. Shift+Click va afișa costul estimat fără a achiziționa vehiculul -STR_VEHICLE_VIEW_CLONE_SHIP_INFO :{BLACK}Acest buton va crea o copie a navei. Ctrl+Click va sincroniza comenzile. Shift+Click va afișa costul estimat fără a achiziționa nava -STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Acest buton va crea o copie a aeronavei. Ctrl+Click va sincroniza comenzile. Shift+Click va afișa costul estimat fără a cumpăra aeronava +STR_VEHICLE_VIEW_CLONE_SHIP_INFO :{BLACK}Acest buton va crea o copie a navei. Ctrl+clic va sincroniza comenzile. Shift+clic va afișa costul estimat fără a achiziționa nava +STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Acest buton va crea o copie a aeronavei. Ctrl+clic va sincroniza comenzile. Shift+clic va afișa costul estimat fără a cumpăra aeronava STR_VEHICLE_VIEW_TRAIN_IGNORE_SIGNAL_TOOLTIP :{BLACK}Forţează trenul să ignore semnalizarea de oprire STR_VEHICLE_VIEW_TRAIN_REVERSE_TOOLTIP :{BLACK}Schimbă sensul de circulaţie al trenului @@ -4054,6 +4102,9 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Merge s STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Merge către {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Service la {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Nu pot ajunge la {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Nu pot ajunge la {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Nu pot ajunge la {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Nu pot ajunge la {DEPOT}, {VELOCITY} # Vehicle stopped/started animations @@ -4080,6 +4131,7 @@ STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} {P STR_VEHICLE_INFO_MAX_SPEED :{BLACK}Viteză max.: {LTBLUE}{VELOCITY} STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Viteză max.: {LTBLUE}{VELOCITY} {BLACK}Tip de aeronavă: {LTBLUE}{STRING} +STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Viteză max.: {LTBLUE}{VELOCITY} {BLACK}Tip de aeronavă: {LTBLUE}{STRING} {BLACK}Autonomie: {LTBLUE}{COMMA} dale STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Greutate: {LTBLUE}{WEIGHT_SHORT} {BLACK}Putere: {LTBLUE}{POWER}{BLACK} Viteză max.: {LTBLUE}{VELOCITY} STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Greutate: {LTBLUE}{WEIGHT_SHORT} {BLACK}Putere: {LTBLUE}{POWER}{BLACK} Viteză max.: {LTBLUE}{VELOCITY} {BLACK}Efort tractiv: {LTBLUE}{FORCE} @@ -4197,7 +4249,7 @@ STR_ORDER_TOOLTIP_UNLOAD :{BLACK}Schimbă STR_ORDER_REFIT :{BLACK}Rearanjeaza STR_ORDER_REFIT_TOOLTIP :{BLACK}Alege tipul de marfă pentru rearanjarea în comandă. Ctrl+clic pentru a anula rearanjarea STR_ORDER_REFIT_AUTO :{BLACK}Auto-modificare -STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Selectează tipul de marfă pentru modificare cu acest ordin. Ctrl+click pentru a elimina o instrucțiune de modificare încărcătură. Modificarea automată va fi efectuată doar dacă vehiculul permite asta. +STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Selectează marfa țintă pentru conversie în această comandă. Ctrl+clic pentru a elimina instrucțiunea de conversie. Conversia din stații va fi efectuată doar dacă vehiculul permite asta. STR_ORDER_DROP_REFIT_AUTO :Tip încărcătură nemodificabil STR_ORDER_DROP_REFIT_AUTO_ANY :Încărcătură disponibilă @@ -4239,15 +4291,15 @@ STR_ORDERS_SKIP_TOOLTIP :{BLACK}Sari pes STR_ORDERS_DELETE_BUTTON :{BLACK}Şterge STR_ORDERS_DELETE_TOOLTIP :{BLACK}Şterge comanda selectată -STR_ORDERS_DELETE_ALL_TOOLTIP :{BLACK}Şterge toate ordinele +STR_ORDERS_DELETE_ALL_TOOLTIP :{BLACK}Șterge toate comenzile STR_ORDERS_STOP_SHARING_BUTTON :{BLACK}Opreşte sincronizarea -STR_ORDERS_STOP_SHARING_TOOLTIP :{BLACK}Opreşte sincronizarea ordinelor. Ctrl-Click şterge toate ordinele pentru acest vehicul +STR_ORDERS_STOP_SHARING_TOOLTIP :{BLACK}Oprește sincronizarea comenzilor. Ctrl-clic șterge toate comenzile acestui vehicul STR_ORDERS_GO_TO_BUTTON :{BLACK}Mergi la STR_ORDER_GO_TO_NEAREST_DEPOT :Du-te la cel mai apropiat depou STR_ORDER_GO_TO_NEAREST_HANGAR :Du-te la cel mai apropiat hangar -STR_ORDER_CONDITIONAL :Salt în ordine condiţionată -STR_ORDER_SHARE :Sincronizează ordinele +STR_ORDER_CONDITIONAL :Salt condițional +STR_ORDER_SHARE :Sincronizează comenzile STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Adaugă o comandă înaintea celei selectate sau la sfârșitul listei. Ctrl-clic transformă comenzile pentru stații în „încarcă orice tip de marfă”, pentru punctele de tranzit în „non-stop” și pentru depouri în „service”. „Sincronizarea comenzilor” sau Ctrl permite acestui vehicul să își partajeze comenzile cu vehiculul selectat. Click pe un vehicul pentru a copia ordinele de la el. O comandă de depou anulează service-ul automat pentru vehicul STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP :{BLACK}Arata toate vehiculele care se incadreaza in acest program @@ -4338,8 +4390,9 @@ STR_TIMETABLE_TRAVEL_FOR :Calatorii pentr STR_TIMETABLE_TRAVEL_FOR_SPEED :Mergi către {STRING} cu maxim {VELOCITY} STR_TIMETABLE_TRAVEL_FOR_ESTIMATED :Călătorie (pentru {STRING}, neplanificată) STR_TIMETABLE_TRAVEL_FOR_SPEED_ESTIMATED :Călătoriți (pentru {STRING}, neprogramat) cu cel mult {VELOCITY} +STR_TIMETABLE_STAY_FOR_ESTIMATED :(staționare pentru {STRING}, neprogramată) STR_TIMETABLE_AND_TRAVEL_FOR_ESTIMATED :(călătorie pentru {STRING}, neprogramată) -STR_TIMETABLE_STAY_FOR :şi opreşte pentru {STRING} +STR_TIMETABLE_STAY_FOR :și staționare pentru {STRING} STR_TIMETABLE_AND_TRAVEL_FOR :şi călătoreşte pentru {STRING} STR_TIMETABLE_DAYS :{COMMA}{NBSP}{P zi zile "de zile"} STR_TIMETABLE_TICKS :{COMMA}{NBSP}{P unitate unități "de unități"} de timp intern{P ă e e} @@ -4347,9 +4400,9 @@ STR_TIMETABLE_TICKS :{COMMA}{NBSP}{P STR_TIMETABLE_TOTAL_TIME :{BLACK}Acest orar va lua {STRING} pentru finalizare STR_TIMETABLE_TOTAL_TIME_INCOMPLETE :{BLACK}Acest orar va lua cel putin {STRING} pentru finalizare (nu in intregime programat) -STR_TIMETABLE_STATUS_ON_TIME :{BLACK}Acest vehicul se incadreaza in timp +STR_TIMETABLE_STATUS_ON_TIME :{BLACK}Acest vehicul se încadrează în timp STR_TIMETABLE_STATUS_LATE :{BLACK}Vehiculul are întârziere de {STRING} -STR_TIMETABLE_STATUS_EARLY :{BLACK}Momentan, acest vehicul si-a devansat programul {STRING} +STR_TIMETABLE_STATUS_EARLY :{BLACK}Momentan, acest vehicul și-a devansat programul {STRING} STR_TIMETABLE_STATUS_NOT_STARTED :{BLACK}Acest orar nu a început încă STR_TIMETABLE_STATUS_START_AT :{BLACK}Acest orar va începe la {STRING} @@ -4512,7 +4565,7 @@ STR_ERROR_SAVE_STILL_IN_PROGRESS :{WHITE}Salvarea STR_ERROR_AUTOSAVE_FAILED :{WHITE}Auto-salvarea a esuat STR_ERROR_UNABLE_TO_READ_DRIVE :{BLACK}Discul nu a putut fi citit STR_ERROR_GAME_SAVE_FAILED :{WHITE}Salvarea jocului eşuată{}{STRING} -STR_ERROR_UNABLE_TO_DELETE_FILE :{WHITE}Ştergerea jocului eşuată +STR_ERROR_UNABLE_TO_DELETE_FILE :{WHITE}Ștergerea fișierului a eșuat STR_ERROR_GAME_LOAD_FAILED :{WHITE}Încărcarea jocului eşuată{}{STRING} STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR :Eroare internă: {STRING} STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME :Salvare eronată - {STRING} @@ -4577,9 +4630,9 @@ STR_ERROR_GENERIC_OBJECT_IN_THE_WAY :{WHITE}{1:STRIN STR_ERROR_NOT_ALLOWED_WHILE_PAUSED :{WHITE}Nepermis când jocul este în pauză # Local authority errors -STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS :{WHITE}Autorităţile locale din {TOWN} refuză să permită această acţiune -STR_ERROR_LOCAL_AUTHORITY_REFUSES_AIRPORT :{WHITE}Autoritatea locală din {TOWN} refuză să permită construirea unui nou aeroport în acest oraş -STR_ERROR_LOCAL_AUTHORITY_REFUSES_NOISE :{WHITE}Autoritatea locală din {TOWN} nu permite construirea unui nou aeroport datorită poluării fonice +STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS :{WHITE}Autoritățile locale din {TOWN} nu permit această acțiune +STR_ERROR_LOCAL_AUTHORITY_REFUSES_AIRPORT :{WHITE}Autoritatea locală din {TOWN} nu permite construirea altui aeroport în acest oraș +STR_ERROR_LOCAL_AUTHORITY_REFUSES_NOISE :{WHITE}Autoritatea locală din {TOWN} refuză autorizarea aeroportului din considerente de poluare fonică STR_ERROR_BRIBE_FAILED :{WHITE}Tentativa de mituire a fost descoperită de un investigator regional # Levelling errors @@ -4620,7 +4673,7 @@ STR_ERROR_TOO_MANY_TOWNS :{WHITE}... prea STR_ERROR_NO_SPACE_FOR_TOWN :{WHITE}... nu mai este loc pe hartă STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}Oraşul nu va construi drumuri. Poţi activa construirea drumurilor via Setari avansate -> Economie -> Oraşe STR_ERROR_ROAD_WORKS_IN_PROGRESS :{WHITE}Lucrari la drum in curs de desfasurare -STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Acest oraş nu poate fi şters...{}O staţie sau un depou face referire la acest oraş, sau o parcelă deţinută de oraş nu poate fi eliminată +STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Acest oraș nu poate fi șters...{}O stație sau un depou face referire la acest oraș, sau o parcelă deținută de oraș nu poate fi eliminată STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... nu există nici un loc potrivit pentru o statuie în centrul acestui oraş # Industry related errors @@ -4642,6 +4695,7 @@ STR_ERROR_FOREST_CAN_ONLY_BE_PLANTED :{WHITE}... păd STR_ERROR_CAN_ONLY_BE_BUILT_ABOVE_SNOW_LINE :{WHITE}... poate fi construit doar deasupra liniei zăpezii STR_ERROR_CAN_ONLY_BE_BUILT_BELOW_SNOW_LINE :{WHITE}... poate fi construit doar sub linia zăpezii +STR_ERROR_NO_SUITABLE_PLACES_FOR_INDUSTRIES :{WHITE}Nu s-au găsit locuri potrivite pentru industriile '{STRING}' STR_ERROR_NO_SUITABLE_PLACES_FOR_INDUSTRIES_EXPLANATION :{WHITE}Modifică parametrii generatorului ca să obții o hartă mai bună # Station construction related errors @@ -4759,6 +4813,7 @@ STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM :{WHITE}Nu pot STR_ERROR_THERE_IS_NO_ROAD :{WHITE}...nu există drum aici STR_ERROR_THERE_IS_NO_TRAMWAY :{WHITE}...nu există şină de tramvai aici STR_ERROR_CAN_T_CONVERT_ROAD :{WHITE}Tipul de drum nu poate fi convertit aici... +STR_ERROR_CAN_T_CONVERT_TRAMWAY :{WHITE}Nu pot converti tipul de tramvai aici... STR_ERROR_NO_SUITABLE_ROAD :{WHITE}Niciun drum adecvat STR_ERROR_NO_SUITABLE_TRAMWAY :{WHITE}Niciun tramvai adecvat @@ -4809,14 +4864,14 @@ STR_ERROR_CAN_T_PURCHASE_THIS_LAND :{WHITE}Nu poţi STR_ERROR_YOU_ALREADY_OWN_IT :{WHITE}... este deja în proprietatea ta! # Group related errors -STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Nu pot crea grup... -STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Nu pot şterge grup... +STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Nu pot crea grupul... +STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Nu se poate șterge acest grup... STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Nu pot redenumi grup... STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Nu pot seta grupul predecesor... STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION :{WHITE}... nu sunt permise buclele în ierarhia de grup STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Nu pot elimina toate vehiculele din acest grup... -STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Nu pot adauga vehiculul in acest grup... -STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Nu pot adauga vehicule partajate in grup... +STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Nu pot adăuga vehiculul în acest grup... +STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Nu pot adăuga vehicule partajate în grup... # Generic vehicle errors @@ -4897,7 +4952,7 @@ STR_ERROR_AIRCRAFT_IS_IN_FLIGHT :{WHITE}Aeronava STR_ERROR_NO_MORE_SPACE_FOR_ORDERS :{WHITE}Nu mai este loc pentru comenzi STR_ERROR_TOO_MANY_ORDERS :{WHITE}Prea multe comenzi STR_ERROR_CAN_T_INSERT_NEW_ORDER :{WHITE}Nu se poate adăuga o comandă nouă... -STR_ERROR_CAN_T_DELETE_THIS_ORDER :{WHITE}Nu se poate şterge această comandă... +STR_ERROR_CAN_T_DELETE_THIS_ORDER :{WHITE}Nu se poate șterge această comandă... STR_ERROR_CAN_T_MODIFY_THIS_ORDER :{WHITE}Nu se poate modifica această comandă... STR_ERROR_CAN_T_MOVE_THIS_ORDER :{WHITE}Nu pot muta acest ordin... STR_ERROR_CAN_T_SKIP_ORDER :{WHITE}Nu se poate sări peste comanda actuală... @@ -4907,7 +4962,7 @@ STR_ERROR_CAN_T_ADD_ORDER :{WHITE}... vehi STR_ERROR_CAN_T_ADD_ORDER_SHARED :{WHITE}... un vehicul care are acest ordin nu poate ajunge la acea staţie STR_ERROR_CAN_T_SHARE_ORDER_LIST :{WHITE}Nu se poate trece la comenzi sincronizate... -STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST :{WHITE}Nu pot opri sincronizarea listei de ordine... +STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST :{WHITE}Nu pot opri sincronizarea listei de comenzi... STR_ERROR_CAN_T_COPY_ORDER_LIST :{WHITE}Nu pot copia lista de comenzi... STR_ERROR_TOO_FAR_FROM_PREVIOUS_DESTINATION :{WHITE}... prea departe de destinaţia precedentă STR_ERROR_AIRCRAFT_NOT_ENOUGH_RANGE :{WHITE}... avionul nu are o rază de acțiune suficientă @@ -4921,7 +4976,7 @@ STR_ERROR_TIMETABLE_NOT_STOPPING_HERE :{WHITE}Acest ve STR_ERROR_TOO_MANY_SIGNS :{WHITE}... prea multe semne STR_ERROR_CAN_T_PLACE_SIGN_HERE :{WHITE}Nu se poate plasa un semn aici... STR_ERROR_CAN_T_CHANGE_SIGN_NAME :{WHITE}Nu se poate schimba numele semnului... -STR_ERROR_CAN_T_DELETE_SIGN :{WHITE}Nu pot sterge semnul... +STR_ERROR_CAN_T_DELETE_SIGN :{WHITE}Nu pot șterge semnul... # Translatable comment for OpenTTD's desktop shortcut ###external 1 @@ -5021,7 +5076,7 @@ STR_INDUSTRY_NAME_SUGAR_MINE :Mină de zahăr ##id 0x6000 STR_SV_EMPTY : -STR_SV_UNNAMED :NoName +STR_SV_UNNAMED :Fără nume STR_SV_TRAIN_NAME :Trenul #{COMMA} STR_SV_ROAD_VEHICLE_NAME :Autovehiculul #{COMMA} STR_SV_SHIP_NAME :Nava #{COMMA} From ccd586a736595c2af09c6f614c11a75b9b3da156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sat, 2 Oct 2021 15:13:58 +0200 Subject: [PATCH 013/710] Fix #9588, 140a96b: [Squirrel] Reaching memory limit during script registration could prevent further script detections (#9589) Also the memory allocation triggering the limit was never freed. And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either. --- src/3rdparty/squirrel/squirrel/sqobject.h | 18 ++++++++++++++++++ src/script/squirrel.cpp | 14 +++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/squirrel/squirrel/sqobject.h b/src/3rdparty/squirrel/squirrel/sqobject.h index 129674b5a6..77d09301c6 100644 --- a/src/3rdparty/squirrel/squirrel/sqobject.h +++ b/src/3rdparty/squirrel/squirrel/sqobject.h @@ -62,6 +62,24 @@ struct SQRefCounted SQUnsignedInteger _uiRef; struct SQWeakRef *_weakref; virtual void Release()=0; + + /* Placement new/delete to prevent memory leaks if constructor throws an exception. */ + inline void *operator new(size_t size, SQRefCounted *place) + { + place->size = size; + return place; + } + + inline void operator delete(void *ptr, SQRefCounted *place) + { + SQ_FREE(ptr, place->size); + } + + /* Never used but required. */ + inline void operator delete(void *ptr) { NOT_REACHED(); } + +private: + size_t size; }; struct SQWeakRef : SQRefCounted diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 6489c87371..8d2aa3b783 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -67,7 +67,7 @@ struct ScriptAllocator { * @param requested_size The requested size that was requested to be allocated. * @param p The pointer to the allocated object, or null if allocation failed. */ - void CheckAllocation(size_t requested_size, const void *p) + void CheckAllocation(size_t requested_size, void *p) { if (this->allocated_size > this->allocation_limit && !this->error_thrown) { /* Do not allow allocating more than the allocation limit, except when an error is @@ -77,6 +77,11 @@ struct ScriptAllocator { char buff[128]; seprintf(buff, lastof(buff), "Maximum memory allocation exceeded by " PRINTF_SIZE " bytes when allocating " PRINTF_SIZE " bytes", this->allocated_size - this->allocation_limit, requested_size); + /* Don't leak the rejected allocation. */ + free(p); + p = nullptr; + /* Allocation rejected, don't count it. */ + this->allocated_size -= requested_size; throw Script_FatalError(buff); } @@ -93,6 +98,8 @@ struct ScriptAllocator { this->error_thrown = true; char buff[64]; seprintf(buff, lastof(buff), "Out of memory. Cannot allocate " PRINTF_SIZE " bytes", requested_size); + /* Allocation failed, don't count it. */ + this->allocated_size -= requested_size; throw Script_FatalError(buff); } } @@ -757,6 +764,11 @@ void Squirrel::Uninitialize() /* Clean up the stuff */ sq_pop(this->vm, 1); sq_close(this->vm); + + assert(this->allocator->allocated_size == 0); + + /* Reset memory allocation errors. */ + this->allocator->error_thrown = false; } void Squirrel::Reset() From 585ad9bcab8b932ce504b43d36dacc168f1ec7f8 Mon Sep 17 00:00:00 2001 From: dP Date: Sat, 2 Oct 2021 17:33:28 +0300 Subject: [PATCH 014/710] Cleanup: Swap comments for IConsoleModes (#9587) --- src/console_type.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/console_type.h b/src/console_type.h index add22e0084..8c40b4f5b5 100644 --- a/src/console_type.h +++ b/src/console_type.h @@ -14,9 +14,9 @@ /** Modes of the in-game console. */ enum IConsoleModes { - ICONSOLE_FULL, ///< In-game console is closed. + ICONSOLE_FULL, ///< In-game console is opened, whole screen. ICONSOLE_OPENED, ///< In-game console is opened, upper 1/3 of the screen. - ICONSOLE_CLOSED, ///< In-game console is opened, whole screen. + ICONSOLE_CLOSED, ///< In-game console is closed. }; /* Colours of the console messages. */ From a2cf81e7221ec4cfd1e37b356caf59a1481cdfcf Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 2 Oct 2021 18:46:31 +0000 Subject: [PATCH 015/710] Update: Translations from eints romanian: 38 changes by kneekoo --- src/lang/romanian.txt | 61 +++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 786d4251d0..2f06daa600 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -794,6 +794,7 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * P STR_STATUSBAR_AUTOSAVE :{RED}SALVARE AUTOMATĂ STR_STATUSBAR_SAVING_GAME :{RED}* * SALVARE JOC * * +STR_STATUSBAR_SPECTATOR :{WHITE}(spectator) # News message history STR_MESSAGE_HISTORY :{WHITE}Cronologia mesajelor @@ -1029,7 +1030,7 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Alege m STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detecție) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normală STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Mărime dublă -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Mărime împătrită +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Mărime cvadruplă STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Dimensiune font STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Alege dimensiunea fontului pentru interfață @@ -1037,6 +1038,7 @@ STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Alege di STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detecție) STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Mărime dublă +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Mărime cvadruplă STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafică @@ -1608,10 +1610,10 @@ STR_CONFIG_SETTING_LOADING_INDICATORS :Foloseşte indi STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :Alege dacă indicatori de încărcare sunt afișați deasupra unor vehicule care sunt în proces de încărcare sau descărcare STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :Arată orarul pe programări în unități de timp interne în loc de zile: {STRING} -STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :Arată timpii de călatorie în tabela cu timpi a jocului folosind unități de timp interne în loc de zile +STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :Arată timpii de călătorie în tabela cu timpi a jocului folosind unități de timp interne în loc de zile -STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Afişează plecările şi sosirile în orare: {STRING} -STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Arată timpii estimați de plecare și sosire în orar +STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Afișează plecările și sosirile din orare: {STRING} +STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Arată timpii estimați de plecare și sosire din orar STR_CONFIG_SETTING_QUICKGOTO :Creare rapidă a comenzilor pentru vehicule: {STRING} STR_CONFIG_SETTING_QUICKGOTO_HELPTEXT :Preselectează cursorul "mergi la" când se deschide fereastra de comenzi @@ -1782,11 +1784,14 @@ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Ştirile color STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Anul începând cu care anunțurile din ziar sunt tipărite color. Înainte de acest an, anunturile sunt monocrome (alb/negru) STR_CONFIG_SETTING_STARTING_YEAR :Anul de început al jocului: {STRING} +STR_CONFIG_SETTING_ENDING_YEAR :Anul final pentru scor: {STRING} +STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :An în care jocul oprește contorizarea scorului. La finalul acestui an, scorul companiei este salvat și tabela celor mai bune scoruri e afișată, însă jucătorii pot continua să se joace.{}Dacă anul e înaintea celui de pornire, tabela celor mai bune scoruri nu va fi afișată. STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Niciodată STR_CONFIG_SETTING_ECONOMY_TYPE :Tipul economiei: {STRING} +STR_CONFIG_SETTING_ECONOMY_TYPE_HELPTEXT :Economia lină face mai des modificări de producție, în pași mai mici. Economia înghețată previne modificările de producție și închiderile industriilor. Setarea ar putea să nu aibă efect dacă tipurile de industrii sunt furnizate de un NewGRF. ###length 3 STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Original STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Lin @@ -1909,7 +1914,7 @@ STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Multiplicator i STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Dimensiunea medie a oraşelor mari relativ la oraşele normale, la începutul jocului STR_CONFIG_SETTING_LINKGRAPH_INTERVAL :Actualizează graficul de distribuţie la fiecare {STRING}{NBSP}{P 0:2 zi zile "de zile"} -STR_CONFIG_SETTING_LINKGRAPH_INTERVAL_HELPTEXT :Interval de timp între recalculările graficului de conexiuni. Fiecare recalculare calculează planurile unei componente ale graficului. Asta înseamnă că o valoare X pentru această setare nu va duce la actualizarea întregului grafic la fiecare X zile, ci doar o componentă va fi actualizată. Cu cât e mai mică valoarea, cu atât mai timp CPU va fi necesar pentru calcule. Cu cât e mai mare valoarea, cu atât va dura mai mult până va începe distribuția mărfii pe rute noi. +STR_CONFIG_SETTING_LINKGRAPH_INTERVAL_HELPTEXT :Interval de timp între recalculările graficului de conexiuni. Fiecare recalculare calculează planurile unei componente ale graficului. Asta înseamnă că o valoare X pentru această setare nu va duce la actualizarea întregului grafic la fiecare X zile, ci doar o componentă va fi actualizată. Cu cât e mai mică valoarea, cu atât mai mult timp va fi necesar pentru calcule. Cu cât e mai mare valoarea, cu atât va dura mai mult până va începe distribuția mărfii pe rute noi. STR_CONFIG_SETTING_LINKGRAPH_TIME :Acordă {STRING}{NBSP}{P 0:2 zi zile "de zile"} pentru recalcularea graficului de distribuţie STR_CONFIG_SETTING_DISTRIBUTION_PAX :Modalitatea de distribuire a pasagerilor: {STRING} @@ -1925,6 +1930,7 @@ STR_CONFIG_SETTING_DISTRIBUTION_ASYMMETRIC :asimetric STR_CONFIG_SETTING_DISTRIBUTION_SYMMETRIC :simetric STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :Acurateţea distribuţiei: {STRING} +STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :Cu cât setezi o valoare mai mare, cu atât mai mult timp va lua calcularea graficului de conexiuni. Dacă durează prea mult, vei sesiza întârzieri. Iar dacă setezi o valoare mică, distribuția va fi imprecisă și ai putea sesiza că anumite mărfuri nu sunt trimise unde te aștepți să ajungă. STR_CONFIG_SETTING_DEMAND_DISTANCE :Efectul distanţei asupra cererii: {STRING} STR_CONFIG_SETTING_DEMAND_DISTANCE_HELPTEXT :Dacă setezi această valoare peste 0, distanța dintre stația origine A al mărfii și o posibilă stație B va afecta cantitatea de marfă trimisă din punctul A în B. Cu cât e mai departe B de A cu atât va fi mai mică cantitatea de marfă transportată. Cu cât mărești această valoare, cu atât mai puțină marfă se livrează spre destinațiile îndepărtate si cu atât mai multă la cele mai apropiate. @@ -2324,6 +2330,7 @@ STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Numele serverul STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Vizibilitate STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Dacă alți oameni îți pot vedea serverul în lista publică STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Cod de invitație +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Cod de invitație cu care pot intra pe server alți jucători STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Tipul conexiunii STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Dacă și cum poate fi găsit serverul tău de alții STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Jucător @@ -2334,12 +2341,14 @@ STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Numele tău în STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Acțiuni administrative de efectuat pentru acest client STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Acțiuni administrative de efectuat pentru această companie STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Intră în această companie +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Trimite un mesaj acestui jucător STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Trimite un mesaj tuturor jucătorilor acestei companii STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Trimite un mesaj tuturor spectatorilor STR_NETWORK_CLIENT_LIST_SPECTATORS :Spectatori STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Companie nouă) STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Creează o nouă companie și intră în ea STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Aici ești tu +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Aceasta este gazda jocului STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P client clienți "de clienți"} / {NUM}{P companie companii "de companii"} # Matches ConnectionType @@ -2898,7 +2907,7 @@ STR_LAND_AREA_INFORMATION_ROAD_OWNER :{BLACK}Propriet STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Proprietar al şinei de tramvai: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Proprietar al căii ferate: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Autoritatea locală: {LTBLUE}{STRING} -STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nici una +STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Niciuna STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordonate: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING}) STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Data construcţiei: {LTBLUE}{DATE_LONG} STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Clasa staţiei: {LTBLUE}{STRING} @@ -3040,6 +3049,7 @@ STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Decala STR_FRAMERATE_DRAWING :{BLACK}Randare grafică: STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Vizoare globale: STR_FRAMERATE_VIDEO :{BLACK}Ieșire video: +STR_FRAMERATE_SOUND :{BLACK}Mixaj de sunet: STR_FRAMERATE_ALLSCRIPTS :{BLACK} Total GS/AI: STR_FRAMERATE_GAMESCRIPT :{BLACK} Script joc: STR_FRAMERATE_AI :{BLACK} IA {NUM} {STRING} @@ -3096,6 +3106,8 @@ STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Nr. de o STR_MAPGEN_DATE :{BLACK}Data: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Nr. de industrii: STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Cel mai înalt vârf: +STR_MAPGEN_HEIGHTMAP_HEIGHT_UP :{BLACK}Crește cu o unitate înălțimea maximă a celui mai înalt vârf al hărții +STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN :{BLACK}Redu cu o unitate înălțimea maximă a celui mai înalt vârf al hărții STR_MAPGEN_SNOW_COVERAGE :{BLACK}Acoperire cu zăpadă: STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}Mărește acoperirea cu zăpadă cu zece procente STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}Reduce acoperirea cu zăpadă cu zece procente @@ -3314,6 +3326,7 @@ STR_NEWGRF_LIST_MISSING :{RED}Fişiere l STR_NEWGRF_BROKEN :{WHITE}Comportamentul NewGRF '{0:STRING}' poate cauza desincronizări şi/sau blocări STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}A modificat starea trenului pentru '{1:ENGINE}' când nu se afla în depou STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}A modificat lungimea vehiculului pentru '{1:ENGINE}' când nu se afla în depou +STR_NEWGRF_BROKEN_CAPACITY :{WHITE}A modificat capacitatea vehiculului pentru '{1:ENGINE}' când nu a fost într-un depou sau în timpul conversiei STR_BROKEN_VEHICLE_LENGTH :{WHITE}Trenul '{VEHICLE}', aparţinând '{COMPANY}' nu are o lungime validă. Probabil este o problemă cu fişierele NewGRF. Jocul s-ar putea desincroniza sau bloca STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:STRING}' produce informaţii incorecte @@ -3495,7 +3508,7 @@ STR_STATION_VIEW_CAPTION :{WHITE}{STATION STR_STATION_VIEW_WAITING_CARGO :{WHITE}{CARGO_LONG} STR_STATION_VIEW_RESERVED :{YELLOW}({CARGO_SHORT} rezervat pentru încărcare) -STR_STATION_VIEW_ACCEPTS_BUTTON :{BLACK}Acceptă +STR_STATION_VIEW_ACCEPTS_BUTTON :{BLACK}Ce acceptă STR_STATION_VIEW_ACCEPTS_TOOLTIP :{BLACK}Afişează lista de încărcături acceptate STR_STATION_VIEW_ACCEPTS_CARGO :{BLACK}Acceptă: {WHITE}{CARGO_LIST} @@ -3936,9 +3949,9 @@ STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Acest bu STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Acest buton va crea o copie a aeronavei. Apasă acest buton, apoi fă clic pe o aeronavă din interiorul sau exteriorul hangarului. Ctrl+clic va sincroniza comenzile. Shift+clic arată costul estimativ fără a efectua achiziția ###length VEHICLE_TYPES -STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia depoului. Ctrl+Click deshide o fereastra cu locaţia depoului -STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia acestei autobaze. Ctrl+Click deshide o fereastra cu locaţia autobazei -STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locaţia şantierului. Ctrl+Click deshide o fereastra cu locaţia şantierului +STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Centrează vizorul principal pe locația depoului. Ctrl+clic deschide un vizor cu locația depoului +STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Centrează vizorul principal pe locația autobazei. Ctrl+clic deschide un vizor cu locația autobazei +STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Centrează vizorul principal pe locația șantierului. Ctrl+clic deschide un vizor cu locația șantierului STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Centrează vizorul principal pe locația hangarului. Ctrl+clic deschide un vizor nou cu locația hangarului ###length VEHICLE_TYPES @@ -4042,7 +4055,8 @@ STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația trenului. Dublu-clic va urmări trenul în vizorul principal. Ctrl+clic deschide un nou vizor cu locație trenului STR_VEHICLE_VIEW_ROAD_VEHICLE_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația vehiculului. Dublu-clic va urmări vehiculul în vizorul principal. Ctrl+clic deschide un nou vizor cu locația vehiculului -STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Centrează imaginea pe locația navei. Dublu clic va urmări nava în vizorul principal. Ctrl+Clic deschide un nou vizor pe locația navei +STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația navei. Dublu-clic va urmări nava în vizorul principal. Ctrl+clic deschide un nou vizor pe locația navei +STR_VEHICLE_VIEW_AIRCRAFT_CENTER_TOOLTIP :{BLACK}Centrează vizorul principal pe locația aeronavei. Dublu-clic va urmări aeronava în vizorul principal. Ctrl+clic deschide un nou vizor cu locația aeronavei ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_SEND_TO_DEPOT_TOOLTIP :{BLACK}Trimite trenul într-un depou @@ -4192,7 +4206,7 @@ STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}Capacita STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}Capacitate nouă: {GOLD}{CARGO_LONG}{}{BLACK}Venituri din schimbare: {GREEN}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}Capacitate nouă: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Costul schimbării: {RED}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}Capacitate nouă: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Venituri din schimbare: {GREEN}{CURRENCY_LONG} -STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Selectează vehiculele pentru modificare. Trage cu mouse-ul pentru a selecta mai multe vehicule. Click pe spațiu gol pentru a selecta intregul vehicul. Ctrl+Click va selecta un vehicul si lanțul atașat +STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Alege vehiculele pentru conversie. Tragerea mausului permite selectarea mai multor vehicule. Clicul pe un spațiu gol va selecta întregul vehicul. Ctrl+clic va selecta un vehicul și lanțul atașat ###length VEHICLE_TYPES STR_REFIT_TRAIN_LIST_TOOLTIP :{BLACK}Alege tipul de marfă transportat de tren @@ -4230,24 +4244,24 @@ STR_ORDER_GO_TO :Du-te la STR_ORDER_GO_NON_STOP_TO :Du-te fără oprire la STR_ORDER_GO_VIA :Du-te prin STR_ORDER_GO_NON_STOP_VIA :Du-te fără oprire prin -STR_ORDER_TOOLTIP_NON_STOP :{BLACK}Schimbă comportamentul de oprire pentru ordinul selectat +STR_ORDER_TOOLTIP_NON_STOP :{BLACK}Schimbă comportamentul de oprire al comenzii selectate STR_ORDER_TOGGLE_FULL_LOAD :{BLACK}Încarcă orice produs STR_ORDER_DROP_LOAD_IF_POSSIBLE :Încarcă dacă este disponibil STR_ORDER_DROP_FULL_LOAD_ALL :Încarcă toate produsele STR_ORDER_DROP_FULL_LOAD_ANY :Încarcă orice produs STR_ORDER_DROP_NO_LOADING :Nu încărca -STR_ORDER_TOOLTIP_FULL_LOAD :{BLACK}Schimbă comportamentul de încărcare pentru ordinul selectat +STR_ORDER_TOOLTIP_FULL_LOAD :{BLACK}Schimbă comportamentul de încărcare al comenzii selectate STR_ORDER_TOGGLE_UNLOAD :{BLACK}Descarcă tot STR_ORDER_DROP_UNLOAD_IF_ACCEPTED :Descarcă dacă este acceptat STR_ORDER_DROP_UNLOAD :Descarcă tot STR_ORDER_DROP_TRANSFER :Transferă STR_ORDER_DROP_NO_UNLOADING :Nu descărca -STR_ORDER_TOOLTIP_UNLOAD :{BLACK}Schimbă comportamentul de descărcare pentru ordinul selectat +STR_ORDER_TOOLTIP_UNLOAD :{BLACK}Schimbă comportamentul de descărcare al comenzii selectate STR_ORDER_REFIT :{BLACK}Rearanjeaza -STR_ORDER_REFIT_TOOLTIP :{BLACK}Alege tipul de marfă pentru rearanjarea în comandă. Ctrl+clic pentru a anula rearanjarea +STR_ORDER_REFIT_TOOLTIP :{BLACK}Alege marfă țintă pentru conversie în această comandă. Ctrl+clic pentru a anula instrucțiunea de conversie STR_ORDER_REFIT_AUTO :{BLACK}Auto-modificare STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Selectează marfa țintă pentru conversie în această comandă. Ctrl+clic pentru a elimina instrucțiunea de conversie. Conversia din stații va fi efectuată doar dacă vehiculul permite asta. STR_ORDER_DROP_REFIT_AUTO :Tip încărcătură nemodificabil @@ -4290,7 +4304,7 @@ STR_ORDERS_SKIP_BUTTON :{BLACK}Treci la STR_ORDERS_SKIP_TOOLTIP :{BLACK}Sari peste comanda actuală și preia-o pe următoarea. Ctrl+clic sare la comanda selectată STR_ORDERS_DELETE_BUTTON :{BLACK}Şterge -STR_ORDERS_DELETE_TOOLTIP :{BLACK}Şterge comanda selectată +STR_ORDERS_DELETE_TOOLTIP :{BLACK}Șterge comanda selectată STR_ORDERS_DELETE_ALL_TOOLTIP :{BLACK}Șterge toate comenzile STR_ORDERS_STOP_SHARING_BUTTON :{BLACK}Opreşte sincronizarea STR_ORDERS_STOP_SHARING_TOOLTIP :{BLACK}Oprește sincronizarea comenzilor. Ctrl-clic șterge toate comenzile acestui vehicul @@ -4386,19 +4400,19 @@ STR_TIMETABLE_NO_TRAVEL :NU este calator STR_TIMETABLE_NOT_TIMETABLEABLE :Călătorie (automat; programată după următoarea comandă manuală) STR_TIMETABLE_TRAVEL_NOT_TIMETABLED :Calatorie (fara orar) STR_TIMETABLE_TRAVEL_NOT_TIMETABLED_SPEED :Călătoriți (neplanificat) cu maxim {2:VELOCITY} -STR_TIMETABLE_TRAVEL_FOR :Calatorii pentru {STRING} +STR_TIMETABLE_TRAVEL_FOR :Călătorii pentru {STRING} STR_TIMETABLE_TRAVEL_FOR_SPEED :Mergi către {STRING} cu maxim {VELOCITY} STR_TIMETABLE_TRAVEL_FOR_ESTIMATED :Călătorie (pentru {STRING}, neplanificată) STR_TIMETABLE_TRAVEL_FOR_SPEED_ESTIMATED :Călătoriți (pentru {STRING}, neprogramat) cu cel mult {VELOCITY} STR_TIMETABLE_STAY_FOR_ESTIMATED :(staționare pentru {STRING}, neprogramată) STR_TIMETABLE_AND_TRAVEL_FOR_ESTIMATED :(călătorie pentru {STRING}, neprogramată) STR_TIMETABLE_STAY_FOR :și staționare pentru {STRING} -STR_TIMETABLE_AND_TRAVEL_FOR :şi călătoreşte pentru {STRING} +STR_TIMETABLE_AND_TRAVEL_FOR :și călătorește timp de {STRING} STR_TIMETABLE_DAYS :{COMMA}{NBSP}{P zi zile "de zile"} STR_TIMETABLE_TICKS :{COMMA}{NBSP}{P unitate unități "de unități"} de timp intern{P ă e e} STR_TIMETABLE_TOTAL_TIME :{BLACK}Acest orar va lua {STRING} pentru finalizare -STR_TIMETABLE_TOTAL_TIME_INCOMPLETE :{BLACK}Acest orar va lua cel putin {STRING} pentru finalizare (nu in intregime programat) +STR_TIMETABLE_TOTAL_TIME_INCOMPLETE :{BLACK}Acest orar va lua cel puțin {STRING} pentru finalizare (nu în întregime programat) STR_TIMETABLE_STATUS_ON_TIME :{BLACK}Acest vehicul se încadrează în timp STR_TIMETABLE_STATUS_LATE :{BLACK}Vehiculul are întârziere de {STRING} @@ -4407,18 +4421,19 @@ STR_TIMETABLE_STATUS_NOT_STARTED :{BLACK}Acest or STR_TIMETABLE_STATUS_START_AT :{BLACK}Acest orar va începe la {STRING} STR_TIMETABLE_STARTING_DATE :{BLACK}Dată pornire +STR_TIMETABLE_STARTING_DATE_TOOLTIP :{BLACK}Alege o dată ca punct de pornire pentru acest orar. Ctrl+clic setează punctul de pornire al acestui orar și distribuie uniform comanda tuturor vehiculelor în cu comenzi similare, dacă comenzile au un orar complet STR_TIMETABLE_CHANGE_TIME :{BLACK}Modifică timpul -STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Modifică durata de timp alocată pentru comanda selectată +STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Modifică durata de timp alocată comenzii selectate STR_TIMETABLE_CLEAR_TIME :{BLACK}Curata timp STR_TIMETABLE_CLEAR_TIME_TOOLTIP :{BLACK}Elimină durata de timp pentru comanda selectată STR_TIMETABLE_CHANGE_SPEED :{BLACK}Schimbă limita de viteză -STR_TIMETABLE_CHANGE_SPEED_TOOLTIP :{BLACK}Schimbă limita maximă de viteză a ordinului selectat +STR_TIMETABLE_CHANGE_SPEED_TOOLTIP :{BLACK}Schimbă limita maximă de viteză a comenzii selectate STR_TIMETABLE_CLEAR_SPEED :{BLACK}Şterge limita de viteză -STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Şterge limita maximă de viteză a ordinului selectat +STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Șterge limita maximă de viteză a comenzii selectate STR_TIMETABLE_RESET_LATENESS :{BLACK}Reinitializeaza contorul de intarziere STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Reiniţializează contorul de întârziere, astfel ca vehiculul să ajungă la timp From a53cfeef131fab66dc4a2395279b64706c5afed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sat, 2 Oct 2021 21:08:42 +0200 Subject: [PATCH 016/710] Fix #9548, e5fedcd: [Squirrel] Crash during engine cleanup after reaching memory limit on realloc (#9592) --- src/script/squirrel.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 8d2aa3b783..2485ed791a 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -69,19 +69,16 @@ struct ScriptAllocator { */ void CheckAllocation(size_t requested_size, void *p) { - if (this->allocated_size > this->allocation_limit && !this->error_thrown) { + if (this->allocated_size + requested_size > this->allocation_limit && !this->error_thrown) { /* Do not allow allocating more than the allocation limit, except when an error is * already as then the allocation is for throwing that error in Squirrel, the * associated stack trace information and while cleaning up the AI. */ this->error_thrown = true; char buff[128]; seprintf(buff, lastof(buff), "Maximum memory allocation exceeded by " PRINTF_SIZE " bytes when allocating " PRINTF_SIZE " bytes", - this->allocated_size - this->allocation_limit, requested_size); + this->allocated_size + requested_size - this->allocation_limit, requested_size); /* Don't leak the rejected allocation. */ free(p); - p = nullptr; - /* Allocation rejected, don't count it. */ - this->allocated_size -= requested_size; throw Script_FatalError(buff); } @@ -98,8 +95,6 @@ struct ScriptAllocator { this->error_thrown = true; char buff[64]; seprintf(buff, lastof(buff), "Out of memory. Cannot allocate " PRINTF_SIZE " bytes", requested_size); - /* Allocation failed, don't count it. */ - this->allocated_size -= requested_size; throw Script_FatalError(buff); } } @@ -107,10 +102,11 @@ struct ScriptAllocator { void *Malloc(SQUnsignedInteger size) { void *p = malloc(size); - this->allocated_size += size; this->CheckAllocation(size, p); + this->allocated_size += size; + #ifdef SCRIPT_DEBUG_ALLOCATIONS assert(p != nullptr); assert(this->allocations.find(p) == this->allocations.end()); @@ -134,14 +130,21 @@ struct ScriptAllocator { assert(this->allocations[p] == oldsize); this->allocations.erase(p); #endif + /* Can't use realloc directly because memory limit check. + * If memory exception is thrown, the old pointer is expected + * to be valid for engine cleanup. + */ + void *new_p = malloc(size); - void *new_p = realloc(p, size); + this->CheckAllocation(size - oldsize, new_p); + + /* Memory limit test passed, we can copy data and free old pointer. */ + memcpy(new_p, p, std::min(oldsize, size)); + free(p); this->allocated_size -= oldsize; this->allocated_size += size; - this->CheckAllocation(size, p); - #ifdef SCRIPT_DEBUG_ALLOCATIONS assert(new_p != nullptr); assert(this->allocations.find(p) == this->allocations.end()); From 2144cd98a34efd7b47156d6f43ee5de7d6216d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sun, 3 Oct 2021 10:49:03 +0200 Subject: [PATCH 017/710] Fix: Incorrect Romanian own name (#9598) --- src/lang/romanian.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 2f06daa600..e230d6de8e 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1,5 +1,5 @@ ##name Romanian -##ownname Românӑ +##ownname Română ##isocode ro_RO ##plural 14 ##textdir ltr From e4ad6329891c9235336649ef4412b2ce0a073af8 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 3 Oct 2021 11:02:28 +0200 Subject: [PATCH 018/710] Add: [Network] Keep the refresh button in lowered state while refreshing (#9600) This gives user visual feedback that the refresh is still pending, and prevents people from clicking again and again thinking nothing is happening. This is especially true for connections that fall back to TURN, as that takes a few seconds to kick in. Additionally, prevent clicking on the button again while a refresh is pending. This is only delaying a successful result. --- src/network/network.cpp | 5 +++++ src/network/network_gamelist.h | 2 +- src/network/network_gui.cpp | 4 +++- src/network/network_query.cpp | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/network/network.cpp b/src/network/network.cpp index 09b748fc50..109a2cce70 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -635,6 +635,7 @@ public: { NetworkGameList *item = NetworkGameListAddItem(connection_string); item->status = NGLS_OFFLINE; + item->refreshing = false; UpdateNetworkGameWindow(); } @@ -653,6 +654,10 @@ void NetworkQueryServer(const std::string &connection_string) { if (!_network_available) return; + /* Mark the entry as refreshing, so the GUI can show the refresh is pending. */ + NetworkGameList *item = NetworkGameListAddItem(connection_string); + item->refreshing = true; + new TCPQueryConnecter(connection_string); } diff --git a/src/network/network_gamelist.h b/src/network/network_gamelist.h index 24ce41bc8a..1c4a68e5c7 100644 --- a/src/network/network_gamelist.h +++ b/src/network/network_gamelist.h @@ -31,7 +31,7 @@ struct NetworkGameList { std::string connection_string; ///< Address of the server. NetworkGameListStatus status = NGLS_OFFLINE; ///< Stats of the server. bool manually = false; ///< True if the server was added manually. - uint8 retries = 0; ///< Number of retries (to stop requerying). + bool refreshing = false; ///< Whether this server is being queried. int version = 0; ///< Used to see which servers are no longer available on the Game Coordinator and can be removed. NetworkGameList *next = nullptr; ///< Next pointer to make a linked game list. }; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 03fd0ce5c8..6bca0c756c 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -613,6 +613,8 @@ public: sel->info.clients_on >= sel->info.clients_max || // Server full !sel->info.compatible); // Revision mismatch + this->SetWidgetLoweredState(WID_NG_REFRESH, sel != nullptr && sel->refreshing); + /* 'NewGRF Settings' button invisible if no NewGRF is used */ this->GetWidget(WID_NG_NEWGRF_SEL)->SetDisplayedPlane(sel == nullptr || sel->status != NGLS_ONLINE || sel->info.grfconfig == nullptr); this->GetWidget(WID_NG_NEWGRF_MISSING_SEL)->SetDisplayedPlane(sel == nullptr || sel->status != NGLS_ONLINE || sel->info.grfconfig == nullptr || !sel->info.version_compatible || sel->info.compatible); @@ -790,7 +792,7 @@ public: break; case WID_NG_REFRESH: // Refresh - if (this->server != nullptr) NetworkQueryServer(this->server->connection_string); + if (this->server != nullptr && !this->server->refreshing) NetworkQueryServer(this->server->connection_string); break; case WID_NG_NEWGRF: // NewGRF Settings diff --git a/src/network/network_query.cpp b/src/network/network_query.cpp index 033c32e7c9..139daafe45 100644 --- a/src/network/network_query.cpp +++ b/src/network/network_query.cpp @@ -79,6 +79,7 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_FULL(Packet *p) { NetworkGameList *item = NetworkGameListAddItem(this->connection_string); item->status = NGLS_FULL; + item->refreshing = false; UpdateNetworkGameWindow(); @@ -89,6 +90,7 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_BANNED(Packet *p { NetworkGameList *item = NetworkGameListAddItem(this->connection_string); item->status = NGLS_BANNED; + item->refreshing = false; UpdateNetworkGameWindow(); @@ -107,6 +109,7 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_GAME_INFO(Packet CheckGameCompatibility(item->info); /* Ensure we consider the server online. */ item->status = NGLS_ONLINE; + item->refreshing = false; UpdateNetworkGameWindow(); @@ -128,6 +131,7 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_ERROR(Packet *p) } else { item->status = NGLS_OFFLINE; } + item->refreshing = false; UpdateNetworkGameWindow(); From e404d16929991d1eddd9d37b859d3813be7e18ed Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Sun, 3 Oct 2021 11:54:19 +0100 Subject: [PATCH 019/710] Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594) --- src/object_cmd.cpp | 3 +++ src/saveload/afterload.cpp | 4 ++-- src/saveload/saveload.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 14645f93de..cd080ca538 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -32,6 +32,7 @@ #include "date_func.h" #include "newgrf_debug.h" #include "vehicle_func.h" +#include "station_func.h" #include "table/strings.h" #include "table/object_land.h" @@ -121,7 +122,9 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u Company::Get(owner)->infrastructure.water++; DirtyCompanyInfrastructureWindows(owner); } + bool remove = IsDockingTile(t); MakeObject(t, owner, o->index, wc, Random()); + if (remove) RemoveDockingTile(t); MarkTileDirtyByTile(t); } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 02a221bb60..6a42ea81c6 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3106,8 +3106,8 @@ bool AfterLoadGame() } } - if (IsSavegameVersionBefore(SLV_DOCK_DOCKINGTILES)) { - /* All tiles around docks may be docking tiles. */ + if (IsSavegameVersionBefore(SLV_REPAIR_OBJECT_DOCKING_TILES)) { + /* Placing objects on docking tiles was not updating adjacent station's docking tiles. */ for (Station *st : Station::Iterate()) { if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st); } diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index 382d77f1a5..0d4e0fb984 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -338,7 +338,8 @@ enum SaveLoadVersion : uint16 { SLV_TABLE_CHUNKS, ///< 295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE. SLV_SCRIPT_INT64, ///< 296 PR#9415 SQInteger is 64bit but was saved as 32bit. SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 v12.0-RC1 Store travel time in the linkgraph. - SLV_DOCK_DOCKINGTILES, ///< 298 PR#9578 v12.0 All tiles around docks may be docking tiles. + SLV_DOCK_DOCKINGTILES, ///< 298 PR#9578 All tiles around docks may be docking tiles. + SLV_REPAIR_OBJECT_DOCKING_TILES, ///< 299 PR#9594 v12.0 Fixing issue with docking tiles overlapping objects. SL_MAX_VERSION, ///< Highest possible saveload version }; From 3046a6ce39d755f50207a2c4a1235069a0eb23fb Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 3 Oct 2021 16:20:05 +0200 Subject: [PATCH 020/710] Change: upgrade Emscripten to 2.0.31 and enable LZMA by default (#9604) --- .github/workflows/ci-build.yml | 9 +++-- .github/workflows/preview_build.yml | 9 +++-- CMakeLists.txt | 2 +- os/emscripten/Dockerfile | 2 +- os/emscripten/README.md | 2 +- os/emscripten/emsdk-liblzma.patch | 55 ++++++++++++----------------- 6 files changed, 40 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 3f05869e05..952e860e4a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-20.04 container: # If you change this version, change the number in the cache step too. - image: emscripten/emsdk:2.0.10 + image: emscripten/emsdk:2.0.31 steps: - name: Checkout @@ -26,7 +26,12 @@ jobs: uses: actions/cache@v2 with: path: /emsdk/upstream/emscripten/cache - key: 2.0.10-${{ runner.os }} + key: 2.0.31-${{ runner.os }} + + - name: Patch Emscripten to support LZMA + run: | + cd /emsdk/upstream/emscripten + patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch - name: Build (host tools) run: | diff --git a/.github/workflows/preview_build.yml b/.github/workflows/preview_build.yml index 9aea890bce..ad254a4939 100644 --- a/.github/workflows/preview_build.yml +++ b/.github/workflows/preview_build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-20.04 container: # If you change this version, change the number in the cache step too. - image: emscripten/emsdk:2.0.10 + image: emscripten/emsdk:2.0.31 # uid=1001(runner) gid=121(docker) options: -u 1001:121 @@ -46,7 +46,12 @@ jobs: uses: actions/cache@v2 with: path: /emsdk/upstream/emscripten/cache - key: 2.0.10-${{ runner.os }} + key: 2.0.31-${{ runner.os }} + + - name: Patch Emscripten to support LZMA + run: | + cd /emsdk/upstream/emscripten + patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch - name: Build (host tools) run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dc733777d..f4e08daf4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,7 +305,7 @@ if(EMSCRIPTEN) add_definitions(-s DISABLE_EXCEPTION_CATCHING=0) # Export functions to Javascript. - target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'") + target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'") # Preload all the files we generate during build. # As we do not compile with FreeType / FontConfig, we also have no way to diff --git a/os/emscripten/Dockerfile b/os/emscripten/Dockerfile index 5184af6432..cbbff38c15 100644 --- a/os/emscripten/Dockerfile +++ b/os/emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM emscripten/emsdk:2.0.10 +FROM emscripten/emsdk:2.0.31 COPY emsdk-liblzma.patch / RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch diff --git a/os/emscripten/README.md b/os/emscripten/README.md index 4c5d7508cc..59f17c6269 100644 --- a/os/emscripten/README.md +++ b/os/emscripten/README.md @@ -1,6 +1,6 @@ ## How to build with Emscripten -Building with Emscripten works with emsdk 2.0.10 and above. +Building with Emscripten works with emsdk 2.0.31 and above. Currently there is no LibLZMA support upstream; for this we suggest to apply the provided patch in this folder to your emsdk installation. diff --git a/os/emscripten/emsdk-liblzma.patch b/os/emscripten/emsdk-liblzma.patch index 103adae0cc..aa75fa5a49 100644 --- a/os/emscripten/emsdk-liblzma.patch +++ b/os/emscripten/emsdk-liblzma.patch @@ -10,44 +10,35 @@ Modifed by OpenTTD to have the bare minimum needed to work. Otherwise there are constantly conflicts when trying to apply this patch to different versions of emsdk. -diff --git a/embuilder.py b/embuilder.py -index 818262190ed..ab7d5adb7b2 100755 ---- a/embuilder.py -+++ b/embuilder.py -@@ -60,6 +60,7 @@ - 'harfbuzz', - 'icu', - 'libjpeg', -+ 'liblzma', - 'libpng', - 'ogg', - 'regal', -@@ -197,6 +198,8 @@ def main(): - build_port('ogg', libname('libogg')) - elif what == 'libjpeg': - build_port('libjpeg', libname('libjpeg')) -+ elif what == 'liblzma': -+ build_port('liblzma', libname('liblzma')) - elif what == 'libpng': - build_port('libpng', libname('libpng')) - elif what == 'sdl2': +diff --git a/tools/settings.py b/tools/settings.py +--- a/tools/settings.py ++++ b/tools/settings.py +@@ -38,6 +38,7 @@ + 'USE_SDL_NET', + 'USE_SDL_GFX', + 'USE_LIBJPEG', ++ 'USE_LIBLZMA', + 'USE_OGG', + 'USE_REGAL', + 'USE_BOOST_HEADERS', diff --git a/src/settings.js b/src/settings.js -index 61cd98939ba..be6fcb678c6 100644 --- a/src/settings.js +++ b/src/settings.js -@@ -1197,6 +1197,9 @@ var USE_BZIP2 = 0; +@@ -1382,8 +1382,12 @@ var USE_BZIP2 = 0; // 1 = use libjpeg from emscripten-ports + // [link] var USE_LIBJPEG = 0; +// 1 = use liblzma from emscripten-ports ++// [link] +var USE_LIBLZMA = 0; + // 1 = use libpng from emscripten-ports + // [link] var USE_LIBPNG = 0; diff --git a/tools/ports/liblzma.py b/tools/ports/liblzma.py new file mode 100644 -index 00000000000..e9567ef36ff --- /dev/null +++ b/tools/ports/liblzma.py @@ -0,0 +1,160 @@ @@ -58,6 +49,8 @@ index 00000000000..e9567ef36ff + +import os +import shutil ++import logging ++from pathlib import Path + +VERSION = '5.2.5' +HASH = '7443674247deda2935220fbc4dfc7665e5bb5a260be8ad858c8bd7d7b9f0f868f04ea45e62eb17c0a5e6a2de7c7500ad2d201e2d668c48ca29bd9eea5a73a3ce' @@ -68,10 +61,11 @@ index 00000000000..e9567ef36ff + + +def get(ports, settings, shared): -+ libname = ports.get_lib_name('liblzma') + ports.fetch_project('liblzma', 'https://tukaani.org/xz/xz-' + VERSION + '.tar.gz', 'xz-' + VERSION, sha512hash=HASH) + -+ def create(): ++ def create(final): ++ logging.info('building port: liblzma') ++ + ports.clear_project_build('liblzma') + + source_path = os.path.join(ports.get_dir(), 'liblzma', 'xz-' + VERSION) @@ -88,22 +82,19 @@ index 00000000000..e9567ef36ff + 'tuklib_exit.c', 'tuklib_mbstr_fw.c', 'tuklib_mbstr_width.c', 'tuklib_open_stdxxx.c', 'tuklib_progname.c'] + include_dirs_rel = ['../common', 'api', 'common', 'check', 'lz', 'rangecoder', 'lzma', 'delta', 'simple'] + -+ open(os.path.join(dest_path, 'src', 'config.h'), 'w').write(config_h) ++ Path(dest_path, os.path.join('src', 'config.h')).write_text(config_h) + -+ final = os.path.join(dest_path, libname) + include_dirs = [os.path.join(dest_path, 'src', 'liblzma', p) for p in include_dirs_rel] + ports.build_port(os.path.join(dest_path, 'src'), final, flags=build_flags, exclude_dirs=exclude_dirs, exclude_files=exclude_files, includes=include_dirs) + + ports.install_headers(os.path.join(dest_path, 'src', 'liblzma', 'api'), 'lzma.h') + ports.install_headers(os.path.join(dest_path, 'src', 'liblzma', 'api', 'lzma'), '*.h', 'lzma') + -+ return final -+ -+ return [shared.Cache.get(libname, create, what='port')] ++ return [shared.Cache.get_lib('liblzma.a', create, what='port')] + + +def clear(ports, settings, shared): -+ shared.Cache.erase_file(ports.get_lib_name('liblzma')) ++ shared.Cache.erase_lib('liblzma.a') + + +def process_args(ports): From 340a36bf1f1f442c597fbb9b290d182d89c5d617 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 3 Oct 2021 18:46:14 +0000 Subject: [PATCH 021/710] Update: Translations from eints romanian: 8 changes by kneekoo irish: 55 changes by temuchie --- src/lang/irish.txt | 55 +++++++++++++++++++++++++++++++++++++++++++ src/lang/romanian.txt | 14 ++++++----- 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 961d87cf9f..f868578e63 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -235,6 +235,7 @@ STR_TOOLTIP_SORT_CRITERIA :{BLACK}Roghnaig STR_TOOLTIP_FILTER_CRITERIA :{BLACK}Roghnaigh critéir scagtha STR_BUTTON_SORT_BY :{BLACK}Sórtáil de réir STR_BUTTON_CATCHMENT :{BLACK}Clúdach +STR_TOOLTIP_CATCHMENT :{BLACK}Scoránaigh taispeáint an limistéir chlúdaigh STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Dún an fhuinneog STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Teideal fuinneoige - tarraing é seo chun fuinneog a bhogadh @@ -888,6 +889,7 @@ STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE :{BIG_FONT}{BLAC STR_NEWS_NEW_VEHICLE_TYPE :{BIG_FONT}{BLACK}{ENGINE} STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE :{BLACK}Tá {STRING} nua ar fáil anois! - {ENGINE} +STR_NEWS_SHOW_VEHICLE_GROUP_TOOLTIP :{BLACK}Oscail fuinneog an ghrúpa atá dírithe ar ghrúpa na feithicle STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO :{WHITE}Ní ghlacann {STATION} le {STRING} a thuilleadh STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO_OR_CARGO :{WHITE}Ní ghlacann {STATION} le {STRING} ná le {STRING} a thuilleadh @@ -1147,6 +1149,7 @@ STR_TERRAIN_TYPE_HILLY :Cnocach STR_TERRAIN_TYPE_MOUNTAINOUS :Sléibhtiúil STR_TERRAIN_TYPE_ALPINIST :Ailpíneach STR_TERRAIN_TYPE_CUSTOM :Airde shaincheaptha +STR_TERRAIN_TYPE_CUSTOM_VALUE :Airde shaincheaptha ({NUM}) ###length 3 STR_CITY_APPROVAL_PERMISSIVE :Tugtar cead @@ -1170,6 +1173,7 @@ STR_CONFIG_SETTING_TYPE_GAME_INGAME :Socrú cluiche STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Socrú cuideachta (stóráilte i gcluiche sábháilte; tionchar ar chluichí nua amháin) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Socrú cuideachta (stóráilte i gcluiche sábháilte; tionchar ar an gcuideachta reatha amháin) STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Rabhadh! +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Leis an mbeart seo athshocrófar gach socrú cluiche chuig a réamhshocrú.{}An bhfuil tú cinnte gur mhaith leat leanúint ar aghaidh? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Catagóir: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Cineál: @@ -1255,6 +1259,7 @@ STR_CONFIG_SETTING_CITY_APPROVAL :Dearcadh chomha STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Roghnaigh a mhéid a mbeidh tionchar ag torann agus damáiste don chomhshaol a dhéanann cuideachtaí ar a rátáil sa bhaile agus ar imeachtaí tógála eile sa cheantar STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :Teorainn uasta na léarscáile: {STRING} +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT :Socraigh airde uasta tír-raon na léarscáile. Le "(uathoibríoch)" roghnófar luach maith tar éis an tír-raon a bheith cruthaithe STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_AUTO :(uath-theorainn) @@ -1266,6 +1271,8 @@ STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Ceadaigh tírdh STR_CONFIG_SETTING_CATCHMENT :Ceadaigh ceantair stáisiún ar mhéid níos realaíoch: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Bíodh an ceantar máguaird a bhaineann le cineálacha éagsúla stáisiún agus aerfort ar mhéideanna éagsúla +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Is féidir le stáisiúin cuideachtaí freastal ar thionscail a bhfuil stáisiúin neodracha ceangailte díobh: {STRING} +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Má tá seo cumasaithe, is féidir freastal ar thionscail a bhufil stáisiúin ceangailte díobh (Rigí Ola, mar shampla) le stáisiúin atá i seilbh cuideachtaí a thógtar in aice láimhe. Má tá seo díchumasaithe, ní féidir freastal orthu ach leis na stáisiúin atá ceangailte díobh. Ní bheidh aon stáisiúin atá ag cuideachtaí in aice láimhe a bheith in ann freastal orthu, ná ní bheidh an stáisiún ceangailte ag freastal ar aon rud eile seachas an tionscal STR_CONFIG_SETTING_EXTRADYNAMITE :Ceadaigh tuilleadh bóithre, droichid agus tolláin ar le baile iad a bhaint: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Fág go mbeidh sé níos éasca bonneagar agus foirgnimh ar le bailte iad a bhaint @@ -1388,6 +1395,7 @@ STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Cothabháil bon STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Má tá sé cumasaithe, bíonn costais chothabhála ar bhonneagar. Méadaíonn an costas níos tapúla ná méid an líonra, rad a fhágann go mbíonn tionchar níos mó aige ar chuideachtaí móra ná ar chuideachtaí beaga STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Dath tosaigh na cuideachta: {STRING} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Roghnaigh dath tosaigh don chuideachta STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Ní imíonn aerfoirt as dáta riamh: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Má dhéantar an socrú seo a chumasú beidh gach cineál aerfoirt ar fáil go deo tar éis é a thabhairt isteach @@ -1437,6 +1445,7 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Tiús na línte STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Leithead na líne sna graif. Is féidir líne thanaí a léamh go beacht, agus tá líne níos tiubhe níos éasca le feiceáil agus tá sé níos éasca na dathanna a idirdhealú óna gcéile STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Taispeáin ainm an NewGRF i bhfuinneog tógála na bhfeithiclí: {STRING} +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Cuir líne nua leis an bhfuinneog "Tóg feithiclí", ina dtaispeánfar cén NewGRF as a dtagann an fheithicil roghnaithe. STR_CONFIG_SETTING_LANDSCAPE :Tírdhreach: {STRING} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Sonraíonn na tírdhreacha an cúlra bunúsach don imirt, le lastais éagsúla agus riachtanais éagsúla d'fhás na mbailte. Is féidir é sin a mhionathrú tuilleadh le NewGRFanna agus Scripteanna Cluiche mar sin féin @@ -1462,6 +1471,7 @@ STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Rialaigh an lei STR_CONFIG_SETTING_SNOW_COVERAGE :Clúdach sneachta: {STRING} STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% +STR_CONFIG_SETTING_DESERT_COVERAGE :Clúdach an fhásaigh: {STRING} STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Chomh garbh agus atá an tír-raon: {STRING} @@ -1557,6 +1567,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Cliceáil amhá STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Cliceáil amháin (láithreach) STR_CONFIG_SETTING_USE_RELAY_SERVICE :Úsáid seirbhís athsheachadta: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Má theipeann ar chruthú an naisc leis an bhfreastalaí, is féidir seirbhís athsheachadadh a úsáid chun nasc a chruthú. Le "ná húsáid riamh" díchumasófar sin, le "iarr" iarrfar ort ar dtús, agus le "ceadaigh" ceadófar é gan iarraidh ort ###length 3 STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Ná húsáid riamh STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Iarr @@ -1626,6 +1637,7 @@ STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Sainigh an leag STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :Bain comharthaí go huathoibríoch agus iarnróid á dtógáil: {STRING} +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Teorainn luais le bogadh ar aghaidh go scioptha: {STRING} STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% de ghnáthluas an chluiche ###setting-zero-is-special STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Gan teorainn (chomh tapa agus a ligeann do ríomhaire duit é) @@ -1691,6 +1703,7 @@ STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :Ceadaigh do rí STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :tá #opcodes roimh scripteanna curtha ar fionraí: {STRING} STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES_HELPTEXT :Uaslíon na gcéimeanna ríofa is féidir le script a dhéanamh in aon chasadh amháin STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY :Úsáid uasta cuimhne in aghaidh na scripte: {STRING} +STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :An méid cuimhne is féidir le haon script amháin a ídiú sula gcuirfear stop leis d'éigean. Seans go mbeidh gá an luach seo a mhéadú i gcás léarscáileanna móra. STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :Eatraimh seirbhísithe i gcéatadán: {STRING} @@ -1779,10 +1792,13 @@ STR_CONFIG_SETTING_ECONOMY_TYPE :Cineál geillea ###length 3 STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Bunaidh STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Mín +STR_CONFIG_SETTING_ECONOMY_TYPE_FROZEN :Reoite STR_CONFIG_SETTING_ALLOW_SHARES :Ceadaigh scaireanna a cheannach ó chuideachtaí eile: {STRING} STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Má tá sé cumasaithe, tá cead scaireanna i gcuideachta a cheannach agus a dhíol. Ní bheidh scaireanna ar fáil ach do chuideachtaí a bhfuil aois áirithe bainte amach acu +STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES :Aois íosta na gcuideachtaí le bheith in ann scaireanna a thrádáil: {STRING} +STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Socraigh aois íosta na gcuideachtaí sula mbeidh daoine eile in ann scaireanna iontu a cheannach agus a dhíol. STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :An céatadán den bhrabús a íocfar ar chuid den turas i gcórais fhriothálacha: {STRING} STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :An céatadán den bhrabús a thugtar as lastais a thabhairt cuid den bhealach i gcórais fhriothálacha, rud a fhágann go bhfuil tuilleadh smachta agat ar an ioncam @@ -1873,6 +1889,8 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_2X :2x STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN :Taifeach is airde le húsáid le haghaidh spríteanna: {STRING} +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN_HELPTEXT :Cuir teorainn leis an taifeach uasta a úsáidfear le haghaidh spríteanna. Má chuirtear teorainn le taifeach na spríteanna ní úsáidfear grafaicí ard-taifigh fiú má bhíonn siad ar fáil. Is féidir leis sin cabhrú chun cuma aontaithe a bheith ar an gcluichle má bhíonn meascán de comhaid GRF a bhfuil agus nach bhfuil grafaicí ard-taifigh acu in úsáid. ###length 3 STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x @@ -2068,6 +2086,7 @@ STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Seiceái STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Taispeáin socruithe AI/Script cluiche STR_INTRO_TOOLTIP_QUIT :{BLACK}Téigh amach as 'OpenTTD' +STR_INTRO_BASESET :{BLACK}Tá {NUM} sprít in easnamh sa bhuntacar grafaicí. Seiceáil an bhfuil nuashonruithe ar fáil don bhuntacar. STR_INTRO_TRANSLATION :{BLACK}Tá {NUM} {P th th th dt t}eaghrán in easnamh san aistriúchán seo. Is féidir leat cabhrú chun OpenTTD a fheabhsú má chláraíonn tú mar aistritheoir. Féach léighmé.txt chun mionsonraí a fháil. # Quit window @@ -2201,6 +2220,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Athraigh ###length 3 STR_NETWORK_SERVER_VISIBILITY_LOCAL :Logánta STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Poiblí +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Le cuireadh amháin # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Ilimreoirí @@ -2308,6 +2328,7 @@ STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Imreoir STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Freastalaí STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Ainm STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}Ainm an fhreastalaí ar an bhfuil tú ag imirt +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Ainm d'fhreastalaí a chur in eagar STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Ainm an fhreastalaí STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Infheictheacht STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Cibé an féidir nó nach féidir le daoine eile d'fhreastalaí a fheiceáil sa liosta poiblí @@ -2324,6 +2345,7 @@ STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Na beart STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Bearta riaracháin is féidir a dhéanamh don chuideachta seo STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Téigh isteach sa chuideachta seo STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Teachtaireacht a sheoladh chuig an imreoir seo +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Teachtaireacht a sheoladh chuig gach imreoir sa chuideachta seo STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Seol teachtaireacht chuig gach duine sa lucht féachana STR_NETWORK_CLIENT_LIST_SPECTATORS :Lucht féachana STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Cuideachta nua) @@ -2334,6 +2356,7 @@ STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} {P # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Logánta STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Ní féidir le himreoirí cianda nascadh STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Poiblí STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Taobh thiar de NAT @@ -2344,10 +2367,13 @@ STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Cuir cosc air STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Scrios STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Díghlasáil le pasfhocal +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Beart riaracháin STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}An bhfuil tú cinnte gur mhaith leat an t-imreoir '{STRING}' a chiceáil? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}An bhfuil tú cinnte gur mian leat cosc a chur ar an imreoir '{STRING}'? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}An bhfuil tú cinnte gur mhaith leat an chuideachta '{COMPANY}' a scriosadh? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}An bhfuil tú cinnte gur mhaith leat pasfhocal na cuideachta '{COMPANY}' a athshocrú? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Úsáid athsheachadadh? STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Níorbh fhéidir nasc a bhunú idir tú féin agus an freastaláí '{STRING}'.{}Ar mhaith leat an seisiún seo a athsheachadadh trí '{STRING}'? STR_NETWORK_ASK_RELAY_NO :{BLACK}Níl STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Tá, an uair seo @@ -2465,6 +2491,7 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Tá an f STR_NETWORK_MESSAGE_KICKED :*** Ciceáladh {STRING}. An chúis: ({STRING}) STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Níorbh fhéidir an freastalaí a chlárú +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Chláraigh freastalaí eile a bhfuil an cód cuiridh céanna aige é féin. Ag athrú go "logánta" mar chineál cluiche. STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Ní cheadaíonn d'fhreastalaí naisc chianda STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Ní bheidh imreoirí eile in ann nascadh le d'fhreastalaí @@ -2544,6 +2571,7 @@ STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Tugann, STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Ní thugann, scoir de OpenTTD STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Theip ar an íoslódáil +STR_MISSING_GRAPHICS_ERROR :{BLACK}Níorbh fhéidir na grafaicí a íoslódáil.{}Íoslódáil na grafaicí de láimh. STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Téigh amach as OpenTTD # Transparency settings window @@ -2693,6 +2721,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Tóg tol STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD :{BLACK}Athraigh idir tógáil/baint agus bóithre á dtógáil STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}Athraigh idir tógáil/baint agus trambhealaí á dtógáil STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD :{BLACK}Tiontaigh/Uasghrádaigh an cineál bóthair. Le Shift is féidir athrú idir bheith ag tógáil agus an costas measta a thaispeáint +STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM :{BLACK}Tiontaigh/Uasghrádaigh an cineál tram. Le Shift is féidir athrú idir bheith ag tógáil agus an costas measta a thaispeáint STR_ROAD_NAME_ROAD :Bóthar STR_ROAD_NAME_TRAM :Trambhealach @@ -2892,6 +2921,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Ainm tí STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Lastas a ghlactar leis: {LTBLUE} STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING}) +STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Cineál ráillí: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_ROAD_TYPE :{BLACK}Cineál bóthair: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_TRAM_TYPE :{BLACK}Cineál tram: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Teorainn luais iarnróid: {LTBLUE}{VELOCITY} @@ -2996,10 +3026,13 @@ STR_ABOUT_VERSION :{BLACK}OpenTTD STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD {COPYRIGHT} 2002-{STRING} An fhoireann OpenTTD # Framerate display window +STR_FRAMERATE_CAPTION :{WHITE}Ráta frámaí STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Ráta ionsamhlúcháin: {STRING} STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Líon ticeanna an chluiche a dhéantar a ionshamhlú in aghaidh an tsoicind. STR_FRAMERATE_RATE_BLITTER :{BLACK}Ráta frámaí na ngraificí: {STRING} +STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Líon na bhfrámaí físe a rindreáiltear in aghaidh an tsoicind. +STR_FRAMERATE_SPEED_FACTOR :{BLACK}FAchtóir luais an chluiche reatha: {DECIMAL}x STR_FRAMERATE_CURRENT :{WHITE}Faoi láthair STR_FRAMERATE_AVERAGE :{WHITE}Meán-ráta STR_FRAMERATE_MEMORYUSE :{WHITE}Cuimhne @@ -3010,6 +3043,7 @@ STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} fráma/s STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} fráma/s STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} fráma/s +STR_FRAMERATE_BYTES_GOOD :{LTBLUE}{BYTES} STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s @@ -3021,6 +3055,8 @@ STR_FRAMERATE_GL_ROADVEHS :{BLACK} Ticean STR_FRAMERATE_GL_SHIPS :{BLACK} Ticeanna na long: STR_FRAMERATE_GL_AIRCRAFT :{BLACK} Ticeanna na n-aerárthach: STR_FRAMERATE_GL_LANDSCAPE :{BLACK} Ticeanna an domhain: +STR_FRAMERATE_GL_LINKGRAPH :{BLACK} An moill ar ghraf an dáileacháin: +STR_FRAMERATE_DRAWING :{BLACK}Rindreáil grafaicí: STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Fuinneoga amhairc an domhain: STR_FRAMERATE_VIDEO :{BLACK}Aschur físe: STR_FRAMERATE_SOUND :{BLACK}Meascadh fuaime: @@ -3033,8 +3069,10 @@ STR_FRAMETIME_CAPTION_GAMELOOP :Lúb an chluich STR_FRAMETIME_CAPTION_GL_ECONOMY :Láimhseáil lastais STR_FRAMETIME_CAPTION_GL_TRAINS :Ticeanna na dtraenacha STR_FRAMETIME_CAPTION_GL_ROADVEHS :Ticeanna na bhfeithiclí bóthair +STR_FRAMETIME_CAPTION_GL_SHIPS :Ticeanna na long STR_FRAMETIME_CAPTION_GL_AIRCRAFT :Ticeanna na n-aerárthach STR_FRAMETIME_CAPTION_GL_LANDSCAPE :Ticeanna an domhain +STR_FRAMETIME_CAPTION_GL_LINKGRAPH :An moill ar ghraf an dáileacháin STR_FRAMETIME_CAPTION_DRAWING :Rindreáil na ngrafaicí STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Rindreáil fhuinneog amhairc an domhain STR_FRAMETIME_CAPTION_VIDEO :Aschur físe: @@ -3347,6 +3385,7 @@ STR_EDIT_SIGN_SIGN_OSKTITLE :{BLACK}Iontrái STR_TOWN_DIRECTORY_CAPTION :{WHITE}Bailte STR_TOWN_DIRECTORY_NONE :{ORANGE}- Ceann ar bith - STR_TOWN_DIRECTORY_TOWN :{ORANGE}{TOWN}{BLACK} ({COMMA}) +STR_TOWN_DIRECTORY_CITY :{ORANGE}{TOWN}{YELLOW} (Cathair){BLACK} ({COMMA}) STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Ainmneacha bailte - cliceáil ar ainm le go mbeidh an baile i lár an scáileán. Osclaítear amharc nua ar shuíomh an bhaile le Ctrl+Cliceáil STR_TOWN_POPULATION :{BLACK}Daonra domhanda: {COMMA} @@ -3380,6 +3419,7 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Athainmnigh bai # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}Údarás áitiúil {TOWN} STR_LOCAL_AUTHORITY_ZONE :{BLACK}Crios +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Taispeáin an limistéar laistigh de theorainneacha an údaráis áitiúil STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Rátálacha cuideachtaí iompair: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Gníomhartha atá ar fáil: @@ -3635,6 +3675,7 @@ STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Díol sc STR_COMPANY_VIEW_COMPANY_NAME_QUERY_CAPTION :Ainm na Cuideachta STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :Ainm an Bhainisteora +STR_COMPANY_VIEW_GIVE_MONEY_QUERY_CAPTION :Cuir isteach an méid airgid is mian leat a thabhairt STR_BUY_COMPANY_MESSAGE :{WHITE}Tá cuideachta iompair á lorg againn chun seilbh a ghlacadh ar ár gcuideachta.{}{}An bhfuil fonn ort seilbh a ghlacadh ar {COMPANY} ar chostas {CURRENCY_LONG}? @@ -3657,6 +3698,7 @@ STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- Ceann STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{STRING}{YELLOW} (Iompraíodh {COMMA}%){BLACK} STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUSTRY} {STRING} +STR_INDUSTRY_DIRECTORY_ITEM_PROD2 :{ORANGE}{INDUSTRY} {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} agus {NUM} sa bhreis... STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Ainmneacha na dtionscal - cliceáil ar ainm chun an príomh-amharc a lárú ar thionscal. Osclaítear amharc nua ar shuíomh an tionscail le Ctrl+Cliceáil @@ -3674,10 +3716,12 @@ STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Leibhéa STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}D'fhógair an tionscal go ndúnfaidh sé gan mhoill! STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Ag teastáil: {YELLOW}{STRING}{STRING} +STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Táirgtear: {YELLOW}{STRING}{STRING} STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Ag teastáil: STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} +STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} ag fanacht{STRING} STR_CONFIG_GAME_PRODUCTION :{WHITE}Athraigh táirgeacht (iolra de 8, suas go 2040) STR_CONFIG_GAME_PRODUCTION_LEVEL :{WHITE}Athraigh an ráta táirgeachta (céatadán, suas go 800%) @@ -3737,6 +3781,7 @@ STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Grúpaí STR_GROUP_CREATE_TOOLTIP :{BLACK}Cliceáil le grúpa a chruthú STR_GROUP_DELETE_TOOLTIP :{BLACK}Scrios an grúpa roghnaithe STR_GROUP_RENAME_TOOLTIP :{BLACK}Athainmnigh an grúpa roghnaithe +STR_GROUP_LIVERY_TOOLTIP :{BLACK}Athraigh libhré an ghrúpa roghnaithe STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Cliceáil chun an grúpa seo a chosaint ón uathionadú uilíoch STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Scrios Grúpa @@ -3781,6 +3826,7 @@ STR_PURCHASE_INFO_REFITTABLE :(is féidir ath STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Deartha: {GOLD}{NUM}{BLACK} Saolré: {GOLD}{COMMA} bliain STR_PURCHASE_INFO_RELIABILITY :{BLACK}Iontaofacht uasta: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Costas: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Costas: {GOLD}{CURRENCY_LONG}{BLACK} (Costas athfheistithe: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Meáchan: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Costas: {GOLD}{CURRENCY_LONG}{BLACK} Luas: {GOLD}{VELOCITY} STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Costas: {GOLD}{CURRENCY_LONG}{BLACK} (Costas Athfheistithe: {GOLD}{CURRENCY_LONG}{BLACK}) Luas: {GOLD}{VELOCITY} @@ -3820,6 +3866,7 @@ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaig STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Ceannaigh an t-aerárthach aibhsithe ###length VEHICLE_TYPES +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an feithicil traenach aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan í a cheannach STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an fheithicil bóthair aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan í a cheannach STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an long aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan í a cheannach STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Ceannaigh agus athfheistigh an t-aerárthach aibhsithe. Le Shift+Cliceáil taispeántar an costas measta gan é a cheannach @@ -3956,6 +4003,7 @@ STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE :inneall gluaist STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :inneall gluaiste maglev STR_ENGINE_PREVIEW_ROAD_VEHICLE :feithicil bóthair +STR_ENGINE_PREVIEW_TRAM_VEHICLE :feithicil trambhealaigh STR_ENGINE_PREVIEW_AIRCRAFT :aerárthach STR_ENGINE_PREVIEW_SHIP :long @@ -3999,9 +4047,11 @@ STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}Athraigh STR_REPLACE_ENGINES :Innill STR_REPLACE_WAGONS :Vaigíní STR_REPLACE_ALL_RAILTYPE :Gach feithicil iarnróid +STR_REPLACE_ALL_ROADTYPE :Gach feithicil bóthair ###length 2 STR_REPLACE_HELP_RAILTYPE :{BLACK}Roghnaigh an cineál ráille is mian leat innill a athsholáthar air +STR_REPLACE_HELP_ROADTYPE :{BLACK}Roghnaigh an cineál bóthair is mian leat na hinnill a ionadú air ###next-name-looks-similar STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Taispeántar cén inneall a dhéanfar an t-inneall atá roghnaithe ar chlé a athsholáthar leis, má dhéanfar é a athsholáthar @@ -4010,6 +4060,7 @@ STR_REPLACE_ELRAIL_VEHICLES :Feithiclí Iarn STR_REPLACE_MONORAIL_VEHICLES :Feithiclí Aonráille STR_REPLACE_MAGLEV_VEHICLES :Feithiclí Maglev +STR_REPLACE_ROAD_VEHICLES :Feithiclí Bóthair STR_REPLACE_TRAM_VEHICLES :Feithiclí Trambhealaigh STR_REPLACE_REMOVE_WAGON :{BLACK}Vaigíní a bhaint ({STRING}): {ORANGE}{STRING} @@ -4040,6 +4091,7 @@ STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Ceannóf STR_VEHICLE_VIEW_TRAIN_IGNORE_SIGNAL_TOOLTIP :{BLACK}Leag ar an traein dul ar aghaidh gan fanacht ar an gcomhartha STR_VEHICLE_VIEW_TRAIN_REVERSE_TOOLTIP :{BLACK}Aisiompaigh treo na traenach STR_VEHICLE_VIEW_ROAD_VEHICLE_REVERSE_TOOLTIP :{BLACK}Cuir iallach ar an bhfeithicil casadh timpeall +STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}Láraigh an príomhamharc ar cheann scríbe an ordaithe. Osclaítear amharc nua ar shuíomh cheann scríbe an ordaithe le Ctrl+Cliceáil ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_REFIT_TOOLTIP :{BLACK}Athfheistigh traein le cineál lastais eile a iompar @@ -4487,9 +4539,11 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}Roghnaig STR_AI_LIST_CANCEL :{BLACK}Cuir ar ceal STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}Ná hathraigh an AI +STR_SCREENSHOT_CAPTION :{WHITE}Seat scáileáin a thógáil STR_SCREENSHOT_SCREENSHOT :{BLACK}Gnáth-seat scáileáin STR_SCREENSHOT_ZOOMIN_SCREENSHOT :{BLACK}Seat scáileáin zúmáilte isteach go hiomlán STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT :{BLACK}Seat scáileáin le zúmáil réamhshocraithe +STR_SCREENSHOT_WORLD_SCREENSHOT :{BLACK}Seat scáileáin den léarscáil iomlán STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Seat scáileáin den mhapa airde STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Seat scáileáin den mhion-léarscáil @@ -4580,6 +4634,7 @@ STR_WARNING_FALLBACK_SOUNDSET :{WHITE}Níor ai STR_WARNING_SCREENSHOT_SIZE_CAPTION :{WHITE}Seat scáileán ollmhór STR_WARNING_SCREENSHOT_SIZE_MESSAGE :{YELLOW}Beidh taifeach {COMMA} x {COMMA} pictilín ag an seat scáileáin. D'fhéadfadh sé go dtógfaidh sé píosa an seat scáileáin a thógáil. An mian leat leanúint ar aghaidh? +STR_MESSAGE_HEIGHTMAP_SUCCESSFULLY :{WHITE}Sábháladh an léarscáil airde mar '{STRING}'. Is é {NUM} an airde atá ag an mbeann is airde STR_MESSAGE_SCREENSHOT_SUCCESSFULLY :{WHITE}Sábháladh an seat scáileáin mar '{STRING}' STR_ERROR_SCREENSHOT_FAILED :{WHITE}Theip ar an seat scáileáin! diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index e230d6de8e..694dc867f8 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1467,6 +1467,7 @@ STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Grosimea stratu STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Controlează înălțimea de la care zăpada apare în peisajul sub-arctic. Zăpada afectează și generarea industriilor și cerințele de creștere a orașelor. Se poate modifica doar prin Editorul de scenarii sau este calculat prin „acoperirea cu zăpadă” STR_CONFIG_SETTING_SNOW_COVERAGE :Acoperire cu zăpadă: {STRING} +STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Controlează cantitatea aproximativă de zăpadă în peisajul subarctic. Zăpada afectează și generarea industriilor și cerințele de creștere a orașelor. Se folosește doar la generarea hărții. Terenul apropiat de nivelul mării este întotdeauna fără zăpadă STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_DESERT_COVERAGE :Acoperire cu deșert: {STRING} @@ -2621,7 +2622,7 @@ STR_RAIL_TOOLBAR_ELRAIL_CONSTRUCTION_CAPTION :Construcţie ca STR_RAIL_TOOLBAR_MONORAIL_CONSTRUCTION_CAPTION :Construcţie monoşină STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Construcţie pernă magnetică -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Construieşte cale ferată. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afişare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Construiește o cale ferată. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Construiește cale ferată în modul automat. Ctrl comută construirea/eliminarea căii ferate. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Construiește un depou feroviar (pentru achiziție și service de trenuri). Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Converteşte linia în punct de tranzit. Ctrl permite alipirea punctelor de tranzit distante. Shift comută între convertire/afişare cost estimat @@ -2700,7 +2701,7 @@ STR_BRIDGE_TUBULAR_SILICON :Tubular, Silico # Road construction toolbar STR_ROAD_TOOLBAR_ROAD_CONSTRUCTION_CAPTION :{WHITE}Construcţii rutiere STR_ROAD_TOOLBAR_TRAM_CONSTRUCTION_CAPTION :{WHITE}Construcţie tramvai -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Construieşte secţiune de şosea. Ctrl comută construirea/eliminarea şoselei. Shift comută între construire/afişare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Construiește o secțiune de șosea. Ctrl comută construirea/eliminarea șoselei. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Construiește șină de tramvai. Ctrl comută construirea/eliminarea șinei. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Construiește secțiune de șosea folosind modul Auto-șosea. Ctrl comută construirea/eliminarea șoselei. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Construiește secțiune de șină de tramvai folosind modul Auto-tramvai. Ctrl comută construirea/eliminarea șinei. Shift comută între construire/afișare cost estimat @@ -3141,6 +3142,7 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}Nume har STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}Dimensiune: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} +STR_MAPGEN_TERRAIN_TYPE_QUERY_CAPT :{WHITE}Înălțimea maximă dorită STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT :{WHITE}Cel mai înalt vârf STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT :{WHITE}Acoperire cu zăpadă (în %) STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}Acoperire cu deșert (în %) @@ -3817,7 +3819,7 @@ STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vagoane STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Modificabil pentru: {GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :Toate tipurile de mărfuri STR_PURCHASE_INFO_NONE :Niciunul -STR_PURCHASE_INFO_ENGINES_ONLY :Doar motoare +STR_PURCHASE_INFO_ENGINES_ONLY :Doar locomotive STR_PURCHASE_INFO_ALL_BUT :Toate, cu excepţia {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Efort tractor max.: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Rază acțiune: {GOLD}{COMMA} pătrățele @@ -4026,7 +4028,7 @@ STR_REPLACE_VEHICLES_STOP :{BLACK}Oprire STR_REPLACE_HELP_STOP_BUTTON :{BLACK}Apasă aici pentru a opri înlocuirea motorului selectat în stânga STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}Comutã între ferestrele de înlocuire motoare si vagoane -STR_REPLACE_ENGINES :Motoare +STR_REPLACE_ENGINES :Locomotive STR_REPLACE_WAGONS :Vagoane STR_REPLACE_ALL_RAILTYPE :Toate vehiculele pe șine STR_REPLACE_ALL_ROADTYPE :Toate vehiculele rutiere @@ -4392,7 +4394,7 @@ STR_INVALID_ORDER :{RED} (Comenzi # Time table window STR_TIMETABLE_TITLE :{WHITE}{VEHICLE} (Orar) STR_TIMETABLE_ORDER_VIEW :{BLACK}Comenzi -STR_TIMETABLE_ORDER_VIEW_TOOLTIP :{BLACK}Schimba la panoul de comenzi +STR_TIMETABLE_ORDER_VIEW_TOOLTIP :{BLACK}Comută la lista comenzilor STR_TIMETABLE_TOOLTIP :{BLACK}Orar - click pe un ordin pentru a-l selecta @@ -4689,7 +4691,7 @@ STR_ERROR_NO_SPACE_FOR_TOWN :{WHITE}... nu m STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}Oraşul nu va construi drumuri. Poţi activa construirea drumurilor via Setari avansate -> Economie -> Oraşe STR_ERROR_ROAD_WORKS_IN_PROGRESS :{WHITE}Lucrari la drum in curs de desfasurare STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Acest oraș nu poate fi șters...{}O stație sau un depou face referire la acest oraș, sau o parcelă deținută de oraș nu poate fi eliminată -STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... nu există nici un loc potrivit pentru o statuie în centrul acestui oraş +STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... nu există niciun loc potrivit pentru o statuie în centrul acestui oraș # Industry related errors STR_ERROR_TOO_MANY_INDUSTRIES :{WHITE}... prea multe industrii From 46123742f581af6ae869cf5bdd690d217e393ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sun, 3 Oct 2021 21:14:59 +0200 Subject: [PATCH 022/710] Change: [Actions] Use macOS-11 image for releases (#9605) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd6a8d8fa1..7adc7c9a03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -473,7 +473,7 @@ jobs: name: MacOS needs: source - runs-on: macos-10.15 + runs-on: macos-11 env: MACOSX_DEPLOYMENT_TARGET: 10.14 From d2bc32e94a6c0dc810e55b1b198428940c9bf330 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 4 Oct 2021 18:48:34 +0000 Subject: [PATCH 023/710] Update: Translations from eints korean: 1 change by telk5093 romanian: 15 changes by kneekoo --- src/lang/korean.txt | 2 +- src/lang/romanian.txt | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 8e062fbb68..1594b11673 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -4985,7 +4985,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}{DATE_SH # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}너무 위험해서 신호를 무시할 수 없습니다... STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}열차를 회차시킬 수 없습니다... -STR_ERROR_TRAIN_START_NO_POWER :동력차가 없습니다 +STR_ERROR_TRAIN_START_NO_POWER :동력이 없습니다 STR_ERROR_CAN_T_MAKE_ROAD_VEHICLE_TURN :{WHITE}차량을 유턴시킬 수 없습니다... diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 694dc867f8..6edfcde21a 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -601,7 +601,7 @@ STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLA STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Dezactivează tot STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Afişează toate mărfurile în graficul de plăţi STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Nu afişa niciun tip de marfă în graficul de plăţi -STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Comutator pentru afişarea graficului de marfă +STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Comută ascunderea/afișarea graficului de marfă STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING} STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Afişează detaliile ratingului performanţei @@ -735,9 +735,9 @@ STR_SMALLMAP_TOOLTIP_SHOW_LINK_STATS_ON_MAP :{BLACK}Arată f STR_SMALLMAP_TOOLTIP_SHOW_TRANSPORT_ROUTES_ON :{BLACK}Arată rutele de transport pe hartă STR_SMALLMAP_TOOLTIP_SHOW_VEGETATION_ON_MAP :{BLACK}Arată vegetaţia pe hartă STR_SMALLMAP_TOOLTIP_SHOW_LAND_OWNERS_ON_MAP :{BLACK}Arată proprietarii de teren pe hartă -STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION :{BLACK}Click pe tipul de industrie pentru a comuta afișarea acestuia. Ctrl+Click dezactivează toate tipurile cu excepția celui selectat. Ctrl+Click din nou pentru a reactiva toate tipurile de industrii +STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION :{BLACK}Click pe tipul de industrie pentru a comuta afișarea acestuia. Ctrl+clic dezactivează toate tipurile cu excepția celui selectat. Ctrl+clic din nou pentru a reactiva toate tipurile de industrii STR_SMALLMAP_TOOLTIP_COMPANY_SELECTION :{BLACK}Click pe o companie pentru a comuta afișarea proprietăților acesteia. Ctrl-Click dezactivează toate companiile cu excepția celei selectate. Ctrl-Click din nou pentru a activa toate companiile -STR_SMALLMAP_TOOLTIP_CARGO_SELECTION :{BLACK}Click pe un tip de încărcătură pentru a afișa sau nu proprietățile. Ctrl+Click dezactivează toate tipurile de încărcături cu excepția celei curente. Ctrl+Click a doua oară pentru a vedea toate tipurile de încărcătură +STR_SMALLMAP_TOOLTIP_CARGO_SELECTION :{BLACK}Dă clic pe un tip de încărcătură pentru a afișa sau nu proprietățile. Ctrl+clic dezactivează toate tipurile de încărcături cu excepția celei curente. Ctrl+clic a doua oară pentru a vedea toate tipurile de încărcătură STR_SMALLMAP_LEGENDA_ROADS :{TINY_FONT}{BLACK}Drumuri STR_SMALLMAP_LEGENDA_RAILROADS :{TINY_FONT}{BLACK}Căi ferate @@ -813,7 +813,7 @@ STR_NEWS_FIRST_SHIP_ARRIVAL :{BIG_FONT}{BLAC STR_NEWS_FIRST_AIRCRAFT_ARRIVAL :{BIG_FONT}{BLACK}Cetăţenii sărbătoresc . . .{}Soseşte prima aeronavă la {STATION}! STR_NEWS_TRAIN_CRASH :{BIG_FONT}{BLACK}Accident feroviar!{}{COMMA} victime în urma coliziunii -STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Accident rutier!{}Şoferul a decedat în urma coliziunii cu un tren +STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Accident rutier!{}Șoferul a decedat în urma coliziunii cu un tren STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLACK}Accident rutier!{}{COMMA} victime în urma coliziunii cu un tren STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLACK}Accident aviatic!{}{COMMA} victime în urma prăbuşirii de la {STATION} STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}Accident aviatic!{}Aeronava a rămas fără combustibil, {COMMA} victime în urma dezastrului @@ -1023,6 +1023,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Bifați STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Setarea va avea efect doar după repornirea jocului STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Bifați această căsuță pentru sincronizarea verticală a imaginii. Modificarea setării va fi aplicată doar după repornirea jocului și funcționează doar cu accelerarea hardware activată STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Mărime interfată STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Alege mărimea elementelor de interfaţa @@ -1270,6 +1271,7 @@ STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Permite terrafo STR_CONFIG_SETTING_CATCHMENT :Permite arii de cuprindere mai realiste: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Permite zone diferite de captare pentru tipuri diferite de staţii şi aeroporturi +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Stațiile companiei pot deservi industrii cu stații neutre atașate: {STRING} STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Dacă este activată, industriile cu stații atașate (cum ar fi Platforma petrolieră) pot fi deservite și de stațiile alăturate ale companiilor. Dacă e dezactivată, aceste industrii nu vor putea fi servite decât prin intermediul stațiilor atașate. Nicio stație din preajmă a unei companii nu le va putea deservi, iar stația atașată nu va putea deservi decât industria sa. STR_CONFIG_SETTING_EXTRADYNAMITE :Permite demolarea unui nr. mai mare de construcţii deţinute de oraş: {STRING} @@ -1876,6 +1878,7 @@ STR_CONFIG_SETTING_SNAP_RADIUS_VALUE :{COMMA} {P 0 pi ###setting-zero-is-special STR_CONFIG_SETTING_SNAP_RADIUS_DISABLED :Dezactivat STR_CONFIG_SETTING_SOFT_LIMIT :Numărul maxim de ferestre nefixate: {STRING} +STR_CONFIG_SETTING_SOFT_LIMIT_HELPTEXT :Maximul permis de ferestre deschise nefixate înainte ca vechile ferestre să fie închise automat ca să le facă loc celor noi STR_CONFIG_SETTING_SOFT_LIMIT_VALUE :{COMMA} ###setting-zero-is-special STR_CONFIG_SETTING_SOFT_LIMIT_DISABLED :dezactivat @@ -3028,6 +3031,7 @@ STR_FRAMERATE_CAPTION :{WHITE}FPS STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Viteza simulării: {STRING} STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Număr de evenimente de joc simulate per secundă. +STR_FRAMERATE_RATE_BLITTER :{BLACK}Rata de reîmprospătare a imaginii: {STRING} STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Numărul de cadre video randate per secundă. STR_FRAMERATE_SPEED_FACTOR :{BLACK}Factorul actual de viteză a jocului: {DECIMAL}x STR_FRAMERATE_CURRENT :{WHITE}Curent @@ -3045,6 +3049,7 @@ STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COM STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ###length 15 +STR_FRAMERATE_GAMELOOP :{BLACK}Totalul buclei de joc: STR_FRAMERATE_GL_ECONOMY :{BLACK} Manipularea încărcăturilor: STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Decalaj grafic de conexiuni: STR_FRAMERATE_DRAWING :{BLACK}Randare grafică: @@ -3220,6 +3225,7 @@ STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Paletă: STR_NEWGRF_SETTINGS_PALETTE_DEFAULT :Implicit (D) STR_NEWGRF_SETTINGS_PALETTE_DEFAULT_32BPP :Implicit (D) / 32 bpp STR_NEWGRF_SETTINGS_PALETTE_LEGACY :Legacy (W) +STR_NEWGRF_SETTINGS_PALETTE_LEGACY_32BPP :Legacy (W) / 32 bpp STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Parametri: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PARAMETER_NONE :Nimic @@ -3329,12 +3335,13 @@ STR_NEWGRF_BROKEN :{WHITE}Comporta STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}A modificat starea trenului pentru '{1:ENGINE}' când nu se afla în depou STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}A modificat lungimea vehiculului pentru '{1:ENGINE}' când nu se afla în depou STR_NEWGRF_BROKEN_CAPACITY :{WHITE}A modificat capacitatea vehiculului pentru '{1:ENGINE}' când nu a fost într-un depou sau în timpul conversiei -STR_BROKEN_VEHICLE_LENGTH :{WHITE}Trenul '{VEHICLE}', aparţinând '{COMPANY}' nu are o lungime validă. Probabil este o problemă cu fişierele NewGRF. Jocul s-ar putea desincroniza sau bloca +STR_BROKEN_VEHICLE_LENGTH :{WHITE}Trenul '{VEHICLE}', aparținând '{COMPANY}', nu are o lungime validă. Probabil este o problemă cu fișierele NewGRF. Jocul s-ar putea desincroniza sau bloca STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:STRING}' produce informaţii incorecte STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Datele despre marfa/regarnisire pentru '{1:ENGINE}' diferă de valorile iniţiale după construcţie. Acest lucru ar putea cauza eşuarea autorenovarii/schimbarii. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' a cauzat o buclă infinită în funcţia de producţie -STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Execuția {1:HEX} a returnat răspunsul invalid/necunoscut {2:HEX} +STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Execuția {1:HEX} a returnat un răspuns nevalid/necunoscut {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' a returnat un tip nevalid de marfă în retro-apelul produsului la {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : @@ -3882,8 +3889,8 @@ STR_BUY_VEHICLE_AIRCRAFT_SHOW_TOGGLE_BUTTON :{BLACK}Afișeaz ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comută ascunderea/afișarea tipului de tren STR_BUY_VEHICLE_ROAD_VEHICLE_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comută ascunderea/afișarea tipului de autovehicul -STR_BUY_VEHICLE_SHIP_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutator pentru afişarea tipului de navă -STR_BUY_VEHICLE_AIRCRAFT_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comutator pentru afişarea tipului de aeronavă +STR_BUY_VEHICLE_SHIP_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comută ascunderea/afișarea tipului de navă +STR_BUY_VEHICLE_AIRCRAFT_HIDE_SHOW_TOGGLE_TOOLTIP :{BLACK}Comută ascunderea/afișarea tipului de aeronavă ###length VEHICLE_TYPES STR_QUERY_RENAME_TRAIN_TYPE_CAPTION :{WHITE}Redenumește modelul vehiculului feroviar From 8b157c9bdf882600d919e98dbe3a530d81684a78 Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 6 Oct 2021 18:47:23 +0000 Subject: [PATCH 024/710] Update: Translations from eints romanian: 1 change by kneekoo --- src/lang/romanian.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 6edfcde21a..b59ca97814 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -4075,7 +4075,7 @@ STR_VEHICLE_VIEW_AIRCRAFT_SEND_TO_DEPOT_TOOLTIP :{BLACK}Trimite ###length VEHICLE_TYPES STR_VEHICLE_VIEW_CLONE_TRAIN_INFO :{BLACK}Acest buton va crea o copie a întregului tren. Ctrl+Click va sincroniza comenzile. Shift+Click va afișa costul estimat fără a achiziționa trenul -STR_VEHICLE_VIEW_CLONE_ROAD_VEHICLE_INFO :{BLACK}Acest buton va crea o copie a autovehiculului. Ctrl+Click va sincroniza comenzile. Shift+Click va afișa costul estimat fără a achiziționa vehiculul +STR_VEHICLE_VIEW_CLONE_ROAD_VEHICLE_INFO :{BLACK}Acest buton va achiziționa o copie a autovehiculului. Ctrl+clic va sincroniza comenzile. Shift+clic va afișa costul estimat fără a achiziționa vehiculul STR_VEHICLE_VIEW_CLONE_SHIP_INFO :{BLACK}Acest buton va crea o copie a navei. Ctrl+clic va sincroniza comenzile. Shift+clic va afișa costul estimat fără a achiziționa nava STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Acest buton va crea o copie a aeronavei. Ctrl+clic va sincroniza comenzile. Shift+clic va afișa costul estimat fără a cumpăra aeronava From 7d831be3abd091dbe996b613a8879d2352f046b0 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 10 Oct 2021 18:46:33 +0000 Subject: [PATCH 025/710] Update: Translations from eints indonesian: 6 changes by bsuseno --- src/lang/indonesian.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 407b998248..72ac5b0e02 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -5287,12 +5287,12 @@ STR_VEHICLE_NAME_ROAD_VEHICLE_PLODDYPHUT_MKIII_BUS :Bus Ploddyphut STR_VEHICLE_NAME_ROAD_VEHICLE_BALOGH_COAL_TRUCK :Truk Batubara Balogh STR_VEHICLE_NAME_ROAD_VEHICLE_UHL_COAL_TRUCK :Truk Batubara Uhl STR_VEHICLE_NAME_ROAD_VEHICLE_DW_COAL_TRUCK :Truk Batubara DW -STR_VEHICLE_NAME_ROAD_VEHICLE_MPS_MAIL_TRUCK :Truk Pos MPS -STR_VEHICLE_NAME_ROAD_VEHICLE_REYNARD_MAIL_TRUCK :Truk Pos Reynard -STR_VEHICLE_NAME_ROAD_VEHICLE_PERRY_MAIL_TRUCK :Truk Pos Perry -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_MAIL_TRUCK :Truk Pos MightyMover -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_MAIL_TRUCK :Truk Pos Powernaught -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_MAIL_TRUCK :Truk Pos Wizzowow +STR_VEHICLE_NAME_ROAD_VEHICLE_MPS_MAIL_TRUCK :Truk Surat MPS +STR_VEHICLE_NAME_ROAD_VEHICLE_REYNARD_MAIL_TRUCK :Truk Surat Reynard +STR_VEHICLE_NAME_ROAD_VEHICLE_PERRY_MAIL_TRUCK :Truk Surat Perry +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_MAIL_TRUCK :Truk Surat MightyMover +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_MAIL_TRUCK :Truk Surat Powernaught +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_MAIL_TRUCK :Truk Surat Wizzowow STR_VEHICLE_NAME_ROAD_VEHICLE_WITCOMBE_OIL_TANKER :Truk Tangki minyak Witcombe STR_VEHICLE_NAME_ROAD_VEHICLE_FOSTER_OIL_TANKER :Truk Tangki minyak Foster STR_VEHICLE_NAME_ROAD_VEHICLE_PERRY_OIL_TANKER :Truk Tangki minyak Perry From d0092925c9aac01b88f13bf7be29305fec3a5be1 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 11 Oct 2021 18:48:06 +0000 Subject: [PATCH 026/710] Update: Translations from eints romanian: 9 changes by kneekoo --- src/lang/romanian.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index b59ca97814..b8ec2e610f 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1274,7 +1274,7 @@ STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Permite zone di STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Stațiile companiei pot deservi industrii cu stații neutre atașate: {STRING} STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Dacă este activată, industriile cu stații atașate (cum ar fi Platforma petrolieră) pot fi deservite și de stațiile alăturate ale companiilor. Dacă e dezactivată, aceste industrii nu vor putea fi servite decât prin intermediul stațiilor atașate. Nicio stație din preajmă a unei companii nu le va putea deservi, iar stația atașată nu va putea deservi decât industria sa. -STR_CONFIG_SETTING_EXTRADYNAMITE :Permite demolarea unui nr. mai mare de construcţii deţinute de oraş: {STRING} +STR_CONFIG_SETTING_EXTRADYNAMITE :Permite demolarea unui nr. mai mare de drumuri, poduri și tunele deținute de oraș: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Facilitează eliminarea de clădiri şi infrastructură deţinute de oraş STR_CONFIG_SETTING_TRAIN_LENGTH :Lungimea maximă a trenurilor: {STRING} @@ -1385,7 +1385,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :niciunul STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :redus STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normal -STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite construirea staţiilor pe drumurile din proprietatea oraşului: {STRING} +STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite construirea stațiilor pe drumurile din proprietatea orașului: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permite construcția stațiilor pe drumurile construite de un oraș STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permite construirea staţiilor pe drumurile competitorilor: {STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Permite construcția stațiilor pe drumurile construite de altă companie @@ -1910,12 +1910,12 @@ STR_CONFIG_SETTING_TOWN_GROWTH_FAST :Rapidă STR_CONFIG_SETTING_TOWN_GROWTH_VERY_FAST :Foarte rapidă STR_CONFIG_SETTING_LARGER_TOWNS :Proporţia oraşelor care vor deveni mari: {STRING} -STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Numărul de oraşe care devin mari, astfel un oraş care porneşte prin a fi mai mare şi creşte mai rapid +STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT :Numărul de orașe care devin mari, deci un oraș care pornește mai mare crește mai rapid STR_CONFIG_SETTING_LARGER_TOWNS_VALUE :1 din {COMMA} ###setting-zero-is-special STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :deloc STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Multiplicator iniţial dimensiune oraş: {STRING} -STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Dimensiunea medie a oraşelor mari relativ la oraşele normale, la începutul jocului +STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Dimensiunea medie a orașelor mari față de orașele normale, la începutul jocului STR_CONFIG_SETTING_LINKGRAPH_INTERVAL :Actualizează graficul de distribuţie la fiecare {STRING}{NBSP}{P 0:2 zi zile "de zile"} STR_CONFIG_SETTING_LINKGRAPH_INTERVAL_HELPTEXT :Interval de timp între recalculările graficului de conexiuni. Fiecare recalculare calculează planurile unei componente ale graficului. Asta înseamnă că o valoare X pentru această setare nu va duce la actualizarea întregului grafic la fiecare X zile, ci doar o componentă va fi actualizată. Cu cât e mai mică valoarea, cu atât mai mult timp va fi necesar pentru calcule. Cu cât e mai mare valoarea, cu atât va dura mai mult până va începe distribuția mărfii pe rute noi. @@ -2631,8 +2631,8 @@ STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Construi STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Converteşte linia în punct de tranzit. Ctrl permite alipirea punctelor de tranzit distante. Shift comută între convertire/afişare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Construiește gară. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Plasează semnale feroviare. Ctrl comută între semafoare/semnale electrice{}Trage cu mausul pentru a construi automat semnale pe o porțiune de șină dreaptă. Apasă Ctrl pentru a construi semnale până la următoarea joncțiune{}Ctrl+Clic comută deschiderea ferestrei de selecție a tipului de semnal. Shift comută între construire/afișare cost estimat -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Construieşte pod de cale ferată. Shift comută între construire/afişare cost estimat -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Construieşte tunel feroviar. Shift comută între construire/afişare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Construiește un pod de cale ferată. Shift comută între construire/afișare cost estimat +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Construiește un tunel feroviar. Shift comută între construire/afișare cost estimat STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Comută construcţia/înlăturarea căilor ferate, semnalelor, punctelor de tranzit şi a staţiilor. Ctrl+Click înlătură şinele din punctele de tranzit şi din staţii STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL :{BLACK}Converteşte tipul de cale ferată. Shift comută între convertire/afişare cost estimat @@ -2715,7 +2715,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construi STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construiește platformă pentru camioane. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Construiește stație pentru tramvai de marfă. Ctrl permite alipirea stațiilor. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Activare/Dezactivare sensuri unice -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Construieşte pod rutier. Shift comută între construire/afişare cost estimat +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Construiește un pod rutier. Shift comută între construire/afișare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_BRIDGE :{BLACK}Construieşte pod pentru tramvaie. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL :{BLACK}Construieşte tunel rutier. Shift comută între construire/afişare cost estimat STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Construieşte tunel pentru tramvaie. Shift comută între construire/afişare cost estimat @@ -2856,7 +2856,7 @@ STR_FOUND_TOWN_INITIAL_SIZE_LARGE_BUTTON :{BLACK}Mare STR_FOUND_TOWN_SIZE_RANDOM :{BLACK}Aleator STR_FOUND_TOWN_INITIAL_SIZE_TOOLTIP :{BLACK}Alege mărimea oraşului STR_FOUND_TOWN_CITY :{BLACK}Metropolă -STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Metropolele cresc mai repede decât oraşele{}În funcţie de setări, sunt mai mari când sunt fondate +STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Metropolele cresc mai repede decât orașele{}În funcție de setări, sunt mai mari când sunt fondate STR_FOUND_TOWN_ROAD_LAYOUT :{YELLOW}Modelul drumului în oraş: STR_FOUND_TOWN_SELECT_TOWN_ROAD_LAYOUT :{BLACK}Alege modelul de drum folosit pentru acest oraş @@ -4695,7 +4695,7 @@ STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP_SUB :{WHITE}... prea STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN :{WHITE}... prea aproape de alt oraş STR_ERROR_TOO_MANY_TOWNS :{WHITE}... prea multe oraşe STR_ERROR_NO_SPACE_FOR_TOWN :{WHITE}... nu mai este loc pe hartă -STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}Oraşul nu va construi drumuri. Poţi activa construirea drumurilor via Setari avansate -> Economie -> Oraşe +STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS :{WHITE}Orașul nu va construi drumuri. Poți activa construirea drumurilor din Setări avansate -> Economie -> Orașe STR_ERROR_ROAD_WORKS_IN_PROGRESS :{WHITE}Lucrari la drum in curs de desfasurare STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Acest oraș nu poate fi șters...{}O stație sau un depou face referire la acest oraș, sau o parcelă deținută de oraș nu poate fi eliminată STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... nu există niciun loc potrivit pentru o statuie în centrul acestui oraș From 207cf7bbdd2c3b919530fe66049131c18df71e4b Mon Sep 17 00:00:00 2001 From: glx22 Date: Tue, 5 Oct 2021 17:58:19 +0200 Subject: [PATCH 027/710] Change: Reverse ship when leaving docks if a better path exists --- src/ship_cmd.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 415d97ebce..0d8cd6c375 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -335,6 +335,18 @@ static Vehicle *EnsureNoMovingShipProc(Vehicle *v, void *data) return v->type == VEH_SHIP && (v->vehstatus & (VS_HIDDEN | VS_STOPPED)) == 0 ? v : nullptr; } +static bool CheckReverseShip(const Ship *v) +{ + /* Ask pathfinder for best direction */ + bool reverse = false; + switch (_settings_game.pf.pathfinder_for_ships) { + case VPF_NPF: reverse = NPFShipCheckReverse(v); break; + case VPF_YAPF: reverse = YapfShipCheckReverse(v); break; + default: NOT_REACHED(); + } + return reverse; +} + static bool CheckShipLeaveDepot(Ship *v) { if (!v->IsChainInDepot()) return false; @@ -364,14 +376,7 @@ static bool CheckShipLeaveDepot(Ship *v) TrackBits north_tracks = DiagdirReachesTracks(north_dir) & GetTileShipTrackStatus(north_neighbour); TrackBits south_tracks = DiagdirReachesTracks(south_dir) & GetTileShipTrackStatus(south_neighbour); if (north_tracks && south_tracks) { - /* Ask pathfinder for best direction */ - bool reverse = false; - switch (_settings_game.pf.pathfinder_for_ships) { - case VPF_NPF: reverse = NPFShipCheckReverse(v); break; - case VPF_YAPF: reverse = YapfShipCheckReverse(v); break; - default: NOT_REACHED(); - } - if (reverse) north_tracks = TRACK_BIT_NONE; + if (CheckReverseShip(v)) north_tracks = TRACK_BIT_NONE; } if (north_tracks) { @@ -624,6 +629,7 @@ static void ShipController(Ship *v) const byte *b; Track track; TrackBits tracks; + GetNewVehiclePosResult gp; v->tick_counter++; v->current_order_time++; @@ -632,7 +638,8 @@ static void ShipController(Ship *v) if (v->vehstatus & VS_STOPPED) return; - ProcessOrders(v); + if (ProcessOrders(v) && CheckReverseShip(v)) goto reverse_direction; + v->HandleLoading(); if (v->current_order.IsType(OT_LOADING)) return; @@ -657,7 +664,7 @@ static void ShipController(Ship *v) if (!ShipAccelerate(v)) return; - GetNewVehiclePosResult gp = GetNewVehiclePos(v); + gp = GetNewVehiclePos(v); if (v->state != TRACK_BIT_WORMHOLE) { /* Not on a bridge */ if (gp.old_tile == gp.new_tile) { From cbe00ec651b05d3cbf30f3c8389f8a4acc5ed204 Mon Sep 17 00:00:00 2001 From: glx22 Date: Tue, 5 Oct 2021 17:58:19 +0200 Subject: [PATCH 028/710] Fix: Try all possible reverse directions when a ship reaches a dead end --- src/pathfinder/npf/npf.cpp | 18 ++++++++++++++++-- src/pathfinder/npf/npf_func.h | 3 ++- src/pathfinder/yapf/yapf.h | 3 ++- src/pathfinder/yapf/yapf_ship.cpp | 19 ++++++++++++------- src/ship_cmd.cpp | 21 +++++++++++++++++---- 5 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index 3bc596e63e..f7cb1a5cda 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -1211,7 +1211,7 @@ Track NPFShipChooseTrack(const Ship *v, bool &path_found) return TrackdirToTrack(ftd.best_trackdir); } -bool NPFShipCheckReverse(const Ship *v) +bool NPFShipCheckReverse(const Ship *v, Trackdir *best_td) { NPFFindStationOrTileData fstd; NPFFoundTargetData ftd; @@ -1224,7 +1224,21 @@ bool NPFShipCheckReverse(const Ship *v) assert(trackdir_rev != INVALID_TRACKDIR); AyStarUserData user = { v->owner, TRANSPORT_WATER, RAILTYPES_NONE, ROADTYPES_NONE, 0 }; - ftd = NPFRouteToStationOrTileTwoWay(v->tile, trackdir, false, v->tile, trackdir_rev, false, &fstd, &user); + if (best_td != nullptr) { + TrackdirBits rtds = DiagdirReachesTrackdirs(ReverseDiagDir(VehicleExitDir(v->direction, v->state))); + Trackdir best = (Trackdir)FindFirstBit2x64(rtds); + for (rtds = KillFirstBit(rtds); rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) { + Trackdir td = (Trackdir)FindFirstBit2x64(rtds); + ftd = NPFRouteToStationOrTileTwoWay(v->tile, best, false, v->tile, td, false, &fstd, &user); + if (ftd.best_bird_dist == 0 && NPFGetFlag(&ftd.node, NPF_FLAG_REVERSE)) best = td; + } + if (ftd.best_bird_dist == 0) { + *best_td = best; + return true; + } + } else { + ftd = NPFRouteToStationOrTileTwoWay(v->tile, trackdir, false, v->tile, trackdir_rev, false, &fstd, &user); + } /* If we didn't find anything, just keep on going straight ahead, otherwise take the reverse flag */ return ftd.best_bird_dist == 0 && NPFGetFlag(&ftd.node, NPF_FLAG_REVERSE); } diff --git a/src/pathfinder/npf/npf_func.h b/src/pathfinder/npf/npf_func.h index 036caf9bb0..9183f76ed5 100644 --- a/src/pathfinder/npf/npf_func.h +++ b/src/pathfinder/npf/npf_func.h @@ -46,9 +46,10 @@ Track NPFShipChooseTrack(const Ship *v, bool &path_found); /** * Returns true if it is better to reverse the ship before leaving depot using NPF. * @param v the ship leaving the depot + * @param trackdir [out] the best of all possible reversed trackdirs * @return true if reversing is better */ -bool NPFShipCheckReverse(const Ship *v); +bool NPFShipCheckReverse(const Ship *v, Trackdir *trackdir); /** * Used when user sends train to the nearest depot or if train needs servicing using NPF diff --git a/src/pathfinder/yapf/yapf.h b/src/pathfinder/yapf/yapf.h index af5e966e7f..d644669807 100644 --- a/src/pathfinder/yapf/yapf.h +++ b/src/pathfinder/yapf/yapf.h @@ -31,9 +31,10 @@ Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, /** * Returns true if it is better to reverse the ship before leaving depot using YAPF. * @param v the ship leaving the depot + * @param trackdir [out] the best of all possible reversed trackdirs * @return true if reversing is better */ -bool YapfShipCheckReverse(const Ship *v); +bool YapfShipCheckReverse(const Ship *v, Trackdir *trackdir); /** * Finds the best path for given road vehicle using YAPF. diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index 3a54ddb3eb..25a63ec669 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -204,14 +204,15 @@ public: * @param tile Current position * @param td1 Forward direction * @param td2 Reverse direction + * @param trackdir [out] the best of all possible reversed trackdirs * @return true if the reverse direction is better */ - static bool CheckShipReverse(const Ship *v, TileIndex tile, Trackdir td1, Trackdir td2) + static bool CheckShipReverse(const Ship *v, TileIndex tile, Trackdir td1, Trackdir td2, Trackdir *trackdir) { /* create pathfinder instance */ Tpf pf; /* set origin and destination nodes */ - pf.SetOrigin(tile, TrackdirToTrackdirBits(td1) | TrackdirToTrackdirBits(td2)); + pf.SetOrigin(tile, trackdir == nullptr ? TrackdirToTrackdirBits(td1) | TrackdirToTrackdirBits(td2) : DiagdirReachesTrackdirs(ReverseDiagDir(VehicleExitDir(v->direction, v->state)))); pf.SetDestination(v); /* find best path */ if (!pf.FindPath(v)) return false; @@ -226,8 +227,12 @@ public: } Trackdir best_trackdir = pNode->GetTrackdir(); - assert(best_trackdir == td1 || best_trackdir == td2); - return best_trackdir == td2; + if (trackdir != nullptr) { + *trackdir = best_trackdir; + } else { + assert(best_trackdir == td1 || best_trackdir == td2); + } + return best_trackdir != td1; } }; @@ -353,13 +358,13 @@ Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, return (td_ret != INVALID_TRACKDIR) ? TrackdirToTrack(td_ret) : INVALID_TRACK; } -bool YapfShipCheckReverse(const Ship *v) +bool YapfShipCheckReverse(const Ship *v, Trackdir *trackdir) { Trackdir td = v->GetVehicleTrackdir(); Trackdir td_rev = ReverseTrackdir(td); TileIndex tile = v->tile; - typedef bool (*PfnCheckReverseShip)(const Ship*, TileIndex, Trackdir, Trackdir); + typedef bool (*PfnCheckReverseShip)(const Ship*, TileIndex, Trackdir, Trackdir, Trackdir*); PfnCheckReverseShip pfnCheckReverseShip = CYapfShip2::CheckShipReverse; // default: ExitDir /* check if non-default YAPF type needed */ @@ -367,7 +372,7 @@ bool YapfShipCheckReverse(const Ship *v) pfnCheckReverseShip = &CYapfShip1::CheckShipReverse; // Trackdir } - bool reverse = pfnCheckReverseShip(v, tile, td, td_rev); + bool reverse = pfnCheckReverseShip(v, tile, td, td_rev, trackdir); return reverse; } diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 0d8cd6c375..7f9dab0f1a 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -335,13 +335,13 @@ static Vehicle *EnsureNoMovingShipProc(Vehicle *v, void *data) return v->type == VEH_SHIP && (v->vehstatus & (VS_HIDDEN | VS_STOPPED)) == 0 ? v : nullptr; } -static bool CheckReverseShip(const Ship *v) +static bool CheckReverseShip(const Ship *v, Trackdir *trackdir = nullptr) { /* Ask pathfinder for best direction */ bool reverse = false; switch (_settings_game.pf.pathfinder_for_ships) { - case VPF_NPF: reverse = NPFShipCheckReverse(v); break; - case VPF_YAPF: reverse = YapfShipCheckReverse(v); break; + case VPF_NPF: reverse = NPFShipCheckReverse(v, trackdir); break; + case VPF_YAPF: reverse = YapfShipCheckReverse(v, trackdir); break; default: NOT_REACHED(); } return reverse; @@ -725,7 +725,19 @@ static void ShipController(Ship *v) DiagDirection diagdir = DiagdirBetweenTiles(gp.old_tile, gp.new_tile); assert(diagdir != INVALID_DIAGDIR); tracks = GetAvailShipTracks(gp.new_tile, diagdir); - if (tracks == TRACK_BIT_NONE) goto reverse_direction; + if (tracks == TRACK_BIT_NONE) { + Trackdir trackdir = INVALID_TRACKDIR; + CheckReverseShip(v, &trackdir); + if (trackdir == INVALID_TRACKDIR) goto reverse_direction; + static const Direction _trackdir_to_direction[] = { + DIR_NE, DIR_SE, DIR_E, DIR_E, DIR_S, DIR_S, INVALID_DIR, INVALID_DIR, + DIR_SW, DIR_NW, DIR_W, DIR_W, DIR_N, DIR_N, INVALID_DIR, INVALID_DIR, + }; + v->direction = _trackdir_to_direction[trackdir]; + assert(v->direction != INVALID_DIR); + v->state = TrackdirBitsToTrackBits(TrackdirToTrackdirBits(trackdir)); + goto direction_changed; + } /* Choose a direction, and continue if we find one */ track = ChooseShipTrack(v, gp.new_tile, diagdir, tracks); @@ -796,6 +808,7 @@ getout: reverse_direction: v->direction = ReverseDir(v->direction); +direction_changed: /* Remember our current location to avoid movement glitch */ v->rotation_x_pos = v->x_pos; v->rotation_y_pos = v->y_pos; From 4b96244b4d9b1a453db7b7f20f8668ca1b1aa6be Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 12 Oct 2021 18:47:28 +0000 Subject: [PATCH 029/710] Update: Translations from eints romanian: 6 changes by kneekoo --- src/lang/romanian.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index b8ec2e610f..2cfaf8c140 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -3034,6 +3034,7 @@ STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Număr d STR_FRAMERATE_RATE_BLITTER :{BLACK}Rata de reîmprospătare a imaginii: {STRING} STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Numărul de cadre video randate per secundă. STR_FRAMERATE_SPEED_FACTOR :{BLACK}Factorul actual de viteză a jocului: {DECIMAL}x +STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Cât de repede merge jocul în comparație cu viteza așteptată pentru o simulație normală. STR_FRAMERATE_CURRENT :{WHITE}Curent STR_FRAMERATE_AVERAGE :{WHITE}Medie STR_FRAMERATE_MEMORYUSE :{WHITE}Memorie @@ -3672,9 +3673,9 @@ STR_BUY_COMPANY_MESSAGE :{WHITE}Căutăm # Company infrastructure window STR_COMPANY_INFRASTRUCTURE_VIEW_CAPTION :{WHITE}Infrastructura {COMPANY} -STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT :{GOLD}Pătrățele de cale ferată: +STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT :{GOLD}Secțiuni de cale ferată: STR_COMPANY_INFRASTRUCTURE_VIEW_SIGNALS :{WHITE}Semnale -STR_COMPANY_INFRASTRUCTURE_VIEW_ROAD_SECT :{GOLD}Pătrățele cu drumuri: +STR_COMPANY_INFRASTRUCTURE_VIEW_ROAD_SECT :{GOLD}Secțiuni de drum: STR_COMPANY_INFRASTRUCTURE_VIEW_TRAM_SECT :{GOLD}Secțiuni de tramvai: STR_COMPANY_INFRASTRUCTURE_VIEW_WATER_SECT :{GOLD}Suprafață apă: STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS :{WHITE}Canale @@ -3806,7 +3807,7 @@ STR_BUY_VEHICLE_SHIP_CAPTION :Nave noi STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Aeronavă nouă STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Greutate: {GOLD}{WEIGHT_SHORT} -STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost reparații: {GOLD}{CURRENCY_LONG}{BLACK}) Greutate: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost de conversie: {GOLD}{CURRENCY_LONG}{BLACK}) Greutate: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Viteză: {GOLD}{VELOCITY}{BLACK} Putere: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Viteză: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Viteza pe ocean: {GOLD}{VELOCITY} @@ -3820,7 +3821,7 @@ STR_PURCHASE_INFO_COST :{BLACK}Cost: {G STR_PURCHASE_INFO_COST_REFIT :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost reparații: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Greutate: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} Viteză: {GOLD}{VELOCITY} -STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost de reparații: {GOLD}{CURRENCY_LONG}{BLACK}) Viteză: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Cost: {GOLD}{CURRENCY_LONG}{BLACK} (Cost de conversie: {GOLD}{CURRENCY_LONG}{BLACK}) Viteză: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacitate: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vagoane electrificate: {GOLD}+{POWER}{BLACK} Greutate: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Modificabil pentru: {GOLD}{STRING} @@ -4280,7 +4281,7 @@ STR_ORDER_SERVICE :{BLACK}Service STR_ORDER_DROP_GO_ALWAYS_DEPOT :Merge mereu STR_ORDER_DROP_SERVICE_DEPOT :Service dacă este nevoie STR_ORDER_DROP_HALT_DEPOT :Stop -STR_ORDER_SERVICE_TOOLTIP :{BLACK}Sari peste aceastã comandã dacã nu este necesar un service +STR_ORDER_SERVICE_TOOLTIP :{BLACK}Sari peste această comandă dacă nu este necesar un service STR_ORDER_CONDITIONAL_VARIABLE_TOOLTIP :{BLACK}Datele vehiculului pe care se bazează From d66dea5d832cbefd6f584848f3c0c88d99752afd Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 15 Oct 2021 18:47:17 +0000 Subject: [PATCH 030/710] Update: Translations from eints indonesian: 9 changes by bsuseno --- src/lang/indonesian.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 72ac5b0e02..76faf24bc6 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -875,8 +875,8 @@ STR_NEWS_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} memiliki dalam perintahnya sebuah bandara berlandasan yang terlalu pendek STR_NEWS_VEHICLE_IS_GETTING_OLD :{WHITE}{VEHICLE} mulai menua -STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD :{WHITE}{VEHICLE} sudah sangat tua -STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD_AND :{WHITE}{VEHICLE} sudah sangat tua dan perlu segera diganti +STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD :{WHITE}{VEHICLE} menjadi sangat tua +STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD_AND :{WHITE}{VEHICLE} menjadi sangat tua dan perlu segera diganti STR_NEWS_TRAIN_IS_STUCK :{WHITE}{VEHICLE} tidak menemukan arah selanjutnya STR_NEWS_VEHICLE_IS_LOST :{WHITE}{VEHICLE} kehilangan arah STR_NEWS_VEHICLE_IS_UNPROFITABLE :{WHITE}Tahun lalu {VEHICLE} merugi sebanyak {CURRENCY_LONG} @@ -1096,7 +1096,7 @@ STR_DIFFICULTY_LEVEL_SETTING_MAXIMUM_NO_COMPETITORS :{LTBLUE}Jumlah STR_NONE :Tidak ada STR_FUNDING_ONLY :Hanya pendanaan STR_MINIMAL :Minimal -STR_NUM_VERY_LOW :Sangat sedikit +STR_NUM_VERY_LOW :Sangat Sedikit STR_NUM_LOW :Sedikit STR_NUM_NORMAL :Normal STR_NUM_HIGH :Padat @@ -1104,21 +1104,21 @@ STR_NUM_CUSTOM :Bebas STR_NUM_CUSTOM_NUMBER :Custom ({NUM}) STR_VARIETY_NONE :Tidak ada -STR_VARIETY_VERY_LOW :Sangat rendah +STR_VARIETY_VERY_LOW :Sangat Rendah STR_VARIETY_LOW :Rendah STR_VARIETY_MEDIUM :Sedang STR_VARIETY_HIGH :Tinggi -STR_VARIETY_VERY_HIGH :Sangat tinggi +STR_VARIETY_VERY_HIGH :Sangat Tinggi ###length 5 -STR_AI_SPEED_VERY_SLOW :Sangat lambat +STR_AI_SPEED_VERY_SLOW :Sangat Lambat STR_AI_SPEED_SLOW :Lambat STR_AI_SPEED_MEDIUM :Sedang STR_AI_SPEED_FAST :Cepat STR_AI_SPEED_VERY_FAST :Sangat Cepat ###length 6 -STR_SEA_LEVEL_VERY_LOW :Sangat rendah +STR_SEA_LEVEL_VERY_LOW :Sangat Rendah STR_SEA_LEVEL_LOW :Rendah STR_SEA_LEVEL_MEDIUM :Sedang STR_SEA_LEVEL_HIGH :Tinggi @@ -1479,7 +1479,7 @@ STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Kekasaran daratan: {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(hanya TerraGenesis) Memilih frekuensi bukit: Bentang darat rata punya bukit yang lebih sedikit dan lebih lebar. Bentang darat bergunung punya lebih banyak bukit, dan ini mungkin akan terlihat lebih membosankan ###length 4 -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Sangat halus +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Sangat Halus STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :Halus STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :Kasar STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :Sangat Kasar @@ -3172,7 +3172,7 @@ STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}Ganti Ta # SE Map generation STR_SE_MAPGEN_CAPTION :{WHITE}Jenis Skenario STR_SE_MAPGEN_FLAT_WORLD :{WHITE}Pulau datar -STR_SE_MAPGEN_FLAT_WORLD_TOOLTIP :{BLACK}Membuat pulau yang sangat datar +STR_SE_MAPGEN_FLAT_WORLD_TOOLTIP :{BLACK}Membuat dataran yang datar STR_SE_MAPGEN_RANDOM_LAND :{WHITE}Pulau bergelombang STR_SE_MAPGEN_FLAT_WORLD_HEIGHT :{BLACK}Tinggi daratan: STR_SE_MAPGEN_FLAT_WORLD_HEIGHT_DOWN :{BLACK}Turunkan ketinggian dataran satu level. (0 = laut) From 78eece71d9f669057c794f345ff5744145376556 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 16 Oct 2021 22:06:08 +0200 Subject: [PATCH 031/710] Codechange: "set but not used" warning when disabling assert() (#9613) DebugCheckSanity() is unused when asserts are disabled. While at it, use WITH_ASSERT over NDEBUG, as that means we also run this code during beta/RC. --- src/order_cmd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 4c94bedc05..f6e7f77a48 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -609,6 +609,7 @@ bool OrderList::IsCompleteTimetable() const return true; } +#ifdef WITH_ASSERT /** * Checks for internal consistency of order list. Triggers assertion if something is wrong. */ @@ -642,6 +643,7 @@ void OrderList::DebugCheckSanity() const (uint)this->num_orders, (uint)this->num_manual_orders, this->num_vehicles, this->timetable_duration, this->total_duration); } +#endif /** * Checks whether the order goes to a station or not, i.e. whether the @@ -1782,7 +1784,7 @@ void CheckOrders(const Vehicle *v) /* Do we only have 1 station in our order list? */ if (n_st < 2 && message == INVALID_STRING_ID) message = STR_NEWS_VEHICLE_HAS_TOO_FEW_ORDERS; -#ifndef NDEBUG +#ifdef WITH_ASSERT if (v->orders.list != nullptr) v->orders.list->DebugCheckSanity(); #endif From 3b7daca83207636d84bd0232ce91ed8e9616b12f Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 17 Oct 2021 18:14:25 +0100 Subject: [PATCH 032/710] Change: Don't use 'server address' string in server list when displaying an invite code (#9615) --- src/lang/english.txt | 1 + src/network/network_gui.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index ea8908a5e2..a944e9b744 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Landsca STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Map size: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Server version: {WHITE}{RAW_STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{RAW_STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Invite code: {WHITE}{RAW_STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Start date: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Game Script: {WHITE}{RAW_STRING} (v{NUM}) diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 6bca0c756c..76385a087d 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -681,7 +681,8 @@ public: y += FONT_HEIGHT_NORMAL; SetDParamStr(0, sel->connection_string); - DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_ADDRESS); // server address + StringID invite_or_address = StrStartsWith(sel->connection_string, "+") ? STR_NETWORK_SERVER_LIST_INVITE_CODE : STR_NETWORK_SERVER_LIST_SERVER_ADDRESS; + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, invite_or_address); // server address / invite code y += FONT_HEIGHT_NORMAL; SetDParam(0, sel->info.start_date); From 0853c1979ba3c778f0d1628276ed8cbe968b328e Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 17 Oct 2021 19:24:50 +0100 Subject: [PATCH 033/710] Feature: Button to toggle showing advanced signal types (#9617) --- src/lang/english.txt | 1 + src/rail_gui.cpp | 7 +++++++ src/widgets/rail_widget.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/lang/english.txt b/src/lang/english.txt index a944e9b744..83ff026980 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2674,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Waypoints # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Signal Selection +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Toggle showing advanced signal types STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Block Signal (semaphore){}This is the most basic type of signal, allowing only one train to be in the same block at the same time STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Entry Signal (semaphore){}Green as long as there is one or more green exit-signal from the following section of track. Otherwise it shows red STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Exit Signal (semaphore){}Behaves in the same way as a block signal but is necessary to trigger the correct colour on entry & combo pre-signals diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 7ce2f27847..c54e172a0c 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1823,6 +1823,12 @@ public: } break; + case WID_BS_TOGGLE_SIZE: + _settings_client.gui.signal_gui_mode = (_settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL) ? SIGNAL_GUI_PATH : SIGNAL_GUI_ALL; + this->SetSignalUIMode(); + this->ReInit(); + break; + default: break; } @@ -1851,6 +1857,7 @@ static const NWidgetPart _nested_signal_builder_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_BS_CAPTION), SetDataTip(STR_BUILD_SIGNAL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), + NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_BS_TOGGLE_SIZE), SetDataTip(SPR_LARGE_SMALL_WINDOW, STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP), EndContainer(), NWidget(NWID_VERTICAL, NC_EQUALSIZE), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), diff --git a/src/widgets/rail_widget.h b/src/widgets/rail_widget.h index 803599e3a9..2874bac450 100644 --- a/src/widgets/rail_widget.h +++ b/src/widgets/rail_widget.h @@ -79,6 +79,7 @@ enum BuildRailStationWidgets { /** Widgets of the #BuildSignalWindow class. */ enum BuildSignalWidgets { WID_BS_CAPTION, ///< Caption for the Signal Selection window. + WID_BS_TOGGLE_SIZE, ///< Toggle showing advanced signal types. WID_BS_SEMAPHORE_NORM, ///< Build a semaphore normal block signal. WID_BS_SEMAPHORE_ENTRY, ///< Build a semaphore entry block signal. WID_BS_SEMAPHORE_EXIT, ///< Build a semaphore exit block signal. From e09f251fc6da7026922a431def468fdbcee2d3d0 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 17 Oct 2021 18:24:04 +0100 Subject: [PATCH 034/710] Fix #9614: Refresh rate dropdown was still active when vsync was enabled --- src/settings_gui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index ae894cd505..3e7a0fbb12 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -469,6 +469,8 @@ struct GameOptionsWindow : Window { this->SetWidgetLoweredState(WID_GO_VIDEO_VSYNC_BUTTON, _video_vsync); this->SetWidgetDirty(WID_GO_VIDEO_VSYNC_BUTTON); + this->SetWidgetDisabledState(WID_GO_REFRESH_RATE_DROPDOWN, _video_vsync); + this->SetWidgetDirty(WID_GO_REFRESH_RATE_DROPDOWN); break; case WID_GO_BASE_SFX_VOLUME: @@ -608,6 +610,7 @@ struct GameOptionsWindow : Window { if (!gui_scope) return; this->SetWidgetLoweredState(WID_GO_FULLSCREEN_BUTTON, _fullscreen); this->SetWidgetLoweredState(WID_GO_VIDEO_ACCEL_BUTTON, _video_hw_accel); + this->SetWidgetDisabledState(WID_GO_REFRESH_RATE_DROPDOWN, _video_vsync); #ifndef __APPLE__ this->SetWidgetLoweredState(WID_GO_VIDEO_VSYNC_BUTTON, _video_vsync); From 86c295bb3b4833126fe18be8947df38b51cec35b Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 17 Oct 2021 18:44:39 +0100 Subject: [PATCH 035/710] Change: Ignore refresh_rate setting when vsync is enabled --- src/video/video_driver.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index b87dc70529..458c674024 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -316,6 +316,8 @@ protected: std::chrono::steady_clock::duration GetDrawInterval() { + /* If vsync, draw interval is decided by the display driver */ + if (_video_vsync && _video_hw_accel) return std::chrono::microseconds(0); return std::chrono::microseconds(1000000 / _settings_client.gui.refresh_rate); } From 01603d9e470ee329936862c0c4ad676843be23e7 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 17 Oct 2021 21:59:50 +0200 Subject: [PATCH 036/710] Fix 3046a6ce: [Preview] building preview failed to patch LZMA (#9620) The job was started under a non-priv user, which did not have permission to patch the emscripten files required to make LZMA work. --- .github/workflows/preview_build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/preview_build.yml b/.github/workflows/preview_build.yml index ad254a4939..d539611b4e 100644 --- a/.github/workflows/preview_build.yml +++ b/.github/workflows/preview_build.yml @@ -13,8 +13,6 @@ jobs: container: # If you change this version, change the number in the cache step too. image: emscripten/emsdk:2.0.31 - # uid=1001(runner) gid=121(docker) - options: -u 1001:121 steps: - name: Update deployment status to in progress From 5bcdf16dc5539ebc2afd58fc2a348d39d13d53fb Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 17 Oct 2021 22:42:29 +0200 Subject: [PATCH 037/710] Fix 01603d9e: [Preview] publishing preview failed due to recent changes (#9621) Since 01603d9e we run under root, not under github user. In result, the location of "aws" binary changed. --- .github/workflows/preview_build.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/preview_build.yml b/.github/workflows/preview_build.yml index d539611b4e..345a2152db 100644 --- a/.github/workflows/preview_build.yml +++ b/.github/workflows/preview_build.yml @@ -87,18 +87,15 @@ jobs: - name: Publish preview run: | - # setuptools is missing in this Docker image, which breaks installing - # awscli. So we need to do this in two steps to recover sanity. - pip3 install setuptools pip3 install awscli - ~/.local/bin/aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ - ~/.local/bin/aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ - ~/.local/bin/aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ - ~/.local/bin/aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ + aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ + aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ + aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ + aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/ # Invalidate the cache of the CloudFront distribution - ~/.local/bin/aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*" + aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*" env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 53e17d07d24cf54a8aa4cdc81ece4122c61aaabd Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 18 Oct 2021 09:43:14 +0100 Subject: [PATCH 038/710] Fix #9595: Always use plural forms of cargo for subsidy strings (#9619) --- src/lang/english.txt | 10 +++++----- src/subsidy.cpp | 8 ++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 83ff026980..49497a00c4 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -898,12 +898,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Offer of subsidy expired:{}{}{STRING} from {STRING2} to {STRING2} will now not attract a subsidy STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subsidy withdrawn:{}{}{STRING} service from {STRING2} to {STRING2} is no longer subsidised -STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Service subsidy offered:{}{}First {STRING} service from {STRING2} to {STRING2} will attract a {NUM} year subsidy from the local authority! +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Service subsidy offered:{}{}First {STRING} from {STRING2} to {STRING2} will attract a {NUM} year subsidy from the local authority! ###length 4 -STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} service from {STRING2} to {STRING2} will pay 50% extra for the next {NUM} year{P "" s}! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} service from {STRING2} to {STRING2} will pay double rates for the next {NUM} year{P "" s}! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} service from {STRING2} to {STRING2} will pay triple rates for the next {NUM} year{P "" s}! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} service from {STRING2} to {STRING2} will pay quadruple rates for the next {NUM} year{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} from {STRING2} to {STRING2} will pay 50% extra for the next {NUM} year{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} from {STRING2} to {STRING2} will pay double rates for the next {NUM} year{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} from {STRING2} to {STRING2} will pay triple rates for the next {NUM} year{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} from {STRING2} to {STRING2} will pay quadruple rates for the next {NUM} year{P "" s}! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding programme funded by {RAW_STRING} brings 6 months of misery to motorists! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transport monopoly! diff --git a/src/subsidy.cpp b/src/subsidy.cpp index 0b1c1a721f..e8fc951c4e 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -74,13 +74,9 @@ std::pair SetupSubsidyDecodeParam(const Su NewsReferenceType reftype1 = NR_NONE; NewsReferenceType reftype2 = NR_NONE; - /* Choose whether to use the singular or plural form of the cargo name based on how we're printing the subsidy */ + /* Always use the plural form of the cargo name - trying to decide between plural or singular causes issues for translations */ const CargoSpec *cs = CargoSpec::Get(s->cargo_type); - if (mode == SubsidyDecodeParamType::Gui || mode == SubsidyDecodeParamType::NewsWithdrawn) { - SetDParam(parameter_offset, cs->name); - } else { - SetDParam(parameter_offset, cs->name_single); - } + SetDParam(parameter_offset, cs->name); switch (s->src_type) { case ST_INDUSTRY: From 6289b4dd8137cf8d9c7a3529f42ee8568290d559 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 18 Oct 2021 18:48:12 +0000 Subject: [PATCH 039/710] Update: Translations from eints greek: 2 changes by dionisis84 russian: 1 change by Ln-Wolf finnish: 2 changes by hpiirai tamil: 88 changes by Aswn --- src/lang/finnish.txt | 2 + src/lang/greek.txt | 2 + src/lang/russian.txt | 1 + src/lang/tamil.txt | 98 ++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 94 insertions(+), 9 deletions(-) diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 1cc2970d4a..c4fa81dbfc 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Maasto: STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Kartan koko: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Palvelimen versio: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Palvelimen osoite: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Kutsukoodi: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Aloitusvuosi: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Päivämäärä: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Peliskripti: {WHITE}{STRING} (v.{NBSP}{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Reittipisteet # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Opastimien valinta +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Edistyneiden opastintyyppien näyttäminen STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Suojastusopastin (siipiopastin){}Kaikkein alkeellisin opastin, joka sallii vain yhden junan samalla osuudella kerrallaan STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Tulo-opastin (siipiopastin){}Näyttää vihreää aina, kun yksi tai useampi seuraavista poistumisopastimista näyttää vihreää. Muutoin se näyttää punaista STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Poistumisopastin (siipiopastin){}Käyttäytyy samalla tavalla kuin suojastusopastin, mutta on välttämätön oikean valon näyttämiseen tulo- ja yhdistelmäopastimissa diff --git a/src/lang/greek.txt b/src/lang/greek.txt index b800390ceb..9b6423e868 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -2364,6 +2364,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Τοπ STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Μέγεθος χάρτη: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Έκδοση διακομιστή: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Διεύθυνση διακομιστή: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Κωδικός πρόσκλησης: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Ημερομηνία έναρξης: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Τρέχουσα ημερομηνία: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script Παιχνιδιού: {WHITE}{STRING} (v{NUM}) @@ -2780,6 +2781,7 @@ STR_STATION_CLASS_WAYP :Σημείο κ # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Επιλογή Σηματοδότη +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Εναλλαγή εμφάνισης προχωρημένων τύπων σηματοδοτών STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Σηματοδότες Τμήματος (σηματοφόρος){}Αυτός είναι ο πιο βασικός τύπος σηματοδότη, επιτρέποντας μόνο ένα τρένο να βρίσκεται σε κάθε τμήμα κάθε φορά STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Σηματοδότης-Εισόδου (σηματοφόρος){}Πράσινο όσο υπάρχει ένας ή περισσότεροι πράσινοι σηματοδότες-εξόδου στο επόμενο τμήμα γράμμης. Διαφορετικά δείχνει κόκκινο STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Σηματοδότης-Εξόδου (σηματοφόρος){}Συμπεριφέρεται με τον ίδιο τρόπο οπως οι σηματοδότες τμήματος αλλά είναι απαραίτητο να τεθεί το σωστό χρώμα στους προ-σηματοδότες είσοδου και συνδυαστικούς diff --git a/src/lang/russian.txt b/src/lang/russian.txt index ec02604eda..53368c6501 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -2408,6 +2408,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Лан STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Размер карты: {WHITE}{COMMA}×{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Версия сервера: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Адрес сервера: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Код-приглашение: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Дата начала: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Текущая дата: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Игровой скрипт: {WHITE}{STRING} (v{NUM}) diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 15b2811f26..3d6b13dbfb 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -160,7 +160,7 @@ STR_ABBREV_BATTERIES :{TINY_FONT}BA STR_ABBREV_PLASTIC :{TINY_FONT}PL STR_ABBREV_FIZZY_DRINKS :{TINY_FONT}FZ STR_ABBREV_NONE :{TINY_FONT}NO -STR_ABBREV_ALL :{TINY_FONT}ALL +STR_ABBREV_ALL :{TINY_FONT}அனைத்தும் # 'Mode' of transport for cargoes STR_PASSENGERS :{COMMA} பயணி{P "" கள்} @@ -194,6 +194,7 @@ STR_COLOUR_RANDOM :ஏதோவொ STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}mph STR_UNITS_VELOCITY_METRIC :{COMMA}{NBSP}km/h STR_UNITS_VELOCITY_SI :{COMMA}{NBSP}m/s +STR_UNITS_VELOCITY_GAMEUNITS :{DECIMAL}{NBSP}வட்டங்கள்/நாளிற்கு STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}hp STR_UNITS_POWER_METRIC :{COMMA}{NBSP}hp @@ -310,12 +311,14 @@ STR_SORT_BY_RANGE :வரையற STR_SORT_BY_POPULATION :மக்கள் தொகை STR_SORT_BY_RATING :மதிப்பீடு STR_SORT_BY_NUM_VEHICLES :வாகங்களின் எண்ணிக்கை +STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :இந்த ஆண்டின் சராசரி இலாபம் # Group by options for vehicle list STR_GROUP_BY_NONE :ஒன்றுமில்லை STR_GROUP_BY_SHARED_ORDERS :பகிரப்பட்ட கட்டளைகள் # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}கட்டளைகள் # Tooltips for the main toolbar ###length 31 @@ -764,9 +767,11 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}அன STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}கடைசி தகவல் அல்லது செய்தி அறிக்கையினை காட்டு STR_STATUSBAR_COMPANY_NAME :{SILVER}- - {COMPANY} - - STR_STATUSBAR_PAUSED :{YELLOW}* * நிறுத்தப்பட்டுள்ளது * * +STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * இடைநிறுத்தப்பட்டது (இணைப்பு வரைபடம் புதுப்பிப்புக்காக காத்திருக்கிறது) * * STR_STATUSBAR_AUTOSAVE :{RED}பதிவுசெய்தல் STR_STATUSBAR_SAVING_GAME :{RED}* * ஆட்டம் பதிவாகிறது * * +STR_STATUSBAR_SPECTATOR :{WHITE}(பார்வையாளர்) # News message history STR_MESSAGE_HISTORY :{WHITE}செய்தி வரலாறு @@ -863,7 +868,10 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO :{WHITE}{STATION STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION} இப்போது {STRING} {STRING} ஆகியவற்றை ஏற்றுக்கொள்கிறது STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}மானியம் இனிமேல் தரப்படாது:{}{}{STRING} இருந்து {STRING} {STRING} வரை போக்குவரத்திற்கு மானியம் வழங்கப்படாது +STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}மானியம் திரும்பப் பெறப்பட்டது :{}{} {STRING} இருந்து {STRING} வரை செல்லும் {STRING} சேவையிற்கு இனி மானியம் இல்லை ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}சேவையிற்கான மானியம் {0:STRING} இற்கு வழங்கப்படுகிறது!{}{} {2:STRING} முதல் {3:STRING} வரையிலான {1:STRING} சேவை அடுத்த {4:NUM} ஆண்டு{P "" களு}க்கு 50% கூடுதல் கட்டணம் செலுத்தும்! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}{0:STRING} இற்கு சேவை மானியம் வழங்கப்படுகிறது!{}{}{2:STRING} முதல் {3:STRING} வரையிலான {1:STRING} சேவை அடுத்த {4:NUM} ஆண்டு{P "" களு}க்கு 4 மடங்கு கட்டணம் செலுத்தும்! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}{TOWN}இல் சாலை போக்குவரத்து பாதிப்பு!{}{}Road rebuilding programme funded by {STRING} brings 6 months of misery to motorists! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}போக்குவரத்து தனியுரிமை! @@ -926,7 +934,7 @@ STR_GAME_OPTIONS_CURRENCY_MYR :மலேசி STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :இடப்பக்கம் ஒட்டு STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :வலப்பக்கம் ஒட்டு -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}நகரங்களின் பெயர்கள் +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}நகரங்களின் பெயர்கள்: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}நகர பெயர்கள் பாணியினைத் தேர்ந்தெடுக்கவும் ###length 21 @@ -965,6 +973,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :ஒவ்வொ STR_GAME_OPTIONS_LANGUAGE :{BLACK}மொழி STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}பயன்படுத்தப்போகும் மொழியினை தேர்ந்தெடு +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% நிறைவுற்றது) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}முழு படம் STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}OpenTTD-ஐ முழுத்திரையில் விளையாட இந்த கட்டத்தினை சொடுக்கவும் @@ -975,9 +984,12 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :மற்றவ STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}இடைமுக அளவு +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}பயன்படுத்த இடைமுக உறுப்பு அளவை தேர்ந்தெடுக்கவும் +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(தானாக கண்டறி) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :சராசரி STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :இரண்டு மடங்கு STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :நான்கு மடங்கு @@ -1089,6 +1101,7 @@ STR_TERRAIN_TYPE_FLAT :சமமான STR_TERRAIN_TYPE_HILLY :உயர்ந்து STR_TERRAIN_TYPE_MOUNTAINOUS :மலைகளாக STR_TERRAIN_TYPE_ALPINIST :அல்பைனிசிட்டு +STR_TERRAIN_TYPE_CUSTOM :தனிப்பயன் உயரம் ###length 3 STR_CITY_APPROVAL_PERMISSIVE :அனுமதிதரும் @@ -1102,6 +1115,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}அம STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}வடிகட்டி: 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_DEFAULT_VALUE :{LTBLUE}இயல்பான மதிப்பு: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}அமைப்பு வகை: {ORANGE}{STRING} @@ -1110,6 +1124,7 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :ஆட்டத STR_CONFIG_SETTING_TYPE_GAME_INGAME :ஆட்டத்தின் அமைப்புகள் (பதிவு செய்யப்பட்டது; தற்போதைய ஆட்டத்தினை மட்டுமே மாற்றும்) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :நிறுவன அமைப்புகள் (பதிவு செய்யப்பட்டது; புதிய ஆட்டங்களை மட்டுமே மாற்றும்) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :நிறுவன அமைப்புகள் (பதிவு செய்யப்பட்டது; தற்போதைய நிறுவனத்தை மட்டுமே மாற்றும்) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}இந்த செயல் அனைத்து விளையாட்டு அமைப்புகளையும் அவற்றின் இயல்புநிலை மதிப்புகளுக்கு மீட்டமைக்கும்.{}நீங்கள் நிச்சயமாக தொடர விரும்புகிறீர்களா?? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}பகுப்பு: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}வகை: @@ -1167,7 +1182,9 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :அடிக் STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :மானியம் பெருக்கு: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :மானியம் வழங்கப்பட்ட பணிகளுக்கு எவ்வுளவு தர வேண்டும் என்பதினை அமை +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :மானியம் வழங்கப்படும் ஆண்டுகளின் எண்ணிக்கையை அமை +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} ஆண்டு{P "" கள்} ###setting-zero-is-special STR_CONFIG_SETTING_CONSTRUCTION_COSTS :கட்டுமானச் செலவுகள்: {STRING} @@ -1231,6 +1248,7 @@ STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :மற்ற STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :எங்கேயாவது STR_CONFIG_SETTING_INDUSTRY_PLATFORM :தொழிற்சாலைகள் அருகே உள்ள சம நிலங்கள்: {STRING} +STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :ஒரு தொழிலைச் சுற்றியுள்ள தட்டையான இடத்தின் அளவு. தடங்கள் மற்றும் பலவற்றைக் கட்டுவதற்கு ஒரு தொழிற்துறையைச் சுற்றி வெற்று இடம் இருப்பதை இது உறுதி செய்கிறது STR_CONFIG_SETTING_MULTIPINDTOWN :ஒரே மாதிரியான தொழிற்சாலைகளை அதே நகரத்தில் நிறுவ அனுமதி: {STRING} @@ -1259,6 +1277,7 @@ STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT :முக்க STR_CONFIG_SETTING_AUTOSCROLL_EVERY_VIEWPORT :ஒவ்வொரு திரைபார்வையும் STR_CONFIG_SETTING_BRIBE :நகராட்சிக்கு கையூட்டுத் தர அனுமதி: {STRING} +STR_CONFIG_SETTING_BRIBE_HELPTEXT :உள்ளூர் நகர அதிகாரத்திற்கு லஞ்சம் கொடுக்க நிறுவனங்களை அனுமதிக்கவும். லஞ்சம் ஒரு ஆய்வாளரால் கவனிக்கப்பட்டால், நிறுவனம் ஆறு மாதங்களுக்கு நகரத்தில் செயல்பட முடியாது STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :போக்குவரத்து உரிமைகளை விற்க அனுமதிக்கவும்: {STRING} @@ -1339,12 +1358,14 @@ STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS :புவித STR_CONFIG_SETTING_TERRAIN_TYPE :நிலவகை: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY :தொழிற்சாலை அடர்த்தி: {STRING} +STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :விளையாட்டின் போது எத்தனை தொழில்கள் உருவாக்கப்பட வேண்டும் மற்றும் எந்த நிலை பராமரிக்கப்பட வேண்டும் என்பதை அமைக்கவும் STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :வரைபட எல்லையிலிருந்து எண்ணெய் தொழிற்சாலைகள் இருக்கக்கூடிய தூரம்: {STRING} STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :எண்ணெய் சுத்திகரிப்பு நிலையங்கள் வரைபடத்தின் எல்லைகளில் மட்டுமே கட்ட இயலும், அதாவது தீவு வரைபடங்களில் கடற்கரைகளில் கட்ட இயலும் STR_CONFIG_SETTING_SNOWLINE_HEIGHT :பனி-கோடின் உயரம்: {STRING} +STR_CONFIG_SETTING_SNOW_COVERAGE :பனி முழுத் தழுவு அளவு: {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :நிலப்பகுதியின் சமனில்லாத நிலை (புவிதுவக்கம் மட்டும்) : {STRING} @@ -1421,6 +1442,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :ஒரு அ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :ஒரு அழுத்தம் (உடனடியாக) ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :கேள் ###length 3 STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_COMMAND :Command+Click @@ -1450,11 +1472,13 @@ STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_ALL_ACTIONS :அனைத் STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS :வாகனப் பட்டியலினைப் பயன்படுத்தவும்: {STRING} +STR_CONFIG_SETTING_LOADING_INDICATORS :ஏற்றுதல் குறிகாட்டிகளைப் பயன்படுத்தவும்: {STRING} STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :வாகனங்களை ஏற்றுவதற்கு அல்லது இறக்குவதற்கு மேலே ஏற்றுதல் குறிகாட்டிகள் காட்டப்படுகிறதா என்பதைத் தேர்ந்தெடுக்கவும் STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :கால அட்டவணையை நாட்களில் அல்லாமல் சொடுக்குகளில் காட்டு: {STRING} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :கால அட்டவணைகளில் காலங்களைக் காட்டவும்: {STRING} +STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :எதிர்பார்த்த வருகை மற்றும் புறப்படும் நேரங்களை கால அட்டவணையில் காட்டவும் STR_CONFIG_SETTING_QUICKGOTO :வாகன கட்டளைகளை விரிவாக உருவாக்கவும்: {STRING} @@ -1542,10 +1566,12 @@ STR_CONFIG_SETTING_SERVINT_VALUE :{COMMA}{NBSP} STR_CONFIG_SETTING_SERVINT_DISABLED :செயலிழக்க செய்யப்பட்டது STR_CONFIG_SETTING_NOSERVICE :பழுதுகள் இல்லையெனில் பழுதுபார்த்தலினை செயலிழக்கவும்: {STRING} +STR_CONFIG_SETTING_NOSERVICE_HELPTEXT :இயக்கப்படும் போது, வாகனங்கள் உடைக்க முடியாவிட்டால் சேவை செய்யப்படாது STR_CONFIG_SETTING_WAGONSPEEDLIMITS :பெட்டி வேக கட்டுப்பாட்டினை செயல்படுத்தவும்: {STRING} STR_CONFIG_SETTING_DISABLE_ELRAILS :மின்சார இரயில்களை அனுமதிக்காதே: {STRING} +STR_CONFIG_SETTING_DISABLE_ELRAILS_HELPTEXT :இந்த அமைப்பை இயக்குவதால், மின்சார இயந்திரங்கள் இயங்குவதற்கான தடங்களை மின்மயமாக்குவதற்கான தேவையை முடக்குகிறது STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN :விளையாடுபவரின் நிலையத்திற்கு முதல் வாகனம் வருகை புரிந்தது: {STRING} STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN_HELPTEXT :முதல் வாகனம் புதிய வீரர் நிலையத்திற்கு வரும்போது செய்தித்தாளைக் காண்பி @@ -1616,8 +1642,10 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :தானாக STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :வெவேறு சிக்னல் வகைகளுள் மாற்றவும்: {STRING} ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :பாதை சிக்னல்கள் மட்டும் -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :அனைத்தும் +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :தெரிகிர அனைத்தும் +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :சிக்னல் வகைகளை காட்டு: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :சிக்னல் கருவிப்பட்டியில் எந்த சிக்னல் வகைகள் காட்டப்படுகின்றன என்பதை தேர்வு செய்யவும் ###length 2 STR_CONFIG_SETTING_TOWN_LAYOUT :புதிய நகரங்களுக்கான சாலை கட்டங்கள்: {STRING} @@ -1693,6 +1721,7 @@ STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :ஆட்டத STR_CONFIG_SETTING_DISTRIBUTION_PAX :பயணிகள் பரிமாற்றம் வகை: {STRING} STR_CONFIG_SETTING_DISTRIBUTION_MAIL :அஞ்சல் பரிமாற்றம் வகை: {STRING} +STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT :மற்ற சரக்கு வகுப்புகளுக்கான விநியோக முறை: {STRING} ###length 3 STR_CONFIG_SETTING_DISTRIBUTION_MANUAL :கைமுறை STR_CONFIG_SETTING_DISTRIBUTION_ASYMMETRIC :சமச்சீர்மையிலா @@ -1708,6 +1737,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :வேக அ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_IMPERIAL :இம்பீரியல் (mph) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :மெட்ரிக் (கி.மீ/மணிநேரம்) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_SI :SI (மீ/நொடி) +STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_GAMEUNITS :விளையாட்டு அலகுகள் (ஓடுகள்/நாளிற்கு) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :வாகன திறன் பிரிவுகள்: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :ஒரு வாகனத்தின் சக்தி பயனர் இடைமுகத்தில் காட்டப்படும் போதெல்லாம், தேர்ந்தெடுக்கப்பட்ட அலகுகளில் அதைக் காட்டு @@ -1717,6 +1747,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_METRIC :மெட்ர STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_SI :SI (கி.வாட்) STR_CONFIG_SETTING_LOCALISATION_UNITS_WEIGHT :எடை பிரிவுகள்: {STRING} +STR_CONFIG_SETTING_LOCALISATION_UNITS_WEIGHT_HELPTEXT :பயனர் இடைமுகத்தில் ஒரு எடை காட்டப்படும் போதெல்லாம், தேர்ந்தெடுக்கப்பட்ட அலகுகளில் அதைக் காட்டுங்கள் ###length 3 STR_CONFIG_SETTING_LOCALISATION_UNITS_WEIGHT_IMPERIAL :இம்பீரியல் (சுருக்கம் ட/டன்) STR_CONFIG_SETTING_LOCALISATION_UNITS_WEIGHT_METRIC :மெட்ரிக் (ட/டன்) @@ -1761,6 +1792,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}தொ STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}சரக்கு பரிமாற்றம் STR_CONFIG_SETTING_AI :{ORANGE}போட்டியாளர்கள் STR_CONFIG_SETTING_AI_NPC :{ORANGE}கணினி வீரர்கள் +STR_CONFIG_SETTING_NETWORK :{ORANGE}இணையம் STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :இரயில்களுக்கான வழிகண்டுபிடிப்பான்: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :இரயில்கள் பயன்படுத்தப்போகும் வழிகண்டுபிடிப்பான் @@ -1769,6 +1801,7 @@ STR_CONFIG_SETTING_PATHFINDER_FOR_ROAD_VEHICLES_HELPTEXT :சாலை STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS :கப்பல்களுக்கான வழிகண்டுபிடிப்பான்: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS_HELPTEXT :கப்பல்கள் பயன்படுத்தப்போகும் வழிகண்டுபிடிப்பான் STR_CONFIG_SETTING_REVERSE_AT_SIGNALS :சிக்னல்களில் தானியங்கி மீட்சி: {STRING} +STR_CONFIG_SETTING_REVERSE_AT_SIGNALS_HELPTEXT :இரயில்கள் நீண்ட நேரம் காத்திருந்தால், சிக்னலில் திரும்புவதற்கு அனுமதிக்கவும் ###length 2 STR_CONFIG_SETTING_PATHFINDER_NPF :NPF STR_CONFIG_SETTING_PATHFINDER_YAPF_RECOMMENDED :YAPF {BLUE}(பரிந்துரைக்கப்பட்டது) @@ -1791,6 +1824,7 @@ STR_CONFIG_ERROR_INVALID_BASE_MUSIC_NOT_FOUND :{WHITE}... அ STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}நினைவாற்றல் நிறைந்துவிட்டது # Video initalization errors +STR_VIDEO_DRIVER_ERROR :{WHITE}வீடியோ அமைப்புகளில் பிழை... # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -1831,6 +1865,7 @@ STR_INTRO_TRANSLATION :{BLACK}இந # Quit window STR_QUIT_CAPTION :{WHITE}வெளியேறு +STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}நீங்கள் நிச்சயமாக OpenTTD இலிருந்து வெளியேற விரும்புகிறீர்களா? STR_QUIT_YES :{BLACK}ஆமாம் STR_QUIT_NO :{BLACK}இல்லை @@ -1986,6 +2021,7 @@ STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}இன STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}கடவுச்சொலினால் தடுக்கப்பட்டுள்ளது! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}சர்வர் இணைப்பில் இல்லை STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}சர்வர் நிரம்பி விட்டது +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}இந்த சர்வரில் இருந்து நீங்கள் தடை செய்யப்பட்டுள்ளீர்கள் STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}பதிப்பு ஒத்துவரவில்லை STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF ஒத்துவரவில்லை @@ -1993,6 +2029,7 @@ STR_NETWORK_SERVER_LIST_JOIN_GAME :{BLACK}ஆட STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}சர்வரினை புதுப்பிக்கவும் STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}சர்வரின் விவரத்தினை புதுப்பிக்கவும் +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET :{BLACK}இணையத்தில் தேடு STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}உள்ளூர் பகுதி இணையத்தில் தேடு STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}சர்வரினை இணை STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}சர்வரினை ஆரம்பி @@ -2038,15 +2075,26 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}சர STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}நிற்வனம் காக்கப்பட்டுள்ளது. கடவுச்சொல்லினை இடவும் # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :விளையாடுவோர் பட்டியல் +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :இணைய வீரர்கள் # Network client list +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}உங்கள் சேவையகத்தின் பெயரைத் திருத்தவும் +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}உங்கள் சேவையகத்தை மற்றவர்கள் எப்படி அணுகலாம் +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}உங்கள் வீரரின் பெயர் +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}இந்த நிறுவனத்திற்கான நிர்வாக நடவடிக்கைகள் +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(புதிய நிறுவனம்) +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} வாடிக்கையாளர்{P "" கள்} / {NUM} நிறுவன{P ம் ங்கள்} # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}தொலைக்கோடியான வீரர்களால் இணைய முடியவில்லை +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}NAT-யிற்கு பின்னால் + +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :கடவுச்சொல் திறத்தல் - +STR_NETWORK_ASK_RELAY_NO :{BLACK}இல்லை +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}ஆம், இந்த முறை மட்டும் STR_NETWORK_SPECTATORS :கவனிப்பவர்கள் @@ -2074,10 +2122,12 @@ STR_NETWORK_CHAT_TO_COMPANY :[Team] பெ STR_NETWORK_CHAT_CLIENT :[Private] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Private] பெறுநர் {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[All] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}இணைய அரட்டையிற்கு வார்தைகளை இடவும் # Network messages -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}அழைப்பிற்கு சர்வர் பதிலளிக்கவில்லை +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}எந்த இணைய சாதனமும் கண்டறியப்படவில்லை +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}அழைப்பிற்கு சர்வர் பதிலளிக்கவில்லை அல்லது நேரம் கடந்துவிட்டது STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}NewGRF கோப்பு பிழையினால் ணைக்க இயலவில்லை STR_NETWORK_ERROR_DESYNC :{WHITE}இணயம்-ஆட்டம் சமமாதல் தோல்வியடைந்தது STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}இணைய ஆட்டத்தின் தொடர்பு துண்டிக்கப்பட்டது @@ -2088,6 +2138,7 @@ STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}தவ STR_NETWORK_ERROR_SERVER_FULL :{WHITE}சர்வர் முழு பயன்பாட்டில் உள்ளது STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}இந்த சர்வரில் இருந்து நீங்கள் தடை செய்யப்பட்டுள்ளீர்கள் STR_NETWORK_ERROR_KICKED :{WHITE}இந்த விளையாட்டிலிருந்து நீங்கள் வெளியேற்றப்பட்டீர்கள் +STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}காரணம்: {STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}இந்த சர்வரில் ஏமாற்ற இயலாது STR_NETWORK_ERROR_TOO_MANY_COMMANDS :{WHITE}சர்வரிற்கு அளவிற்கு அதிகமான கட்டளைகளினை அனுப்பிக்கொண்டிருந்தீர்கள் STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}கடவுச்சொல்லினை இட அதிக நேரம் எடுத்துக்கொண்டீர்கள் @@ -2119,6 +2170,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :சரியா STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :பொதுவான காலப்பிழை STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :வரைபடம் பதிவிறக்கமாக அதிக நேரம் ஆகியது STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :படத்தினைத் திறக்க அதிக நேரம் ஆகியது +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :தவறான வாடிக்கையாளர் பெயர் # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2143,12 +2195,13 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {STRING} STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} பார்வையாளராக சேர்ந்துள்ளார் STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} புதிய நிறுவனம் (#{2:NUM})வை துவக்கி உள்ளார் STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} ஆட்டத்தை விட்டு வெளியேரினார் ({2:STRING}) -STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} அவரது/அவளது பெயரினை {STRING} என்று மாற்றினார் +STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} அவரது பெயரினை {STRING} என்று மாற்றினார் STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} தங்கள் நிறுவனத்திற்கு {1:STRING} {2:CURRENCY_LONG} கொடுத்தார் STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}சர்வர் ஆட்டத்தினை முடித்தது STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}சர்வர் மீண்டும் தொடங்குகிறது...{}சற்று பொறுக்கவும்... STR_NETWORK_MESSAGE_KICKED :*** {STRING} வெளியேற்றப்பட்டார். காரணம்: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}சர்வர் பதிவு தோல்வி # Content downloading window STR_CONTENT_TITLE :{WHITE}கோப்புகள் பதிவிறக்கம் செய்யப்படுகின்றன @@ -2220,6 +2273,7 @@ STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}OpenTTD STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}ஆம், அசையூட்டங்களை பதிவிறக்கம் செய் STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}இல்லை, OpenTTD-ஐ விட்டு வெளியேறு +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}OpenTTD-ஐ விட்டு வெளியேறு # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}ஒளி அமைப்புகள் @@ -2301,6 +2355,7 @@ STR_STATION_CLASS_WAYP :பாதைப # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}சிக்னல் தேர்ந்தெடுத்தல் +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}மேம்பட்ட சிக்னல் வகைகளைக் காட்டவும்/மறைக்கவும் STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}சிக்னல்களை இழுக்கும் தொளைவு # Bridge selection window @@ -2365,7 +2420,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_LOCKS_TOOLTIP :{BLACK}நீ STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP :{BLACK}கப்பல் பணிமனையினைக் கட்டவும்(கப்பல்களை வாங்க மற்றும் பழுதுபார்க்க). Shift அழுத்தினால் கட்டுமான/செலவு மதிப்பீடு காட்டப்படும் STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}கப்பல் துறைமுகத்தினைக் கட்டவும். Ctrl அழுத்தினால் துறைமுகங்களினை இணைக்கலாம். Shift அழுத்தினால் கட்டுமான/செலவு மதிப்பீடு காட்டப்படும் STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}நீர்வாழ்வை உருவாக்குங்கள். Shift கட்டிடம் கட்டுதல் / செலவு மதிப்பீட்டைக் காட்டும் -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}ஆறுகளை அமைக்கவும் +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}ஆறுகளை அமைக்கவும். Ctrl அழுத்தினால் குறுக்கான பகுதியைத் தேர்ந்தெடுக்கலாம் # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}கப்பல் பணிமனை திசையமைப்பு @@ -2478,6 +2533,7 @@ STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}கட STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}நிறுவு STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}அனைத்து தொழிற்சாலைகளையும் அகற்றவும் STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_CAPTION :{WHITE}அனைத்து தொழிற்சாலைகளையும் அகற்றவும் +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :{YELLOW}நீங்கள் நிச்சயமாக அனைத்து தொழிற்சாலைகளையும் அகற்ற விரும்புகிறீர்களா? # Industry cargoes window STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION :{WHITE}{STRING} தொழிற்சாலையிற்கான தொழிற்சாலைத் தொடர் @@ -2622,6 +2678,7 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION :{WHITE}பிரேம் வீதம் +STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{BLACK}உருவகப்படுத்துதலின் வேகம்: {STRING} STR_FRAMERATE_SPEED_FACTOR :{BLACK}தற்போதைய ஆட்டத்தின் வேக அமைப்பு: {DECIMAL} மடங்கு STR_FRAMERATE_AVERAGE :{WHITE}சராசரி @@ -2679,6 +2736,7 @@ STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}எந STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: {WHITE}{STRING} STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}ஏற்கனவே உள்ள கோப்பை மேலெழுத விரும்புகிறீர்களா? +STR_SAVELOAD_DIRECTORY :{STRING} (கோப்பகம்) STR_SAVELOAD_OSKTITLE :{BLACK}பதிவு-ஆட்டத்திற்கு பெயர் ஒன்றினை இடு @@ -2690,6 +2748,8 @@ STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}நக STR_MAPGEN_DATE :{BLACK}தேதி: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}தொழிற்சாலைகளின் எண்ணிக்கை: STR_MAPGEN_SNOW_COVERAGE :{BLACK}பனி முழுத் தழுவு அளவு: +STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}பாலைவன முழுத் தழுவு அளவினை பத்து சதவிகிதம் அதிகப்படுத்து +STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_LAND_GENERATOR :{BLACK}பூமி உருவாக்குனர்: STR_MAPGEN_TERRAIN_TYPE :{BLACK}நிலவகை: STR_MAPGEN_QUANTITY_OF_SEA_LAKES :{BLACK}கடல் மட்டம்: @@ -2715,6 +2775,7 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}உய STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}அளவு: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} +STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}பாலைவன முழுத் தழுவு அளவு (%) STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}தொடங்கும் வருடத்தினை மாற்று # SE Map generation @@ -2766,6 +2827,7 @@ STR_NEWGRF_SETTINGS_MOVEUP :{BLACK}மே STR_NEWGRF_SETTINGS_MOVEUP_TOOLTIP :{BLACK}தேர்ந்தெடுக்கப்பட்ட NewGRF கோப்பினை பட்டியலில் மேல் நகர்த்து STR_NEWGRF_SETTINGS_MOVEDOWN :{BLACK}கீழ் இறக்கு STR_NEWGRF_SETTINGS_MOVEDOWN_TOOLTIP :{BLACK}தேர்ந்தெடுக்கப்பட்ட NewGRF கோப்பினை பட்டியலில் கீழ் இறக்கு +STR_NEWGRF_SETTINGS_UPGRADE :{BLACK}தரவேற்று STR_NEWGRF_SETTINGS_FILE_TOOLTIP :{BLACK}நிறுவியுள்ள NewGRF கோப்புகளின் ஓர் பட்டியல். STR_NEWGRF_SETTINGS_SET_PARAMETERS :{BLACK}குணாதிசயங்களை அமை @@ -2936,6 +2998,7 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :நகரத் # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}{TOWN} நகராட்சி STR_LOCAL_AUTHORITY_ZONE :{BLACK}மண்டலம் +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}உள்ளூர் அதிகார எல்லைக்குள் மண்டலத்தைக் காட்டு STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}போக்குவரத்து நிறுவன தரங்கள்: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}செயற்பாடுகள்: @@ -2958,7 +3021,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}சி STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}சராசரி விளம்பர பிரசாரத்தினைத் தொடங்கு, இதனால் பயணிகள் மற்றும் சரக்குகள் உங்களது போக்குவரத்து நிறுவனத்தினைப் பயன்படுத்துவர்.{}செலவு: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}பெரிய விளம்பர பிரசாரத்தினைத் தொடங்கு, இதனால் பயணிகள் மற்றும் சரக்குகள் உங்களது போக்குவரத்து நிறுவனத்தினைப் பயன்படுத்துவர்.{}செலவு: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}நகர்ப்புற சாலை நெட்வொர்க்கின் புனரமைப்புக்கு நிதியளிக்கவும். 6 மாதங்கள் வரை சாலை போக்குவரத்துக்கு கணிசமான இடையூறு ஏற்படுகிறது.{}செலவு: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}தங்கள் நிறுவனத்தின் பெருமைக்காக ஓர் சிலையினைக் கட்டவும்.{}செலவு: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}தங்கள் நிறுவனத்தின் பெருமைக்காக ஓர் சிலையினைக் கட்டவும்.{}நிலையத்திற்கு நிரந்தர ஊக்கத்தை அளிக்கிறது.{}செலவு: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} குறிக்கோள்கள் @@ -3008,6 +3071,7 @@ STR_SUBSIDIES_SUBSIDISED_FROM_TO :{ORANGE}{STRING # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY} கதைப் புத்தகம் STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}உலக கதைப் புத்தகம் +STR_STORY_BOOK_SPECTATOR :உலகளாவிய கதை புத்தகம் STR_STORY_BOOK_TITLE :{YELLOW}{STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :பக்கம் {NUM} STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}இந்த கீழ்தோன்றும் பட்டியலில் ஒரு குறிப்பிட்ட பக்கத்தைத் தேர்ந்தெடுப்பதன் மூலம் செல்லவும். @@ -3062,6 +3126,7 @@ STR_STATION_VIEW_NONSTOP :{YELLOW}{CARGO_ STR_STATION_VIEW_GROUP_S_V_D :மூலம்-வழியாக-சேருமிடம் STR_STATION_VIEW_GROUP_S_D_V :மூல-சேருமிடம்-வழியாக +STR_STATION_VIEW_GROUP_V_S_D :வழியாக-மூலம்-சேருமிடம் STR_STATION_VIEW_GROUP_D_S_V :சேருமிடம்-மூலம்-வழியாக STR_STATION_VIEW_GROUP_D_V_S :மூல-வழியாக-இலக்கு @@ -3158,6 +3223,7 @@ STR_COMPANY_VIEW_RELOCATE_HQ :{BLACK}HQ வ STR_COMPANY_VIEW_INFRASTRUCTURE_BUTTON :{BLACK}விவரங்கள் STR_COMPANY_VIEW_INFRASTRUCTURE_TOOLTIP :{BLACK}விவரமான கட்டட எண்ணிக்கைகளை காட்டு STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}பணத்தை வழங்கு +STR_COMPANY_VIEW_GIVE_MONEY_TOOLTIP :{BLACK}இந்த நிறுவனத்திற்கு பணம் கொடு STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}புதிய முகம் STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}மேலாளருக்கு புதிய முகத்தினைத் தேர்ந்தெடு @@ -3174,6 +3240,7 @@ STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}இந STR_COMPANY_VIEW_COMPANY_NAME_QUERY_CAPTION :நிறுவனத்தின் பெயர் STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :மேலாளரின் பெயர் +STR_COMPANY_VIEW_GIVE_MONEY_QUERY_CAPTION :நீங்கள் கொடுக்க விரும்பும் பணத்தை உள்ளிடவும் STR_BUY_COMPANY_MESSAGE :{WHITE}எங்கள் நிறுவனத்தை கையகப்படுத்த ஒரு போக்குவரத்து நிறுவனத்தை நாங்கள் தேடுகிறோம்.{}{}நீங்கள் {COMPANY}யை {CURRENCY_LONG} வாங்க விரும்புகிறீர்களா? @@ -3192,8 +3259,10 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}{CURRENC # Industry directory STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}தொழிற்சாலைகள் STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- ஒன்றுமில்லை - +STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{STRING}{YELLOW} ({COMMA}% கொண்டு செல்லப்பட்டது){BLACK} STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUSTRY} {STRING} +STR_INDUSTRY_DIRECTORY_ITEM_PROD2 :{ORANGE}{INDUSTRY} {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}ஏற்றுக்கொள்ளப்படும் சரக்குகள்: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}உற்பத்தி செய்யப்பட்ட சரக்குகள்: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :அனைத்து சரக்கு வகைகள் @@ -3267,6 +3336,7 @@ STR_GROUP_DELETE_TOOLTIP :{BLACK}தே STR_GROUP_RENAME_TOOLTIP :{BLACK}தேர்ந்தெடுக்கப்பட்ட குழுவின் பெயரினை மாற்றவும் STR_GROUP_LIVERY_TOOLTIP :{BLACK}தேர்ந்தெடுக்கப்பட்ட குழுவின் நிறத்தினை மாற்றவும் +STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}இந்தக் குழுவினை நீக்கு STR_GROUP_DELETE_QUERY_TEXT :{WHITE}இந்த குழுவையும் சந்ததியினரையும் நீக்க விரும்புகிறீர்களா? STR_GROUP_ADD_SHARED_VEHICLE :பகிர்ந்த வாகனங்களை சேர்க்கவும் @@ -3309,6 +3379,7 @@ STR_PURCHASE_INFO_RELIABILITY :{BLACK}அத STR_PURCHASE_INFO_COST :{BLACK}விலை: {GOLD}{CURRENCY_LONG} STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}எடை: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}செலவு: {GOLD}{CURRENCY_LONG}{BLACK} வேகம்: {GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}செலவு: {GOLD}{CURRENCY_LONG}{BLACK} (மறுசீரமைப்பு செலவு: {GOLD}{CURRENCY_LONG}{BLACK}) வேகம்: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}கொள்ளளவு: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}பொறி பெட்டிகள்: {GOLD}+{POWER}{BLACK} எடை: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}இவற்றிற்கு மாற்றியமைக்கலாம்: {GOLD}{STRING} @@ -3358,6 +3429,7 @@ STR_BUY_VEHICLE_AIRCRAFT_RENAME_TOOLTIP :{BLACK}வி ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_HIDE_TOGGLE_BUTTON :{BLACK}மறை STR_BUY_VEHICLE_ROAD_VEHICLE_HIDE_TOGGLE_BUTTON :{BLACK}மறை +STR_BUY_VEHICLE_SHIP_HIDE_TOGGLE_BUTTON :{BLACK}மறை STR_BUY_VEHICLE_AIRCRAFT_HIDE_TOGGLE_BUTTON :{BLACK}மறை ###length VEHICLE_TYPES @@ -3472,6 +3544,7 @@ STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}செ STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}செலவு: {CURRENCY_LONG} அதி. வேகம்: {VELOCITY}{}விமான வகை: {STRING}{}கொள்ளளவு: {CARGO_LONG}, {CARGO_LONG}{}ஓட்டும் செலவு: {CURRENCY_LONG}/ஆண்டிற்கு STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}செலவு: {CURRENCY_LONG} அதி. வேகம்: {VELOCITY}{}விமான வகை: {STRING}{}கொள்ளளவு: {CARGO_LONG}{}ஓட்டும் செலவு: {CURRENCY_LONG}/ஆண்டிற்கு STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}செலவு: {CURRENCY_LONG} அதி. வேகம்: {VELOCITY}{}விமான வகை: {STRING} வீச்சு எல்லை: {COMMA} கட்டங்கள்{}கொள்ளளவு: {CARGO_LONG}, {CARGO_LONG}{}ஓட்டும் செலவு: {CURRENCY_LONG}/ஆண்டிற்கு +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}செலவு: {CURRENCY_LONG} அதி. வேகம்: {VELOCITY}{}விமான வகை: {STRING} வீச்சு எல்லை: {COMMA} கட்டங்கள்{}கொள்ளளவு: {CARGO_LONG}{}ஓட்டும் செலவு: {CURRENCY_LONG}/ஆண்டிற்கு # Autoreplace window STR_REPLACE_VEHICLES_WHITE :{WHITE}மாற்று {STRING} - {STRING} @@ -3511,6 +3584,8 @@ STR_REPLACE_MAGLEV_VEHICLES :மேக்ல STR_REPLACE_ROAD_VEHICLES :சாலை வாகனங்கள் STR_REPLACE_TRAM_VEHICLES :அமிழ் தண்டூர்தி வாகனங்கள் +STR_REPLACE_REMOVE_WAGON :{BLACK}பெட்டி நீக்கம் ({STRING}): {ORANGE}{STRING} +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. துணை குழுக்களுக்கும் விண்ணப்பிக்க Ctrl+கிளிக் செய்யவும் # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} @@ -3571,6 +3646,8 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE} {WAYPO STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE} {DEPOT}-இற்கு செல்கிறது, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE} {DEPOT}-இல் சர்வீஸ் செய்ய செல்கிறது, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}{STATION} நிலையத்தினை அடைய முடியவில்லை, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}{WAYPOINT}-இனை அடைய முடியவில்லை, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -3953,6 +4030,7 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}கு STR_AI_LIST_CANCEL :{BLACK}இரத்து செய் STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}வரிவடிவத்தினை மாற்றாதே +STR_SCREENSHOT_CAPTION :{WHITE}ஒரு திரைப்பிடிப்பினை எடுக்கவும் STR_SCREENSHOT_SCREENSHOT :{BLACK}சாதாரண திரைப்பிடிப்பு STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT :{BLACK}திரைபிடிப்பு - இயல்பிருப்பு பெரிதாக்குதல் STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}உயர்படத்தின் திரைப்பிடிப்பு @@ -3968,6 +4046,7 @@ STR_AI_SETTINGS_START_DELAY :இந்த AI # Textfile window +STR_TEXTFILE_WRAP_TEXT :{WHITE}உரையை மடக்கு STR_TEXTFILE_VIEW_README :{BLACK}படிக்க வேண்டியதை பார்வையிடு STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}மாற்றங்கள் பதிவேடு STR_TEXTFILE_VIEW_LICENCE :{BLACK}அனுமதி @@ -4424,6 +4503,7 @@ STR_BASESOUNDS_WIN_DESCRIPTION :அசல் STR_BASESOUNDS_NONE_DESCRIPTION :ஒலிகள் இல்லாத ஒலி தொகுப்பு. STR_BASEMUSIC_WIN_DESCRIPTION :அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் விண்டோஸ் பதிப்பு இசை. STR_BASEMUSIC_DOS_DESCRIPTION :அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் DOS பதிப்பு இசை. +STR_BASEMUSIC_TTO_DESCRIPTION :அசல் டிரான்ஸ்ஃபோர்ட் டைக்கூன் (அசல்/உலக ஆசிரியர்) DOS பதிப்பு இசை. STR_BASEMUSIC_NONE_DESCRIPTION :இசை இல்லாத இசைத்தொகுப்பு. ##id 0x2000 From 14429bbe8a323f25deb72d4586d5ce6ee23b5a78 Mon Sep 17 00:00:00 2001 From: glx22 Date: Tue, 19 Oct 2021 02:58:16 +0200 Subject: [PATCH 040/710] Change: [Actions] Also check desync debug --- .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 952e860e4a..5b69c1eea1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -82,7 +82,7 @@ jobs: libsdl: libsdl1.2-dev - compiler: gcc cxxcompiler: g++ - extra-cmake-parameters: -DOPTION_DEDICATED=ON + extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" runs-on: ubuntu-20.04 env: From 1c0700e0c0aa233b8850eba8358862f44574856d Mon Sep 17 00:00:00 2001 From: glx22 Date: Tue, 19 Oct 2021 03:06:01 +0200 Subject: [PATCH 041/710] Fix #9624: compilation with RANDOM_DEBUG --- src/network/network_client.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 22f7278f3e..bc5f24ac38 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -858,7 +858,11 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_FRAME(Packet *p #ifdef ENABLE_NETWORK_SYNC_EVERY_FRAME /* Test if the server supports this option * and if we are at the frame the server is */ - if (p->pos + 1 < p->size) { +#ifdef NETWORK_SEND_DOUBLE_SEED + if (p->CanReadFromPacket(sizeof(uint32) + sizeof(uint32))) { +#else + if (p->CanReadFromPacket(sizeof(uint32))) { +#endif _sync_frame = _frame_counter_server; _sync_seed_1 = p->Recv_uint32(); #ifdef NETWORK_SEND_DOUBLE_SEED From e68a51ecede7add7057dd5cfa37c1f2c0cb2e448 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 19 Oct 2021 18:47:37 +0000 Subject: [PATCH 042/710] Update: Translations from eints korean: 3 changes by telk5093 french: 2 changes by glx22 portuguese: 2 changes by azulcosta --- src/lang/french.txt | 2 ++ src/lang/korean.txt | 4 +++- src/lang/portuguese.txt | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lang/french.txt b/src/lang/french.txt index 7d02f7f2e0..404b35d045 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Terrain STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Taille de la carte{NBSP}: {WHITE}{COMMA}{NBSP}×{NBSP}{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Version du serveur{NBSP}: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Adresse du serveur{NBSP}: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Code d'invitation{NBSP}: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Date de début{NBSP}: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Date courante{NBSP}: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script de jeu{NBSP}: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2675,7 @@ STR_STATION_CLASS_WAYP :Points de contr # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Sélection des signaux +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Basculer l'affichage des types de signaux avancés STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Signal de bloc (sémaphore){}Ce sont les signaux les plus basiques, n'autorisant qu'un seul train à la fois dans un même bloc STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Signal d'entrée (sémaphore){}Vert tant qu'au moins un signal de sortie du bloc est vert, rouge dans le cas contraire. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Signal de sortie (sémaphore){}Fonctionne comme un signal de bloc, mais est nécessaire pour commander les signaux d'entrée et combinés diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 1594b11673..8fa35b717b 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -828,7 +828,7 @@ STR_NEWS_DISASTER_COAL_MINE_SUBSIDENCE :{BIG_FONT}{BLAC STR_NEWS_DISASTER_FLOOD_VEHICLE :{BIG_FONT}{BLACK}홍수 발생!{}최소 {COMMA}명의 실종자가 발생하였으며, 범람 후에 사상자도 발생할 것입니다! STR_NEWS_COMPANY_IN_TROUBLE_TITLE :{BIG_FONT}{BLACK}운송회사에 문제가 생김! -STR_NEWS_COMPANY_IN_TROUBLE_DESCRIPTION :{BIG_FONT}{BLACK}성취도를 바로 올리지 못하면 {STRING}{G 0 "은" "는"} 팔리거나 파산할 것입니다! +STR_NEWS_COMPANY_IN_TROUBLE_DESCRIPTION :{BIG_FONT}{BLACK}{STRING} - 성취도를 바로 올리지 못하면 회사가 팔리거나 파산할 것입니다! STR_NEWS_COMPANY_MERGER_TITLE :{BIG_FONT}{BLACK}운송 회사 합병! STR_NEWS_COMPANY_MERGER_DESCRIPTION :{BIG_FONT}{BLACK}{STRING} 회사가 {STRING} 회사에게 {CURRENCY_LONG}의 가격으로 인수합병되었습니다! STR_NEWS_COMPANY_BANKRUPT_TITLE :{BIG_FONT}{BLACK}파산! @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}기후: STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}지도 크기: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}서버 버전: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}서버 주소: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}초대 코드: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}시작 날짜: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}현재 날짜: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}게임 스크립트: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2675,7 @@ STR_STATION_CLASS_WAYP :경유지 # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}신호기 선택 +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}고급 신호기 종류를 보이거나 감춥니다 STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}폐색 신호기 (구식){}가장 기본적인 신호기 형식입니다. 단 한 대의 열차만이 이 폐색 구간을 통과할 수 있습니다 STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}입구 신호기 (구식){}다음 폐색 구간에 있는 출구 신호기가 하나라도 파란불이면 파란불이 되며, 그렇지 않은 경우에는 빨간불이 됩니다 STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}출구 신호기 (구식){}일반 신호기와 기능이 똑같지만, 입구 & 복합 신호기와 올바르게 연계되어야 합니다 diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index b3ce159b57..7f0468a71e 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Paisage STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Tamanho do Mapa: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versão do servidor: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Endereço do servidor: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Código de convite: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data de início: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data actual: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script de Jogo: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2675,7 @@ STR_STATION_CLASS_WAYP :Pontos de passa # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Selecção de Sinal +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Alterna a exibição para tipos de sinais avançados STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Sinal de bloco (semáforo){}Este é o tipo mais básico de sinal. Permite apenas a passagem de um comboio dentro de um bloco de linha ao mesmo tempo. STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Sinal de entrada (semáforo){}Apresenta-se verde enquanto existir um ou mais sinais de saída verdes no seguimento da linha. Caso contrário, ficará vermelho. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Sinal de saída (semáforo){}Funciona da mesma forma que o sinal de bloco, mas é necessário para ativar a cor correta nos pré-sinais de entrada e combinado. From eed49d779274ec149c5a69805ab6e6d21d149f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 20 Oct 2021 12:23:16 +0200 Subject: [PATCH 043/710] Fix #9626, ddafc0d: Incorrect loading of script saved data (#9629) --- src/script/script_instance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 3f611e66c6..4342289afc 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -565,7 +565,7 @@ bool ScriptInstance::IsPaused() switch (_script_sl_byte) { case SQSL_INT: { int64 value; - SlCopy(&value, 1, IsSavegameVersionBefore(SLV_SCRIPT_INT64) ? SLE_INT32 : SLE_INT64); + SlCopy(&value, 1, IsSavegameVersionBefore(SLV_SCRIPT_INT64) ? SLE_FILE_I32 | SLE_VAR_I64 : SLE_INT64); if (vm != nullptr) sq_pushinteger(vm, (SQInteger)value); return true; } From b043d58b9242a5ddd373c8194fe6df10f125cc5e Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 20 Oct 2021 18:49:34 +0000 Subject: [PATCH 044/710] Update: Translations from eints swedish: 4 changes by joeax910 spanish: 1 change by MontyMontana --- src/lang/spanish.txt | 1 + src/lang/swedish.txt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 00bdddfede..65c6bf199f 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Terreno STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Tamaño del Mapa: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versión del servidor: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Dirección del servidor: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Código de invitación: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Fecha de inicio: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Fecha actual: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script de juego: {WHITE}{STRING} (v{NUM}) diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 95ca573700..9f99390dd1 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -900,8 +900,8 @@ STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLAC STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subventionen gäller inte längre:{}{}{STRING} från {STRING} till {STRING} är inte längre subventionerad STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Ny subvention:{}{}Första transporten av {STRING} från {STRING} till {STRING} får {NUM} års subvention från kommunen! ###length 4 -STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger 50% extra de{P 4 t ""} {NUM} kommande år{P et en}! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger dubbelt så mycket nästa {NUM} år{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger 50% extra i {NUM} år framåt! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger dubbelt så mycket i {NUM} år framåt! STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger tre gånger så mycket de{P 4 t ""} kommande {NUM} år{P et en}! STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger fyra gånger så mycket de{P 4 t ""} kommande {NUM} år{P et en}! @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Klimat: STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Kartstorlek: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Serverversion: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Serveradress: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Inbjudningskod: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Startdatum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Nuvarande datum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Spelskript: {WHITE}{STRING} (v{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Riktmärken # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Signalval +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Slå av/på visning av avancerade signaltyper STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Standardsignal (semafor){}Detta är den enklaste typen av signal, som endast tillåter ett tåg per block vid samma tidpunkt STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Infartssignal (semafor){}Grön så länge det finns en eller flera gröna utfartssignaler på efterföljande bit av spår, annars visas rött STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Utfartssignal (semafor){}Fungerar på samma sätt som en vanlig signal, men behövs för att utlösa korrekt färg på in- eller kombinationssignaler From bc1b84cbbb3868edfe2e1acdb2ed0a1f7fafad02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 20 Oct 2021 22:08:08 +0200 Subject: [PATCH 045/710] Fix #9630: intro game could zoom in/out more than allowed by settings (#9633) Also fixes #9622 --- src/main_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 944a284058..6131050cf8 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -161,11 +161,11 @@ void FixTitleGameZoom(int zoom_adjust) /* Adjust the zoom in/out. * Can't simply add, since operator+ is not defined on the ZoomLevel type. */ vp->zoom = _gui_zoom; - while (zoom_adjust < 0 && vp->zoom != ZOOM_LVL_MIN) { + while (zoom_adjust < 0 && vp->zoom != _settings_client.gui.zoom_min) { vp->zoom--; zoom_adjust++; } - while (zoom_adjust > 0 && vp->zoom != ZOOM_LVL_MAX) { + while (zoom_adjust > 0 && vp->zoom != _settings_client.gui.zoom_max) { vp->zoom++; zoom_adjust--; } From f2c03a77f0f2467720be353b50d7dfd62469ba5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 20 Oct 2021 22:14:23 +0200 Subject: [PATCH 046/710] Change: Don't store not to be activated newGRFs in savegames (#9627) --- 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 510ffc156e..5dde97132c 100644 --- a/src/saveload/newgrf_sl.cpp +++ b/src/saveload/newgrf_sl.cpp @@ -81,7 +81,7 @@ struct NGRFChunkHandler : ChunkHandler { int index = 0; for (GRFConfig *c = _grfconfig; c != nullptr; c = c->next) { - if (HasBit(c->flags, GCF_STATIC)) continue; + if (HasBit(c->flags, GCF_STATIC) || HasBit(c->flags, GCF_INIT_ONLY)) continue; SlSetArrayIndex(index++); SlObject(c, _grfconfig_desc); } From ae340f415e5ab740bec1d6eb76d70c39bbd53b8b Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 21 Oct 2021 18:47:48 +0000 Subject: [PATCH 047/710] Update: Translations from eints russian: 2 changes by Ln-Wolf --- src/lang/russian.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 53368c6501..ad8425c24f 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -2845,6 +2845,7 @@ STR_STATION_CLASS_WAYP :Точки пу # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Выбор сигналов +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Переключить отображение расширенного списка сигналов STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Стандартный семафор{}Не позволяет нескольким поездам одновременно находиться на одном блок-участке. STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Входной семафор{}Открыт, если хотя бы один из выходных сигналов на следующей секции путей открыт. В остальных случаях закрыт. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Выходной семафор{}Работает как обычный семафор, но его состояние учитывается при работе входных и комбинированных сигналов. @@ -2858,7 +2859,7 @@ STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Комб STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Маршрутный светофор{}Позволяет нескольким поездам находиться в одном сигнальном блоке, если каждый из них может зарезервировать безопасный путь. Допускает следование поездов в обе стороны. STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Односторонний маршрутн. светофор{}Позволяет нескольким поездам находиться в одном сигнальном блоке, если каждый из них может зарезервировать безопасный путь. Не допускает следования поездов в обратную сторону. STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Изменение типа сигнала{}Когда кнопка нажата, щёлкните для преобразования существующего сигнала в сигнал выбранного типа и варианта, или щёлкните с нажатым Ctrl для перебора существующих вариантов. Shift+щелчок - оценка стоимости преобразования. -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Расстояние между сигналами при протягивании. +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Расстояние между сигналами при протягивании STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Уменьшить расстояние между сигналами при протягивании STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Увеличить расстояние между сигналами при протягивании From 08c048e0a1bd16a41a97faa7dc32d41492098365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Fri, 22 Oct 2021 16:34:48 +0200 Subject: [PATCH 048/710] Fix #9643, 95386dc: Incorrect determination of screenshot format (#9644) --- src/screenshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 244aede50f..f91648cf47 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -584,7 +584,7 @@ void InitializeScreenshotFormats() { uint j = 0; for (uint i = 0; i < lengthof(_screenshot_formats); i++) { - if (_screenshot_format_name.compare(_screenshot_formats[i].extension) != 0) { + if (_screenshot_format_name.compare(_screenshot_formats[i].extension) == 0) { j = i; break; } From b2e83b4da6742b1c463d336bf660d52eb9f8e4b9 Mon Sep 17 00:00:00 2001 From: Joan Josep Date: Fri, 22 Oct 2021 19:39:47 +0200 Subject: [PATCH 049/710] Fix: Draw rotor in cursor when dragging helicopters. (#9612) --- src/vehicle_gui.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index c43347ca81..10e925b8be 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -3181,12 +3181,22 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) _cursor.sprite_count = 0; int total_width = 0; - for (; v != nullptr; v = v->HasArticulatedPart() ? v->GetNextArticulatedPart() : nullptr) { + int y_offset = 0; + bool rotor_seq = false; // Whether to draw the rotor of the vehicle in this step. + + while (v != nullptr) { if (total_width >= ScaleGUITrad(2 * (int)VEHICLEINFO_FULL_VEHICLE_WIDTH)) break; PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); VehicleSpriteSeq seq; - v->GetImage(rtl ? DIR_E : DIR_W, image_type, &seq); + + if (rotor_seq) { + GetCustomRotorSprite(Aircraft::From(v), true, image_type, &seq); + if (!seq.IsValid()) seq.Set(SPR_ROTOR_STOPPED); + y_offset = - ScaleGUITrad(5); + } else { + v->GetImage(rtl ? DIR_E : DIR_W, image_type, &seq); + } if (_cursor.sprite_count + seq.count > lengthof(_cursor.sprite_seq)) break; @@ -3195,11 +3205,17 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) _cursor.sprite_seq[_cursor.sprite_count].sprite = seq.seq[i].sprite; _cursor.sprite_seq[_cursor.sprite_count].pal = pal2; _cursor.sprite_pos[_cursor.sprite_count].x = rtl ? -total_width : total_width; - _cursor.sprite_pos[_cursor.sprite_count].y = 0; + _cursor.sprite_pos[_cursor.sprite_count].y = y_offset; _cursor.sprite_count++; } - total_width += GetSingleVehicleWidth(v, image_type); + if (v->type == VEH_AIRCRAFT && v->subtype == AIR_HELICOPTER && !rotor_seq) { + /* Draw rotor part in the next step. */ + rotor_seq = true; + } else { + total_width += GetSingleVehicleWidth(v, image_type); + v = v->HasArticulatedPart() ? v->GetNextArticulatedPart() : nullptr; + } } int offs = (ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH) - total_width) / 2; From bf0210229c9e9a9c36c515e5a19bd620bc22c924 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 22 Oct 2021 18:53:01 +0000 Subject: [PATCH 050/710] Update: Translations from eints english (us): 2 changes by 2TallTyler vietnamese: 2 changes by KhoiCanDev catalan: 2 changes by J0anJosep portuguese (brazilian): 2 changes by Vimerum --- src/lang/brazilian_portuguese.txt | 2 ++ src/lang/catalan.txt | 2 ++ src/lang/english_US.txt | 2 ++ src/lang/vietnamese.txt | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 9db7f83ce9..6ac50be4bf 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Terreno STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Tamanho do mapa: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versão do servidor: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}IP do servidor: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Código de convite: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data de inicio: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data atual: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script de jogo: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2675,7 @@ STR_STATION_CLASS_WAYP :Pontos de contr # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Seleção de Sinais +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Alternar se mostra os tipos de sinais avançados STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Sinais padrão (semáforos){}Sinais são necessários para impedir trens de colidirem nas malhas ferroviárias com mais de um trem STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Sinal de Entrada (semáforo){}Verde enquanto haja um ou mais sinais de saída verdes na atual seção dos trilhos. Do contrário, mostra vermelho STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Sinal de saída (semáforo){}Funciona como um sinal normal, porém é necessário para o funcionamento correto do sistema de pré-sinais combo ou de entrada diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 4faf47f9ed..bf37d20b37 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Escenar STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Mida del mapa: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versió del servidor: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Adreça del servidor: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Codi d'invitació: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data inicial: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data actual: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script de partida: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2675,7 @@ STR_STATION_CLASS_WAYP :Punt de pas # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Selecció de senyals +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Mostra o amaga els tipus avançats de senyals. STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Senyal de secció (mecànic){}Aquest és el tipus de senyal més senzill. Permet l'entrada a la següent secció de vies només si no hi ha cap altre tren. STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Senyal previ d'entrada (mecànic){}En verd si a la següent secció no hi ha trens i, a més a més, hi ha almenys un senyal previ de sortida en verd. En cas contrari, en vermell. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Senyal previ de sortida (mecànic){}Es comporta com un senyal de secció i activa correctament els senyals previs d'entrada i combinats. diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 8266d7c121..60fd6d9d3c 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Landsca STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Map size: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Server version: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Invite code: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Start date: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Game Script: {WHITE}{STRING} (v{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Waypoints # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Signal Selection +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Toggle showing advanced signal types STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Block Signal (semaphore){}This is the most basic type of signal, allowing only one train to be in the same block at the same time STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Entry Signal (semaphore){}Green as long as there is one or more green exit-signal from the following section of track. Otherwise it shows red STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Exit Signal (semaphore){}Behaves in the same way as a block signal but is necessary to trigger the correct color on entry & combo pre-signals diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index dd79e5490c..44f15e6b79 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Địa STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Cỡ bản đồ: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Phiên bản server: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Địa chỉ server: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Mã tham gia: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Ngày bắt đầu: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Ngày hiện tại: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Game Script: {WHITE}{STRING} (v{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Điểm mốc # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Chọn Đèn Tín Hiệu +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Bật/tắt hiển thị các loại đèn báo nâng cao STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Đèn (cờ) tín hiệu khoá{}Đây là loại tín hiệu cơ bản, chỉ cho phép một đoàn tàu đi vào chỗ khoá cùng một thời điểm. STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Đèn (cờ) tín hiệu cửa nhập{}Sẽ xanh nếu một hoặc nhiều đèn tín hiệu cửa thoát ở phía sau màu xanh. Không thì sẽ đỏ. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Đèn (cờ) tín hiệu cửa thoát{}Tương tự đèn tín hiệu khoá, nhưng cần có để đổi trạng thái của đèn tín hiệu loại cửa nhập & kết hợp nằm trước nó. From bc984d9af52eaf55b7b76ad9e3cc5115935803b0 Mon Sep 17 00:00:00 2001 From: frosch Date: Fri, 22 Oct 2021 21:46:55 +0200 Subject: [PATCH 051/710] Codechange: remove redundant 'info_view' parameter, it can be derived from 'image_type'. --- src/aircraft_cmd.cpp | 2 +- src/aircraft_gui.cpp | 2 +- src/newgrf_engine.cpp | 3 ++- src/newgrf_engine.h | 6 +++--- src/vehicle_gui.cpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index f4f933982a..52c966e81e 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -188,7 +188,7 @@ void GetRotorImage(const Aircraft *v, EngineImageType image_type, VehicleSpriteS const Aircraft *w = v->Next()->Next(); if (is_custom_sprite(v->spritenum)) { - GetCustomRotorSprite(v, false, image_type, result); + GetCustomRotorSprite(v, image_type, result); if (result->IsValid()) return; } diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 311bc497bf..422f422002 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -100,7 +100,7 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s if (helicopter) { const Aircraft *a = Aircraft::From(v); VehicleSpriteSeq rotor_seq; - GetCustomRotorSprite(a, true, image_type, &rotor_seq); + GetCustomRotorSprite(a, image_type, &rotor_seq); if (!rotor_seq.IsValid()) rotor_seq.Set(SPR_ROTOR_STOPPED); heli_offs = ScaleGUITrad(5); rotor_seq.Draw(x, y + y_offs - heli_offs, PAL_NONE, false); diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index ee4af5e6a0..128f5639c8 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1103,7 +1103,7 @@ void GetCustomEngineSprite(EngineID engine, const Vehicle *v, Direction directio } -void GetRotorOverrideSprite(EngineID engine, const struct Aircraft *v, bool info_view, EngineImageType image_type, VehicleSpriteSeq *result) +void GetRotorOverrideSprite(EngineID engine, const struct Aircraft *v, EngineImageType image_type, VehicleSpriteSeq *result) { const Engine *e = Engine::Get(engine); @@ -1111,6 +1111,7 @@ void GetRotorOverrideSprite(EngineID engine, const struct Aircraft *v, bool info assert(e->type == VEH_AIRCRAFT); assert(!(e->u.air.subtype & AIR_CTOL)); + bool info_view = image_type != EIT_ON_MAP; VehicleResolverObject object(engine, v, VehicleResolverObject::WO_SELF, info_view, CBID_NO_CALLBACK); result->Clear(); uint rotor_pos = v == nullptr || info_view ? 0 : v->Next()->Next()->state; diff --git a/src/newgrf_engine.h b/src/newgrf_engine.h index f63134d9f6..0cfbb0a76f 100644 --- a/src/newgrf_engine.h +++ b/src/newgrf_engine.h @@ -84,9 +84,9 @@ void GetCustomEngineSprite(EngineID engine, const Vehicle *v, Direction directio #define GetCustomVehicleSprite(v, direction, image_type, result) GetCustomEngineSprite(v->engine_type, v, direction, image_type, result) #define GetCustomVehicleIcon(et, direction, image_type, result) GetCustomEngineSprite(et, nullptr, direction, image_type, result) -void GetRotorOverrideSprite(EngineID engine, const struct Aircraft *v, bool info_view, EngineImageType image_type, VehicleSpriteSeq *result); -#define GetCustomRotorSprite(v, i, image_type, result) GetRotorOverrideSprite(v->engine_type, v, i, image_type, result) -#define GetCustomRotorIcon(et, image_type, result) GetRotorOverrideSprite(et, nullptr, true, image_type, result) +void GetRotorOverrideSprite(EngineID engine, const struct Aircraft *v, EngineImageType image_type, VehicleSpriteSeq *result); +#define GetCustomRotorSprite(v, image_type, result) GetRotorOverrideSprite(v->engine_type, v, image_type, result) +#define GetCustomRotorIcon(et, image_type, result) GetRotorOverrideSprite(et, nullptr, image_type, result) /* Forward declaration of GRFFile, to avoid unnecessary inclusion of newgrf.h * elsewhere... */ diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 10e925b8be..f2ab811574 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -3191,7 +3191,7 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) VehicleSpriteSeq seq; if (rotor_seq) { - GetCustomRotorSprite(Aircraft::From(v), true, image_type, &seq); + GetCustomRotorSprite(Aircraft::From(v), image_type, &seq); if (!seq.IsValid()) seq.Set(SPR_ROTOR_STOPPED); y_offset = - ScaleGUITrad(5); } else { From 111a47af0d0bb37b421eb8a77f1f8e69d38bbe3c Mon Sep 17 00:00:00 2001 From: frosch Date: Fri, 22 Oct 2021 22:04:52 +0200 Subject: [PATCH 052/710] Codechange: rename 'info_view' to 'rotor_in_gui', because it is only used by helicopters. --- src/newgrf_engine.cpp | 22 +++++++++++++--------- src/newgrf_engine.h | 10 +++++----- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 128f5639c8..a8dace53f8 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -790,7 +790,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, case 0x1C: return v->y_pos; case 0x1D: return GB(v->y_pos, 8, 8); case 0x1E: return v->z_pos; - case 0x1F: return object->info_view ? DIR_W : v->direction; + case 0x1F: return object->rotor_in_gui ? DIR_W : v->direction; // for rotors the spriteset contains animation frames, so NewGRF need a different way to tell the helicopter orientation. case 0x20: break; // not implemented case 0x21: break; // not implemented case 0x22: break; // not implemented @@ -1041,17 +1041,17 @@ static const GRFFile *GetEngineGrfFile(EngineID engine_type) * @param engine_type Engine type * @param v %Vehicle being resolved. * @param wagon_override Application of wagon overrides. - * @param info_view Indicates if the item is being drawn in an info window. + * @param rotor_in_gui Helicopter rotor is drawn in GUI. * @param callback Callback ID. * @param callback_param1 First parameter (var 10) of the callback. * @param callback_param2 Second parameter (var 18) of the callback. */ -VehicleResolverObject::VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool info_view, +VehicleResolverObject::VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool rotor_in_gui, CallbackID callback, uint32 callback_param1, uint32 callback_param2) : ResolverObject(GetEngineGrfFile(engine_type), callback, callback_param1, callback_param2), - self_scope(*this, engine_type, v, info_view), - parent_scope(*this, engine_type, ((v != nullptr) ? v->First() : v), info_view), - relative_scope(*this, engine_type, v, info_view), + self_scope(*this, engine_type, v, rotor_in_gui), + parent_scope(*this, engine_type, ((v != nullptr) ? v->First() : v), rotor_in_gui), + relative_scope(*this, engine_type, v, rotor_in_gui), cached_relative_count(0) { if (wagon_override == WO_SELF) { @@ -1111,10 +1111,14 @@ void GetRotorOverrideSprite(EngineID engine, const struct Aircraft *v, EngineIma assert(e->type == VEH_AIRCRAFT); assert(!(e->u.air.subtype & AIR_CTOL)); - bool info_view = image_type != EIT_ON_MAP; - VehicleResolverObject object(engine, v, VehicleResolverObject::WO_SELF, info_view, CBID_NO_CALLBACK); + /* We differ from TTDPatch by resolving the sprite using the primary vehicle 'v', and not using the rotor vehicle 'v->Next()->Next()'. + * TTDPatch copies some variables between the vehicles each time, to somehow synchronize the rotor vehicle with the primary vehicle. + * We use 'rotor_in_gui' to replicate when the variables differ. + * But some other variables like 'rotor state' and 'rotor speed' are not available in OpenTTD, while they are in TTDPatch. */ + bool rotor_in_gui = image_type != EIT_ON_MAP; + VehicleResolverObject object(engine, v, VehicleResolverObject::WO_SELF, rotor_in_gui, CBID_NO_CALLBACK); result->Clear(); - uint rotor_pos = v == nullptr || info_view ? 0 : v->Next()->Next()->state; + uint rotor_pos = v == nullptr || rotor_in_gui ? 0 : v->Next()->Next()->state; bool sprite_stack = HasBit(e->info.misc_flags, EF_SPRITE_STACK); uint max_stack = sprite_stack ? lengthof(result->seq) : 1; diff --git a/src/newgrf_engine.h b/src/newgrf_engine.h index 0cfbb0a76f..eb6a51040e 100644 --- a/src/newgrf_engine.h +++ b/src/newgrf_engine.h @@ -22,17 +22,17 @@ struct VehicleScopeResolver : public ScopeResolver { const struct Vehicle *v; ///< The vehicle being resolved. EngineID self_type; ///< Type of the vehicle. - bool info_view; ///< Indicates if the item is being drawn in an info window. + bool rotor_in_gui; ///< Helicopter rotor is drawn in GUI. /** * Scope resolver of a single vehicle. * @param ro Surrounding resolver. * @param engine_type Engine type * @param v %Vehicle being resolved. - * @param info_view Indicates if the item is being drawn in an info window. + * @param rotor_in_gui Helicopter rotor is drawn in GUI. */ - VehicleScopeResolver(ResolverObject &ro, EngineID engine_type, const Vehicle *v, bool info_view) - : ScopeResolver(ro), v(v), self_type(engine_type), info_view(info_view) + VehicleScopeResolver(ResolverObject &ro, EngineID engine_type, const Vehicle *v, bool rotor_in_gui) + : ScopeResolver(ro), v(v), self_type(engine_type), rotor_in_gui(rotor_in_gui) { } @@ -59,7 +59,7 @@ struct VehicleResolverObject : public ResolverObject { VehicleScopeResolver relative_scope; ///< Scope resolver for an other vehicle in the chain. byte cached_relative_count; ///< Relative position of the other vehicle. - VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool info_view = false, + VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool rotor_in_gui = false, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override; From e8bff0ad03550a65f3575375ffec22d9a4426afb Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 23 Oct 2021 15:13:39 +0200 Subject: [PATCH 053/710] Change: Suppress panning in intro game, while user is interacting with the GUI. (#9645) --- src/intro_gui.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 8d11a2bb3a..fe19ec0632 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -102,6 +102,8 @@ struct SelectGameWindow : public Window { size_t cur_viewport_command_index; /** Time spent (milliseconds) on current viewport command. */ uint cur_viewport_command_time; + uint mouse_idle_time; + Point mouse_idle_pos; /** * Find and parse all viewport command signs. @@ -181,6 +183,8 @@ struct SelectGameWindow : public Window { this->cur_viewport_command_index = (size_t)-1; this->cur_viewport_command_time = 0; + this->mouse_idle_time = 0; + this->mouse_idle_pos = _cursor.pos; } void OnRealtimeTick(uint delta_ms) override @@ -189,6 +193,17 @@ struct SelectGameWindow : public Window { if (intro_viewport_commands.empty()) return; + bool suppress_panning = true; + if (this->mouse_idle_pos.x != _cursor.pos.x || this->mouse_idle_pos.y != _cursor.pos.y) { + this->mouse_idle_pos = _cursor.pos; + this->mouse_idle_time = 2000; + } else if (this->mouse_idle_time > delta_ms) { + this->mouse_idle_time -= delta_ms; + } else { + this->mouse_idle_time = 0; + suppress_panning = false; + } + /* Determine whether to move to the next command or stay at current. */ bool changed_command = false; if (this->cur_viewport_command_index >= intro_viewport_commands.size()) { @@ -212,6 +227,9 @@ struct SelectGameWindow : public Window { /* Early exit if the current command hasn't elapsed and isn't animated. */ if (!changed_command && !vc.pan_to_next && vc.vehicle == INVALID_VEHICLE) return; + /* Suppress panning commands, while user interacts with GUIs. */ + if (!changed_command && suppress_panning) return; + /* Reset the zoom level. */ if (changed_command) FixTitleGameZoom(vc.zoom_adjust); From 279fe11b039434b606f857999b1ad1f612a9b939 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 23 Oct 2021 18:47:57 +0000 Subject: [PATCH 054/710] Update: Translations from eints indonesian: 2 changes by hadyatmo --- src/lang/indonesian.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 76faf24bc6..a52e9ae2a1 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Ukuran STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Ukuran Peta: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versi Server: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Alamat Server: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Kode undangan: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Tgl mulai: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Tgl sekarang: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Skrip Permainan: {WHITE}{STRING} (v{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Waypoint # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Pemilihan Sinyal +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK} Beralih menampilkan jenis sinyal tingkat lanjut STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Sinyal Blok (semaphore){}Ini adalah jenis sinyal yang umum, hanya memperbolehkan satu kereta berada pada satu blok yang sama dalam waktu yang sama STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Sinyal Masuk(semaphore){}Akan berwarna hijau jika ada satu atau lebih Sinyal Keluar yang berwarna hijau pada jalur berikutnya. Jika tidak, akan berwarna merah STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Sinyal Keluar (semaphore){}Cara kerjanya sama dengan Sinyal Blok, akan tetapi penggunaanya lebih ditujukan untuk menghasilkan warna yang benar pada Sinyal Masuk dan Sinyal Kombo From a0831cec3910b516f19debfb6be1bc6306969c76 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 24 Oct 2021 18:46:47 +0000 Subject: [PATCH 055/710] Update: Translations from eints swedish: 1 change by joeax910 --- src/lang/swedish.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 9f99390dd1..89819470d2 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -2686,7 +2686,7 @@ STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}Infartss STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Utfartssignal (elektrisk){}Fungerar på samma sätt som en vanlig signal men behövs för att utlösa korrekt färg på infarts- och kombinationssignaler STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Kombinationssignal (elektrisk){}Kombinationssignalen fungerar som både en infarts- och utfartssignal. Detta gör det möjligt att bygga stora "träd" av för-signaler STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Avancerad signal (elektrisk){}En avancerad signal tillåter flera fordon att befinna sig i ett signalblock samtidigt, om fordonet kan reservera en väg till en säker stopp-plats. Avancerade signaler kan passeras bakifrån -STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Avancerad envägssignal (elektrisk){}En avancerad signal tillåter flera fordon att befinna sig i ett signalblock samtidigt, om fordonet kan reservera en väg till en säker stopp-plats. Avancerade envägs-signaler kan inte passeras bakifrån +STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Avancerad envägssignal (elektrisk){}En avancerad signal tillåter flera fordon att befinna sig i ett signalblock samtidigt, om fordonet kan reservera en väg till en säker stopp-plats. Avancerade envägssignaler kan inte passeras bakifrån STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Konvertera signal{}När den är markerad, klicka på en existerande signal för att konvertera den till vald signaltyp och -variant. Ctrl-klick ändrar den existerande varianten. Shift-klick visar beräknad konverteringskostnad STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Avstånd mellan signaler STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Minska avstånd mellan signaler From 4487ad1a5e587b1c5d54eb9e3f975f816de35da9 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 25 Oct 2021 18:49:13 +0000 Subject: [PATCH 056/710] Update: Translations from eints korean: 1 change by telk5093 polish: 2 changes by pAter-exe --- src/lang/korean.txt | 2 +- src/lang/polish.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 8fa35b717b..8907295282 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -3560,7 +3560,7 @@ STR_STATION_VIEW_VIA :{YELLOW}{1:STAT STR_STATION_VIEW_TO :{YELLOW}{1:STATION} 도착: {0:CARGO_SHORT} STR_STATION_VIEW_FROM_ANY :{RED}알 수 없는 역에서 출발한 {CARGO_SHORT} STR_STATION_VIEW_TO_ANY :{RED}아무 역에나 도착하는 {CARGO_SHORT} -STR_STATION_VIEW_VIA_ANY :{RED}어디든 경유하는 {CARGO_SHORT} +STR_STATION_VIEW_VIA_ANY :{RED}아무 역이나 경유하는 {CARGO_SHORT} STR_STATION_VIEW_FROM_HERE :{GREEN}여기에서 출발하는 {CARGO_SHORT} STR_STATION_VIEW_VIA_HERE :{GREEN}이 역을 경유하는 {CARGO_SHORT} STR_STATION_VIEW_TO_HERE :{GREEN}이 역에 도착하는 {CARGO_SHORT} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index a3246b72b1..b94f28a086 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -2637,6 +2637,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Krajobr STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Rozmiar mapy: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Wersja serwera: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Adres serwera: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Kod zaproszenia: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data uruchomienia: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Aktualna data: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Game Script: {WHITE}{STRING} (v{NUM}) @@ -3053,6 +3054,7 @@ STR_STATION_CLASS_WAYP :Posterunki # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Wybór sygnałów +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Przełącznik pokazujący zaawansowane typy sygnałów STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Sygnalizator bloku (semafor){}Najprostszy typ sygnału pozwalający na przebywanie w jednym bloku wyłącznie jednemu pociągowi naraz STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Sygnalizator wejściowy (semafor){}Zielony, póki choć jeden sygnalizator wyjściowy dla kolejnego odcinka trasy jest zielony. W przeciwnym wypadku czerwony. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Sygnalizator wyjściowy (semafor){}Zachowuje się jak sygnalizator blokowy, lecz jest niezbędny do zmiany na poprawny kolor w presygnalizatorach wejściowych i złożonych From 488cf2640657818f87301c3793f905d5a9cedb93 Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 27 Oct 2021 18:50:25 +0000 Subject: [PATCH 057/710] Update: Translations from eints swedish: 44 changes by joeax910 japanese: 1 change by clzls chinese (simplified): 2 changes by clzls --- src/lang/japanese.txt | 1 + src/lang/simplified_chinese.txt | 2 + src/lang/swedish.txt | 88 ++++++++++++++++----------------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index b7ef4ad2ed..f5deb003a6 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}地域: STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}地図サイズ: {WHITE}{COMMA}×{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}サーバーバージョン: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}サーバーアドレス: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}招待コード:{WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}開始日: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}現在の日付:{WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}ゲームスクリプト: {WHITE}{STRING} (v{NUM}) diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 412f56baf7..99cb2c15d0 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}场景 STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}地图尺寸: {WHITE}{COMMA}×{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}服务器版本: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}该服IP: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}邀请码:{WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}开始日期: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}当前日期: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}游戏脚本:{WHITE}{STRING} (v{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :路标 # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}信号灯 +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}选择是否显示高级信号灯类型 STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}通过信号灯(悬臂){}是最基本的信号灯,只允许一列车进入该信号灯以后的区间 STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}入口信号灯(悬臂){}在下一轨道区间上至少有一个出口信号灯是绿色时此信号亮绿灯,否则亮红灯 STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}出口信号灯(悬臂){}信号显示条件与通过信号灯相同,但是它的状态可以触发入口及复合信号灯 diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 89819470d2..cbf86ec3f4 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -818,7 +818,7 @@ STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLAC STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLACK}Flygplanskrasch!{}{COMMA} dog i lågorna på {STATION} STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}Flygplanskrasch!{}Flygplanet fick slut på bränsle, {COMMA} dog i lågorna! -STR_NEWS_DISASTER_ZEPPELIN :{BIG_FONT}{BLACK}Zeppelinare-katastrof på {STATION}! +STR_NEWS_DISASTER_ZEPPELIN :{BIG_FONT}{BLACK}Zeppelinarkatastrof på {STATION}! STR_NEWS_DISASTER_SMALL_UFO :{BIG_FONT}{BLACK}Vägfordon förstört i 'UFO'-kollision! STR_NEWS_DISASTER_AIRPLANE_OIL_REFINERY :{BIG_FONT}{BLACK}Oljeraffinaderi exploderade nära {TOWN}! STR_NEWS_DISASTER_HELICOPTER_FACTORY :{BIG_FONT}{BLACK}Fabrik förstörd under misstänkta omständigheter nära {TOWN}! @@ -872,7 +872,7 @@ STR_NEWS_VEHICLE_HAS_TOO_FEW_ORDERS :{WHITE}{VEHICLE STR_NEWS_VEHICLE_HAS_VOID_ORDER :{WHITE}{VEHICLE} har en ogiltig order STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}{VEHICLE} har dubblerade destinationer STR_NEWS_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE} har en felaktig station bland destinationerna -STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} har i sina beställningar en flygplats vars bana är för kort +STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} har i sitt körschema en flygplats vars bana är för kort STR_NEWS_VEHICLE_IS_GETTING_OLD :{WHITE}{VEHICLE} börjar bli gammal STR_NEWS_VEHICLE_IS_GETTING_VERY_OLD :{WHITE}{VEHICLE} börjar bli mycket gammal @@ -902,8 +902,8 @@ STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLAC ###length 4 STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger 50% extra i {NUM} år framåt! STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger dubbelt så mycket i {NUM} år framåt! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger tre gånger så mycket de{P 4 t ""} kommande {NUM} år{P et en}! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger fyra gånger så mycket de{P 4 t ""} kommande {NUM} år{P et en}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger tre gånger så mycket i {NUM} år framåt! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subvention tilldelad {STRING}!{}{}{STRING} från {STRING} till {STRING} ger fyra gånger så mycket i {NUM} år framåt! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Trafikkaos i {TOWN}!{}{}Vägombyggnadsprogram bekostat av {STRING} medför 6 månader av elände för bilister! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transportmonopol! @@ -1323,7 +1323,7 @@ STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :Samma som för STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :Prospekterande STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Platt yta runt industrier: {STRING} -STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Hur mycket platt yta som finns runt en industri. Detta säkerställer att tom yta finns tillgängligt runt en industri för byggnation av spår mm. +STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Hur mycket platt yta som finns runt en industri. Detta säkerställer att tom yta finns tillgänglig runt en industri för byggnation av spår m.m. STR_CONFIG_SETTING_MULTIPINDTOWN :Tillåt flera industrier av samma typ per stad: {STRING} STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :I normala fall vill en stad inte ha mer än en industri av varje typ. Med den här inställningen tillåts flera industrier av samma typ i samma stad @@ -1640,9 +1640,9 @@ STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Välj layout f STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :Automatiskt ta bort signaler vid byggande av järnväg: {STRING} STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :Ta automatiskt bort signaler vid byggande av järnväg om signalerna är i vägen. Notera att detta kan leda till att tåg krockar. -STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Snabbspolnings begränsning: {STRING} +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Begränsning av snabbspolning: {STRING} STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT :Begränsa hur snabbt spelet går när snabbspolning är aktiverad. 0 = ingen begränsning (så snabbt som din dator tillåter). Värden under 100% saktar ner spelet. Den övre begränsningen beror på din dators specifikationer och kan variera beroende på spelet. -STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% normal spel hastighet +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% normal spelhastighet ###setting-zero-is-special STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Ingen begränsning (Så snabbt som din dator tillåter) @@ -1864,8 +1864,8 @@ STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Placering av tr STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Kontrollera den slumpmässiga uppkomsten av träd under spelets gång. Detta kan påverka industrier som är beroende av växande träd, till exempel sågverk ###length 4 STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Växer men sprider ej{RED}(Sågverket fungerar inte) -STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Växer men endast spriding i rengskogar -STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Väx och sprid överallt +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Växer, men sprids endast i regnskogar +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Växer och sprids överallt STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_GROWTH_NO_SPREAD :Växer ej, sprider ej{RED}(Sågverket fungerar inte) STR_CONFIG_SETTING_TOOLBAR_POS :Verktygsradens position: {STRING} @@ -3380,7 +3380,7 @@ STR_NEWGRF_SCAN_STATUS :{BLACK}{NUM} Ne STR_NEWGRF_SCAN_ARCHIVES :Skannar efter arkiv # Sign list window -STR_SIGN_LIST_CAPTION :{WHITE}Skyltlista - {COMMA} Skylt{P "" ar} +STR_SIGN_LIST_CAPTION :{WHITE}Skyltlista - {COMMA} skylt{P "" ar} STR_SIGN_LIST_MATCH_CASE :{BLACK}Matcha VERSALER/gemener STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Slå på/av matchning av VERSALER/gemener när skyltnamn matchas mot sökfiltret @@ -5292,7 +5292,7 @@ STR_VEHICLE_NAME_ROAD_VEHICLE_DW_COAL_TRUCK :DW Koldumper STR_VEHICLE_NAME_ROAD_VEHICLE_MPS_MAIL_TRUCK :MPS Postbil STR_VEHICLE_NAME_ROAD_VEHICLE_REYNARD_MAIL_TRUCK :Reynard Postbil STR_VEHICLE_NAME_ROAD_VEHICLE_PERRY_MAIL_TRUCK :Perry Postbil -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_MAIL_TRUCK :MightyMover Postbil +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_MAIL_TRUCK :MightyMover postbil STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_MAIL_TRUCK :Powernaught Postbil STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_MAIL_TRUCK :Wizzowow Postbil STR_VEHICLE_NAME_ROAD_VEHICLE_WITCOMBE_OIL_TANKER :Witcombe Oljetanker @@ -5338,44 +5338,44 @@ STR_VEHICLE_NAME_ROAD_VEHICLE_BALOGH_RUBBER_TRUCK :Balogh Gummidum STR_VEHICLE_NAME_ROAD_VEHICLE_UHL_RUBBER_TRUCK :Uhl Gummidumper STR_VEHICLE_NAME_ROAD_VEHICLE_RMT_RUBBER_TRUCK :RMT Gummidumper STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_SUGAR_TRUCK :MightyMover Sockerlastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_SUGAR_TRUCK :Powernaught Sockerlastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_SUGAR_TRUCK :Wizzowow Sockerlastare -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_COLA_TRUCK :MightyMover Kolalastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_COLA_TRUCK :Powernaught Kolalastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_COLA_TRUCK :Wizzowow Kolalastare -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_COTTON_CANDY :MightyMover Sockervaddslastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_COTTON_CANDY :Powernaught Sockervaddslastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_COTTON_CANDY_TRUCK :Wizzowow Sockervaddslastare +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_SUGAR_TRUCK :Powernaught sockerlastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_SUGAR_TRUCK :Wizzowow sockerlastare +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_COLA_TRUCK :MightyMover kolalastare +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_COLA_TRUCK :Powernaught kolalastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_COLA_TRUCK :Wizzowow kolalastare +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_COTTON_CANDY :MightyMover sockervaddslastare +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_COTTON_CANDY :Powernaught sockervaddslastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_COTTON_CANDY_TRUCK :Wizzowow sockervaddslastare STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_TOFFEE_TRUCK :MightyMover Knäcklastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOFFEE_TRUCK :Powernaught Knäcklastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOFFEE_TRUCK :Wizzowow Knäcklastare +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOFFEE_TRUCK :Powernaught knäcklastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOFFEE_TRUCK :Wizzowow knäcklastare STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_TOY_VAN :MightyMover Leksaksbil -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOY_VAN :Powernaught Leksaksbil -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOY_VAN :Wizzowow Leksaksbil -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_CANDY_TRUCK :MightyMover Godislastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_CANDY_TRUCK :Powernaught Godislastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_CANDY_TRUCK :Wizzowow Godislastare -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_BATTERY_TRUCK :MightyMover Batterilastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_BATTERY_TRUCK :Powernaught Batterilastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_BATTERY_TRUCK :Wizzowow Batterilastare -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_FIZZY_DRINK :MightyMover Läsklastbil -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_FIZZY_DRINK :Powernaught Läsklastbil -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_FIZZY_DRINK_TRUCK :Wizzowow Läsklastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_TOY_VAN :Powernaught leksaksbil +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_TOY_VAN :Wizzowow leksaksbil +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_CANDY_TRUCK :MightyMover godislastare +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_CANDY_TRUCK :Powernaught godislastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_CANDY_TRUCK :Wizzowow godislastare +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_BATTERY_TRUCK :MightyMover batterilastare +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_BATTERY_TRUCK :Powernaught batterilastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_BATTERY_TRUCK :Wizzowow batterilastare +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_FIZZY_DRINK :MightyMover läsklastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_FIZZY_DRINK :Powernaught läsklastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_FIZZY_DRINK_TRUCK :Wizzowow läsklastbil STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_PLASTIC_TRUCK :MightyMover Plastlastare -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_PLASTIC_TRUCK :Powernaught Plastlastare -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_PLASTIC_TRUCK :Wizzowow Plastlastbil -STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_BUBBLE_TRUCK :MightyMover Bubbellastbil -STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_BUBBLE_TRUCK :Powernaught Bubbellastbil -STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_BUBBLE_TRUCK :Wizzowow Bubbellastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_PLASTIC_TRUCK :Powernaught plastlastare +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_PLASTIC_TRUCK :Wizzowow plastlastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_MIGHTYMOVER_BUBBLE_TRUCK :MightyMover bubbellastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_POWERNAUGHT_BUBBLE_TRUCK :Powernaught bubbellastbil +STR_VEHICLE_NAME_ROAD_VEHICLE_WIZZOWOW_BUBBLE_TRUCK :Wizzowow bubbellastbil ###length 11 STR_VEHICLE_NAME_SHIP_MPS_OIL_TANKER :MPS Oljetanker STR_VEHICLE_NAME_SHIP_CS_INC_OIL_TANKER :CS-Inc. Oljetanker -STR_VEHICLE_NAME_SHIP_MPS_PASSENGER_FERRY :MPS Passagerarfärja -STR_VEHICLE_NAME_SHIP_FFP_PASSENGER_FERRY :FFP Passagerarfärja +STR_VEHICLE_NAME_SHIP_MPS_PASSENGER_FERRY :MPS passagerarfärja +STR_VEHICLE_NAME_SHIP_FFP_PASSENGER_FERRY :FFP passagerarfärja STR_VEHICLE_NAME_SHIP_BAKEWELL_300_HOVERCRAFT :Bakewell 300 svävare -STR_VEHICLE_NAME_SHIP_CHUGGER_CHUG_PASSENGER :Chugger-Chug Passagerarfärja -STR_VEHICLE_NAME_SHIP_SHIVERSHAKE_PASSENGER_FERRY :Shivershake Passagerarfärja +STR_VEHICLE_NAME_SHIP_CHUGGER_CHUG_PASSENGER :Chugger-Chug passagerarfärja +STR_VEHICLE_NAME_SHIP_SHIVERSHAKE_PASSENGER_FERRY :Shivershake passagerarfärja STR_VEHICLE_NAME_SHIP_YATE_CARGO_SHIP :Yate lastfartyg STR_VEHICLE_NAME_SHIP_BAKEWELL_CARGO_SHIP :Bakewell lastfartyg STR_VEHICLE_NAME_SHIP_MIGHTYMOVER_CARGO_SHIP :MightyMover lastfartyg @@ -5420,9 +5420,9 @@ STR_VEHICLE_NAME_AIRCRAFT_PLODDYPHUT_500 :Ploddyphut 500 STR_VEHICLE_NAME_AIRCRAFT_FLASHBANG_X1 :Flashbang X1 STR_VEHICLE_NAME_AIRCRAFT_JUGGERPLANE_M1 :Juggerplane M1 STR_VEHICLE_NAME_AIRCRAFT_FLASHBANG_WIZZER :Flashbang Wizzer -STR_VEHICLE_NAME_AIRCRAFT_TRICARIO_HELICOPTER :Tricario Helikopter -STR_VEHICLE_NAME_AIRCRAFT_GURU_X2_HELICOPTER :Guru X2 Helikopter -STR_VEHICLE_NAME_AIRCRAFT_POWERNAUT_HELICOPTER :Powernaut Helikopter +STR_VEHICLE_NAME_AIRCRAFT_TRICARIO_HELICOPTER :Tricario helikopter +STR_VEHICLE_NAME_AIRCRAFT_GURU_X2_HELICOPTER :Guru X2 helikopter +STR_VEHICLE_NAME_AIRCRAFT_POWERNAUT_HELICOPTER :Powernaut helikopter ##id 0x8800 # Formatting of some strings From edf7b02ddbae5c3d88c293c4db9b5b5ceee616e7 Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 28 Oct 2021 18:48:40 +0000 Subject: [PATCH 058/710] Update: Translations from eints german: 2 changes by Wuzzy2 --- src/lang/german.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/german.txt b/src/lang/german.txt index c842c5c572..a87e04e534 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -2258,6 +2258,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Landsch STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Spielfeldgröße: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Serverversion: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Serveradresse: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Einladungscode: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Startdatum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Aktuelles Datum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Spielskript: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2675,7 @@ STR_STATION_CLASS_WAYP :Wegpunkte # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Signalauswahl +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Das Zeigen erweiterter Signaltypen umschalten STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Blocksignal (Formsignal){}Dies ist der einfachste Signaltyp. Bei Verwendung dieses Signaltyps darf sich immer nur ein Zug im Signalabschnitt aufhalten STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Einfahrsignal (Formsignal){}Zeigt grün, wenn im nächsten Block mindestens ein Ausfahrsignal grün zeigt. Andernfalls zeigt es rot STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Ausfahrsignal (Formsignal){}Verhält sich wie ein Blocksignal, wird jedoch benötigt, um den Einfahr- oder Kombinationssignalen des Blockes „frei“ zu melden From ccf70fc4b3bc3dbcf053b93d5231951fe57972e0 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 29 Oct 2021 18:49:23 +0000 Subject: [PATCH 059/710] Update: Translations from eints dutch: 2 changes by Afoklala --- src/lang/dutch.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index f430e6950f..b803b6d96c 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Landsch STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Kaartgrootte: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Serverversie: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Serveradres: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Uitnodigingscode: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Startdatum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Huidige datum: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Spelscript: {WHITE}{STRING} (v{NUM}) @@ -2673,6 +2674,7 @@ STR_STATION_CLASS_WAYP :Routepunten # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Seinselectie +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Wisselen tussen geavanceerde seintypen weergeven-verbergen STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Bloksein (armsein){}Dit is het simpelste soort sein dat slechts één trein tegelijk in hetzelfde blok toelaat STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Ingangssein (armsein){}Groen als er een groen uitgangssein is uit het volgende blok. Anders rood. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Uitgangssein (armsein){}Gedraagt zich hetzelfde als een standaardsein, maar is nodig om ingangs- en combinatie-voorseinen aan te sturen From 00a6287f977f6e0a24d572e2eb7ca9ebab5a07f2 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 1 Nov 2021 18:49:20 +0000 Subject: [PATCH 060/710] Update: Translations from eints arabic (egypt): 2 changes by AviationGamerX --- src/lang/arabic_egypt.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 35288f9b2e..201d061914 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -1149,6 +1149,7 @@ STR_CONFIG_SETTING_HORIZONTAL_POS_CENTER :متوسط STR_CONFIG_SETTING_HORIZONTAL_POS_RIGHT :يمين +STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT :سعر الفائدة على القرض يتحكم أيضًا في التضخم ، إذا تم تمكينه STR_CONFIG_SETTING_CONSTRUCTION_SPEED ::سرعة البناء {STRING} @@ -2047,6 +2048,7 @@ STR_CONTENT_SELECT_UPDATES_CAPTION_TOOLTIP :{BLACK} ضع ع STR_CONTENT_UNSELECT_ALL_CAPTION :{BLACK} مسح الكل STR_CONTENT_UNSELECT_ALL_CAPTION_TOOLTIP :{BLACK} ضع علامة على المحتوى التي لن يتم تحميلها STR_CONTENT_SEARCH_EXTERNAL :{BLACK}بحث المواقع الخارجية +STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK} محتوى البحث غير متوفر في في خدمة محتوى OpenTTD على مواقع الويب غير التابعة لـ OpenTTD STR_CONTENT_FILTER_TITLE :{BLACK}مُرَشِح: STR_CONTENT_OPEN_URL :{BLACK} زيارة الموقع STR_CONTENT_OPEN_URL_TOOLTIP :{BLACK}قم بزيارة الموقع لهذا المحتوى From 9edb75ec0b4ecfb2803728d129b353d1d224beaf Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 2 Nov 2021 18:49:30 +0000 Subject: [PATCH 061/710] Update: Translations from eints arabic (egypt): 7 changes by AviationGamerX --- src/lang/arabic_egypt.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 201d061914..1a100e6a57 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -294,6 +294,7 @@ STR_SORT_BY_LENGTH :الطول STR_SORT_BY_LIFE_TIME :العمر المتبقي STR_SORT_BY_TIMETABLE_DELAY :تاخير جدولة الاوامر STR_SORT_BY_FACILITY :نوع المحطة +STR_SORT_BY_WAITING_TOTAL :إجمالي البضائع المنتظرة STR_SORT_BY_RATING_MAX :اعلى نسبة شحن STR_SORT_BY_RATING_MIN :اقل نسبة شحن STR_SORT_BY_ENGINE_ID :نوع المحرك (قياسي) @@ -1161,12 +1162,14 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS ::تعطلات ###setting-zero-is-special +STR_CONFIG_SETTING_RECESSIONS :حالات الركود: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL :موقف مجلس المدينة من إعادة هيكلة المنطقة: {STRING} STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :حد ارتفاع الخريطة:{STRING} +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT :اضبط أقصى ارتفاع لتضاريس الخريطة. باستخدام "(أوتوماتيك)" ، سيتم اختيار قيمة جيدة بعد إنشاء التضاريس ###setting-zero-is-special STR_CONFIG_SETTING_AUTOSLOPE :السماح بتحريك الأرض تحت المباني, الطرق, الخ : {STRING} @@ -1268,6 +1271,7 @@ STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :عند التم STR_CONFIG_SETTING_AUTORENEW_MONEY :التجديد التلقائي عند توفر السيولة الدنيا للتجديد: {STRING} +STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE :{COMMA} ثانية ###setting-zero-is-special @@ -1937,6 +1941,7 @@ STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(شركة جد STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :منع +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}هل أنت متأكد أنك تريد طرد اللاعب '{STRING}'؟ STR_NETWORK_SPECTATORS :المشاهدين @@ -2782,6 +2787,7 @@ STR_NEWGRF_LIST_MISSING :{RED}ملفات STR_NEWGRF_BROKEN :{WHITE}حركات NewGFR '{0:STRING}'قد تتسبب في اخطاء او توقف للعبة STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}غير حالة العربات المكهربة ل'{1:ENGINE}' عندما لا تكون داخل ورشة الصيانة. STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}يغير طول العربة من '{1:ENGINE}' عندما لا تكون داخل المستودع +STR_NEWGRF_BROKEN_CAPACITY :{WHITE}غيرت حمولة السيارة ل '{1:ENGINE}' عندما لا تكون داخل مخزن أو تحت التجديد STR_BROKEN_VEHICLE_LENGTH :{WHITE}قطار '{VEHICLE}' المملوك ل'{COMPANY}' لدية طول غير مسرح . غالبا نتج عن مشكلة في NewGRF. اللعبة قد تتوقف او تتعطل . STR_NEWGRF_BUGGY :{WHITE}الرسوميات الجديدة '{0:STRING}' تعطي معلومات غير صحيحة. @@ -3808,6 +3814,7 @@ STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW} شاش # AI configuration window STR_AI_CONFIG_CAPTION :{WHITE}إعدادات الذكاء الصناعي +STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}مخطوطت اللعبة الذي سيتم تحميله في اللعبة التالية STR_AI_CONFIG_HUMAN_PLAYER :لاعب انساني STR_AI_CONFIG_RANDOM_AI :ذكاء صناعي عشوائي STR_AI_CONFIG_NONE :(لا شيء) From 80e3397f8549f06a6c75a274029560934c45ea7b Mon Sep 17 00:00:00 2001 From: dP Date: Wed, 3 Nov 2021 23:33:38 +0300 Subject: [PATCH 062/710] Fix 3a1a915: Every 16th client never reconnects after server restart --- src/network/network_client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index bc5f24ac38..f03601b39f 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -1055,9 +1055,9 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_NEWGAME(Packet * care about the server shutting down. */ if (this->status >= STATUS_JOIN) { /* To throttle the reconnects a bit, every clients waits its - * Client ID modulo 16. This way reconnects should be spread - * out a bit. */ - _network_reconnect = _network_own_client_id % 16; + * Client ID modulo 16 + 1 (value 0 means no reconnect). + * This way reconnects should be spread out a bit. */ + _network_reconnect = _network_own_client_id % 16 + 1; ShowErrorMessage(STR_NETWORK_MESSAGE_SERVER_REBOOT, INVALID_STRING_ID, WL_CRITICAL); } From 33ef34189e25779c222efa068313c6df5ea532ed Mon Sep 17 00:00:00 2001 From: Dmitry Erlikh Date: Wed, 3 Nov 2021 22:10:21 +0100 Subject: [PATCH 063/710] Fix #9648: add missing commas in crash message --- src/saveload/afterload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 6a42ea81c6..d3194cd4e2 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -393,8 +393,8 @@ static void CDECL HandleSavegameLoadCrash(int signum) "or older version.\n" "It will load a NewGRF with the same GRF ID as the missing NewGRF.\n" "This means that if the author makes incompatible NewGRFs with the\n" - "same GRF ID OpenTTD cannot magically do the right thing. In most\n" - "cases OpenTTD will load the savegame and not crash, but this is an\n" + "same GRF ID, OpenTTD cannot magically do the right thing. In most\n" + "cases, OpenTTD will load the savegame and not crash, but this is an\n" "exception.\n" "Please load the savegame with the appropriate NewGRFs installed.\n" "The missing/compatible NewGRFs are:\n"); From 6ff0858b38cac1fa734081adef1ae6d6b6297a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sat, 6 Nov 2021 17:32:37 +0100 Subject: [PATCH 064/710] Fix #9669, cbe00ec: Only try valid reverse directions (#9672) --- src/pathfinder/npf/npf.cpp | 7 +++++-- src/pathfinder/yapf/yapf_ship.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index f7cb1a5cda..25681507c7 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -1225,9 +1225,12 @@ bool NPFShipCheckReverse(const Ship *v, Trackdir *best_td) AyStarUserData user = { v->owner, TRANSPORT_WATER, RAILTYPES_NONE, ROADTYPES_NONE, 0 }; if (best_td != nullptr) { - TrackdirBits rtds = DiagdirReachesTrackdirs(ReverseDiagDir(VehicleExitDir(v->direction, v->state))); + DiagDirection entry = ReverseDiagDir(VehicleExitDir(v->direction, v->state)); + TrackdirBits rtds = DiagdirReachesTrackdirs(entry) & TrackStatusToTrackdirBits(GetTileTrackStatus(v->tile, TRANSPORT_WATER, 0, entry)); Trackdir best = (Trackdir)FindFirstBit2x64(rtds); - for (rtds = KillFirstBit(rtds); rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) { + rtds = KillFirstBit(rtds); + if (rtds == TRACKDIR_BIT_NONE) return false; /* At most one choice. */ + for (; rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) { Trackdir td = (Trackdir)FindFirstBit2x64(rtds); ftd = NPFRouteToStationOrTileTwoWay(v->tile, best, false, v->tile, td, false, &fstd, &user); if (ftd.best_bird_dist == 0 && NPFGetFlag(&ftd.node, NPF_FLAG_REVERSE)) best = td; diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index 25a63ec669..947de5a764 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -212,7 +212,13 @@ public: /* create pathfinder instance */ Tpf pf; /* set origin and destination nodes */ - pf.SetOrigin(tile, trackdir == nullptr ? TrackdirToTrackdirBits(td1) | TrackdirToTrackdirBits(td2) : DiagdirReachesTrackdirs(ReverseDiagDir(VehicleExitDir(v->direction, v->state)))); + if (trackdir == nullptr) { + pf.SetOrigin(tile, TrackdirToTrackdirBits(td1) | TrackdirToTrackdirBits(td2)); + } else { + DiagDirection entry = ReverseDiagDir(VehicleExitDir(v->direction, v->state)); + TrackdirBits rtds = DiagdirReachesTrackdirs(entry) & TrackStatusToTrackdirBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0, entry)); + pf.SetOrigin(tile, rtds); + } pf.SetDestination(v); /* find best path */ if (!pf.FindPath(v)) return false; From 95c84676701ba8e6b4ec6b84ce588b653b3a2ac9 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 6 Nov 2021 18:50:28 +0100 Subject: [PATCH 065/710] Fix 65cbde4b: Writing to uninitialized string when loading a currency NewGRF. --- src/newgrf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 8a88e52032..d1352d02e7 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2679,8 +2679,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint16 options = buf->ReadWord(); if (curidx < CURRENCY_END) { - _currency_specs[curidx].separator[0] = GB(options, 0, 8); - _currency_specs[curidx].separator[1] = '\0'; + _currency_specs[curidx].separator.clear(); + _currency_specs[curidx].separator.push_back(GB(options, 0, 8)); /* By specifying only one bit, we prevent errors, * since newgrf specs said that only 0 and 1 can be set for symbol_pos */ _currency_specs[curidx].symbol_pos = GB(options, 8, 1); From 73001ae1a9282aadb9512b93845f2fe4c1a7e5e9 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 6 Nov 2021 18:47:14 +0000 Subject: [PATCH 066/710] Update: Translations from eints english (au): 3 changes by LordAro --- src/lang/english_AU.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 7dd88a014f..8e6b8976fa 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1338,7 +1338,7 @@ STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE :{COMMA} second{ STR_CONFIG_SETTING_HOVER_DELAY :Show tooltips: {STRING} STR_CONFIG_SETTING_HOVER_DELAY_HELPTEXT :Delay before tooltips are displayed when hovering the mouse over some interface element. Alternatively tooltips can be bound to the right mouse button -STR_CONFIG_SETTING_HOVER_DELAY_VALUE :Hover for {COMMA} second{P 0 "" s} +STR_CONFIG_SETTING_HOVER_DELAY_VALUE :Hover for {COMMA} millisecond{P 0 "" s} ###setting-zero-is-special STR_CONFIG_SETTING_HOVER_DELAY_DISABLED :Right click @@ -2255,6 +2255,7 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} ha STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} has started a new company (#{2:NUM}) STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} has left the game ({2:STRING}) STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} has changed his/her name to {STRING} +STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} gave {2:CURRENCY_LONG} to {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}The server closed the session STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}The server is restarting...{}Please wait... @@ -3641,6 +3642,7 @@ STR_REPLACE_MONORAIL_VEHICLES :Monorail Vehicl STR_REPLACE_MAGLEV_VEHICLES :Maglev Vehicles +STR_REPLACE_REMOVE_WAGON :{BLACK}Wagon removal ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Make autoreplace keep the length of a train the same by removing wagons (starting at the front), if replacing the engine would make the train longer # Vehicle view From 8c558d74a59fe10061bb16b83d708ad8e65eb020 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 6 Nov 2021 18:59:52 +0100 Subject: [PATCH 067/710] Fix 55a11710: Curly braces need to be double-escaped for (std::)fmt. --- src/network/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/network.cpp b/src/network/network.cpp index 109a2cce70..dd0a915949 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -1073,7 +1073,7 @@ void NetworkGameLoop() if (sync_state[0] == _random.state[0] && sync_state[1] == _random.state[1]) { Debug(desync, 0, "Sync check: {:08x}; {:02x}; match", _date, _date_fract); } else { - Debug(desync, 0, "Sync check: {:08x}; {:02x}; mismatch expected {{:08x}, {:08x}}, got {{:08x}, {:08x}}", + Debug(desync, 0, "Sync check: {:08x}; {:02x}; mismatch expected {{{:08x}, {:08x}}}, got {{{:08x}, {:08x}}}", _date, _date_fract, sync_state[0], sync_state[1], _random.state[0], _random.state[1]); NOT_REACHED(); } From d0655a48bab31903068d6e0f94323da8a8bda94d Mon Sep 17 00:00:00 2001 From: J0anJosep Date: Sat, 6 Nov 2021 23:04:33 +0100 Subject: [PATCH 068/710] Fix: Do not redraw vehicle lists when skip order command is tested. --- src/order_cmd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index f6e7f77a48..f282ca12bd 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1136,11 +1136,11 @@ CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 v->UpdateRealOrderIndex(); InvalidateVehicleOrder(v, VIWD_MODIFY_ORDERS); - } - /* We have an aircraft/ship, they have a mini-schedule, so update them all */ - if (v->type == VEH_AIRCRAFT) SetWindowClassesDirty(WC_AIRCRAFT_LIST); - if (v->type == VEH_SHIP) SetWindowClassesDirty(WC_SHIPS_LIST); + /* We have an aircraft/ship, they have a mini-schedule, so update them all */ + if (v->type == VEH_AIRCRAFT) SetWindowClassesDirty(WC_AIRCRAFT_LIST); + if (v->type == VEH_SHIP) SetWindowClassesDirty(WC_SHIPS_LIST); + } return CommandCost(); } From 08cb5ba2cd69406e34cb4a439d477142e80cef57 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 7 Nov 2021 11:41:24 -0500 Subject: [PATCH 069/710] Fix: Don't show screenshot GUI in screenshots (#9674) --- src/screenshot.cpp | 3 +++ src/screenshot_gui.cpp | 22 ++++++++++++++++++++++ src/screenshot_gui.h | 1 + 3 files changed, 26 insertions(+) diff --git a/src/screenshot.cpp b/src/screenshot.cpp index f91648cf47..ddb22f13e1 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -12,6 +12,7 @@ #include "viewport_func.h" #include "gfx_func.h" #include "screenshot.h" +#include "screenshot_gui.h" #include "blitter/factory.hpp" #include "zoom_func.h" #include "core/endian_func.hpp" @@ -909,8 +910,10 @@ static bool RealMakeScreenshot(ScreenshotType t, std::string name, uint32 width, * of the screenshot. This way the screenshot will always show the name * of the previous screenshot in the 'successful' message instead of the * name of the new screenshot (or an empty name). */ + SetScreenshotWindowVisibility(true); UndrawMouseCursor(); DrawDirtyBlocks(); + SetScreenshotWindowVisibility(false); } _screenshot_name[0] = '\0'; diff --git a/src/screenshot_gui.cpp b/src/screenshot_gui.cpp index e9b989e517..b6d68d0919 100644 --- a/src/screenshot_gui.cpp +++ b/src/screenshot_gui.cpp @@ -13,6 +13,7 @@ #include "screenshot.h" #include "widgets/screenshot_widget.h" #include "table/strings.h" +#include "gfx_func.h" struct ScreenshotWindow : Window { ScreenshotWindow(WindowDesc *desc) : Window(desc) @@ -72,3 +73,24 @@ void ShowScreenshotWindow() CloseWindowById(WC_SCREENSHOT, 0); new ScreenshotWindow(&_screenshot_window_desc); } + +/** + * Set the visibility of the screenshot window when taking a screenshot. + * @param hide Are we hiding the window or showing it again after the screenshot is taken? + */ +void SetScreenshotWindowVisibility(bool hide) +{ + ScreenshotWindow *scw = (ScreenshotWindow *)FindWindowById(WC_SCREENSHOT, 0); + + if (scw == nullptr) return; + + if (hide) { + /* Set dirty the screen area where the window is covering (not the window itself), then move window off screen. */ + scw->SetDirty(); + scw->left += 2 * _screen.width; + } else { + /* Return window to original position. */ + scw->left -= 2 * _screen.width; + scw->SetDirty(); + } +} diff --git a/src/screenshot_gui.h b/src/screenshot_gui.h index 44a395edb1..493bcc80f7 100644 --- a/src/screenshot_gui.h +++ b/src/screenshot_gui.h @@ -11,5 +11,6 @@ #define SCREENSHOT_GUI_H void ShowScreenshotWindow(); +void SetScreenshotWindowVisibility(bool hide); #endif /* SCREENSHOT_GUI_H */ From b4bd7b367e3b2ab0e82319e04adb9f302a9f222f Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 7 Nov 2021 13:53:54 -0500 Subject: [PATCH 070/710] Feature: Ctrl-click to remove fully autoreplaced vehicles from list (#9639) --- src/autoreplace_gui.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 9f2deaf10a..898b4e7503 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -578,6 +578,16 @@ public: size_t engine_count = this->engines[click_side].size(); EngineID e = engine_count > i ? this->engines[click_side][i] : INVALID_ENGINE; + + /* If Ctrl is pressed on the left side and we don't have any engines of the selected type, stop autoreplacing. + * This is most common when we have finished autoreplacing the engine and want to remove it from the list. */ + if (click_side == 0 && _ctrl_pressed && e != INVALID_ENGINE && + (GetGroupNumEngines(_local_company, sel_group, e) == 0 || GetGroupNumEngines(_local_company, ALL_GROUP, e) == 0)) { + EngineID veh_from = e; + DoCommandP(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE); + break; + } + if (e == this->sel_engine[click_side]) break; // we clicked the one we already selected this->sel_engine[click_side] = e; if (click_side == 0) { From c38af729787f25e56cb19fce90d89eebf3067c66 Mon Sep 17 00:00:00 2001 From: Guillaume Renoult Date: Mon, 8 Nov 2021 05:54:50 +1100 Subject: [PATCH 071/710] Update: add setting to hide news about competitors vehicle crash (#9653) --- src/aircraft_cmd.cpp | 7 ++++++- src/lang/english.txt | 3 +++ src/news_gui.cpp | 1 + src/news_type.h | 1 + src/roadveh_cmd.cpp | 8 +++++++- src/settings_gui.cpp | 1 + src/settings_type.h | 1 + src/table/settings/news_display_settings.ini | 11 +++++++++++ 8 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 52c966e81e..4c4ed5a46a 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1341,7 +1341,12 @@ static void CrashAirplane(Aircraft *v) AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, vt, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING)); Game::NewEvent(new ScriptEventVehicleCrashed(v->index, vt, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING)); - AddTileNewsItem(newsitem, NT_ACCIDENT, vt, nullptr, st != nullptr ? st->index : INVALID_STATION); + NewsType newstype = NT_ACCIDENT; + if (v->owner != _local_company) { + newstype = NT_ACCIDENT_OTHER; + } + + AddTileNewsItem(newsitem, newstype, vt, nullptr, st != nullptr ? st->index : INVALID_STATION); ModifyStationRatingAround(vt, v->owner, -160, 30); if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); diff --git a/src/lang/english.txt b/src/lang/english.txt index 49497a00c4..becf8d35c2 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1743,6 +1743,9 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Display a newsp STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / disasters: {STRING2} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Display a newspaper when accidents or disasters occur +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidents of competitor's vehicles: {STRING2} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Display a newspaper about crashed vehicles for competitors + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Company information: {STRING2} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Display a newspaper when a new company starts, or when companies are risking to bankrupt diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 4bd4bcecbb..10a49b62e8 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -231,6 +231,7 @@ static NewsTypeData _news_type_data[] = { NewsTypeData("news_display.arrival_player", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_COMPANY NewsTypeData("news_display.arrival_other", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_OTHER NewsTypeData("news_display.accident", 90, SND_BEGIN ), ///< NT_ACCIDENT + NewsTypeData("news_display.accident_other", 90, SND_BEGIN ), ///< NT_ACCIDENT_OTHER NewsTypeData("news_display.company_info", 60, SND_BEGIN ), ///< NT_COMPANY_INFO NewsTypeData("news_display.open", 90, SND_BEGIN ), ///< NT_INDUSTRY_OPEN NewsTypeData("news_display.close", 90, SND_BEGIN ), ///< NT_INDUSTRY_CLOSE diff --git a/src/news_type.h b/src/news_type.h index 4dea8c46f5..188305b52f 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -22,6 +22,7 @@ enum NewsType { NT_ARRIVAL_COMPANY, ///< First vehicle arrived for company NT_ARRIVAL_OTHER, ///< First vehicle arrived for competitor NT_ACCIDENT, ///< An accident or disaster has occurred + NT_ACCIDENT_OTHER, ///< An accident or disaster has occurred NT_COMPANY_INFO, ///< Company info (new companies, bankruptcy messages) NT_INDUSTRY_OPEN, ///< Opening of industries NT_INDUSTRY_CLOSE, ///< Closing of industries diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 86c2de78eb..9c444d1d37 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -553,7 +553,13 @@ static void RoadVehCrash(RoadVehicle *v) SetDParam(0, pass); StringID newsitem = (pass == 1) ? STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER : STR_NEWS_ROAD_VEHICLE_CRASH; - AddTileNewsItem(newsitem, NT_ACCIDENT, v->tile); + NewsType newstype = NT_ACCIDENT; + + if (v->owner != _local_company) { + newstype = NT_ACCIDENT_OTHER; + } + + AddTileNewsItem(newsitem, newstype, v->tile); ModifyStationRatingAround(v->tile, v->owner, -160, 22); if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 3e7a0fbb12..f99ef8f3e2 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1648,6 +1648,7 @@ static SettingsContainer &GetSettingsTree() advisors->Add(new SettingEntry("news_display.general")); advisors->Add(new SettingEntry("news_display.new_vehicles")); advisors->Add(new SettingEntry("news_display.accident")); + advisors->Add(new SettingEntry("news_display.accident_other")); advisors->Add(new SettingEntry("news_display.company_info")); advisors->Add(new SettingEntry("news_display.acceptance")); advisors->Add(new SettingEntry("news_display.arrival_player")); diff --git a/src/settings_type.h b/src/settings_type.h index 3c2f2be7b0..9da2655d6b 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -242,6 +242,7 @@ struct NewsSettings { uint8 arrival_player; ///< NewsDisplay of vehicles arriving at new stations of current player uint8 arrival_other; ///< NewsDisplay of vehicles arriving at new stations of other players uint8 accident; ///< NewsDisplay of accidents that occur + uint8 accident_other; ///< NewsDisplay if a vehicle from another company is involved in an accident uint8 company_info; ///< NewsDisplay of general company information uint8 open; ///< NewsDisplay on new industry constructions uint8 close; ///< NewsDisplay about closing industries diff --git a/src/table/settings/news_display_settings.ini b/src/table/settings/news_display_settings.ini index 81a739fbaf..edbb8783ba 100644 --- a/src/table/settings/news_display_settings.ini +++ b/src/table/settings/news_display_settings.ini @@ -67,6 +67,17 @@ str = STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS strhelp = STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT strval = STR_CONFIG_SETTING_NEWS_MESSAGES_OFF +[SDTC_OMANY] +var = news_display.accident_other +type = SLE_UINT8 +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN +def = 2 +max = 2 +full = _news_display +str = STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER +strhelp = STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT +strval = STR_CONFIG_SETTING_NEWS_MESSAGES_OFF + [SDTC_OMANY] var = news_display.company_info type = SLE_UINT8 From e9cb9c11357133ed4695a434bf5d6b927059e9ff Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Mon, 8 Nov 2021 03:12:15 -0500 Subject: [PATCH 072/710] Fix #9579: Object and HQ construction is Construction cost, not Property Maintenance (#9673) --- regression/regression/result.txt | 2 +- src/object_cmd.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/regression/regression/result.txt b/regression/regression/result.txt index 69322b1d2d..984c1de82b 100644 --- a/regression/regression/result.txt +++ b/regression/regression/result.txt @@ -639,7 +639,7 @@ ERROR: IsEnd() is invalid as Begin() is never called GetQuarterlyCompanyValue(): -1 Quarter: 0 GetQuarterlyIncome(): 0 - GetQuarterlyExpenses(): -210 + GetQuarterlyExpenses(): 0 GetQuarterlyCargoDelivered(): 0 GetQuarterlyPerformanceRating(): -1 GetQuarterlyCompanyValue(): 1 diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index cd080ca538..7e1e36c1f1 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -204,7 +204,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags); */ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) { - CommandCost cost(EXPENSES_PROPERTY); + CommandCost cost(EXPENSES_CONSTRUCTION); ObjectType type = (ObjectType)GB(p1, 0, 16); if (type >= NUM_OBJECTS) return CMD_ERROR; @@ -526,7 +526,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags) } /* cost of relocating company is 1% of company value */ - cost = CommandCost(EXPENSES_PROPERTY, CalculateCompanyValue(c) / 100); + cost = CommandCost(EXPENSES_CONSTRUCTION, CalculateCompanyValue(c) / 100); break; } From 0ad40ee868a4e2ced9cb34bdbb5cddec84cb26fe Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 8 Nov 2021 18:50:01 +0000 Subject: [PATCH 073/710] Update: Translations from eints arabic (egypt): 35 changes by AviationGamerX --- src/lang/afrikaans.txt | 1 + src/lang/arabic_egypt.txt | 47 +++++++++++++++++++++++-------- src/lang/basque.txt | 1 + src/lang/belarusian.txt | 1 + src/lang/brazilian_portuguese.txt | 1 + src/lang/bulgarian.txt | 1 + src/lang/catalan.txt | 1 + src/lang/chuvash.txt | 1 + src/lang/croatian.txt | 1 + src/lang/czech.txt | 1 + src/lang/danish.txt | 1 + src/lang/dutch.txt | 1 + src/lang/english_AU.txt | 1 + src/lang/english_US.txt | 1 + src/lang/esperanto.txt | 1 + src/lang/estonian.txt | 1 + src/lang/faroese.txt | 1 + src/lang/finnish.txt | 1 + src/lang/french.txt | 1 + src/lang/frisian.txt | 1 + src/lang/gaelic.txt | 1 + src/lang/galician.txt | 1 + src/lang/german.txt | 1 + src/lang/greek.txt | 1 + src/lang/hebrew.txt | 1 + src/lang/hindi.txt | 1 + src/lang/hungarian.txt | 1 + src/lang/icelandic.txt | 1 + src/lang/ido.txt | 1 + src/lang/indonesian.txt | 1 + src/lang/irish.txt | 1 + src/lang/italian.txt | 1 + src/lang/japanese.txt | 1 + src/lang/korean.txt | 1 + src/lang/latin.txt | 1 + src/lang/latvian.txt | 1 + src/lang/lithuanian.txt | 1 + src/lang/luxembourgish.txt | 1 + src/lang/macedonian.txt | 1 + src/lang/malay.txt | 1 + src/lang/maltese.txt | 1 + src/lang/marathi.txt | 1 + src/lang/norwegian_bokmal.txt | 1 + src/lang/norwegian_nynorsk.txt | 1 + src/lang/persian.txt | 1 + src/lang/polish.txt | 1 + src/lang/portuguese.txt | 1 + src/lang/romanian.txt | 1 + src/lang/russian.txt | 1 + src/lang/serbian.txt | 1 + src/lang/simplified_chinese.txt | 1 + src/lang/slovak.txt | 1 + src/lang/slovenian.txt | 1 + src/lang/spanish.txt | 1 + src/lang/spanish_MX.txt | 1 + src/lang/swedish.txt | 1 + src/lang/tamil.txt | 1 + src/lang/thai.txt | 1 + src/lang/traditional_chinese.txt | 1 + src/lang/turkish.txt | 1 + src/lang/ukrainian.txt | 1 + src/lang/urdu.txt | 1 + src/lang/vietnamese.txt | 1 + src/lang/welsh.txt | 1 + 64 files changed, 99 insertions(+), 11 deletions(-) diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index d9e050ed60..1ad648233d 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -1671,6 +1671,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Vertoon 'n koer STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ongelukke / rampe: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Vertoon 'n koerantberig wanneer daar ongelukke of natuurrampe voorkom + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Maatskappy informasie: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Vertoon 'n koerantberig wanneer 'n nuwe maatskappy begin, of wanneer 'n maatskappy in gevaar is om bankkrot te speel diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 1a100e6a57..f1503a22bb 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -360,6 +360,7 @@ STR_SCENEDIT_TOOLBAR_LANDSCAPE_GENERATION :{BLACK}بناء STR_SCENEDIT_TOOLBAR_TOWN_GENERATION :{BLACK}بناء المدن STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION :{BLACK}بناء المصانع STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}بناء الطرق +STR_SCENEDIT_TOOLBAR_TRAM_CONSTRUCTION :{BLACK}بناء الترام STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}زراعة اشجار STR_SCENEDIT_TOOLBAR_PLACE_SIGN :{BLACK}وضع علامة STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}وضع جسم @@ -758,6 +759,7 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES :{BLACK}عرض STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT :{BLACK}بدل عرض خريطة التضاريس STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES :{BLACK}عدم عرض ممتلكات اي شركة على الخارطة STR_SMALLMAP_TOOLTIP_ENABLE_ALL_COMPANIES :{BLACK}عرض جميع املاك الشركة على الخريطة +STR_SMALLMAP_TOOLTIP_DISABLE_ALL_CARGOS :{BLACK}عدم عرض أي بضائع على الخريطة # Status bar messages STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}اظهر اخر رسالة / تقرير @@ -923,7 +925,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :(HKD) دولا STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :القيادة على اليسار STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :القيادة على اليمين -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}اسماء المدن +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}اسماء المدن: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}اختيار طريقة عرض اسماء المدن ###length 21 @@ -1171,6 +1173,7 @@ STR_CONFIG_SETTING_CITY_APPROVAL :موقف مجل STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :حد ارتفاع الخريطة:{STRING} STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT :اضبط أقصى ارتفاع لتضاريس الخريطة. باستخدام "(أوتوماتيك)" ، سيتم اختيار قيمة جيدة بعد إنشاء التضاريس ###setting-zero-is-special +STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}لا يمكنك تعيين حد ارتفاع الخريطة لهذه القيمة. يوجد جبل واحد على الأقل أعلى على الخريطة STR_CONFIG_SETTING_AUTOSLOPE :السماح بتحريك الأرض تحت المباني, الطرق, الخ : {STRING} @@ -1194,6 +1197,7 @@ STR_CONFIG_SETTING_FORBID_90_DEG :منع القط STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :السماح بربط محطتين غير متجاورتين : {STRING} STR_CONFIG_SETTING_INFLATION :التضخم: {STRING} +STR_CONFIG_SETTING_INFLATION_HELPTEXT :تمكين التضخم في الاقتصاد ، حيث ترتفع التكاليف بشكل أسرع قليلاً من المدفوعات @@ -1222,16 +1226,19 @@ STR_CONFIG_SETTING_STOP_LOCATION_FAR_END :النهاية STR_CONFIG_SETTING_AUTOSCROLL :حرك الشاشة عندما تكون المؤشر على الحافة: {STRING} ###length 4 +STR_CONFIG_SETTING_AUTOSCROLL_DISABLED :غير مفعل STR_CONFIG_SETTING_BRIBE :السماح برشوة السلطات االمحليه: {STRING} STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :السماح بشراء حقوق النقل الحصري: {STRING} STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :السماح بتمويل المباني: {STRING} +STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :السماح للشركات بإعطاء الأموال للمدن لتمويل المنازل الجديدة STR_CONFIG_SETTING_ALLOW_FUND_ROAD :السماح بتمويل تعمير الطرق المحلية: {STRING} STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :السماح بتحويل المال للشركات الأخرى: {STRING} +STR_CONFIG_SETTING_ALLOW_GIVE_MONEY_HELPTEXT :السماح بتحويل الأموال بين الشركات في وضع اللعب الجماعي STR_CONFIG_SETTING_FREIGHT_TRAINS :مضاعفة وزن الشحنة لمحاكاة القطارات الثقيلة: {STRING} @@ -1297,7 +1304,7 @@ STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :إختر مقد STR_CONFIG_SETTING_SNOWLINE_HEIGHT :ارتفاع خط الثلج: {STRING} -STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :تحكم على اي ارتفاع يبدأ نزول الثلج في المناطق القطبية,تؤثر الثلوج على مستوى تطور القطاع الصناعي ونمو المدن +STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :تحكم على اي ارتفاع يبدأ نزول الثلج في المناطق القطبية,تؤثر الثلوج على مستوى تطور القطاع الصناعي ونمو المدن. لا يمكن تعديله إلا عبر معدل السيناريو أو يتم حسابه بطريقة أخرى عبر "تغطية الجليد" @@ -1380,6 +1387,7 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_COMMAND :الأوامر STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL :للتحكم STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :عدم استخدام +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :تغلق النافذة عن طريق الطغط على الزر الأيمن في الماوس داخل النافذة. يعطل الملحوظة عند الطغط على الزر الأيمن في الماوس! STR_CONFIG_SETTING_AUTOSAVE :حفظ تلقائي : {STRING} STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :اختر الوقت بين كل عملية حفظ اتوماتيكية @@ -1402,6 +1410,7 @@ STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_ALL_ACTIONS :كل تصرف STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS :استخدام المجموعات في قائمة العربات : {STRING} STR_CONFIG_SETTING_LOADING_INDICATORS :تفعيل مؤشر التحميل: {STRING} +STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :حدد ما إذا كانت مؤشرات التحميل معروضة فوق تحميل المركبات أو تفريغها STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :عرض جدولة الأعمال بالمهام بدلا من الأيام: {STRING} @@ -1449,6 +1458,7 @@ STR_CONFIG_SETTING_SOUND_AMBIENT :مؤثرات: { STR_CONFIG_SETTING_SOUND_AMBIENT_HELPTEXT :شغل مؤثرات صوتية في المناظر و المصانع و المدن STR_CONFIG_SETTING_MAX_TRAINS :الحد الأعلى لعدد القطارات لكل شركة: {STRING} +STR_CONFIG_SETTING_MAX_TRAINS_HELPTEXT :الحد الأقصى لعدد القطارات التي يمكن أن تمتلكها الشركة STR_CONFIG_SETTING_MAX_ROAD_VEHICLES :الحد الأعلى لعدد العربات لكل شركة: {STRING} @@ -1489,6 +1499,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :وصول اول STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :الحوادث/الأزمات: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :معلومات الشركة: {STRING} STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :تشغيل مصنع جديد: {STRING} @@ -1524,6 +1535,7 @@ STR_CONFIG_SETTING_NEWS_MESSAGES_SUMMARY :ملخص STR_CONFIG_SETTING_NEWS_MESSAGES_FULL :ممتلئ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :الاخبار الملونة تظهر في: {STRING} +STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :السنة التي تُطبع فيها إعلانات الجريدة بالألوان. قبل هذا العام ، يستخدم اللون أسود / أبيض STR_CONFIG_SETTING_STARTING_YEAR :سنة البدايه: {STRING} ###setting-zero-is-special @@ -1542,7 +1554,7 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :اتاحة اس STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :الدوران خلال الاشارات: {STRING} ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :اشارات الطريق فقط -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :الكل +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :الكل واضح ###length 2 @@ -1556,6 +1568,7 @@ STR_CONFIG_SETTING_TOWN_LAYOUT_RANDOM :عشوائي STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :السماح للمدن ببناء طرق: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :يسمح للمدن ببناء تقاطعات متعددة: {STRING} +STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :تمكين هذا الإعداد يسمح للمدن ببناء تقاطعات متعددة STR_CONFIG_SETTING_NOISE_LEVEL :السماح للمدن بالتحكم بضجيج المطارات: {STRING} @@ -1614,6 +1627,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :وحدات ال ###length 4 STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :(متري (كم / ساعة +STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :وحدات الطاقة في السيارة: {STRING} ###length 3 ###length 3 @@ -1677,6 +1691,7 @@ STR_CONFIG_ERROR_INVALID_GRF_UNKNOWN :مجهول STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL :{WHITE}... نسبة الضغط '{STRING}' غير صحيحة # Video initalization errors +STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... لم يتم العثور على GPU متوافق. تم تعطيل تسريع الأجهزة # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -1877,6 +1892,7 @@ STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}الت STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}كلمت السر محمية! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}الخادم غير موجود STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}الخادم ممتلئ +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}الخادم (سرڤر) قديم جدًا STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}النسخة غير متطابقة STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER} عدم توافق NewGFR @@ -1932,12 +1948,15 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}الشر # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :قائمة العملاء +STR_NETWORK_COMPANY_LIST_SPECTATE :شاهد # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}اللاعبون عبر الإنترنت STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(شركة جديدة) # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}عامة STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :منع @@ -1980,7 +1999,7 @@ STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}لم ي STR_NETWORK_ERROR_DESYNC :{WHITE}فشل تحديث البيانات STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}انقطع الاتصال بلعبة الشبكة STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}لايمكن تحميل اللعبة المخزنة -STR_NETWORK_ERROR_SERVER_START :{WHITE}لايمكن بدء الخادم +STR_NETWORK_ERROR_SERVER_START :{WHITE}لايمكن بدء الخادم (سرڤر) STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}حدث خطأ في البروتوكول و انقطع الاتصال STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}لم يتم تحديد اسم اللاعب الخاص بك. يمكنك تحديد الاسم في الجزء العلوي من نافذة العب الجماعي STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}نسخة اللاعب غير مطابقة لنسخة الخادم @@ -2100,7 +2119,7 @@ STR_CONTENT_DOWNLOAD_COMPLETE :{WHITE}انته STR_CONTENT_DOWNLOAD_PROGRESS_SIZE :{WHITE}{BYTES} من {BYTES} {NUM} % # Content downloading error messages -STR_CONTENT_ERROR_COULD_NOT_CONNECT :{WHITE}لم يتم الربط مع خادم المحتوى +STR_CONTENT_ERROR_COULD_NOT_CONNECT :{WHITE}لم يتم الربط مع خادم (سرڤر) المحتوى STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD :{WHITE}فشل التحميل... STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE :{WHITE}... لا يمكن الكتابة على الملف STR_CONTENT_ERROR_COULD_NOT_EXTRACT :{WHITE}لم يتمكن من فك ضغط الملف المحمل @@ -2110,6 +2129,7 @@ STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}تحتا STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}نعم, حمل الرسومات STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}لا, اغلق اللعبة +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}الخروج من OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}خيارات الشفافية @@ -2349,6 +2369,7 @@ STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}ضع ش STR_TREES_RANDOM_TREES_BUTTON :{BLACK}زراعة اشجار عشوائيا STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}زراعة اشجار عشوائيا في الأرض STR_TREES_MODE_NORMAL_TOOLTIP :زراعة شجرات منفصلة بالسحب فوق الارض +STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}غابة # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}بناء المسطحات الأرضية @@ -2399,7 +2420,7 @@ STR_FOUND_TOWN_SELECT_LAYOUT_RANDOM :{BLACK} عشو # Fund new industry window STR_FUND_INDUSTRY_CAPTION :{WHITE}مول بناء مصنع جديد STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}اختر المصنع المناسب من القائمة -STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :الكثير من المصانع +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :{BLACK}إنشاء المصانع العشوائية STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}غطي الخريطة عشوائيا بالمصانع STR_FUND_INDUSTRY_INDUSTRY_BUILD_COST :{BLACK}التكلفة: {YELLOW}{CURRENCY_LONG} STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK} الاحتمالية @@ -2770,6 +2791,7 @@ STR_NEWGRF_CONFIRMATION_TEXT :{YELLOW}انت STR_NEWGRF_DUPLICATE_GRFID :{WHITE}لا يمكن اضافة الملف: نسخة سابقة منه مضافة STR_NEWGRF_COMPATIBLE_LOADED :{ORANGE}الملف المطابق غير موجود (ملف متوافق من NewGRFحمل) +STR_NEWGRF_TOO_MANY_NEWGRFS :{WHITE}لا يمكن إضافة ملف: تم الوصول إلى الحد الأقصى المسموح به لملف NewGRF STR_NEWGRF_COMPATIBLE_LOAD_WARNING :{WHITE}تم تحميل ملف GFR مطابق بدلا من المفقود STR_NEWGRF_DISABLED_WARNING :{WHITE}تم تعطيل ملف GRF المفقود @@ -2895,16 +2917,17 @@ STR_GOALS_SPECTATOR :الأهداف STR_GOALS_TEXT :{ORANGE}{STRING} # Goal question window -STR_GOAL_QUESTION_CAPTION_QUESTION :اسئله -STR_GOAL_QUESTION_CAPTION_INFORMATION :معلومات -STR_GOAL_QUESTION_CAPTION_WARNING :تحذير -STR_GOAL_QUESTION_CAPTION_ERROR :خطا +STR_GOAL_QUESTION_CAPTION_QUESTION :{BLACK}اسئله +STR_GOAL_QUESTION_CAPTION_INFORMATION :{BLACK}معلومات +STR_GOAL_QUESTION_CAPTION_WARNING :{BLACK}تحذير +STR_GOAL_QUESTION_CAPTION_ERROR :{YELLOW}خطا # Goal Question button list ###length 18 STR_GOAL_QUESTION_BUTTON_YES :نعم STR_GOAL_QUESTION_BUTTON_RETRY :إعادة المحاولة STR_GOAL_QUESTION_BUTTON_RESTART :إعادة تشغيل +STR_GOAL_QUESTION_BUTTON_SURRENDER :استسلام # Subsidies window STR_SUBSIDIES_CAPTION :{WHITE}العروض @@ -3506,6 +3529,7 @@ STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT :{BLACK}فترا STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP :{BLACK}زيادة فترات الصيانة بقدر 10. ومع مفتاح كنترول بمقدار 5. STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP :{BLACK} انقاص فترات الصيانة بمعدل 10. Ctrl+ الضغط الانقاص بمعدل 5. +STR_SERVICE_INTERVAL_DROPDOWN_TOOLTIP :{BLACK}تغيير نوع الفاصل الزمني للصيانة STR_VEHICLE_DETAILS_DAYS :الأيام ###length VEHICLE_TYPES @@ -3810,7 +3834,7 @@ STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}عرض STR_ERROR_AI_NO_AI_FOUND :لا يوجد اضافات مناسبة للتحميل{} هذه اضافة غبية ولن تفعل شيئا لك{} تستطيع تحميل اضافات من الشبكة عن طريق نظام التحميل STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}واحد من الذكاء الصناعي فشل. الرجاء ابلاغ المبرمج عنه مصحوبا بصورة من شاشة مصحح الاخطاء. -STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW} شاشة اخطاء الذكاء الصناعي متوفرة فقط للخادم +STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW} شاشة اخطاء الذكاء الصناعي متوفرة فقط للخادم (سرڤر) # AI configuration window STR_AI_CONFIG_CAPTION :{WHITE}إعدادات الذكاء الصناعي @@ -4267,6 +4291,7 @@ STR_ERROR_CAN_T_SHARE_ORDER_LIST :{WHITE}لا ي STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST :{WHITE}لايمكن ايقاف امر المشاركة بالاوامر ... STR_ERROR_CAN_T_COPY_ORDER_LIST :{WHITE}لا يمكن نسخ قائمة الأوامر STR_ERROR_TOO_FAR_FROM_PREVIOUS_DESTINATION :{WHITE}بعيد جدا من محطة/علامة الوصول السابقة +STR_ERROR_AIRCRAFT_NOT_ENOUGH_RANGE :{WHITE}... الطائرات ليس لها مدى كاف # Timetable related errors STR_ERROR_CAN_T_TIMETABLE_VEHICLE :{WHITE}لا يمكن جدولة العربة ... diff --git a/src/lang/basque.txt b/src/lang/basque.txt index d80c349cd6..3055206359 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -1595,6 +1595,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :Lehenengo garra STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Istripuak / hondamendiak: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Konpainien informazioa: {STRING} STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :Industrien zabalerak: {STRING} diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 7abce03abb..1dbc92f0b1 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -1982,6 +1982,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Паказва STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Здарэньні й катастрофы: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Паказваць ґазэту, калі здараецца аварыя ці катастрофа + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Інфармацыя аб Кампаніі: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Паказваць ґазэту, калі новая кампанія распачынае дзейнасьць або існуючая кампанія рызыкуе банкруцтвам diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 6ac50be4bf..55872e2c4f 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Exibe um jornal STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Acidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Exibir jornal quando acidentes ou desastres acontecem + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informações da empresa: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Exibe um jornal quando uma companhia é aberta, ou quando estão próximas da bancarrota diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index d709b5579b..72c5531243 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -1631,6 +1631,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Показва STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Инциденти / бедствия: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Показване на вестник при катастрофи или бедствия + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Информация за компанията: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Показване на вестник когато стартира нова компания, или когато компании са запплашени от фалит diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index bf37d20b37..d8d2bfd427 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostra les not STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostra un diari quan passin accidents i desastres + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informació de la companyia: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostra les notícies de companyies noves que es creen i de companyies en risc de fer fallida diff --git a/src/lang/chuvash.txt b/src/lang/chuvash.txt index aa5fb497ee..6722b6f47e 100644 --- a/src/lang/chuvash.txt +++ b/src/lang/chuvash.txt @@ -782,6 +782,7 @@ STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_ISO :ISO (2008-12-31 + STR_CONFIG_SETTING_NEWS_SUBSIDIES :Грантсем: {STRING} ###length 3 diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index c7013726a3..59ba78ef95 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -1775,6 +1775,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Prikaži novost STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Nesreće / katastrofe: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Prikaži novine kod nesreća ili katastrofa + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Podaci vezani za tvrtku: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Prikaži novosti kada se pojavi nova tvrtka ili kada tvrtke riskiraju bankrot diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 1ef97fa2a4..8b6bdb437e 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1830,6 +1830,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Zobrazovat novi STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Nehody a katastrofy: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Zobrazovat noviny o nehodách a katastrofách + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informace o společnosti: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Zobrazovat noviny když společnost začne nebo hrozí krach diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 1725c8c5f7..fa3559ce53 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Vis en avis nå STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Uheld / katastrofer: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Vis en avis når ulykker eller katastrofer forekommer + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Selskabsinformation: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Vis en avis når nye selskaber starter, eller når selskaber er i risiko for at gå konkurs diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index b803b6d96c..5b11449440 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Nieuwsbericht w STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ongelukken / rampen: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Nieuwsbericht weergeven bij ongevallen of rampen + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Bedrijfsinformatie: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Nieuwsbericht weergeven als een nieuw bedrijf start en wanneer een bedrijf bijna falliet gaat diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 8e6b8976fa..07a31fe0ff 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1617,6 +1617,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Display a newsp STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / disasters: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Display a newspaper when accidents or disasters occur + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Company information: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Display a newspaper when a new company starts, or when companies are at risk of bankruptcy diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 60fd6d9d3c..3636551ea6 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Display a newsp STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / disasters: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Display a newspaper when accidents or disasters occur + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Company information: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Display a newspaper when a new company starts, or when companies are at risk of going bankrupt diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 7487274554..d9f5377eac 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -1443,6 +1443,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :Unua veturilo a STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Akcidentoj / katastrofoj: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Kompaniaj informoj: {STRING} STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :Malfermiĝo de industrioj: {STRING} diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index c4e39fa328..c98a8a2425 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1783,6 +1783,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Kui vastasettev STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Õnnetused / katastroofid: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Õnnetusi või katastroofi esinemisel näidatakse seda ajalehes + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Ettevõtte teave: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Kui uus ettevõte alustab, või ettevõte riskib pankrotiga, näidatakse seda ajalehes diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index 190a42f958..ff2312ab71 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -1573,6 +1573,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Vís eitt tíð STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Vanlukkur/ Ólukkur: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Vís eitt tíðindablað tá vanlukkur ella ólukkur koma fyri + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Fyritøku kunning: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Vís eitt tíðindablað tá ein nýggj fyritøka byrjar, ella tá fyritøkur eru í vanda fyri at fara á húsagang diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index c4fa81dbfc..2d08b1e3c7 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Näytä sanomal STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Vahingot/onnettomuudet: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Näytä sanomalehti vahingon tai onnettomuuden sattuessa + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Yhtiön tiedot: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Näytä sanomalehti kun uusi yhtiö aloittaa toimintansa tai kun jokin yhtiö on lähellä konkurssia diff --git a/src/lang/french.txt b/src/lang/french.txt index 404b35d045..d3f1e4cc56 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Afficher un jou STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / Catastrophes{NBSP}: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Afficher un journal quand des accidents ou des catastrophes se produisent + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informations corporatives{NBSP}: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Afficher un journal quand une nouvelle compagnie débute, ou quand des compagnies risquent la banqueroute diff --git a/src/lang/frisian.txt b/src/lang/frisian.txt index 2225452200..b352a5b1d3 100644 --- a/src/lang/frisian.txt +++ b/src/lang/frisian.txt @@ -1625,6 +1625,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Lit in krantebe STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ûngelokken / rampen: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Lit in kranteberjocht sjen at der in ûngelok of ramp foarfalt + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Bedriuws ynformaasje: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Lit in kranteberjocht sjen at in nij bedriuw starten wurdt of at in bedriuw it risiko rint fallyt te gean diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 3afe2ea8d1..13f1d7f749 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -1846,6 +1846,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Seall pàipear- STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Tubaistean / dunaidh: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Seall pàipear-naidheachd nuair a thachras tubaist no dunaidh + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Fiosrachadh na companaidh: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Seall pàipear-naidheachd nuair thèid companaidh ùr a stèidheachadh no nuair a bhios companaidh fo chunnart brisidh diff --git a/src/lang/galician.txt b/src/lang/galician.txt index b1958bf581..b281dbc266 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -1676,6 +1676,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Amosa un xornal STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Amosa un xornal cando un accidente ou desastre ocurre + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Información da compañía: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Amosa un xornal cando unha nova compañía é creada, ou cando unha compañía está en risco de bancarrota diff --git a/src/lang/german.txt b/src/lang/german.txt index a87e04e534..3c18b22b23 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Zeitung anzeige STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Unfälle und Katastrophen: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Zeitung anzeigen, wenn Unfälle oder Katastrophen auftreten + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Firmenmitteilungen: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Zeitung anzeigen, wenn neue Firmen gegründet werden oder kurz vor dem Bankrott stehen diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 9b6423e868..962ae84eb7 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1850,6 +1850,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Παρουσί STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ατυχήματα / καταστροφές: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Προβάλλει εφημερίδα όταν συμβαίνουν ατυχήματα ή καταστροφές + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Πληροφορίες εταιρίας: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Προβάλλει εφημερίδα όταν αρχίζει νέα εταιρεία ή όταν οι εταιρίες ρισκάρουν χρεωκοπία diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 1418661ecf..cd97ba5fe1 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -1661,6 +1661,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :הצג עיתו STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :תאונות / אסונות: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :הצג עיתון כאשר מתרחשים תאונות או אסונות + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :מידע על החברה: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :הצג עיתון כאשר חברה נוסדת, או כאשר חברות בסכנת פשיטת רגל diff --git a/src/lang/hindi.txt b/src/lang/hindi.txt index e1a152680b..1444e73d71 100644 --- a/src/lang/hindi.txt +++ b/src/lang/hindi.txt @@ -533,6 +533,7 @@ STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :दुर्घ + ###length 3 diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 3ce26b338c..931b1475e9 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1807,6 +1807,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Újság megjele STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Balesetek / természeti csapások: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Újság megjelenítése balesetek vagy katasztrófák bekövetkezésekor + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Vállalati információk: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Újság megjelenítése amikor egy új cég alapul vagy csődközelbe kerül diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 4937ec7d6c..2d3bda353c 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1572,6 +1572,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Birta dagblöð STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Slys / hamfarir: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Birta dagblöð þegar slys eða hörmungar gerast + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Fyrirtækisupplýsingar: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Birta dagblöð þegar nýtt fyrirtæki byrjar, eða þegar fyrirtæki eru í hættu á gjaldþroti diff --git a/src/lang/ido.txt b/src/lang/ido.txt index f5467f6a67..889dcb2b73 100644 --- a/src/lang/ido.txt +++ b/src/lang/ido.txt @@ -733,6 +733,7 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Violkolora + ###length 3 diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index a52e9ae2a1..f2628aa05c 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Tampilkan koran STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Kecelakaan / bencana: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Tampilkan berita saat ada kecelakaan atau bencana + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informasi Perusahaan: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Tampilkan koran saat ada perusahaan yang baru berdiri, atau jika ada perusahaan yang akan bangkrut diff --git a/src/lang/irish.txt b/src/lang/irish.txt index f868578e63..88d8449d96 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -1739,6 +1739,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Taispeáin nuac STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Timpistí / tubaistí: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Taispeáin nuachtán nuair a thiteann timpistí nó tubaistí amach + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Faisnéis cuideachta: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Taispeáin nuachtán nuair a thosaíonn cuideachta nua, nó nuair atá cuideachta i mbaol féimheachta diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 5acd638d7a..340ee9d4e2 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1749,6 +1749,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostra un giorn STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Incidenti / disastri: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostra un giornale quando si verificano incidenti o disastri + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informazioni sulla compagnia: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostra un giornale quando una compagnia viene lanciata, o quando rischia il fallimento diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index f5deb003a6..cbf78cf54a 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :他社の新し STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :事故/災害: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :事故や災害が発生したときにニュースを表示するかを設定します + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :会社情報: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :新会社の設立や社の経営危機などのニュースを表示するかを設定します diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 8907295282..73ec1ae518 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :경쟁자의 STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :사고 / 재앙: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :사고나 재앙이 일어났을 때 메시지로 알려줍니다. + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :회사 정보: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :새로운 회사가 열리거나, 파산 위기에 처했을 때 메시지로 알려줍니다. diff --git a/src/lang/latin.txt b/src/lang/latin.txt index cc1b80b6ee..88f0a360ee 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -1849,6 +1849,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Ostendere ephem STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :De accidentibus / calamitatibus: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Ostendere ephemeridem cum accidentes calamitatesve fiant + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :De indicio societatis: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Ostendere ephemeridem cum nova societas condiatur, sive cum societas in angustiis sit diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 365e283afb..2416d61e45 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -1745,6 +1745,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Rādīt avīzi STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Negadījumi / katastrofas: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Rādīt avīzi, kad notiek nelaimes gadījumi vai katastrofas + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Uzņēmuma informācija: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Rādīt avīzi kad darbību sāk jauns uzņēmums, vai kad uzņēmumi riskē bankrotēt diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index bad8e906c3..ebd40a4743 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1941,6 +1941,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Rodyti naujienr STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Avarijos / nelaimės: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Rodyti naujienraštį atsitikus incidentui ar katastrofai + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Kompanijos informacija: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Rodyti naujienraštį įsikūrus naujai kompanijai (arba esamai susidūrus su sunkumais) diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 7a9d843cf0..38cece0dec 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Weis d'Zeitung STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidenter / Katastrophen: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Weis d'Zeitung wann Accidenter oder Katastrophe geschéien + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Firmeninformatiounen: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Weis d'Zeitung wann eng nei Firma opgeet, oder wann ee riskéiert Bankrott ze goen diff --git a/src/lang/macedonian.txt b/src/lang/macedonian.txt index 0a7b958f8c..e427c95b8f 100644 --- a/src/lang/macedonian.txt +++ b/src/lang/macedonian.txt @@ -1035,6 +1035,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :Пристиг STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Несреќи / хаварии: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Информации за компанијата: {STRING} STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :Отворање на индустрии: {STRING} diff --git a/src/lang/malay.txt b/src/lang/malay.txt index 8657dc4181..2f4811261c 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -1505,6 +1505,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :Ketibaan kender STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Kemalangan / bencana: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Maklumat syarikat: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Paparkan surat khabar mengenai pembukaan syarikat baru, atau apabila syarikat dalam risiko untuk muflis diff --git a/src/lang/maltese.txt b/src/lang/maltese.txt index adf0caf619..f420abb44e 100644 --- a/src/lang/maltese.txt +++ b/src/lang/maltese.txt @@ -664,6 +664,7 @@ STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS_HELPTEXT :Ippermetti l-uz + ###length 3 diff --git a/src/lang/marathi.txt b/src/lang/marathi.txt index 6681871a1e..236ba602b5 100644 --- a/src/lang/marathi.txt +++ b/src/lang/marathi.txt @@ -993,6 +993,7 @@ STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_ALL_ACTIONS :सर्व + ###length 3 diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 0e529b86b1..911b7ba788 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -1746,6 +1746,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Vise nyhetsoppd STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ulykker / katastrofer: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Vise nyhetsoppdatering når ulykker eller katastrofer inntreffer + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Firmainformasjon: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Vise nyhetsoppdatering når nye selskaper starter opp, eller når selskaper er konkurstruet diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 6e55f88abb..d45fb4d563 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -1584,6 +1584,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Vis nyheitsarti STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ulykker/katastrofar: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Vis nyheitsartiklar ved ulykker eller katastrofar + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Firmainformasjon: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Vis nyheitsartiklar når nye firma startar opp, eller når firma risikerer konkurs diff --git a/src/lang/persian.txt b/src/lang/persian.txt index f69ccb191d..7ebfe1503d 100644 --- a/src/lang/persian.txt +++ b/src/lang/persian.txt @@ -1460,6 +1460,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :رسیدن او STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :حوادث / بلایا: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :اطلاعات شرکت: {STRING} STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :بازگشایی صنایع: {STRING} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index b94f28a086..c621eb314e 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -2123,6 +2123,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Wyświetl wiado STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Wypadki / klęski: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Wyświetl wiadomość w gazecie kiedy zdarzy się wypadek lub nastąpi katastrofa + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informacja firmy: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Wyświetl wiadomość w gazecie kiedy powstaje nowa firma lub kiedy istniejącym firmom grozi bankructwo diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 7f0468a71e..a13dc9b901 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostrar um jorn STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Acidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostrar um jornal quando ocorrem acidentes ou desastres + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informações da empresa: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostrar um jornal quando uma empresa nova é criada, ou quando uma empresa está à beira da falência diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 2cfaf8c140..20778ce5ae 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Afișează un z STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidente / dezastre: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Afișează un ziar când există un accident sau un dezastru natural + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informaţii despre companie: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Afișează un ziar când o nouă companie este înființată, sau când o companie este pe cale de a intra în faliment diff --git a/src/lang/russian.txt b/src/lang/russian.txt index ad8425c24f..a4e38d8b22 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1894,6 +1894,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Показыв STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Аварии и катастрофы: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Показывать новости об авариях и катастрофах + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Информация о компании: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Показывать новости об основании и риске банкротства транспортных компаний diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index f3728f7dcb..10f341a6f8 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -1938,6 +1938,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Prikazuje novin STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Udesi/nepogode: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Prikazuje novinske naslove kada se dese nezgode ili katastrofe + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Podaci o preduzeću: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Prikazuje novinske naslove kada se otvori nova kompanija, ili kada postojeća rizikuje bankrot diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 99cb2c15d0..f33031e318 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :报纸报道竞 STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :事故/灾难: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :报纸报道事故或灾难发生情况 + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :公司信息: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :报纸报道新公司开业或者预警倒闭风险 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 7e11f3eb4f..102592deca 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1811,6 +1811,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Zobrazovať spr STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Havárie / Katastrofy: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Zobrazovať správu keď sa vyskytne dopravná nehoda alebo katastrofa + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informácie o spoločnosti: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Zobrazovať správu keď vznikla nová spoločnosť alebo keď je spoločnosť v riziku bankrotu diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index a43347d7b6..7215adc077 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1797,6 +1797,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Prikaz časopis STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Nesreče / katastrofe: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Prikaži novice ko se zgodi nesreča + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informacije o podjetju: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Prikaz časopisa, ko se ustanovi novo podjetje ali ko se pripravlja na bankrot diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 65c6bf199f..4af060379d 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostrar una not STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostrar noticias cuando ocurre un accidente o un desastre + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Información de la empresa: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostrar una noticia cuando se crea una nueva compañía, o cuando alguna compañía está en riesgo de quiebra diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 64e658361d..4bfac233fd 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostrar noticia STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidentes y desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostrar noticia cuando ocurra un accidente o un desastre + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Información de la empresa: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostrar noticia cuando una nueva empresa sea creada o cuando alguna empresa esté en peligro de quiebra diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index cbf86ec3f4..a39e3925ae 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Visa nyhetstidn STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Olyckor / katastrofer: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Visa nyhetstidning när olyckor eller katastrofer inträffar + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Företagsinformation: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Visa nyhetstidning när nya företag startar upp eller när ett befintligt företag riskerar att gå bankrupt diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 3d6b13dbfb..8cd35af3fe 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -1582,6 +1582,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :புதிய STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :விபத்துகள் / பேரழிவுகள்: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :விபத்துகள் அல்லது பேரழிவுகள் நிகழும்போது செய்தித்தாள் ஒன்றினைக் காட்டு + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :நிறுவனத்தின் விவரம்: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :ஒரு புதிய நிறுவனம் தொடங்கும் போது அல்லது நிறுவனங்கள் திவாலாகும் அபாயத்தில் இருக்கும்போது ஒரு செய்தித்தாளைக் காண்பி diff --git a/src/lang/thai.txt b/src/lang/thai.txt index c1aa982b28..5a9fe48bdd 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -1599,6 +1599,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :แสดงข STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :ภัยพิบัติ / อุบัติเหตุ: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :แสดงข่าวเกี่ยวกับภัยพิบัติและอุบัติเหตุ + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :ข้อมูลข่าวสารของบริษัท: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :แสดงข่าวเมื่อมีบริษัทเปิดใหม่หรือบริษัทใกล้ล้มละลาย diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 84ae5cd816..941462a079 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -1649,6 +1649,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :當對手設立 STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :事故/災難: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :當事故或災難發生時顯示報紙訊息 + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :公司資訊: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :當一所公司開始營業或倒閉破產時顯示報紙訊息 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 4518a50809..0d35521c38 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1744,6 +1744,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Rakibe ait yeni STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Kazalar / felaketler: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Kazalar veya felaketler meydana geldiğinde gazete haberi olarak göster + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Şirket bilgisi: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Yeni bir şirket oyuna başladığında veya şirketler iflas etme riski taşıdığında gazete haberi olarak göster diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 7a9a12bb63..77530aa423 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1871,6 +1871,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Показат STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Нещасні випадки / стихійні лиха: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Показати газету при аварії або катастрофі + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Інформація щодо компанії: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Показати газету коли відкривається нова компанія, або коли компанії ризикують збанкрутувати diff --git a/src/lang/urdu.txt b/src/lang/urdu.txt index e6ea342267..7139df4195 100644 --- a/src/lang/urdu.txt +++ b/src/lang/urdu.txt @@ -1384,6 +1384,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :مقابل کے STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :حادثے / تباہیاں: {STRING} + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :کمپنی کی معلومات: {STRING} STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :صنعتوں کا افتتاح: {STRING} diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 44f15e6b79..fd5758c9bc 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Hiển thị ti STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Tai nạn / thiên tai: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Hiển thị tin tức về các vụ tại nạn hoặc thiên tai xảy ra + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Thông tin công ty: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Hiển thị tin tức khi có một công ty mới khai trương, hoặc các công ty có nguy cơ phá sản diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index 2f8d3fb7da..4b970c9193 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -1642,6 +1642,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Dangos papur ne STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Damweiniau / trychinebau: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Dangos papur newydd pan fo damweiniau neu drychinebau'n digwydd + STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Gwybodaeth Cwmnïau: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Dangos papur newydd pan fo cwmni newydd yn dechrau, neu pan fo cwmnïau ar fin taro'r wal From 236f71640c1d535ed839c8e6866d18b2a429b9be Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 9 Nov 2021 18:50:34 +0000 Subject: [PATCH 074/710] Update: Translations from eints english (us): 2 changes by 2TallTyler arabic (egypt): 49 changes by AviationGamerX korean: 17 changes by telk5093 catalan: 2 changes by J0anJosep danish: 4 changes by nielsmh french: 2 changes by glx22 portuguese: 2 changes by azulcosta --- src/lang/arabic_egypt.txt | 68 ++++++++++++++++++++++++++++----------- src/lang/catalan.txt | 2 ++ src/lang/danish.txt | 4 +++ src/lang/english_US.txt | 2 ++ src/lang/french.txt | 2 ++ src/lang/korean.txt | 32 +++++++++--------- src/lang/portuguese.txt | 2 ++ 7 files changed, 78 insertions(+), 34 deletions(-) diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index f1503a22bb..5aacaf9339 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -203,6 +203,7 @@ STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP} STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}{NBSP}طن STR_UNITS_WEIGHT_SHORT_SI :{COMMA}{NBSP}كجم +STR_UNITS_WEIGHT_LONG_IMPERIAL :{COMMA}{NBSP}طن STR_UNITS_WEIGHT_LONG_METRIC :{COMMA}{NBSP} طن STR_UNITS_WEIGHT_LONG_SI :{COMMA}{NBSP}كجم @@ -220,7 +221,7 @@ STR_UNITS_HEIGHT_IMPERIAL :{COMMA}{NBSP} STR_UNITS_HEIGHT_SI :{COMMA}{NBSP} متر # Common window strings -STR_LIST_FILTER_TITLE :{BLACK}تصفية القائمة +STR_LIST_FILTER_TITLE :{BLACK}تصفية القائمة: STR_LIST_FILTER_OSKTITLE :{BLACK} ادخل فلتر STR_LIST_FILTER_TOOLTIP :{BLACK} اختر كلمة اساسية لفلترة القائمة @@ -749,6 +750,7 @@ STR_SMALLMAP_LEGENDA_SNOW :{TINY_FONT}{BLA STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF :{BLACK}عرض/اخفاء اسماء المدن STR_SMALLMAP_CENTER :{BLACK}وسط الخريطة الصغيرة على الموقع الحالي STR_SMALLMAP_INDUSTRY :{TINY_FONT}{STRING} ({NUM}) +STR_SMALLMAP_LINKSTATS :{TINY_FONT}{STRING} STR_SMALLMAP_COMPANY :{TINY_FONT}{COMPANY} STR_SMALLMAP_TOWN :{TINY_FONT}{WHITE}{TOWN} STR_SMALLMAP_DISABLE_ALL :{BLACK}تعطيل الكل @@ -869,9 +871,14 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK} اعلان عن انتهاء عرض{}{} نقل {STRING} من {STRING} الى {STRING} لن يعطي ارباح اضافية بعد الآن . STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK} تم سحب العرض{}{} نقل {STRING} من {STRING} الى {STRING} لم يعد معروض +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}اعلان عن عرض{}{} اول {STRING} من {STRING} الى {STRING} سوفستجذب دعم لمدة {NUM} سنة من السلطة المحلية! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK} العرض قد اعطي لـ {STRING}!{}{}{STRING} من {STRING} الى {STRING} سوف يعطي زيادة 50% ارباح ل{NUM} سنة! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}العرض قد منحت إلى {STRING}!{}{}{STRING} من {STRING} الى {STRING} سوف يعطي ضعف الدخل ل{NUM} سنة! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}شركة {STRING} فازت بالعرض{}{}{STRING} من {STRING} الى {STRING} سوف يعطي 3 اضعاف الدخل ل{NUM} سنة! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK} شركة {STRING} فازت بالعرض !{}{}{STRING} من {STRING} الى {STRING} سوف يعطي اربعة اضعاف الدخل ل{NUM} سنة! -STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK} فوضى طرق عارمة في مدينة {TOWN}!{}{}اعادة ترميم الطرق مولت من قبل شركة {STRING}{} تجلي ستة أشهر من الشقاء لعربات الطريق. +STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK} فوضى طرق عارمة في مدينة {TOWN}!{}{}اعادة ترميم الطرق مولت من قبل شركة {STRING} تجلي ستة أشهر من الشقاء لعربات الطريق. # Extra view window STR_EXTRA_VIEWPORT_TITLE :{WHITE}شاشة العرض {COMMA} @@ -1110,6 +1117,7 @@ STR_WARNING_NO_SUITABLE_AI :{WHITE}لايو # Settings tree window STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}الإعدادات +STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}تصفية القائمة: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}مدد الكل STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}إسحب الكل STR_CONFIG_SETTING_RESET_ALL :{BLACK}اعادة ضبط جميع القيم @@ -1208,6 +1216,7 @@ STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :بدون STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :ككل المصانع الأخرى STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :تنقيب +STR_CONFIG_SETTING_INDUSTRY_PLATFORM :المساحة المسطحة حول الصناعات: {STRING} STR_CONFIG_SETTING_MULTIPINDTOWN :السماح بوجود أكثر من مصنع من نفس النوع في المدينة الواحدة: {STRING} @@ -1306,6 +1315,7 @@ STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :إختر مقد STR_CONFIG_SETTING_SNOWLINE_HEIGHT :ارتفاع خط الثلج: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :تحكم على اي ارتفاع يبدأ نزول الثلج في المناطق القطبية,تؤثر الثلوج على مستوى تطور القطاع الصناعي ونمو المدن. لا يمكن تعديله إلا عبر معدل السيناريو أو يتم حسابه بطريقة أخرى عبر "تغطية الجليد" +STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :خشونة التضاريس: {STRING} @@ -1602,6 +1612,7 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :X4 STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :X8 ###length 3 +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x STR_CONFIG_SETTING_TOWN_GROWTH :سرعة نمو المدينه: {STRING} ###length 5 @@ -1689,6 +1700,7 @@ STR_CONFIG_ERROR_INVALID_GRF_SYSTEM :نظام الا STR_CONFIG_ERROR_INVALID_GRF_INCOMPATIBLE :غير متطابق مع هذه النسخة من OpenTTD STR_CONFIG_ERROR_INVALID_GRF_UNKNOWN :مجهول STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL :{WHITE}... نسبة الضغط '{STRING}' غير صحيحة +STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}نفذت الذاكرة # Video initalization errors STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... لم يتم العثور على GPU متوافق. تم تعطيل تسريع الأجهزة @@ -1901,7 +1913,7 @@ STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}حدث STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}حدث معلومات الخادم STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}اضف خادم - سيرفر -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}اضف خادم (سيرفر) و الذي سوف يفحص اذا كان هناك لعبة قيد التشغيل حاليا +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}اضف خادم (سيرڤر). يمكن أن يكون هذا إما عنوان خادم أو رقم دعوة STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}أبدأ الخادم STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}أبدأ خادمك الخاص @@ -1947,7 +1959,7 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}الخا STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}الشركه محميه. من فضلك ادخل كلمه المرور # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :قائمة العملاء +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :اللاعبون عبر الإنترنت STR_NETWORK_COMPANY_LIST_SPECTATE :شاهد # Network client list @@ -1962,6 +1974,7 @@ STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :منع STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}هل أنت متأكد أنك تريد طرد اللاعب '{STRING}'؟ +STR_NETWORK_ASK_RELAY_NO :{BLACK}لا STR_NETWORK_SPECTATORS :المشاهدين @@ -1990,11 +2003,12 @@ STR_NETWORK_CHAT_TO_COMPANY :[فريق] ال STR_NETWORK_CHAT_CLIENT :[خاص] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[خاص] الى {STRING} : {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[الكل] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}ادخل نص للمحادثة # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}لايوجد أجهزة شبكة او الشبكة معطلة -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}الخادم لم يجب على الطلب +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}انتهت مهلة الاتصال بالخادم أو تم رفضه STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}لم يتم الربط بسبب عدم توافق NewGFR STR_NETWORK_ERROR_DESYNC :{WHITE}فشل تحديث البيانات STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}انقطع الاتصال بلعبة الشبكة @@ -2052,7 +2066,8 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {STRING} ا STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} انضم الى المشاهدين STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} قد بدأ شركة جديدة: (#{2:NUM}) STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} قد غادر اللعبة : - {2:STRING}- -STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} قد غير اسمه / اسمها الى {STRING} +STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} قد غير الاسم الى {STRING} +STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} اعطى {2:CURRENCY_LONG} إلى {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}اقفل الخادم الجلسة STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}يتم بدأ الخادم من جديد ...{} الرجاء الأنتظار @@ -2308,7 +2323,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}بناء STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}وضع عوامة - يمكن استخدامها نقطة عبور STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}بناء قناة مائية STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}عرف منطقة البحر.{} انشأ قناة, يجب الضغط المتواصل على مفتاح كنترول عند مستوى البحر والا طمرت المياة الاجزاء المجاورة -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}انشاء انهار +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}انشاء انهار. Ctrl يختار المنطقة قطريا # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}اتجاه حوض الصيانة @@ -2573,8 +2588,11 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}النس STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} صورة في الثانية STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} صورة في الثانية +STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} ثواني ###length 15 +STR_FRAMERATE_GL_ECONOMY :{BLACK} التعامل مع البضائع: +STR_FRAMERATE_GL_TRAINS :{BLACK} تكتكة القطار: STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} منافذ العرض للعالم: STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} @@ -2902,13 +2920,13 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :اشتري حق STR_LOCAL_AUTHORITY_ACTION_BRIBE :ارشي السلطات المحلية ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}البدء في حملة دعائية صغيرة للشركة, لكي تجلب ركاب و بضائع اكثر لمحطاتك.{} التكلفة: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW} البدء في حملة دعائية متوسطة للشركة, لكي تجلب ركاب و بضائع اكثر لمحطاتك.{} التكلفة: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}البدء في حملة دعائية كبيرة للشركة, لكي تجلب ركاب و بضائع اكثر لمحطاتك.{} التكلفة: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW} مول اعمال الصيانة للطرق و الشوارع بالمدينة. يتسبب في تعطيل حركة النقل داخل المدينة لمدة قد تصل ستة اشهر.{} التكلفة {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW} بناء مجسم تقديرا للشركة في اعمال النقل.{} التكلفة {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW} مول بناء مباني تجارية جديدة في المدينة.{}التكلفة {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW} اشتري حقوق النقل لسنة كاملة في هذة المدينة و المصانع التابعة لها. البلدية سوف تسمح للركاب و البضائع باستخدام محطاتك فقط.{}التكلفة: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}البدء في حملة دعائية صغيرة للشركة, لكي تجلب ركاب و بضائع اكثر لمحطاتك.{}يوفر تعزيزًا مؤقتًا لتصنيف المحطة في دائرة صغيرة حول وسط المدينة.{}التكلفة: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW} البدء في حملة دعائية متوسطة للشركة, لكي تجلب ركاب و بضائع اكثر لمحطاتك.{}يوفر تعزيزًا مؤقتًا لتصنيف المحطة في دائرة متوسطة حول وسط المدينة.{} التكلفة: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}البدء في حملة دعائية كبيرة للشركة, لكي تجلب ركاب و بضائع اكثر لمحطاتك.{}يوفر تعزيزًا مؤقتًا لتصنيف المحطة في دائرة كبيرة حول وسط المدينة.{}التكلفة: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW} مول اعمال الصيانة للطرق و الشوارع بالمدينة.{}يتسبب في تعطيل حركة النقل داخل المدينة لمدة قد تصل ستة اشهر.{}التكلفة: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW} بناء مجسم تقديرا للشركة في اعمال النقل.{}يوفر تعزيزًا دائمًا لتصنيف المحطة في هذه المدينة.{}التكلفة {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW} مول بناء مباني جديدة في المدينة.{}يوفر تعزيزًا مؤقتًا لنمو المدينة.{}التكلفة {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW} اشتري حقوق النقل لسنة كاملة في هذة المدينة و المصانع التابعة لها.{}البلدية لن تسمح للركاب و البضائع باستخدام محطات منافسيك.{}التكلفة: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW} ارشي السلطات المحلية لزيادة كفائة الشركة. هناك عقاب شديد اذا ما اكتشفت الرشوة.{} التكلفة: {CURRENCY_LONG} # Goal window @@ -2924,6 +2942,7 @@ STR_GOAL_QUESTION_CAPTION_ERROR :{YELLOW}خطا # Goal Question button list ###length 18 +STR_GOAL_QUESTION_BUTTON_NO :لا STR_GOAL_QUESTION_BUTTON_YES :نعم STR_GOAL_QUESTION_BUTTON_RETRY :إعادة المحاولة STR_GOAL_QUESTION_BUTTON_RESTART :إعادة تشغيل @@ -2940,7 +2959,10 @@ STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}اضغط # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY}كتاب القصص +STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}كتاب القصة العالمية +STR_STORY_BOOK_TITLE :{YELLOW}{STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :الصفحة {NUM} +STR_STORY_BOOK_PREV_PAGE_TOOLTIP :{BLACK}الانتقال إلى الصفحة السابقة # Station list window STR_STATION_LIST_TOOLTIP :{BLACK}اسم المحطة - اضغط على اسم المحطة لتوسيطها في الشاشة. اضغط + كنترول لفتح شاشة عرض جديدة بمنطقة المحطة. @@ -2971,6 +2993,7 @@ STR_STATION_VIEW_WAITING_AMOUNT :الكمية: STR_STATION_VIEW_PLANNED_AMOUNT :المبلغ: تم تخطيطه STR_STATION_VIEW_FROM :{YELLOW}{CARGO_SHORT} من {STATION} STR_STATION_VIEW_TO :{YELLOW}{CARGO_SHORT} إلى {STATION} +STR_STATION_VIEW_TO_ANY :{RED}{CARGO_SHORT} إلى أي محطة ###length 8 @@ -2993,6 +3016,7 @@ STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP :{BLACK}عرض STR_STATION_VIEW_RENAME_STATION_CAPTION :اعادة تسمية المحطة +STR_STATION_VIEW_CLOSE_AIRPORT :{BLACK}اغلاق المطار # Waypoint/buoy view window STR_WAYPOINT_VIEW_CAPTION :{WHITE}{WAYPOINT} @@ -3176,7 +3200,7 @@ STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}المج STR_GROUP_CREATE_TOOLTIP :{BLACK}أضغط لإنشاء مجموعة STR_GROUP_DELETE_TOOLTIP :{BLACK}أحذف المجموعة المختارة STR_GROUP_RENAME_TOOLTIP :{BLACK}أعد تسمية المجموعة المختارة -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}اضغط لحماية المجموعة من التغيير الكلي للعربات +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}اضغط لحماية المجموعة من التغيير الكلي للعربات. اضغط مع Ctrl لحماية المجموعات الفرعية أيضًا. STR_QUERY_GROUP_DELETE_CAPTION :حذف المجموعه{WHITE} STR_GROUP_DELETE_QUERY_TEXT :{WHITE}هل انت واثق من حذف هذه المجموعه مع كل أحفادها @@ -3198,10 +3222,12 @@ STR_BUY_VEHICLE_TRAIN_MONORAIL_CAPTION :عربات قط STR_BUY_VEHICLE_TRAIN_MAGLEV_CAPTION :عربات قطار ممغنط جديدة STR_BUY_VEHICLE_ROAD_VEHICLE_CAPTION :عربات جديدة +STR_BUY_VEHICLE_TRAM_VEHICLE_CAPTION :مركبات الترام الجديدة # Vehicle availability ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_ALL_CAPTION :عربات قطار +STR_BUY_VEHICLE_ROAD_VEHICLE_ALL_CAPTION :عربات جديدة STR_BUY_VEHICLE_SHIP_CAPTION :سفن جديدة STR_BUY_VEHICLE_AIRCRAFT_CAPTION :طائرة جديدة @@ -3423,6 +3449,7 @@ STR_REPLACE_MAGLEV_VEHICLES :مركبات م STR_REPLACE_TRAM_VEHICLES :مركبات الترام +STR_REPLACE_REMOVE_WAGON :{BLACK} إزالة العربة ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK} المحافظة على طول القطار بازالة عربات ابتداء من المقدمة عند التبديل - عندما يكون التبدل ينتج قطارا اطول. # Vehicle view @@ -3850,6 +3877,7 @@ STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}انقل STR_AI_CONFIG_AI :{SILVER} الذكاء الاصطناعي +STR_AI_CONFIG_CHANGE :{BLACK}اختر {STRING} STR_AI_CONFIG_CHANGE_NONE : STR_AI_CONFIG_CONFIGURE :{BLACK} اعداد STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK} اعداد خواص الذكاء الصناعي @@ -3893,6 +3921,7 @@ STR_PERCENT_DOWN_SMALL :{TINY_FONT}{WHI STR_PERCENT_DOWN :{WHITE}{NUM}%{DOWN_ARROW} STR_PERCENT_UP_DOWN_SMALL :{TINY_FONT}{WHITE}{NUM}%{UP_ARROW}{DOWN_ARROW} STR_PERCENT_UP_DOWN :{WHITE}{NUM}%{UP_ARROW}{DOWN_ARROW} +STR_PERCENT_NONE_SMALL :{TINY_FONT}{WHITE}{NUM}% # Income 'floats' STR_INCOME_FLOAT_COST_SMALL :{TINY_FONT}{RED}تكلفة: {CURRENCY_LONG} @@ -3942,6 +3971,7 @@ STR_WARNING_HEIGHTMAP_SCALE_MESSAGE :{YELLOW}اعا STR_WARNING_FALLBACK_SOUNDSET :{WHITE}لايوجد غير مجموعة اصوات. اذا اردت اصوات, نصب مجموعة صوتية من خلال نظام التحميل. # Screenshot related messages +STR_WARNING_SCREENSHOT_SIZE_CAPTION :{WHITE}صورة ضخمة من شاشة STR_MESSAGE_SCREENSHOT_SUCCESSFULLY :{WHITE}صورة من الشاشة حفظت بنجاح باسم: '{STRING}' STR_ERROR_SCREENSHOT_FAILED :{WHITE}لم يتم حفظ الصورة @@ -4401,10 +4431,10 @@ STR_INDUSTRY_NAME_SUGAR_MINE :قصب سكر ##id 0x6000 STR_SV_EMPTY : STR_SV_UNNAMED :غير مسمى -STR_SV_TRAIN_NAME :قطار {COMMA} -STR_SV_ROAD_VEHICLE_NAME :عربة {COMMA} -STR_SV_SHIP_NAME :سفينة {COMMA} -STR_SV_AIRCRAFT_NAME :طائرة {COMMA} +STR_SV_TRAIN_NAME :قطار #{COMMA} +STR_SV_ROAD_VEHICLE_NAME :عربة #{COMMA} +STR_SV_SHIP_NAME :سفينة #{COMMA} +STR_SV_AIRCRAFT_NAME :طائرة #{COMMA} ###length 27 STR_SV_STNAME :{STRING} diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index d8d2bfd427..6409ddd264 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1744,6 +1744,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostra les not STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostra un diari quan passin accidents i desastres +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidents dels vehicles de competidors: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Mostra un diari amb notícies dels accidents dels vehicles dels oponents. STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informació de la companyia: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostra les notícies de companyies noves que es creen i de companyies en risc de fer fallida diff --git a/src/lang/danish.txt b/src/lang/danish.txt index fa3559ce53..f3d32bce86 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1743,6 +1743,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Vis en avis nå STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Uheld / katastrofer: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Vis en avis når ulykker eller katastrofer forekommer +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Ulykker med konkurrenters fartøjer: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Vis en avis om forulykkede fartøjer der tilhører konkurrenter STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Selskabsinformation: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Vis en avis når nye selskaber starter, eller når selskaber er i risiko for at gå konkurs @@ -2258,6 +2260,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Klima: STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Størrelse: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Server version: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Serveradresse: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Invitationskode: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Start dato: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Nuværende dato: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Spilscript: {WHITE}{STRING} (v{NUM}) @@ -2674,6 +2677,7 @@ STR_STATION_CLASS_WAYP :Waypoints # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Signalvælger +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Vis eller skjul avancerede signaltyper STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Standardsignal (semafor){}Dette er den mest almindelige type signal, og tillader kun et tog ad gangen på den samme signalblok STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Indgangssignal (semafor){}Grønt så længe der er et eller flere grønne udgangssignaler fra den efterfølgende sporsektion. Ellers vises rødt. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Udgangssignal (semafor){}Fungerer som et normalt signal men er nødvendigt for at vise den korrekte farve ved indgangs- og kombisignaler. diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 3636551ea6..764f484fe3 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1743,6 +1743,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Display a newsp STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / disasters: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Display a newspaper when accidents or disasters occur +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidents of competitor's vehicles: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Display a newspaper about crashed vehicles for competitors STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Company information: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Display a newspaper when a new company starts, or when companies are at risk of going bankrupt diff --git a/src/lang/french.txt b/src/lang/french.txt index d3f1e4cc56..fd4bdd4314 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1744,6 +1744,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Afficher un jou STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / Catastrophes{NBSP}: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Afficher un journal quand des accidents ou des catastrophes se produisent +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidents de véhicules d'un concurrent{NBSP}: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Afficher un journal au sujet des véhicules accidentés des concurrents STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informations corporatives{NBSP}: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Afficher un journal quand une nouvelle compagnie débute, ou quand des compagnies risquent la banqueroute diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 73ec1ae518..448c738025 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1736,50 +1736,52 @@ STR_CONFIG_SETTING_DISABLE_ELRAILS :전기 철도 STR_CONFIG_SETTING_DISABLE_ELRAILS_HELPTEXT :이 설정을 켜면, 전기 기관차가 일반 철도에서도 달릴 수 있도록 만듭니다. STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN :내 회사의 첫 차량 도착: {STRING} -STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN_HELPTEXT :나의 새 역사에 처음으로 차량이 도착하면 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN_HELPTEXT :나의 새 역사에 처음으로 차량이 도착하면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :경쟁사의 첫 차량 도착: {STRING} -STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :경쟁자의 새 역사에 처음으로 차량이 도착하면 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :경쟁자의 새 역사에 처음으로 차량이 도착하면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :사고 / 재앙: {STRING} -STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :사고나 재앙이 일어났을 때 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :사고나 재앙이 일어났을 때 메시지로 알려줍니다 +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :경쟁사의 차량 사고: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :경쟁사의 차량이 사고가 나면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :회사 정보: {STRING} -STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :새로운 회사가 열리거나, 파산 위기에 처했을 때 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :새로운 회사가 열리거나, 파산 위기에 처했을 때 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :산업시설 건설: {STRING} -STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN_HELPTEXT :새로운 산업시설이 건설되면 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN_HELPTEXT :새로운 산업시설이 건설되면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_INDUSTRY_CLOSE :산업시설 폐쇄: {STRING} -STR_CONFIG_SETTING_NEWS_INDUSTRY_CLOSE_HELPTEXT :산업시설이 폐쇄될 때 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_INDUSTRY_CLOSE_HELPTEXT :산업시설이 폐쇄될 때 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_ECONOMY_CHANGES :경제 변화: {STRING} -STR_CONFIG_SETTING_NEWS_ECONOMY_CHANGES_HELPTEXT :거시적인 경제에 변화가 생기면 뉴스 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_ECONOMY_CHANGES_HELPTEXT :경제에 거시적인 변화가 생기면 뉴스 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_COMPANY :내 회사에 의한 산업시설의 생산량 변동: {STRING} -STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_COMPANY_HELPTEXT :내 회사가 수송하는 산업시설의 생산량이 변하면 소식으로 알려줍니다. +STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_COMPANY_HELPTEXT :내 회사가 수송하는 산업시설의 생산량이 변하면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_OTHER :경쟁사에 의한 산업시설의 생산량 변동: {STRING} -STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_OTHER_HELPTEXT :경쟁사가 수송하고 있는 산업시설의 생산량이 변하면 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_OTHER_HELPTEXT :경쟁사가 수송하고 있는 산업시설의 생산량이 변하면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_UNSERVED :기타 산업시설의 생산량 변동: {STRING} -STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_UNSERVED_HELPTEXT :아무도 수송하지 않는 산업시설의 생산량이 변하면 소식으로 알려줍니다. +STR_CONFIG_SETTING_NEWS_INDUSTRY_CHANGES_UNSERVED_HELPTEXT :아무도 수송하지 않는 산업시설의 생산량이 변하면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_ADVICE :내 회사의 차량에 관한 권고 / 정보: {STRING} -STR_CONFIG_SETTING_NEWS_ADVICE_HELPTEXT :주의를 기울여야하는 차량에 대한 메시지를 표시합니다. +STR_CONFIG_SETTING_NEWS_ADVICE_HELPTEXT :주의를 기울여야하는 차량을 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_NEW_VEHICLES :새 차량: {STRING} -STR_CONFIG_SETTING_NEWS_NEW_VEHICLES_HELPTEXT :새로운 차량 종류를 사용할 수 있게 되면 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_NEW_VEHICLES_HELPTEXT :새로운 차량 종류를 사용할 수 있게 되면 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_CHANGES_ACCEPTANCE :역에서 받는 화물의 변경: {STRING} -STR_CONFIG_SETTING_NEWS_CHANGES_ACCEPTANCE_HELPTEXT :역사가 받을 수 있는 화물이 변경될 경우 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_CHANGES_ACCEPTANCE_HELPTEXT :역사가 받을 수 있는 화물이 변경될 경우 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_SUBSIDIES :보조금: {STRING} -STR_CONFIG_SETTING_NEWS_SUBSIDIES_HELPTEXT :보조금과 관련된 소식을 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_SUBSIDIES_HELPTEXT :보조금과 관련된 소식을 메시지로 알려줍니다 STR_CONFIG_SETTING_NEWS_GENERAL_INFORMATION :일반 정보: {STRING} -STR_CONFIG_SETTING_NEWS_GENERAL_INFORMATION_HELPTEXT :도로 재건축 투자나 수송 독점권의 구입 등과 같은 일반적인 사건에 대한 소식을 메시지로 알려줍니다. +STR_CONFIG_SETTING_NEWS_GENERAL_INFORMATION_HELPTEXT :도로 재건축 투자나 수송 독점권의 구입 등과 같은 일반적인 사건에 대한 소식을 메시지로 알려줍니다 ###length 3 STR_CONFIG_SETTING_NEWS_MESSAGES_OFF :끄기 STR_CONFIG_SETTING_NEWS_MESSAGES_SUMMARY :상태 표시줄로 알림 diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index a13dc9b901..4d8a234294 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1744,6 +1744,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostrar um jorn STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Acidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostrar um jornal quando ocorrem acidentes ou desastres +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Acidentes de veículos dos concorrentes: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Mostrar um jornal sobre veículos acidentados para concorrentes STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informações da empresa: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostrar um jornal quando uma empresa nova é criada, ou quando uma empresa está à beira da falência From 48c1c7f221cd51fbe4fda3771eaed09edacef997 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Tue, 9 Nov 2021 07:18:01 -0700 Subject: [PATCH 075/710] Cleanup: Fix typo in overflowsafe_type comment --- src/core/overflowsafe_type.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp index 0976a090be..29aab175b3 100644 --- a/src/core/overflowsafe_type.hpp +++ b/src/core/overflowsafe_type.hpp @@ -22,8 +22,8 @@ /** * Overflow safe template for integers, i.e. integers that will never overflow - * you multiply the maximum value with 2, or add 2, or subtract something from - * the minimum value, etc. + * when you multiply the maximum value with 2, or add 2, or subtract something + * from the minimum value, etc. * @param T the type these integers are stored with. */ template From 7d40cc9291a816fb62f9f7880a7dcf8fee0a23d9 Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Tue, 9 Nov 2021 14:05:11 +0000 Subject: [PATCH 076/710] Change: Explicitly specify SHA1 for legacy code signing on Windows --- os/windows/sign.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/windows/sign.bat b/os/windows/sign.bat index 0e4291f9b8..3954d4618c 100644 --- a/os/windows/sign.bat +++ b/os/windows/sign.bat @@ -12,7 +12,7 @@ REM URL of the timestamp server IF NOT DEFINED SIGNTOOL_TIMESTAMP_URL (SET SIGNTOOL_TIMESTAMP_URL=http://timestamp.digicert.com) REM Sign with SHA-1 for Windows 7 and below -"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% %1 +"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% -fd sha1 %1 REM Sign with SHA-256 for Windows 8 and above "%SIGNTOOL_PATH%" sign -v -n %2 -tr %SIGNTOOL_TIMESTAMP_URL% -fd sha256 -td sha256 -as %1 From 4bcbcbc58fe91c87831ea64786d2a1f0e9d38b14 Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 10 Nov 2021 18:52:03 +0000 Subject: [PATCH 077/710] Update: Translations from eints tamil: 2 changes by Aswn --- src/lang/tamil.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 8cd35af3fe..8894401bce 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -1476,6 +1476,7 @@ STR_CONFIG_SETTING_LOADING_INDICATORS :ஏற்று STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :வாகனங்களை ஏற்றுவதற்கு அல்லது இறக்குவதற்கு மேலே ஏற்றுதல் குறிகாட்டிகள் காட்டப்படுகிறதா என்பதைத் தேர்ந்தெடுக்கவும் STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :கால அட்டவணையை நாட்களில் அல்லாமல் சொடுக்குகளில் காட்டு: {STRING} +STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :கால அட்டவணையை நாட்களில் அல்லாமல் சொடுக்குகளில் காட்டு STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :கால அட்டவணைகளில் காலங்களைக் காட்டவும்: {STRING} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :எதிர்பார்த்த வருகை மற்றும் புறப்படும் நேரங்களை கால அட்டவணையில் காட்டவும் @@ -1702,6 +1703,7 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x ###length 3 STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x STR_CONFIG_SETTING_TOWN_GROWTH :நகர வளர்ச்சி வேகம்: {STRING} STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :நகர வளர்ச்சி வேகம் From 62795a2e6d53ba9473c13ebe4119640e48e4ca83 Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 11 Nov 2021 18:48:27 +0000 Subject: [PATCH 078/710] Update: Translations from eints russian: 2 changes by Ln-Wolf --- src/lang/russian.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/russian.txt b/src/lang/russian.txt index a4e38d8b22..534be43c18 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1894,6 +1894,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Показыв STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Аварии и катастрофы: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Показывать новости об авариях и катастрофах +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Аварии, произошедшие с транспортом конкурентов: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Показывать новости об авариях, произошедших с транспортными средствами конкурирующих компаний STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Информация о компании: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Показывать новости об основании и риске банкротства транспортных компаний From 2f72eb0657869a423977dceae0ea56d5fb8a333b Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Thu, 11 Nov 2021 19:06:31 +0000 Subject: [PATCH 079/710] Add: Specify minimum version for macOS (#9689) --- os/macosx/Info.plist.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/macosx/Info.plist.in b/os/macosx/Info.plist.in index 359d28de8d..0148ab289a 100644 --- a/os/macosx/Info.plist.in +++ b/os/macosx/Info.plist.in @@ -31,5 +31,7 @@ NSApplication NSHighResolutionCapable True + LSMinimumSystemVersion + 10.14.0 From f8efab4653b195de2a16c331a90d56c0d8ccaa03 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 12 Nov 2021 18:46:13 +0000 Subject: [PATCH 080/710] Update: Translations from eints japanese: 1 change by akaregi dutch: 3 changes by Afoklala --- src/lang/dutch.txt | 4 +++- src/lang/japanese.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 5b11449440..ff15afbf64 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1741,8 +1741,10 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :Eerste voertuig STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Nieuwsbericht weergeven als het eerste voertuig arriveert op een nieuw station van een concurrent STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ongelukken / rampen: {STRING} -STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Nieuwsbericht weergeven bij ongevallen of rampen +STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Nieuwsbericht weergeven bij ongelukken of rampen +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Ongelukken met voertuigen van concurrenten: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Nieuwsbericht weergeven over ongelukken met voertuigen van concurrenten STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Bedrijfsinformatie: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Nieuwsbericht weergeven als een nieuw bedrijf start en wanneer een bedrijf bijna falliet gaat diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index cbf78cf54a..3946ef3895 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -4102,7 +4102,7 @@ STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}航空 STR_VEHICLE_VIEW_TRAIN_IGNORE_SIGNAL_TOOLTIP :{BLACK}赤信号を無視して進行させます STR_VEHICLE_VIEW_TRAIN_REVERSE_TOOLTIP :{BLACK}運転方向を反転させます STR_VEHICLE_VIEW_ROAD_VEHICLE_REVERSE_TOOLTIP :{BLACK}車両を反転します -STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}注文先の中央のメインビュー。Ctrlキーを押しながらクリックすると、注文先の場所に新しいビューポートが開きます +STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}移動先の中央のメインビュー。Ctrlキーを押しながらクリックすると移動先の新しいビューポートが開きます ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_REFIT_TOOLTIP :{BLACK}現在とは異なる種類の貨物を運送するように列車を改造します From 5f6303f985928d8fe2a9f75b80a32c9564b88fd6 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 13 Nov 2021 21:01:16 +0100 Subject: [PATCH 081/710] Fix: don't complain when the sprite font is missing glyphs. (#9692) Silently auto-pick a suitable font. --- src/strings.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index 7ff1cee315..bfbde9b0dc 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2116,6 +2116,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher) if (bad_font) { /* We found an unprintable character... lets try whether we can find * a fallback font that can print the characters in the current language. */ + bool any_font_configured = !_freetype.medium.font.empty(); FreeTypeSettings backup = _freetype; _freetype.mono.os_handle = nullptr; @@ -2125,10 +2126,10 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher) _freetype = backup; - if (!bad_font) { - /* Show that we loaded fallback font. To do this properly we have - * to set the colour of the string, otherwise we end up with a lot - * of artifacts.* The colour 'character' might change in the + if (!bad_font && any_font_configured) { + /* If the user configured a bad font, and we found a better one, + * show that we loaded the better font instead of the configured one. + * The colour 'character' might change in the * future, so for safety we just Utf8 Encode it into the string, * which takes exactly three characters, so it replaces the "XXX" * with the colour marker. */ From 0cbe94256e4f600ceb397ddf8c0e3dca60676e5b Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 14 Nov 2021 16:59:49 +0100 Subject: [PATCH 082/710] Change: [Emscripten] update to 2.0.34 and use Release over RelWithDebInfo (#9696) It turns out that having "-g" in the compile-statement causes Emscripten to pick -g3, which makes for very big binaries. This is very likely not your intention when building Emscripten, as smaller really is better. For comparison, with RelWithDebInfo the binary is ~80MB. With Release it is ~7.4MB. --- .github/workflows/preview_build.yml | 2 +- os/emscripten/Dockerfile | 2 +- os/emscripten/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview_build.yml b/.github/workflows/preview_build.yml index 345a2152db..2a280a6fcd 100644 --- a/.github/workflows/preview_build.yml +++ b/.github/workflows/preview_build.yml @@ -76,7 +76,7 @@ jobs: echo "::group::CMake" emcmake cmake .. \ -DHOST_BINARY_DIR=../build-host \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Release \ # EOF echo "::endgroup::" diff --git a/os/emscripten/Dockerfile b/os/emscripten/Dockerfile index cbbff38c15..5d54b54114 100644 --- a/os/emscripten/Dockerfile +++ b/os/emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM emscripten/emsdk:2.0.31 +FROM emscripten/emsdk:2.0.34 COPY emsdk-liblzma.patch / RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch diff --git a/os/emscripten/README.md b/os/emscripten/README.md index 59f17c6269..c78dc6727b 100644 --- a/os/emscripten/README.md +++ b/os/emscripten/README.md @@ -24,7 +24,7 @@ Next, build the game with emscripten: ``` mkdir build - docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=$(pwd)/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF + docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j5 ``` From cf16f452da6d1cc8d4777ea4021d0c29b5679835 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 15 Nov 2021 13:39:41 +0000 Subject: [PATCH 083/710] Fix #9680: Recalculating aircraft positions before map array updates caused crashes (#9699) --- src/saveload/afterload.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index d3194cd4e2..bc8ffd2474 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -957,10 +957,6 @@ bool AfterLoadGame() } } - /* In version 2.2 of the savegame, we have new airports, so status of all aircraft is reset. - * This has to be called after the oilrig airport_type update above ^^^ ! */ - if (IsSavegameVersionBefore(SLV_2, 2)) UpdateOldAircraft(); - /* In version 6.1 we put the town index in the map-array. To do this, we need * to use m2 (16bit big), so we need to clean m2, and that is where this is * all about ;) */ @@ -2899,6 +2895,10 @@ bool AfterLoadGame() } } + /* In version 2.2 of the savegame, we have new airports, so status of all aircraft is reset. + * This has to be called after all map array updates */ + if (IsSavegameVersionBefore(SLV_2, 2)) UpdateOldAircraft(); + if (IsSavegameVersionBefore(SLV_188)) { /* Fix articulated road vehicles. * Some curves were shorter than other curves. From fc58ed9987a24785213a24c8c5d27f3b39c156ae Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 16 Nov 2021 22:48:21 +0000 Subject: [PATCH 084/710] Codechange: Remove CargoSpec::multipliertowngrowth which is unused (#9701) This is set by cargo property 19. This property is only implemented in TTDPatch. --- src/cargotype.h | 1 - src/newgrf.cpp | 2 +- src/table/cargo_const.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cargotype.h b/src/cargotype.h index 5ed9ac90e2..22c1bf7f54 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -66,7 +66,6 @@ struct CargoSpec { bool is_freight; ///< Cargo type is considered to be freight (affects train freight multiplier). TownEffect town_effect; ///< The effect that delivering this cargo type has on towns. Also affects destination of subsidies. - uint16 multipliertowngrowth; ///< Size of the effect. uint8 callback_mask; ///< Bitmask of cargo callbacks that have to be called StringID name; ///< Name of this type of cargo. diff --git a/src/newgrf.cpp b/src/newgrf.cpp index d1352d02e7..ef13e5545d 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3019,7 +3019,7 @@ static ChangeInfoResult CargoChangeInfo(uint cid, int numinfo, int prop, ByteRea } case 0x19: // Town growth coefficient - cs->multipliertowngrowth = buf->ReadWord(); + buf->ReadWord(); break; case 0x1A: // Bitmask of callbacks to use diff --git a/src/table/cargo_const.h b/src/table/cargo_const.h index bb6f811a92..8fffc8e804 100644 --- a/src/table/cargo_const.h +++ b/src/table/cargo_const.h @@ -44,7 +44,7 @@ * @param classes Classes of this cargo type. @see CargoClass */ #define MK(bt, label, colour, weight, mult, ip, td1, td2, freight, te, str_plural, str_singular, str_volume, classes) \ - {bt, label, colour, colour, weight, mult, ip, {td1, td2}, freight, te, 0, 0, \ + {bt, label, colour, colour, weight, mult, ip, {td1, td2}, freight, te, 0, \ MK_STR_CARGO_PLURAL(str_plural), MK_STR_CARGO_SINGULAR(str_singular), str_volume, MK_STR_QUANTITY(str_plural), MK_STR_ABBREV(str_plural), \ MK_SPRITE(str_plural), classes, nullptr, nullptr, 0} From f6886754ff99420dd4e02b541b94c213ad6f2052 Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 18 Nov 2021 18:47:13 +0000 Subject: [PATCH 085/710] Update: Translations from eints greek: 2 changes by dionisis84 german: 2 changes by danidoedel --- src/lang/german.txt | 2 ++ src/lang/greek.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/lang/german.txt b/src/lang/german.txt index 3c18b22b23..8b1d81dba1 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -1744,6 +1744,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Zeitung anzeige STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Unfälle und Katastrophen: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Zeitung anzeigen, wenn Unfälle oder Katastrophen auftreten +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Unfälle von Mitbewerberfahrzeugen: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Zeitung anzeigen, wenn Fahrzeuge eines Mitbewerbers Unfälle haben STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Firmenmitteilungen: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Zeitung anzeigen, wenn neue Firmen gegründet werden oder kurz vor dem Bankrott stehen diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 962ae84eb7..ca18521d53 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1850,6 +1850,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Παρουσί STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Ατυχήματα / καταστροφές: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Προβάλλει εφημερίδα όταν συμβαίνουν ατυχήματα ή καταστροφές +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Ατυχήματα των ανταγωνιστικών οχημάτων: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Εμφάνιση εφημερίδας για τα διαλυμένα οχήματα για τους ανταγωνιστές STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Πληροφορίες εταιρίας: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Προβάλλει εφημερίδα όταν αρχίζει νέα εταιρεία ή όταν οι εταιρίες ρισκάρουν χρεωκοπία From 0533b666b7036750ed0b004f22f933625391dd8e Mon Sep 17 00:00:00 2001 From: Bernard Teo Date: Fri, 19 Nov 2021 08:03:52 +0800 Subject: [PATCH 086/710] Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704) --- src/group_gui.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/group_gui.cpp b/src/group_gui.cpp index bc6a9aaf2e..374ed5700d 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -746,17 +746,23 @@ public: NOT_REACHED(); } if (v) { - if (_ctrl_pressed) { - if (this->grouping == GB_NONE) { - this->SelectGroup(v->group_id); - } else { - ShowOrdersWindow(v); - } + if (_ctrl_pressed && this->grouping == GB_SHARED_ORDERS) { + ShowOrdersWindow(v); } else { this->vehicle_sel = v->index; + + if (_ctrl_pressed && this->grouping == GB_NONE) { + /* + * It only makes sense to select a group if not using shared orders + * since two vehicles sharing orders can be from different groups. + */ + this->SelectGroup(v->group_id); + } + SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this); SetMouseCursorVehicle(v, EIT_IN_LIST); _cursor.vehchain = true; + this->SetDirty(); } } From 2cb6351af596178ac3169baeffbc5a827f9aad5f Mon Sep 17 00:00:00 2001 From: nchappe <74881848+nchappe@users.noreply.github.com> Date: Fri, 19 Nov 2021 00:04:22 +0000 Subject: [PATCH 087/710] Fix: Update last servicing dates when using the date cheat (#9694) --- src/cheat_gui.cpp | 2 ++ src/date.cpp | 2 +- src/vehicle.cpp | 10 ++++++++++ src/vehicle_base.h | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 4821edbcc9..a0ac5fab8f 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -14,6 +14,7 @@ #include "company_func.h" #include "date_func.h" #include "saveload/saveload.h" +#include "vehicle_base.h" #include "textbuf_gui.h" #include "window_gui.h" #include "string_func.h" @@ -106,6 +107,7 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2) if (p1 == _cur_year) return _cur_year; Date new_date = ConvertYMDToDate(p1, ymd.month, ymd.day); + for (auto v : Vehicle::Iterate()) v->ShiftDates(new_date - _date); LinkGraphSchedule::instance.ShiftDates(new_date - _date); SetDate(new_date, _date_fract); EnginesMonthlyLoop(); diff --git a/src/date.cpp b/src/date.cpp index 0fd98c42b9..eac0c5f0ba 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -211,7 +211,7 @@ static void OnNewYear() _cur_year--; days_this_year = IsLeapYear(_cur_year) ? DAYS_IN_LEAP_YEAR : DAYS_IN_YEAR; _date -= days_this_year; - for (Vehicle *v : Vehicle::Iterate()) v->date_of_last_service -= days_this_year; + for (Vehicle *v : Vehicle::Iterate()) v->ShiftDates(-days_this_year); for (LinkGraph *lg : LinkGraph::Iterate()) lg->ShiftDates(-days_this_year); /* Because the _date wraps here, and text-messages expire by game-days, we have to clean out diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9e22927512..30e1c477cb 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -763,6 +763,16 @@ uint32 Vehicle::GetGRFID() const return this->GetEngine()->GetGRFID(); } +/** + * Shift all dates by given interval. + * This is useful if the date has been modified with the cheat menu. + * @param interval Number of days to be added or substracted. + */ +void Vehicle::ShiftDates(int interval) +{ + this->date_of_last_service += interval; +} + /** * Handle the pathfinding result, especially the lost status. * If the vehicle is now lost and wasn't previously fire an diff --git a/src/vehicle_base.h b/src/vehicle_base.h index a5549b4441..12acaa8edf 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -545,6 +545,8 @@ public: */ virtual void OnNewDay() {}; + void ShiftDates(int interval); + /** * Crash the (whole) vehicle chain. * @param flooded whether the cause of the crash is flooding or not. From 54951e39a1f0395438180ba920aad88eea928f50 Mon Sep 17 00:00:00 2001 From: dP Date: Fri, 19 Nov 2021 03:07:22 +0300 Subject: [PATCH 088/710] Fix #8797: Use logical rail length when placing signals (#9652) --- src/rail_cmd.cpp | 180 ++++++++++++++++++++++++++------------------- src/vehicle_base.h | 5 +- 2 files changed, 109 insertions(+), 76 deletions(-) diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 59c1d27ab0..4c34f1ca86 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1209,8 +1209,11 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, return cost; } -static bool CheckSignalAutoFill(TileIndex &tile, Trackdir &trackdir, int &signal_ctr, bool remove) +static bool AdvanceSignalAutoFill(TileIndex &tile, Trackdir &trackdir, bool remove) { + /* We only process starting tiles of tunnels or bridges so jump to the other end before moving further. */ + if (IsTileType(tile, MP_TUNNELBRIDGE)) tile = GetOtherTunnelBridgeEnd(tile); + tile = AddTileIndexDiffCWrap(tile, _trackdelta[trackdir]); if (tile == INVALID_TILE) return false; @@ -1233,35 +1236,21 @@ static bool CheckSignalAutoFill(TileIndex &tile, Trackdir &trackdir, int &signal case MP_RAILWAY: if (IsRailDepot(tile)) return false; if (!remove && HasSignalOnTrack(tile, TrackdirToTrack(trackdir))) return false; - signal_ctr++; - if (IsDiagonalTrackdir(trackdir)) { - signal_ctr++; - /* Ensure signal_ctr even so X and Y pieces get signals */ - ClrBit(signal_ctr, 0); - } - return true; + break; case MP_ROAD: if (!IsLevelCrossing(tile)) return false; - signal_ctr += 2; - return true; + break; case MP_TUNNELBRIDGE: { - TileIndex orig_tile = tile; // backup old value - if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false; if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false; - - /* Skip to end of tunnel or bridge - * note that tile is a parameter by reference, so it must be updated */ - tile = GetOtherTunnelBridgeEnd(tile); - - signal_ctr += (GetTunnelBridgeLength(orig_tile, tile) + 2) * 2; - return true; + break; } default: return false; } + return true; } /** @@ -1292,7 +1281,7 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin bool remove = HasBit(p2, 5); bool autofill = HasBit(p2, 6); bool minimise_gaps = HasBit(p2, 10); - byte signal_density = GB(p2, 24, 8); + int signal_density = GB(p2, 24, 8); if (p1 >= MapSize() || !ValParamTrackOrientation(track)) return CMD_ERROR; TileIndex end_tile = p1; @@ -1300,9 +1289,8 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin if (!IsPlainRailTile(tile)) return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK); - /* for vertical/horizontal tracks, double the given signals density - * since the original amount will be too dense (shorter tracks) */ - signal_density *= 2; + /* Interpret signal_density as the logical length of said amount of tiles in X/Y direction. */ + signal_density *= TILE_AXIAL_DISTANCE; Trackdir trackdir = TrackToTrackdir(track); CommandCost ret = ValidateAutoDrag(&trackdir, tile, end_tile); @@ -1350,86 +1338,128 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin * and convert all others to semaphore/signal * remove - 1 remove signals, 0 build signals */ int signal_ctr = 0; - int last_used_ctr = INT_MIN; // initially INT_MIN to force building/removing at the first tile + int last_used_ctr = -signal_density; // to force signal at first tile int last_suitable_ctr = 0; TileIndex last_suitable_tile = INVALID_TILE; Trackdir last_suitable_trackdir = INVALID_TRACKDIR; CommandCost last_error = CMD_ERROR; bool had_success = false; - for (;;) { - /* only build/remove signals with the specified density */ - if (remove || minimise_gaps || signal_ctr % signal_density == 0) { - uint32 param1 = GB(TrackdirToTrack(trackdir), 0, 3); - SB(param1, 3, 1, mode); - SB(param1, 4, 1, semaphores); - SB(param1, 5, 3, sigtype); - if (!remove && signal_ctr == 0) SetBit(param1, 17); + uint32 param1 = 0; + SB(param1, 3, 1, mode); + SB(param1, 4, 1, semaphores); + SB(param1, 5, 3, sigtype); - /* Pick the correct orientation for the track direction */ - signals = 0; - if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(trackdir); - if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(trackdir); + auto build_signal = [&](TileIndex tile, Trackdir trackdir, bool test_only) { + SB(param1, 0, 3, TrackdirToTrack(trackdir)); + SB(param1, 17, 1, (!remove && signal_ctr == 0 ? 1 : 0)); - /* Test tiles in between for suitability as well if minimising gaps. */ - bool test_only = !remove && minimise_gaps && signal_ctr < (last_used_ctr + signal_density); - CommandCost ret = DoCommand(tile, param1, signals, test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS); + /* Pick the correct orientation for the track direction */ + byte signals = 0; + if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(trackdir); + if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(trackdir); - if (ret.Succeeded()) { - /* Remember last track piece where we can place a signal. */ - last_suitable_ctr = signal_ctr; - last_suitable_tile = tile; - last_suitable_trackdir = trackdir; - } else if (!test_only && last_suitable_tile != INVALID_TILE) { - /* If a signal can't be placed, place it at the last possible position. */ - SB(param1, 0, 3, TrackdirToTrack(last_suitable_trackdir)); - ClrBit(param1, 17); + CommandCost ret = DoCommand(tile, param1, signals, test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS); - /* Pick the correct orientation for the track direction. */ - signals = 0; - if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(last_suitable_trackdir); - if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(last_suitable_trackdir); + if (test_only) return ret.Succeeded(); - ret = DoCommand(last_suitable_tile, param1, signals, flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS); + if (ret.Succeeded()) { + had_success = true; + total_cost.AddCost(ret); + } else { + /* The "No railway" error is the least important one. */ + if (ret.GetErrorMessage() != STR_ERROR_THERE_IS_NO_RAILROAD_TRACK || + last_error.GetErrorMessage() == INVALID_STRING_ID) { + last_error = ret; } + } + return ret.Succeeded(); + }; - /* Collect cost. */ - if (!test_only) { - /* Be user-friendly and try placing signals as much as possible */ - if (ret.Succeeded()) { - had_success = true; - total_cost.AddCost(ret); - last_used_ctr = last_suitable_ctr; + for (;;) { + if (remove) { + /* In remove mode last_* stuff doesn't matter, we simply try to clear every tile. */ + build_signal(tile, trackdir, false); + } else if (minimise_gaps) { + /* We're trying to minimize gaps wherever possible, so keep track of last suitable + * position and use it if current gap exceeds required signal density. */ + + if (signal_ctr > last_used_ctr + signal_density && last_suitable_tile != INVALID_TILE) { + /* We overshot so build a signal in last good location. */ + if (build_signal(last_suitable_tile, last_suitable_trackdir, false)) { last_suitable_tile = INVALID_TILE; - } else { - /* The "No railway" error is the least important one. */ - if (ret.GetErrorMessage() != STR_ERROR_THERE_IS_NO_RAILROAD_TRACK || - last_error.GetErrorMessage() == INVALID_STRING_ID) { - last_error = ret; - } + last_used_ctr = last_suitable_ctr; } } + + if (signal_ctr == last_used_ctr + signal_density) { + /* Current gap matches the required density, build a signal. */ + if (build_signal(tile, trackdir, false)) { + last_used_ctr = signal_ctr; + last_suitable_tile = INVALID_TILE; + } + } else { + /* Test tile for a potential signal spot. */ + if (build_signal(tile, trackdir, true)) { + last_suitable_tile = tile; + last_suitable_ctr = signal_ctr; + last_suitable_trackdir = trackdir; + } + } + } else if(signal_ctr >= last_used_ctr + signal_density) { + /* We're always keeping regular interval between signals so doesn't matter whether we succeed or not. */ + build_signal(tile, trackdir, false); + last_used_ctr = signal_ctr; } if (autofill) { - if (!CheckSignalAutoFill(tile, trackdir, signal_ctr, remove)) break; + switch (GetTileType(tile)) { + case MP_RAILWAY: + signal_ctr += (IsDiagonalTrackdir(trackdir) ? TILE_AXIAL_DISTANCE : TILE_CORNER_DISTANCE); + break; + + case MP_ROAD: + signal_ctr += TILE_AXIAL_DISTANCE; + break; + + case MP_TUNNELBRIDGE: { + uint len = (GetTunnelBridgeLength(tile, GetOtherTunnelBridgeEnd(tile)) + 2) * TILE_AXIAL_DISTANCE; + if (remove || minimise_gaps) { + signal_ctr += len; + } else { + /* To keep regular interval we need to emulate placing signals on a bridge. + * We start with TILE_AXIAL_DISTANCE as one bridge tile gets processed in the main loop. */ + signal_ctr += TILE_AXIAL_DISTANCE; + for(uint i = TILE_AXIAL_DISTANCE; i < len; i += TILE_AXIAL_DISTANCE) { + if (signal_ctr >= last_used_ctr + signal_density) last_used_ctr = signal_ctr; + signal_ctr += TILE_AXIAL_DISTANCE; + } + } + break; + } + + default: break; + } + + if (!AdvanceSignalAutoFill(tile, trackdir, remove)) break; /* Prevent possible loops */ if (tile == start_tile && trackdir == start_trackdir) break; } else { if (tile == end_tile) break; - tile += ToTileIndexDiff(_trackdelta[trackdir]); - signal_ctr++; - + signal_ctr += (IsDiagonalTrackdir(trackdir) ? TILE_AXIAL_DISTANCE : TILE_CORNER_DISTANCE); /* toggle railbit for the non-diagonal tracks (|, -- tracks) */ - if (IsDiagonalTrackdir(trackdir)) { - signal_ctr++; - } else { - ToggleBit(trackdir, 0); - } + + tile += ToTileIndexDiff(_trackdelta[trackdir]); + if (!IsDiagonalTrackdir(trackdir)) ToggleBit(trackdir, 0); } } + /* We may end up with the current gap exceeding the signal density so fix that if needed. */ + if (!remove && minimise_gaps && signal_ctr > last_used_ctr + signal_density && last_suitable_tile != INVALID_TILE) { + build_signal(last_suitable_tile, last_suitable_trackdir, false); + } + return had_success ? total_cost : last_error; } diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 12acaa8edf..a5ab42989c 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -26,6 +26,9 @@ #include #include +const uint TILE_AXIAL_DISTANCE = 192; // Logical length of the tile in any DiagDirection used in vehicle movement. +const uint TILE_CORNER_DISTANCE = 128; // Logical length of the tile corner crossing in any non-diagonal direction used in vehicle movement. + /** Vehicle status bits in #Vehicle::vehstatus. */ enum VehStatus { VS_HIDDEN = 0x01, ///< Vehicle is not visible. @@ -426,7 +429,7 @@ public: */ inline uint GetAdvanceDistance() { - return (this->direction & 1) ? 192 : 256; + return (this->direction & 1) ? TILE_AXIAL_DISTANCE : TILE_CORNER_DISTANCE * 2; } /** From ad90e88ebdfcacead53c9af40e75cb0ab37e3b00 Mon Sep 17 00:00:00 2001 From: dP Date: Fri, 19 Nov 2021 03:08:06 +0300 Subject: [PATCH 089/710] Change: Make pf.yapf.rail_firstred_twoway_eol on by default (#9544) --- src/table/settings/pathfinding_settings.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/table/settings/pathfinding_settings.ini b/src/table/settings/pathfinding_settings.ini index 322090001a..ac0a428371 100644 --- a/src/table/settings/pathfinding_settings.ini +++ b/src/table/settings/pathfinding_settings.ini @@ -334,7 +334,7 @@ cat = SC_EXPERT [SDT_BOOL] var = pf.yapf.rail_firstred_twoway_eol from = SLV_28 -def = false +def = true cat = SC_EXPERT [SDT_VAR] From 793de48e890a0d45693881b48e8abe9ffef35f60 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 20 Nov 2021 18:49:33 +0000 Subject: [PATCH 090/710] Update: Translations from eints vietnamese: 2 changes by KhoiCanDev --- src/lang/vietnamese.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index fd5758c9bc..478f75c690 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -1743,6 +1743,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Hiển thị ti STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Tai nạn / thiên tai: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Hiển thị tin tức về các vụ tại nạn hoặc thiên tai xảy ra +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Tai nạn của đối thủ: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Hiển thị thông điệp về phương tiện bị tai nạn của đối thủ STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Thông tin công ty: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Hiển thị tin tức khi có một công ty mới khai trương, hoặc các công ty có nguy cơ phá sản From 20a30825a0c80e57a069fca5524365f72d85f6b0 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 20 Nov 2021 23:27:45 +0100 Subject: [PATCH 091/710] Fix: Insufficient input validation for CmdIndustryCtrl. (#9711) --- src/industry_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 8be44488db..b03a722b78 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -2118,7 +2118,7 @@ CommandCost CmdIndustryCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint } default: - NOT_REACHED(); + return CMD_ERROR; } return CommandCost(); From ad7bdeb73a99970ea8e7de99dc20131b29fb1b9e Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 22 Nov 2021 18:48:48 +0000 Subject: [PATCH 092/710] Update: Translations from eints chinese (simplified): 2 changes by kurax --- src/lang/simplified_chinese.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index f33031e318..5f92aff44c 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -1743,6 +1743,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :报纸报道竞 STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :事故/灾难: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :报纸报道事故或灾难发生情况 +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :竞争对手的运输工具事故:{STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :显示竞争对手的运输工具事故消息 STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :公司信息: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :报纸报道新公司开业或者预警倒闭风险 From e0a91d7325ec8a800babcf905d8ff8df87ec1530 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 26 Nov 2021 18:48:29 +0000 Subject: [PATCH 093/710] Update: Translations from eints galician: 17 changes by pvillaverde --- src/lang/galician.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lang/galician.txt b/src/lang/galician.txt index b281dbc266..db2909687d 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -315,6 +315,7 @@ STR_SORT_BY_CARGO_CAPACITY :Capacidade de c STR_SORT_BY_RANGE :Autonomía STR_SORT_BY_POPULATION :Poboación STR_SORT_BY_RATING :Puntuación +STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Beneficio promedio deste ano # Group by options for vehicle list @@ -749,6 +750,7 @@ STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_ROUGH_LAND :{TINY_FONT}{BLACK}Terra STR_SMALLMAP_LEGENDA_GRASS_LAND :{TINY_FONT}{BLACK}Herba STR_SMALLMAP_LEGENDA_BARE_LAND :{TINY_FONT}{BLACK}Terra deserta +STR_SMALLMAP_LEGENDA_RAINFOREST :{TINY_FONT}{BLACK}Selva STR_SMALLMAP_LEGENDA_FIELDS :{TINY_FONT}{BLACK}Leiras STR_SMALLMAP_LEGENDA_TREES :{TINY_FONT}{BLACK}Árbores STR_SMALLMAP_LEGENDA_ROCKS :{TINY_FONT}{BLACK}Rochas @@ -996,6 +998,7 @@ STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Seleccio STR_GAME_OPTIONS_RESOLUTION_OTHER :outra +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marca esta caixa para activar o V-sync da pantalla. O cambio só se aplicará tras reiniciar o xogo. Só funciona coa aceleración de hardware habilitada STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamaño da interface STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleciona o tamaño de elementos da interface a usar @@ -1012,6 +1015,7 @@ STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Tamaño doble STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Tamaño do cadro +STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Amosar tasa de refresco STR_GAME_OPTIONS_BASE_GRF :{BLACK}Conxunto básico de gráficos STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Selecciona o conxunto de gráficos básico a empregar @@ -1126,6 +1130,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Opcións STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filtrar texto: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Expandir todos STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Minimizar todos +STR_CONFIG_SETTING_RESET_ALL :{BLACK}Restablecer todos os valores STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(sen explicación dispoñíbel) STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Valor por defecto: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}Tipo de configuración: {ORANGE}{STRING} @@ -1813,6 +1818,7 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x ###length 3 +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x STR_CONFIG_SETTING_TOWN_GROWTH :Velocidade de crecemento das cidades: {STRING} STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :Velocidade de crecemento das cidades @@ -2130,6 +2136,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Cambia-l # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_LOCAL :Local # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Multixogador @@ -2165,6 +2172,7 @@ STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data ac STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Protexido con contrasinal! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVIDOR DESCONECTADO STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVIDOR CHEO +STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}O SERVIDOR PROHIBIUCHE O ACCESO STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIÓN INCORRECTA STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}PROBLEMA CON NEWGRF @@ -2172,6 +2180,7 @@ STR_NETWORK_SERVER_LIST_JOIN_GAME :{BLACK}Unirse STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}Actualizar servidor STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}Actualiza-la información do servidor +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Buscar servidores públicos en internet STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Engadir servidor STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Engade un servidor á lista que será comprobado sempre para buscar partidas. STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Iniciar servidor @@ -2222,9 +2231,14 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}A compa STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Lista de clientes # Network client list +STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Servidor +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Código de convite +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Enviar unha mensaxe a todos os espectadores +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Este é o anfitrión da partida # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Público @@ -2331,6 +2345,7 @@ STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} de STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}O servidor pechou a sesión STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}O servidor estase a reiniciar...{}Agarda por favor... +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Outro servidor co mesmo código de convite rexistrouse a si mesmo. Cambiando o modo de xogo "local". # Content downloading window STR_CONTENT_TITLE :{WHITE}Descargando contidos @@ -2697,6 +2712,7 @@ STR_FUND_INDUSTRY_CAPTION :{WHITE}Financia STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}Elixe a industria apropiada desta lista STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :Moitas industrias aleatorias STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}Cubri-lo mapa con industrias colocadas aleatoriamente +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_QUERY :{YELLOW}Estás seguro de que queres crear moitas industrias aleatorias? STR_FUND_INDUSTRY_INDUSTRY_BUILD_COST :{BLACK}Custo: {YELLOW}{CURRENCY_LONG} STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}Prospección STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Construír @@ -4058,7 +4074,7 @@ STR_ORDER_TOOLTIP_UNLOAD :{BLACK}Cambiar STR_ORDER_REFIT :{BLACK}Reformar STR_ORDER_REFIT_TOOLTIP :{BLACK}Selecciona o tipo de carga para reformar nesta orde. CTRL+click para quita-la instrución de reforma STR_ORDER_REFIT_AUTO :{BLACK}Auto-reforma -STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Selecciona que tipo de carfa se reformará nesta orde. Ctrl+click para borra-la orde de reforma. A auto-reforma só será feita se o vehículo o permite +STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Selecciona que tipo de carga se reformará nesta orde. Ctrl+click para borra-la orde de reforma. A auto-reforma só será feita se o vehículo o permite STR_ORDER_DROP_REFIT_AUTO :Carga fixada STR_ORDER_DROP_REFIT_AUTO_ANY :Carga dispoñíbel From 6953df7b5e52d749e50275640197e5fc17e2310c Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 27 Nov 2021 18:47:35 +0000 Subject: [PATCH 094/710] Update: Translations from eints galician: 265 changes by pvillaverde indonesian: 8 changes by indrabagus spanish: 7 changes by MontyMontana --- src/lang/galician.txt | 294 ++++++++++++++++++++++++++++++++++++---- src/lang/indonesian.txt | 14 +- src/lang/spanish.txt | 11 +- 3 files changed, 280 insertions(+), 39 deletions(-) diff --git a/src/lang/galician.txt b/src/lang/galician.txt index db2909687d..5429f5e640 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -195,6 +195,7 @@ STR_COLOUR_RANDOM :Ao chou STR_UNITS_VELOCITY_IMPERIAL :{COMMA} mph STR_UNITS_VELOCITY_METRIC :{COMMA} km/h STR_UNITS_VELOCITY_SI :{COMMA} m/s +STR_UNITS_VELOCITY_GAMEUNITS :{DECIMAL}{NBSP}cadros/día STR_UNITS_POWER_IMPERIAL :{COMMA}cv STR_UNITS_POWER_METRIC :{COMMA}cv @@ -315,11 +316,19 @@ STR_SORT_BY_CARGO_CAPACITY :Capacidade de c STR_SORT_BY_RANGE :Autonomía STR_SORT_BY_POPULATION :Poboación STR_SORT_BY_RATING :Puntuación +STR_SORT_BY_NUM_VEHICLES :Número de vehículos +STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Beneficio total o último ano +STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Beneficio total deste ano +STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Beneficio promedio do último ano STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Beneficio promedio deste ano # Group by options for vehicle list +STR_GROUP_BY_NONE :Ningún +STR_GROUP_BY_SHARED_ORDERS :Ordes compartidas # Order button in shared orders vehicle list +STR_GOTO_ORDER_VIEW :{BLACK}Ordes +STR_GOTO_ORDER_VIEW_TOOLTIP :{BLACK}Abre a vista de ordes # Tooltips for the main toolbar ###length 31 @@ -611,7 +620,7 @@ STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR :Coordinador de STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR :Supervisor de Ruta STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR :Maquinista STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE :Xefe Executivo -STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN :Director +STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN :Xerente STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT :Presidente STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON :Magnate @@ -696,7 +705,7 @@ STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Pincha n STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED :{BIG_FONT}{BLACK}Mellores compañías que chegaron a {NUM} STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME :{BIG_FONT}{BLACK}Cadro da liga de compañías en {NUM} STR_HIGHSCORE_POSITION :{BIG_FONT}{BLACK}{COMMA}. -STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN :Home de negocios +STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN :Persoa de negocios STR_HIGHSCORE_PERFORMANCE_TITLE_ENTREPRENEUR :Emprendedor STR_HIGHSCORE_PERFORMANCE_TITLE_INDUSTRIALIST :Industrial STR_HIGHSCORE_PERFORMANCE_TITLE_CAPITALIST :Capitalista @@ -782,9 +791,11 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}Amosa t STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}Mostrar a última mensaxe ou nova STR_STATUSBAR_COMPANY_NAME :{SILVER}- - {COMPANY} - - STR_STATUSBAR_PAUSED :{YELLOW}* * EN PAUSA * * +STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * PAUSADO (agardando pola actualización do gráfico de ligazóns) * * STR_STATUSBAR_AUTOSAVE :{RED}AUTOGRAVADO STR_STATUSBAR_SAVING_GAME :{RED}* * GRAVANDO PARTIDA * * +STR_STATUSBAR_SPECTATOR :{WHITE}(espectador) # News message history STR_MESSAGE_HISTORY :{WHITE}Historial de mensaxes @@ -879,6 +890,7 @@ STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE :{BIG_FONT}{BLAC STR_NEWS_NEW_VEHICLE_TYPE :{BIG_FONT}{BLACK}{ENGINE} STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE :{BLACK}Nova {STRING} dispoñíbel! - {ENGINE} +STR_NEWS_SHOW_VEHICLE_GROUP_TOOLTIP :{BLACK}Abre a fiestra de grupo enfocada no grupo do vehículo. STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO :{WHITE}{STATION} xa non acepta máis {STRING} STR_NEWS_STATION_NO_LONGER_ACCEPTS_CARGO_OR_CARGO :{WHITE}{STATION} xa non acepta máis {STRING} nin {STRING} @@ -887,7 +899,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}Oferta de subvención expirada:{}{}{STRING} dende {STRING} ata {STRING} non será subvencionada. STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}Subvención reitrada:{}{}O servizo de transporte de {STRING} dende {STRING} ata {STRING} xa non ten subvención. +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Oferta de subvención:{}{}O primeiro servizo de transporte de {STRING} dende {STRING} ata {STRING} será subvencionado con {NUM} durante un ano pola autoridade local! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}Subvención concedida a {STRING}!{}{}Polo servizo de transporte de {STRING} dende {STRING} ata {STRING} pagarase un 50% máis durante {NUM} ano{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}Subvención concedida a {STRING}!{}{}Polo servizo de transporte de {STRING} dende {STRING} ata {STRING} pagarase o dobre durante {NUM} ano{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}Subvención concedida a {STRING}!{}{}Polo servizo de transporte de {STRING} dende {STRING} ata {STRING} pagarase o triplo durante {NUM} ano{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Subvención concedida a {STRING}!{}{}Polo servizo de transporte de {STRING} dende {STRING} ata {STRING} pagaráse o cuádruplo durante {NUM} ano{P "" s}! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Caos no tráfico de {TOWN}!{}{}O programa de reconstrución de estradas financiado por {STRING} trae 6 meses de miseria para os condutores! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Monopolio de transportes! @@ -945,12 +962,15 @@ STR_GAME_OPTIONS_CURRENCY_MXN :Peso mexicano ( STR_GAME_OPTIONS_CURRENCY_NTD :Novo dólar taiwanés (NTD) STR_GAME_OPTIONS_CURRENCY_CNY :Renminbi chinés (CNY) STR_GAME_OPTIONS_CURRENCY_HKD :Dólar de Hong Kong (HKD) +STR_GAME_OPTIONS_CURRENCY_INR :Rupia India (INR) +STR_GAME_OPTIONS_CURRENCY_IDR :Rupia Indonesia (IDR) +STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit malaio(MYR) ###length 2 STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :Conducir pola esquerda STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :Conducir pola dereita -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Nomes das cidades +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}Nomes das localidades: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}Selecciona o estilo dos nomes das cidades ###length 21 @@ -989,6 +1009,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_12_MONTHS :Cada 12 meses STR_GAME_OPTIONS_LANGUAGE :{BLACK}Lingua STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Selecciona a lingua para a interface +STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% completado) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Pantalla completa STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Marca esta opción para xogar a OpenTTD en modo de pantalla completa @@ -996,13 +1017,19 @@ STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_RESOLUTION :{BLACK}Resolución de pantalla STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Selecciona a resolución de pantalla a empregar STR_GAME_OPTIONS_RESOLUTION_OTHER :outra +STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} +STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Aceleración por hardware +STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Marca esta caixa para permitirlle a OpenTTD intentar usar a aceleración por hardware. O cambio da configuración só se aplicará o reiniciar o xogo +STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}O cambio da configuración só se aplicará o reiniciar o xogo +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marca esta caixa para activar o V-sync da pantalla. O cambio só se aplicará tras reiniciar o xogo. Só funciona coa aceleración de hardware habilitada STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamaño da interface STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleciona o tamaño de elementos da interface a usar +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detectar) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobre tamaño STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Tamaño do cadro @@ -1010,12 +1037,17 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Tamaño do cadr STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Tamaño da letra STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Escoller o tamaño de fonte da interfaz +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detectar) STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Tamaño doble STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Tamaño do cadro +STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Amosar tasa de refresco +STR_GAME_OPTIONS_REFRESH_RATE_TOOLTIP :{BLACK}Selecciona a tasa de refresco de pantalla a usar +STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{NUM}Hz +STR_GAME_OPTIONS_REFRESH_RATE_WARNING :{WHITE}As tasas de refresco superiores a 60Hz poden afectar o rendemento. STR_GAME_OPTIONS_BASE_GRF :{BLACK}Conxunto básico de gráficos STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Selecciona o conxunto de gráficos básico a empregar @@ -1117,6 +1149,8 @@ STR_TERRAIN_TYPE_FLAT :Chan STR_TERRAIN_TYPE_HILLY :Accidentado STR_TERRAIN_TYPE_MOUNTAINOUS :Montañoso STR_TERRAIN_TYPE_ALPINIST :Alpinista +STR_TERRAIN_TYPE_CUSTOM :Altitude personalizada +STR_TERRAIN_TYPE_CUSTOM_VALUE :Altitude personalizada ({NUM}) ###length 3 STR_CITY_APPROVAL_PERMISSIVE :Permisiva @@ -1139,6 +1173,8 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :Configuración STR_CONFIG_SETTING_TYPE_GAME_INGAME :Configuración da partida (almacénase nas partidas gravadas; afecta só á partida actual) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Configuración da compañía (almacénase nas partidas gravadas; afecta só ás novas partidas) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Configuración da compañía (almacénase nas partidas gravadas; afecta só á partida actual) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_CAPTION :{WHITE}Coidado! +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}Esta acción restablecera todas as configuracións do xogo os seus valores por defecto.{}Estas seguro de que queres continuar? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Categoría: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Tipo: @@ -1201,8 +1237,12 @@ STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Controla a frec STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Multiplicador das subvencións: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Fixa canto se paga polas conexións subvencionadas +STR_CONFIG_SETTING_SUBSIDY_DURATION :Duración da subvención: {STRING} +STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT :Establece o número de anos durante os cales se concede a subvención. +STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE :{NUM} ano{P "" s} ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Sen subvencións STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Custos de construción: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Fixa o nivel de custos de construción e compra @@ -1219,8 +1259,12 @@ STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Activa os desas STR_CONFIG_SETTING_CITY_APPROVAL :Actitude das autoridades locáis cara a restruturacións de áreas: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Escolle ata que punto o ruido e danos medioambientais producidos polas compañias afectan á súa valoración municipal e ás próximas actividades construtivas na súa área +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :Altitude máxima do mapa: {STRING} +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT :Establece a altitude máxima do terreo do mapa. Con "(auto)" collerase un bo valor despois da xeración do terreo. +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE :{NUM} ###setting-zero-is-special -STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}Non podes establecer a altura máxima do mapa a este valor. Canda menos un monte do mapa é maior +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_AUTO :(auto) +STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}Non podes establecer a altura máxima do mapa a este valor. Canda menos un monte do mapa ten máis altura. STR_CONFIG_SETTING_AUTOSLOPE :Permitir modificacións do terreo baixo edificios, vías, etc. (autopendente): {STRING} STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Permite modificar o terreo baixo edificacións e vías sen retiralos @@ -1401,9 +1445,11 @@ STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Amosa a poboaci STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Grosor das liñas dos gráficos: {STRING} STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Ancho de liña nos gráficos. Unha liña fina lese con máis precisión, unha liña grosa é máis doada de ver e as cores son máis fáciles de distinguir +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Amosar o nome do NewGRF na fiestra de comprar vehículos: {STRING} +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Engade unha liña a fiestra de compra de vehículos, amosando de que NewGRF ven o vehículo. STR_CONFIG_SETTING_LANDSCAPE :Paisaxe: {STRING} -STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :As paisaxes definen escenarios de xogo con diferentes requirimentos de mercadorías e de crecemento da poboación. Ainda que os scripts de xogo e os NewGRF permiten máis control +STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :As paisaxes definen escenarios de xogo con diferentes requerimentos de mercadorías e de crecemento da poboación. Os scripts de xogo e os NewGRF permiten un maior control STR_CONFIG_SETTING_LAND_GENERATOR :Xerador de terreo: {STRING} STR_CONFIG_SETTING_LAND_GENERATOR_HELPTEXT :O xerador orixinal depende do conxunto base de gráficos, e compón formas fixas de paisaxe. TerraGenesis é un xerador baseado no Ruido Perlin con maiores opcións de control @@ -1421,9 +1467,15 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distancia máxi STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limita a qué distancia dos bordes do mundo as refinerías e pozos petrolíferos poden construirse. En mapas con illas asegura que estean situadas preto da costa. En mapas maiores de 256 unidades, o valor escálase acorde ao tamaño do mapa. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Cota de neve: {STRING} -STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Controla a que altitude comeza a nevar en paisaxes subárticas. A neve afecta tamén á xeración industrial e aos requirimentos de crecemento dos pobos +STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Controla a que altitude comeza a nevar en paisaxes subárticas. A neve afecta tamén á xeración industrial e aos requirimentos de crecemento dos pobos. Só se pode modificar no Editor de Escenarios ou se non calcúlase a través da "cobertura de neve". +STR_CONFIG_SETTING_SNOW_COVERAGE :Cobertura de neve: {STRING} +STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Controla a cantidade aproximada de neve nas paisaxes subárticas. A neve afecta tamén á xeración industrial e aos requirimentos de crecemento dos pobos. Só se usa durante a xeración do mapa. O terreo xusto por enriba do nivel do mar nunca ten neve. +STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% +STR_CONFIG_SETTING_DESERT_COVERAGE :Cobertura do deserto: {STRING} +STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT :Controla a cantidade aproximada de deserto nas paisaxes tropicais. O Deserto tamén afecta a xeración industrial. Só se usa durante a xeración do mapa. +STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Desigualdade do terreo (só TerraGenesis) : {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(só TerraGenesis) Escolle a frequencia de montes: Suaviza as paisaxes tendo menos montes e máis espallados. Paisaxes escarpadas teñen moitos outos, que poderían semellar repetitivos @@ -1517,7 +1569,12 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Dobre clic STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Clic sinxelo (centrado) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Clic sinxelo (inmediatamente) +STR_CONFIG_SETTING_USE_RELAY_SERVICE :Utilizar servizo de relé: {STRING} +STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT :Se falla a creación dunha conexión o servidor, un pode usar o servizo relé para crear unha conexión. "Nunca" impide isto, "preguntar", preguntarache primeiro, "permitir" o permitirá sen preguntar. ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER :Nunca +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ASK :Preguntar +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :Permitir STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :Emulación do botón dereito: {STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :Selecciona o método para emular clics co botón dereito do rato @@ -1581,8 +1638,14 @@ STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Mante-las ferra STR_CONFIG_SETTING_EXPENSES_LAYOUT :Agrupa-los gastos na ventá de finanzas da compañía: {STRING} STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Define a apariencia da ventá de gastos da compañía +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :orrar automáticamente as sinais durante a construción de ferrocarrís: {STRING} +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :Borrar automáticamente as sinais durante a construción de ferrocarrís se as sinais están no medio. Teña en conta que isto pode levar a accidentes de tren. +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Límite de velocidade do avance rápido: {STRING} +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT :Limite o rápido que vai o xogo cando se activa o avance rápido. 0 = sen límite (tanto como permita o teu equipo). Os valores por debaixo do 100% ralentizan o xogo. O límite superior depende das especificacións do teu ordenador e pode variar dependendo do xogo. +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% velocidade normal de xogo ###setting-zero-is-special +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Sen límite (tan rápido como permita o teu equipo) STR_CONFIG_SETTING_SOUND_TICKER :Son coas novas: {STRING} STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Reproducir son para as mensaxes abreviadas de novas @@ -1681,6 +1744,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Amosa un xornal STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Amosa un xornal cando un accidente ou desastre ocurre +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidentes dos vehículos da competencia: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Amosa no xornal os accidentes de vehículos dos competidores STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Información da compañía: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Amosa un xornal cando unha nova compañía é creada, ou cando unha compañía está en risco de bancarrota @@ -1726,9 +1791,18 @@ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Data de aparici STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Ano no que os avisos dos xornais son impresos en cor. Antes deste ano, emprégase monocromo branco e negro STR_CONFIG_SETTING_STARTING_YEAR :Data de comezo: {STRING} +STR_CONFIG_SETTING_ENDING_YEAR :Ano da puntuación final: {STRING} +STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :O ano no que remate o xogo a efectos de puntiacións. Ao final deste ano, gárdase cal é a compañía con máis puntuación e amosase a pantalla de puntuacións, pero os xogadores poden seguir xogando despois disto.{}Se é anterior a data de inicio, a pantalla de puntuacións nunca se amosa. +STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM} ###setting-zero-is-special +STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Nunca +STR_CONFIG_SETTING_ECONOMY_TYPE :Tipo de economía: {STRING} +STR_CONFIG_SETTING_ECONOMY_TYPE_HELPTEXT :A economía suave fai cambios de produción máis a miúdo, e en pequenos pasos. As economías conxeladas paran os cambios de produción e as industrias pechan. Esta configuración non ten efecto se non se provén industrias por un NewGRF. ###length 3 +STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Orixinal +STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Suave +STR_CONFIG_SETTING_ECONOMY_TYPE_FROZEN :Conxelado STR_CONFIG_SETTING_ALLOW_SHARES :Permiti-la compra de accións de outras compañías: {STRING} STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Cando se activa, permite comprar ou vender accións da compañía. As accións só estarán dispoñíbeis para compañías que acaden certa idade @@ -1749,12 +1823,16 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Construír sina STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Selecciona o ano no que se comezan a empregar sinais eléctricos nas vías. Antes de este ano, empregaranse sinais mecánicos (que teñen exactamente a mesma función, pero distinta apariencia) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Circular polos tipos de sinais: {STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Selecciona os tipos de sinal polos que rodará o cursor ao facer Ctrl+clic +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Selecciona os tipos de sinal polos que rodará o cursor ao facer Ctrl+clic nunha construción coa ferramenta de sinal. ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Só sinais de ruta -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Todas +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :Todas visibles +STR_CONFIG_SETTING_SIGNAL_GUI_MODE :Amosar os tipos de sinais: {STRING} +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_HELPTEXT :Selecciona os tipos de sinais que se mostran na barra de ferramentas de sinais. ###length 2 +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :Só sinais de ruta +STR_CONFIG_SETTING_SIGNAL_GUI_MODE_ALL_CYCLE_PATH :Todos os sinais STR_CONFIG_SETTING_TOWN_LAYOUT :Distribución das estradas en novas cidades: {STRING} STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT :Distribución da rede de estradas de cidades @@ -1789,6 +1867,10 @@ STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Lineal STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Colocación de árbores durante a partida: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Controla a aparición aleatoria de árbores durante a partida. Isto pode afectar ás industrias que dependan do crecemento arbóreo, por exemplo o serradoiro ###length 4 +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Medra pero non se expande {RED}(Escaralla os aserradoiros) +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Medrar pero só expandirse en selvas +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Medrar e expandirse por todas partes +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_GROWTH_NO_SPREAD :Non medrar nin expandirse {RED}(Escaralla os aserradoiros) STR_CONFIG_SETTING_TOOLBAR_POS :Posición da barra de ferramentas principal: {STRING} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Posición horizontal da barra de ferramentas principal da parte superior da pantalla @@ -1817,8 +1899,12 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_2X :2x STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN :Resolución máis alta a usar nos sprites: {STRING} +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN_HELPTEXT :Limite a resolución máxima a usar nos sprites. Limitar a resolución dos sprites impide que se usen os gráficos de alta resolución incluso cando están dispoñibles. Isto axuda o xogo a manter unha apariencia unificada cando se usan distintos arquivos GRF con e sen gráficos de alta resolución. ###length 3 STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x +STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_NORMAL :1x STR_CONFIG_SETTING_TOWN_GROWTH :Velocidade de crecemento das cidades: {STRING} STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT :Velocidade de crecemento das cidades @@ -1872,6 +1958,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Cando unha velo STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_IMPERIAL :Imperial (mph) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :Métrico (km/h) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_SI :SI (m/s) +STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_GAMEUNITS :Unidades do xogo (cadros/día) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :Unidades de potencia dos vehículos: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :Cando a potencia dun vehículo se amose na interfaz de usuario, facelo nas unidades seleccionadas @@ -1931,6 +2018,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Industr STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}Distribución da carga STR_CONFIG_SETTING_AI :{ORANGE}Competidores STR_CONFIG_SETTING_AI_NPC :{ORANGE}Xogadores da computadora +STR_CONFIG_SETTING_NETWORK :{ORANGE}Rede STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :Buscador de ruta para trens: {STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :Buscador de ruta empregado polos trens @@ -1967,6 +2055,8 @@ STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}Memoria STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE} Fallo ao reservar {BYTES} de caché de sprites. A caché de sprites reduciuse a {BYTES}. Isto reducirá o rendemento de OpenTTD. Para reducir os requisitos de memoria podes tentar deshabilitar os gráficos 32bpp e/ou niveles de zoom # Video initalization errors +STR_VIDEO_DRIVER_ERROR :{WHITE}Error na configuración de vídeo... +STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... non se atopu unha GPU compatible. Deshabilitarase a aceleración por hardware. # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -2011,6 +2101,7 @@ STR_INTRO_TRANSLATION :{BLACK}A ista t # Quit window STR_QUIT_CAPTION :{WHITE}Saír +STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}Estás seguro de que queres saír de OpenTTD? STR_QUIT_YES :{BLACK}Si STR_QUIT_NO :{BLACK}Non @@ -2022,6 +2113,7 @@ STR_ABANDON_SCENARIO_QUERY :{YELLOW}Estás # Cheat window STR_CHEATS :{WHITE}Trampulladas STR_CHEATS_TOOLTIP :{BLACK}As caixas de confirmación indican se usaches esta trampa antes +STR_CHEATS_NOTE :{BLACK}Nota: o uso de calquera de estas opcións constará na partida gardada STR_CHEAT_MONEY :{LTBLUE}Incrementar os cartos en {CURRENCY_LONG} STR_CHEAT_CHANGE_COMPANY :{LTBLUE}Xogando coma compañía: {ORANGE}{COMMA} STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Escavadora máxica (elimina industrias, obxectos non eliminables): {ORANGE}{STRING} @@ -2137,6 +2229,8 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}Cambia-l # Matches ServerGameType ###length 3 STR_NETWORK_SERVER_VISIBILITY_LOCAL :Local +STR_NETWORK_SERVER_VISIBILITY_PUBLIC :Público +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :Só por invitación # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}Multixogador @@ -2167,12 +2261,15 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Paisaxe STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Tamaño do mapa: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Versión do servidor: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Dirección do servidor: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Código de convite: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Data de comezo: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Data actual: {WHITE}{DATE_SHORT} +STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script do xogo: {WHITE}{STRING} (v{NUM}) STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}Protexido con contrasinal! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}SERVIDOR DESCONECTADO STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}SERVIDOR CHEO STR_NETWORK_SERVER_LIST_SERVER_BANNED :{SILVER}O SERVIDOR PROHIBIUCHE O ACCESO +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}SERVIDOR MOI ANTIGO STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}VERSIÓN INCORRECTA STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}PROBLEMA CON NEWGRF @@ -2180,13 +2277,17 @@ STR_NETWORK_SERVER_LIST_JOIN_GAME :{BLACK}Unirse STR_NETWORK_SERVER_LIST_REFRESH :{BLACK}Actualizar servidor STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP :{BLACK}Actualiza-la información do servidor +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET :{BLACK}Buscar en internet STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP :{BLACK}Buscar servidores públicos en internet +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN :{BLACK}Buscar en LAN +STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP :{BLACK}Buscar servidores na rede local STR_NETWORK_SERVER_LIST_ADD_SERVER :{BLACK}Engadir servidor -STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Engade un servidor á lista que será comprobado sempre para buscar partidas. +STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP :{BLACK}Engade un servidor á lista. Isto pode ser unha dirección do servidor ou un código de convite. STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}Iniciar servidor STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}Comezar o teu propio servidor STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}Escribe o teu nome +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}Introduce a dirección do servidor ou o código de convite # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}Comezar nova partida multixogador @@ -2196,6 +2297,8 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}O nome d STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}Establecer contrasinal STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}Protexe a túa partida cun contrasinal se non queres ser accesible públicamente +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}Visibilidade +STR_NETWORK_START_SERVER_VISIBILITY_TOOLTIP :{BLACK}Controla se outra xente pode ver o teu servidor no listado público STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} cliente{P "" s} STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}Máximo de clientes: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}Escolle o máximo número de clientes. Non tódolos ocos teñen que estar cubertos @@ -2228,20 +2331,64 @@ STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}O servid STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}A compañía está protexida. Introduce o contrasinal # Network company list added strings -STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Lista de clientes +STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Xogadores en liña +STR_NETWORK_COMPANY_LIST_SPECTATE :Espectador # Network client list +STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}Xogadores en liña STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}Servidor +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}Nome +STR_NETWORK_CLIENT_LIST_SERVER_NAME_TOOLTIP :{BLACK}O Nome do servidor no que estás xogando +STR_NETWORK_CLIENT_LIST_SERVER_NAME_EDIT_TOOLTIP :{BLACK}Edita o nome do teu servidor +STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :Nome do servidor +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}Visibilidade +STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY_TOOLTIP :{BLACK}Controla se a xente pode ver o teu servidor no listado público STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE :{BLACK}Código de convite +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}Código de convite que poden usar outros xogadores para unirse a este servidor +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}Tipo de conexión +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TOOLTIP :{BLACK}Como e se outros poden conectarse o teu servidor +STR_NETWORK_CLIENT_LIST_PLAYER :{BLACK}Xogador +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}Nome +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP :{BLACK}O teu nome de xogador +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}Editar o teu nome de xogador +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :O teu nome de xogador +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Accións administrativas a executar neste cliente +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Accións administrativas a executar para esta compañía +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Unirse a esta compañía +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Envía unha mensaxe a este xogador +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Envía unha mensaxe a todos os xogadores desta compañía STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Enviar unha mensaxe a todos os espectadores +STR_NETWORK_CLIENT_LIST_SPECTATORS :Espectadores +STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Nova compañía) +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Crear unha nova compañía e unirte a ela +STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Este es ti STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Este é o anfitrión da partida +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} cliente{P "" s} / {NUM} compañía{P "" "s"} # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_UNKNOWN :{BLACK}Local +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}Os xogadores remotos non se poden conectar STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}Público +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_STUN :{BLACK}Detrás de NAT +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_TURN :{BLACK}Vía relé +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :Expulsar +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Expulsar permanentemente +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Eliminar +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Desbloquear contrasinal +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Acción administrativa +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}Estás seguro de que queres expulsar o xogador '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}Estás seguro de que queres expulsar permanentemente o xogador '{STRING}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}Estás seguro de querer borrar a compañía '{COMPANY}'? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}Estás seguro de querer restablecer o contrasinal da compañía '{COMPANY}'? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}Utilizar relé? +STR_NETWORK_ASK_RELAY_TEXT :{YELLOW}Fallou o establecemento da conexión entre ti e o servidor '{STRING}'.{}Gustaríache retransmitir esta sesión vía '{STRING}'? +STR_NETWORK_ASK_RELAY_NO :{BLACK}No +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Si, esta vez +STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Si, non volvas preguntar STR_NETWORK_SPECTATORS :Espectadores @@ -2270,28 +2417,33 @@ STR_NETWORK_CHAT_TO_COMPANY :[Equipo] A {STR STR_NETWORK_CHAT_CLIENT :[Privado] {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[Privado] A {STRING}: {WHITE}{STRING} STR_NETWORK_CHAT_ALL :[Todos] {STRING}: {WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Escribe o texto para a parola en rede # Network messages STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Non se atoparon dispositivos de rede -STR_NETWORK_ERROR_NOCONNECTION :{WHITE}O servidor non respondeu á solicitude +STR_NETWORK_ERROR_NOCONNECTION :{WHITE}O servidor non respondeu á solicitude ou foi rexeitada STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Non se pode conectar debido a un problema cos NewGRF STR_NETWORK_ERROR_DESYNC :{WHITE}Sincronización da partida en rede fallida STR_NETWORK_ERROR_LOSTCONNECTION :{WHITE}Perdeuse a conexión da partida en rede STR_NETWORK_ERROR_SAVEGAMEERROR :{WHITE}Non se pode carga-la partida STR_NETWORK_ERROR_SERVER_START :{WHITE}Non se puido inicia-lo servidor STR_NETWORK_ERROR_SERVER_ERROR :{WHITE}Detectouse un erro de protocolo e pechouse a conexión +STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Non se estableceu o teu nome de xogador. O nome pode establecerse na parte superior da fiestra de multixogador +STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Non se estableceu o nome do teu servidor. O nome pode establecerse na parte superior da fiestra de multixogador. STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}A revisión deste cliente non é igual ca revisión do servidor STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Contrasinal incorrecto STR_NETWORK_ERROR_SERVER_FULL :{WHITE}O servidor está cheo STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Non se che permite o acceso a este servidor STR_NETWORK_ERROR_KICKED :{WHITE}Chimpáronte da partida +STR_NETWORK_ERROR_KICK_MESSAGE :{WHITE}Motivo: {STRING} STR_NETWORK_ERROR_CHEATER :{WHITE}Non se permite facer trampas neste servidor STR_NETWORK_ERROR_TOO_MANY_COMMANDS :{WHITE}Estiveches mandando demasiados comandos ao servidor STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}Tardaches demasiado en introduci-lo contrasinal STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}A túa computadora é demasiado lenta para seguir a velocidade do servidor STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}A túa computadora tardou demasiado en descarga-lo mapa STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}A túa computadora tardou demasiado en unirse ao servidor +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}O teu nome de xogador non é válido STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}Posible perda da conexión STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}Nos últimos {NUM} segundo{P "" s} non chegaron datos do servidor @@ -2317,6 +2469,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :non recibiu nin STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :timeout xeral STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :a descarga do mapa tardou demasiado STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :o procesado do mapa tardou demasiado +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :nome de cliente inválido # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2327,11 +2480,13 @@ STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1 :Partida aínda STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2 :Partida aínda en pausa ({STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3 :Partida aínda en pausa ({STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_4 :Partida aínda en pausa ({STRING}, {STRING}, {STRING}, {STRING}) +STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_5 :Partida aínda en pausa ({STRING}, {STRING}, {STRING}, {STRING}, {STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED :Pausa rematada ({STRING}) STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS :número de xogadores STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS :conectando clientes STR_NETWORK_SERVER_MESSAGE_GAME_REASON_MANUAL :manual STR_NETWORK_SERVER_MESSAGE_GAME_REASON_GAME_SCRIPT :script do xogo +STR_NETWORK_SERVER_MESSAGE_GAME_REASON_LINK_GRAPH :agargando pola actualización do gráfico de ligazóns STR_NETWORK_MESSAGE_CLIENT_LEAVING :saíndo STR_NETWORK_MESSAGE_CLIENT_JOINED :*** {STRING} uniuse á partida @@ -2344,8 +2499,12 @@ STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} ca STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} deu {2:CURRENCY_LONG} a {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}O servidor pechou a sesión STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}O servidor estase a reiniciar...{}Agarda por favor... +STR_NETWORK_MESSAGE_KICKED :*** {STRING} foi expulsado. Motivo: ({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Fallou o rexistro do servidor STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}Outro servidor co mesmo código de convite rexistrouse a si mesmo. Cambiando o modo de xogo "local". +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}O teu servidor non permite conexións remotas +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Outros xogadores non se poderán conectar o teu servidor # Content downloading window STR_CONTENT_TITLE :{WHITE}Descargando contidos @@ -2422,6 +2581,9 @@ STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}OpenTTD STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Si, descarga os gráficos STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}Non, abandona OpenTTD +STR_MISSING_GRAPHICS_ERROR_TITLE :{WHITE}Descarga fallida +STR_MISSING_GRAPHICS_ERROR :{BLACK}A descarga dos gráficos fallou.{} Por favor, descargaos manualmente. +STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Saír de OpenTTD # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Opcións de Transparencia @@ -2465,6 +2627,7 @@ STR_JOIN_WAYPOINT_CAPTION :{WHITE}Unir pun STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT :{YELLOW}Constrúe un un punto de ruta separado # Generic toolbar +STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE :{BLACK}Deshabilitada xa que non hai vehículos dispoñibles actualmente para esta infraestrutura. # Rail construction toolbar STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION :Construción de Ferrocarrís @@ -2515,6 +2678,7 @@ STR_STATION_CLASS_WAYP :Puntos de ruta # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Selección de sinais +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Activa ou desactiva amosar os tipos de sinais avanzados STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Sinal de bloqueo (mecánico){}Este é o tipo máis básico de sinal, só permite un tren no mesmo cantón ao mesmo tempo. STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Sinal de entrada (mecánico){}Verde mentras haxa un ou máis sinais de saída verdes na seguinte sección de vía. Noutro caso estará vermella. STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Sinal de saída (mecánico){}Actúa igual que un sinal de bloqueo pero é necesaria para activar a cor correcta nas combinacións de sinal avanzado + sinal de entrada @@ -2600,7 +2764,7 @@ STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Constru STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Boia de posición, pódese empregar para marcar puntos de ruta adicionais. Shift alterna entre construír/amosar estimación de custo STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Construír acueduto. Shift alterna entre construír/amosar estimación de custo STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Define a área de auga.{}Fai unha canle, a non ser que manteñas pulsado CTRL ao nivel do mar, entón inundaranse os arredores do lugar -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Colocar ríos +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Colocar ríos. Premendo Crl podes facelos en diagonal. # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Orientación do depósito de barcos @@ -2660,6 +2824,12 @@ STR_TREES_RANDOM_TYPE :{BLACK}Árbores STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}Colocar árbores de tipo aleatorio. Shift alterna entre construír e amosa-lo custo estimado STR_TREES_RANDOM_TREES_BUTTON :{BLACK}Árbores aleatorias STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}Plantar árbores aleatoriamente sobre a paisaxe +STR_TREES_MODE_NORMAL_BUTTON :{BLACK}Normal +STR_TREES_MODE_NORMAL_TOOLTIP :{BLACK}Planta árbores individuais arrastrando sobre a paisaxe. +STR_TREES_MODE_FOREST_SM_BUTTON :{BLACK}Arboreda +STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}Planta pequenos bosques arrastrando sobre a paisaxe. +STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}Bosque +STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Plantar bosques arrastrando sobre a paisaxe. # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}Xeración de terreo @@ -2710,13 +2880,18 @@ STR_FOUND_TOWN_SELECT_LAYOUT_RANDOM :{BLACK}Aleatori # Fund new industry window STR_FUND_INDUSTRY_CAPTION :{WHITE}Financiar unha nova industria STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}Elixe a industria apropiada desta lista -STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :Moitas industrias aleatorias +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :{BLACK}Moitas industrias aleatorias STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}Cubri-lo mapa con industrias colocadas aleatoriamente +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_CAPTION :{WHITE}Crear industrias aleatorias STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_QUERY :{YELLOW}Estás seguro de que queres crear moitas industrias aleatorias? STR_FUND_INDUSTRY_INDUSTRY_BUILD_COST :{BLACK}Custo: {YELLOW}{CURRENCY_LONG} STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}Prospección STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}Construír STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}Financiar +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}Eliminar todas as industrias +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_TOOLTIP :{BLACK}Eliminar todas as industrias presentes no mapa +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_CAPTION :{WHITE}Eliminar todas as industrias +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :{YELLOW}Estás seguro de querer quitar todas as industrias? # Industry cargoes window STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION :{WHITE}Cadea de industrias para a industria {STRING} @@ -2737,6 +2912,7 @@ STR_INDUSTRY_CARGOES_SELECT_INDUSTRY_TOOLTIP :{BLACK}Seleccio # Land area window STR_LAND_AREA_INFORMATION_CAPTION :{WHITE}Información dunha área de terreo +STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Centrar a vista principal na localización do cadro. Ctrl+Click abre unha nova fiestra na localización do cadro STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A :{BLACK}Custo de limpar: {LTBLUE}N/D STR_LAND_AREA_INFORMATION_COST_TO_CLEAR :{BLACK}Custo de limpar: {RED}{CURRENCY_LONG} STR_LAND_AREA_INFORMATION_REVENUE_WHEN_CLEARED :{BLACK}Ingresos cando se borre: {LTBLUE}{CURRENCY_LONG} @@ -2944,6 +3120,8 @@ STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: STR_SAVELOAD_FILTER_TITLE :{BLACK}String de filtrado: STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}Sobrescribir arquivo STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}Estás seguro de que queres rescribir este arquivo? +STR_SAVELOAD_DIRECTORY :{STRING} (Directorio) +STR_SAVELOAD_PARENT_DIRECTORY :{STRING} (Directorio pai) STR_SAVELOAD_OSKTITLE :{BLACK}Escribe un nome para a partida @@ -2955,6 +3133,17 @@ STR_MAPGEN_BY :{BLACK}* STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Nº de cidades: STR_MAPGEN_DATE :{BLACK}Data: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}Nº de industrias: +STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Maior pico: +STR_MAPGEN_HEIGHTMAP_HEIGHT_UP :{BLACK}Aumentar a altitude máxima do pico máis alto do mapa nunha unidade. +STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN :{BLACK}Disminuir a altitude máxima do pico máis alto do mapa nunha unidade. +STR_MAPGEN_SNOW_COVERAGE :{BLACK}Cobertura de neve: +STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}Aumenta a cobertura de neve un dez por cento +STR_MAPGEN_SNOW_COVERAGE_DOWN :{BLACK}Disminuír a cobertura de neve un dez por cento. +STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% +STR_MAPGEN_DESERT_COVERAGE :{BLACK}Cobertura do deserto: +STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}Aumenta a cobertura do deserto un dez por cento +STR_MAPGEN_DESERT_COVERAGE_DOWN :{BLACK}Disminuír a cobertura do deserto un dez por cento. +STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_LAND_GENERATOR :{BLACK}Xerador de terreo: STR_MAPGEN_TERRAIN_TYPE :{BLACK}Tipo de terreo: STR_MAPGEN_QUANTITY_OF_SEA_LAKES :{BLACK}Nivel do mar: @@ -2980,6 +3169,10 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}Nome do STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}Tamaño: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} +STR_MAPGEN_TERRAIN_TYPE_QUERY_CAPT :{WHITE}Obxectivo de pico máis alto +STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT :{WHITE}Pico más alto +STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT :{WHITE}Cobertura de neve (en %) +STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}Cobertura de deserto (en %) STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}Cambia-lo ano de inicio # SE Map generation @@ -3118,6 +3311,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Coidado: { STR_NEWGRF_ERROR_MSG_ERROR :{RED}Erro: {SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}Erro fatal: {SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Ocorreu un erro fatal de NewGRF:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}Ocurriu un erro cun NewGRF:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} non funcionará coa versión de TTDPatch reportada por OpenTTD. STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} é para a versión {STRING} de TTD. STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} está deseñado para ser usado con {STRING} @@ -3196,6 +3390,7 @@ STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Activar # Sign window STR_EDIT_SIGN_CAPTION :{WHITE}Edita-lo texto do rótulo +STR_EDIT_SIGN_LOCATION_TOOLTIP :{BLACK}Centrar a vista principal na localización do sinal. Ctrl+Click abre unha nova ventá na localización do sinal. STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP :{BLACK}Ir ao seguinte rótulo STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP :{BLACK}Ir ao rótulo anterior @@ -3258,19 +3453,23 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Compra-los dere STR_LOCAL_AUTHORITY_ACTION_BRIBE :Suborna-la autoridade local ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Iniciar unha campaña de publicidade pequena, para atraer máis pasaxeiros e mercadorías aos teus servizos de transporte.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Iniciar unha campaña de publicidade mediana, para atraer máis pasaxeiros e mercadorías aos teus servizos de transporte.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Iniciar unha gran campaña de publicidade, para atraer máis pasaxeiros e mercadorías aos teus servizos de transporte.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financia-la reconstrución das rúas da cidade. Provoca unhas considerables interrupcións no tráfico durante seis meses.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construír unha estatua en honor á túa compañía.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW} Financia-la construción de novos edificios comerciais na cidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Compra-los dereitos exclusivos de transporte na cidade durante 1 ano. A autoridade só permitirá que os pasaxeiros e as mercadorías usen as estacións da túa compañía.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Iniciar unha campaña de publicidade pequena, para atraer máis pasaxeiros e mercadorías aos teus servizos de transporte.{}Concede un aumento temporal da puntuación da estación nun pequeno radio arredor do centro da localide.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Iniciar unha campaña de publicidade mediana, para atraer máis pasaxeiros e mercadorías aos teus servizos de transporte.{}Concede un aumento temporal da puntuación da estación nun radio medio arredor do centro da localide.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Iniciar unha gran campaña de publicidade, para atraer máis pasaxeiros e mercadorías aos teus servizos de transporte.{}Concede un aumento temporal da puntiación das túas estacións nun gran radio arredor do centro da localidade.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financiar a reconstrución das rúas da localidade.{}Provoca unhas considerables interrupcións no tráfico durante seis meses.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construír unha estatua en honor a túa compañía.{}Condede un aumento permanente da puntuación das túas estacións nesta localide.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW} Financiar a construción de novos edificios comerciais na cidade.{}Concede un aumento temporal do crecemento desta localide.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Comprar os dereitos exclusivos de transporte na cidade durante 1 ano.{}A autoridade só permitirá que os pasaxeiros e as mercadorías usen as estacións da túa compañía.{}Custo: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Suborna-la autoridade local para mellora-la túa puntuación, co risco dunha gran penalización se o descobren.{}Custo: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Obxectivos STR_GOALS_SPECTATOR_CAPTION :{WHITE}Obxectivos globais STR_GOALS_SPECTATOR :Obxectivos globais +STR_GOALS_GLOBAL_BUTTON :{BLACK}Global +STR_GOALS_GLOBAL_BUTTON_HELPTEXT :{BLACK}Amosar os obxectivos globais +STR_GOALS_COMPANY_BUTTON :{BLACK}Compañía +STR_GOALS_COMPANY_BUTTON_HELPTEXT :{BLACK}Amosar os obxectivos da compañía STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- Ningún - STR_GOALS_PROGRESS :{ORANGE}{STRING} @@ -3278,10 +3477,10 @@ STR_GOALS_PROGRESS_COMPLETE :{GREEN}{STRING} STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Pincha nun obxectivo para centra-la vista principal na industria/cidade/cadro. Ctrl+Click abre unha nova ventá na localización da industria/cidade/cadro # Goal question window -STR_GOAL_QUESTION_CAPTION_QUESTION :Pregunta -STR_GOAL_QUESTION_CAPTION_INFORMATION :Información -STR_GOAL_QUESTION_CAPTION_WARNING :Aviso -STR_GOAL_QUESTION_CAPTION_ERROR :Erro +STR_GOAL_QUESTION_CAPTION_QUESTION :{BLACK}Pregunta +STR_GOAL_QUESTION_CAPTION_INFORMATION :{BLACK}Información +STR_GOAL_QUESTION_CAPTION_WARNING :{BLACK}Aviso +STR_GOAL_QUESTION_CAPTION_ERROR :{YELLOW}Erro # Goal Question button list ###length 18 @@ -3472,6 +3671,8 @@ STR_COMPANY_VIEW_RELOCATE_HQ :{BLACK}Reposici STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS :{BLACK}Recontruí-la sede da compañía en calquera outro lugar cun custo do 1% do valor da compañía. Shift+click mostra o custo estimado sen reubica-la sede STR_COMPANY_VIEW_INFRASTRUCTURE_BUTTON :{BLACK}Detalles STR_COMPANY_VIEW_INFRASTRUCTURE_TOOLTIP :{BLACK}Ver contas detalladas de infraestrutura +STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}Dar cartos +STR_COMPANY_VIEW_GIVE_MONEY_TOOLTIP :{BLACK}Dar cartos a esta compañía STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}Nova cara STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}Selecciona-la nova cara do presidente @@ -3489,6 +3690,7 @@ STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Vender u STR_COMPANY_VIEW_COMPANY_NAME_QUERY_CAPTION :Nome da compañía STR_COMPANY_VIEW_PRESIDENT_S_NAME_QUERY_CAPTION :Nome do presidente +STR_COMPANY_VIEW_GIVE_MONEY_QUERY_CAPTION :Introduce a cantidade de cartos que queres dar STR_BUY_COMPANY_MESSAGE :{WHITE}Buscamos unha compañía de transportes para adquiri-la nosa compañía{}{}Queres mercar{COMPANY} por {CURRENCY_LONG}? @@ -3515,6 +3717,10 @@ STR_INDUSTRY_DIRECTORY_ITEM_PROD2 :{ORANGE}{INDUST STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} e {NUM} máis... STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Nomes das industrias - pincha nun nome para centrar a vista nela. Ctrl+Click abre una nova fiestra na situación da industria +STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Carga aceptada: {SILVER}{STRING} +STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Carga producida: {SILVER}{STRING} +STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :Tódolos tipos de carga +STR_INDUSTRY_DIRECTORY_FILTER_NONE :Ningún # Industry view STR_INDUSTRY_VIEW_CAPTION :{WHITE}{INDUSTRY} @@ -3591,7 +3797,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Pincha p STR_GROUP_DELETE_TOOLTIP :{BLACK}Borrar o grupo seleccionado STR_GROUP_RENAME_TOOLTIP :{BLACK}Renomear o grupo seleccionado STR_GROUP_LIVERY_TOOLTIP :{BLACK}Mudar o deseño do grupo seleccionado -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Pincha para protexer a este grupo da autosubstitución global +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Pincha para protexer a este grupo da autosubstitución global. Ctrl+Click para protexer tamén os subgrupos. STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Borrar Grupo STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Seguro que queres borrar este grupo e calquera descendente? @@ -3644,6 +3850,7 @@ STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Vagóns STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Reformábel a: {GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :Tódolos tipos de carga STR_PURCHASE_INFO_NONE :Ningún +STR_PURCHASE_INFO_ENGINES_ONLY :Só motores STR_PURCHASE_INFO_ALL_BUT :Todos excepto {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Esforzo máximo de tracción: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Autonomía: {GOLD}{COMMA} cadros @@ -3871,12 +4078,18 @@ STR_REPLACE_MAGLEV_VEHICLES :Vehículos magl STR_REPLACE_ROAD_VEHICLES :Vehículos de estrada STR_REPLACE_TRAM_VEHICLES :Tranvías +STR_REPLACE_REMOVE_WAGON :{BLACK}Eliminar os vagóns ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Facer que a autosubstitución manteña a lonxitude do tren quitando vagóns (empezando pola cabeza), se ao substituír a locomotora o tren se fixera máis longo. +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+Click para aplicalo tamen ós subgrupos. # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} ###length VEHICLE_TYPES +STR_VEHICLE_VIEW_TRAIN_CENTER_TOOLTIP :BLACK}Centrar a vista principal na localización do tren. Doble click o seguira na vista principal. Ctrl+Click abrirá unha nova fiestra na localización do tren. +STR_VEHICLE_VIEW_ROAD_VEHICLE_CENTER_TOOLTIP :{BLACK}Centrar a vista principal na localización do vehículo. Doble click o seguira na vista principal. Ctrl+Click abrirá unha nova fiestra na localización do vehículo. +STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Centrar a vista principal na localización do barco. Doble click o seguira na vista principal. Ctrl+Click abrirá unha nova fiestra na localización da embarcación. +STR_VEHICLE_VIEW_AIRCRAFT_CENTER_TOOLTIP :{BLACK}Centrar a vista principal na localización do avión. Doble click o seguira na vista principal. Ctrl+Click abrirá unha nova fiestra na localización do avión. ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_SEND_TO_DEPOT_TOOLTIP :{BLACK}Enviar tren ao depósito. Ctrl+click para facer só servizo @@ -3893,6 +4106,7 @@ STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Esto con STR_VEHICLE_VIEW_TRAIN_IGNORE_SIGNAL_TOOLTIP :{BLACK}Obligar ao tren a circular sen agardar a que o sinal o autorice STR_VEHICLE_VIEW_TRAIN_REVERSE_TOOLTIP :{BLACK}Inverti-la marcha do tren STR_VEHICLE_VIEW_ROAD_VEHICLE_REVERSE_TOOLTIP :{BLACK}Forzar ao vehículo a dar a volta +STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}Centrar a vista principal no destino da orde. Ctrl+Click abre unha nova ventá no destino da orde ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_REFIT_TOOLTIP :{BLACK}Modificar o tren para levar un tipo de carga diferente @@ -3913,6 +4127,10 @@ STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}Mostra-l STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Mostra-los detalles do avión ###length VEHICLE_TYPES +STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}Acción do tren actual - Click para parar/arrancar o tren +STR_VEHICLE_VIEW_ROAD_VEHICLE_STATUS_START_STOP_TOOLTIP :{BLACK}Acción do vehículo actual - Click para parar/arrancar o vehículo +STR_VEHICLE_VIEW_SHIP_STATE_STATUS_STOP_TOOLTIP :{BLACK}Acción do barco actual - Click para parar/arrancar o barco +STR_VEHICLE_VIEW_AIRCRAFT_STATUS_START_STOP_TOOLTIP :{BLACK}Acción do avión actual - Click para parar/arrancar o avión # Messages in the start stop button in the vehicle view STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}Cargando / Descargando @@ -3931,6 +4149,10 @@ STR_VEHICLE_STATUS_HEADING_FOR_WAYPOINT_VEL :{LTBLUE}Dirixí STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL :{ORANGE}Dirixíndose a {DEPOT}, {VELOCITY} STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL :{LTBLUE}Servizo en {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_STATION_VEL :{LTBLUE}Non pode chegar a {STATION}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_WAYPOINT_VEL :{LTBLUE}Non pode chegar a {WAYPOINT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_VEL :{ORANGE}Non pode chegar a {DEPOT}, {VELOCITY} +STR_VEHICLE_STATUS_CANNOT_REACH_DEPOT_SERVICE_VEL :{LTBLUE}Non pode chegar a {DEPOT}, {VELOCITY} # Vehicle stopped/started animations ###length 2 @@ -4152,6 +4374,7 @@ STR_ORDER_REFIT_STOP_ORDER :(Reaxustar a {S STR_ORDER_STOP_ORDER :(Parar) STR_ORDER_GO_TO_STATION :{STRING} {STATION} {STRING} +STR_ORDER_GO_TO_STATION_CAN_T_USE_STATION :{PUSH_COLOUR}{RED}(Non pode usar a estación){POP_COLOUR} {STRING} {STATION} {STRING} STR_ORDER_IMPLICIT :(Implícito) @@ -4331,6 +4554,13 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}Seleccio STR_AI_LIST_CANCEL :{BLACK}Cancelar STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}Non cambia-lo script +STR_SCREENSHOT_CAPTION :{WHITE}Tomar unha captura de pantalla +STR_SCREENSHOT_SCREENSHOT :{BLACK}Captura de pantalla normal +STR_SCREENSHOT_ZOOMIN_SCREENSHOT :{BLACK}Captura de pantalla co zoom o máximo. +STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT :{BLACK}Captura de pantalla co zoom por defecto +STR_SCREENSHOT_WORLD_SCREENSHOT :{BLACK}Captura de pantalla de todo o mapa +STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Captura de pantalla do mapa de alturas +STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Captura de pantalla do minimapa # AI Parameters STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Parámetros @@ -4391,6 +4621,7 @@ STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :A partida gravo STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE :Arquivo ilexíbel STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE :Non se pode escribir no arquivo STR_GAME_SAVELOAD_ERROR_DATA_INTEGRITY_CHECK_FAILED :Fallou a comprobación de integridade dos datos +STR_GAME_SAVELOAD_ERROR_PATCHPACK :A Partida fíxose cunha versión modificada STR_GAME_SAVELOAD_NOT_AVAILABLE : STR_WARNING_LOADGAME_REMOVED_TRAMS :{WHITE}A partida gravouse nunha versión sen soporte para tranvías. Quitáronse tódolos tranvías. @@ -4418,6 +4649,7 @@ STR_WARNING_FALLBACK_SOUNDSET :{WHITE}Só se a STR_WARNING_SCREENSHOT_SIZE_CAPTION :{WHITE}Captura de pantalla enorme STR_WARNING_SCREENSHOT_SIZE_MESSAGE :{YELLOW}A captura de pantalla terá unha resolución de {COMMA} x {COMMA} píxeis. Tomar a captura poderá levar un anaco. Queres continuar? +STR_MESSAGE_HEIGHTMAP_SUCCESSFULLY :{WHITE}Gardouse a altitude do mapa como '{STRING}'. O pico máis alto é {NUM} STR_MESSAGE_SCREENSHOT_SUCCESSFULLY :{WHITE}Captura de pantalla gardada con éxito coma '{STRING}' STR_ERROR_SCREENSHOT_FAILED :{WHITE}Captura de pantalla fallida! @@ -4471,6 +4703,7 @@ STR_ERROR_LOAN_ALREADY_REPAYED :{WHITE}... non STR_ERROR_CURRENCY_REQUIRED :{WHITE}... precisas {CURRENCY_LONG} STR_ERROR_CAN_T_REPAY_LOAN :{WHITE}Non se pode devolve-lo préstamo... STR_ERROR_INSUFFICIENT_FUNDS :{WHITE}Non podes da-lo diñeiro prestado polo banco... +STR_ERROR_CAN_T_GIVE_MONEY :{WHITE}Non se poden dar cartos a esta compañía... STR_ERROR_CAN_T_BUY_COMPANY :{WHITE}Non se pode compra-la compañía... STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS :{WHITE}Non se pode construí-la sede STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS :{WHITE}Non se pode comprar un 25% das accións desta compañía... @@ -4597,6 +4830,8 @@ STR_ERROR_DEPOT_WRONG_DEPOT_TYPE :Tipo de depósi STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE} é demasiado longo despois do reemprazo STR_ERROR_AUTOREPLACE_NOTHING_TO_DO :{WHITE}Non se aplicaron as regras de autosubstitución/renovación STR_ERROR_AUTOREPLACE_MONEY_LIMIT :(límite de cartos) +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_CARGO :{WHITE}O novo vehículo non pode levar {STRING} +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_REFIT :{WHITE}O Novo vehículo non pode reformarse na orde {NUM} # Rail construction errors STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION :{WHITE}Combinación de vías imposíbel @@ -4890,10 +5125,10 @@ STR_INDUSTRY_NAME_SUGAR_MINE :Mina de azucre ##id 0x6000 STR_SV_EMPTY : STR_SV_UNNAMED :Sen nome -STR_SV_TRAIN_NAME :Tren {COMMA} -STR_SV_ROAD_VEHICLE_NAME :Vehículo de estrada {COMMA} -STR_SV_SHIP_NAME :Barco {COMMA} -STR_SV_AIRCRAFT_NAME :Aeronave {COMMA} +STR_SV_TRAIN_NAME :Tren #{COMMA} +STR_SV_ROAD_VEHICLE_NAME :Vehículo de estrada #{COMMA} +STR_SV_SHIP_NAME :Barco #{COMMA} +STR_SV_AIRCRAFT_NAME :Aeronave #{COMMA} ###length 27 STR_SV_STNAME :{STRING} @@ -5202,6 +5437,7 @@ STR_FORMAT_DATE_ISO :{2:NUM}-{1:STRI STR_FORMAT_COMPANY_NUM :(Compañía {COMMA}) STR_FORMAT_GROUP_NAME :Grupo {COMMA} +STR_FORMAT_GROUP_VEHICLE_NAME :{GROUP} #{COMMA} STR_FORMAT_INDUSTRY_NAME :{TOWN}: {STRING} ###length 2 diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index f2628aa05c..af5fe37acd 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -1743,6 +1743,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Tampilkan koran STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Kecelakaan / bencana: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Tampilkan berita saat ada kecelakaan atau bencana +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Kecelakaan pada moda transportasi kompetitor: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Tampilkan surat kabar jika kompetitor mengalami kecelakaan STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informasi Perusahaan: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Tampilkan koran saat ada perusahaan yang baru berdiri, atau jika ada perusahaan yang akan bangkrut @@ -3866,9 +3868,9 @@ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Beli Kap STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Beli Pesawat ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli lalu karoseri kendaraan -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli lalu karoseri kendaraan -STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli lalu karoseri kapal yang dipilih +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli dan restorasi kendaraan +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli dan restorasi kendaraan +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli dan restorasi kapal yang dipilih STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Beli dan ubah kargo pesawat ###length VEHICLE_TYPES @@ -3879,9 +3881,9 @@ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Beli pes ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli lalu karoseri kereta yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya tanpa membelinya -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli lalu karoseri kendaraan yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya tanpa membelinya -STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli lalu karoseri kapal yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya tanpa membelinya -STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli lalu karoseri Pesawat yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya tanpa membelinya +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli dan restorasi kendaraan yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya pembelian +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli dan restorasi kapal yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya pembelian +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Beli dan restorasi pesawat yang dipilih. Shift+Klik untuk menampilkan perkiraan biaya pembelian ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Ubah Nama diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 4af060379d..8300736058 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -902,7 +902,7 @@ STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLAC STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}Se ofrece subvención:{}{}¡Al primer servicio de {STRING} que cubra la línea desde {STRING} a {STRING} se le otorgará una subvención durante {NUM} año{P "" s} por parte de las autoridades locales! ###length 4 STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}¡Subvención otorgada a {STRING}!{}{}¡El servicio de {STRING} desde {STRING} a {STRING} se pagará un 50% más caro durante {NUM} año{P "" s}! -STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}¡Subvención otorgada a {STRING}!{}{}¡El servicio de {STRING} desde {STRING} a {STRING} se pagará a tarifa doble durante los próximos {NUM} año{P "" s}! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}¡Subvención otorgada a {STRING}!{}{}¡El transporte de {STRING} desde {STRING} a {STRING} se pagará a tarifa doble durante los próximos {NUM} año{P "" s}! STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}¡Subvención otorgada a {STRING}!{}{}¡El servicio de {STRING} desde {STRING} a {STRING} se pagará a tarifa triple durante {NUM} año{P "" s}! STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}¡Subvención otorgada a {STRING}!{}{}¡El servicio de {STRING} desde {STRING} a {STRING} se pagará a tarifa cuádruple durante {NUM} año{P "" s}! @@ -1744,6 +1744,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Mostrar una not STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidentes / desastres: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Mostrar noticias cuando ocurre un accidente o un desastre +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidentes de vehículos de competidores: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Muestra una noticia sobre los vehículos siniestrados de los competidores STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Información de la empresa: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Mostrar una noticia cuando se crea una nueva compañía, o cuando alguna compañía está en riesgo de quiebra @@ -2353,9 +2355,9 @@ STR_NETWORK_CLIENT_LIST_PLAYER_NAME_QUERY_CAPTION :Tu nombre de ju STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_TOOLTIP :{BLACK}Acciones de administrador a realizar para este cliente STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_TOOLTIP :{BLACK}Acciones de administrador a realizar para esta empresa STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}Unirse a esta empresa -STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Manda un mensaje a este jugador -STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Manda un mensaje a todos los jugadores de esta empresa -STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Manda un mensaje a todos los observadores +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}Envía un mensaje a este jugador +STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOOLTIP :{BLACK}Envía un mensaje a todos los jugadores de esta empresa +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}Envía un mensaje a todos los observadores STR_NETWORK_CLIENT_LIST_SPECTATORS :Observadores STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(Nueva empresa) STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Crea una nueva empresa y te une a ella @@ -2676,6 +2678,7 @@ STR_STATION_CLASS_WAYP :Puntos de ruta # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Selección de Señales +STR_BUILD_SIGNAL_TOGGLE_ADVANCED_SIGNAL_TOOLTIP :{BLACK}Muestra/Oculta las imágenes avanzadas STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}Señal de bloque (mecánica){}Es el tipo de señal más básico, que permite a un único tren estar a la vez en el mismo bloque STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}Señal de entrada (mecánica){}En verde si existen una o más señales en verde en el siguiente segmento de vía; de lo contrario, estará en rojo STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}Señal de salida (mecánica){}Se comporta de la misma manera que una señal de bloque, pero es necesaria para activar el color correcto en las señales de entrada y combo From 802ca4e72231895e9f043a7b380c59dfbba366cd Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 28 Nov 2021 07:16:42 -0700 Subject: [PATCH 095/710] Fix: Don't try to rename OWNER_DEITY signs in-game (#9716) --- src/signs.cpp | 12 ++++++++++++ src/signs_cmd.cpp | 2 +- src/signs_func.h | 1 + src/signs_gui.cpp | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/signs.cpp b/src/signs.cpp index 3e0e7a7a33..0f1d7a78f0 100644 --- a/src/signs.cpp +++ b/src/signs.cpp @@ -9,6 +9,7 @@ #include "stdafx.h" #include "landscape.h" +#include "company_func.h" #include "signs_base.h" #include "signs_func.h" #include "strings_func.h" @@ -61,3 +62,14 @@ void UpdateAllSignVirtCoords() si->UpdateVirtCoord(); } } + +/** + * Check if the current company can rename a given sign. + * @param *si The sign in question. + * @return true if the sign can be renamed, else false. + */ +bool CompanyCanRenameSign(const Sign *si) +{ + if (si->owner == OWNER_DEITY && _current_company != OWNER_DEITY && _game_mode != GM_EDITOR) return false; + return true; +} diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 0dd821157e..78bbb8b4b5 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -79,7 +79,7 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 { Sign *si = Sign::GetIfValid(p1); if (si == nullptr) return CMD_ERROR; - if (si->owner == OWNER_DEITY && _current_company != OWNER_DEITY && _game_mode != GM_EDITOR) return CMD_ERROR; + if (!CompanyCanRenameSign(si)) return CMD_ERROR; /* Rename the signs when empty, otherwise remove it */ if (!text.empty()) { diff --git a/src/signs_func.h b/src/signs_func.h index 55e831fdca..af677201c1 100644 --- a/src/signs_func.h +++ b/src/signs_func.h @@ -18,6 +18,7 @@ extern SignID _new_sign_id; void UpdateAllSignVirtCoords(); void PlaceProc_Sign(TileIndex tile); +bool CompanyCanRenameSign(const Sign *si); /* signs_gui.cpp */ void ShowRenameSignWindow(const Sign *si); diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 0240a6a257..5169064625 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -565,10 +565,14 @@ static WindowDesc _query_sign_edit_desc( */ void HandleClickOnSign(const Sign *si) { + /* If we can't rename the sign, don't even open the rename GUI. */ + if (!CompanyCanRenameSign(si)) return; + if (_ctrl_pressed && (si->owner == _local_company || (si->owner == OWNER_DEITY && _game_mode == GM_EDITOR))) { RenameSign(si->index, ""); return; } + ShowRenameSignWindow(si); } From 9c36c12c85ede5a187263d3dda1ed067a6875852 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 4 Dec 2021 18:32:06 +0100 Subject: [PATCH 096/710] Codechange: ensure OnConnect() always gets called with a valid socket (#9729) This should already be the case, but now assert()s will tell us if this isn't. --- src/network/core/tcp.cpp | 2 ++ src/network/core/tcp_connect.cpp | 2 ++ src/network/network_coordinator.cpp | 2 ++ src/network/network_turn.cpp | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp index a2e31b53d2..3dc2a3fac8 100644 --- a/src/network/core/tcp.cpp +++ b/src/network/core/tcp.cpp @@ -217,6 +217,8 @@ Packet *NetworkTCPSocketHandler::ReceivePacket() */ bool NetworkTCPSocketHandler::CanSendReceive() { + assert(this->sock != INVALID_SOCKET); + fd_set read_fd, write_fd; struct timeval tv; diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index 73c6aa90d3..f9c40c2026 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -451,6 +451,8 @@ bool TCPServerConnecter::CheckActivity() */ void TCPServerConnecter::SetConnected(SOCKET sock) { + assert(sock != INVALID_SOCKET); + this->socket = sock; this->status = Status::CONNECTED; } diff --git a/src/network/network_coordinator.cpp b/src/network/network_coordinator.cpp index c3fa2b5ce5..a52ac638ea 100644 --- a/src/network/network_coordinator.cpp +++ b/src/network/network_coordinator.cpp @@ -566,6 +566,8 @@ void ClientNetworkCoordinatorSocketHandler::ConnectFailure(const std::string &to */ void ClientNetworkCoordinatorSocketHandler::ConnectSuccess(const std::string &token, SOCKET sock, NetworkAddress &address) { + assert(sock != INVALID_SOCKET); + /* Connecter will destroy itself. */ this->game_connecter = nullptr; diff --git a/src/network/network_turn.cpp b/src/network/network_turn.cpp index ae82f3094d..bfc4919e59 100644 --- a/src/network/network_turn.cpp +++ b/src/network/network_turn.cpp @@ -41,7 +41,7 @@ public: { this->handler->connecter = nullptr; - handler->sock = s; + this->handler->sock = s; } }; From ea4f6bb8b2a4e1298d1166febaaeebb3c9e583ed Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 4 Dec 2021 20:56:05 +0100 Subject: [PATCH 097/710] Fix #9730: [Network] connections can use an invalid socket due to a race condition A race condition happens when an IPv6 connection takes more than 250ms to report an error, but does return before the IPv4 connection is established. In result, an invalid socket might be used for that connection. --- src/network/core/tcp_connect.cpp | 37 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index f9c40c2026..8ef41ebf00 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -363,7 +363,10 @@ bool TCPConnecter::CheckActivity() return true; } - /* Check for errors on any of the sockets. */ + /* If a socket is writeable, it is either in error-state or connected. + * Remove all sockets that are in error-state and mark the first that is + * not in error-state as the socket we will use for our connection. */ + SOCKET connected_socket = INVALID_SOCKET; for (auto it = this->sockets.begin(); it != this->sockets.end(); /* nothing */) { NetworkError socket_error = GetSocketError(*it); if (socket_error.HasError()) { @@ -371,34 +374,28 @@ bool TCPConnecter::CheckActivity() closesocket(*it); this->sock_to_address.erase(*it); it = this->sockets.erase(it); - } else { - it++; + continue; } - } - /* In case all sockets had an error, queue a new one. */ - if (this->sockets.empty()) { - if (!this->TryNextAddress()) { - /* There were no more addresses to try, so we failed. */ - this->OnFailure(); - return true; - } - return false; - } - - /* At least one socket is connected. The first one that does is the one - * we will be using, and we close all other sockets. */ - SOCKET connected_socket = INVALID_SOCKET; - for (auto it = this->sockets.begin(); it != this->sockets.end(); /* nothing */) { + /* No error but writeable means connected. */ if (connected_socket == INVALID_SOCKET && FD_ISSET(*it, &write_fd)) { connected_socket = *it; - } else { + } + + it++; + } + + /* All the writable sockets were in error state. So nothing is connected yet. */ + if (connected_socket == INVALID_SOCKET) return false; + + /* Close all sockets except the one we picked for our connection. */ + for (auto it = this->sockets.begin(); it != this->sockets.end(); /* nothing */) { + if (connected_socket != *it) { closesocket(*it); } this->sock_to_address.erase(*it); it = this->sockets.erase(it); } - assert(connected_socket != INVALID_SOCKET); Debug(net, 3, "Connected to {}", this->connection_string); if (_debug_net_level >= 5) { From ad89601c49bc5f4e996d2afea58db17fb1b01324 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 5 Dec 2021 16:15:27 +0100 Subject: [PATCH 098/710] Codechange: do not use all upper case enumerators in a scoped enum --- src/industry_gui.cpp | 16 ++++++++-------- src/network/core/tcp.h | 12 ++++++------ src/network/core/tcp_connect.cpp | 28 ++++++++++++++-------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 1b63191f39..bfdb308b66 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1324,10 +1324,10 @@ protected: static CargoID produced_cargo_filter; enum class SorterType : uint8 { - IDW_SORT_BY_NAME, ///< Sorter type to sort by name - IDW_SORT_BY_TYPE, ///< Sorter type to sort by type - IDW_SORT_BY_PRODUCTION, ///< Sorter type to sort by production amount - IDW_SORT_BY_TRANSPORTED, ///< Sorter type to sort by transported percentage + ByName, ///< Sorter type to sort by name + ByType, ///< Sorter type to sort by type + ByProduction, ///< Sorter type to sort by production amount + ByTransported, ///< Sorter type to sort by transported percentage }; /** @@ -1552,9 +1552,9 @@ protected: } switch (static_cast(this->industries.SortType())) { - case IndustryDirectoryWindow::SorterType::IDW_SORT_BY_NAME: - case IndustryDirectoryWindow::SorterType::IDW_SORT_BY_TYPE: - case IndustryDirectoryWindow::SorterType::IDW_SORT_BY_PRODUCTION: + case IndustryDirectoryWindow::SorterType::ByName: + case IndustryDirectoryWindow::SorterType::ByType: + case IndustryDirectoryWindow::SorterType::ByProduction: /* Sort by descending production, then descending transported */ std::sort(cargos.begin(), cargos.end(), [](const CargoInfo &a, const CargoInfo &b) { if (a.production != b.production) return a.production > b.production; @@ -1562,7 +1562,7 @@ protected: }); break; - case IndustryDirectoryWindow::SorterType::IDW_SORT_BY_TRANSPORTED: + case IndustryDirectoryWindow::SorterType::ByTransported: /* Sort by descending transported, then descending production */ std::sort(cargos.begin(), cargos.end(), [](const CargoInfo &a, const CargoInfo &b) { if (a.transported != b.transported) return a.transported > b.transported; diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index 52d9cfddb3..7bce8f6c0a 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -78,15 +78,15 @@ private: * lock on the game-state. */ enum class Status { - INIT, ///< TCPConnecter is created but resolving hasn't started. - RESOLVING, ///< The hostname is being resolved (threaded). - FAILURE, ///< Resolving failed. - CONNECTING, ///< We are currently connecting. - CONNECTED, ///< The connection is established. + Init, ///< TCPConnecter is created but resolving hasn't started. + Resolving, ///< The hostname is being resolved (threaded). + Failure, ///< Resolving failed. + Connecting, ///< We are currently connecting. + Connected, ///< The connection is established. }; std::thread resolve_thread; ///< Thread used during resolving. - std::atomic status = Status::INIT; ///< The current status of the connecter. + std::atomic status = Status::Init; ///< The current status of the connecter. std::atomic killed = false; ///< Whether this connecter is marked as killed. addrinfo *ai = nullptr; ///< getaddrinfo() allocated linked-list of resolved addresses. diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index 8ef41ebf00..a9cc77934e 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -52,7 +52,7 @@ TCPServerConnecter::TCPServerConnecter(const std::string &connection_string, uin break; case SERVER_ADDRESS_INVITE_CODE: - this->status = Status::CONNECTING; + this->status = Status::Connecting; _network_coordinator_client.ConnectToServer(this->server_address.connection_string, this); break; @@ -254,14 +254,14 @@ void TCPConnecter::Resolve() if (error != 0) { Debug(net, 0, "Failed to resolve DNS for {}", this->connection_string); - this->status = Status::FAILURE; + this->status = Status::Failure; return; } this->ai = ai; this->OnResolved(ai); - this->status = Status::CONNECTING; + this->status = Status::Connecting; } /** @@ -281,11 +281,11 @@ bool TCPConnecter::CheckActivity() if (this->killed) return true; switch (this->status) { - case Status::INIT: + case Status::Init: /* Start the thread delayed, so the vtable is loaded. This allows classes * to overload functions used by Resolve() (in case threading is disabled). */ if (StartNewThread(&this->resolve_thread, "ottd:resolve", &TCPConnecter::ResolveThunk, this)) { - this->status = Status::RESOLVING; + this->status = Status::Resolving; return false; } @@ -296,18 +296,18 @@ bool TCPConnecter::CheckActivity() * connection. The rest of this function handles exactly that. */ break; - case Status::RESOLVING: + case Status::Resolving: /* Wait till Resolve() comes back with an answer (in case it runs threaded). */ return false; - case Status::FAILURE: + case Status::Failure: /* Ensure the OnFailure() is called from the game-thread instead of the * resolve-thread, as otherwise we can get into some threading issues. */ this->OnFailure(); return true; - case Status::CONNECTING: - case Status::CONNECTED: + case Status::Connecting: + case Status::Connected: break; } @@ -403,7 +403,7 @@ bool TCPConnecter::CheckActivity() } this->OnConnect(connected_socket); - this->status = Status::CONNECTED; + this->status = Status::Connected; return true; } @@ -422,11 +422,11 @@ bool TCPServerConnecter::CheckActivity() case SERVER_ADDRESS_INVITE_CODE: /* Check if a result has come in. */ switch (this->status) { - case Status::FAILURE: + case Status::Failure: this->OnFailure(); return true; - case Status::CONNECTED: + case Status::Connected: this->OnConnect(this->socket); return true; @@ -451,7 +451,7 @@ void TCPServerConnecter::SetConnected(SOCKET sock) assert(sock != INVALID_SOCKET); this->socket = sock; - this->status = Status::CONNECTED; + this->status = Status::Connected; } /** @@ -459,7 +459,7 @@ void TCPServerConnecter::SetConnected(SOCKET sock) */ void TCPServerConnecter::SetFailure() { - this->status = Status::FAILURE; + this->status = Status::Failure; } /** From 762b656b53680f64a1d48d8c17d18570ed7b82b1 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 10 Dec 2021 01:12:04 +0000 Subject: [PATCH 099/710] Fix #9740: Fix loading of gamelog change items from savegame ver >= 294 --- src/saveload/gamelog_sl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/saveload/gamelog_sl.cpp b/src/saveload/gamelog_sl.cpp index 89db17424c..72d3f3d852 100644 --- a/src/saveload/gamelog_sl.cpp +++ b/src/saveload/gamelog_sl.cpp @@ -328,6 +328,7 @@ public: size_t length = SlGetStructListLength(UINT32_MAX); la->change = ReallocT(la->change, length); + la->changes = (uint32)length; for (size_t i = 0; i < length; i++) { LoggedChange *lc = &la->change[i]; From bc22e9333e838c73ce27eff6db7a812fab93e638 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 12 Dec 2021 17:35:41 +0100 Subject: [PATCH 100/710] Fix: if vehicles only refit to cargo-slots >= 32, the default cargo was wrong. (#9744) --- src/core/bitmath_func.cpp | 15 ++++++++------- src/core/bitmath_func.hpp | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/bitmath_func.cpp b/src/core/bitmath_func.cpp index 803eb9e1ca..206c04e54b 100644 --- a/src/core/bitmath_func.cpp +++ b/src/core/bitmath_func.cpp @@ -24,7 +24,7 @@ const uint8 _ffb_64[64] = { }; /** - * Search the first set bit in a 32 bit variable. + * Search the first set bit in a 64 bit variable. * * This algorithm is a static implementation of a log * congruence search algorithm. It checks the first half @@ -34,7 +34,7 @@ const uint8 _ffb_64[64] = { * @param x The value to search * @return The position of the first bit set */ -uint8 FindFirstBit(uint32 x) +uint8 FindFirstBit(uint64 x) { if (x == 0) return 0; /* The macro FIND_FIRST_BIT is better to use when your x is @@ -42,11 +42,12 @@ uint8 FindFirstBit(uint32 x) uint8 pos = 0; - if ((x & 0x0000ffff) == 0) { x >>= 16; pos += 16; } - if ((x & 0x000000ff) == 0) { x >>= 8; pos += 8; } - if ((x & 0x0000000f) == 0) { x >>= 4; pos += 4; } - if ((x & 0x00000003) == 0) { x >>= 2; pos += 2; } - if ((x & 0x00000001) == 0) { pos += 1; } + if ((x & 0xffffffffULL) == 0) { x >>= 32; pos += 32; } + if ((x & 0x0000ffffULL) == 0) { x >>= 16; pos += 16; } + if ((x & 0x000000ffULL) == 0) { x >>= 8; pos += 8; } + if ((x & 0x0000000fULL) == 0) { x >>= 4; pos += 4; } + if ((x & 0x00000003ULL) == 0) { x >>= 2; pos += 2; } + if ((x & 0x00000001ULL) == 0) { pos += 1; } return pos; } diff --git a/src/core/bitmath_func.hpp b/src/core/bitmath_func.hpp index be0d8cd54d..979d9b73b7 100644 --- a/src/core/bitmath_func.hpp +++ b/src/core/bitmath_func.hpp @@ -222,7 +222,7 @@ static inline uint8 FindFirstBit2x64(const int value) } } -uint8 FindFirstBit(uint32 x); +uint8 FindFirstBit(uint64 x); uint8 FindLastBit(uint64 x); /** From 0c90326adae7d5b7be9e799fd73fb4765b49741e Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 14 Dec 2021 18:49:17 +0000 Subject: [PATCH 101/710] Update: Translations from eints swedish: 1 change by joeax910 chinese (traditional): 160 changes by Tetrapod1206 galician: 21 changes by pvillaverde irish: 5 changes by temuchie polish: 2 changes by pAter-exe --- src/lang/galician.txt | 42 ++++---- src/lang/irish.txt | 8 +- src/lang/polish.txt | 2 + src/lang/swedish.txt | 1 + src/lang/traditional_chinese.txt | 170 +++++++++++++++++++++++++++++-- 5 files changed, 189 insertions(+), 34 deletions(-) diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 5429f5e640..c5817d0f47 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -138,7 +138,7 @@ STR_ABBREV_GOODS :{TINY_FONT}ME STR_ABBREV_GRAIN :{TINY_FONT}GR STR_ABBREV_WOOD :{TINY_FONT}MA STR_ABBREV_IRON_ORE :{TINY_FONT}FE -STR_ABBREV_STEEL :{TINY_FONT}AC +STR_ABBREV_STEEL :{TINY_FONT}AÇ STR_ABBREV_VALUABLES :{TINY_FONT}VA STR_ABBREV_COPPER_ORE :{TINY_FONT}CO STR_ABBREV_MAIZE :{TINY_FONT}MI @@ -845,7 +845,7 @@ STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLAC STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}Nova {STRING} asentada preto de {TOWN}! STR_NEWS_INDUSTRY_CLOSURE_GENERAL :{BIG_FONT}{BLACK}{STRING} anuncia o seu peche inminente! -STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS :{BIG_FONT}{BLACK}Problemas de subministración en {STRING} provocan que anuncie o seu peche inminente! +STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS :{BIG_FONT}{BLACK}Problemas de abastecemento en {STRING} provocan que anuncie o seu peche inminente! STR_NEWS_INDUSTRY_CLOSURE_LACK_OF_TREES :{BIG_FONT}{BLACK}A falta de árbores cercanos provoca que {STRING} anuncie o peche inminente! STR_NEWS_EURO_INTRODUCTION :{BIG_FONT}{BLACK}Unión Económica e Monetaria Europea!{}{}O Euro introdúcese como a única moeda para as transaccións diarias no teu país! @@ -2617,7 +2617,7 @@ STR_STATION_BUILD_COVERAGE_ON :{BLACK}On STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP :{BLACK}Non resalta-la área de cobertura do sitio proposto STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP :{BLACK}Resalta-la área de cobertura do sitio proposto STR_STATION_BUILD_ACCEPTS_CARGO :{BLACK}Acepta: {GOLD}{CARGO_LIST} -STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Suministros: {GOLD}{CARGO_LIST} +STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Abastecementos: {GOLD}{CARGO_LIST} # Join station window STR_JOIN_STATION_CAPTION :{WHITE}Unir estación @@ -3550,7 +3550,7 @@ STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPAN STR_STATION_VIEW_RATINGS_BUTTON :{BLACK}Puntuacións: STR_STATION_VIEW_RATINGS_TOOLTIP :{BLACK}Mostra-las puntuacións da estación -STR_STATION_VIEW_SUPPLY_RATINGS_TITLE :{BLACK}Suministro mensual e puntuación local: +STR_STATION_VIEW_SUPPLY_RATINGS_TITLE :{BLACK}Abastecemento mensual e puntuación local: STR_STATION_VIEW_CARGO_SUPPLY_RATING :{WHITE}{STRING}: {YELLOW}{COMMA} / {STRING} ({COMMA}%) STR_STATION_VIEW_GROUP :{BLACK}Agrupar por @@ -4136,7 +4136,7 @@ STR_VEHICLE_VIEW_AIRCRAFT_STATUS_START_STOP_TOOLTIP :{BLACK}Acción STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}Cargando / Descargando STR_VEHICLE_STATUS_LEAVING :{LTBLUE}Saíndo STR_VEHICLE_STATUS_CRASHED :{RED}Estrelado! -STR_VEHICLE_STATUS_BROKEN_DOWN :{RED}Roto +STR_VEHICLE_STATUS_BROKEN_DOWN :{RED}Avariado STR_VEHICLE_STATUS_STOPPED :{RED}Parado STR_VEHICLE_STATUS_TRAIN_STOPPING_VEL :{RED}Parando, {VELOCITY} STR_VEHICLE_STATUS_TRAIN_NO_POWER :{RED}Sen enerxía @@ -5102,7 +5102,7 @@ STR_INDUSTRY_NAME_DIAMOND_MINE :Mina de diamant STR_INDUSTRY_NAME_IRON_ORE_MINE :Mina de ferro STR_INDUSTRY_NAME_FRUIT_PLANTATION :Plantación de froita STR_INDUSTRY_NAME_RUBBER_PLANTATION :Plantación de sobreiras -STR_INDUSTRY_NAME_WATER_SUPPLY :Subministro de auga +STR_INDUSTRY_NAME_WATER_SUPPLY :Abastecemento de auga STR_INDUSTRY_NAME_WATER_TOWER :Torre de auga STR_INDUSTRY_NAME_FACTORY_2 :Fábrica STR_INDUSTRY_NAME_FARM_2 :Granxa @@ -5198,20 +5198,20 @@ STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COAL_CAR :Coche de Carbó STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_OIL_TANKER :Tanque de Petróleo STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_LIVESTOCK_VAN :Furgón de Gando STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_GOODS_VAN :Furgón de Mercadorías -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_GRAIN_HOPPER :Tolva de Gran +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_GRAIN_HOPPER :Tremoia de Gran STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_WOOD_TRUCK :Vagón de Madeira -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_IRON_ORE_HOPPER :Tolva de Hematita +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_IRON_ORE_HOPPER :Tremoia de Hematita STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_STEEL_TRUCK :Vagón de Aceiro STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_ARMORED_VAN :Furgón Blindado STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_FOOD_VAN :Furgón de Comida STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_PAPER_TRUCK :Vagón de Papel -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COPPER_ORE_HOPPER :Tolva de Mineral de Cobre +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COPPER_ORE_HOPPER :Tremoia de Mineral de Cobre STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_WATER_TANKER :Tanque de Auga STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_FRUIT_TRUCK :Vagón de Froitas STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_RUBBER_TRUCK :Vagón de Caucho STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_SUGAR_TRUCK :Vagón de Azucre -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COTTON_CANDY_HOPPER :Tolva de Algodón de Azucre -STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_TOFFEE_HOPPER :Tolva de Toffee +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COTTON_CANDY_HOPPER :Tremoia de Algodón de Azucre +STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_TOFFEE_HOPPER :Tremoia de Toffee STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_BUBBLE_VAN :Furgón de Burbullas STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_COLA_TANKER :Tanque de Cola STR_VEHICLE_NAME_TRAIN_WAGON_RAIL_CANDY_VAN :Furgón de Caramelos @@ -5228,20 +5228,20 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COAL_CAR :Coche de Carbó STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_OIL_TANKER :Tanque de Petróleo STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_LIVESTOCK_VAN :Furgón de Gando STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_GOODS_VAN :Furgón de Mercadorías -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_GRAIN_HOPPER :Tolva de Gran +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_GRAIN_HOPPER :Tremoia de Gran STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_WOOD_TRUCK :Vagón de Madeira -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_IRON_ORE_HOPPER :Tolva de Hematita +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_IRON_ORE_HOPPER :Tremoia de Hematita STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_STEEL_TRUCK :Vagón de Aceiro STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_ARMORED_VAN :Furgón Blindado STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_FOOD_VAN :Furgón de Comida STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_PAPER_TRUCK :Vagón de Papel -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COPPER_ORE_HOPPER :Tolva de Mineral de Cobre +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COPPER_ORE_HOPPER :Tremoia de Mineral de Cobre STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_WATER_TANKER :Tanque de Auga STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_FRUIT_TRUCK :Vagón de Froitas STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_RUBBER_TRUCK :Vagón de Caucho STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_SUGAR_TRUCK :Vagón de Azucre -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COTTON_CANDY_HOPPER :Tolva de Algodón de Azucre -STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_TOFFEE_HOPPER :Tolva de Toffee +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COTTON_CANDY_HOPPER :Tremoia de Algodón de Azucre +STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_TOFFEE_HOPPER :Tremoia de Toffee STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_BUBBLE_VAN :Furgón de Burbullas STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_COLA_TANKER :Tanque de Cola STR_VEHICLE_NAME_TRAIN_WAGON_MONORAIL_CANDY_VAN :Furgón de Caramelos @@ -5260,20 +5260,20 @@ STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COAL_CAR :Coche de Carbó STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_OIL_TANKER :Tanque de Petróleo STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_LIVESTOCK_VAN :Furgón de Gando STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_GOODS_VAN :Furgón de Mercadorías -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_GRAIN_HOPPER :Tolva de Gran +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_GRAIN_HOPPER :Tremoia de Gran STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_WOOD_TRUCK :Vagón de Madeira -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_IRON_ORE_HOPPER :Tolva de Hematita +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_IRON_ORE_HOPPER :Tremoia de Hematita STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_STEEL_TRUCK :Vagón de Aceiro STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_ARMORED_VAN :Furgón Blindado STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_FOOD_VAN :Furgón de Comida STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_PAPER_TRUCK :Vagón de Papel -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COPPER_ORE_HOPPER :Tolva de Mineral de Cobre +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COPPER_ORE_HOPPER :Tremoia de Mineral de Cobre STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_WATER_TANKER :Tanque de Auga STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_FRUIT_TRUCK :Vagón de Froitas STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_RUBBER_TRUCK :Vagón de Caucho STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_SUGAR_TRUCK :Vagón de Azucre -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COTTON_CANDY_HOPPER :Tolva de Algodón de Azucre -STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_TOFFEE_HOPPER :Tolva de Toffee +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COTTON_CANDY_HOPPER :Tremoia de Algodón de Azucre +STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_TOFFEE_HOPPER :Tremoia de Toffee STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_BUBBLE_VAN :Furgón de Burbullas STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_COLA_TANKER :Tanque de Cola STR_VEHICLE_NAME_TRAIN_WAGON_MAGLEV_CANDY_VAN :Furgón de Caramelos diff --git a/src/lang/irish.txt b/src/lang/irish.txt index 88d8449d96..9341b996cd 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -205,7 +205,7 @@ STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}t STR_UNITS_WEIGHT_SHORT_SI :{COMMA}kg STR_UNITS_WEIGHT_LONG_IMPERIAL :{COMMA}{NBSP}tona -STR_UNITS_WEIGHT_LONG_METRIC :{COMMA}{NBSP}{P "th" "th" "th" "dt" "th"}ona +STR_UNITS_WEIGHT_LONG_METRIC :{COMMA}{NBSP}{P "th" "th" "th" "dt" "t"}ona STR_UNITS_WEIGHT_LONG_SI :{COMMA}{NBSP}kg STR_UNITS_VOLUME_SHORT_IMPERIAL :{COMMA}{NBSP}gal @@ -855,7 +855,7 @@ STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL :{BIG_FONT}{BLAC STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_COAL :{BIG_FONT}{BLACK}Aimsítear síog ghuail nua ag {INDUSTRY}!{}Meastar go dtiocfaidh méadú faoi dhó ar tháirgeadh! STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL :{BIG_FONT}{BLACK}Aimsítear stoc ola nua ag {INDUSTRY}!{}Meastar go dtiocfaidh méadú faoi dhó ar tháirgeadh! STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM :{BIG_FONT}{BLACK}Meastar go dtiocfaidh méadú faoi dhó ar tháirgeadh ag {INDUSTRY} mar gheall ar feabhsuithe sna modhanna feirmeoireachta! -STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_SMOOTH :{BIG_FONT}{BLACK}Tagann méadú ar tháirgeadh {STRING} ag {INDUSTRY} de {COMMA}%! +STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_SMOOTH :{BIG_FONT}{BLACK}Tháing méadú {2:COMMA}% ar tháirgeadh '{0:STRING}' ag {1:INDUSTRY}! STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL :{BIG_FONT}{BLACK}Tagann laghdú 50% ar tháirgeadh ag {INDUSTRY} STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM :{BIG_FONT}{BLACK}Déantar robach de bharr inmhíolú feithidí ag {INDUSTRY}!{}Lagdhú 50% ar tháirgeadh STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_SMOOTH :{BIG_FONT}{BLACK}Tagann laghdú ar tháirgeadh {STRING} ag {INDUSTRY} de {COMMA}%! @@ -1031,7 +1031,7 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Roghnaig STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(uath-aimsiú) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Gnáth STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Méid dúbailte -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Méid cheathrúil +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Méid 4x STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Méid na clófhoirne STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Roghnaigh méid na clófhoirne don chomhéadan a úsáidfear @@ -1739,6 +1739,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Taispeáin nuac STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Timpistí / tubaistí: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Taispeáin nuachtán nuair a thiteann timpistí nó tubaistí amach +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Timpistí de chuid fheithiclí na n-iomaitheoirí: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Faisnéis cuideachta: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Taispeáin nuachtán nuair a thosaíonn cuideachta nua, nó nuair atá cuideachta i mbaol féimheachta @@ -2252,6 +2253,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Tírdhr STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Méid na léarscáile: {WHITE}{COMMA}x{COMMA} STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Leagan an fhreastalaí: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Seoladh an fhreastalaí: {WHITE}{STRING} +STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Cód an chuiridh: {WHITE}{STRING} STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Dáta tosaigh: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Dáta reatha: {WHITE}{DATE_SHORT} STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Script Cluiche: {WHITE}{STRING} (v{NUM}) diff --git a/src/lang/polish.txt b/src/lang/polish.txt index c621eb314e..77369b0f88 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -2123,6 +2123,8 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Wyświetl wiado STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Wypadki / klęski: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Wyświetl wiadomość w gazecie kiedy zdarzy się wypadek lub nastąpi katastrofa +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Wypadki pojazdów konkurentów: {STRING} +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Wyświetl wiadomość w gazecie o rozbitych pojazdach konkurentów STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Informacja firmy: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Wyświetl wiadomość w gazecie kiedy powstaje nowa firma lub kiedy istniejącym firmom grozi bankructwo diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index a39e3925ae..f63ac4e02d 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1743,6 +1743,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Visa nyhetstidn STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Olyckor / katastrofer: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Visa nyhetstidning när olyckor eller katastrofer inträffar +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Olyckor med konkurrenters fordon: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Företagsinformation: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Visa nyhetstidning när nya företag startar upp eller när ett befintligt företag riskerar att gå bankrupt diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 941462a079..c5994ee5c1 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -188,6 +188,7 @@ STR_COLOUR_ORANGE :橙 STR_COLOUR_BROWN :棕 STR_COLOUR_GREY :灰 STR_COLOUR_WHITE :白 +STR_COLOUR_RANDOM :隨機 # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}英里/小時 @@ -263,6 +264,7 @@ STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT_TOOLTIP :{BLACK}如啟 STR_BUTTON_DEFAULT :{BLACK}預設值 STR_BUTTON_CANCEL :{BLACK}取消 STR_BUTTON_OK :{BLACK}確定 +STR_WARNING_PASSWORD_SECURITY :{YELLOW}警告: 伺服器管理者可能可以閱讀在此處輸入的任何文字訊息 # On screen keyboard window STR_OSK_KEYBOARD_LAYOUT :`1234567890-=\qwertyuiop[]asdfghjkl;' zxcvbnm,./ . @@ -312,9 +314,13 @@ STR_SORT_BY_RANGE :範圍 STR_SORT_BY_POPULATION :人口 STR_SORT_BY_RATING :評價 STR_SORT_BY_NUM_VEHICLES :車輛數量 +STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :去年總盈利 +STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :今年總盈利 +STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :去年平均盈利 # Group by options for vehicle list STR_GROUP_BY_NONE :無 +STR_GROUP_BY_SHARED_ORDERS :共享指令 # Order button in shared orders vehicle list @@ -363,6 +369,7 @@ STR_SCENEDIT_TOOLBAR_LANDSCAPE_GENERATION :{BLACK}產生 STR_SCENEDIT_TOOLBAR_TOWN_GENERATION :{BLACK}產生市鎮 STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION :{BLACK}產生工業 STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}建造道路 +STR_SCENEDIT_TOOLBAR_TRAM_CONSTRUCTION :{BLACK}鋪設電車軌 STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}植樹。按 Shift 可切換種植/顯示預估的種植費用 STR_SCENEDIT_TOOLBAR_PLACE_SIGN :{BLACK}放置標誌 STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}放置物件。按 Shift 可切換興建/顯示預估的興建費用 @@ -777,6 +784,7 @@ STR_STATUSBAR_PAUSED :{YELLOW}* * STR_STATUSBAR_AUTOSAVE :{RED}自動儲存 STR_STATUSBAR_SAVING_GAME :{RED}* * 遊戲儲存中 * * +STR_STATUSBAR_SPECTATOR :{WHITE}旁觀者 # News message history STR_MESSAGE_HISTORY :{WHITE}訊息記錄 @@ -878,7 +886,12 @@ STR_NEWS_STATION_NOW_ACCEPTS_CARGO_AND_CARGO :{WHITE}{STATION STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED :{BIG_FONT}{BLACK}補助過期:{}{}將 {STRING} 從 {STRING} 運到 {STRING} 現在起不再提供補助 STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE :{BIG_FONT}{BLACK}補助結束:{}{}將 {STRING} 從 {STRING} 運到 {STRING} 的服務不再提供補助 +STR_NEWS_SERVICE_SUBSIDY_OFFERED :{BIG_FONT}{BLACK}提供補助:{}{}首先將 {STRING} 從 {STRING} 運到 {STRING} 的公司將得到地方政府補助{NUM}年! ###length 4 +STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF :{BIG_FONT}{BLACK}{STRING} 獲得補助!{}{}將 {STRING} 從 {STRING} 運到 {STRING} 的服務可在往後{NUM}年收到額外 50% 的運費補助! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_DOUBLE :{BIG_FONT}{BLACK}{STRING} 獲得補助!{}{}將 {STRING} 從 {STRING} 運到 {STRING} 的服務可在往後{NUM}年收到雙倍運費補助! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLACK}{STRING} 獲得補助!{}{}將 {STRING} 從 {STRING} 運到 {STRING} 的服務可在往後{NUM}年收到三倍運費補助! +STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}{STRING} 獲得補助!{}{}將 {STRING} 從 {STRING} 運到 {STRING} 的服務可在往後{NUM}年收到四倍運費補助! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}{TOWN} 交通大亂!{}{}{STRING} 出資的道路重建計劃為用路人帶來六個月的惡夢! STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}運輸大亨! @@ -918,7 +931,7 @@ STR_GAME_OPTIONS_CURRENCY_NLG :荷蘭盾 (NLG) STR_GAME_OPTIONS_CURRENCY_NOK :挪威克朗 (NOK) STR_GAME_OPTIONS_CURRENCY_PLN :波蘭茲羅提 (PLN) STR_GAME_OPTIONS_CURRENCY_RON :羅馬尼亞列伊 (RON) -STR_GAME_OPTIONS_CURRENCY_RUR :俄羅斯盧布 (RUR) +STR_GAME_OPTIONS_CURRENCY_RUR :俄羅斯舊盧布 (RUR) STR_GAME_OPTIONS_CURRENCY_SIT :斯洛文尼亞托拉 (SIT) STR_GAME_OPTIONS_CURRENCY_SEK :瑞典克朗 (SEK) STR_GAME_OPTIONS_CURRENCY_TRY :土耳其里拉 (TRY) @@ -931,13 +944,17 @@ STR_GAME_OPTIONS_CURRENCY_ZAR :南非蘭特 (Z STR_GAME_OPTIONS_CURRENCY_CUSTOM :自訂... STR_GAME_OPTIONS_CURRENCY_GEL :喬治亞拉里 (GEL) STR_GAME_OPTIONS_CURRENCY_IRR :伊朗里亞爾 (IRR) +STR_GAME_OPTIONS_CURRENCY_RUB :俄羅斯盧布 (RUB) +STR_GAME_OPTIONS_CURRENCY_CNY :中國人民幣(CNY) STR_GAME_OPTIONS_CURRENCY_HKD :港幣 (HKD) +STR_GAME_OPTIONS_CURRENCY_INR :印度盧比(INR) +STR_GAME_OPTIONS_CURRENCY_IDR :印尼盾 (IDR) ###length 2 STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_LEFT :靠左行駛 STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_RIGHT :靠右行駛 -STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}市鎮名稱 +STR_GAME_OPTIONS_TOWN_NAMES_FRAME :{BLACK}市鎮名稱: STR_GAME_OPTIONS_TOWN_NAMES_DROPDOWN_TOOLTIP :{BLACK}選擇市鎮命名風格 ###length 21 @@ -984,8 +1001,12 @@ STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}勾選 STR_GAME_OPTIONS_RESOLUTION :{BLACK}螢幕解析度 STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}選擇螢幕解析度 STR_GAME_OPTIONS_RESOLUTION_OTHER :其它 +STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} +STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}硬體加速 +STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync +STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}勾選此方框以啟用V-SYNC。此項設定將會在遊戲重啟後套用。只有在硬體加速存在時可用 STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}介面大小 STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}選擇使用的介面元素大小 @@ -995,8 +1016,13 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :兩倍大小 STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(自動偵測) +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :兩倍大小 +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 +STR_GAME_OPTIONS_GRAPHICS :{BLACK}圖形 +STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{NUM}Hz STR_GAME_OPTIONS_BASE_GRF :{BLACK}基本圖形集 STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}選擇要使用的基本圖形集 @@ -1098,6 +1124,7 @@ STR_TERRAIN_TYPE_FLAT :平坦 STR_TERRAIN_TYPE_HILLY :丘陵 STR_TERRAIN_TYPE_MOUNTAINOUS :高山 STR_TERRAIN_TYPE_ALPINIST :多山 +STR_TERRAIN_TYPE_CUSTOM :自訂高度 STR_TERRAIN_TYPE_CUSTOM_VALUE :自訂高度({NUM}) ###length 3 @@ -1112,6 +1139,7 @@ STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}顯示 STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}篩選字串: 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_DEFAULT_VALUE :{LTBLUE}預設值: {ORANGE}{STRING} STR_CONFIG_SETTING_TYPE :{LTBLUE}設定種類: {ORANGE}{STRING} @@ -1120,6 +1148,7 @@ STR_CONFIG_SETTING_TYPE_GAME_MENU :遊戲設定 ( STR_CONFIG_SETTING_TYPE_GAME_INGAME :遊戲設定 (存檔時保存;僅影響現時開啟的遊戲) STR_CONFIG_SETTING_TYPE_COMPANY_MENU :公司設定 (存檔時保存;僅在往後建立的新遊戲生效) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :公司設定 (存檔時保存;僅影響您正在控制的公司) +STR_CONFIG_SETTING_RESET_ALL_CONFIRMATION_DIALOG_TEXT :{WHITE}此操作將會還原所有遊戲設定至預設狀態{}你確定要進行此操作嗎? STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}篩選設定: STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}適用範圍: @@ -1184,6 +1213,7 @@ STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :設定獲補助 ###setting-zero-is-special +STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :沒有補貼 STR_CONFIG_SETTING_CONSTRUCTION_COSTS :建造成本: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :設定建造和購買物件的成本水平 @@ -1200,8 +1230,10 @@ STR_CONFIG_SETTING_DISASTERS_HELPTEXT :切換那些有 STR_CONFIG_SETTING_CITY_APPROVAL :地方政府對地區結構重組的態度: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :選擇公司所製造的噪音和環境傷害對其在市鎮的評比及未來的建設行動會造成多大影響 +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT :地圖高度限制: {STRING} +STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE :{NUM} ###setting-zero-is-special -STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}您不能把地圖的最高高度設成此值。至少有一座山比這個高度更高。 +STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}您不能把地圖的最大高度限制設成此值。至少有一座山比這個高度更高。 STR_CONFIG_SETTING_AUTOSLOPE :允許在建築物或軌道底下改變地形斜度 (autoslope):{STRING} STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :可以在建築物或軌道底下改變地形而不需移除它們 @@ -1330,6 +1362,7 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}當有 STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :基礎建設維護: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :如啟用此選項,基礎建設會產生維護成本。該成本的增長會根據公司基礎建設的規模而加倍增大,因此該設定對大公司的影響比對小公司更大 +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :選擇公司的初始顏色 STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :機場永不過期:{STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :如啟用此選項,所有機場一經面世,就永遠可以選擇建設 @@ -1454,6 +1487,7 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :暗綠 STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :紫 ###length 4 +STR_CONFIG_SETTING_SCROLLMODE_RMB :使用右鍵移動地圖 STR_CONFIG_SETTING_SCROLLMODE_LMB :使用左鍵移動地圖 STR_CONFIG_SETTING_SMOOTH_SCROLLING :視野平滑移動:{STRING} @@ -1491,6 +1525,7 @@ STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :單撳 (選定 STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :單撳 (立刻) ###length 3 +STR_CONFIG_SETTING_USE_RELAY_SERVICE_ALLOW :允許 STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU :右鍵模擬:{STRING} STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT :選擇模擬右撳鼠鍵的方法 @@ -1499,6 +1534,8 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_COMMAND :Command 鍵 STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL :Control 鍵 STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :無 +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :右鍵關閉視窗: {STRING} +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :在視窗內以右鍵點擊可關閉視窗。可用右鍵關閉工具提示 STR_CONFIG_SETTING_AUTOSAVE :自動儲存: {STRING} STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :選擇自動存檔的週期 @@ -1552,7 +1589,10 @@ STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :設定是否在 STR_CONFIG_SETTING_EXPENSES_LAYOUT :將公司財務視窗的收支分組顯示:{STRING} STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :決定是否將公司財務視窗內的收支項目分組顯示 +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :在鋪設軌道時自動移除號誌: {STRING} +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :自動移除軌道鋪設路徑上的號誌。請注意:本設定有導致火車事故的潛在風險 +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% 正常遊戲速度 ###setting-zero-is-special STR_CONFIG_SETTING_SOUND_TICKER :新聞提示: {STRING} @@ -1649,6 +1689,7 @@ STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :當對手設立 STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :事故/災難: {STRING} STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :當事故或災難發生時顯示報紙訊息 +STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :顯示有關對手公司事故運具的報紙 STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :公司資訊: {STRING} STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :當一所公司開始營業或倒閉破產時顯示報紙訊息 @@ -1700,10 +1741,12 @@ STR_CONFIG_SETTING_ENDING_YEAR_ZERO :永不 ###length 3 STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :原版 +STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :平滑 STR_CONFIG_SETTING_ALLOW_SHARES :允許購買其它公司的股票:{STRING} STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :啟用此選項以容許公司買賣股票。一所公司必須達到一定的年齡方能買賣股票 +STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :設定容許公司買賣股票的最小年齡 STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :轉運服務所得的收入百分比: {STRING} STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :設定進行轉運的運輸工具在卸載被轉運的貨物時,獲得的收入佔貨物總收入的百分比。此選項讓玩家更有效地控制收入分配方式 @@ -1718,10 +1761,10 @@ STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :自動在指定 STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :設定使用燈號號誌的年份。在遊戲進行到那一年之前,系統會預設豎立懸臂號誌 STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :按住 Ctrl 點選號誌時要切換的號誌種類:{STRING} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :選擇可透過 Ctrl+單撳 更換的號誌類型 +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :選擇可透過 Ctrl+點擊 更換的號誌類型 ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :僅限路徑號誌 -STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :所有號誌 +STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :所有可見的號誌 ###length 2 STR_CONFIG_SETTING_SIGNAL_GUI_MODE_PATH :僅限路徑號誌 @@ -1750,11 +1793,13 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :禁止 STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :允許 STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :允許,可自訂市鎮道路配置 +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :貨物的產出速度取決於城市中的房屋,與城市的總人口數相關。{}二次方: 兩倍人口的都市產出四倍量的貨物{}線性: 兩倍人口的都市產出兩倍量的貨物 ###length 2 STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :遊戲中產生樹木的地點:{STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :控制遊戲內是否隨意種植樹木。此選項可能會影響一些依賴樹木的工業 (例如熱帶氣候的伐木場) ###length 4 +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :在任意地點皆可生長與擴散 STR_CONFIG_SETTING_TOOLBAR_POS :主工具列位置:{STRING} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :設定主工具列在螢幕頂部的位置 @@ -1897,6 +1942,7 @@ STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}工業 STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :{ORANGE}貨物分配 STR_CONFIG_SETTING_AI :{ORANGE}競爭對手 STR_CONFIG_SETTING_AI_NPC :{ORANGE}電腦玩家 +STR_CONFIG_SETTING_NETWORK :{ORANGE}網路 STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS :列車的路徑搜尋方式:{STRING} STR_CONFIG_SETTING_PATHFINDER_FOR_TRAINS_HELPTEXT :設定列車使用的路徑搜尋方式 @@ -1933,6 +1979,7 @@ STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}記憶 STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}無法編配{BYTES}作為子畫面快取。子畫面快取的大小已降至{BYTES}。OpenTTD的效能會受到影響。請嘗試停用32bpp圖形及/或減少放大倍數,以減低記憶體要求 # Video initalization errors +STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}...找不到相容的顯示卡裝置,硬體加速已被停用 # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -1976,6 +2023,7 @@ STR_INTRO_TRANSLATION :{BLACK}此段 # Quit window STR_QUIT_CAPTION :{WHITE}離開 +STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD :{YELLOW}您確定要關閉OperTTD嗎? STR_QUIT_YES :{BLACK}是 STR_QUIT_NO :{BLACK}否 @@ -1987,6 +2035,7 @@ STR_ABANDON_SCENARIO_QUERY :{YELLOW}你確 # Cheat window STR_CHEATS :{WHITE}作弊 STR_CHEATS_TOOLTIP :{BLACK}方塊被勾選代表您用過這個密技 +STR_CHEATS_NOTE :{BLACK}請注意:任何修改這些設定的操作將會被記錄於遊戲存檔中 STR_CHEAT_MONEY :{LTBLUE}增加金錢:{CURRENCY_LONG} STR_CHEAT_CHANGE_COMPANY :{LTBLUE}切換玩家操控的公司:{ORANGE}{COMMA} STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}神奇推土機 (可摧毀工業、無法移除的物件):{ORANGE}{STRING} @@ -2101,6 +2150,7 @@ STR_FACE_TIE_EARRING_TOOLTIP :{BLACK}改變 # Matches ServerGameType ###length 3 +STR_NETWORK_SERVER_VISIBILITY_INVITE_ONLY :僅限邀請加入 # Network server list STR_NETWORK_SERVER_LIST_CAPTION :{WHITE}多人遊戲 @@ -2137,6 +2187,7 @@ STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}遊戲 STR_NETWORK_SERVER_LIST_PASSWORD :{SILVER}受密碼保護! STR_NETWORK_SERVER_LIST_SERVER_OFFLINE :{SILVER}伺服器離線 STR_NETWORK_SERVER_LIST_SERVER_FULL :{SILVER}伺服器已滿 +STR_NETWORK_SERVER_LIST_SERVER_TOO_OLD :{SILVER}伺服器太舊 STR_NETWORK_SERVER_LIST_VERSION_MISMATCH :{SILVER}版本不符 STR_NETWORK_SERVER_LIST_GRF_MISMATCH :{SILVER}NEWGRF 不符合 @@ -2152,6 +2203,7 @@ STR_NETWORK_SERVER_LIST_START_SERVER :{BLACK}起動 STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP :{BLACK}起動您自己的伺服器 STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE :{BLACK}輸入您的名稱 +STR_NETWORK_SERVER_LIST_ENTER_SERVER_ADDRESS :{BLACK}輸入伺服器位址或邀請碼 # Start new multiplayer server STR_NETWORK_START_SERVER_CAPTION :{WHITE}開始新的多人遊戲 @@ -2161,6 +2213,7 @@ STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP :{BLACK}遊戲 STR_NETWORK_START_SERVER_SET_PASSWORD :{BLACK}設定密碼 STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP :{BLACK}如果您不想讓大眾連線的話,可以用密碼保護遊戲 +STR_NETWORK_START_SERVER_VISIBILITY_LABEL :{BLACK}可見性 STR_NETWORK_START_SERVER_CLIENTS_SELECT :{BLACK}{NUM} 玩家 STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS :{BLACK}用戶端上限: STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP :{BLACK}選擇連線人數上限,但不是每個名額都要有人連線 @@ -2194,20 +2247,40 @@ STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}公司 # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :用戶端清單 +STR_NETWORK_COMPANY_LIST_SPECTATE :旁觀 # Network client list STR_NETWORK_CLIENT_LIST_CAPTION :{WHITE}多人遊戲 STR_NETWORK_CLIENT_LIST_SERVER :{BLACK}伺服器 +STR_NETWORK_CLIENT_LIST_SERVER_NAME :{BLACK}名稱 STR_NETWORK_CLIENT_LIST_SERVER_NAME_QUERY_CAPTION :伺服器名稱 STR_NETWORK_CLIENT_LIST_SERVER_VISIBILITY :{BLACK}可見性 +STR_NETWORK_CLIENT_LIST_SERVER_INVITE_CODE_TOOLTIP :{BLACK}其他玩家可使用以進入伺服器的邀請碼 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE :{BLACK}連線類型 +STR_NETWORK_CLIENT_LIST_PLAYER_NAME :{BLACK}名稱 +STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP :{BLACK}編輯玩家名稱 +STR_NETWORK_CLIENT_LIST_JOIN_TOOLTIP :{BLACK}加入此公司 +STR_NETWORK_CLIENT_LIST_CHAT_CLIENT_TOOLTIP :{BLACK}傳送訊息給此玩家 +STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP :{BLACK}傳送訊息給所有旁觀者 +STR_NETWORK_CLIENT_LIST_SPECTATORS :旁觀者 +STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}創立並加入一個新公司 # Matches ConnectionType ###length 5 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_ISOLATED :{RED}遠端玩家無法連線 +STR_NETWORK_CLIENT_LIST_SERVER_CONNECTION_TYPE_DIRECT :{BLACK}公開 STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK :踢出 +STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :停權 +STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :密碼解鎖 +STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}你確定要踢出玩家: '{STRING}'嗎? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}你確定要刪除「{COMPANY}」公司嗎? +STR_NETWORK_CLIENT_LIST_ASK_COMPANY_UNLOCK :{YELLOW}你確定要重設 '{COMPANY}'的公司密碼嗎? +STR_NETWORK_ASK_RELAY_CAPTION :{WHITE}是否使用中繼伺服器? +STR_NETWORK_ASK_RELAY_NO :{BLACK}否 +STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}是,僅此一次 STR_NETWORK_SPECTATORS :旁觀者 @@ -2236,6 +2309,7 @@ STR_NETWORK_CHAT_TO_COMPANY :[團隊] 給 {S STR_NETWORK_CHAT_CLIENT :[私人] {STRING}:{WHITE}{STRING} STR_NETWORK_CHAT_TO_CLIENT :[私人] 給 {STRING}:{WHITE}{STRING} STR_NETWORK_CHAT_ALL :[全員] {STRING}:{WHITE}{STRING} +STR_NETWORK_CHAT_EXTERNAL :[{3:STRING}] {0:STRING}: {WHITE}{1:STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}輸入要聊天的文字 # Network messages @@ -2259,6 +2333,7 @@ STR_NETWORK_ERROR_TIMEOUT_PASSWORD :{WHITE}你輸 STR_NETWORK_ERROR_TIMEOUT_COMPUTER :{WHITE}您的電腦可能較慢,未能跟上伺服器的速度 STR_NETWORK_ERROR_TIMEOUT_MAP :{WHITE}您的電腦花了太多時間下載地圖 STR_NETWORK_ERROR_TIMEOUT_JOIN :{WHITE}您的電腦花了太多時間嘗試加入這個伺服器 +STR_NETWORK_ERROR_INVALID_CLIENT_NAME :{WHITE}你的玩家名稱是無效的 STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION_CAPTION :{WHITE}可能發生連線中斷 STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNECTION :{WHITE}最後 {NUM} 秒沒有資料從伺服器過來 @@ -2284,6 +2359,7 @@ STR_NETWORK_ERROR_CLIENT_TIMEOUT_PASSWORD :未能及時取 STR_NETWORK_ERROR_CLIENT_TIMEOUT_COMPUTER :一般逾時狀況 STR_NETWORK_ERROR_CLIENT_TIMEOUT_MAP :下載地圖需時太長 STR_NETWORK_ERROR_CLIENT_TIMEOUT_JOIN :處理地圖需時太長 +STR_NETWORK_ERROR_CLIENT_INVALID_CLIENT_NAME :無效的使用者端名稱 # Network related errors STR_NETWORK_SERVER_MESSAGE :*** {1:STRING} @@ -2309,10 +2385,15 @@ STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} 已建立新公司 (#{2:NUM}) STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} 已離開遊戲 ({2:STRING}) STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} 已修改其名稱為 {STRING} +STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} 付給{1:STRING} {2:CURRENCY_LONG} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}伺服器關閉連線 STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}伺服器重新啟動中...{}請稍候... STR_NETWORK_MESSAGE_KICKED :*** {STRING} 已被踢出。原因:({STRING}) +STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}伺服器註冊失敗 +STR_NETWORK_ERROR_COORDINATOR_REUSE_OF_INVITE_CODE :{WHITE}已有另一個伺服器以同樣的邀請碼進行註冊。點擊"本地"以改變遊戲模式 +STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}你的伺服器不接受遠端連線 +STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}其他玩家將無法連線到你的伺服器 # Content downloading window STR_CONTENT_TITLE :{WHITE}內容下載中 @@ -2410,6 +2491,7 @@ STR_LINKGRAPH_LEGEND_CAPTION :{BLACK}貨物 STR_LINKGRAPH_LEGEND_ALL :{BLACK}全部 STR_LINKGRAPH_LEGEND_NONE :{BLACK}無 STR_LINKGRAPH_LEGEND_SELECT_COMPANIES :{BLACK}選擇所顯示的公司 +STR_LINKGRAPH_LEGEND_COMPANY_TOOLTIP :{BLACK}{STRING}{}{COMPANY} # Linkgraph legend window and linkgraph legend in smallmap STR_LINKGRAPH_LEGEND_UNUSED :{TINY_FONT}{BLACK}未使用 @@ -2628,6 +2710,8 @@ STR_TREES_RANDOM_TYPE :{BLACK}隨機 STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}種植隨機種類樹木。按 Shift 可切換種植/顯示預估的種植費用 STR_TREES_RANDOM_TREES_BUTTON :{BLACK}隨機樹種 STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}在場景中隨機植樹 +STR_TREES_MODE_NORMAL_BUTTON :{BLACK}正常 +STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}框選一片區域以種植小規模的森林 STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}森林 # Land generation window (SE) @@ -2681,11 +2765,15 @@ STR_FUND_INDUSTRY_CAPTION :{WHITE}投資 STR_FUND_INDUSTRY_SELECTION_TOOLTIP :{BLACK}從清單中選擇合適的工業 STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES :隨機產生多個工業 STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP :{BLACK}以隨機分佈的工業佈滿地圖 +STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_CAPTION :{WHITE}隨機產生工業 STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_QUERY :{YELLOW}你確定要新建大量隨機工業嗎? STR_FUND_INDUSTRY_INDUSTRY_BUILD_COST :{BLACK}費用:{YELLOW}{CURRENCY_LONG} STR_FUND_INDUSTRY_PROSPECT_NEW_INDUSTRY :{BLACK}探勘 STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY :{BLACK}設立 STR_FUND_INDUSTRY_FUND_NEW_INDUSTRY :{BLACK}設立 +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES :{BLACK}移除所有工業 +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_TOOLTIP :{BLACK}移除地圖上所有工業 +STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_CAPTION :{WHITE}移除所有工業 # Industry cargoes window STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION :{WHITE}{STRING} 工業的產業鍊 @@ -2726,8 +2814,11 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}機場 STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF:{LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}接收貨物:{LTBLUE} STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING}) +STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}鐵軌種類: {LTBLUE}{STRING} +STR_LANG_AREA_INFORMATION_ROAD_TYPE :{BLACK}道路類型: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}軌道速限:{LTBLUE}{VELOCITY} STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}道路速限:{LTBLUE}{VELOCITY} +STR_LANG_AREA_INFORMATION_TRAM_SPEED_LIMIT :{BLACK}有軌電車速限: {LTBLUE}{VELOCITY} # Description of land area of different tiles STR_LAI_CLEAR_DESCRIPTION_ROCKS :石頭 @@ -2828,18 +2919,28 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION :{WHITE}幀率 +STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) +STR_FRAMERATE_RATE_GAMELOOP :{BLACK}模擬速度: {STRING} +STR_FRAMERATE_RATE_BLITTER :{BLACK}畫面幀數: {STRING} +STR_FRAMERATE_AVERAGE :{WHITE}平均 STR_FRAMERATE_MEMORYUSE :{WHITE}記憶體 STR_FRAMERATE_DATA_POINTS :{BLACK}數據基於 {COMMA} 個採樣 STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} 毫秒 +STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} 幀/秒 +STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} 幀/秒 STR_FRAMERATE_BYTES_GOOD :{LTBLUE}{BYTES} ###length 15 +STR_FRAMERATE_VIDEO :{BLACK}影像輸出 +STR_FRAMERATE_SOUND :{BLACK}混音: STR_FRAMERATE_GAMESCRIPT :{BLACK} 遊戲腳本: STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} ###length 15 STR_FRAMETIME_CAPTION_GL_LANDSCAPE :世界刻 +STR_FRAMETIME_CAPTION_DRAWING :圖形彩現 STR_FRAMETIME_CAPTION_ALLSCRIPTS :GS/AI 腳本總計 +STR_FRAMETIME_CAPTION_GAMESCRIPT :遊戲腳本 STR_FRAMETIME_CAPTION_AI :AI {NUM} {STRING} @@ -2865,6 +2966,7 @@ STR_SAVELOAD_DETAIL_CAPTION :{BLACK}遊戲 STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}沒有可用的資訊 STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF:{WHITE}{STRING} +STR_SAVELOAD_FILTER_TITLE :{BLACK}篩選字串: STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}覆蓋檔案 STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}你確定要覆蓋現有存檔嗎? STR_SAVELOAD_DIRECTORY :{STRING} (路徑) @@ -2879,7 +2981,10 @@ STR_MAPGEN_BY :{BLACK}* STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}市鎮數量: STR_MAPGEN_DATE :{BLACK}日期: STR_MAPGEN_NUMBER_OF_INDUSTRIES :{BLACK}工業數量: +STR_MAPGEN_SNOW_COVERAGE :{BLACK}雪地覆蓋率: +STR_MAPGEN_SNOW_COVERAGE_UP :{BLACK}將雪地覆蓋率提高10% STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}% +STR_MAPGEN_DESERT_COVERAGE :{BLACK}沙漠覆蓋率: STR_MAPGEN_DESERT_COVERAGE_UP :{BLACK}將沙漠覆蓋率提高10% STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_LAND_GENERATOR :{BLACK}地形產生器: @@ -2907,6 +3012,7 @@ STR_MAPGEN_HEIGHTMAP_NAME :{BLACK}高度 STR_MAPGEN_HEIGHTMAP_SIZE_LABEL :{BLACK}大小: STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x {NUM} +STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}沙漠覆蓋率 (以百分比%計算) STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}修改開始年份 # SE Map generation @@ -3041,6 +3147,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}警告:{ STR_NEWGRF_ERROR_MSG_ERROR :{RED}錯誤:{SILVER}{STRING} STR_NEWGRF_ERROR_MSG_FATAL :{RED}嚴重錯誤:{SILVER}{STRING} STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}發生嚴重 NewGRF 錯誤的處理方式:{}{STRING} +STR_NEWGRF_ERROR_POPUP :{WHITE}發生NewGRF錯誤:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} 跟由 OpenTTD 回報的 TTDPatch 版本不合 STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} 只適合用於 TTD 版本 {STRING} STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} 必須跟 {STRING} 一起使用 @@ -3132,6 +3239,7 @@ STR_TOWN_POPULATION :{BLACK}世界 STR_TOWN_VIEW_TOWN_CAPTION :{WHITE}{TOWN} STR_TOWN_VIEW_CITY_CAPTION :{WHITE}{TOWN} (城市) STR_TOWN_VIEW_POPULATION_HOUSES :{BLACK}人口:{ORANGE}{COMMA}{BLACK} 房屋:{ORANGE}{COMMA} +STR_TOWN_VIEW_CARGO_LAST_MONTH_MAX :{BLACK}{CARGO_LIST} 上月: {ORANGE}{COMMA}{BLACK} 最多: {ORANGE}{COMMA} STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH :{BLACK}市鎮成長所需貨物: STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_GENERAL :{RED}需要 {ORANGE}{STRING} STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_WINTER :{ORANGE}{STRING}{BLACK} 必須是冬天 @@ -3186,7 +3294,10 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}冒著 # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} 遊戲目標 STR_GOALS_SPECTATOR_CAPTION :{WHITE}全局目標 +STR_GOALS_SPECTATOR :全局目標 +STR_GOALS_GLOBAL_BUTTON :{BLACK}全局 STR_GOALS_GLOBAL_BUTTON_HELPTEXT :{BLACK}顯示全局目標 +STR_GOALS_COMPANY_BUTTON :{BLACK}公司 STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- 當前無目標 - STR_GOALS_PROGRESS :{ORANGE}{STRING} @@ -3194,10 +3305,10 @@ STR_GOALS_PROGRESS_COMPLETE :{GREEN}{STRING} STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}點選目標以將有關工業 / 市鎮或方格置於畫面中央。按下 Ctrl 鍵並點選目標以開啟一個以有關工業 / 市鎮或方格為中心的新視野 # Goal question window -STR_GOAL_QUESTION_CAPTION_QUESTION :問題 -STR_GOAL_QUESTION_CAPTION_INFORMATION :資訊 -STR_GOAL_QUESTION_CAPTION_WARNING :警告 -STR_GOAL_QUESTION_CAPTION_ERROR :錯誤 +STR_GOAL_QUESTION_CAPTION_QUESTION :{BLACK}問題 +STR_GOAL_QUESTION_CAPTION_INFORMATION :{BLACK}資訊 +STR_GOAL_QUESTION_CAPTION_WARNING :{BLACK}警告 +STR_GOAL_QUESTION_CAPTION_ERROR :{YELLOW}錯誤 # Goal Question button list ###length 18 @@ -3423,9 +3534,12 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL :{WHITE}每年{C # Industry directory STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}工業 STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- 無 - +STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{STRING}{YELLOW} (運送了{COMMA}%){BLACK} STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY} STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUSTRY} {STRING} +STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}工業名稱 - 點選名稱可將工業置於畫面中央。 按住 Ctrl 點選可於工業位置開啟新視窗視野 +STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}接受貨物: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :所有貨物種類 STR_INDUSTRY_DIRECTORY_FILTER_NONE :無 @@ -3440,6 +3554,8 @@ STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}該工 STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}需要: {YELLOW}{STRING}{STRING} STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :,{STRING}{STRING} +STR_INDUSTRY_VIEW_REQUIRES :{BLACK}需要: +STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} STR_CONFIG_GAME_PRODUCTION :{WHITE}修改產量 (以 8 為倍數增減,最大為 2040) STR_CONFIG_GAME_PRODUCTION_LEVEL :{WHITE}變更產出等級 (百分比,最高可到800%) @@ -3493,12 +3609,13 @@ STR_GROUP_DEFAULT_ROAD_VEHICLES :未分組的車 STR_GROUP_DEFAULT_SHIPS :未分組的船舶 STR_GROUP_DEFAULT_AIRCRAFTS :未分組的飛機 +STR_GROUP_COUNT_WITH_SUBGROUP :{TINY_FONT}{COMMA} (+{COMMA}) STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}群組 - 點選群組以顯示其中的運輸工具清單。拖曳群組標籤以排列群組的次序和層級。 STR_GROUP_CREATE_TOOLTIP :{BLACK}點選可建立群組 STR_GROUP_DELETE_TOOLTIP :{BLACK}移除所選群組 STR_GROUP_RENAME_TOOLTIP :{BLACK}重新命名群組 -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}點選可保護此群組排除在全域自動替換設定之外 +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}點選可保護此群組排除在全域自動替換設定之外。按住 Ctrl 鍵點選以套用至所有子群組 STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}刪除群組 STR_GROUP_DELETE_QUERY_TEXT :{WHITE}您是否決定刪除此群組及其所有子群組? @@ -3509,6 +3626,9 @@ STR_GROUP_REMOVE_ALL_VEHICLES :移去所有運 STR_GROUP_RENAME_CAPTION :{BLACK}重新命名群組 STR_GROUP_PROFIT_THIS_YEAR :今年盈利: +STR_GROUP_PROFIT_LAST_YEAR :去年盈利: +STR_GROUP_OCCUPANCY :目前使用率: +STR_GROUP_OCCUPANCY_VALUE :{NUM}% # Build vehicle window ###length 4 @@ -3518,10 +3638,12 @@ STR_BUY_VEHICLE_TRAIN_MONORAIL_CAPTION :新購單軌車 STR_BUY_VEHICLE_TRAIN_MAGLEV_CAPTION :新購磁浮車輛 STR_BUY_VEHICLE_ROAD_VEHICLE_CAPTION :新購車輛 +STR_BUY_VEHICLE_TRAM_VEHICLE_CAPTION :新的電車運具 # Vehicle availability ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_ALL_CAPTION :新購鐵路列車 +STR_BUY_VEHICLE_ROAD_VEHICLE_ALL_CAPTION :新購車輛 STR_BUY_VEHICLE_SHIP_CAPTION :新購船舶 STR_BUY_VEHICLE_AIRCRAFT_CAPTION :新購飛機 @@ -3537,12 +3659,15 @@ STR_PURCHASE_INFO_REFITTABLE :(可改裝) STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}設計年份:{GOLD}{NUM}{BLACK} 使用年限:{GOLD}{COMMA} 年 STR_PURCHASE_INFO_RELIABILITY :{BLACK}最大可靠度:{GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}費用:{GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}費用: {GOLD}{CURRENCY_LONG}{BLACK} (改裝費用: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}載重:{GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}費用:{GOLD}{CURRENCY_LONG}{BLACK} 速度:{GOLD}{VELOCITY} +STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}費用: {GOLD}{CURRENCY_LONG}{BLACK} (改裝費用: {GOLD}{CURRENCY_LONG}{BLACK}) 速度: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}容量:{GOLD}{CARGO_LONG},{CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}動力車廂:{GOLD}+{POWER}{BLACK} 載重:{GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}可改裝成:{GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :所有貨物種類 +STR_PURCHASE_INFO_NONE :無 STR_PURCHASE_INFO_ALL_BUT :所有貨物({CARGO_LIST}除外) STR_PURCHASE_INFO_MAX_TE :{BLACK}最大牽引力:{GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}範圍: {GOLD}{COMMA} 方格 @@ -3571,6 +3696,8 @@ STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}購買 STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}購買選定的飛機。按住 Shift 點選則只會顯示預估的購買費用 ###length VEHICLE_TYPES +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}購買並改裝選定的車輛。按住 Shift 點選則只會顯示預估的購買費用 +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}購買並改裝選定的船舶。按住 Shift 點選則只會顯示預估的購買費用 STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}購買並改裝選定的飛機。按住 Shift 點選則只會顯示預估的購買費用 ###length VEHICLE_TYPES @@ -3704,6 +3831,7 @@ STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE :單軌機車頭 STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :磁浮機車頭 STR_ENGINE_PREVIEW_ROAD_VEHICLE :車輛 +STR_ENGINE_PREVIEW_TRAM_VEHICLE :有軌電車運具 STR_ENGINE_PREVIEW_AIRCRAFT :飛機 STR_ENGINE_PREVIEW_SHIP :船舶 @@ -3711,6 +3839,8 @@ STR_ENGINE_PREVIEW_SHIP :船舶 STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}費用:{CURRENCY_LONG} 載重:{WEIGHT_SHORT}{}速度:{VELOCITY} 功率:{POWER}{}營運成本:{CURRENCY_LONG} / 年{}容量:{CARGO_LONG} STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}費用:{CURRENCY_LONG} 載重:{WEIGHT_SHORT}{}速度:{VELOCITY} 功率:{POWER} 最大牽引力:{6:FORCE}{}營運成本:{4:CURRENCY_LONG}/年{}容量:{5:CARGO_LONG} STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}費用:{CURRENCY_LONG} 最高速度:{VELOCITY}{}容量:{CARGO_LONG}{}營運成本:{CURRENCY_LONG}/年 +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}費用: {CURRENCY_LONG} 最高速度: {VELOCITY}{}航空運具型號: {STRING}{}容量: {CARGO_LONG}{}營運成本: {CURRENCY_LONG}/年 +STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}費用: {CURRENCY_LONG} 最高速度: {VELOCITY}{}航空運具型號: {STRING} 距離: {COMMA} 格{}容量: {CARGO_LONG}, {CARGO_LONG}{}營運成本: {CURRENCY_LONG}/年 # Autoreplace window STR_REPLACE_VEHICLES_WHITE :{WHITE}替換 {STRING} - {STRING} @@ -3742,6 +3872,7 @@ STR_REPLACE_HELP_STOP_BUTTON :{BLACK}按下 STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}在車頭及車廂替換畫面間切換。 STR_REPLACE_ENGINES :車頭 STR_REPLACE_WAGONS :車廂 +STR_REPLACE_ALL_RAILTYPE :所有的軌道運具 STR_REPLACE_ALL_ROADTYPE :所有公路車輛 ###length 2 @@ -3755,13 +3886,17 @@ STR_REPLACE_MONORAIL_VEHICLES :單軌列車 STR_REPLACE_MAGLEV_VEHICLES :磁浮列車 STR_REPLACE_ROAD_VEHICLES :車輛 +STR_REPLACE_TRAM_VEHICLES :有軌電車運具 +STR_REPLACE_REMOVE_WAGON :{BLACK}移除車廂({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}如果替換後的車廂較長的話,讓自動替換功能移除多餘的車廂 (從頭開始) 以便維持列車長度 +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. 按住Ctrl並點擊以套用到所有子群組 # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} ###length VEHICLE_TYPES +STR_VEHICLE_VIEW_AIRCRAFT_CENTER_TOOLTIP :{BLACK}將飛機置於畫面中央。雙擊將會使視野跟隨飛機。 按住 Ctrl 點選可於飛機位置開啟新視窗視野 ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_SEND_TO_DEPOT_TOOLTIP :{BLACK}將列車送回機廠,按住 CTRL 點選機廠則僅做維護 @@ -3798,6 +3933,9 @@ STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}顯示 STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}顯示飛機詳細資料 ###length VEHICLE_TYPES +STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}目前列車狀態 - 點擊以停止/起動運具 +STR_VEHICLE_VIEW_ROAD_VEHICLE_STATUS_START_STOP_TOOLTIP :{BLACK}目前列車狀態 - 點擊以停止/起動運具 +STR_VEHICLE_VIEW_SHIP_STATE_STATUS_STOP_TOOLTIP :{BLACK}目前船舶狀態 - 點擊以停止/起動運具 # Messages in the start stop button in the vehicle view STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}正在裝卸貨物 @@ -3842,6 +3980,8 @@ STR_VEHICLE_INFO_AGE :{COMMA} 年 ({C STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} 年 ({COMMA}) STR_VEHICLE_INFO_MAX_SPEED :{BLACK}最高速度:{LTBLUE}{VELOCITY} +STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}最大速度: {LTBLUE}{VELOCITY} {BLACK}空中運具型號: {LTBLUE}{STRING} +STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}最高速度: {LTBLUE}{VELOCITY} {BLACK}航空運具型號: {LTBLUE}{STRING} {BLACK}距離: {LTBLUE}{COMMA} 格 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}載重:{LTBLUE}{WEIGHT_SHORT} {BLACK}功率:{LTBLUE}{POWER}{BLACK} 最高速度:{LTBLUE}{VELOCITY} STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}載重:{LTBLUE}{WEIGHT_SHORT} {BLACK}功率:{LTBLUE}{POWER}{BLACK} 最高速度:{LTBLUE}{VELOCITY} {BLACK}最大牽引力:{LTBLUE}{FORCE} @@ -3980,6 +4120,7 @@ STR_ORDER_CONDITIONAL_AGE :年齡 (年) STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :需要維護 STR_ORDER_CONDITIONAL_UNCONDITIONALLY :總是 STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :剩餘年限 (年) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :最大可靠度 ###next-name-looks-similar STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}運輸工具相關數字與指定數值比對的條件 @@ -4215,6 +4356,8 @@ STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}選擇 STR_AI_LIST_CANCEL :{BLACK}取消 STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}不改變腳本 +STR_SCREENSHOT_CAPTION :{WHITE}螢幕截圖 +STR_SCREENSHOT_WORLD_SCREENSHOT :{BLACK}截圖整張地圖 # AI Parameters STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} 參數 @@ -4275,6 +4418,7 @@ STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :該存檔是由 STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE :檔案無法讀取 STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE :檔案無法寫入 STR_GAME_SAVELOAD_ERROR_DATA_INTEGRITY_CHECK_FAILED :資料完整性檢查失敗 +STR_GAME_SAVELOAD_ERROR_PATCHPACK :該存檔是由被修改過的遊戲所產生 STR_GAME_SAVELOAD_NOT_AVAILABLE :<無法使用> STR_WARNING_LOADGAME_REMOVED_TRAMS :{WHITE}此存檔版本不支援路面電車,已移除所有路面電車 @@ -4481,6 +4625,7 @@ STR_ERROR_DEPOT_WRONG_DEPOT_TYPE :錯誤的機廠 STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE} 將在替換後過長 STR_ERROR_AUTOREPLACE_NOTHING_TO_DO :{WHITE}無自動替換/翻新的規則可套用 STR_ERROR_AUTOREPLACE_MONEY_LIMIT :(金錢限制) +STR_ERROR_AUTOREPLACE_INCOMPATIBLE_CARGO :{WHITE}新的運具無法運輸 {STRING} # Rail construction errors STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION :{WHITE}不合理的軌道組合 @@ -4508,6 +4653,9 @@ STR_ERROR_CAN_T_REMOVE_ROAD_FROM :{WHITE}不能 STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM :{WHITE}無法移除此處的電車軌... STR_ERROR_THERE_IS_NO_ROAD :{WHITE}... 這裡沒有道路 STR_ERROR_THERE_IS_NO_TRAMWAY :{WHITE}... 這裡沒有電車軌 +STR_ERROR_CAN_T_CONVERT_ROAD :{WHITE}無法轉換此處的道路類型... +STR_ERROR_NO_SUITABLE_ROAD :{WHITE}沒有適合的道路 +STR_ERROR_NO_SUITABLE_TRAMWAY :{WHITE}沒有合適的電車軌道 # Waterway construction errors STR_ERROR_CAN_T_BUILD_CANALS :{WHITE}無法在此興建運河... @@ -4682,6 +4830,7 @@ STR_BASESOUNDS_DOS_DESCRIPTION :原版 Transpor STR_BASESOUNDS_WIN_DESCRIPTION :原版 Transport Tycoon Deluxe Windows 版的音效。 STR_BASESOUNDS_NONE_DESCRIPTION :不含任何音效的音效集。 STR_BASEMUSIC_WIN_DESCRIPTION :原版 Transport Tycoon Deluxe Windows 版的音樂。 +STR_BASEMUSIC_DOS_DESCRIPTION :原版 Transport Tycoon Deluxe DOS 版的音樂。 STR_BASEMUSIC_NONE_DESCRIPTION :不含任何音樂的音樂集。 ##id 0x2000 @@ -5078,6 +5227,7 @@ STR_FORMAT_DATE_ISO :{2:NUM}-{1:STRI STR_FORMAT_COMPANY_NUM :(公司 {COMMA}) STR_FORMAT_GROUP_NAME :群組 {COMMA} +STR_FORMAT_GROUP_VEHICLE_NAME :{GROUP} #{COMMA} STR_FORMAT_INDUSTRY_NAME :{TOWN} {STRING} ###length 2 From 39e8783f4b8d24a27d28f99905acf8f54dec24fa Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Thu, 28 Oct 2021 23:10:03 +0200 Subject: [PATCH 102/710] Fix: Template syntax error when using 'span' with a container type. --- src/core/CMakeLists.txt | 1 + src/core/span_type.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 96da089326..b94ed77e91 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -26,5 +26,6 @@ add_files( smallmatrix_type.hpp smallstack_type.hpp smallvec_type.hpp + span_type.hpp string_compare_type.hpp ) diff --git a/src/core/span_type.hpp b/src/core/span_type.hpp index 03bc678b7e..614be84567 100644 --- a/src/core/span_type.hpp +++ b/src/core/span_type.hpp @@ -31,8 +31,8 @@ struct is_compatible_element < C, E, std::void_t< decltype(std::data(std::declval())), - typename std::remove_pointer()))>::type(*)[]> -> : std::is_convertible()))>::type(*)[], E(*)[]>{}; + typename std::remove_pointer_t()))>(*)[]> +> : std::is_convertible()))>(*)[], E(*)[]>{}; /* Template to check if a container is compatible. gsl-lite also includes is_array and is_std_array, but as we don't use them, they are omitted. */ template From b6933a2ebdf66c5fb23b2226d3ce07d71426d7d2 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 3 Oct 2021 15:39:49 +0200 Subject: [PATCH 103/710] Codechange: Move command arguments to the back of the DoCommand function call. --- src/aircraft_cmd.cpp | 6 ++-- src/autoreplace_cmd.cpp | 28 +++++++++---------- src/bridge_gui.cpp | 2 +- src/build_vehicle_gui.cpp | 2 +- src/clear_cmd.cpp | 2 +- src/command.cpp | 8 +++--- src/command_func.h | 2 +- src/company_cmd.cpp | 2 +- src/disaster_vehicle.cpp | 4 +-- src/economy.cpp | 10 +++---- src/group_cmd.cpp | 8 +++--- src/industry_cmd.cpp | 14 +++++----- src/landscape.cpp | 4 +-- src/misc_gui.cpp | 2 +- src/object_cmd.cpp | 12 ++++---- src/order_backup.cpp | 4 +-- src/order_cmd.cpp | 2 +- src/rail_cmd.cpp | 24 ++++++++-------- src/rail_gui.cpp | 2 +- src/road_cmd.cpp | 20 +++++++------- src/road_gui.cpp | 2 +- src/roadveh_cmd.cpp | 2 +- src/script/api/script_vehicle.cpp | 4 +-- src/station_cmd.cpp | 22 +++++++-------- src/terraform_cmd.cpp | 6 ++-- src/terraform_gui.cpp | 2 +- src/town_cmd.cpp | 46 +++++++++++++++---------------- src/train_cmd.cpp | 6 ++-- src/tree_cmd.cpp | 4 +-- src/tunnelbridge_cmd.cpp | 16 +++++------ src/vehicle.cpp | 8 +++--- src/vehicle_cmd.cpp | 30 ++++++++++---------- src/vehicle_gui.cpp | 4 +-- src/water_cmd.cpp | 22 +++++++-------- src/waypoint_cmd.cpp | 2 +- 35 files changed, 167 insertions(+), 167 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 4c4ed5a46a..1f52bbecd2 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1274,7 +1274,7 @@ void HandleMissingAircraftOrders(Aircraft *v) const Station *st = GetTargetAirportIfValid(v); if (st == nullptr) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost ret = DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT); + CommandCost ret = DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index, 0); cur_company.Restore(); if (ret.Failed()) CrashAirplane(v); @@ -1637,7 +1637,7 @@ static void AircraftEventHandler_HeliTakeOff(Aircraft *v, const AirportFTAClass /* Send the helicopter to a hangar if needed for replacement */ if (v->NeedsAutomaticServicing()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - DoCommand(v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0, DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT); + DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0); cur_company.Restore(); } } @@ -1688,7 +1688,7 @@ static void AircraftEventHandler_Landing(Aircraft *v, const AirportFTAClass *apc /* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */ if (v->NeedsAutomaticServicing()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - DoCommand(v->tile, v->index | DEPOT_SERVICE, 0, DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT); + DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | DEPOT_SERVICE, 0); cur_company.Restore(); } } diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 4f9cf92bb4..617c3bc6c1 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -340,7 +340,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic } /* Build the new vehicle */ - cost = DoCommand(old_veh->tile, e | (CT_INVALID << 24), 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh)); + cost = DoCommand(DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh), old_veh->tile, e | (CT_INVALID << 24), 0); if (cost.Failed()) return cost; Vehicle *new_veh = Vehicle::Get(_new_vehicle_id); @@ -350,13 +350,13 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic if (refit_cargo != CT_NO_REFIT) { byte subtype = GetBestFittingSubType(old_veh, new_veh, refit_cargo); - cost.AddCost(DoCommand(0, new_veh->index, refit_cargo | (subtype << 8), DC_EXEC, GetCmdRefitVeh(new_veh))); + cost.AddCost(DoCommand(DC_EXEC, GetCmdRefitVeh(new_veh), 0, new_veh->index, refit_cargo | (subtype << 8))); assert(cost.Succeeded()); // This should be ensured by GetNewCargoTypeForReplace() } /* Try to reverse the vehicle, but do not care if it fails as the new type might not be reversible */ if (new_veh->type == VEH_TRAIN && HasBit(Train::From(old_veh)->flags, VRF_REVERSE_DIRECTION)) { - DoCommand(0, new_veh->index, true, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION); + DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, 0, new_veh->index, true); } return cost; @@ -370,7 +370,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic */ static inline CommandCost CmdStartStopVehicle(const Vehicle *v, bool evaluate_callback) { - return DoCommand(0, v->index, evaluate_callback ? 1 : 0, DC_EXEC | DC_AUTOREPLACE, CMD_START_STOP_VEHICLE); + return DoCommand(DC_EXEC | DC_AUTOREPLACE, CMD_START_STOP_VEHICLE, 0, v->index, evaluate_callback ? 1 : 0); } /** @@ -383,7 +383,7 @@ static inline CommandCost CmdStartStopVehicle(const Vehicle *v, bool evaluate_ca */ static inline CommandCost CmdMoveVehicle(const Vehicle *v, const Vehicle *after, DoCommandFlag flags, bool whole_chain) { - return DoCommand(0, v->index | (whole_chain ? 1 : 0) << 20, after != nullptr ? after->index : INVALID_VEHICLE, flags | DC_NO_CARGO_CAP_CHECK, CMD_MOVE_RAIL_VEHICLE); + return DoCommand(flags | DC_NO_CARGO_CAP_CHECK, CMD_MOVE_RAIL_VEHICLE, 0, v->index | (whole_chain ? 1 : 0) << 20, after != nullptr ? after->index : INVALID_VEHICLE); } /** @@ -397,10 +397,10 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head, CommandCost cost = CommandCost(); /* Share orders */ - if (cost.Succeeded() && old_head != new_head) cost.AddCost(DoCommand(0, new_head->index | CO_SHARE << 30, old_head->index, DC_EXEC, CMD_CLONE_ORDER)); + if (cost.Succeeded() && old_head != new_head) cost.AddCost(DoCommand(DC_EXEC, CMD_CLONE_ORDER, 0, new_head->index | CO_SHARE << 30, old_head->index)); /* Copy group membership */ - if (cost.Succeeded() && old_head != new_head) cost.AddCost(DoCommand(0, old_head->group_id, new_head->index, DC_EXEC, CMD_ADD_VEHICLE_GROUP)); + if (cost.Succeeded() && old_head != new_head) cost.AddCost(DoCommand(DC_EXEC, CMD_ADD_VEHICLE_GROUP, 0, old_head->group_id, new_head->index)); /* Perform start/stop check whether the new vehicle suits newgrf restrictions etc. */ if (cost.Succeeded()) { @@ -466,11 +466,11 @@ static CommandCost ReplaceFreeUnit(Vehicle **single_unit, DoCommandFlag flags, b } /* Sell the old vehicle */ - cost.AddCost(DoCommand(0, old_v->index, 0, flags, GetCmdSellVeh(old_v))); + cost.AddCost(DoCommand(flags, GetCmdSellVeh(old_v), 0, old_v->index, 0)); /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - DoCommand(0, new_v->index, 0, DC_EXEC, GetCmdSellVeh(new_v)); + DoCommand(DC_EXEC, GetCmdSellVeh(new_v), 0, new_v->index, 0); } } @@ -597,7 +597,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon assert(RailVehInfo(wagon->engine_type)->railveh_type == RAILVEH_WAGON); /* Sell wagon */ - [[maybe_unused]] CommandCost ret = DoCommand(0, wagon->index, 0, DC_EXEC, GetCmdSellVeh(wagon)); + [[maybe_unused]] CommandCost ret = DoCommand(DC_EXEC, GetCmdSellVeh(wagon), 0, wagon->index, 0); assert(ret.Succeeded()); new_vehs[i] = nullptr; @@ -629,7 +629,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon /* Sell the vehicle. * Note: This might temporarily construct new trains, so use DC_AUTOREPLACE to prevent * it from failing due to engine limits. */ - cost.AddCost(DoCommand(0, w->index, 0, flags | DC_AUTOREPLACE, GetCmdSellVeh(w))); + cost.AddCost(DoCommand(flags | DC_AUTOREPLACE, GetCmdSellVeh(w), 0, w->index, 0)); if ((flags & DC_EXEC) != 0) { old_vehs[i] = nullptr; if (i == 0) old_head = nullptr; @@ -660,7 +660,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon if ((flags & DC_EXEC) == 0) { for (int i = num_units - 1; i >= 0; i--) { if (new_vehs[i] != nullptr) { - DoCommand(0, new_vehs[i]->index, 0, DC_EXEC, GetCmdSellVeh(new_vehs[i])); + DoCommand(DC_EXEC, GetCmdSellVeh(new_vehs[i]), 0, new_vehs[i]->index, 0); new_vehs[i] = nullptr; } } @@ -691,12 +691,12 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon } /* Sell the old vehicle */ - cost.AddCost(DoCommand(0, old_head->index, 0, flags, GetCmdSellVeh(old_head))); + cost.AddCost(DoCommand(flags, GetCmdSellVeh(old_head), 0, old_head->index, 0)); } /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - DoCommand(0, new_head->index, 0, DC_EXEC, GetCmdSellVeh(new_head)); + DoCommand(DC_EXEC, GetCmdSellVeh(new_head), 0, new_head->index, 0); } } } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 74c7234d57..9e6fc4eeef 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -390,7 +390,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo /* only query bridge building possibility once, result is the same for all bridges! * returns CMD_ERROR on failure, and price on success */ StringID errmsg = INVALID_STRING_ID; - CommandCost ret = DoCommand(end, start, type, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)) | DC_QUERY_COST, CMD_BUILD_BRIDGE); + CommandCost ret = DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)) | DC_QUERY_COST, CMD_BUILD_BRIDGE, end, start, type); GUIBridgeList *bl = nullptr; if (ret.Failed()) { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 547ac3e003..6bee767b0c 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1226,7 +1226,7 @@ struct BuildVehicleWindow : Window { if (!this->listview_mode) { /* Query for cost and refitted capacity */ - CommandCost ret = DoCommand(this->window_number, this->sel_engine | (cargo << 24), 0, DC_QUERY_COST, GetCmdBuildVeh(this->vehicle_type)); + CommandCost ret = DoCommand(DC_QUERY_COST, GetCmdBuildVeh(this->vehicle_type), this->window_number, this->sel_engine | (cargo << 24), 0); if (ret.Succeeded()) { this->te.cost = ret.GetCost() - e->GetCost(); this->te.capacity = _returned_refit_capacity; diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index 4036313123..918f5c373c 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -381,7 +381,7 @@ static void ChangeTileOwner_Clear(TileIndex tile, Owner old_owner, Owner new_own static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } extern const TileTypeProcs _tile_type_clear_procs = { diff --git a/src/command.cpp b/src/command.cpp index 7d1a72dec9..b971ccb6bd 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -449,23 +449,23 @@ static int _docommand_recursive = 0; */ CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags) { - return DoCommand(container->tile, container->p1, container->p2, flags, container->cmd & CMD_ID_MASK, container->text); + return DoCommand(flags, container->cmd & CMD_ID_MASK, container->tile, container->p1, container->p2, container->text); } /*! * This function executes a given command with the parameters from the #CommandProc parameter list. * Depending on the flags parameter it execute or test a command. * + * @param flags Flags for the command and how to execute the command + * @param cmd The command-id to execute (a value of the CMD_* enums) * @param tile The tile to apply the command on (for the #CommandProc) * @param p1 Additional data for the command (for the #CommandProc) * @param p2 Additional data for the command (for the #CommandProc) - * @param flags Flags for the command and how to execute the command - * @param cmd The command-id to execute (a value of the CMD_* enums) * @param text The text to pass * @see CommandProc * @return the cost */ -CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, uint32 cmd, const std::string &text) +CommandCost DoCommand(DoCommandFlag flags, uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost res; diff --git a/src/command_func.h b/src/command_func.h index 426283bd3a..07de8de9c0 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -32,7 +32,7 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); */ #define return_cmd_error(errcode) return CommandCost(errcode); -CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, uint32 cmd, const std::string &text = {}); +CommandCost DoCommand(DoCommandFlag flags, uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags); bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback = nullptr, const std::string &text = {}, bool my_cmd = true); diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 7549212849..ce7488f037 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -1127,7 +1127,7 @@ CommandCost CmdRenamePresident(TileIndex tile, DoCommandFlag flags, uint32 p1, u c->president_name = text; if (c->name_1 == STR_SV_UNNAMED && c->name.empty()) { - DoCommand(0, 0, 0, DC_EXEC, CMD_RENAME_COMPANY, text + " Transport"); + DoCommand(DC_EXEC, CMD_RENAME_COMPANY, 0, 0, 0, text + " Transport"); } } diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index cc245b38fe..126e48f5fc 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -61,7 +61,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_RAILWAY: if (Company::IsHumanID(GetTileOwner(tile)) && !IsRailDepot(tile)) { Backup cur_company(_current_company, OWNER_WATER, FILE_LINE); - DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); cur_company.Restore(); /* update signals in buffer */ @@ -71,7 +71,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_HOUSE: { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); cur_company.Restore(); break; } diff --git a/src/economy.cpp b/src/economy.cpp index 936fba7896..5c25636454 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -312,7 +312,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) for (i = 0; i < 4; i++) { if (c->share_owners[i] == old_owner) { /* Sell its shares */ - CommandCost res = DoCommand(0, c->index, 0, DC_EXEC | DC_BANKRUPT, CMD_SELL_SHARE_IN_COMPANY); + CommandCost res = DoCommand(DC_EXEC | DC_BANKRUPT, CMD_SELL_SHARE_IN_COMPANY, 0, c->index, 0); /* Because we are in a DoCommand, we can't just execute another one and * expect the money to be removed. We need to do it ourself! */ SubtractMoneyFromCompany(res); @@ -332,7 +332,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) } else { cur_company2.Change(c->share_owners[i]); /* Sell the shares */ - CommandCost res = DoCommand(0, old_owner, 0, DC_EXEC | DC_BANKRUPT, CMD_SELL_SHARE_IN_COMPANY); + CommandCost res = DoCommand(DC_EXEC | DC_BANKRUPT, CMD_SELL_SHARE_IN_COMPANY, 0, old_owner, 0); /* Because we are in a DoCommand, we can't just execute another one and * expect the money to be removed. We need to do it ourself! */ SubtractMoneyFromCompany(res); @@ -448,7 +448,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) * However, do not rely on that behaviour. */ int interval = CompanyServiceInterval(new_company, v->type); - DoCommand(v->tile, v->index, interval | (new_company->settings.vehicle.servint_ispercent << 17), DC_EXEC | DC_BANKRUPT, CMD_CHANGE_SERVICE_INT); + DoCommand(DC_EXEC | DC_BANKRUPT, CMD_CHANGE_SERVICE_INT, v->tile, v->index, interval | (new_company->settings.vehicle.servint_ispercent << 17)); } v->owner = new_owner; @@ -1485,7 +1485,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station if (st->goods[cid].cargo.HasCargoFor(next_station)) { /* Try to find out if auto-refitting would succeed. In case the refit is allowed, * the returned refit capacity will be greater than zero. */ - DoCommand(v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16, DC_QUERY_COST, GetCmdRefitVeh(v_start)); // Auto-refit and only this vehicle including artic parts. + DoCommand(DC_QUERY_COST, GetCmdRefitVeh(v_start), v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. /* Try to balance different loadable cargoes between parts of the consist, so that * all of them can be loaded. Avoid a situation where all vehicles suddenly switch * to the first loadable cargo for which there is only one packet. If the capacities @@ -1508,7 +1508,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station * "via any station" before reserving. We rather produce some more "any station" cargo than * misrouting it. */ IterateVehicleParts(v_start, ReturnCargoAction(st, INVALID_STATION)); - CommandCost cost = DoCommand(v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16, DC_EXEC, GetCmdRefitVeh(v_start)); // Auto-refit and only this vehicle including artic parts. + CommandCost cost = DoCommand(DC_EXEC, GetCmdRefitVeh(v_start), v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. if (cost.Succeeded()) v->First()->profit_this_year -= cost.GetCost() << 8; } diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index 50b361d007..ec4358f765 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -356,12 +356,12 @@ CommandCost CmdDeleteGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (g == nullptr || g->owner != _current_company) return CMD_ERROR; /* Remove all vehicles from the group */ - DoCommand(0, p1, 0, flags, CMD_REMOVE_ALL_VEHICLES_GROUP); + DoCommand(flags, CMD_REMOVE_ALL_VEHICLES_GROUP, 0, p1, 0); /* Delete sub-groups */ for (const Group *gp : Group::Iterate()) { if (gp->parent == g->index) { - DoCommand(0, gp->index, 0, flags, CMD_DELETE_GROUP); + DoCommand(flags, CMD_DELETE_GROUP, 0, gp->index, 0); } } @@ -580,7 +580,7 @@ CommandCost CmdAddSharedVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 /* For each shared vehicles add it to the group */ for (Vehicle *v2 = v->FirstShared(); v2 != nullptr; v2 = v2->NextShared()) { - if (v2->group_id != id_g) DoCommand(tile, id_g, v2->index, flags, CMD_ADD_VEHICLE_GROUP, text); + if (v2->group_id != id_g) DoCommand(flags, CMD_ADD_VEHICLE_GROUP, tile, id_g, v2->index, text); } } } @@ -616,7 +616,7 @@ CommandCost CmdRemoveAllVehiclesGroup(TileIndex tile, DoCommandFlag flags, uint3 if (v->group_id != old_g) continue; /* Add The Vehicle to the default group */ - DoCommand(tile, DEFAULT_GROUP, v->index, flags, CMD_ADD_VEHICLE_GROUP, text); + DoCommand(flags, CMD_ADD_VEHICLE_GROUP, tile, DEFAULT_GROUP, v->index, text); } } diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index b03a722b78..529e01edbe 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1100,7 +1100,7 @@ static bool SearchLumberMillTrees(TileIndex tile, void *user_data) _industry_sound_tile = tile; if (_settings_client.sound.ambient) SndPlayTileFx(SND_38_LUMBER_MILL_1, tile); - DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); cur_company.Restore(); return true; @@ -1482,13 +1482,13 @@ static CommandCost CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTil /* Clear the tiles as OWNER_TOWN to not affect town rating, and to not clear protected buildings */ Backup cur_company(_current_company, OWNER_TOWN, FILE_LINE); - CommandCost ret = DoCommand(cur_tile, 0, 0, DC_NONE, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(DC_NONE, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); cur_company.Restore(); if (ret.Failed()) return ret; } else { /* Clear the tiles, but do not affect town ratings */ - CommandCost ret = DoCommand(cur_tile, 0, 0, DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); if (ret.Failed()) return ret; } @@ -1598,7 +1598,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, } /* This is not 100% correct check, but the best we can do without modifying the map. * What is missing, is if the difference in height is more than 1.. */ - if (DoCommand(tile_walk, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND).Failed()) { + if (DoCommand(flags & ~DC_EXEC, CMD_TERRAFORM_LAND, tile_walk, SLOPE_N, (curh > h) ? 0 : 1).Failed()) { cur_company.Restore(); return false; } @@ -1613,7 +1613,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, /* We give the terraforming for free here, because we can't calculate * exact cost in the test-round, and as we all know, that will cause * a nice assert if they don't match ;) */ - DoCommand(tile_walk, SLOPE_N, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND); + DoCommand(flags, CMD_TERRAFORM_LAND, tile_walk, SLOPE_N, (curh > h) ? 0 : 1); curh += (curh > h) ? -1 : 1; } } @@ -1883,7 +1883,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, WaterClass wc = (IsWaterTile(cur_tile) ? GetWaterClass(cur_tile) : WATER_CLASS_INVALID); - DoCommand(cur_tile, 0, 0, DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); MakeIndustry(cur_tile, i->index, it.gfx, Random(), wc); @@ -3059,7 +3059,7 @@ static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, i } } } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } extern const TileTypeProcs _tile_type_industry_procs = { diff --git a/src/landscape.cpp b/src/landscape.cpp index f13d1835f7..242ee089ac 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -755,7 +755,7 @@ CommandCost CmdClearArea(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 TileIterator *iter = HasBit(p2, 0) ? (TileIterator *)new DiagonalTileIterator(tile, p1) : new OrthogonalTileIterator(tile, p1); for (; *iter != INVALID_TILE; ++(*iter)) { TileIndex t = *iter; - CommandCost ret = DoCommand(t, 0, 0, flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR, t, 0, 0); if (ret.Failed()) { last_error = ret; @@ -772,7 +772,7 @@ CommandCost CmdClearArea(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 delete iter; return cost; } - DoCommand(t, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + DoCommand(flags, CMD_LANDSCAPE_CLEAR, t, 0, 0); /* draw explosion animation... * Disable explosions when game is paused. Looks silly and blocks the view. */ diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index f0492925d8..859798deb1 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -191,7 +191,7 @@ public: Company *c = Company::GetIfValid(_local_company); if (c != nullptr) { assert(_current_company == _local_company); - CommandCost costclear = DoCommand(tile, 0, 0, DC_QUERY_COST, CMD_LANDSCAPE_CLEAR); + CommandCost costclear = DoCommand(DC_QUERY_COST, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (costclear.Succeeded()) { Money cost = costclear.GetCost(); if (cost < 0) { diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 7e1e36c1f1..328cadd93d 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -229,7 +229,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (type == OBJECT_OWNED_LAND) { /* Owned land is special as it can be placed on any slope. */ - cost.AddCost(DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR)); + cost.AddCost(DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0)); } else { /* Check the surface to build on. At this time we can't actually execute the * the CLEAR_TILE commands since the newgrf callback later on can check @@ -242,7 +242,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (!IsWaterTile(t)) { /* Normal water tiles don't have to be cleared. For all other tile types clear * the tile but leave the water. */ - cost.AddCost(DoCommand(t, 0, 0, flags & ~DC_NO_WATER & ~DC_EXEC, CMD_LANDSCAPE_CLEAR)); + cost.AddCost(DoCommand(flags & ~DC_NO_WATER & ~DC_EXEC, CMD_LANDSCAPE_CLEAR, t, 0, 0)); } else { /* Can't build on water owned by another company. */ Owner o = GetTileOwner(t); @@ -260,7 +260,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 IsTileType(t, MP_OBJECT) && IsTileOwner(t, _current_company) && IsObjectType(t, OBJECT_HQ))) { - cost.AddCost(DoCommand(t, 0, 0, flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR)); + cost.AddCost(DoCommand(flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR, t, 0, 0)); } } } @@ -292,10 +292,10 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 for (TileIndex t : ta) { if (HasTileWaterGround(t)) { if (!IsWaterTile(t)) { - DoCommand(t, 0, 0, (flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR); + DoCommand((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, t, 0, 0); } } else { - DoCommand(t, 0, 0, flags | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR); + DoCommand(flags | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, t, 0, 0); } } } @@ -847,7 +847,7 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, int } } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } extern const TileTypeProcs _tile_type_object_procs = { diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 37579a3198..8b8c2685f6 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -73,7 +73,7 @@ void OrderBackup::DoRestore(Vehicle *v) { /* If we had shared orders, recover that */ if (this->clone != nullptr) { - DoCommand(0, v->index | CO_SHARE << 30, this->clone->index, DC_EXEC, CMD_CLONE_ORDER); + DoCommand(DC_EXEC, CMD_CLONE_ORDER, 0, v->index | CO_SHARE << 30, this->clone->index); } else if (this->orders != nullptr && OrderList::CanAllocateItem()) { v->orders.list = new OrderList(this->orders, v); this->orders = nullptr; @@ -88,7 +88,7 @@ void OrderBackup::DoRestore(Vehicle *v) if (v->cur_implicit_order_index >= v->GetNumOrders()) v->cur_implicit_order_index = v->cur_real_order_index; /* Restore vehicle group */ - DoCommand(0, this->group, v->index, DC_EXEC, CMD_ADD_VEHICLE_GROUP); + DoCommand(DC_EXEC, CMD_ADD_VEHICLE_GROUP, 0, this->group, v->index); } /** diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index f282ca12bd..b681b63796 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -2036,7 +2036,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo()); /* If there is no depot in front, reverse automatically (trains only) */ - if (v->type == VEH_TRAIN && reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION); + if (v->type == VEH_TRAIN && reverse) DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, v->tile, v->index, 0); if (v->type == VEH_AIRCRAFT) { Aircraft *a = Aircraft::From(v); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 4c34f1ca86..8ff8d64539 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -451,7 +451,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u CommandCost ret = CheckTileOwnership(tile); if (ret.Failed()) return ret; - if (!IsPlainRail(tile)) return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); // just get appropriate error message + if (!IsPlainRail(tile)) return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); // just get appropriate error message if (!IsCompatibleRail(GetRailType(tile), railtype)) return_cmd_error(STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION); @@ -469,7 +469,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u for (Track track_it = TRACK_BEGIN; track_it < TRACK_END; track_it++) { if (HasTrack(tile, track_it) && HasSignalOnTrack(tile, track_it)) { - CommandCost ret_remove_signals = DoCommand(tile, track_it, 0, flags, CMD_REMOVE_SIGNALS); + CommandCost ret_remove_signals = DoCommand(flags, CMD_REMOVE_SIGNALS, tile, track_it, 0); if (ret_remove_signals.Failed()) return ret_remove_signals; cost.AddCost(ret_remove_signals); } @@ -481,7 +481,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u * the present rail type are powered on the new rail type. */ if (GetRailType(tile) != railtype && !HasPowerOnRail(railtype, GetRailType(tile))) { if (HasPowerOnRail(GetRailType(tile), railtype)) { - ret = DoCommand(tile, tile, railtype, flags, CMD_CONVERT_RAIL); + ret = DoCommand(flags, CMD_CONVERT_RAIL, tile, tile, railtype); if (ret.Failed()) return ret; cost.AddCost(ret); } else { @@ -581,7 +581,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (ret.Failed()) return ret; cost.AddCost(ret); - ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -691,7 +691,7 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, /* Charge extra to remove signals on the track, if they are there */ if (HasSignalOnTrack(tile, track)) { - cost.AddCost(DoCommand(tile, track, 0, flags, CMD_REMOVE_SIGNALS)); + cost.AddCost(DoCommand(flags, CMD_REMOVE_SIGNALS, tile, track, 0)); } if (flags & DC_EXEC) { @@ -784,7 +784,7 @@ bool FloodHalftile(TileIndex t) TrackBits to_remove = lower_track & rail_bits; if (to_remove != 0) { Backup cur_company(_current_company, OWNER_WATER, FILE_LINE); - flooded = DoCommand(t, 0, FIND_FIRST_BIT(to_remove), DC_EXEC, CMD_REMOVE_SINGLE_RAIL).Succeeded(); + flooded = DoCommand(DC_EXEC, CMD_REMOVE_SINGLE_RAIL, t, 0, FIND_FIRST_BIT(to_remove)).Succeeded(); cur_company.Restore(); if (!flooded) return flooded; // not yet floodable rail_bits = rail_bits & ~to_remove; @@ -903,7 +903,7 @@ static CommandCost CmdRailTrackHelper(TileIndex tile, DoCommandFlag flags, uint3 bool had_success = false; CommandCost last_error = CMD_ERROR; for (;;) { - CommandCost ret = DoCommand(tile, remove ? 0 : railtype, TrackdirToTrack(trackdir) | (auto_remove_signals << 3), flags, remove ? CMD_REMOVE_SINGLE_RAIL : CMD_BUILD_SINGLE_RAIL); + CommandCost ret = DoCommand(flags, remove ? CMD_REMOVE_SINGLE_RAIL : CMD_BUILD_SINGLE_RAIL, tile, remove ? 0 : railtype, TrackdirToTrack(trackdir) | (auto_remove_signals << 3)); if (ret.Failed()) { last_error = ret; @@ -1007,7 +1007,7 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u cost.AddCost(_price[PR_BUILD_FOUNDATION]); } - cost.AddCost(DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR)); + cost.AddCost(DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0)); if (cost.Failed()) return cost; if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -1358,7 +1358,7 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(trackdir); if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(trackdir); - CommandCost ret = DoCommand(tile, param1, signals, test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS); + CommandCost ret = DoCommand(test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS, tile, param1, signals); if (test_only) return ret.Succeeded(); @@ -1878,7 +1878,7 @@ static CommandCost ClearTile_Track(TileIndex tile, DoCommandFlag flags) TrackBits tracks = GetTrackBits(tile); while (tracks != TRACK_BIT_NONE) { Track track = RemoveFirstTrack(&tracks); - CommandCost ret = DoCommand(tile, 0, track, flags, CMD_REMOVE_SINGLE_RAIL); + CommandCost ret = DoCommand(flags, CMD_REMOVE_SINGLE_RAIL, tile, 0, track); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -2952,7 +2952,7 @@ static void ChangeTileOwner_Track(TileIndex tile, Owner old_owner, Owner new_own SetTileOwner(tile, new_owner); } else { - DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } } @@ -3140,7 +3140,7 @@ static CommandCost TerraformTile_Track(TileIndex tile, DoCommandFlag flags, int AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRailDepotDirection(tile))) { return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index c54e172a0c..9ed9032c45 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -756,7 +756,7 @@ struct BuildRailToolbarWindow : Window { void OnPlacePresize(Point pt, TileIndex tile) override { - DoCommand(tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, DC_AUTO, CMD_BUILD_TUNNEL); + DoCommand(DC_AUTO, CMD_BUILD_TUNNEL, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 70a014434e..942cce7a5e 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -366,7 +366,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec if (!IsTileType(tile, MP_ROAD)) { /* If it's the last roadtype, just clear the whole tile */ - if (GetRoadType(tile, OtherRoadTramType(rtt)) == INVALID_ROADTYPE) return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + if (GetRoadType(tile, OtherRoadTramType(rtt)) == INVALID_ROADTYPE) return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); CommandCost cost(EXPENSES_CONSTRUCTION); if (IsTileType(tile, MP_TUNNELBRIDGE)) { @@ -821,7 +821,7 @@ do_clear:; } if (need_to_clear) { - CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -867,7 +867,7 @@ do_clear:; if (HasPowerOnRoad(rt, existing_rt)) { rt = existing_rt; } else if (HasPowerOnRoad(existing_rt, rt)) { - CommandCost ret = DoCommand(tile, tile, rt, flags, CMD_CONVERT_ROAD); + CommandCost ret = DoCommand(flags, CMD_CONVERT_ROAD, tile, tile, rt); if (ret.Failed()) return ret; cost.AddCost(ret); } else { @@ -1038,7 +1038,7 @@ CommandCost CmdBuildLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 p if (tile == start_tile && HasBit(p2, 0)) bits &= DiagDirToRoadBits(dir); } - CommandCost ret = DoCommand(tile, drd << 11 | rt << 4 | bits, 0, flags, CMD_BUILD_ROAD); + CommandCost ret = DoCommand(flags, CMD_BUILD_ROAD, tile, drd << 11 | rt << 4 | bits, 0); if (ret.Failed()) { last_error = ret; if (last_error.GetErrorMessage() != STR_ERROR_ALREADY_BUILT) { @@ -1129,7 +1129,7 @@ CommandCost CmdRemoveLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 if (flags & DC_EXEC) { money_spent += ret.GetCost(); if (money_spent > 0 && money_spent > money_available) { - _additional_cash_required = DoCommand(start_tile, end_tile, p2, flags & ~DC_EXEC, CMD_REMOVE_LONG_ROAD).GetCost(); + _additional_cash_required = DoCommand(flags & ~DC_EXEC, CMD_REMOVE_LONG_ROAD, start_tile, end_tile, p2).GetCost(); return cost; } RemoveRoad(tile, flags, bits, rtt, true, false); @@ -1180,7 +1180,7 @@ CommandCost CmdBuildRoadDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, ui cost.AddCost(_price[PR_BUILD_FOUNDATION]); } - cost.AddCost(DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR)); + cost.AddCost(DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0)); if (cost.Failed()) return cost; if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -1266,7 +1266,7 @@ static CommandCost ClearTile_Road(TileIndex tile, DoCommandFlag flags) } if (flags & DC_EXEC) { - DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } return ret; } @@ -2194,7 +2194,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne if (IsRoadDepot(tile)) { if (GetTileOwner(tile) == old_owner) { if (new_owner == INVALID_OWNER) { - DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } else { /* A road depot has two road bits. No need to dirty windows here, we'll redraw the whole screen anyway. */ RoadType rt = GetRoadTypeRoad(tile); @@ -2231,7 +2231,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne if (IsLevelCrossing(tile)) { if (GetTileOwner(tile) == old_owner) { if (new_owner == INVALID_OWNER) { - DoCommand(tile, 0, GetCrossingRailTrack(tile), DC_EXEC | DC_BANKRUPT, CMD_REMOVE_SINGLE_RAIL); + DoCommand(DC_EXEC | DC_BANKRUPT, CMD_REMOVE_SINGLE_RAIL, tile, 0, GetCrossingRailTrack(tile)); } else { /* Update infrastructure counts. No need to dirty windows here, we'll redraw the whole screen anyway. */ Company::Get(old_owner)->infrastructure.rail[GetRailType(tile)] -= LEVELCROSSING_TRACKBIT_FACTOR; @@ -2280,7 +2280,7 @@ static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, int z } } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } /** Update power of road vehicle under which is the roadtype being converted */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index f6ddbae41f..30d9301aab 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -708,7 +708,7 @@ struct BuildRoadToolbarWindow : Window { void OnPlacePresize(Point pt, TileIndex tile) override { - DoCommand(tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0, DC_AUTO, CMD_BUILD_TUNNEL); + DoCommand(DC_AUTO, CMD_BUILD_TUNNEL, tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 9c444d1d37..b20748fa05 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1133,7 +1133,7 @@ static bool CanBuildTramTrackOnTile(CompanyID c, TileIndex t, RoadType rt, RoadB /* The 'current' company is not necessarily the owner of the vehicle. */ Backup cur_company(_current_company, c, FILE_LINE); - CommandCost ret = DoCommand(t, rt << 4 | r, 0, DC_NO_WATER, CMD_BUILD_ROAD); + CommandCost ret = DoCommand(DC_NO_WATER, CMD_BUILD_ROAD, t, rt << 4 | r, 0); cur_company.Restore(); return ret.Succeeded(); diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index cd5cc5af72..bbd9df55de 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -93,7 +93,7 @@ ::VehicleType type = ::Engine::Get(engine_id)->type; - CommandCost res = ::DoCommand(depot, engine_id | (cargo << 24), 0, DC_QUERY_COST, ::GetCmdBuildVeh(type)); + CommandCost res = ::DoCommand(DC_QUERY_COST, ::GetCmdBuildVeh(type), depot, engine_id | (cargo << 24), 0); return res.Succeeded() ? _returned_refit_capacity : -1; } @@ -142,7 +142,7 @@ if (!IsValidVehicle(vehicle_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - CommandCost res = ::DoCommand(0, vehicle_id, cargo, DC_QUERY_COST, GetCmdRefitVeh(::Vehicle::Get(vehicle_id))); + CommandCost res = ::DoCommand(DC_QUERY_COST, GetCmdRefitVeh(::Vehicle::Get(vehicle_id)), 0, vehicle_id, cargo); return res.Succeeded() ? _returned_refit_capacity : -1; } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 1a188252ce..713d383743 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -841,7 +841,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo if (ret.Failed()) return ret; cost.AddCost(ret); - ret = DoCommand(tile_iter, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_iter, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -921,14 +921,14 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl affected_vehicles.push_back(v); } } - CommandCost ret = DoCommand(tile_cur, 0, track, flags, CMD_REMOVE_SINGLE_RAIL); + CommandCost ret = DoCommand(flags, CMD_REMOVE_SINGLE_RAIL, tile_cur, 0, track); if (ret.Failed()) return ret; cost.AddCost(ret); /* With flags & ~DC_EXEC CmdLandscapeClear would fail since the rail still exists */ continue; } } - ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_cur, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -1046,7 +1046,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags cost.AddCost(RoadBuildCost(rt) * 2); } } else { - ret = DoCommand(cur_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(RoadBuildCost(rt) * 2); @@ -1752,7 +1752,7 @@ static CommandCost RemoveRailStation(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove platforms tile by tile */ if (_current_company == OWNER_WATER) { - return DoCommand(tile, 0, 0, DC_EXEC, CMD_REMOVE_FROM_RAIL_STATION); + return DoCommand(DC_EXEC, CMD_REMOVE_FROM_RAIL_STATION, tile, 0, 0); } Station *st = Station::GetByTile(tile); @@ -1773,7 +1773,7 @@ static CommandCost RemoveRailWaypoint(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove waypoints tile by tile */ if (_current_company == OWNER_WATER) { - return DoCommand(tile, 0, 0, DC_EXEC, CMD_REMOVE_FROM_RAIL_WAYPOINT); + return DoCommand(DC_EXEC, CMD_REMOVE_FROM_RAIL_WAYPOINT, tile, 0, 0); } return RemoveRailStation(Waypoint::GetByTile(tile), flags, _price[PR_CLEAR_WAYPOINT_RAIL]); @@ -2535,7 +2535,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]); - ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -2550,7 +2550,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Get the water class of the water tile before it is cleared.*/ WaterClass wc = GetWaterClass(tile_cur); - ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_cur, 0, 0); if (ret.Failed()) return ret; tile_cur += TileOffsByDiagDir(direction); @@ -4240,12 +4240,12 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o } else { if (IsDriveThroughStopTile(tile)) { /* Remove the drive-through road stop */ - DoCommand(tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS, DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP); + DoCommand(DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP, tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS); assert(IsTileType(tile, MP_ROAD)); /* Change owner of tile and all roadtypes */ ChangeTileOwner(tile, old_owner, new_owner); } else { - DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); /* Set tile owner of water under (now removed) buoy and dock to OWNER_NONE. * Update owner of buoy if it was not removed (was in orders). * Do not update when owned by OWNER_WATER (sea and rivers). */ @@ -4362,7 +4362,7 @@ static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, in } } } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } /** diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index eaed9e71c1..205a364165 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -289,7 +289,7 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin } CommandCost cost; if (indirectly_cleared) { - cost = DoCommand(t, 0, 0, tile_flags, CMD_LANDSCAPE_CLEAR); + cost = DoCommand(tile_flags, CMD_LANDSCAPE_CLEAR, t, 0, 0); } else { cost = _tile_type_procs[GetTileType(t)]->terraform_tile_proc(t, tile_flags, z_min, tileh); } @@ -378,7 +378,7 @@ CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 TileIndex t = *iter; uint curh = TileHeight(t); while (curh != h) { - CommandCost ret = DoCommand(t, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND); + CommandCost ret = DoCommand(flags & ~DC_EXEC, CMD_TERRAFORM_LAND, t, SLOPE_N, (curh > h) ? 0 : 1); if (ret.Failed()) { last_error = ret; @@ -394,7 +394,7 @@ CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 delete iter; return cost; } - DoCommand(t, SLOPE_N, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND); + DoCommand(flags, CMD_TERRAFORM_LAND, t, SLOPE_N, (curh > h) ? 0 : 1); } else { /* When we're at the terraform limit we better bail (unneeded) testing as well. * This will probably cause the terraforming cost to be underestimated, but only diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index f710cecc5c..820287e9ce 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -511,7 +511,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed) /* Delete all station signs */ for (BaseStation *st : BaseStation::Iterate()) { /* There can be buoys, remove them */ - if (IsBuoyTile(st->xy)) DoCommand(st->xy, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); + if (IsBuoyTile(st->xy)) DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, st->xy, 0, 0); if (!st->IsInUse()) delete st; } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 2863b4d6f7..27a9e69783 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -938,8 +938,8 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) * If that fails clear the land, and if that fails exit. * This is to make sure that we can build a road here later. */ RoadType rt = GetTownRoadType(t); - if (DoCommand(tile, ((dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X) | (rt << 4), 0, DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD).Failed() && - DoCommand(tile, 0, 0, DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR).Failed()) { + if (DoCommand(DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD, tile, ((dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X) | (rt << 4), 0).Failed() && + DoCommand(DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Failed()) { return false; } } @@ -956,8 +956,8 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) CommandCost res = CMD_ERROR; if (!_generating_world && Chance16(1, 10)) { /* Note: Do not replace "^ SLOPE_ELEVATED" with ComplementSlope(). The slope might be steep. */ - res = DoCommand(tile, Chance16(1, 16) ? cur_slope : cur_slope ^ SLOPE_ELEVATED, 0, - DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND); + res = DoCommand(DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND, + tile, Chance16(1, 16) ? cur_slope : cur_slope ^ SLOPE_ELEVATED, 0); } if (res.Failed() && Chance16(1, 3)) { /* We can consider building on the slope, though. */ @@ -973,9 +973,9 @@ static bool TerraformTownTile(TileIndex tile, int edges, int dir) { assert(tile < MapSize()); - CommandCost r = DoCommand(tile, edges, dir, DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND); + CommandCost r = DoCommand(DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND, tile, edges, dir); if (r.Failed() || r.GetCost() >= (_price[PR_TERRAFORM] + 2) * 8) return false; - DoCommand(tile, edges, dir, DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_TERRAFORM_LAND); + DoCommand(DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_TERRAFORM_LAND, tile, edges, dir); return true; } @@ -1107,7 +1107,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile) static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd) { RoadType rt = GetTownRoadType(t); - if (DoCommand(tile, rcmd | (rt << 4), t->index, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD).Succeeded()) { + if (DoCommand(DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD, tile, rcmd | (rt << 4), t->index).Succeeded()) { _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1154,7 +1154,7 @@ static bool CanRoadContinueIntoNextTile(const Town *t, const TileIndex tile, con if (IsTileType(next_tile, MP_RAILWAY) && !_settings_game.economy.allow_town_level_crossings) return false; /* If a road tile can be built, the construction is allowed. */ - return DoCommand(next_tile, rcmd | (rt << 4), t->index, DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD).Succeeded(); + return DoCommand(DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD, next_tile, rcmd | (rt << 4), t->index).Succeeded(); } /** @@ -1222,8 +1222,8 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi /* Can we actually build the bridge? */ RoadType rt = GetTownRoadType(t); - if (DoCommand(tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE).Succeeded()) { - DoCommand(tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15, DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE); + if (DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE, tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15).Succeeded()) { + DoCommand(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE, tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15); _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1293,8 +1293,8 @@ static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDi /* Attempt to build the tunnel. Return false if it fails to let the town build a road instead. */ RoadType rt = GetTownRoadType(t); - if (DoCommand(tile, rt | (TRANSPORT_ROAD << 8), 0, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_TUNNEL)), CMD_BUILD_TUNNEL).Succeeded()) { - DoCommand(tile, rt | (TRANSPORT_ROAD << 8), 0, DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_TUNNEL)), CMD_BUILD_TUNNEL); + if (DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_TUNNEL)), CMD_BUILD_TUNNEL, tile, rt | (TRANSPORT_ROAD << 8), 0).Succeeded()) { + DoCommand(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_TUNNEL)), CMD_BUILD_TUNNEL, tile, rt | (TRANSPORT_ROAD << 8), 0); _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1732,9 +1732,9 @@ static bool GrowTown(Town *t) for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) { /* Only work with plain land that not already has a house */ if (!IsTileType(tile, MP_HOUSE) && IsTileFlat(tile)) { - if (DoCommand(tile, 0, 0, DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR).Succeeded()) { + if (DoCommand(DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Succeeded()) { RoadType rt = GetTownRoadType(t); - DoCommand(tile, GenRandomRoadBits() | (rt << 4), t->index, DC_EXEC | DC_AUTO, CMD_BUILD_ROAD); + DoCommand(DC_EXEC | DC_AUTO, CMD_BUILD_ROAD, tile, GenRandomRoadBits() | (rt << 4), t->index); cur_company.Restore(); return true; } @@ -2179,7 +2179,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size if (t->cache.population > 0) return t; Backup cur_company(_current_company, OWNER_TOWN, FILE_LINE); - [[maybe_unused]] CommandCost rc = DoCommand(t->xy, t->index, 0, DC_EXEC, CMD_DELETE_TOWN); + [[maybe_unused]] CommandCost rc = DoCommand(DC_EXEC, CMD_DELETE_TOWN, t->xy, t->index, 0); cur_company.Restore(); assert(rc.Succeeded()); @@ -2280,7 +2280,7 @@ HouseZonesBits GetTownRadiusGroup(const Town *t, TileIndex tile) */ static inline void ClearMakeHouseTile(TileIndex tile, Town *t, byte counter, byte stage, HouseID type, byte random_bits) { - [[maybe_unused]] CommandCost cc = DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR); + [[maybe_unused]] CommandCost cc = DoCommand(DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0); assert(cc.Succeeded()); IncreaseBuildingCount(t, type); @@ -2337,7 +2337,7 @@ static inline bool CanBuildHouseHere(TileIndex tile, bool noslope) if (IsBridgeAbove(tile)) return false; /* can we clear the land? */ - return DoCommand(tile, 0, 0, DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR).Succeeded(); + return DoCommand(DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Succeeded(); } @@ -2972,7 +2972,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Non-oil rig stations are always a problem. */ if (!(st->facilities & FACIL_AIRPORT) || st->airport.type != AT_OILRIG) return CMD_ERROR; /* We can only automatically delete oil rigs *if* there's no vehicle on them. */ - CommandCost ret = DoCommand(st->airport.tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, st->airport.tile, 0, 0); if (ret.Failed()) return ret; } } @@ -2988,7 +2988,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 * tile was already deleted earlier in the loop. */ for (TileIndex current_tile = 0; current_tile < MapSize(); ++current_tile) { if (IsTileType(current_tile, MP_TUNNELBRIDGE) && TestTownOwnsBridge(current_tile, t)) { - CommandCost ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); if (ret.Failed()) return ret; } } @@ -3031,7 +3031,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 break; } if (try_clear) { - CommandCost ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); if (ret.Failed()) return ret; } } @@ -3107,7 +3107,7 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags) static bool TryClearTile(TileIndex tile) { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - CommandCost r = DoCommand(tile, 0, 0, DC_NONE, CMD_LANDSCAPE_CLEAR); + CommandCost r = DoCommand(DC_NONE, CMD_LANDSCAPE_CLEAR, tile, 0, 0); cur_company.Restore(); return r.Succeeded(); } @@ -3179,7 +3179,7 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags) if (flags & DC_EXEC) { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - DoCommand(statue_data.best_position, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, statue_data.best_position, 0, 0); cur_company.Restore(); BuildObject(OBJECT_STATUE, statue_data.best_position, _current_company, t); SetBit(t->statues, _current_company); // Once found and built, "inform" the Town. @@ -3786,7 +3786,7 @@ static CommandCost TerraformTile_Town(TileIndex tile, DoCommandFlag flags, int z } } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } /** Tile callback functions for a town */ diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index f5eb32d7f9..775b1f6374 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -654,7 +654,7 @@ static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const w->engine_type == e->index && ///< Same type w->First() != v && ///< Don't connect to ourself !(w->vehstatus & VS_CRASHED)) { ///< Not crashed/flooded - if (DoCommand(0, v->index | 1 << 20, w->Last()->index, DC_EXEC, CMD_MOVE_RAIL_VEHICLE).Succeeded()) { + if (DoCommand(DC_EXEC, CMD_MOVE_RAIL_VEHICLE, 0, v->index | 1 << 20, w->Last()->index).Succeeded()) { break; } } @@ -670,9 +670,9 @@ static void NormalizeTrainVehInDepot(const Train *u) for (const Train *v : Train::Iterate()) { if (v->IsFreeWagon() && v->tile == u->tile && v->track == TRACK_BIT_DEPOT) { - if (DoCommand(0, v->index | 1 << 20, u->index, DC_EXEC, - CMD_MOVE_RAIL_VEHICLE).Failed()) + if (DoCommand(DC_EXEC, CMD_MOVE_RAIL_VEHICLE, 0, v->index | 1 << 20, u->index).Failed()) { break; + } } } } diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 237b34fffb..626f0386f7 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -460,7 +460,7 @@ CommandCost CmdPlantTree(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 switch (GetRawClearGround(current_tile)) { case CLEAR_FIELDS: case CLEAR_ROCKS: { - CommandCost ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); break; @@ -881,7 +881,7 @@ void InitializeTrees() static CommandCost TerraformTile_Trees(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 5181dfdca2..9c77dff9dc 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -418,7 +418,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u bool allow_on_slopes = (_settings_game.construction.build_on_slopes && transport_type != TRANSPORT_WATER); /* Try and clear the start landscape */ - CommandCost ret = DoCommand(tile_start, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_start, 0, 0); if (ret.Failed()) return ret; cost = ret; @@ -426,7 +426,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u cost.AddCost(terraform_cost_north); /* Try and clear the end landscape */ - ret = DoCommand(tile_end, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_end, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -498,7 +498,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u default: not_valid_below:; /* try and clear the middle landscape */ - ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); break; @@ -672,7 +672,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, if (HasTileWaterGround(start_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); - CommandCost ret = DoCommand(start_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, start_tile, 0, 0); if (ret.Failed()) return ret; /* XXX - do NOT change 'ret' in the loop, as it is used as the price @@ -732,7 +732,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, if (HasTileWaterGround(end_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); /* Clear the tile in any case */ - ret = DoCommand(end_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, end_tile, 0, 0); if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); cost.AddCost(ret); @@ -764,7 +764,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself coa = nullptr; - ret = DoCommand(end_tile, end_tileh & start_tileh, 0, flags, CMD_TERRAFORM_LAND); + ret = DoCommand(flags, CMD_TERRAFORM_LAND, end_tile, end_tileh & start_tileh, 0); _cleared_object_areas[(uint)coa_index].first_tile = old_first_tile; if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); cost.AddCost(ret); @@ -1846,7 +1846,7 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, Owner old_owner, Owner if (tt == TRANSPORT_RAIL) { /* Since all of our vehicles have been removed, it is safe to remove the rail * bridge / tunnel. */ - [[maybe_unused]] CommandCost ret = DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); + [[maybe_unused]] CommandCost ret = DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); assert(ret.Succeeded()); } else { /* In any other case, we can safely reassign the ownership to OWNER_NONE. */ @@ -2037,7 +2037,7 @@ static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flag if (res.Succeeded() && (z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } extern const TileTypeProcs _tile_type_tunnelbridge_procs = { diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 30e1c477cb..1e0cccaadc 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -307,7 +307,7 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF SetDParamStr(0, grfconfig->GetName()); SetDParam(1, engine); ShowErrorMessage(part1, part2, WL_CRITICAL); - if (!_networking) DoCommand(0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1, DC_EXEC, CMD_PAUSE); + if (!_networking) DoCommand(DC_EXEC, CMD_PAUSE, 0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1); } /* debug output */ @@ -1055,7 +1055,7 @@ void CallVehicleTicks() const Company *c = Company::Get(_current_company); SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, (Money)c->settings.engine_renew_money)); - CommandCost res = DoCommand(0, v->index, 0, DC_EXEC, CMD_AUTOREPLACE_VEHICLE); + CommandCost res = DoCommand(DC_EXEC, CMD_AUTOREPLACE_VEHICLE, 0, v->index, 0); SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, -(Money)c->settings.engine_renew_money)); if (!IsLocalCompany()) continue; @@ -1561,7 +1561,7 @@ void VehicleEnterDepot(Vehicle *v) if (v->current_order.IsRefit()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost cost = DoCommand(v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8, DC_EXEC, GetCmdRefitVeh(v)); + CommandCost cost = DoCommand(DC_EXEC, GetCmdRefitVeh(v), v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8); cur_company.Restore(); if (cost.Failed()) { @@ -2443,7 +2443,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) /* If there is no depot in front and the train is not already reversing, reverse automatically (trains only) */ if (this->type == VEH_TRAIN && (reverse ^ HasBit(Train::From(this)->flags, VRF_REVERSING))) { - DoCommand(this->tile, this->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION); + DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, this->tile, this->index, 0); } if (this->type == VEH_AIRCRAFT) { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index f3e0a99b8b..5b1878c3a8 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -182,7 +182,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* If we are not in DC_EXEC undo everything */ if (flags != subflags) { - DoCommand(0, v->index, 0, DC_EXEC, GetCmdSellVeh(v)); + DoCommand(DC_EXEC, GetCmdSellVeh(v), 0, v->index, 0); } } @@ -665,7 +665,7 @@ CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 if (!vehicle_list_window && !v->IsChainInDepot()) continue; /* Just try and don't care if some vehicle's can't be stopped. */ - DoCommand(tile, v->index, 0, flags, CMD_START_STOP_VEHICLE); + DoCommand(flags, CMD_START_STOP_VEHICLE, tile, v->index, 0); } return CommandCost(); @@ -697,7 +697,7 @@ CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 CommandCost last_error = CMD_ERROR; bool had_success = false; for (uint i = 0; i < list.size(); i++) { - CommandCost ret = DoCommand(tile, list[i]->index | (1 << 20), 0, flags, sell_command); + CommandCost ret = DoCommand(flags, sell_command, tile, list[i]->index | (1 << 20), 0); if (ret.Succeeded()) { cost.AddCost(ret); had_success = true; @@ -736,7 +736,7 @@ CommandCost CmdDepotMassAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 /* Ensure that the vehicle completely in the depot */ if (!v->IsChainInDepot()) continue; - CommandCost ret = DoCommand(0, v->index, 0, flags, CMD_AUTOREPLACE_VEHICLE); + CommandCost ret = DoCommand(flags, CMD_AUTOREPLACE_VEHICLE, 0, v->index, 0); if (ret.Succeeded()) cost.AddCost(ret); } @@ -875,11 +875,11 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint DoCommandFlag build_flags = flags; if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE; - CommandCost cost = DoCommand(tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0, build_flags, GetCmdBuildVeh(v)); + CommandCost cost = DoCommand(build_flags, GetCmdBuildVeh(v), tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0); if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ - if (w_front != nullptr) DoCommand(w_front->tile, w_front->index | (1 << 20), 0, flags, GetCmdSellVeh(w_front)); + if (w_front != nullptr) DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | (1 << 20), 0); return cost; } @@ -895,12 +895,12 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (v->type == VEH_TRAIN && !v->IsFrontEngine()) { /* this s a train car * add this unit to the end of the train */ - CommandCost result = DoCommand(0, w->index | 1 << 20, w_rear->index, flags, CMD_MOVE_RAIL_VEHICLE); + CommandCost result = DoCommand(flags, CMD_MOVE_RAIL_VEHICLE, 0, w->index | 1 << 20, w_rear->index); if (result.Failed()) { /* The train can't be joined to make the same consist as the original. * Sell what we already made (clean up) and return an error. */ - DoCommand(w_front->tile, w_front->index | 1 << 20, 0, flags, GetCmdSellVeh(w_front)); - DoCommand(w_front->tile, w->index | 1 << 20, 0, flags, GetCmdSellVeh(w)); + DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | 1 << 20, 0); + DoCommand(flags, GetCmdSellVeh(w) , w_front->tile, w->index | 1 << 20, 0); return result; // return error and the message returned from CMD_MOVE_RAIL_VEHICLE } } else { @@ -921,7 +921,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (flags & DC_EXEC) { /* Cloned vehicles belong to the same group */ - DoCommand(0, v_front->group_id, w_front->index, flags, CMD_ADD_VEHICLE_GROUP); + DoCommand(flags, CMD_ADD_VEHICLE_GROUP, 0, v_front->group_id, w_front->index); } @@ -943,7 +943,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* Find out what's the best sub type */ byte subtype = GetBestFittingSubType(v, w, v->cargo_type); if (w->cargo_type != v->cargo_type || w->cargo_subtype != subtype) { - CommandCost cost = DoCommand(0, w->index, v->cargo_type | 1U << 25 | (subtype << 8), flags, GetCmdRefitVeh(v)); + CommandCost cost = DoCommand(flags, GetCmdRefitVeh(v), 0, w->index, v->cargo_type | 1U << 25 | (subtype << 8)); if (cost.Succeeded()) total_cost.AddCost(cost); } @@ -978,10 +978,10 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint * the vehicle refitted before doing this, otherwise the moved * cargo types might not match (passenger vs non-passenger) */ - CommandCost result = DoCommand(0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index, flags, CMD_CLONE_ORDER); + CommandCost result = DoCommand(flags, CMD_CLONE_ORDER, 0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index); if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ - DoCommand(w_front->tile, w_front->index | 1 << 20, 0, flags, GetCmdSellVeh(w_front)); + DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | 1 << 20, 0); return result; } @@ -992,7 +992,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint * check whether the company has enough money manually. */ if (!CheckCompanyHasMoney(total_cost)) { /* The vehicle has already been bought, so now it must be sold again. */ - DoCommand(w_front->tile, w_front->index | 1 << 20, 0, flags, GetCmdSellVeh(w_front)); + DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | 1 << 20, 0); return total_cost; } } @@ -1017,7 +1017,7 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con bool had_success = false; for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; - CommandCost ret = DoCommand(v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0, flags, GetCmdSendToDepot(vli.vtype)); + CommandCost ret = DoCommand(flags, GetCmdSendToDepot(vli.vtype), v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0); if (ret.Succeeded()) { had_success = true; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index f2ab811574..e11e340f59 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -772,8 +772,8 @@ struct RefitWindow : public Window { { assert(_current_company == _local_company); Vehicle *v = Vehicle::Get(this->window_number); - CommandCost cost = DoCommand(v->tile, this->selected_vehicle, option->cargo | option->subtype << 8 | this->num_vehicles << 16 | - (int)this->auto_refit << 24, DC_QUERY_COST, GetCmdRefitVeh(v->type)); + CommandCost cost = DoCommand(DC_QUERY_COST, GetCmdRefitVeh(v->type), v->tile, this->selected_vehicle, option->cargo | + option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24); if (cost.Failed()) return INVALID_STRING_ID; diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index ba09b415a7..12f300ac2c 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -122,13 +122,13 @@ CommandCost CmdBuildShipDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, ui CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_DEPOT_SHIP]); bool add_cost = !IsWaterTile(tile); - CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags | DC_AUTO, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; if (add_cost) { cost.AddCost(ret); } add_cost = !IsWaterTile(tile2); - ret = DoCommand(tile2, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags | DC_AUTO, CMD_LANDSCAPE_CLEAR, tile2, 0, 0); if (ret.Failed()) return ret; if (add_cost) { cost.AddCost(ret); @@ -306,13 +306,13 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag /* middle tile */ WaterClass wc_middle = HasTileWaterGround(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL; - ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); /* lower tile */ if (!IsWaterTile(tile - delta)) { - ret = DoCommand(tile - delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile - delta, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(_price[PR_BUILD_CANAL]); @@ -324,7 +324,7 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag /* upper tile */ if (!IsWaterTile(tile + delta)) { - ret = DoCommand(tile + delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile + delta, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(_price[PR_BUILD_CANAL]); @@ -480,7 +480,7 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Outside the editor, prevent building canals over your own or OWNER_NONE owned canals */ if (water && IsCanal(current_tile) && _game_mode != GM_EDITOR && (IsTileOwner(current_tile, _current_company) || IsTileOwner(current_tile, OWNER_NONE))) continue; - ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); if (ret.Failed()) return ret; if (!water) cost.AddCost(ret); @@ -1135,7 +1135,7 @@ void DoFloodTile(TileIndex target) FALLTHROUGH; case MP_CLEAR: - if (DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR).Succeeded()) { + if (DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, target, 0, 0).Succeeded()) { MakeShore(target); MarkTileDirtyByTile(target); flooded = true; @@ -1150,7 +1150,7 @@ void DoFloodTile(TileIndex target) FloodVehicles(target); /* flood flat tile */ - if (DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR).Succeeded()) { + if (DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, target, 0, 0).Succeeded()) { MakeSea(target); MarkTileDirtyByTile(target); flooded = true; @@ -1202,7 +1202,7 @@ static void DoDryUp(TileIndex tile) case MP_WATER: assert(IsCoast(tile)); - if (DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR).Succeeded()) { + if (DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Succeeded()) { MakeClear(tile, CLEAR_GRASS, 3); MarkTileDirtyByTile(tile); } @@ -1361,7 +1361,7 @@ static void ChangeTileOwner_Water(TileIndex tile, Owner old_owner, Owner new_own } /* Remove depot */ - if (IsShipDepot(tile)) DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); + if (IsShipDepot(tile)) DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); /* Set owner of canals and locks ... and also canal under dock there was before. * Check if the new owner after removing depot isn't OWNER_WATER. */ @@ -1381,7 +1381,7 @@ static CommandCost TerraformTile_Water(TileIndex tile, DoCommandFlag flags, int /* Canals can't be terraformed */ if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST); - return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); } diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 632d697429..77b9fbd027 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -315,7 +315,7 @@ CommandCost CmdBuildBuoy(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]); if (!IsWaterTile(tile)) { - CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR); + CommandCost ret = DoCommand(flags | DC_AUTO, CMD_LANDSCAPE_CLEAR, tile, 0, 0); if (ret.Failed()) return ret; cost.AddCost(ret); } From 549caca39cebc8c988f4e51d79d353cab4646d58 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 3 Oct 2021 17:15:48 +0200 Subject: [PATCH 104/710] Codechange: Move command arguments to the back of the networked command function calls. --- src/ai/ai_gui.cpp | 8 ++-- src/autoreplace_gui.cpp | 10 ++-- src/bridge_gui.cpp | 6 +-- src/build_vehicle_gui.cpp | 6 +-- src/cheat_gui.cpp | 2 +- src/command.cpp | 74 +++++++++++++++++++++-------- src/command_func.h | 7 +-- src/company_cmd.cpp | 2 +- src/company_gui.cpp | 24 +++++----- src/console_cmds.cpp | 14 +++--- src/depot_gui.cpp | 20 ++++---- src/dock_gui.cpp | 12 ++--- src/economy.cpp | 2 +- src/engine_gui.cpp | 2 +- src/fios_gui.cpp | 4 +- src/goal_gui.cpp | 6 +-- src/group_gui.cpp | 24 +++++----- src/highscore_gui.cpp | 8 ++-- src/industry_gui.cpp | 7 ++- src/linkgraph/linkgraphschedule.cpp | 4 +- src/main_gui.cpp | 2 +- src/misc_cmd.cpp | 2 +- src/network/network.cpp | 4 +- src/network/network_client.cpp | 2 +- src/network/network_command.cpp | 8 ++-- src/network/network_gui.cpp | 6 +-- src/network/network_server.cpp | 6 +-- src/object_gui.cpp | 4 +- src/openttd.cpp | 8 ++-- src/order_backup.cpp | 4 +- src/order_gui.cpp | 46 +++++++++--------- src/rail_gui.cpp | 42 ++++++++-------- src/road_gui.cpp | 22 ++++----- src/script/api/script_object.cpp | 2 +- src/settings.cpp | 6 +-- src/signs_cmd.cpp | 2 +- src/signs_gui.cpp | 2 +- src/station_gui.cpp | 4 +- src/story_gui.cpp | 6 +-- src/terraform_gui.cpp | 16 +++---- src/timetable_gui.cpp | 12 ++--- src/toolbar_gui.cpp | 2 +- src/town_gui.cpp | 12 ++--- src/train_cmd.cpp | 2 +- src/train_gui.cpp | 2 +- src/tree_gui.cpp | 4 +- src/vehicle_gui.cpp | 29 ++++++----- src/waypoint_gui.cpp | 2 +- 48 files changed, 265 insertions(+), 236 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index c7ae4740e2..340b6db956 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -1290,8 +1290,8 @@ struct AIDebugWindow : public Window { case WID_AID_RELOAD_TOGGLE: if (ai_debug_company == OWNER_DEITY) break; /* First kill the company of the AI, then start a new one. This should start the current AI again */ - DoCommandP(0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); - DoCommandP(0, CCA_NEW_AI | ai_debug_company << 16, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | ai_debug_company << 16, 0); break; case WID_AID_SETTINGS: @@ -1330,7 +1330,7 @@ struct AIDebugWindow : public Window { } if (all_unpaused) { /* All scripts have been unpaused => unpause the game. */ - DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); } } } @@ -1379,7 +1379,7 @@ struct AIDebugWindow : public Window { /* Pause the game. */ if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); } /* Highlight row that matched */ diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 898b4e7503..d4e392c971 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -217,7 +217,7 @@ class ReplaceVehicleWindow : public Window { { EngineID veh_from = this->sel_engine[0]; EngineID veh_to = this->sel_engine[1]; - DoCommandP(0, (replace_when_old ? 1 : 0) | (this->sel_group << 16), veh_from + (veh_to << 16), CMD_SET_AUTOREPLACE); + DoCommandP(CMD_SET_AUTOREPLACE, 0, (replace_when_old ? 1 : 0) | (this->sel_group << 16), veh_from + (veh_to << 16)); } public: @@ -541,10 +541,10 @@ public: case WID_RV_TRAIN_WAGONREMOVE_TOGGLE: { const Group *g = Group::GetIfValid(this->sel_group); if (g != nullptr) { - DoCommandP(0, this->sel_group | (GroupFlags::GF_REPLACE_WAGON_REMOVAL << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL) ? 0 : 1) | (_ctrl_pressed << 1), CMD_SET_GROUP_FLAG); + DoCommandP(CMD_SET_GROUP_FLAG, 0, this->sel_group | (GroupFlags::GF_REPLACE_WAGON_REMOVAL << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL) ? 0 : 1) | (_ctrl_pressed << 1)); } else { // toggle renew_keep_length - DoCommandP(0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_CHANGE_COMPANY_SETTING, nullptr, "company.renew_keep_length"); + DoCommandP(CMD_CHANGE_COMPANY_SETTING, 0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, "company.renew_keep_length"); } break; } @@ -562,7 +562,7 @@ public: case WID_RV_STOP_REPLACE: { // Stop replacing EngineID veh_from = this->sel_engine[0]; - DoCommandP(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE); + DoCommandP(CMD_SET_AUTOREPLACE, 0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16)); break; } @@ -584,7 +584,7 @@ public: if (click_side == 0 && _ctrl_pressed && e != INVALID_ENGINE && (GetGroupNumEngines(_local_company, sel_group, e) == 0 || GetGroupNumEngines(_local_company, ALL_GROUP, e) == 0)) { EngineID veh_from = e; - DoCommandP(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE); + DoCommandP(CMD_SET_AUTOREPLACE, 0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16)); break; } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 9e6fc4eeef..2aef088e3f 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -117,8 +117,8 @@ private: case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->at(i).index; break; default: break; } - DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->at(i).index, - CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge); + DoCommandP(CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge, + this->end_tile, this->start_tile, this->type | this->bridges->at(i).index); } /** Sort the builable bridges */ @@ -383,7 +383,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo default: break; // water ways and air routes don't have bridge types } if (_ctrl_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len).Succeeded()) { - DoCommandP(end, start, type | last_bridge_type, CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge); + DoCommandP(CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge, end, start, type | last_bridge_type); return; } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 6bee767b0c..aafc0a950e 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1458,7 +1458,7 @@ struct BuildVehicleWindow : Window { case WID_BV_SHOW_HIDE: { const Engine *e = (this->sel_engine == INVALID_ENGINE) ? nullptr : Engine::Get(this->sel_engine); if (e != nullptr) { - DoCommandP(0, 0, this->sel_engine | (e->IsHidden(_current_company) ? 0 : (1u << 31)), CMD_SET_VEHICLE_VISIBILITY); + DoCommandP(CMD_SET_VEHICLE_VISIBILITY, 0, 0, this->sel_engine | (e->IsHidden(_current_company) ? 0 : (1u << 31))); } break; } @@ -1469,7 +1469,7 @@ struct BuildVehicleWindow : Window { CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle; CargoID cargo = this->cargo_filter[this->cargo_filter_criteria]; if (cargo == CF_ANY || cargo == CF_ENGINES) cargo = CF_NONE; - DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback); + DoCommandP(GetCmdBuildVeh(this->vehicle_type), callback, this->window_number, sel_eng | (cargo << 24), 0); } break; } @@ -1634,7 +1634,7 @@ struct BuildVehicleWindow : Window { { if (str == nullptr) return; - DoCommandP(0, this->rename_engine, 0, CMD_RENAME_ENGINE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type), nullptr, str); + DoCommandP(CMD_RENAME_ENGINE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type), 0, this->rename_engine, 0, str); } void OnDropdownSelect(int widget, int index) override diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index a0ac5fab8f..84884b3ded 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -54,7 +54,7 @@ static int32 _money_cheat_amount = 10000000; */ static int32 ClickMoneyCheat(int32 p1, int32 p2) { - DoCommandP(0, (uint32)(p2 * _money_cheat_amount), 0, CMD_MONEY_CHEAT); + DoCommandP(CMD_MONEY_CHEAT, 0, (uint32)(p2 * _money_cheat_amount), 0); return _money_cheat_amount; } diff --git a/src/command.cpp b/src/command.cpp index b971ccb6bd..d397d3fe6a 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -532,16 +532,6 @@ Money GetAvailableMoneyForCommand() return Company::Get(company)->money; } -/** - * Shortcut for the long DoCommandP when having a container with the data. - * @param container the container with information. - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) - * @return true if the command succeeded, else false - */ -bool DoCommandP(const CommandContainer *container, bool my_cmd) -{ - return DoCommandP(container->tile, container->p1, container->p2, container->cmd, container->callback, container->text, my_cmd); -} /*! * Toplevel network safe docommand function for the current company. Must not be called recursively. @@ -549,16 +539,16 @@ bool DoCommandP(const CommandContainer *container, bool my_cmd) * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. * The parameter \a my_cmd is used to indicate if the command is from a company or the server. * + * @param cmd The command to execute (a CMD_* value) + * @param callback A callback function to call after the command is finished + * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) * @param tile The tile to perform a command on (see #CommandProc) * @param p1 Additional data for the command (see #CommandProc) * @param p2 Additional data for the command (see #CommandProc) - * @param cmd The command to execute (a CMD_* value) - * @param callback A callback function to call after the command is finished * @param text The text to pass - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) * @return \c true if the command succeeded, else \c false. */ -bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const std::string &text, bool my_cmd) +static bool DoCommandP(uint32 cmd, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Cost estimation is generally only done when the * local user presses shift while doing something. @@ -586,7 +576,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac /* Only set p2 when the command does not come from the network. */ if (!(cmd & CMD_NETWORK_COMMAND) && GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = CLIENT_ID_SERVER; - CommandCost res = DoCommandPInternal(tile, p1, p2, cmd, callback, text, my_cmd, estimate_only); + CommandCost res = DoCommandPInternal(cmd, callback, my_cmd, estimate_only, tile, p1, p2, text); if (res.Failed()) { /* Only show the error when it's for us. */ StringID error_part1 = GB(cmd, 16, 16); @@ -611,6 +601,48 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac return res.Succeeded(); } +/** + * Shortcut for the long DoCommandP when having a container with the data. + * @param container the container with information. + * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @return true if the command succeeded, else false + */ +bool DoCommandP(const CommandContainer *container, bool my_cmd) +{ + return DoCommandP(container->cmd, container->callback, my_cmd, container->tile, container->p1, container->p2, container->text); +} + +/** + * Shortcut for the long DoCommandP when not using a callback. + * @param cmd The command to execute (a CMD_* value) + * @param tile The tile to perform a command on (see #CommandProc) + * @param p1 Additional data for the command (see #CommandProc) + * @param p2 Additional data for the command (see #CommandProc) + * @param text The text to pass + * @return \c true if the command succeeded, else \c false. + */ +bool DoCommandP(uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + return DoCommandP(cmd, nullptr, true, tile, p1, p2, text); +} + +/*! + * Toplevel network safe docommand function for the current company. Must not be called recursively. + * The callback is called when the command succeeded or failed. The parameters + * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. + * + * @param cmd The command to execute (a CMD_* value) + * @param callback A callback function to call after the command is finished + * @param tile The tile to perform a command on (see #CommandProc) + * @param p1 Additional data for the command (see #CommandProc) + * @param p2 Additional data for the command (see #CommandProc) + * @param text The text to pass + * @return \c true if the command succeeded, else \c false. + */ +bool DoCommandP(uint32 cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + return DoCommandP(cmd, callback, true, tile, p1, p2, text); +} /** * Helper to deduplicate the code for returning. @@ -621,17 +653,17 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac /*! * Helper function for the toplevel network safe docommand function for the current company. * + * @param cmd The command to execute (a CMD_* value) + * @param callback A callback function to call after the command is finished + * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @param estimate_only whether to give only the estimate or also execute the command * @param tile The tile to perform a command on (see #CommandProc) * @param p1 Additional data for the command (see #CommandProc) * @param p2 Additional data for the command (see #CommandProc) - * @param cmd The command to execute (a CMD_* value) - * @param callback A callback function to call after the command is finished * @param text The text to pass - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) - * @param estimate_only whether to give only the estimate or also execute the command * @return the command cost of this function. */ -CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const std::string &text, bool my_cmd, bool estimate_only) +CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cmd, bool estimate_only, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Prevent recursion; it gives a mess over the network */ assert(_docommand_recursive == 0); @@ -707,7 +739,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, * send it to the command-queue and abort execution */ if (_networking && !_generating_world && !(cmd & CMD_NETWORK_COMMAND)) { - NetworkSendCommand(tile, p1, p2, cmd & ~CMD_FLAGS_MASK, callback, text, _current_company); + NetworkSendCommand(cmd & ~CMD_FLAGS_MASK, callback, _current_company, tile, p1, p2, text); cur_company.Restore(); /* Don't return anything special here; no error, no costs. diff --git a/src/command_func.h b/src/command_func.h index 07de8de9c0..eefaadd9b6 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -35,12 +35,13 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); CommandCost DoCommand(DoCommandFlag flags, uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags); -bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback = nullptr, const std::string &text = {}, bool my_cmd = true); +bool DoCommandP(uint32 cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); +bool DoCommandP(uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(const CommandContainer *container, bool my_cmd = true); -CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const std::string &text, bool my_cmd, bool estimate_only); +CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cmd, bool estimate_only, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); -void NetworkSendCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const std::string &text, CompanyID company); +void NetworkSendCommand(uint32 cmd, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); extern Money _additional_cash_required; diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index ce7488f037..792dd624b2 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -603,7 +603,7 @@ static bool MaybeStartNewCompany() if (n < (uint)_settings_game.difficulty.max_no_competitors) { /* Send a command to all clients to start up a new AI. * Works fine for Multiplayer and Singleplayer */ - return DoCommandP(0, CCA_NEW_AI | INVALID_COMPANY << 16, 0, CMD_COMPANY_CTRL); + return DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | INVALID_COMPANY << 16, 0); } return false; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index fe8c2326c2..d8b468ad91 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -435,11 +435,11 @@ struct CompanyFinancesWindow : Window { break; case WID_CF_INCREASE_LOAN: // increase loan - DoCommandP(0, 0, _ctrl_pressed, CMD_INCREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY)); + DoCommandP(CMD_INCREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY), 0, 0, _ctrl_pressed); break; case WID_CF_REPAY_LOAN: // repay loan - DoCommandP(0, 0, _ctrl_pressed, CMD_DECREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_REPAY_LOAN)); + DoCommandP(CMD_DECREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_REPAY_LOAN), 0, 0, _ctrl_pressed); break; case WID_CF_INFRASTRUCTURE: // show infrastructure details @@ -995,12 +995,12 @@ public: for (LiveryScheme scheme = LS_DEFAULT; scheme < LS_END; scheme++) { /* Changed colour for the selected scheme, or all visible schemes if CTRL is pressed. */ if (HasBit(this->sel, scheme) || (_ctrl_pressed && _livery_class[scheme] == this->livery_class && HasBit(_loaded_newgrf_features.used_liveries, scheme))) { - DoCommandP(0, scheme | (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256), index, CMD_SET_COMPANY_COLOUR); + DoCommandP(CMD_SET_COMPANY_COLOUR, 0, scheme | (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256), index); } } } else { /* Setting group livery */ - DoCommandP(0, this->sel, (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256) | (index << 16), CMD_SET_GROUP_LIVERY); + DoCommandP(CMD_SET_GROUP_LIVERY, 0, this->sel, (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256) | (index << 16)); } } @@ -1581,7 +1581,7 @@ public: /* OK button */ case WID_SCMF_ACCEPT: - DoCommandP(0, 0, this->face, CMD_SET_COMPANY_MANAGER_FACE); + DoCommandP(CMD_SET_COMPANY_MANAGER_FACE, 0, 0, this->face); FALLTHROUGH; /* Cancel button */ @@ -2576,11 +2576,11 @@ struct CompanyWindow : Window break; case WID_C_BUY_SHARE: - DoCommandP(0, this->window_number, 0, CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS)); + DoCommandP(CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS), 0, this->window_number, 0); break; case WID_C_SELL_SHARE: - DoCommandP(0, this->window_number, 0, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_SELL_25_SHARE_IN)); + DoCommandP(CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_SELL_25_SHARE_IN), 0, this->window_number, 0); break; case WID_C_COMPANY_PASSWORD: @@ -2613,7 +2613,7 @@ struct CompanyWindow : Window void OnPlaceObject(Point pt, TileIndex tile) override { - if (DoCommandP(tile, OBJECT_HQ, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS)) && !_shift_pressed) { + if (DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS), tile, OBJECT_HQ, 0) && !_shift_pressed) { ResetObjectToPlace(); this->RaiseButtons(); } @@ -2635,16 +2635,16 @@ struct CompanyWindow : Window Money money = (Money)(strtoull(str, nullptr, 10) / _currency->rate); uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 - DoCommandP(0, money_c, this->window_number, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_CAN_T_GIVE_MONEY)); + DoCommandP(CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_CAN_T_GIVE_MONEY), 0, money_c, this->window_number); break; } case WID_C_PRESIDENT_NAME: - DoCommandP(0, 0, 0, CMD_RENAME_PRESIDENT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_PRESIDENT), nullptr, str); + DoCommandP(CMD_RENAME_PRESIDENT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_PRESIDENT), 0, 0, 0, str); break; case WID_C_COMPANY_NAME: - DoCommandP(0, 0, 0, CMD_RENAME_COMPANY | CMD_MSG(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME), nullptr, str); + DoCommandP(CMD_RENAME_COMPANY | CMD_MSG(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME), 0, 0, 0, str); break; case WID_C_COMPANY_JOIN: @@ -2771,7 +2771,7 @@ struct BuyCompanyWindow : Window { break; case WID_BC_YES: - DoCommandP(0, this->window_number, 0, CMD_BUY_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_COMPANY)); + DoCommandP(CMD_BUY_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_COMPANY), 0, this->window_number, 0); break; } } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 5cdb744abc..040b938fe7 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -630,7 +630,7 @@ DEF_CONSOLE_CMD(ConPauseGame) } if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); if (!_networking) IConsolePrint(CC_DEFAULT, "Game paused."); } else { IConsolePrint(CC_DEFAULT, "Game is already paused."); @@ -652,7 +652,7 @@ DEF_CONSOLE_CMD(ConUnpauseGame) } if ((_pause_mode & PM_PAUSED_NORMAL) != PM_UNPAUSED) { - DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); if (!_networking) IConsolePrint(CC_DEFAULT, "Game unpaused."); } else if ((_pause_mode & PM_PAUSED_ERROR) != PM_UNPAUSED) { IConsolePrint(CC_DEFAULT, "Game is in error state and cannot be unpaused via console."); @@ -863,7 +863,7 @@ DEF_CONSOLE_CMD(ConResetCompany) } /* It is safe to remove this company */ - DoCommandP(0, CCA_DELETE | index << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | index << 16 | CRR_MANUAL << 24, 0); IConsolePrint(CC_DEFAULT, "Company deleted."); return true; @@ -1220,7 +1220,7 @@ DEF_CONSOLE_CMD(ConStartAI) } /* Start a new AI company */ - DoCommandP(0, CCA_NEW_AI | INVALID_COMPANY << 16, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | INVALID_COMPANY << 16, 0); return true; } @@ -1256,8 +1256,8 @@ DEF_CONSOLE_CMD(ConReloadAI) } /* First kill the company of the AI, then start a new one. This should start the current AI again */ - DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); - DoCommandP(0, CCA_NEW_AI | company_id << 16, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | company_id << 16, 0); IConsolePrint(CC_DEFAULT, "AI reloaded."); return true; @@ -1294,7 +1294,7 @@ DEF_CONSOLE_CMD(ConStopAI) } /* Now kill the company of the AI. */ - DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0); IConsolePrint(CC_DEFAULT, "AI stopped, company deleted."); return true; diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index d6f4d900cf..7ff812c230 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -141,7 +141,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh if (wagon == v) return; - DoCommandP(v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index, CMD_MOVE_RAIL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_MOVE_VEHICLE)); + DoCommandP(CMD_MOVE_RAIL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_MOVE_VEHICLE), v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index); } static VehicleCellSize _base_block_sizes_depot[VEH_COMPANY_END]; ///< Cell size for vehicle images in the depot view. @@ -802,7 +802,7 @@ struct DepotWindow : Window { case WID_D_STOP_ALL: case WID_D_START_ALL: { VehicleListIdentifier vli(VL_DEPOT_LIST, this->type, this->owner); - DoCommandP(this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack(), CMD_MASS_START_STOP); + DoCommandP(CMD_MASS_START_STOP, this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack()); break; } @@ -825,7 +825,7 @@ struct DepotWindow : Window { break; case WID_D_AUTOREPLACE: - DoCommandP(this->window_number, this->type, 0, CMD_DEPOT_MASS_AUTOREPLACE); + DoCommandP(CMD_DEPOT_MASS_AUTOREPLACE, this->window_number, this->type, 0); break; } @@ -836,7 +836,7 @@ struct DepotWindow : Window { if (str == nullptr) return; /* Do depot renaming */ - DoCommandP(0, this->GetDepotIndex(), 0, CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), nullptr, str); + DoCommandP(CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), 0, this->GetDepotIndex(), 0, str); } bool OnRightClick(Point pt, int widget) override @@ -904,10 +904,10 @@ struct DepotWindow : Window { { if (_ctrl_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ - DoCommandP(this->window_number, v->index, 1, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), nullptr); + DoCommandP(CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), this->window_number, v->index, 1); } else { /* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to changs things on new vehicle) */ - if (DoCommandP(this->window_number, v->index, 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle)) { + if (DoCommandP(CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle, this->window_number, v->index, 0)) { ResetObjectToPlace(); } } @@ -1001,8 +1001,8 @@ struct DepotWindow : Window { if (this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, &gdvp) == MODE_DRAG_VEHICLE && sel != INVALID_VEHICLE) { if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _ctrl_pressed) { - DoCommandP(Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true, - CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE)); + DoCommandP(CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE), + Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true); } else if (gdvp.wagon == nullptr || gdvp.wagon->index != sel) { this->vehicle_over = INVALID_VEHICLE; TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head); @@ -1027,7 +1027,7 @@ struct DepotWindow : Window { this->SetDirty(); int sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0; - DoCommandP(v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0, GetCmdSellVeh(v->type)); + DoCommandP(GetCmdSellVeh(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0); break; } @@ -1091,7 +1091,7 @@ static void DepotSellAllConfirmationCallback(Window *win, bool confirmed) DepotWindow *w = (DepotWindow*)win; TileIndex tile = w->window_number; byte vehtype = w->type; - DoCommandP(tile, vehtype, 0, CMD_DEPOT_SELL_ALL_VEHICLES); + DoCommandP(CMD_DEPOT_SELL_ALL_VEHICLES, tile, vehtype, 0); } } diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 77ebe1be78..0911555a4e 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -191,7 +191,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_LOCK: // Build lock button - DoCommandP(tile, 0, 0, CMD_BUILD_LOCK | CMD_MSG(STR_ERROR_CAN_T_BUILD_LOCKS), CcBuildDocks); + DoCommandP(CMD_BUILD_LOCK | CMD_MSG(STR_ERROR_CAN_T_BUILD_LOCKS), CcBuildDocks, tile, 0, 0); break; case WID_DT_DEMOLISH: // Demolish aka dynamite button @@ -199,7 +199,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_DEPOT: // Build depot button - DoCommandP(tile, _ship_depot_direction, 0, CMD_BUILD_SHIP_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT), CcBuildDocks); + DoCommandP(CMD_BUILD_SHIP_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT), CcBuildDocks, tile, _ship_depot_direction, 0); break; case WID_DT_STATION: { // Build station button @@ -217,7 +217,7 @@ struct BuildDocksToolbarWindow : Window { } case WID_DT_BUOY: // Build buoy button - DoCommandP(tile, 0, 0, CMD_BUILD_BUOY | CMD_MSG(STR_ERROR_CAN_T_POSITION_BUOY_HERE), CcBuildDocks); + DoCommandP(CMD_BUILD_BUOY | CMD_MSG(STR_ERROR_CAN_T_POSITION_BUOY_HERE), CcBuildDocks, tile, 0, 0); break; case WID_DT_RIVER: // Build river button (in scenario editor) @@ -225,7 +225,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_BUILD_AQUEDUCT: // Build aqueduct button - DoCommandP(tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15, CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE), CcBuildBridge); + DoCommandP(CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE), CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15); break; default: NOT_REACHED(); @@ -245,10 +245,10 @@ struct BuildDocksToolbarWindow : Window { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); break; case DDSP_CREATE_WATER: - DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_CONSTRUCTION_WATER); + DoCommandP(CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL); break; case DDSP_CREATE_RIVER: - DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0), CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_CONSTRUCTION_WATER); + DoCommandP(CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0)); break; default: break; diff --git a/src/economy.cpp b/src/economy.cpp index 5c25636454..b7100257a0 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -627,7 +627,7 @@ static void CompanyCheckBankrupt(Company *c) * player we are sure (the above check) that we are not the local * company and thus we won't be moved. */ if (!_networking || _network_server) { - DoCommandP(0, CCA_DELETE | (c->index << 16) | (CRR_BANKRUPT << 24), 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | (c->index << 16) | (CRR_BANKRUPT << 24), 0); return; } break; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index bc0143be17..6710967f43 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -125,7 +125,7 @@ struct EnginePreviewWindow : Window { { switch (widget) { case WID_EP_YES: - DoCommandP(0, this->window_number, 0, CMD_WANT_ENGINE_PREVIEW); + DoCommandP(CMD_WANT_ENGINE_PREVIEW, 0, this->window_number, 0); FALLTHROUGH; case WID_EP_NO: if (!_shift_pressed) this->Close(); diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index c0551701e8..9d7ab70d8c 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -358,7 +358,7 @@ public: /* pause is only used in single-player, non-editor mode, non-menu mode. It * will be unpaused in the WE_DESTROY event handler. */ if (_game_mode != GM_MENU && !_networking && _game_mode != GM_EDITOR) { - DoCommandP(0, PM_PAUSED_SAVELOAD, 1, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 1); } SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0); @@ -402,7 +402,7 @@ public: { /* pause is only used in single-player, non-editor mode, non menu mode */ if (!_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) { - DoCommandP(0, PM_PAUSED_SAVELOAD, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); } this->Window::Close(); } diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index 65ed9003b0..d6180b0df2 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -382,17 +382,17 @@ struct GoalQuestionWindow : public Window { { switch (widget) { case WID_GQ_BUTTON_1: - DoCommandP(0, this->window_number, this->button[0], CMD_GOAL_QUESTION_ANSWER); + DoCommandP(CMD_GOAL_QUESTION_ANSWER, 0, this->window_number, this->button[0]); this->Close(); break; case WID_GQ_BUTTON_2: - DoCommandP(0, this->window_number, this->button[1], CMD_GOAL_QUESTION_ANSWER); + DoCommandP(CMD_GOAL_QUESTION_ANSWER, 0, this->window_number, this->button[1]); this->Close(); break; case WID_GQ_BUTTON_3: - DoCommandP(0, this->window_number, this->button[2], CMD_GOAL_QUESTION_ANSWER); + DoCommandP(CMD_GOAL_QUESTION_ANSWER, 0, this->window_number, this->button[2]); this->Close(); break; } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 374ed5700d..ee8e604744 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -640,7 +640,7 @@ public: if (confirmed) { VehicleGroupWindow *w = (VehicleGroupWindow*)win; w->vli.index = ALL_GROUP; - DoCommandP(0, w->group_confirm, 0, CMD_DELETE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_DELETE)); + DoCommandP(CMD_DELETE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_DELETE), 0, w->group_confirm, 0); } } @@ -771,7 +771,7 @@ public: } case WID_GL_CREATE_GROUP: { // Create a new group - DoCommandP(0, this->vli.vtype, this->vli.index, CMD_CREATE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_CREATE), CcCreateGroup); + DoCommandP(CMD_CREATE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_CREATE), CcCreateGroup, 0, this->vli.vtype, this->vli.index); break; } @@ -800,14 +800,14 @@ public: case WID_GL_START_ALL: case WID_GL_STOP_ALL: { // Start/stop all vehicles of the list - DoCommandP(0, (1 << 1) | (widget == WID_GL_START_ALL ? (1 << 0) : 0), this->vli.Pack(), CMD_MASS_START_STOP); + DoCommandP(CMD_MASS_START_STOP, 0, (1 << 1) | (widget == WID_GL_START_ALL ? (1 << 0) : 0), this->vli.Pack()); break; } case WID_GL_REPLACE_PROTECTION: { const Group *g = Group::GetIfValid(this->vli.index); if (g != nullptr) { - DoCommandP(0, this->vli.index | (GroupFlags::GF_REPLACE_PROTECTION << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION) ? 0 : 1) | (_ctrl_pressed << 1), CMD_SET_GROUP_FLAG); + DoCommandP(CMD_SET_GROUP_FLAG, 0, this->vli.index | (GroupFlags::GF_REPLACE_PROTECTION << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION) ? 0 : 1) | (_ctrl_pressed << 1)); } break; } @@ -822,7 +822,7 @@ public: case WID_GL_ALL_VEHICLES: // All vehicles case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles if (g->parent != INVALID_GROUP) { - DoCommandP(0, this->group_sel | (1 << 16), INVALID_GROUP, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT)); + DoCommandP(CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT), 0, this->group_sel | (1 << 16), INVALID_GROUP); } this->group_sel = INVALID_GROUP; @@ -835,7 +835,7 @@ public: GroupID new_g = id_g >= this->groups.size() ? INVALID_GROUP : this->groups[id_g]->index; if (this->group_sel != new_g && g->parent != new_g) { - DoCommandP(0, this->group_sel | (1 << 16), new_g, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT)); + DoCommandP(CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT), 0, this->group_sel | (1 << 16), new_g); } this->group_sel = INVALID_GROUP; @@ -850,7 +850,7 @@ public: { switch (widget) { case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles - DoCommandP(0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE)); + DoCommandP(CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), 0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); this->vehicle_sel = INVALID_VEHICLE; this->group_over = INVALID_GROUP; @@ -867,7 +867,7 @@ public: uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; - DoCommandP(0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr); + DoCommandP(CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); break; } @@ -922,7 +922,7 @@ public: void OnQueryTextFinished(char *str) override { - if (str != nullptr) DoCommandP(0, this->group_rename, 0, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_RENAME), nullptr, str); + if (str != nullptr) DoCommandP(CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_RENAME), 0, this->group_rename, 0, str); this->group_rename = INVALID_GROUP; } @@ -952,19 +952,19 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: { // Send to Depots - DoCommandP(0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack(), GetCmdSendToDepot(this->vli.vtype)); + DoCommandP(GetCmdSendToDepot(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack()); break; } case ADI_ADD_SHARED: // Add shared Vehicles assert(Group::IsValidID(this->vli.index)); - DoCommandP(0, this->vli.index, this->vli.vtype, CMD_ADD_SHARED_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE)); + DoCommandP(CMD_ADD_SHARED_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE), 0, this->vli.index, this->vli.vtype); break; case ADI_REMOVE_ALL: // Remove all Vehicles from the selected group assert(Group::IsValidID(this->vli.index)); - DoCommandP(0, this->vli.index, 0, CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES)); + DoCommandP(CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES), 0, this->vli.index, 0); break; default: NOT_REACHED(); } diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 768b9c9c17..0dfaebc3b7 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -96,7 +96,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { EndGameWindow(WindowDesc *desc) : EndGameHighScoreBaseWindow(desc) { /* Pause in single-player to have a look at the highscore at your own leisure */ - if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + if (!_networking) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); this->background_img = SPR_TYCOON_IMG1_BEGIN; @@ -124,7 +124,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { void Close() override { - if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause + if (!_networking) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); // unpause ShowHighscoreTable(this->window_number, this->rank); this->EndGameHighScoreBaseWindow::Close(); } @@ -159,7 +159,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { /* pause game to show the chart */ this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL; - if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + if (!_networking && !this->game_paused_by_player) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); /* Close all always on-top windows to get a clean screen */ if (_game_mode != GM_MENU) HideVitalWindows(); @@ -174,7 +174,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { if (_game_mode != GM_MENU) ShowVitalWindows(); - if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause + if (!_networking && !this->game_paused_by_player) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); // unpause this->EndGameHighScoreBaseWindow::Close(); } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index bfdb308b66..e78b6853d3 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -678,7 +678,7 @@ public: case WID_DPI_FUND_WIDGET: { if (this->selected_type != INVALID_INDUSTRYTYPE) { if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) { - DoCommandP(0, this->selected_type, InteractiveRandom(), CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY)); + DoCommandP(CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), 0, this->selected_type, InteractiveRandom()); this->HandleButtonClick(WID_DPI_FUND_WIDGET); } else { HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT); @@ -715,14 +715,13 @@ public: Backup old_generating_world(_generating_world, true, FILE_LINE); _ignore_restrictions = true; - DoCommandP(tile, (layout_index << 8) | this->selected_type, seed, - CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), &CcBuildIndustry); + DoCommandP(CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed); cur_company.Restore(); old_generating_world.Restore(); _ignore_restrictions = false; } else { - success = DoCommandP(tile, (layout_index << 8) | this->selected_type, seed, CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY)); + success = DoCommandP(CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), tile, (layout_index << 8) | this->selected_type, seed); } /* If an industry has been built, just reset the cursor and the system */ diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp index ce28ec3d85..c4fc2d5f9c 100644 --- a/src/linkgraph/linkgraphschedule.cpp +++ b/src/linkgraph/linkgraphschedule.cpp @@ -173,7 +173,7 @@ void StateGameLoop_LinkGraphPauseControl() if (_pause_mode & PM_PAUSED_LINK_GRAPH) { /* We are paused waiting on a job, check the job every tick. */ if (!LinkGraphSchedule::instance.IsJoinWithUnfinishedJobDue()) { - DoCommandP(0, PM_PAUSED_LINK_GRAPH, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_LINK_GRAPH, 0); } } else if (_pause_mode == PM_UNPAUSED && _date_fract == LinkGraphSchedule::SPAWN_JOIN_TICK - 2 && @@ -181,7 +181,7 @@ void StateGameLoop_LinkGraphPauseControl() LinkGraphSchedule::instance.IsJoinWithUnfinishedJobDue()) { /* Perform check two _date_fract ticks before we would join, to make * sure it also works in multiplayer. */ - DoCommandP(0, PM_PAUSED_LINK_GRAPH, 1, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_LINK_GRAPH, 1); } } diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 6131050cf8..46fff1a51b 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -326,7 +326,7 @@ struct MainWindow : Window case GHK_MONEY: // Gimme money /* You can only cheat for money in singleplayer mode. */ - if (!_networking) DoCommandP(0, 10000000, 0, CMD_MONEY_CHEAT); + if (!_networking) DoCommandP(CMD_MONEY_CHEAT, 0, 10000000, 0); break; case GHK_UPDATE_COORDS: // Update the coordinates of all station signs diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index e60717cf89..c461d36dc8 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -134,7 +134,7 @@ CommandCost CmdDecreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint static void AskUnsafeUnpauseCallback(Window *w, bool confirmed) { if (confirmed) { - DoCommandP(0, PM_PAUSED_ERROR, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_ERROR, 0); } } diff --git a/src/network/network.cpp b/src/network/network.cpp index dd0a915949..6e111926ed 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -394,7 +394,7 @@ static void CheckPauseHelper(bool pause, PauseMode pm) { if (pause == ((_pause_mode & pm) != PM_UNPAUSED)) return; - DoCommandP(0, pm, pause ? 1 : 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, pm, pause ? 1 : 0); } /** @@ -1064,7 +1064,7 @@ void NetworkGameLoop() while (f != nullptr && !feof(f)) { if (_date == next_date && _date_fract == next_date_fract) { if (cp != nullptr) { - NetworkSendCommand(cp->tile, cp->p1, cp->p2, cp->cmd & ~CMD_FLAGS_MASK, nullptr, cp->text, cp->company); + NetworkSendCommand(cp->cmd & ~CMD_FLAGS_MASK, nullptr, cp->company, cp->tile, cp->p1, cp->p2, cp->text); Debug(desync, 0, "Injecting: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, cp->tile, cp->p1, cp->p2, cp->cmd, cp->text, GetCommandName(cp->cmd)); delete cp; cp = nullptr; diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index f03601b39f..e638df0053 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -839,7 +839,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(Packet * the server will give us a client-id and let us in */ _network_join_status = NETWORK_JOIN_STATUS_REGISTERING; ShowJoinStatusWindow(); - NetworkSendCommand(0, CCA_NEW, 0, CMD_COMPANY_CTRL, nullptr, {}, _local_company); + NetworkSendCommand(CMD_COMPANY_CTRL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } } else { /* take control over an existing company */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 6d03aaaa13..f1a0f682d3 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -125,15 +125,15 @@ static CommandQueue _local_execution_queue; /** * Prepare a DoCommand to be send over the network + * @param cmd The command to execute (a CMD_* value) + * @param callback A callback function to call after the command is finished + * @param company The company that wants to send the command * @param tile The tile to perform a command on (see #CommandProc) * @param p1 Additional data for the command (see #CommandProc) * @param p2 Additional data for the command (see #CommandProc) - * @param cmd The command to execute (a CMD_* value) - * @param callback A callback function to call after the command is finished * @param text The text to pass - * @param company The company that wants to send the command */ -void NetworkSendCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const std::string &text, CompanyID company) +void NetworkSendCommand(uint32 cmd, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { assert((cmd & CMD_FLAGS_MASK) == 0); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 76385a087d..c795e15501 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1395,7 +1395,7 @@ static void AdminCompanyResetCallback(Window *w, bool confirmed) { if (confirmed) { if (NetworkCompanyHasClients(_admin_company_id)) return; - DoCommandP(0, CCA_DELETE | _admin_company_id << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | _admin_company_id << 16 | CRR_MANUAL << 24, 0); } } @@ -1535,9 +1535,9 @@ private: static void OnClickCompanyNew(NetworkClientListWindow *w, Point pt, CompanyID company_id) { if (_network_server) { - DoCommandP(0, CCA_NEW, _network_own_client_id, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW, _network_own_client_id); } else { - NetworkSendCommand(0, CCA_NEW, 0, CMD_COMPANY_CTRL, nullptr, {}, _local_company); + NetworkSendCommand(CMD_COMPANY_CTRL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 9deaa5522d..65e8010736 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1553,7 +1553,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_unprotected-months, and is there no protection? */ if (_settings_client.network.autoclean_unprotected != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_unprotected && _network_company_states[c->index].password.empty()) { /* Shut the company down */ - DoCommandP(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0); IConsolePrint(CC_INFO, "Auto-cleaned company #{} with no password.", c->index + 1); } /* Is the company empty for autoclean_protected-months, and there is a protection? */ @@ -1567,7 +1567,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_novehicles-months, and has no vehicles? */ if (_settings_client.network.autoclean_novehicles != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_novehicles && vehicles_in_company[c->index] == 0) { /* Shut the company down */ - DoCommandP(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, CMD_COMPANY_CTRL); + DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0); IConsolePrint(CC_INFO, "Auto-cleaned company #{} with no vehicles.", c->index + 1); } } else { @@ -2078,7 +2078,7 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci) /* ci is nullptr when replaying, or for AIs. In neither case there is a client. */ ci->client_playas = c->index; NetworkUpdateClientInfo(ci->client_id); - NetworkSendCommand(0, 0, 0, CMD_RENAME_PRESIDENT, nullptr, ci->client_name, c->index); + NetworkSendCommand(CMD_RENAME_PRESIDENT, nullptr, c->index, 0, 0, 0, ci->client_name); } /* Announce new company on network. */ diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 4ab9615337..b05d46831b 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -541,8 +541,8 @@ public: void OnPlaceObject(Point pt, TileIndex tile) override { ObjectClass *objclass = ObjectClass::Get(_selected_object_class); - DoCommandP(tile, objclass->GetSpec(_selected_object_index)->Index(), - _selected_object_view, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_OBJECT), CcTerraform); + DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_OBJECT), CcTerraform, + tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view); } void OnPlaceObjectAbort() override diff --git a/src/openttd.cpp b/src/openttd.cpp index 189010aad1..abd5d99df6 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -851,7 +851,7 @@ static void MakeNewGameDone() /* In a dedicated server, the server does not play */ if (!VideoDriver::GetInstance()->HasGUI()) { OnStartGame(true); - if (_settings_client.gui.pause_on_newgame) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + if (_settings_client.gui.pause_on_newgame) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); return; } @@ -880,7 +880,7 @@ static void MakeNewGameDone() NetworkChangeCompanyPassword(_local_company, _settings_client.network.default_company_pass); } - if (_settings_client.gui.pause_on_newgame) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + if (_settings_client.gui.pause_on_newgame) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); CheckEngines(); CheckIndustries(); @@ -1045,7 +1045,7 @@ void SwitchToMode(SwitchMode new_mode) } OnStartGame(_network_dedicated); /* Decrease pause counter (was increased from opening load dialog) */ - DoCommandP(0, PM_PAUSED_SAVELOAD, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); } break; } @@ -1067,7 +1067,7 @@ void SwitchToMode(SwitchMode new_mode) SetLocalCompany(OWNER_NONE); _settings_newgame.game_creation.starting_year = _cur_year; /* Cancel the saveload pausing */ - DoCommandP(0, PM_PAUSED_SAVELOAD, 0, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); } else { SetDParamStr(0, GetSaveLoadErrorString()); ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR); diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 8b8c2685f6..e3bcb30eb5 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -169,7 +169,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, /* If it's not a backup of us, ignore it. */ if (ob->user != user) continue; - DoCommandP(0, 0, user, CMD_CLEAR_ORDER_BACKUP); + DoCommandP(CMD_CLEAR_ORDER_BACKUP, 0, 0, user); return; } } @@ -198,7 +198,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, /* We need to circumvent the "prevention" from this command being executed * while the game is paused, so use the internal method. Nor do we want * this command to get its cost estimated when shift is pressed. */ - DoCommandPInternal(ob->tile, 0, user, CMD_CLEAR_ORDER_BACKUP, nullptr, {}, true, false); + DoCommandPInternal(CMD_CLEAR_ORDER_BACKUP, nullptr, true, false, ob->tile, 0, user, {}); } else { /* The command came from the game logic, i.e. the clearing of a tile. * In that case we have no need to actually sync this, just do it. */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 3205be166f..8ec4e7e985 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -591,7 +591,7 @@ private: } if (order->GetLoadType() == load_type) return; // If we still match, do nothing - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4), CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4)); } /** @@ -606,7 +606,7 @@ private: if (order == nullptr) return; i = (order->GetDepotOrderType() & ODTFB_SERVICE) ? DA_ALWAYS_GO : DA_SERVICE; } - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4), CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4)); } /** @@ -621,7 +621,7 @@ private: _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); order.SetDepotActionType(ODATFB_NEAREST_DEPOT); - DoCommandP(this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack(), CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER)); + DoCommandP(CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); } /** @@ -641,11 +641,11 @@ private: } if (order->GetUnloadType() == unload_type) return; // If we still match, do nothing - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4), CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4)); /* Transfer and unload orders with leave empty as default */ if (unload_type == OUFB_TRANSFER || unload_type == OUFB_UNLOAD) { - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (OLFB_NO_LOAD << 4), CMD_MODIFY_ORDER); + DoCommandP(CMD_MODIFY_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (OLFB_NO_LOAD << 4)); this->SetWidgetDirty(WID_O_FULL_LOAD); } } @@ -669,7 +669,7 @@ private: } this->SetWidgetDirty(WID_O_NON_STOP); - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4, CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4); } /** @@ -682,8 +682,8 @@ private: if (_ctrl_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return; if (this->vehicle->GetNumOrders() <= 1) return; - DoCommandP(this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders()), - CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER)); + DoCommandP(CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER), + this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())); } /** @@ -694,7 +694,7 @@ private: /* When networking, move one order lower */ int selected = this->selected_order + (int)_networking; - if (DoCommandP(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CMD_DELETE_ORDER | CMD_MSG(STR_ERROR_CAN_T_DELETE_THIS_ORDER))) { + if (DoCommandP(CMD_DELETE_ORDER | CMD_MSG(STR_ERROR_CAN_T_DELETE_THIS_ORDER), this->vehicle->tile, this->vehicle->index, this->OrderGetSel())) { this->selected_order = selected >= this->vehicle->GetNumOrders() ? -1 : selected; this->UpdateButtonState(); } @@ -719,7 +719,7 @@ private: /* Get another vehicle that share orders with this vehicle. */ Vehicle *other_shared = (this->vehicle->FirstShared() == this->vehicle) ? this->vehicle->NextShared() : this->vehicle->PreviousShared(); /* Copy the order list of the other vehicle. */ - if (DoCommandP(this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index, CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST))) { + if (DoCommandP(CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST), this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index)) { this->UpdateButtonState(); } } @@ -734,10 +734,10 @@ private: { if (_ctrl_pressed) { /* Cancel refitting */ - DoCommandP(this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT, CMD_ORDER_REFIT); + DoCommandP(CMD_ORDER_REFIT, this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT); } else { if (i == 1) { // Auto-refit to available cargo type. - DoCommandP(this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | CT_AUTO_REFIT, CMD_ORDER_REFIT); + DoCommandP(CMD_ORDER_REFIT, this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | CT_AUTO_REFIT); } else { ShowVehicleRefitWindow(this->vehicle, this->OrderGetSel(), this, auto_refit); } @@ -1159,7 +1159,7 @@ public: order.index = 0; order.MakeConditional(order_id); - DoCommandP(this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack(), CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER)); + DoCommandP(CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); } ResetObjectToPlace(); break; @@ -1182,9 +1182,9 @@ public: this->selected_order = -1; } else if (sel == this->selected_order) { if (this->vehicle->type == VEH_TRAIN && sel < this->vehicle->GetNumOrders()) { - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel << 20), - MOF_STOP_LOCATION | ((this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END) << 4, - CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), + this->vehicle->tile, this->vehicle->index + (sel << 20), + MOF_STOP_LOCATION | ((this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END) << 4); } } else { /* Select clicked order */ @@ -1331,7 +1331,7 @@ public: default: break; } - DoCommandP(this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4, CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4); } } @@ -1369,11 +1369,11 @@ public: break; case WID_O_COND_VARIABLE: - DoCommandP(this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4, CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4); break; case WID_O_COND_COMPARATOR: - DoCommandP(this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4, CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER)); + DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4); break; } } @@ -1386,7 +1386,7 @@ public: VehicleOrderID to_order = this->GetOrderFromPt(pt.y); if (!(from_order == to_order || from_order == INVALID_VEH_ORDER_ID || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_VEH_ORDER_ID || to_order > this->vehicle->GetNumOrders()) && - DoCommandP(this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16), CMD_MOVE_ORDER | CMD_MSG(STR_ERROR_CAN_T_MOVE_THIS_ORDER))) { + DoCommandP(CMD_MOVE_ORDER | CMD_MSG(STR_ERROR_CAN_T_MOVE_THIS_ORDER), this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16))) { this->selected_order = -1; this->UpdateButtonState(); } @@ -1438,7 +1438,7 @@ public: const Order cmd = GetOrderCmdFromTile(this->vehicle, tile); if (cmd.IsType(OT_NOTHING)) return; - if (DoCommandP(this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack(), CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER))) { + if (DoCommandP(CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack())) { /* With quick goto the Go To button stays active */ if (!_settings_client.gui.quick_goto) ResetObjectToPlace(); } @@ -1455,8 +1455,8 @@ public: bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; - if (DoCommandP(this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index, - share_order ? CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_SHARE_ORDER_LIST) : CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_COPY_ORDER_LIST))) { + if (DoCommandP(share_order ? CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_SHARE_ORDER_LIST) : CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_COPY_ORDER_LIST), + this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index)) { this->selected_order = -1; ResetObjectToPlace(); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 9ed9032c45..17254ccfb0 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -92,11 +92,11 @@ void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, TileIndex tile, ui static void GenericPlaceRail(TileIndex tile, int cmd) { - DoCommandP(tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3), - _remove_button_clicked ? + DoCommandP(_remove_button_clicked ? CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) : CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK), - CcPlaySound_CONSTRUCTION_RAIL); + CcPlaySound_CONSTRUCTION_RAIL, + tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3)); } /** @@ -112,7 +112,7 @@ static void PlaceExtraDepotRail(TileIndex tile, DiagDirection dir, Track track) if (GetRailTileType(tile) == RAIL_TILE_SIGNALS && !_settings_client.gui.auto_remove_signals) return; if ((GetTrackBits(tile) & DiagdirReachesTracks(dir)) == 0) return; - DoCommandP(tile, _cur_railtype, track | (_settings_client.gui.auto_remove_signals << 3), CMD_BUILD_SINGLE_RAIL); + DoCommandP(CMD_BUILD_SINGLE_RAIL, tile, _cur_railtype, track | (_settings_client.gui.auto_remove_signals << 3)); } /** Additional pieces of track to add at the entrance of a depot. */ @@ -166,7 +166,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } else { /* Tile where we can't build rail waypoints. This is always going to fail, * but provides the user with a proper error message. */ - DoCommandP(tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT)); + DoCommandP(CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16); } } @@ -224,7 +224,7 @@ static void GenericPlaceSignals(TileIndex tile) Track track = FindFirstTrack(trackbits); if (_remove_button_clicked) { - DoCommandP(tile, track, 0, CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound_CONSTRUCTION_RAIL); + DoCommandP(CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound_CONSTRUCTION_RAIL, tile, track, 0); } else { const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); @@ -255,9 +255,8 @@ static void GenericPlaceSignals(TileIndex tile) SB(p1, 9, 6, cycle_types); } - DoCommandP(tile, p1, 0, CMD_BUILD_SIGNALS | - CMD_MSG((w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), - CcPlaySound_CONSTRUCTION_RAIL); + DoCommandP(CMD_BUILD_SIGNALS | CMD_MSG((w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), + CcPlaySound_CONSTRUCTION_RAIL, tile, p1, 0); } } @@ -359,11 +358,11 @@ static void BuildRailClick_Remove(Window *w) static void DoRailroadTrack(int mode) { uint32 p2 = _cur_railtype | (mode << 6) | (_settings_client.gui.auto_remove_signals << 11); - DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, - _remove_button_clicked ? + DoCommandP(_remove_button_clicked ? CMD_REMOVE_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) : CMD_BUILD_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK), - CcPlaySound_CONSTRUCTION_RAIL); + CcPlaySound_CONSTRUCTION_RAIL, + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2); } static void HandleAutodirPlacement() @@ -414,11 +413,11 @@ static void HandleAutoSignalPlacement() /* _settings_client.gui.drag_signals_density is given as a parameter such that each user * in a network game can specify their own signal density */ - DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, - _remove_button_clicked ? + DoCommandP(_remove_button_clicked ? CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM) : CMD_BUILD_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), - CcPlaySound_CONSTRUCTION_RAIL); + CcPlaySound_CONSTRUCTION_RAIL, + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2); } @@ -644,9 +643,8 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_DEPOT: - DoCommandP(tile, _cur_railtype, _build_depot_direction, - CMD_BUILD_TRAIN_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT), - CcRailDepot); + DoCommandP(CMD_BUILD_TRAIN_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT), + CcRailDepot, tile, _cur_railtype, _build_depot_direction); break; case WID_RAT_BUILD_WAYPOINT: @@ -666,7 +664,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_TUNNEL: - DoCommandP(tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, CMD_BUILD_TUNNEL | CMD_MSG(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE), CcBuildRailTunnel); + DoCommandP(CMD_BUILD_TUNNEL | CMD_MSG(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE), CcBuildRailTunnel, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0); break; case WID_RAT_CONVERT_RAIL: @@ -708,7 +706,7 @@ struct BuildRailToolbarWindow : Window { break; case DDSP_CONVERT_RAIL: - DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound_CONSTRUCTION_RAIL); + DoCommandP(CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0)); break; case DDSP_REMOVE_STATION: @@ -716,14 +714,14 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound_CONSTRUCTION_RAIL); + DoCommandP(CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); } else { HandleStationPlacement(start_tile, end_tile); } } else { /* Waypoint */ if (_remove_button_clicked) { - DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound_CONSTRUCTION_RAIL); + DoCommandP(CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); } else { TileArea ta(start_tile, end_tile); uint32 p1 = _cur_railtype | (select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y) << 6 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 30d9301aab..84ec742068 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -124,7 +124,7 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) /* if there is a roadpiece just outside of the station entrance, build a connecting route */ if (IsNormalRoadTile(tile)) { if (GetRoadBits(tile, GetRoadTramType(_cur_roadtype)) != ROAD_NONE) { - DoCommandP(tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0, CMD_BUILD_ROAD); + DoCommandP(CMD_BUILD_ROAD, tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0); } } } @@ -550,8 +550,8 @@ struct BuildRoadToolbarWindow : Window { break; case WID_ROT_DEPOT: - DoCommandP(tile, _cur_roadtype << 2 | _road_depot_orientation, 0, - CMD_BUILD_ROAD_DEPOT | CMD_MSG(this->rti->strings.err_depot), CcRoadDepot); + DoCommandP(CMD_BUILD_ROAD_DEPOT | CMD_MSG(this->rti->strings.err_depot), CcRoadDepot, + tile, _cur_roadtype << 2 | _road_depot_orientation, 0); break; case WID_ROT_BUS_STATION: @@ -567,8 +567,8 @@ struct BuildRoadToolbarWindow : Window { break; case WID_ROT_BUILD_TUNNEL: - DoCommandP(tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0, - CMD_BUILD_TUNNEL | CMD_MSG(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE), CcBuildRoadTunnel); + DoCommandP(CMD_BUILD_TUNNEL | CMD_MSG(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE), CcBuildRoadTunnel, + tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0); break; case WID_ROT_CONVERT_ROAD: @@ -669,10 +669,10 @@ struct BuildRoadToolbarWindow : Window { * flags */ _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3)); - DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10), - _remove_button_clicked ? + DoCommandP(_remove_button_clicked ? CMD_REMOVE_LONG_ROAD | CMD_MSG(this->rti->strings.err_remove_road) : - CMD_BUILD_LONG_ROAD | CMD_MSG(this->rti->strings.err_build_road), CcPlaySound_CONSTRUCTION_OTHER); + CMD_BUILD_LONG_ROAD | CMD_MSG(this->rti->strings.err_build_road), CcPlaySound_CONSTRUCTION_OTHER, + start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10)); break; case DDSP_BUILD_BUSSTOP: @@ -680,7 +680,7 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_BUS_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(this->rti->strings.err_remove_station[ROADSTOP_BUS]), CcPlaySound_CONSTRUCTION_OTHER); + DoCommandP(CMD_REMOVE_ROAD_STOP | CMD_MSG(this->rti->strings.err_remove_station[ROADSTOP_BUS]), CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS); } else { PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, CMD_BUILD_ROAD_STOP | CMD_MSG(this->rti->strings.err_build_station[ROADSTOP_BUS])); } @@ -692,7 +692,7 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_TRUCK_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(this->rti->strings.err_remove_station[ROADSTOP_TRUCK]), CcPlaySound_CONSTRUCTION_OTHER); + DoCommandP(CMD_REMOVE_ROAD_STOP | CMD_MSG(this->rti->strings.err_remove_station[ROADSTOP_TRUCK]), CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK); } else { PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP | CMD_MSG(this->rti->strings.err_build_station[ROADSTOP_TRUCK])); } @@ -700,7 +700,7 @@ struct BuildRoadToolbarWindow : Window { break; case DDSP_CONVERT_ROAD: - DoCommandP(end_tile, start_tile, _cur_roadtype, CMD_CONVERT_ROAD | CMD_MSG(rti->strings.err_convert_road), CcPlaySound_CONSTRUCTION_OTHER); + DoCommandP(CMD_CONVERT_ROAD | CMD_MSG(rti->strings.err_convert_road), CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype); break; } } diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index 1e20b55ed5..bb7260d9c5 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -329,7 +329,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() if (!estimate_only && _networking && !_generating_world) SetLastCommand(tile, p1, p2, cmd); /* Try to perform the command. */ - CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, command_text, false, estimate_only); + CommandCost res = ::DoCommandPInternal(cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, false, estimate_only, tile, p1, p2, command_text); /* We failed; set the error and bail out */ if (res.Failed()) { diff --git a/src/settings.cpp b/src/settings.cpp index 52f30be082..d821239fbb 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1549,7 +1549,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame) const IntSettingDesc *setting = sd->AsIntSetting(); if ((setting->flags & SF_PER_COMPANY) != 0) { if (Company::IsValidID(_local_company) && _game_mode != GM_MENU) { - return DoCommandP(0, 0, value, CMD_CHANGE_COMPANY_SETTING, nullptr, setting->GetName()); + return DoCommandP(CMD_CHANGE_COMPANY_SETTING, 0, 0, value, setting->GetName()); } setting->ChangeValue(&_settings_client.company, value); @@ -1575,7 +1575,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame) /* send non-company-based settings over the network */ if (!_networking || (_networking && _network_server)) { - return DoCommandP(0, 0, value, CMD_CHANGE_SETTING, nullptr, setting->GetName()); + return DoCommandP(CMD_CHANGE_SETTING, 0, 0, value, setting->GetName()); } return false; } @@ -1603,7 +1603,7 @@ void SyncCompanySettings() const SettingDesc *sd = GetSettingDesc(desc); uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object); uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object); - if (old_value != new_value) NetworkSendCommand(0, 0, new_value, CMD_CHANGE_COMPANY_SETTING, nullptr, sd->GetName(), _local_company); + if (old_value != new_value) NetworkSendCommand(CMD_CHANGE_COMPANY_SETTING, nullptr, _local_company, 0, 0, new_value, sd->GetName()); } } diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 78bbb8b4b5..77c5ce456c 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -130,5 +130,5 @@ void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 */ void PlaceProc_Sign(TileIndex tile) { - DoCommandP(tile, 0, 0, CMD_PLACE_SIGN | CMD_MSG(STR_ERROR_CAN_T_PLACE_SIGN_HERE), CcPlaceSign); + DoCommandP(CMD_PLACE_SIGN | CMD_MSG(STR_ERROR_CAN_T_PLACE_SIGN_HERE), CcPlaceSign, tile, 0, 0); } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 5169064625..368b57b43e 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -413,7 +413,7 @@ Window *ShowSignList() static bool RenameSign(SignID index, const char *text) { bool remove = StrEmpty(text); - DoCommandP(0, index, 0, CMD_RENAME_SIGN | (StrEmpty(text) ? CMD_MSG(STR_ERROR_CAN_T_DELETE_SIGN) : CMD_MSG(STR_ERROR_CAN_T_CHANGE_SIGN_NAME)), nullptr, text); + DoCommandP(CMD_RENAME_SIGN | (StrEmpty(text) ? CMD_MSG(STR_ERROR_CAN_T_DELETE_SIGN) : CMD_MSG(STR_ERROR_CAN_T_CHANGE_SIGN_NAME)), 0, index, 0, text); return remove; } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index ecc7ea77c3..1992a2c56c 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1947,7 +1947,7 @@ struct StationViewWindow : public Window { break; case WID_SV_CLOSE_AIRPORT: - DoCommandP(0, this->window_number, 0, CMD_OPEN_CLOSE_AIRPORT); + DoCommandP(CMD_OPEN_CLOSE_AIRPORT, 0, this->window_number, 0); break; case WID_SV_TRAINS: // Show list of scheduled trains to this station @@ -2084,7 +2084,7 @@ struct StationViewWindow : public Window { { if (str == nullptr) return; - DoCommandP(0, this->window_number, 0, CMD_RENAME_STATION | CMD_MSG(STR_ERROR_CAN_T_RENAME_STATION), nullptr, str); + DoCommandP(CMD_RENAME_STATION | CMD_MSG(STR_ERROR_CAN_T_RENAME_STATION), 0, this->window_number, 0, str); } void OnResize() override diff --git a/src/story_gui.cpp b/src/story_gui.cpp index ccb9ccf7b8..5330b8a304 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -566,7 +566,7 @@ protected: this->SetTimeout(); this->SetWidgetDirty(WID_SB_PAGE_PANEL); - DoCommandP(0, pe.index, 0, CMD_STORY_PAGE_BUTTON); + DoCommandP(CMD_STORY_PAGE_BUTTON, 0, pe.index, 0); break; case SPET_BUTTON_TILE: @@ -921,7 +921,7 @@ public: return; } - DoCommandP(tile, pe->index, 0, CMD_STORY_PAGE_BUTTON); + DoCommandP(CMD_STORY_PAGE_BUTTON, tile, pe->index, 0); ResetObjectToPlace(); } @@ -940,7 +940,7 @@ public: VehicleType wanted_vehtype = data.GetVehicleType(); if (wanted_vehtype != VEH_INVALID && wanted_vehtype != v->type) return false; - DoCommandP(0, pe->index, v->index, CMD_STORY_PAGE_BUTTON); + DoCommandP(CMD_STORY_PAGE_BUTTON, 0, pe->index, v->index); ResetObjectToPlace(); return true; } diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 820287e9ce..5e25df78ca 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -60,7 +60,7 @@ static void GenerateDesertArea(TileIndex end, TileIndex start) TileArea ta(start, end); for (TileIndex tile : ta) { SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT); - DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + DoCommandP(CMD_LANDSCAPE_CLEAR, tile, 0, 0); MarkTileDirtyByTile(tile); } old_generating_world.Restore(); @@ -115,16 +115,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - DoCommandP(end_tile, start_tile, _ctrl_pressed ? 1 : 0, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound_EXPLOSION); + DoCommandP(CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0); break; case DDSP_RAISE_AND_LEVEL_AREA: - DoCommandP(end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0), CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform); + DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0)); break; case DDSP_LOWER_AND_LEVEL_AREA: - DoCommandP(end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0), CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LOWER_LAND_HERE), CcTerraform); + DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LOWER_LAND_HERE), CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0)); break; case DDSP_LEVEL_AREA: - DoCommandP(end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0), CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LEVEL_LAND_HERE), CcTerraform); + DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LEVEL_LAND_HERE), CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0)); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -238,7 +238,7 @@ struct TerraformToolbarWindow : Window { break; case WID_TT_BUY_LAND: // Buy land button - DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound_CONSTRUCTION_RAIL); + DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0); break; case WID_TT_PLACE_SIGN: // Place sign button @@ -395,7 +395,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) StringID msg = mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE; - DoCommandP(tile, SLOPE_N, (uint32)mode, CMD_TERRAFORM_LAND | CMD_MSG(msg), CcTerraform); + DoCommandP(CMD_TERRAFORM_LAND | CMD_MSG(msg), CcTerraform, tile, SLOPE_N, (uint32)mode); } else { assert(_terraform_size != 0); TileArea ta(tile, _terraform_size, _terraform_size); @@ -422,7 +422,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) for (TileIndex tile2 : ta) { if (TileHeight(tile2) == h) { - DoCommandP(tile2, SLOPE_N, (uint32)mode, CMD_TERRAFORM_LAND); + DoCommandP(CMD_TERRAFORM_LAND, tile2, SLOPE_N, (uint32)mode); } } } diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 4853181b31..9f9bfad5a6 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -142,7 +142,7 @@ static void FillTimetableArrivalDepartureTable(const Vehicle *v, VehicleOrderID */ static void ChangeTimetableStartCallback(const Window *w, Date date) { - DoCommandP(0, w->window_number, date, CMD_SET_TIMETABLE_START | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); + DoCommandP(CMD_SET_TIMETABLE_START | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, w->window_number, date); } @@ -578,25 +578,25 @@ struct TimetableWindow : Window { case WID_VT_CLEAR_TIME: { // Clear waiting time. uint32 p1 = PackTimetableArgs(v, this->sel_index, false); - DoCommandP(0, p1, 0, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); + DoCommandP(CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, p1, 0); break; } case WID_VT_CLEAR_SPEED: { // Clear max speed button. uint32 p1 = PackTimetableArgs(v, this->sel_index, true); - DoCommandP(0, p1, UINT16_MAX, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); + DoCommandP(CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, p1, UINT16_MAX); break; } case WID_VT_RESET_LATENESS: // Reset the vehicle's late counter. - DoCommandP(0, v->index, 0, CMD_SET_VEHICLE_ON_TIME | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); + DoCommandP(CMD_SET_VEHICLE_ON_TIME | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, v->index, 0); break; case WID_VT_AUTOFILL: { // Autofill the timetable. uint32 p2 = 0; if (!HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(p2, 0); if (_ctrl_pressed) SetBit(p2, 1); - DoCommandP(0, v->index, p2, CMD_AUTOFILL_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); + DoCommandP(CMD_AUTOFILL_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, v->index, p2); break; } @@ -629,7 +629,7 @@ struct TimetableWindow : Window { uint32 p2 = std::min(val, UINT16_MAX); - DoCommandP(0, p1, p2, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE)); + DoCommandP(CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, p1, p2); } void OnResize() override diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index f5b3fa3b7d..665556e8ab 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -265,7 +265,7 @@ static CallBackFunction ToolbarPauseClick(Window *w) { if (_networking && !_network_server) return CBF_NONE; // only server can pause the game - if (DoCommandP(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, CMD_PAUSE)) { + if (DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED)) { if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP); } return CBF_NONE; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index a4bb240637..9082fc7b38 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -287,7 +287,7 @@ public: } case WID_TA_EXECUTE: - DoCommandP(this->town->xy, this->window_number, this->sel_index, CMD_DO_TOWN_ACTION | CMD_MSG(STR_ERROR_CAN_T_DO_THIS)); + DoCommandP(CMD_DO_TOWN_ACTION | CMD_MSG(STR_ERROR_CAN_T_DO_THIS), this->town->xy, this->window_number, this->sel_index); break; } } @@ -474,12 +474,12 @@ public: _warn_town_no_roads = true; } - DoCommandP(0, this->window_number, 0, CMD_EXPAND_TOWN | CMD_MSG(STR_ERROR_CAN_T_EXPAND_TOWN)); + DoCommandP(CMD_EXPAND_TOWN | CMD_MSG(STR_ERROR_CAN_T_EXPAND_TOWN), 0, this->window_number, 0); break; } case WID_TV_DELETE: // delete town - only available on Scenario editor - DoCommandP(0, this->window_number, 0, CMD_DELETE_TOWN | CMD_MSG(STR_ERROR_TOWN_CAN_T_DELETE)); + DoCommandP(CMD_DELETE_TOWN | CMD_MSG(STR_ERROR_TOWN_CAN_T_DELETE), 0, this->window_number, 0); break; } } @@ -561,7 +561,7 @@ public: { if (str == nullptr) return; - DoCommandP(0, this->window_number, 0, CMD_RENAME_TOWN | CMD_MSG(STR_ERROR_CAN_T_RENAME_TOWN), nullptr, str); + DoCommandP(CMD_RENAME_TOWN | CMD_MSG(STR_ERROR_CAN_T_RENAME_TOWN), 0, this->window_number, 0, str); } }; @@ -1162,8 +1162,8 @@ public: if (strcmp(buf, this->townname_editbox.text.buf) != 0) name = this->townname_editbox.text.buf; } - bool success = DoCommandP(tile, this->town_size | this->city << 2 | this->town_layout << 3 | random << 6, - townnameparts, CMD_FOUND_TOWN | CMD_MSG(errstr), cc, name); + bool success = DoCommandP(CMD_FOUND_TOWN | CMD_MSG(errstr), cc, + tile, this->town_size | this->city << 2 | this->town_layout << 3 | random << 6, townnameparts, name); /* Rerandomise name, if success and no cost-estimation. */ if (success && !_shift_pressed) this->RandomTownName(); diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 775b1f6374..e0a70d14fb 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -86,7 +86,7 @@ void CheckTrainsLengths() if (!_networking && first) { first = false; - DoCommandP(0, PM_PAUSED_ERROR, 1, CMD_PAUSE); + DoCommandP(CMD_PAUSE, 0, PM_PAUSED_ERROR, 1); } /* Break so we warn only once for each train. */ break; diff --git a/src/train_gui.cpp b/src/train_gui.cpp index c8995f9b74..9bb7d59476 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -44,7 +44,7 @@ void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p if (found != nullptr) { found = found->Last(); /* put the new wagon at the end of the loco. */ - DoCommandP(0, _new_vehicle_id, found->index, CMD_MOVE_RAIL_VEHICLE); + DoCommandP(CMD_MOVE_RAIL_VEHICLE, 0, _new_vehicle_id, found->index); InvalidateWindowClassesData(WC_TRAINS_LIST, 0); } } diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index ccec4705dc..005cebd467 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -230,7 +230,7 @@ public: TileIndex tile = TileVirtXY(pt.x, pt.y); if (this->mode == PM_NORMAL) { - DoCommandP(tile, this->tree_to_plant, tile, CMD_PLANT_TREE); + DoCommandP(CMD_PLANT_TREE, tile, this->tree_to_plant, tile); } else { this->DoPlantForest(tile); } @@ -240,7 +240,7 @@ public: void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL && pt.x != -1 && select_proc == DDSP_PLANT_TREES) { - DoCommandP(end_tile, this->tree_to_plant, start_tile, CMD_PLANT_TREE | CMD_MSG(STR_ERROR_CAN_T_PLANT_TREE_HERE)); + DoCommandP(CMD_PLANT_TREE | CMD_MSG(STR_ERROR_CAN_T_PLANT_TREE_HERE), end_tile, this->tree_to_plant, start_tile); } } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index e11e340f59..56e1bb713b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1033,9 +1033,9 @@ struct RefitWindow : public Window { if (this->order == INVALID_VEH_ORDER_ID) { bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX; - if (DoCommandP(v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16, GetCmdRefitVeh(v)) && delete_window) this->Close(); + if (DoCommandP(GetCmdRefitVeh(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16) && delete_window) this->Close(); } else { - if (DoCommandP(v->tile, v->index, this->cargo->cargo | this->order << 16, CMD_ORDER_REFIT)) this->Close(); + if (DoCommandP(CMD_ORDER_REFIT, v->tile, v->index, this->cargo->cargo | this->order << 16)) this->Close(); } } break; @@ -1894,7 +1894,7 @@ public: case WID_VL_STOP_ALL: case WID_VL_START_ALL: - DoCommandP(0, (1 << 1) | (widget == WID_VL_START_ALL ? (1 << 0) : 0), this->window_number, CMD_MASS_START_STOP); + DoCommandP(CMD_MASS_START_STOP, 0, (1 << 1) | (widget == WID_VL_START_ALL ? (1 << 0) : 0), this->window_number); break; } } @@ -1919,7 +1919,7 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: // Send to Depots - DoCommandP(0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number, GetCmdSendToDepot(this->vli.vtype)); + DoCommandP(GetCmdSendToDepot(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number); break; default: NOT_REACHED(); @@ -2422,7 +2422,7 @@ struct VehicleDetailsWindow : Window { mod = GetServiceIntervalClamped(mod + v->GetServiceInterval(), v->ServiceIntervalIsPercent()); if (mod == v->GetServiceInterval()) return; - DoCommandP(v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17), CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING)); + DoCommandP(CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING), v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17)); break; } @@ -2458,7 +2458,7 @@ struct VehicleDetailsWindow : Window { bool iscustom = index != 0; bool ispercent = iscustom ? (index == 2) : Company::Get(v->owner)->settings.vehicle.servint_ispercent; uint16 interval = GetServiceIntervalClamped(v->GetServiceInterval(), ispercent); - DoCommandP(v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17), CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING)); + DoCommandP(CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING), v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17)); break; } } @@ -2639,7 +2639,7 @@ void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, ui void StartStopVehicle(const Vehicle *v, bool texteffect) { assert(v->IsPrimaryVehicle()); - DoCommandP(v->tile, v->index, 0, _vehicle_command_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr); + DoCommandP(_vehicle_command_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, 0); } /** Checks whether the vehicle may be refitted at the moment.*/ @@ -2963,7 +2963,7 @@ public: break; case WID_VV_GOTO_DEPOT: // goto hangar - DoCommandP(v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0, GetCmdSendToDepot(v)); + DoCommandP(GetCmdSendToDepot(v), v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0); break; case WID_VV_REFIT: // refit ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID, this); @@ -2987,18 +2987,17 @@ public: * There is no point to it except for starting the vehicle. * For starting the vehicle the player has to open the depot GUI, which is * most likely already open, but is also visible in the vehicle viewport. */ - DoCommandP(v->tile, v->index, _ctrl_pressed ? 1 : 0, - _vehicle_command_translation_table[VCT_CMD_CLONE_VEH][v->type], - _ctrl_pressed ? nullptr : CcCloneVehicle); + DoCommandP(_vehicle_command_translation_table[VCT_CMD_CLONE_VEH][v->type], + _ctrl_pressed ? nullptr : CcCloneVehicle, + v->tile, v->index, _ctrl_pressed ? 1 : 0); break; case WID_VV_TURN_AROUND: // turn around assert(v->IsGroundVehicle()); - DoCommandP(v->tile, v->index, 0, - _vehicle_command_translation_table[VCT_CMD_TURN_AROUND][v->type]); + DoCommandP(_vehicle_command_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0); break; case WID_VV_FORCE_PROCEED: // force proceed assert(v->type == VEH_TRAIN); - DoCommandP(v->tile, v->index, 0, CMD_FORCE_TRAIN_PROCEED | CMD_MSG(STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL)); + DoCommandP(CMD_FORCE_TRAIN_PROCEED | CMD_MSG(STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL), v->tile, v->index, 0); break; } } @@ -3007,7 +3006,7 @@ public: { if (str == nullptr) return; - DoCommandP(0, this->window_number, 0, CMD_RENAME_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type), nullptr, str); + DoCommandP(CMD_RENAME_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type), 0, this->window_number, 0, str); } void OnMouseOver(Point pt, int widget) override diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 4dd2397b78..8a4772ac08 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -138,7 +138,7 @@ public: { if (str == nullptr) return; - DoCommandP(0, this->window_number, 0, CMD_RENAME_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME), nullptr, str); + DoCommandP(CMD_RENAME_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME), 0, this->window_number, 0, str); } }; From a38bbefe1b28ac59b2a9fef45765fa3890cde32e Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 3 Oct 2021 21:13:32 +0200 Subject: [PATCH 105/710] Codechange: Untangle command code, flags and error string for DoCommand*. --- src/ai/ai_instance.cpp | 2 +- src/airport_gui.cpp | 4 +- src/autoreplace_cmd.cpp | 18 ++--- src/bridge_gui.cpp | 6 +- src/build_vehicle_gui.cpp | 6 +- src/command.cpp | 113 +++++++++++++++++++----------- src/command_func.h | 18 ++--- src/command_type.h | 29 ++------ src/company_gui.cpp | 18 ++--- src/depot_gui.cpp | 15 ++-- src/dock_gui.cpp | 18 ++--- src/economy.cpp | 4 +- src/game/game_instance.cpp | 2 +- src/group_gui.cpp | 24 +++---- src/industry_gui.cpp | 8 +-- src/main_gui.cpp | 2 +- src/network/network.cpp | 8 ++- src/network/network_admin.cpp | 6 +- src/network/network_client.cpp | 2 +- src/network/network_command.cpp | 16 ++--- src/network/network_gui.cpp | 2 +- src/network/network_server.cpp | 6 +- src/object_gui.cpp | 2 +- src/order_backup.cpp | 2 +- src/order_gui.cpp | 32 ++++----- src/rail_gui.cpp | 45 ++++++------ src/road_gui.cpp | 32 ++++----- src/script/api/script_object.cpp | 12 ++-- src/script/api/script_object.hpp | 7 +- src/script/api/script_vehicle.cpp | 16 ++--- src/script/script_instance.cpp | 2 +- src/script/script_instance.hpp | 2 +- src/script/script_storage.hpp | 2 +- src/settings.cpp | 2 +- src/signs_cmd.cpp | 4 +- src/signs_gui.cpp | 2 +- src/station_gui.cpp | 2 +- src/terraform_gui.cpp | 14 ++-- src/timetable_gui.cpp | 12 ++-- src/town_gui.cpp | 14 ++-- src/train_gui.cpp | 2 +- src/tree_gui.cpp | 2 +- src/vehicle.cpp | 2 +- src/vehicle_cmd.cpp | 64 ++++++++--------- src/vehicle_func.h | 40 +++++------ src/vehicle_gui.cpp | 56 ++++++++------- src/waypoint_gui.cpp | 2 +- 47 files changed, 354 insertions(+), 345 deletions(-) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 9e1f001631..da79d7c132 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -98,7 +98,7 @@ ScriptInfo *AIInstance::FindLibrary(const char *library, int version) * @param p2 p2 as given to DoCommandPInternal. * @param cmd cmd as given to DoCommandPInternal. */ -void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { /* * The company might not exist anymore. Check for this. diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 4d09fbdfdf..a031c450c3 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -40,7 +40,7 @@ static void ShowBuildAirportPicker(Window *parent); SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout); -void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -60,7 +60,7 @@ static void PlaceAirport(TileIndex tile) uint32 p1 = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex(); p1 |= _selected_airport_layout << 8; - CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_AIRPORT | CMD_MSG(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport, "" }; + CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_AIRPORT, STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, "" }; ShowSelectStationIfNeeded(cmdcont, TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE)); } diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 617c3bc6c1..2602d86ada 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -340,7 +340,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic } /* Build the new vehicle */ - cost = DoCommand(DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh), old_veh->tile, e | (CT_INVALID << 24), 0); + cost = DoCommand(DC_EXEC | DC_AUTOREPLACE, CMD_BUILD_VEHICLE, old_veh->tile, e | (CT_INVALID << 24), 0); if (cost.Failed()) return cost; Vehicle *new_veh = Vehicle::Get(_new_vehicle_id); @@ -350,7 +350,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic if (refit_cargo != CT_NO_REFIT) { byte subtype = GetBestFittingSubType(old_veh, new_veh, refit_cargo); - cost.AddCost(DoCommand(DC_EXEC, GetCmdRefitVeh(new_veh), 0, new_veh->index, refit_cargo | (subtype << 8))); + cost.AddCost(DoCommand(DC_EXEC, CMD_REFIT_VEHICLE, 0, new_veh->index, refit_cargo | (subtype << 8))); assert(cost.Succeeded()); // This should be ensured by GetNewCargoTypeForReplace() } @@ -466,11 +466,11 @@ static CommandCost ReplaceFreeUnit(Vehicle **single_unit, DoCommandFlag flags, b } /* Sell the old vehicle */ - cost.AddCost(DoCommand(flags, GetCmdSellVeh(old_v), 0, old_v->index, 0)); + cost.AddCost(DoCommand(flags, CMD_SELL_VEHICLE, 0, old_v->index, 0)); /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - DoCommand(DC_EXEC, GetCmdSellVeh(new_v), 0, new_v->index, 0); + DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, new_v->index, 0); } } @@ -597,7 +597,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon assert(RailVehInfo(wagon->engine_type)->railveh_type == RAILVEH_WAGON); /* Sell wagon */ - [[maybe_unused]] CommandCost ret = DoCommand(DC_EXEC, GetCmdSellVeh(wagon), 0, wagon->index, 0); + [[maybe_unused]] CommandCost ret = DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, wagon->index, 0); assert(ret.Succeeded()); new_vehs[i] = nullptr; @@ -629,7 +629,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon /* Sell the vehicle. * Note: This might temporarily construct new trains, so use DC_AUTOREPLACE to prevent * it from failing due to engine limits. */ - cost.AddCost(DoCommand(flags | DC_AUTOREPLACE, GetCmdSellVeh(w), 0, w->index, 0)); + cost.AddCost(DoCommand(flags | DC_AUTOREPLACE, CMD_SELL_VEHICLE, 0, w->index, 0)); if ((flags & DC_EXEC) != 0) { old_vehs[i] = nullptr; if (i == 0) old_head = nullptr; @@ -660,7 +660,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon if ((flags & DC_EXEC) == 0) { for (int i = num_units - 1; i >= 0; i--) { if (new_vehs[i] != nullptr) { - DoCommand(DC_EXEC, GetCmdSellVeh(new_vehs[i]), 0, new_vehs[i]->index, 0); + DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, new_vehs[i]->index, 0); new_vehs[i] = nullptr; } } @@ -691,12 +691,12 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon } /* Sell the old vehicle */ - cost.AddCost(DoCommand(flags, GetCmdSellVeh(old_head), 0, old_head->index, 0)); + cost.AddCost(DoCommand(flags, CMD_SELL_VEHICLE, 0, old_head->index, 0)); } /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - DoCommand(DC_EXEC, GetCmdSellVeh(new_head), 0, new_head->index, 0); + DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, new_head->index, 0); } } } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 2aef088e3f..d5347989ed 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -58,7 +58,7 @@ typedef GUIList GUIBridgeList; ///< List of bridges, used in #B * - p2 = (bit 15-16) - transport type. * @param cmd unused */ -void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile); @@ -117,7 +117,7 @@ private: case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->at(i).index; break; default: break; } - DoCommandP(CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge, + DoCommandP(CMD_BUILD_BRIDGE, STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, this->end_tile, this->start_tile, this->type | this->bridges->at(i).index); } @@ -383,7 +383,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo default: break; // water ways and air routes don't have bridge types } if (_ctrl_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len).Succeeded()) { - DoCommandP(CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge, end, start, type | last_bridge_type); + DoCommandP(CMD_BUILD_BRIDGE, STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, end, start, type | last_bridge_type); return; } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index aafc0a950e..b1136ec302 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1226,7 +1226,7 @@ struct BuildVehicleWindow : Window { if (!this->listview_mode) { /* Query for cost and refitted capacity */ - CommandCost ret = DoCommand(DC_QUERY_COST, GetCmdBuildVeh(this->vehicle_type), this->window_number, this->sel_engine | (cargo << 24), 0); + CommandCost ret = DoCommand(DC_QUERY_COST, CMD_BUILD_VEHICLE, this->window_number, this->sel_engine | (cargo << 24), 0); if (ret.Succeeded()) { this->te.cost = ret.GetCost() - e->GetCost(); this->te.capacity = _returned_refit_capacity; @@ -1469,7 +1469,7 @@ struct BuildVehicleWindow : Window { CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle; CargoID cargo = this->cargo_filter[this->cargo_filter_criteria]; if (cargo == CF_ANY || cargo == CF_ENGINES) cargo = CF_NONE; - DoCommandP(GetCmdBuildVeh(this->vehicle_type), callback, this->window_number, sel_eng | (cargo << 24), 0); + DoCommandP(CMD_BUILD_VEHICLE, GetCmdBuildVehMsg(this->vehicle_type), callback, this->window_number, sel_eng | (cargo << 24), 0); } break; } @@ -1634,7 +1634,7 @@ struct BuildVehicleWindow : Window { { if (str == nullptr) return; - DoCommandP(CMD_RENAME_ENGINE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type), 0, this->rename_engine, 0, str); + DoCommandP(CMD_RENAME_ENGINE, STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type, 0, this->rename_engine, 0, str); } void OnDropdownSelect(int widget, int index) override diff --git a/src/command.cpp b/src/command.cpp index d397d3fe6a..449fdece28 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -378,8 +378,6 @@ static const Command _command_proc_table[] = { */ bool IsValidCommand(uint32 cmd) { - cmd &= CMD_ID_MASK; - return cmd < lengthof(_command_proc_table) && _command_proc_table[cmd].proc != nullptr; } @@ -390,11 +388,11 @@ bool IsValidCommand(uint32 cmd) * @param cmd The integer value of the command * @return The flags for this command */ -CommandFlags GetCommandFlags(uint32 cmd) +CommandFlags GetCommandFlags(Commands cmd) { assert(IsValidCommand(cmd)); - return _command_proc_table[cmd & CMD_ID_MASK].flags; + return _command_proc_table[cmd].flags; } /*! @@ -404,11 +402,11 @@ CommandFlags GetCommandFlags(uint32 cmd) * @param cmd The integer value of the command * @return The name for this command */ -const char *GetCommandName(uint32 cmd) +const char *GetCommandName(Commands cmd) { assert(IsValidCommand(cmd)); - return _command_proc_table[cmd & CMD_ID_MASK].name; + return _command_proc_table[cmd].name; } /** @@ -433,7 +431,7 @@ bool IsCommandAllowedWhilePaused(uint32 cmd) static_assert(lengthof(command_type_lookup) == CMDT_END); assert(IsValidCommand(cmd)); - return _game_mode == GM_EDITOR || command_type_lookup[_command_proc_table[cmd & CMD_ID_MASK].type] <= _settings_game.construction.command_pause_level; + return _game_mode == GM_EDITOR || command_type_lookup[_command_proc_table[cmd].type] <= _settings_game.construction.command_pause_level; } @@ -449,7 +447,7 @@ static int _docommand_recursive = 0; */ CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags) { - return DoCommand(flags, container->cmd & CMD_ID_MASK, container->tile, container->p1, container->p2, container->text); + return DoCommand(flags, container->cmd, container->tile, container->p1, container->p2, container->text); } /*! @@ -465,7 +463,7 @@ CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags) * @see CommandProc * @return the cost */ -CommandCost DoCommand(DoCommandFlag flags, uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost res; @@ -473,7 +471,7 @@ CommandCost DoCommand(DoCommandFlag flags, uint32 cmd, TileIndex tile, uint32 p1 if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return CMD_ERROR; /* Chop of any CMD_MSG or other flags; we don't need those here */ - CommandProc *proc = _command_proc_table[cmd & CMD_ID_MASK].proc; + CommandProc *proc = _command_proc_table[cmd].proc; _docommand_recursive++; @@ -542,13 +540,14 @@ Money GetAvailableMoneyForCommand() * @param cmd The command to execute (a CMD_* value) * @param callback A callback function to call after the command is finished * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @param network_command execute the command without sending it on the network * @param tile The tile to perform a command on (see #CommandProc) * @param p1 Additional data for the command (see #CommandProc) * @param p2 Additional data for the command (see #CommandProc) * @param text The text to pass * @return \c true if the command succeeded, else \c false. */ -static bool DoCommandP(uint32 cmd, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +static bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Cost estimation is generally only done when the * local user presses shift while doing something. @@ -557,31 +556,30 @@ static bool DoCommandP(uint32 cmd, CommandCallback *callback, bool my_cmd, TileI * to execute. */ bool estimate_only = _shift_pressed && IsLocalCompany() && !_generating_world && - !(cmd & CMD_NETWORK_COMMAND) && + !network_command && !(GetCommandFlags(cmd) & CMD_NO_EST); /* We're only sending the command, so don't do * fancy things for 'success'. */ - bool only_sending = _networking && !(cmd & CMD_NETWORK_COMMAND); + bool only_sending = _networking && !network_command; /* Where to show the message? */ int x = TileX(tile) * TILE_SIZE; int y = TileY(tile) * TILE_SIZE; if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cmd) && !estimate_only) { - ShowErrorMessage(GB(cmd, 16, 16), STR_ERROR_NOT_ALLOWED_WHILE_PAUSED, WL_INFO, x, y); + ShowErrorMessage(err_message, STR_ERROR_NOT_ALLOWED_WHILE_PAUSED, WL_INFO, x, y); return false; } /* Only set p2 when the command does not come from the network. */ - if (!(cmd & CMD_NETWORK_COMMAND) && GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = CLIENT_ID_SERVER; + if (!network_command && GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = CLIENT_ID_SERVER; - CommandCost res = DoCommandPInternal(cmd, callback, my_cmd, estimate_only, tile, p1, p2, text); + CommandCost res = DoCommandPInternal(cmd, err_message, callback, my_cmd, estimate_only, network_command, tile, p1, p2, text); if (res.Failed()) { /* Only show the error when it's for us. */ - StringID error_part1 = GB(cmd, 16, 16); - if (estimate_only || (IsLocalCompany() && error_part1 != 0 && my_cmd)) { - ShowErrorMessage(error_part1, res.GetErrorMessage(), WL_INFO, x, y, res.GetTextRefStackGRF(), res.GetTextRefStackSize(), res.GetTextRefStack()); + if (estimate_only || (IsLocalCompany() && err_message != 0 && my_cmd)) { + ShowErrorMessage(err_message, res.GetErrorMessage(), WL_INFO, x, y, res.GetTextRefStackGRF(), res.GetTextRefStackSize(), res.GetTextRefStack()); } } else if (estimate_only) { ShowEstimatedCostOrIncome(res.GetCost(), x, y); @@ -605,15 +603,16 @@ static bool DoCommandP(uint32 cmd, CommandCallback *callback, bool my_cmd, TileI * Shortcut for the long DoCommandP when having a container with the data. * @param container the container with information. * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @param network_command execute the command without sending it on the network * @return true if the command succeeded, else false */ -bool DoCommandP(const CommandContainer *container, bool my_cmd) +bool DoCommandP(const CommandContainer *container, bool my_cmd, bool network_command) { - return DoCommandP(container->cmd, container->callback, my_cmd, container->tile, container->p1, container->p2, container->text); + return DoCommandP(container->cmd, container->err_msg, container->callback, my_cmd, network_command, container->tile, container->p1, container->p2, container->text); } /** - * Shortcut for the long DoCommandP when not using a callback. + * Shortcut for the long DoCommandP when not using a callback or error message. * @param cmd The command to execute (a CMD_* value) * @param tile The tile to perform a command on (see #CommandProc) * @param p1 Additional data for the command (see #CommandProc) @@ -621,16 +620,13 @@ bool DoCommandP(const CommandContainer *container, bool my_cmd) * @param text The text to pass * @return \c true if the command succeeded, else \c false. */ -bool DoCommandP(uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +bool DoCommandP(Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - return DoCommandP(cmd, nullptr, true, tile, p1, p2, text); + return DoCommandP(cmd, STR_NULL, nullptr, true, false, tile, p1, p2, text); } -/*! - * Toplevel network safe docommand function for the current company. Must not be called recursively. - * The callback is called when the command succeeded or failed. The parameters - * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. - * +/** + * Shortcut for the long DoCommandP when not using an error message. * @param cmd The command to execute (a CMD_* value) * @param callback A callback function to call after the command is finished * @param tile The tile to perform a command on (see #CommandProc) @@ -639,9 +635,43 @@ bool DoCommandP(uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::str * @param text The text to pass * @return \c true if the command succeeded, else \c false. */ -bool DoCommandP(uint32 cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +bool DoCommandP(Commands cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - return DoCommandP(cmd, callback, true, tile, p1, p2, text); + return DoCommandP(cmd, STR_NULL, callback, true, false, tile, p1, p2, text); +} + +/** + * Shortcut for the long DoCommandP when not using a callback. + * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error + * @param tile The tile to perform a command on (see #CommandProc) + * @param p1 Additional data for the command (see #CommandProc) + * @param p2 Additional data for the command (see #CommandProc) + * @param text The text to pass + * @return \c true if the command succeeded, else \c false. + */ +bool DoCommandP(Commands cmd, StringID err_message, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + return DoCommandP(cmd, err_message, nullptr, true, false, tile, p1, p2, text); +} + +/*! + * Toplevel network safe docommand function for the current company. Must not be called recursively. + * The callback is called when the command succeeded or failed. The parameters + * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. + * + * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param tile The tile to perform a command on (see #CommandProc) + * @param p1 Additional data for the command (see #CommandProc) + * @param p2 Additional data for the command (see #CommandProc) + * @param text The text to pass + * @return \c true if the command succeeded, else \c false. + */ +bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + return DoCommandP(cmd, err_message, callback, true, false, tile, p1, p2, text); } /** @@ -654,6 +684,7 @@ bool DoCommandP(uint32 cmd, CommandCallback *callback, TileIndex tile, uint32 p1 * Helper function for the toplevel network safe docommand function for the current company. * * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error * @param callback A callback function to call after the command is finished * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) * @param estimate_only whether to give only the estimate or also execute the command @@ -663,7 +694,7 @@ bool DoCommandP(uint32 cmd, CommandCallback *callback, TileIndex tile, uint32 p1 * @param text The text to pass * @return the command cost of this function. */ -CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cmd, bool estimate_only, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Prevent recursion; it gives a mess over the network */ assert(_docommand_recursive == 0); @@ -673,10 +704,8 @@ CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cm _additional_cash_required = 0; /* Get pointer to command handler */ - byte cmd_id = cmd & CMD_ID_MASK; - assert(cmd_id < lengthof(_command_proc_table)); - - CommandProc *proc = _command_proc_table[cmd_id].proc; + assert(cmd < lengthof(_command_proc_table)); + CommandProc *proc = _command_proc_table[cmd].proc; /* Shouldn't happen, but you never know when someone adds * NULLs to the _command_proc_table. */ assert(proc != nullptr); @@ -725,10 +754,10 @@ CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cm * we bail out here. */ if (res.Failed() || estimate_only || (!test_and_exec_can_differ && !CheckCompanyHasMoney(res))) { - if (!_networking || _generating_world || (cmd & CMD_NETWORK_COMMAND) != 0) { + if (!_networking || _generating_world || network_command) { /* Log the failed command as well. Just to be able to be find * causes of desyncs due to bad command test implementations. */ - Debug(desync, 1, "cmdf: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text, GetCommandName(cmd)); + Debug(desync, 1, "cmdf: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd, err_message, text, GetCommandName(cmd)); } cur_company.Restore(); return_dcpi(res); @@ -738,8 +767,8 @@ CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cm * If we are in network, and the command is not from the network * send it to the command-queue and abort execution */ - if (_networking && !_generating_world && !(cmd & CMD_NETWORK_COMMAND)) { - NetworkSendCommand(cmd & ~CMD_FLAGS_MASK, callback, _current_company, tile, p1, p2, text); + if (_networking && !_generating_world && !network_command) { + NetworkSendCommand(cmd, err_message, callback, _current_company, tile, p1, p2, text); cur_company.Restore(); /* Don't return anything special here; no error, no costs. @@ -748,7 +777,7 @@ CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cm * reset the storages as we've not executed the command. */ return_dcpi(CommandCost()); } - Debug(desync, 1, "cmd: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text, GetCommandName(cmd)); + Debug(desync, 1, "cmd: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd, err_message, text, GetCommandName(cmd)); /* Actually try and execute the command. If no cost-type is given * use the construction one */ @@ -757,7 +786,7 @@ CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cm CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text); BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND); - if (cmd_id == CMD_COMPANY_CTRL) { + if (cmd == CMD_COMPANY_CTRL) { cur_company.Trash(); /* We are a new company -> Switch to new local company. * We were closed down -> Switch to spectator diff --git a/src/command_func.h b/src/command_func.h index eefaadd9b6..662ae00a5c 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -32,22 +32,24 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); */ #define return_cmd_error(errcode) return CommandCost(errcode); -CommandCost DoCommand(DoCommandFlag flags, uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); +CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags); -bool DoCommandP(uint32 cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -bool DoCommandP(uint32 cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -bool DoCommandP(const CommandContainer *container, bool my_cmd = true); +bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); +bool DoCommandP(Commands cmd, StringID err_message, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); +bool DoCommandP(Commands cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); +bool DoCommandP(Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); +bool DoCommandP(const CommandContainer *container, bool my_cmd = true, bool network_command = false); -CommandCost DoCommandPInternal(uint32 cmd, CommandCallback *callback, bool my_cmd, bool estimate_only, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); +CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); -void NetworkSendCommand(uint32 cmd, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); +void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); extern Money _additional_cash_required; bool IsValidCommand(uint32 cmd); -CommandFlags GetCommandFlags(uint32 cmd); -const char *GetCommandName(uint32 cmd); +CommandFlags GetCommandFlags(Commands cmd); +const char *GetCommandName(Commands cmd); Money GetAvailableMoneyForCommand(); bool IsCommandAllowedWhilePaused(uint32 cmd); diff --git a/src/command_type.h b/src/command_type.h index 61154ea04b..972db596ea 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -172,7 +172,7 @@ public: * * @see _command_proc_table */ -enum Commands { +enum Commands : uint16 { CMD_BUILD_RAILROAD_TRACK, ///< build a rail track CMD_REMOVE_RAILROAD_TRACK, ///< remove a rail track CMD_BUILD_SINGLE_RAIL, ///< build a single rail track @@ -360,28 +360,6 @@ enum DoCommandFlag { }; DECLARE_ENUM_AS_BIT_SET(DoCommandFlag) -/** - * Used to combine a StringID with the command. - * - * This macro can be used to add a StringID (the error message to show) on a command-id - * (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from - * this macro. - * - * @param x The StringID to combine with a command-id - */ -#define CMD_MSG(x) ((x) << 16) - -/** - * Defines some flags. - * - * This enumeration defines some flags which are binary-or'ed on a command. - */ -enum FlaggedCommands { - CMD_NETWORK_COMMAND = 0x0100, ///< execute the command without sending it on the network - CMD_FLAGS_MASK = 0xFF00, ///< mask for all command flags - CMD_ID_MASK = 0x00FF, ///< mask for the command ID -}; - /** * Command flags for the command table _command_proc_table. * @@ -471,7 +449,7 @@ struct Command { * @param p1 Additional data of the command * @see CommandProc */ -typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd); +typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd); /** * Structure for buffering the build command when selecting a station to join. @@ -480,7 +458,8 @@ struct CommandContainer { TileIndex tile; ///< tile command being executed on. uint32 p1; ///< parameter p1. uint32 p2; ///< parameter p2. - uint32 cmd; ///< command being executed. + Commands cmd; ///< command being executed. + StringID err_msg; ///< string ID of error message to use. CommandCallback *callback; ///< any callback function executed upon successful completion of the command. std::string text; ///< possible text sent for name changes etc. }; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index d8b468ad91..6ab3b0aa7d 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -435,11 +435,11 @@ struct CompanyFinancesWindow : Window { break; case WID_CF_INCREASE_LOAN: // increase loan - DoCommandP(CMD_INCREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY), 0, 0, _ctrl_pressed); + DoCommandP(CMD_INCREASE_LOAN, STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, 0, 0, _ctrl_pressed); break; case WID_CF_REPAY_LOAN: // repay loan - DoCommandP(CMD_DECREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_REPAY_LOAN), 0, 0, _ctrl_pressed); + DoCommandP(CMD_DECREASE_LOAN, STR_ERROR_CAN_T_REPAY_LOAN, 0, 0, _ctrl_pressed); break; case WID_CF_INFRASTRUCTURE: // show infrastructure details @@ -2576,11 +2576,11 @@ struct CompanyWindow : Window break; case WID_C_BUY_SHARE: - DoCommandP(CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS), 0, this->window_number, 0); + DoCommandP(CMD_BUY_SHARE_IN_COMPANY, STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, 0, this->window_number, 0); break; case WID_C_SELL_SHARE: - DoCommandP(CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_SELL_25_SHARE_IN), 0, this->window_number, 0); + DoCommandP(CMD_SELL_SHARE_IN_COMPANY, STR_ERROR_CAN_T_SELL_25_SHARE_IN, 0, this->window_number, 0); break; case WID_C_COMPANY_PASSWORD: @@ -2613,7 +2613,7 @@ struct CompanyWindow : Window void OnPlaceObject(Point pt, TileIndex tile) override { - if (DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS), tile, OBJECT_HQ, 0) && !_shift_pressed) { + if (DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0) && !_shift_pressed) { ResetObjectToPlace(); this->RaiseButtons(); } @@ -2635,16 +2635,16 @@ struct CompanyWindow : Window Money money = (Money)(strtoull(str, nullptr, 10) / _currency->rate); uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 - DoCommandP(CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_CAN_T_GIVE_MONEY), 0, money_c, this->window_number); + DoCommandP(CMD_GIVE_MONEY, STR_ERROR_CAN_T_GIVE_MONEY, 0, money_c, this->window_number); break; } case WID_C_PRESIDENT_NAME: - DoCommandP(CMD_RENAME_PRESIDENT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_PRESIDENT), 0, 0, 0, str); + DoCommandP(CMD_RENAME_PRESIDENT, STR_ERROR_CAN_T_CHANGE_PRESIDENT, 0, 0, 0, str); break; case WID_C_COMPANY_NAME: - DoCommandP(CMD_RENAME_COMPANY | CMD_MSG(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME), 0, 0, 0, str); + DoCommandP(CMD_RENAME_COMPANY, STR_ERROR_CAN_T_CHANGE_COMPANY_NAME, 0, 0, 0, str); break; case WID_C_COMPANY_JOIN: @@ -2771,7 +2771,7 @@ struct BuyCompanyWindow : Window { break; case WID_BC_YES: - DoCommandP(CMD_BUY_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_COMPANY), 0, this->window_number, 0); + DoCommandP(CMD_BUY_COMPANY, STR_ERROR_CAN_T_BUY_COMPANY, 0, this->window_number, 0); break; } } diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 7ff812c230..8515258f0f 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -117,7 +117,7 @@ extern void DepotSortList(VehicleList *list); * @param p2 unused * @param cmd unused */ -void CcCloneVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcCloneVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -141,7 +141,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh if (wagon == v) return; - DoCommandP(CMD_MOVE_RAIL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_MOVE_VEHICLE), v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index); + DoCommandP(CMD_MOVE_RAIL_VEHICLE, STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index); } static VehicleCellSize _base_block_sizes_depot[VEH_COMPANY_END]; ///< Cell size for vehicle images in the depot view. @@ -836,7 +836,7 @@ struct DepotWindow : Window { if (str == nullptr) return; /* Do depot renaming */ - DoCommandP(CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), 0, this->GetDepotIndex(), 0, str); + DoCommandP(CMD_RENAME_DEPOT, STR_ERROR_CAN_T_RENAME_DEPOT, 0, this->GetDepotIndex(), 0, str); } bool OnRightClick(Point pt, int widget) override @@ -904,10 +904,10 @@ struct DepotWindow : Window { { if (_ctrl_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ - DoCommandP(CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), this->window_number, v->index, 1); + DoCommandP(CMD_CLONE_VEHICLE, STR_ERROR_CAN_T_BUY_TRAIN + v->type, this->window_number, v->index, 1); } else { /* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to changs things on new vehicle) */ - if (DoCommandP(CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle, this->window_number, v->index, 0)) { + if (DoCommandP(CMD_CLONE_VEHICLE, STR_ERROR_CAN_T_BUY_TRAIN + v->type, CcCloneVehicle, this->window_number, v->index, 0)) { ResetObjectToPlace(); } } @@ -1001,8 +1001,7 @@ struct DepotWindow : Window { if (this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, &gdvp) == MODE_DRAG_VEHICLE && sel != INVALID_VEHICLE) { if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _ctrl_pressed) { - DoCommandP(CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE), - Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true); + DoCommandP(CMD_REVERSE_TRAIN_DIRECTION, STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE, Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true); } else if (gdvp.wagon == nullptr || gdvp.wagon->index != sel) { this->vehicle_over = INVALID_VEHICLE; TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head); @@ -1027,7 +1026,7 @@ struct DepotWindow : Window { this->SetDirty(); int sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0; - DoCommandP(GetCmdSellVeh(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0); + DoCommandP(CMD_SELL_VEHICLE, GetCmdSellVehMsg(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0); break; } diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 0911555a4e..c1f6156122 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -38,7 +38,7 @@ static void ShowBuildDocksDepotPicker(Window *parent); static Axis _ship_depot_direction; -void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -46,7 +46,7 @@ void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcPlaySound_CONSTRUCTION_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcPlaySound_CONSTRUCTION_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_CONSTRUCTION_WATER, tile); } @@ -191,7 +191,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_LOCK: // Build lock button - DoCommandP(CMD_BUILD_LOCK | CMD_MSG(STR_ERROR_CAN_T_BUILD_LOCKS), CcBuildDocks, tile, 0, 0); + DoCommandP(CMD_BUILD_LOCK, STR_ERROR_CAN_T_BUILD_LOCKS, CcBuildDocks, tile, 0, 0); break; case WID_DT_DEMOLISH: // Demolish aka dynamite button @@ -199,14 +199,14 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_DEPOT: // Build depot button - DoCommandP(CMD_BUILD_SHIP_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT), CcBuildDocks, tile, _ship_depot_direction, 0); + DoCommandP(CMD_BUILD_SHIP_DEPOT, STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction, 0); break; case WID_DT_STATION: { // Build station button uint32 p2 = (uint32)INVALID_STATION << 16; // no station to join /* tile is always the land tile, so need to evaluate _thd.pos */ - CommandContainer cmdcont = { tile, _ctrl_pressed, p2, CMD_BUILD_DOCK | CMD_MSG(STR_ERROR_CAN_T_BUILD_DOCK_HERE), CcBuildDocks, "" }; + CommandContainer cmdcont = { tile, _ctrl_pressed, p2, CMD_BUILD_DOCK, STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, "" }; /* Determine the watery part of the dock. */ DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); @@ -217,7 +217,7 @@ struct BuildDocksToolbarWindow : Window { } case WID_DT_BUOY: // Build buoy button - DoCommandP(CMD_BUILD_BUOY | CMD_MSG(STR_ERROR_CAN_T_POSITION_BUOY_HERE), CcBuildDocks, tile, 0, 0); + DoCommandP(CMD_BUILD_BUOY, STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile, 0, 0); break; case WID_DT_RIVER: // Build river button (in scenario editor) @@ -225,7 +225,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_BUILD_AQUEDUCT: // Build aqueduct button - DoCommandP(CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE), CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15); + DoCommandP(CMD_BUILD_BRIDGE, STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE, CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15); break; default: NOT_REACHED(); @@ -245,10 +245,10 @@ struct BuildDocksToolbarWindow : Window { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); break; case DDSP_CREATE_WATER: - DoCommandP(CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL); + DoCommandP(CMD_BUILD_CANAL, STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL); break; case DDSP_CREATE_RIVER: - DoCommandP(CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0)); + DoCommandP(CMD_BUILD_CANAL, STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0)); break; default: break; diff --git a/src/economy.cpp b/src/economy.cpp index b7100257a0..3beeb25f58 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1485,7 +1485,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station if (st->goods[cid].cargo.HasCargoFor(next_station)) { /* Try to find out if auto-refitting would succeed. In case the refit is allowed, * the returned refit capacity will be greater than zero. */ - DoCommand(DC_QUERY_COST, GetCmdRefitVeh(v_start), v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. + DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. /* Try to balance different loadable cargoes between parts of the consist, so that * all of them can be loaded. Avoid a situation where all vehicles suddenly switch * to the first loadable cargo for which there is only one packet. If the capacities @@ -1508,7 +1508,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station * "via any station" before reserving. We rather produce some more "any station" cargo than * misrouting it. */ IterateVehicleParts(v_start, ReturnCargoAction(st, INVALID_STATION)); - CommandCost cost = DoCommand(DC_EXEC, GetCmdRefitVeh(v_start), v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. + CommandCost cost = DoCommand(DC_EXEC, CMD_REFIT_VEHICLE, v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. if (cost.Succeeded()) v->First()->profit_this_year -= cost.GetCost() << 8; } diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index 842b4b3e47..abd0541159 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -87,7 +87,7 @@ void GameInstance::Died() * @param p2 p2 as given to DoCommandPInternal. * @param cmd cmd as given to DoCommandPInternal. */ -void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2, cmd)) { Game::GetGameInstance()->Continue(); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index ee8e604744..316cdc4f3c 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -640,7 +640,7 @@ public: if (confirmed) { VehicleGroupWindow *w = (VehicleGroupWindow*)win; w->vli.index = ALL_GROUP; - DoCommandP(CMD_DELETE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_DELETE), 0, w->group_confirm, 0); + DoCommandP(CMD_DELETE_GROUP, STR_ERROR_GROUP_CAN_T_DELETE, 0, w->group_confirm, 0); } } @@ -771,7 +771,7 @@ public: } case WID_GL_CREATE_GROUP: { // Create a new group - DoCommandP(CMD_CREATE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_CREATE), CcCreateGroup, 0, this->vli.vtype, this->vli.index); + DoCommandP(CMD_CREATE_GROUP, STR_ERROR_GROUP_CAN_T_CREATE, CcCreateGroup, 0, this->vli.vtype, this->vli.index); break; } @@ -822,7 +822,7 @@ public: case WID_GL_ALL_VEHICLES: // All vehicles case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles if (g->parent != INVALID_GROUP) { - DoCommandP(CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT), 0, this->group_sel | (1 << 16), INVALID_GROUP); + DoCommandP(CMD_ALTER_GROUP, STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), INVALID_GROUP); } this->group_sel = INVALID_GROUP; @@ -835,7 +835,7 @@ public: GroupID new_g = id_g >= this->groups.size() ? INVALID_GROUP : this->groups[id_g]->index; if (this->group_sel != new_g && g->parent != new_g) { - DoCommandP(CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_SET_PARENT), 0, this->group_sel | (1 << 16), new_g); + DoCommandP(CMD_ALTER_GROUP, STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), new_g); } this->group_sel = INVALID_GROUP; @@ -850,7 +850,7 @@ public: { switch (widget) { case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles - DoCommandP(CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), 0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); + DoCommandP(CMD_ADD_VEHICLE_GROUP, STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, 0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); this->vehicle_sel = INVALID_VEHICLE; this->group_over = INVALID_GROUP; @@ -867,7 +867,7 @@ public: uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; - DoCommandP(CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); + DoCommandP(CMD_ADD_VEHICLE_GROUP, STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); break; } @@ -922,7 +922,7 @@ public: void OnQueryTextFinished(char *str) override { - if (str != nullptr) DoCommandP(CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_RENAME), 0, this->group_rename, 0, str); + if (str != nullptr) DoCommandP(CMD_ALTER_GROUP, STR_ERROR_GROUP_CAN_T_RENAME, 0, this->group_rename, 0, str); this->group_rename = INVALID_GROUP; } @@ -952,19 +952,19 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: { // Send to Depots - DoCommandP(GetCmdSendToDepot(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack()); + DoCommandP(CMD_SEND_VEHICLE_TO_DEPOT, GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack()); break; } case ADI_ADD_SHARED: // Add shared Vehicles assert(Group::IsValidID(this->vli.index)); - DoCommandP(CMD_ADD_SHARED_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE), 0, this->vli.index, this->vli.vtype); + DoCommandP(CMD_ADD_SHARED_VEHICLE_GROUP, STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE, 0, this->vli.index, this->vli.vtype); break; case ADI_REMOVE_ALL: // Remove all Vehicles from the selected group assert(Group::IsValidID(this->vli.index)); - DoCommandP(CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES), 0, this->vli.index, 0); + DoCommandP(CMD_REMOVE_ALL_VEHICLES_GROUP, STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, 0, this->vli.index, 0); break; default: NOT_REACHED(); } @@ -1146,7 +1146,7 @@ static inline VehicleGroupWindow *FindVehicleGroupWindow(VehicleType vt, Owner o * @param cmd Unused. * @see CmdCreateGroup */ -void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; assert(p1 <= VEH_AIRCRAFT); @@ -1163,7 +1163,7 @@ void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 * @param p2 Bit 0-19: Vehicle ID. * @param cmd Unused. */ -void CcAddVehicleNewGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcAddVehicleNewGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; assert(Vehicle::IsValidID(GB(p2, 0, 20))); diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index e78b6853d3..cfdd2c6ca3 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -224,7 +224,7 @@ void SortIndustryTypes() * @param p2 Additional data of the #CMD_BUILD_INDUSTRY command. * @param cmd Unused. */ -void CcBuildIndustry(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildIndustry(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded()) return; @@ -678,7 +678,7 @@ public: case WID_DPI_FUND_WIDGET: { if (this->selected_type != INVALID_INDUSTRYTYPE) { if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) { - DoCommandP(CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), 0, this->selected_type, InteractiveRandom()); + DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom()); this->HandleButtonClick(WID_DPI_FUND_WIDGET); } else { HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT); @@ -715,13 +715,13 @@ public: Backup old_generating_world(_generating_world, true, FILE_LINE); _ignore_restrictions = true; - DoCommandP(CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed); + DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed); cur_company.Restore(); old_generating_world.Restore(); _ignore_restrictions = false; } else { - success = DoCommandP(CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), tile, (layout_index << 8) | this->selected_type, seed); + success = DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed); } /* If an industry has been built, just reset the cursor and the system */ diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 46fff1a51b..d521f79d1a 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -76,7 +76,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl } -void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } diff --git a/src/network/network.cpp b/src/network/network.cpp index 6e111926ed..13f2fe52a4 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -1064,7 +1064,7 @@ void NetworkGameLoop() while (f != nullptr && !feof(f)) { if (_date == next_date && _date_fract == next_date_fract) { if (cp != nullptr) { - NetworkSendCommand(cp->cmd & ~CMD_FLAGS_MASK, nullptr, cp->company, cp->tile, cp->p1, cp->p2, cp->text); + NetworkSendCommand(cp->cmd, cp->err_msg, nullptr, cp->company, cp->tile, cp->p1, cp->p2, cp->text); Debug(desync, 0, "Injecting: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, cp->tile, cp->p1, cp->p2, cp->cmd, cp->text, GetCommandName(cp->cmd)); delete cp; cp = nullptr; @@ -1103,14 +1103,16 @@ void NetworkGameLoop() if (*p == ' ') p++; cp = new CommandPacket(); int company; + uint cmd; char buffer[128]; - int ret = sscanf(p, "%x; %x; %x; %x; %x; %x; %x; \"%127[^\"]\"", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cp->cmd, buffer); + int ret = sscanf(p, "%x; %x; %x; %x; %x; %x; %x; %x; \"%127[^\"]\"", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cmd, &cp->err_msg, buffer); cp->text = buffer; /* There are 8 pieces of data to read, however the last is a * string that might or might not exist. Ignore it if that * string misses because in 99% of the time it's not used. */ - assert(ret == 8 || ret == 7); + assert(ret == 9 || ret == 8); cp->company = (CompanyID)company; + cp->cmd = (Commands)cmd; } else if (strncmp(p, "join: ", 6) == 0) { /* Manually insert a pause when joining; this way the client can join at the exact right time. */ int ret = sscanf(p + 6, "%x; %x", &next_date, &next_date_fract); diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index 49b222f36f..99f803e24e 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -593,8 +593,8 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCmdNames() { Packet *p = new Packet(ADMIN_PACKET_SERVER_CMD_NAMES); - for (uint i = 0; i < CMD_END; i++) { - const char *cmdname = GetCommandName(i); + for (uint16 i = 0; i < CMD_END; i++) { + const char *cmdname = GetCommandName(static_cast(i)); /* Should COMPAT_MTU be exceeded, start a new packet * (magic 5: 1 bool "more data" and one uint16 "command id", one @@ -629,7 +629,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCmdLogging(ClientID clien p->Send_uint32(client_id); p->Send_uint8 (cp->company); - p->Send_uint16(cp->cmd & CMD_ID_MASK); + p->Send_uint16(cp->cmd); p->Send_uint32(cp->p1); p->Send_uint32(cp->p2); p->Send_uint32(cp->tile); diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index e638df0053..dd42f5f6ff 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -839,7 +839,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(Packet * the server will give us a client-id and let us in */ _network_join_status = NETWORK_JOIN_STATUS_REGISTERING; ShowJoinStatusWindow(); - NetworkSendCommand(CMD_COMPANY_CTRL, nullptr, _local_company, 0, CCA_NEW, 0, {}); + NetworkSendCommand(CMD_COMPANY_CTRL, STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } } else { /* take control over an existing company */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index f1a0f682d3..6df53d7da1 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -126,6 +126,7 @@ static CommandQueue _local_execution_queue; /** * Prepare a DoCommand to be send over the network * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error * @param callback A callback function to call after the command is finished * @param company The company that wants to send the command * @param tile The tile to perform a command on (see #CommandProc) @@ -133,16 +134,15 @@ static CommandQueue _local_execution_queue; * @param p2 Additional data for the command (see #CommandProc) * @param text The text to pass */ -void NetworkSendCommand(uint32 cmd, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - assert((cmd & CMD_FLAGS_MASK) == 0); - CommandPacket c; c.company = company; c.tile = tile; c.p1 = p1; c.p2 = p2; c.cmd = cmd; + c.err_msg = err_message; c.callback = callback; c.text = text; @@ -207,8 +207,7 @@ void NetworkExecuteLocalCommandQueue() /* We can execute this command */ _current_company = cp->company; - cp->cmd |= CMD_NETWORK_COMMAND; - DoCommandP(cp, cp->my_cmd); + DoCommandP(cp, cp->my_cmd, true); queue.Pop(); delete cp; @@ -295,10 +294,10 @@ void NetworkDistributeCommands() const char *NetworkGameSocketHandler::ReceiveCommand(Packet *p, CommandPacket *cp) { cp->company = (CompanyID)p->Recv_uint8(); - cp->cmd = p->Recv_uint32(); + cp->cmd = static_cast(p->Recv_uint16()); if (!IsValidCommand(cp->cmd)) return "invalid command"; if (GetCommandFlags(cp->cmd) & CMD_OFFLINE) return "single-player only command"; - if ((cp->cmd & CMD_FLAGS_MASK) != 0) return "invalid command flag"; + cp->err_msg = p->Recv_uint16(); cp->p1 = p->Recv_uint32(); cp->p2 = p->Recv_uint32(); @@ -320,7 +319,8 @@ const char *NetworkGameSocketHandler::ReceiveCommand(Packet *p, CommandPacket *c void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) { p->Send_uint8 (cp->company); - p->Send_uint32(cp->cmd); + p->Send_uint16(cp->cmd); + p->Send_uint16(cp->err_msg); p->Send_uint32(cp->p1); p->Send_uint32(cp->p2); p->Send_uint32(cp->tile); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index c795e15501..82e01e81e2 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1537,7 +1537,7 @@ private: if (_network_server) { DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW, _network_own_client_id); } else { - NetworkSendCommand(CMD_COMPANY_CTRL, nullptr, _local_company, 0, CCA_NEW, 0, {}); + NetworkSendCommand(CMD_COMPANY_CTRL, STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 65e8010736..50b46dfe10 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1034,12 +1034,12 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet if ((GetCommandFlags(cp.cmd) & CMD_SERVER) && ci->client_id != CLIENT_ID_SERVER) { - IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to calling a server only command {}.", ci->client_id, this->GetClientIP(), cp.cmd & CMD_ID_MASK); + IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to calling a server only command {}.", ci->client_id, this->GetClientIP(), cp.cmd); return this->SendError(NETWORK_ERROR_KICKED); } if ((GetCommandFlags(cp.cmd) & CMD_SPECTATOR) == 0 && !Company::IsValidID(cp.company) && ci->client_id != CLIENT_ID_SERVER) { - IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to calling a non-spectator command {}.", ci->client_id, this->GetClientIP(), cp.cmd & CMD_ID_MASK); + IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to calling a non-spectator command {}.", ci->client_id, this->GetClientIP(), cp.cmd); return this->SendError(NETWORK_ERROR_KICKED); } @@ -2078,7 +2078,7 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci) /* ci is nullptr when replaying, or for AIs. In neither case there is a client. */ ci->client_playas = c->index; NetworkUpdateClientInfo(ci->client_id); - NetworkSendCommand(CMD_RENAME_PRESIDENT, nullptr, c->index, 0, 0, 0, ci->client_name); + NetworkSendCommand(CMD_RENAME_PRESIDENT, STR_NULL, nullptr, c->index, 0, 0, 0, ci->client_name); } /* Announce new company on network. */ diff --git a/src/object_gui.cpp b/src/object_gui.cpp index b05d46831b..234e3eab66 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -541,7 +541,7 @@ public: void OnPlaceObject(Point pt, TileIndex tile) override { ObjectClass *objclass = ObjectClass::Get(_selected_object_class); - DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_OBJECT), CcTerraform, + DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_BUILD_OBJECT, CcTerraform, tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view); } diff --git a/src/order_backup.cpp b/src/order_backup.cpp index e3bcb30eb5..cba46941c5 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -198,7 +198,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, /* We need to circumvent the "prevention" from this command being executed * while the game is paused, so use the internal method. Nor do we want * this command to get its cost estimated when shift is pressed. */ - DoCommandPInternal(CMD_CLEAR_ORDER_BACKUP, nullptr, true, false, ob->tile, 0, user, {}); + DoCommandPInternal(CMD_CLEAR_ORDER_BACKUP, STR_NULL, nullptr, true, false, false, ob->tile, 0, user, {}); } else { /* The command came from the game logic, i.e. the clearing of a tile. * In that case we have no need to actually sync this, just do it. */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 8ec4e7e985..b934b9d161 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -591,7 +591,7 @@ private: } if (order->GetLoadType() == load_type) return; // If we still match, do nothing - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4)); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4)); } /** @@ -606,7 +606,7 @@ private: if (order == nullptr) return; i = (order->GetDepotOrderType() & ODTFB_SERVICE) ? DA_ALWAYS_GO : DA_SERVICE; } - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4)); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4)); } /** @@ -621,7 +621,7 @@ private: _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); order.SetDepotActionType(ODATFB_NEAREST_DEPOT); - DoCommandP(CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); + DoCommandP(CMD_INSERT_ORDER, STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); } /** @@ -641,7 +641,7 @@ private: } if (order->GetUnloadType() == unload_type) return; // If we still match, do nothing - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4)); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4)); /* Transfer and unload orders with leave empty as default */ if (unload_type == OUFB_TRANSFER || unload_type == OUFB_UNLOAD) { @@ -669,7 +669,7 @@ private: } this->SetWidgetDirty(WID_O_NON_STOP); - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4); } /** @@ -682,7 +682,7 @@ private: if (_ctrl_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return; if (this->vehicle->GetNumOrders() <= 1) return; - DoCommandP(CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER), + DoCommandP(CMD_SKIP_TO_ORDER, _ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER, this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())); } @@ -694,7 +694,7 @@ private: /* When networking, move one order lower */ int selected = this->selected_order + (int)_networking; - if (DoCommandP(CMD_DELETE_ORDER | CMD_MSG(STR_ERROR_CAN_T_DELETE_THIS_ORDER), this->vehicle->tile, this->vehicle->index, this->OrderGetSel())) { + if (DoCommandP(CMD_DELETE_ORDER, STR_ERROR_CAN_T_DELETE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel())) { this->selected_order = selected >= this->vehicle->GetNumOrders() ? -1 : selected; this->UpdateButtonState(); } @@ -719,7 +719,7 @@ private: /* Get another vehicle that share orders with this vehicle. */ Vehicle *other_shared = (this->vehicle->FirstShared() == this->vehicle) ? this->vehicle->NextShared() : this->vehicle->PreviousShared(); /* Copy the order list of the other vehicle. */ - if (DoCommandP(CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST), this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index)) { + if (DoCommandP(CMD_CLONE_ORDER, STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST, this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index)) { this->UpdateButtonState(); } } @@ -1159,7 +1159,7 @@ public: order.index = 0; order.MakeConditional(order_id); - DoCommandP(CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); + DoCommandP(CMD_INSERT_ORDER, STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); } ResetObjectToPlace(); break; @@ -1182,7 +1182,7 @@ public: this->selected_order = -1; } else if (sel == this->selected_order) { if (this->vehicle->type == VEH_TRAIN && sel < this->vehicle->GetNumOrders()) { - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_STOP_LOCATION | ((this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END) << 4); } @@ -1331,7 +1331,7 @@ public: default: break; } - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4); } } @@ -1369,11 +1369,11 @@ public: break; case WID_O_COND_VARIABLE: - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4); break; case WID_O_COND_COMPARATOR: - DoCommandP(CMD_MODIFY_ORDER | CMD_MSG(STR_ERROR_CAN_T_MODIFY_THIS_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4); + DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4); break; } } @@ -1386,7 +1386,7 @@ public: VehicleOrderID to_order = this->GetOrderFromPt(pt.y); if (!(from_order == to_order || from_order == INVALID_VEH_ORDER_ID || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_VEH_ORDER_ID || to_order > this->vehicle->GetNumOrders()) && - DoCommandP(CMD_MOVE_ORDER | CMD_MSG(STR_ERROR_CAN_T_MOVE_THIS_ORDER), this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16))) { + DoCommandP(CMD_MOVE_ORDER, STR_ERROR_CAN_T_MOVE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16))) { this->selected_order = -1; this->UpdateButtonState(); } @@ -1438,7 +1438,7 @@ public: const Order cmd = GetOrderCmdFromTile(this->vehicle, tile); if (cmd.IsType(OT_NOTHING)) return; - if (DoCommandP(CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER), this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack())) { + if (DoCommandP(CMD_INSERT_ORDER, STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack())) { /* With quick goto the Go To button stays active */ if (!_settings_client.gui.quick_goto) ResetObjectToPlace(); } @@ -1455,7 +1455,7 @@ public: bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; - if (DoCommandP(share_order ? CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_SHARE_ORDER_LIST) : CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_COPY_ORDER_LIST), + if (DoCommandP(CMD_CLONE_ORDER, share_order ? STR_ERROR_CAN_T_SHARE_ORDER_LIST : STR_ERROR_CAN_T_COPY_ORDER_LIST, this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index)) { this->selected_order = -1; ResetObjectToPlace(); diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 17254ccfb0..54bef88fdf 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -85,16 +85,15 @@ static bool IsStationAvailable(const StationSpec *statspec) return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); } -void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); } static void GenericPlaceRail(TileIndex tile, int cmd) { - DoCommandP(_remove_button_clicked ? - CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) : - CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK), + DoCommandP(_remove_button_clicked ? CMD_REMOVE_SINGLE_RAIL : CMD_BUILD_SINGLE_RAIL, + _remove_button_clicked ? STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK : STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3)); } @@ -129,7 +128,7 @@ static const DiagDirection _place_depot_extra_dir[12] = { DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE, }; -void CcRailDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcRailDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -166,11 +165,11 @@ static void PlaceRail_Waypoint(TileIndex tile) } else { /* Tile where we can't build rail waypoints. This is always going to fail, * but provides the user with a proper error message. */ - DoCommandP(CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16); + DoCommandP(CMD_BUILD_RAIL_WAYPOINT, STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16); } } -void CcStation(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcStation(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -199,7 +198,7 @@ static void PlaceRail_Station(TileIndex tile) int h = _settings_client.gui.station_platlength; if (!_railstation.orientation) Swap(w, h); - CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" }; + CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, "" }; ShowSelectStationIfNeeded(cmdcont, TileArea(tile, w, h)); } } @@ -224,7 +223,7 @@ static void GenericPlaceSignals(TileIndex tile) Track track = FindFirstTrack(trackbits); if (_remove_button_clicked) { - DoCommandP(CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound_CONSTRUCTION_RAIL, tile, track, 0); + DoCommandP(CMD_REMOVE_SIGNALS, STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, tile, track, 0); } else { const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); @@ -255,7 +254,7 @@ static void GenericPlaceSignals(TileIndex tile) SB(p1, 9, 6, cycle_types); } - DoCommandP(CMD_BUILD_SIGNALS | CMD_MSG((w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), + DoCommandP(CMD_BUILD_SIGNALS, (w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, tile, p1, 0); } } @@ -277,7 +276,7 @@ static void PlaceRail_Bridge(TileIndex tile, Window *w) } /** Command callback for building a tunnel */ -void CcBuildRailTunnel(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildRailTunnel(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); @@ -358,9 +357,8 @@ static void BuildRailClick_Remove(Window *w) static void DoRailroadTrack(int mode) { uint32 p2 = _cur_railtype | (mode << 6) | (_settings_client.gui.auto_remove_signals << 11); - DoCommandP(_remove_button_clicked ? - CMD_REMOVE_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) : - CMD_BUILD_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK), + DoCommandP(_remove_button_clicked ? CMD_REMOVE_RAILROAD_TRACK : CMD_BUILD_RAILROAD_TRACK, + _remove_button_clicked ? STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK : STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2); } @@ -413,9 +411,8 @@ static void HandleAutoSignalPlacement() /* _settings_client.gui.drag_signals_density is given as a parameter such that each user * in a network game can specify their own signal density */ - DoCommandP(_remove_button_clicked ? - CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM) : - CMD_BUILD_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), + DoCommandP(_remove_button_clicked ? CMD_REMOVE_SIGNAL_TRACK : CMD_BUILD_SIGNAL_TRACK, + _remove_button_clicked ? STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2); } @@ -643,7 +640,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_DEPOT: - DoCommandP(CMD_BUILD_TRAIN_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT), + DoCommandP(CMD_BUILD_TRAIN_DEPOT, STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT, CcRailDepot, tile, _cur_railtype, _build_depot_direction); break; @@ -664,7 +661,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_TUNNEL: - DoCommandP(CMD_BUILD_TUNNEL | CMD_MSG(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE), CcBuildRailTunnel, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0); + DoCommandP(CMD_BUILD_TUNNEL, STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRailTunnel, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0); break; case WID_RAT_CONVERT_RAIL: @@ -706,7 +703,7 @@ struct BuildRailToolbarWindow : Window { break; case DDSP_CONVERT_RAIL: - DoCommandP(CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0)); + DoCommandP(CMD_CONVERT_RAIL, STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0)); break; case DDSP_REMOVE_STATION: @@ -714,20 +711,20 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - DoCommandP(CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); + DoCommandP(CMD_REMOVE_FROM_RAIL_STATION, STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); } else { HandleStationPlacement(start_tile, end_tile); } } else { /* Waypoint */ if (_remove_button_clicked) { - DoCommandP(CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); + DoCommandP(CMD_REMOVE_FROM_RAIL_WAYPOINT, STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); } else { TileArea ta(start_tile, end_tile); uint32 p1 = _cur_railtype | (select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y) << 6 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24; uint32 p2 = STAT_CLASS_WAYP | _cur_waypoint_type << 8 | INVALID_STATION << 16; - CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), CcPlaySound_CONSTRUCTION_RAIL, "" }; + CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT, STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, "" }; ShowSelectWaypointIfNeeded(cmdcont, ta); } } @@ -886,7 +883,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) uint32 p1 = _cur_railtype | _railstation.orientation << 6 | numtracks << 8 | platlength << 16 | _ctrl_pressed << 24; uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16; - CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" }; + CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, "" }; ShowSelectStationIfNeeded(cmdcont, ta); } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 84ec742068..bdd4353ca8 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -66,7 +66,7 @@ static RoadType _cur_roadtype; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; -void CcPlaySound_CONSTRUCTION_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcPlaySound_CONSTRUCTION_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); } @@ -96,7 +96,7 @@ static void PlaceRoad_Bridge(TileIndex tile, Window *w) * @param p2 unused * @param cmd unused */ -void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, start_tile); @@ -129,7 +129,7 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) } } -void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -155,7 +155,7 @@ void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 * @param cmd Unused. * @see CmdBuildRoadStop */ -void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -178,9 +178,10 @@ void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, * bit 2: Allow stations directly adjacent to other stations. * bit 5..10: The roadtypes. * @param cmd Command to use. + * @param err_msg Error message to show. * @see CcRoadStop() */ -static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, uint32 cmd) +static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, Commands cmd, StringID err_msg) { uint8 ddir = _road_station_picker_orientation; SB(p2, 16, 16, INVALID_STATION); // no station to join @@ -192,7 +193,7 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, u p2 |= ddir << 3; // Set the DiagDirecion into p2 bits 3 and 4. TileArea ta(start_tile, end_tile); - CommandContainer cmdcont = { ta.tile, (uint32)(ta.w | ta.h << 8), p2, cmd, CcRoadStop, "" }; + CommandContainer cmdcont = { ta.tile, (uint32)(ta.w | ta.h << 8), p2, cmd, err_msg, CcRoadStop, "" }; ShowSelectStationIfNeeded(cmdcont, ta); } @@ -550,7 +551,7 @@ struct BuildRoadToolbarWindow : Window { break; case WID_ROT_DEPOT: - DoCommandP(CMD_BUILD_ROAD_DEPOT | CMD_MSG(this->rti->strings.err_depot), CcRoadDepot, + DoCommandP(CMD_BUILD_ROAD_DEPOT, this->rti->strings.err_depot, CcRoadDepot, tile, _cur_roadtype << 2 | _road_depot_orientation, 0); break; @@ -567,7 +568,7 @@ struct BuildRoadToolbarWindow : Window { break; case WID_ROT_BUILD_TUNNEL: - DoCommandP(CMD_BUILD_TUNNEL | CMD_MSG(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE), CcBuildRoadTunnel, + DoCommandP(CMD_BUILD_TUNNEL, STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRoadTunnel, tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0); break; @@ -669,9 +670,8 @@ struct BuildRoadToolbarWindow : Window { * flags */ _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3)); - DoCommandP(_remove_button_clicked ? - CMD_REMOVE_LONG_ROAD | CMD_MSG(this->rti->strings.err_remove_road) : - CMD_BUILD_LONG_ROAD | CMD_MSG(this->rti->strings.err_build_road), CcPlaySound_CONSTRUCTION_OTHER, + DoCommandP(_remove_button_clicked ? CMD_REMOVE_LONG_ROAD : CMD_BUILD_LONG_ROAD, + _remove_button_clicked ? this->rti->strings.err_remove_road : this->rti->strings.err_build_road, CcPlaySound_CONSTRUCTION_OTHER, start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10)); break; @@ -680,9 +680,9 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_BUS_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - DoCommandP(CMD_REMOVE_ROAD_STOP | CMD_MSG(this->rti->strings.err_remove_station[ROADSTOP_BUS]), CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS); + DoCommandP(CMD_REMOVE_ROAD_STOP, this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS); } else { - PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, CMD_BUILD_ROAD_STOP | CMD_MSG(this->rti->strings.err_build_station[ROADSTOP_BUS])); + PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, CMD_BUILD_ROAD_STOP, this->rti->strings.err_build_station[ROADSTOP_BUS]); } } break; @@ -692,15 +692,15 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_TRUCK_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - DoCommandP(CMD_REMOVE_ROAD_STOP | CMD_MSG(this->rti->strings.err_remove_station[ROADSTOP_TRUCK]), CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK); + DoCommandP(CMD_REMOVE_ROAD_STOP, this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK); } else { - PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP | CMD_MSG(this->rti->strings.err_build_station[ROADSTOP_TRUCK])); + PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); } } break; case DDSP_CONVERT_ROAD: - DoCommandP(CMD_CONVERT_ROAD | CMD_MSG(rti->strings.err_convert_road), CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype); + DoCommandP(CMD_CONVERT_ROAD, rti->strings.err_convert_road, CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype); break; } } diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index bb7260d9c5..720e922f12 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -82,24 +82,24 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->mode_instance; } -/* static */ void ScriptObject::SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +/* static */ void ScriptObject::SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { ScriptStorage *s = GetStorage(); Debug(script, 6, "SetLastCommand company={:02d} tile={:06x} p1={:08x} p2={:08x} cmd={}", s->root_company, tile, p1, p2, cmd); s->last_tile = tile; s->last_p1 = p1; s->last_p2 = p2; - s->last_cmd = cmd & CMD_ID_MASK; + s->last_cmd = cmd; } -/* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +/* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { ScriptStorage *s = GetStorage(); Debug(script, 6, "CheckLastCommand company={:02d} tile={:06x} p1={:08x} p2={:08x} cmd={}", s->root_company, tile, p1, p2, cmd); if (s->last_tile != tile) return false; if (s->last_p1 != p1) return false; if (s->last_p2 != p2) return false; - if (s->last_cmd != (cmd & CMD_ID_MASK)) return false; + if (s->last_cmd != cmd) return false; return true; } @@ -298,7 +298,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->callback_value[index]; } -/* static */ bool ScriptObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const char *text, Script_SuspendCallbackProc *callback) +/* static */ bool ScriptObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd, const char *text, Script_SuspendCallbackProc *callback) { if (!ScriptObject::CanSuspend()) { throw Script_FatalError("You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator."); @@ -329,7 +329,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() if (!estimate_only && _networking && !_generating_world) SetLastCommand(tile, p1, p2, cmd); /* Try to perform the command. */ - CommandCost res = ::DoCommandPInternal(cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, false, estimate_only, tile, p1, p2, command_text); + CommandCost res = ::DoCommandPInternal(cmd, STR_NULL, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, false, estimate_only, false, tile, p1, p2, command_text); /* We failed; set the error and bail out */ if (res.Failed()) { diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index f953b20e47..a1134aa5c3 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -13,6 +13,7 @@ #include "../../misc/countedptr.hpp" #include "../../road_type.h" #include "../../rail_type.h" +#include "../../command_type.h" #include "script_types.hpp" #include "../script_suspend.hpp" @@ -69,17 +70,17 @@ protected: /** * Executes a raw DoCommand for the script. */ - static bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const char *text = nullptr, Script_SuspendCallbackProc *callback = nullptr); + static bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd, const char *text = nullptr, Script_SuspendCallbackProc *callback = nullptr); /** * Store the latest command executed by the script. */ - static void SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd); + static void SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd); /** * Check if it's the latest command executed by the script. */ - static bool CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd); + static bool CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd); /** * Sets the DoCommand costs counter to a value. diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index bbd9df55de..9e2a56e923 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -69,7 +69,7 @@ EnforcePreconditionCustomError(VEHICLE_INVALID, !ScriptGameSettings::IsDisabledVehicleType((ScriptVehicle::VehicleType)type), ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED); - if (!ScriptObject::DoCommand(depot, engine_id | (cargo << 24), 0, ::GetCmdBuildVeh(type), nullptr, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; + if (!ScriptObject::DoCommand(depot, engine_id | (cargo << 24), 0, CMD_BUILD_VEHICLE, nullptr, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; @@ -91,9 +91,7 @@ if (!ScriptEngine::IsBuildable(engine_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - ::VehicleType type = ::Engine::Get(engine_id)->type; - - CommandCost res = ::DoCommand(DC_QUERY_COST, ::GetCmdBuildVeh(type), depot, engine_id | (cargo << 24), 0); + CommandCost res = ::DoCommand(DC_QUERY_COST, CMD_BUILD_VEHICLE, depot, engine_id | (cargo << 24), 0); return res.Succeeded() ? _returned_refit_capacity : -1; } @@ -142,7 +140,7 @@ if (!IsValidVehicle(vehicle_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - CommandCost res = ::DoCommand(DC_QUERY_COST, GetCmdRefitVeh(::Vehicle::Get(vehicle_id)), 0, vehicle_id, cargo); + CommandCost res = ::DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, 0, vehicle_id, cargo); return res.Succeeded() ? _returned_refit_capacity : -1; } @@ -151,7 +149,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id) && ScriptCargo::IsValidCargo(cargo)); - return ScriptObject::DoCommand(0, vehicle_id, cargo, GetCmdRefitVeh(::Vehicle::Get(vehicle_id))); + return ScriptObject::DoCommand(0, vehicle_id, cargo, CMD_REFIT_VEHICLE); } @@ -161,7 +159,7 @@ EnforcePrecondition(false, IsValidVehicle(vehicle_id)); const Vehicle *v = ::Vehicle::Get(vehicle_id); - return ScriptObject::DoCommand(0, vehicle_id | (v->type == VEH_TRAIN ? 1 : 0) << 20, 0, GetCmdSellVeh(v)); + return ScriptObject::DoCommand(0, vehicle_id | (v->type == VEH_TRAIN ? 1 : 0) << 20, 0, CMD_SELL_VEHICLE); } /* static */ bool ScriptVehicle::_SellWagonInternal(VehicleID vehicle_id, int wagon, bool sell_attached_wagons) @@ -191,7 +189,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id, 0, GetCmdSendToDepot(::Vehicle::Get(vehicle_id))); + return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_SEND_VEHICLE_TO_DEPOT); } /* static */ bool ScriptVehicle::SendVehicleToDepotForServicing(VehicleID vehicle_id) @@ -199,7 +197,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id | DEPOT_SERVICE, 0, GetCmdSendToDepot(::Vehicle::Get(vehicle_id))); + return ScriptObject::DoCommand(0, vehicle_id | DEPOT_SERVICE, 0, CMD_SEND_VEHICLE_TO_DEPOT); } /* static */ bool ScriptVehicle::IsInDepot(VehicleID vehicle_id) diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 4342289afc..03fad1491a 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -687,7 +687,7 @@ SQInteger ScriptInstance::GetOpsTillSuspend() return this->engine->GetOpsTillSuspend(); } -bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { ScriptObject::ActiveInstance active(this); diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 7db4f5ea8f..01415d4d4b 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -183,7 +183,7 @@ public: * @param cmd cmd as given to DoCommandPInternal. * @return true if we handled result. */ - bool DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd); + bool DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd); /** * Insert an event for this script. diff --git a/src/script/script_storage.hpp b/src/script/script_storage.hpp index 2f5520cffa..8dadf59ae4 100644 --- a/src/script/script_storage.hpp +++ b/src/script/script_storage.hpp @@ -47,7 +47,7 @@ private: TileIndex last_tile; ///< The last tile passed to a command. uint32 last_p1; ///< The last p1 passed to a command. uint32 last_p2; ///< The last p2 passed to a command. - uint32 last_cmd; ///< The last cmd passed to a command. + Commands last_cmd; ///< The last cmd passed to a command. VehicleID new_vehicle_id; ///< The ID of the new Vehicle. SignID new_sign_id; ///< The ID of the new Sign. diff --git a/src/settings.cpp b/src/settings.cpp index d821239fbb..b82fe6d9a1 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1603,7 +1603,7 @@ void SyncCompanySettings() const SettingDesc *sd = GetSettingDesc(desc); uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object); uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object); - if (old_value != new_value) NetworkSendCommand(CMD_CHANGE_COMPANY_SETTING, nullptr, _local_company, 0, 0, new_value, sd->GetName()); + if (old_value != new_value) NetworkSendCommand(CMD_CHANGE_COMPANY_SETTING, STR_NULL, nullptr, _local_company, 0, 0, new_value, sd->GetName()); } } diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 77c5ce456c..504bae0781 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -114,7 +114,7 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 * @param p2 unused * @param cmd unused */ -void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -130,5 +130,5 @@ void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 */ void PlaceProc_Sign(TileIndex tile) { - DoCommandP(CMD_PLACE_SIGN | CMD_MSG(STR_ERROR_CAN_T_PLACE_SIGN_HERE), CcPlaceSign, tile, 0, 0); + DoCommandP(CMD_PLACE_SIGN, STR_ERROR_CAN_T_PLACE_SIGN_HERE, CcPlaceSign, tile, 0, 0); } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 368b57b43e..0bb9fa2daf 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -413,7 +413,7 @@ Window *ShowSignList() static bool RenameSign(SignID index, const char *text) { bool remove = StrEmpty(text); - DoCommandP(CMD_RENAME_SIGN | (StrEmpty(text) ? CMD_MSG(STR_ERROR_CAN_T_DELETE_SIGN) : CMD_MSG(STR_ERROR_CAN_T_CHANGE_SIGN_NAME)), 0, index, 0, text); + DoCommandP(CMD_RENAME_SIGN, StrEmpty(text) ? STR_ERROR_CAN_T_DELETE_SIGN : STR_ERROR_CAN_T_CHANGE_SIGN_NAME, 0, index, 0, text); return remove; } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 1992a2c56c..e1229fe3d1 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2084,7 +2084,7 @@ struct StationViewWindow : public Window { { if (str == nullptr) return; - DoCommandP(CMD_RENAME_STATION | CMD_MSG(STR_ERROR_CAN_T_RENAME_STATION), 0, this->window_number, 0, str); + DoCommandP(CMD_RENAME_STATION, STR_ERROR_CAN_T_RENAME_STATION, 0, this->window_number, 0, str); } void OnResize() override diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 5e25df78ca..0325a957ff 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -39,7 +39,7 @@ #include "safeguards.h" -void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); @@ -115,16 +115,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - DoCommandP(CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0); + DoCommandP(CMD_CLEAR_AREA, STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0); break; case DDSP_RAISE_AND_LEVEL_AREA: - DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0)); + DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0)); break; case DDSP_LOWER_AND_LEVEL_AREA: - DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LOWER_LAND_HERE), CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0)); + DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0)); break; case DDSP_LEVEL_AREA: - DoCommandP(CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LEVEL_LAND_HERE), CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0)); + DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0)); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -238,7 +238,7 @@ struct TerraformToolbarWindow : Window { break; case WID_TT_BUY_LAND: // Buy land button - DoCommandP(CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0); + DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0); break; case WID_TT_PLACE_SIGN: // Place sign button @@ -395,7 +395,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) StringID msg = mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE; - DoCommandP(CMD_TERRAFORM_LAND | CMD_MSG(msg), CcTerraform, tile, SLOPE_N, (uint32)mode); + DoCommandP(CMD_TERRAFORM_LAND, msg, CcTerraform, tile, SLOPE_N, (uint32)mode); } else { assert(_terraform_size != 0); TileArea ta(tile, _terraform_size, _terraform_size); diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 9f9bfad5a6..00ab50115d 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -142,7 +142,7 @@ static void FillTimetableArrivalDepartureTable(const Vehicle *v, VehicleOrderID */ static void ChangeTimetableStartCallback(const Window *w, Date date) { - DoCommandP(CMD_SET_TIMETABLE_START | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, w->window_number, date); + DoCommandP(CMD_SET_TIMETABLE_START, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, w->window_number, date); } @@ -578,25 +578,25 @@ struct TimetableWindow : Window { case WID_VT_CLEAR_TIME: { // Clear waiting time. uint32 p1 = PackTimetableArgs(v, this->sel_index, false); - DoCommandP(CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, p1, 0); + DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, 0); break; } case WID_VT_CLEAR_SPEED: { // Clear max speed button. uint32 p1 = PackTimetableArgs(v, this->sel_index, true); - DoCommandP(CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, p1, UINT16_MAX); + DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, UINT16_MAX); break; } case WID_VT_RESET_LATENESS: // Reset the vehicle's late counter. - DoCommandP(CMD_SET_VEHICLE_ON_TIME | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, v->index, 0); + DoCommandP(CMD_SET_VEHICLE_ON_TIME, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, 0); break; case WID_VT_AUTOFILL: { // Autofill the timetable. uint32 p2 = 0; if (!HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(p2, 0); if (_ctrl_pressed) SetBit(p2, 1); - DoCommandP(CMD_AUTOFILL_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, v->index, p2); + DoCommandP(CMD_AUTOFILL_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, p2); break; } @@ -629,7 +629,7 @@ struct TimetableWindow : Window { uint32 p2 = std::min(val, UINT16_MAX); - DoCommandP(CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE), 0, p1, p2); + DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, p2); } void OnResize() override diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 9082fc7b38..9e1ba39680 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -287,7 +287,7 @@ public: } case WID_TA_EXECUTE: - DoCommandP(CMD_DO_TOWN_ACTION | CMD_MSG(STR_ERROR_CAN_T_DO_THIS), this->town->xy, this->window_number, this->sel_index); + DoCommandP(CMD_DO_TOWN_ACTION, STR_ERROR_CAN_T_DO_THIS, this->town->xy, this->window_number, this->sel_index); break; } } @@ -474,12 +474,12 @@ public: _warn_town_no_roads = true; } - DoCommandP(CMD_EXPAND_TOWN | CMD_MSG(STR_ERROR_CAN_T_EXPAND_TOWN), 0, this->window_number, 0); + DoCommandP(CMD_EXPAND_TOWN, STR_ERROR_CAN_T_EXPAND_TOWN, 0, this->window_number, 0); break; } case WID_TV_DELETE: // delete town - only available on Scenario editor - DoCommandP(CMD_DELETE_TOWN | CMD_MSG(STR_ERROR_TOWN_CAN_T_DELETE), 0, this->window_number, 0); + DoCommandP(CMD_DELETE_TOWN, STR_ERROR_TOWN_CAN_T_DELETE, 0, this->window_number, 0); break; } } @@ -561,7 +561,7 @@ public: { if (str == nullptr) return; - DoCommandP(CMD_RENAME_TOWN | CMD_MSG(STR_ERROR_CAN_T_RENAME_TOWN), 0, this->window_number, 0, str); + DoCommandP(CMD_RENAME_TOWN, STR_ERROR_CAN_T_RENAME_TOWN, 0, this->window_number, 0, str); } }; @@ -1008,7 +1008,7 @@ void ShowTownDirectory() new TownDirectoryWindow(&_town_directory_desc); } -void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -1016,7 +1016,7 @@ void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcFoundRandomTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcFoundRandomTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(_new_town_id)->xy); } @@ -1162,7 +1162,7 @@ public: if (strcmp(buf, this->townname_editbox.text.buf) != 0) name = this->townname_editbox.text.buf; } - bool success = DoCommandP(CMD_FOUND_TOWN | CMD_MSG(errstr), cc, + bool success = DoCommandP(CMD_FOUND_TOWN, errstr, cc, tile, this->town_size | this->city << 2 | this->town_layout << 3 | random << 6, townnameparts, name); /* Rerandomise name, if success and no cost-estimation. */ diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 9bb7d59476..a630c9fbd1 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -27,7 +27,7 @@ * @param p2 Additional data for the command (for the #CommandProc) * @param cmd Unused. */ -void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 005cebd467..f176668b1a 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -240,7 +240,7 @@ public: void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL && pt.x != -1 && select_proc == DDSP_PLANT_TREES) { - DoCommandP(CMD_PLANT_TREE | CMD_MSG(STR_ERROR_CAN_T_PLANT_TREE_HERE), end_tile, this->tree_to_plant, start_tile); + DoCommandP(CMD_PLANT_TREE, STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, this->tree_to_plant, start_tile); } } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 1e0cccaadc..82170ed4c0 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1561,7 +1561,7 @@ void VehicleEnterDepot(Vehicle *v) if (v->current_order.IsRefit()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost cost = DoCommand(DC_EXEC, GetCmdRefitVeh(v), v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8); + CommandCost cost = DoCommand(DC_EXEC, CMD_REFIT_VEHICLE, v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8); cur_company.Restore(); if (cost.Failed()) { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 5b1878c3a8..a36abb59dd 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -37,33 +37,33 @@ #include "safeguards.h" -/* Tables used in vehicle.h to find the right command for a certain vehicle type */ -const uint32 _veh_build_proc_table[] = { - CMD_BUILD_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN), - CMD_BUILD_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_ROAD_VEHICLE), - CMD_BUILD_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_SHIP), - CMD_BUILD_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_AIRCRAFT), +/* Tables used in vehicle_func.h to find the right error message for a certain vehicle type */ +const StringID _veh_build_msg_table[] = { + STR_ERROR_CAN_T_BUY_TRAIN, + STR_ERROR_CAN_T_BUY_ROAD_VEHICLE, + STR_ERROR_CAN_T_BUY_SHIP, + STR_ERROR_CAN_T_BUY_AIRCRAFT, }; -const uint32 _veh_sell_proc_table[] = { - CMD_SELL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_SELL_TRAIN), - CMD_SELL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_SELL_ROAD_VEHICLE), - CMD_SELL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_SELL_SHIP), - CMD_SELL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_SELL_AIRCRAFT), +const StringID _veh_sell_msg_table[] = { + STR_ERROR_CAN_T_SELL_TRAIN, + STR_ERROR_CAN_T_SELL_ROAD_VEHICLE, + STR_ERROR_CAN_T_SELL_SHIP, + STR_ERROR_CAN_T_SELL_AIRCRAFT, }; -const uint32 _veh_refit_proc_table[] = { - CMD_REFIT_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_REFIT_TRAIN), - CMD_REFIT_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_REFIT_ROAD_VEHICLE), - CMD_REFIT_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_REFIT_SHIP), - CMD_REFIT_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_REFIT_AIRCRAFT), +const StringID _veh_refit_msg_table[] = { + STR_ERROR_CAN_T_REFIT_TRAIN, + STR_ERROR_CAN_T_REFIT_ROAD_VEHICLE, + STR_ERROR_CAN_T_REFIT_SHIP, + STR_ERROR_CAN_T_REFIT_AIRCRAFT, }; -const uint32 _send_to_depot_proc_table[] = { - CMD_SEND_VEHICLE_TO_DEPOT | CMD_MSG(STR_ERROR_CAN_T_SEND_TRAIN_TO_DEPOT), - CMD_SEND_VEHICLE_TO_DEPOT | CMD_MSG(STR_ERROR_CAN_T_SEND_ROAD_VEHICLE_TO_DEPOT), - CMD_SEND_VEHICLE_TO_DEPOT | CMD_MSG(STR_ERROR_CAN_T_SEND_SHIP_TO_DEPOT), - CMD_SEND_VEHICLE_TO_DEPOT | CMD_MSG(STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR), +const StringID _send_to_depot_msg_table[] = { + STR_ERROR_CAN_T_SEND_TRAIN_TO_DEPOT, + STR_ERROR_CAN_T_SEND_ROAD_VEHICLE_TO_DEPOT, + STR_ERROR_CAN_T_SEND_SHIP_TO_DEPOT, + STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR, }; @@ -182,7 +182,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* If we are not in DC_EXEC undo everything */ if (flags != subflags) { - DoCommand(DC_EXEC, GetCmdSellVeh(v), 0, v->index, 0); + DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, v->index, 0); } } @@ -689,15 +689,13 @@ CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 if (!IsCompanyBuildableVehicleType(vehicle_type)) return CMD_ERROR; - uint sell_command = GetCmdSellVeh(vehicle_type); - /* Get the list of vehicles in the depot */ BuildDepotVehicleList(vehicle_type, tile, &list, &list); CommandCost last_error = CMD_ERROR; bool had_success = false; for (uint i = 0; i < list.size(); i++) { - CommandCost ret = DoCommand(flags, sell_command, tile, list[i]->index | (1 << 20), 0); + CommandCost ret = DoCommand(flags, CMD_SELL_VEHICLE, tile, list[i]->index | (1 << 20), 0); if (ret.Succeeded()) { cost.AddCost(ret); had_success = true; @@ -875,11 +873,11 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint DoCommandFlag build_flags = flags; if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE; - CommandCost cost = DoCommand(build_flags, GetCmdBuildVeh(v), tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0); + CommandCost cost = DoCommand(build_flags, CMD_BUILD_VEHICLE, tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0); if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ - if (w_front != nullptr) DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | (1 << 20), 0); + if (w_front != nullptr) DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | (1 << 20), 0); return cost; } @@ -899,8 +897,8 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (result.Failed()) { /* The train can't be joined to make the same consist as the original. * Sell what we already made (clean up) and return an error. */ - DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | 1 << 20, 0); - DoCommand(flags, GetCmdSellVeh(w) , w_front->tile, w->index | 1 << 20, 0); + DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | 1 << 20, 0); + DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w->index | 1 << 20, 0); return result; // return error and the message returned from CMD_MOVE_RAIL_VEHICLE } } else { @@ -943,7 +941,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* Find out what's the best sub type */ byte subtype = GetBestFittingSubType(v, w, v->cargo_type); if (w->cargo_type != v->cargo_type || w->cargo_subtype != subtype) { - CommandCost cost = DoCommand(flags, GetCmdRefitVeh(v), 0, w->index, v->cargo_type | 1U << 25 | (subtype << 8)); + CommandCost cost = DoCommand(flags, CMD_REFIT_VEHICLE, 0, w->index, v->cargo_type | 1U << 25 | (subtype << 8)); if (cost.Succeeded()) total_cost.AddCost(cost); } @@ -981,7 +979,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint CommandCost result = DoCommand(flags, CMD_CLONE_ORDER, 0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index); if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ - DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | 1 << 20, 0); + DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | 1 << 20, 0); return result; } @@ -992,7 +990,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint * check whether the company has enough money manually. */ if (!CheckCompanyHasMoney(total_cost)) { /* The vehicle has already been bought, so now it must be sold again. */ - DoCommand(flags, GetCmdSellVeh(w_front), w_front->tile, w_front->index | 1 << 20, 0); + DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | 1 << 20, 0); return total_cost; } } @@ -1017,7 +1015,7 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con bool had_success = false; for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; - CommandCost ret = DoCommand(flags, GetCmdSendToDepot(vli.vtype), v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0); + CommandCost ret = DoCommand(flags, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0); if (ret.Succeeded()) { had_success = true; diff --git a/src/vehicle_func.h b/src/vehicle_func.h index ec14e526af..5784de1081 100644 --- a/src/vehicle_func.h +++ b/src/vehicle_func.h @@ -115,50 +115,50 @@ const struct Livery *GetEngineLivery(EngineID engine_type, CompanyID company, En SpriteID GetEnginePalette(EngineID engine_type, CompanyID company); SpriteID GetVehiclePalette(const Vehicle *v); -extern const uint32 _veh_build_proc_table[]; -extern const uint32 _veh_sell_proc_table[]; -extern const uint32 _veh_refit_proc_table[]; -extern const uint32 _send_to_depot_proc_table[]; +extern const StringID _veh_build_msg_table[]; +extern const StringID _veh_sell_msg_table[]; +extern const StringID _veh_refit_msg_table[]; +extern const StringID _send_to_depot_msg_table[]; /* Functions to find the right command for certain vehicle type */ -static inline uint32 GetCmdBuildVeh(VehicleType type) +static inline StringID GetCmdBuildVehMsg(VehicleType type) { - return _veh_build_proc_table[type]; + return _veh_build_msg_table[type]; } -static inline uint32 GetCmdBuildVeh(const BaseVehicle *v) +static inline StringID GetCmdBuildVehMsg(const BaseVehicle *v) { - return GetCmdBuildVeh(v->type); + return GetCmdBuildVehMsg(v->type); } -static inline uint32 GetCmdSellVeh(VehicleType type) +static inline StringID GetCmdSellVehMsg(VehicleType type) { - return _veh_sell_proc_table[type]; + return _veh_sell_msg_table[type]; } -static inline uint32 GetCmdSellVeh(const BaseVehicle *v) +static inline StringID GetCmdSellVehMsg(const BaseVehicle *v) { - return GetCmdSellVeh(v->type); + return GetCmdSellVehMsg(v->type); } -static inline uint32 GetCmdRefitVeh(VehicleType type) +static inline StringID GetCmdRefitVehMsg(VehicleType type) { - return _veh_refit_proc_table[type]; + return _veh_refit_msg_table[type]; } -static inline uint32 GetCmdRefitVeh(const BaseVehicle *v) +static inline StringID GetCmdRefitVehMsg(const BaseVehicle *v) { - return GetCmdRefitVeh(v->type); + return GetCmdRefitVehMsg(v->type); } -static inline uint32 GetCmdSendToDepot(VehicleType type) +static inline StringID GetCmdSendToDepotMsg(VehicleType type) { - return _send_to_depot_proc_table[type]; + return _send_to_depot_msg_table[type]; } -static inline uint32 GetCmdSendToDepot(const BaseVehicle *v) +static inline StringID GetCmdSendToDepotMsg(const BaseVehicle *v) { - return GetCmdSendToDepot(v->type); + return GetCmdSendToDepotMsg(v->type); } CommandCost EnsureNoVehicleOnGround(TileIndex tile); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 56e1bb713b..69fb158460 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -772,7 +772,7 @@ struct RefitWindow : public Window { { assert(_current_company == _local_company); Vehicle *v = Vehicle::Get(this->window_number); - CommandCost cost = DoCommand(DC_QUERY_COST, GetCmdRefitVeh(v->type), v->tile, this->selected_vehicle, option->cargo | + CommandCost cost = DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, v->tile, this->selected_vehicle, option->cargo | option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24); if (cost.Failed()) return INVALID_STRING_ID; @@ -1033,7 +1033,7 @@ struct RefitWindow : public Window { if (this->order == INVALID_VEH_ORDER_ID) { bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX; - if (DoCommandP(GetCmdRefitVeh(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16) && delete_window) this->Close(); + if (DoCommandP(CMD_REFIT_VEHICLE, GetCmdRefitVehMsg(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16) && delete_window) this->Close(); } else { if (DoCommandP(CMD_ORDER_REFIT, v->tile, v->index, this->cargo->cargo | this->order << 16)) this->Close(); } @@ -1919,7 +1919,7 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: // Send to Depots - DoCommandP(GetCmdSendToDepot(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number); + DoCommandP(CMD_SEND_VEHICLE_TO_DEPOT, GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number); break; default: NOT_REACHED(); @@ -2422,7 +2422,7 @@ struct VehicleDetailsWindow : Window { mod = GetServiceIntervalClamped(mod + v->GetServiceInterval(), v->ServiceIntervalIsPercent()); if (mod == v->GetServiceInterval()) return; - DoCommandP(CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING), v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17)); + DoCommandP(CMD_CHANGE_SERVICE_INT, STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17)); break; } @@ -2458,7 +2458,7 @@ struct VehicleDetailsWindow : Window { bool iscustom = index != 0; bool ispercent = iscustom ? (index == 2) : Company::Get(v->owner)->settings.vehicle.servint_ispercent; uint16 interval = GetServiceIntervalClamped(v->GetServiceInterval(), ispercent); - DoCommandP(CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING), v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17)); + DoCommandP(CMD_CHANGE_SERVICE_INT, STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17)); break; } } @@ -2591,24 +2591,24 @@ enum VehicleCommandTranslation { }; /** Command codes for the shared buttons indexed by VehicleCommandTranslation and vehicle type. */ -static const uint32 _vehicle_command_translation_table[][4] = { +static const StringID _vehicle_msg_translation_table[][4] = { { // VCT_CMD_START_STOP - CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_TRAIN), - CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_ROAD_VEHICLE), - CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_SHIP), - CMD_START_STOP_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_STOP_START_AIRCRAFT) + STR_ERROR_CAN_T_STOP_START_TRAIN, + STR_ERROR_CAN_T_STOP_START_ROAD_VEHICLE, + STR_ERROR_CAN_T_STOP_START_SHIP, + STR_ERROR_CAN_T_STOP_START_AIRCRAFT }, { // VCT_CMD_CLONE_VEH - CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN), - CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_ROAD_VEHICLE), - CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_SHIP), - CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_AIRCRAFT) + STR_ERROR_CAN_T_BUY_TRAIN, + STR_ERROR_CAN_T_BUY_ROAD_VEHICLE, + STR_ERROR_CAN_T_BUY_SHIP, + STR_ERROR_CAN_T_BUY_AIRCRAFT }, { // VCT_CMD_TURN_AROUND - CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN), - CMD_TURN_ROADVEH | CMD_MSG(STR_ERROR_CAN_T_MAKE_ROAD_VEHICLE_TURN), - 0xffffffff, // invalid for ships - 0xffffffff // invalid for aircraft + STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN, + STR_ERROR_CAN_T_MAKE_ROAD_VEHICLE_TURN, + INVALID_STRING_ID, // invalid for ships + INVALID_STRING_ID // invalid for aircraft }, }; @@ -2619,7 +2619,7 @@ static const uint32 _vehicle_command_translation_table[][4] = { * @param p1 vehicle ID * @param p2 unused */ -void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; @@ -2639,7 +2639,7 @@ void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, ui void StartStopVehicle(const Vehicle *v, bool texteffect) { assert(v->IsPrimaryVehicle()); - DoCommandP(_vehicle_command_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, 0); + DoCommandP(CMD_START_STOP_VEHICLE, _vehicle_msg_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, 0); } /** Checks whether the vehicle may be refitted at the moment.*/ @@ -2963,7 +2963,7 @@ public: break; case WID_VV_GOTO_DEPOT: // goto hangar - DoCommandP(GetCmdSendToDepot(v), v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0); + DoCommandP(CMD_SEND_VEHICLE_TO_DEPOT, GetCmdSendToDepotMsg(v), v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0); break; case WID_VV_REFIT: // refit ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID, this); @@ -2987,17 +2987,21 @@ public: * There is no point to it except for starting the vehicle. * For starting the vehicle the player has to open the depot GUI, which is * most likely already open, but is also visible in the vehicle viewport. */ - DoCommandP(_vehicle_command_translation_table[VCT_CMD_CLONE_VEH][v->type], + DoCommandP(CMD_CLONE_VEHICLE, _vehicle_msg_translation_table[VCT_CMD_CLONE_VEH][v->type], _ctrl_pressed ? nullptr : CcCloneVehicle, v->tile, v->index, _ctrl_pressed ? 1 : 0); break; case WID_VV_TURN_AROUND: // turn around assert(v->IsGroundVehicle()); - DoCommandP(_vehicle_command_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0); + if (v->type == VEH_ROAD) { + DoCommandP(CMD_TURN_ROADVEH, _vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0); + } else { + DoCommandP(CMD_REVERSE_TRAIN_DIRECTION, _vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0); + } break; case WID_VV_FORCE_PROCEED: // force proceed assert(v->type == VEH_TRAIN); - DoCommandP(CMD_FORCE_TRAIN_PROCEED | CMD_MSG(STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL), v->tile, v->index, 0); + DoCommandP(CMD_FORCE_TRAIN_PROCEED, STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL, v->tile, v->index, 0); break; } } @@ -3006,7 +3010,7 @@ public: { if (str == nullptr) return; - DoCommandP(CMD_RENAME_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type), 0, this->window_number, 0, str); + DoCommandP(CMD_RENAME_VEHICLE, STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type, 0, this->window_number, 0, str); } void OnMouseOver(Point pt, int widget) override @@ -3119,7 +3123,7 @@ void StopGlobalFollowVehicle(const Vehicle *v) * @param p2 unused * @param cmd unused */ -void CcBuildPrimaryVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +void CcBuildPrimaryVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) { if (result.Failed()) return; diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 8a4772ac08..44e2718b68 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -138,7 +138,7 @@ public: { if (str == nullptr) return; - DoCommandP(CMD_RENAME_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME), 0, this->window_number, 0, str); + DoCommandP(CMD_RENAME_WAYPOINT, STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME, 0, this->window_number, 0, str); } }; From 5ddfdc8516e35c4f5de2613692d104486151171b Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 3 Oct 2021 22:08:03 +0200 Subject: [PATCH 106/710] Codechange: Declare our custom enum operators as constexpr. --- src/core/enum_type.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/enum_type.hpp b/src/core/enum_type.hpp index d4ea82eff1..72e23ba363 100644 --- a/src/core/enum_type.hpp +++ b/src/core/enum_type.hpp @@ -12,13 +12,13 @@ /** Some enums need to have allowed incrementing (i.e. StationClassID) */ #define DECLARE_POSTFIX_INCREMENT(enum_type) \ - inline enum_type operator ++(enum_type& e, int) \ + inline constexpr enum_type operator ++(enum_type& e, int) \ { \ enum_type e_org = e; \ e = (enum_type)((std::underlying_type::type)e + 1); \ return e_org; \ } \ - inline enum_type operator --(enum_type& e, int) \ + inline constexpr enum_type operator --(enum_type& e, int) \ { \ enum_type e_org = e; \ e = (enum_type)((std::underlying_type::type)e - 1); \ @@ -29,13 +29,13 @@ /** Operators to allow to work with enum as with type safe bit set in C++ */ # define DECLARE_ENUM_AS_BIT_SET(mask_t) \ - inline mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 | m2);} \ - inline mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 & m2);} \ - inline mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 ^ m2);} \ - inline mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \ - inline mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \ - inline mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \ - inline mask_t operator ~(mask_t m) {return (mask_t)(~(std::underlying_type::type)m);} + inline constexpr mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 | m2);} \ + inline constexpr mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 & m2);} \ + inline constexpr mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 ^ m2);} \ + inline constexpr mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \ + inline constexpr mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \ + inline constexpr mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \ + inline constexpr mask_t operator ~(mask_t m) {return (mask_t)(~(std::underlying_type::type)m);} /** From 33ca4f2b9950d98fed902962c847833667ccca9f Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Tue, 5 Oct 2021 22:02:27 +0200 Subject: [PATCH 107/710] Codechange: Let the compile generate the master command table out of templated command traits. This is using a non-intrusive type-traits like templated system, which allows compile-time validation that the command table and the command enum match up. --- src/CMakeLists.txt | 32 ++ src/aircraft_cmd.cpp | 1 + src/aircraft_cmd.h | 19 + src/autoreplace_cmd.cpp | 1 + src/autoreplace_cmd.h | 21 ++ src/command.cpp | 389 +++------------------ src/command_func.h | 4 +- src/command_type.h | 23 +- src/company_cmd.cpp | 1 + src/company_cmd.h | 29 ++ src/depot_cmd.cpp | 1 + src/depot_cmd.h | 19 + src/economy.cpp | 1 + src/economy_cmd.h | 23 ++ src/engine.cpp | 1 + src/engine_cmd.h | 25 ++ src/goal.cpp | 1 + src/goal_cmd.h | 31 ++ src/group_cmd.cpp | 1 + src/group_cmd.h | 33 ++ src/industry_cmd.cpp | 1 + src/industry_cmd.h | 21 ++ src/landscape.cpp | 1 + src/landscape_cmd.h | 21 ++ src/misc_cmd.cpp | 1 + src/misc_cmd.h | 27 ++ src/news_cmd.h | 19 + src/news_gui.cpp | 1 + src/object_cmd.cpp | 1 + src/object_cmd.h | 19 + src/order_backup.cpp | 1 + src/order_cmd.cpp | 1 + src/order_cmd.h | 33 ++ src/rail_cmd.cpp | 1 + src/rail_cmd.h | 37 ++ src/road_cmd.cpp | 1 + src/road_cmd.h | 13 + src/roadveh_cmd.cpp | 1 + src/roadveh_cmd.h | 23 ++ src/settings.cpp | 1 + src/settings_cmd.h | 21 ++ src/ship_cmd.cpp | 1 + src/ship_cmd.h | 19 + src/signs_cmd.cpp | 1 + src/signs_cmd.h | 21 ++ src/station_cmd.cpp | 2 + src/station_cmd.h | 33 ++ src/story.cpp | 1 + src/story_cmd.h | 35 ++ src/subsidy.cpp | 1 + src/subsidy_cmd.h | 19 + src/table/CMakeLists.txt | 2 +- src/table/{train_cmd.h => train_sprites.h} | 2 +- src/terraform_cmd.cpp | 1 + src/terraform_cmd.h | 21 ++ src/timetable_cmd.cpp | 1 + src/timetable_cmd.h | 25 ++ src/town_cmd.cpp | 1 + src/town_cmd.h | 35 ++ src/train_cmd.cpp | 3 +- src/train_cmd.h | 28 ++ src/tree_cmd.cpp | 1 + src/tree_cmd.h | 19 + src/tunnelbridge_cmd.cpp | 1 + src/tunnelbridge_cmd.h | 21 ++ src/vehicle_cmd.cpp | 14 +- src/vehicle_cmd.h | 39 +++ src/viewport.cpp | 1 + src/viewport_cmd.h | 19 + src/water_cmd.cpp | 1 + src/water_cmd.h | 23 ++ src/waypoint_cmd.cpp | 1 + src/waypoint_cmd.h | 25 ++ 73 files changed, 960 insertions(+), 358 deletions(-) create mode 100644 src/aircraft_cmd.h create mode 100644 src/autoreplace_cmd.h create mode 100644 src/company_cmd.h create mode 100644 src/depot_cmd.h create mode 100644 src/economy_cmd.h create mode 100644 src/engine_cmd.h create mode 100644 src/goal_cmd.h create mode 100644 src/group_cmd.h create mode 100644 src/industry_cmd.h create mode 100644 src/landscape_cmd.h create mode 100644 src/misc_cmd.h create mode 100644 src/news_cmd.h create mode 100644 src/object_cmd.h create mode 100644 src/order_cmd.h create mode 100644 src/rail_cmd.h create mode 100644 src/roadveh_cmd.h create mode 100644 src/settings_cmd.h create mode 100644 src/ship_cmd.h create mode 100644 src/signs_cmd.h create mode 100644 src/station_cmd.h create mode 100644 src/story_cmd.h create mode 100644 src/subsidy_cmd.h rename src/table/{train_cmd.h => train_sprites.h} (97%) create mode 100644 src/terraform_cmd.h create mode 100644 src/timetable_cmd.h create mode 100644 src/town_cmd.h create mode 100644 src/train_cmd.h create mode 100644 src/tree_cmd.h create mode 100644 src/tunnelbridge_cmd.h create mode 100644 src/vehicle_cmd.h create mode 100644 src/viewport_cmd.h create mode 100644 src/water_cmd.h create mode 100644 src/waypoint_cmd.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 631eaf6dea..6950e32757 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,7 @@ endif() add_files( aircraft.h aircraft_cmd.cpp + aircraft_cmd.h aircraft_gui.cpp airport.cpp airport.h @@ -49,6 +50,7 @@ add_files( autoreplace.cpp autoreplace_base.h autoreplace_cmd.cpp + autoreplace_cmd.h autoreplace_func.h autoreplace_gui.cpp autoreplace_gui.h @@ -90,6 +92,7 @@ add_files( command_type.h company_base.h company_cmd.cpp + company_cmd.h company_func.h company_gui.cpp company_gui.h @@ -119,6 +122,7 @@ add_files( depot.cpp depot_base.h depot_cmd.cpp + depot_cmd.h depot_func.h depot_gui.cpp depot_map.h @@ -132,6 +136,7 @@ add_files( driver.h economy.cpp economy_base.h + economy_cmd.h economy_func.h economy_type.h effectvehicle.cpp @@ -141,6 +146,7 @@ add_files( elrail_func.h engine.cpp engine_base.h + engine_cmd.h engine_func.h engine_gui.cpp engine_gui.h @@ -174,6 +180,7 @@ add_files( gfxinit.h goal.cpp goal_base.h + goal_cmd.h goal_gui.cpp goal_type.h graph_gui.cpp @@ -182,6 +189,7 @@ add_files( ground_vehicle.hpp group.h group_cmd.cpp + group_cmd.h group_gui.cpp group_gui.h group_type.h @@ -198,6 +206,7 @@ add_files( house_type.h industry.h industry_cmd.cpp + industry_cmd.h industry_gui.cpp industry_map.h industry_type.h @@ -208,6 +217,7 @@ add_files( intro_gui.cpp landscape.cpp landscape.h + landscape_cmd.h landscape_type.h language.h livery.h @@ -217,6 +227,7 @@ add_files( map_type.h misc.cpp misc_cmd.cpp + misc_cmd.h misc_gui.cpp mixer.cpp mixer.h @@ -277,6 +288,7 @@ add_files( newgrf_town.h newgrf_townname.cpp newgrf_townname.h + news_cmd.h news_func.h news_gui.cpp news_gui.h @@ -284,6 +296,7 @@ add_files( object.h object_base.h object_cmd.cpp + object_cmd.h object_gui.cpp object_map.h object_type.h @@ -293,6 +306,7 @@ add_files( order_backup.h order_base.h order_cmd.cpp + order_cmd.h order_func.h order_gui.cpp order_type.h @@ -305,6 +319,7 @@ add_files( rail.cpp rail.h rail_cmd.cpp + rail_cmd.h rail_gui.cpp rail_gui.h rail_map.h @@ -327,6 +342,7 @@ add_files( roadstop_base.h roadveh.h roadveh_cmd.cpp + roadveh_cmd.h roadveh_gui.cpp safeguards.h screenshot_gui.cpp @@ -334,6 +350,7 @@ add_files( screenshot.cpp screenshot.h settings.cpp + settings_cmd.h settings_func.h settings_gui.cpp settings_gui.h @@ -343,6 +360,7 @@ add_files( settings_type.h ship.h ship_cmd.cpp + ship_cmd.h ship_gui.cpp signal.cpp signal_func.h @@ -350,6 +368,7 @@ add_files( signs.cpp signs_base.h signs_cmd.cpp + signs_cmd.h signs_func.h signs_gui.cpp signs_type.h @@ -368,6 +387,7 @@ add_files( station.cpp station_base.h station_cmd.cpp + station_cmd.h station_func.h station_gui.cpp station_gui.h @@ -379,6 +399,7 @@ add_files( stdafx.h story.cpp story_base.h + story_cmd.h story_gui.cpp story_type.h strgen/strgen.h @@ -393,11 +414,13 @@ add_files( strings_type.h subsidy.cpp subsidy_base.h + subsidy_cmd.h subsidy_func.h subsidy_gui.cpp subsidy_type.h tar_type.h terraform_cmd.cpp + terraform_cmd.h terraform_gui.cpp terraform_gui.h textbuf.cpp @@ -422,11 +445,13 @@ add_files( tilematrix_type.hpp timetable.h timetable_cmd.cpp + timetable_cmd.h timetable_gui.cpp toolbar_gui.cpp toolbar_gui.h town.h town_cmd.cpp + town_cmd.h town_gui.cpp town_kdtree.h town_map.h @@ -438,22 +463,26 @@ add_files( track_type.h train.h train_cmd.cpp + train_cmd.h train_gui.cpp transparency.h transparency_gui.cpp transparency_gui.h transport_type.h tree_cmd.cpp + tree_cmd.h tree_gui.cpp tree_map.h tunnel_map.cpp tunnel_map.h tunnelbridge.h tunnelbridge_cmd.cpp + tunnelbridge_cmd.h tunnelbridge_map.h vehicle.cpp vehicle_base.h vehicle_cmd.cpp + vehicle_cmd.h vehicle_func.h vehicle_gui.cpp vehicle_gui.h @@ -462,6 +491,7 @@ add_files( vehiclelist.cpp vehiclelist.h viewport.cpp + viewport_cmd.h viewport_func.h viewport_gui.cpp viewport_kdtree.h @@ -472,10 +502,12 @@ add_files( walltime_func.h water.h water_cmd.cpp + water_cmd.h water_map.h waypoint.cpp waypoint_base.h waypoint_cmd.cpp + waypoint_cmd.h waypoint_func.h waypoint_gui.cpp widget.cpp diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 1f52bbecd2..2d9b2ae16a 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -37,6 +37,7 @@ #include "disaster_vehicle.h" #include "newgrf_airporttiles.h" #include "framerate_type.h" +#include "aircraft_cmd.h" #include "table/strings.h" diff --git a/src/aircraft_cmd.h b/src/aircraft_cmd.h new file mode 100644 index 0000000000..769a707c73 --- /dev/null +++ b/src/aircraft_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 aircraft_cmd.h Command definitions related to aircraft. */ + +#ifndef AIRCRAFT_CMD_H +#define AIRCRAFT_CMD_H + +#include "command_type.h" +#include "engine_type.h" +#include "vehicle_type.h" + +CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); + +#endif /* AIRCRAFT_CMD_H */ diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 2602d86ada..db14a4a1d4 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -22,6 +22,7 @@ #include "ai/ai.hpp" #include "news_func.h" #include "strings_func.h" +#include "autoreplace_cmd.h" #include "table/strings.h" diff --git a/src/autoreplace_cmd.h b/src/autoreplace_cmd.h new file mode 100644 index 0000000000..14088d6dc5 --- /dev/null +++ b/src/autoreplace_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 autoreplace_cmd.h Command definitions related to autoreplace. */ + +#ifndef AUTOREPLACE_CMD_H +#define AUTOREPLACE_CMD_H + +#include "command_type.h" + +CommandProc CmdAutoreplaceVehicle; +CommandProc CmdSetAutoReplace; + +DEF_CMD_TRAIT(CMD_AUTOREPLACE_VEHICLE, CmdAutoreplaceVehicle, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_AUTOREPLACE, CmdSetAutoReplace, 0, CMDT_VEHICLE_MANAGEMENT) + +#endif /* AUTOREPLACE_CMD_H */ diff --git a/src/command.cpp b/src/command.cpp index 449fdece28..b875884f97 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -24,187 +24,66 @@ #include "signal_func.h" #include "core/backup_type.hpp" #include "object_base.h" +#include "autoreplace_cmd.h" +#include "company_cmd.h" +#include "depot_cmd.h" +#include "economy_cmd.h" +#include "engine_cmd.h" +#include "goal_cmd.h" +#include "group_cmd.h" +#include "industry_cmd.h" +#include "landscape_cmd.h" +#include "misc_cmd.h" +#include "news_cmd.h" +#include "object_cmd.h" +#include "order_cmd.h" +#include "rail_cmd.h" +#include "road_cmd.h" +#include "roadveh_cmd.h" +#include "settings_cmd.h" +#include "signs_cmd.h" +#include "station_cmd.h" +#include "story_cmd.h" +#include "subsidy_cmd.h" +#include "terraform_cmd.h" +#include "timetable_cmd.h" +#include "town_cmd.h" +#include "train_cmd.h" +#include "tree_cmd.h" +#include "tunnelbridge_cmd.h" +#include "vehicle_cmd.h" +#include "viewport_cmd.h" +#include "water_cmd.h" +#include "waypoint_cmd.h" + +#include #include "table/strings.h" #include "safeguards.h" -CommandProc CmdBuildRailroadTrack; -CommandProc CmdRemoveRailroadTrack; -CommandProc CmdBuildSingleRail; -CommandProc CmdRemoveSingleRail; -CommandProc CmdLandscapeClear; +/** + * Define a command with the flags which belongs to it. + * + * This struct connects a command handler function with the flags created with + * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values. + */ +struct CommandInfo { + CommandProc *proc; ///< The procedure to actually executing + const char *name; ///< A human readable name for the procedure + CommandFlags flags; ///< The (command) flags to that apply to this command + CommandType type; ///< The type of command. +}; +/* Helpers to generate the master command table from the command traits. */ -CommandProc CmdBuildBridge; +template +inline constexpr CommandInfo CommandFromTrait() noexcept { return { T::proc, T::name, T::flags, T::type }; }; -CommandProc CmdBuildRailStation; -CommandProc CmdRemoveFromRailStation; -CommandProc CmdConvertRail; - -CommandProc CmdBuildSingleSignal; -CommandProc CmdRemoveSingleSignal; - -CommandProc CmdTerraformLand; - -CommandProc CmdBuildObject; -CommandProc CmdSellLandArea; - -CommandProc CmdBuildTunnel; - -CommandProc CmdBuildTrainDepot; -CommandProc CmdBuildRailWaypoint; -CommandProc CmdRenameWaypoint; -CommandProc CmdRemoveFromRailWaypoint; - -CommandProc CmdBuildRoadStop; -CommandProc CmdRemoveRoadStop; - -CommandProc CmdBuildLongRoad; -CommandProc CmdRemoveLongRoad; -CommandProc CmdBuildRoad; - -CommandProc CmdBuildRoadDepot; - -CommandProc CmdConvertRoad; - -CommandProc CmdBuildAirport; - -CommandProc CmdBuildDock; - -CommandProc CmdBuildShipDepot; - -CommandProc CmdBuildBuoy; - -CommandProc CmdPlantTree; - -CommandProc CmdMoveRailVehicle; - -CommandProc CmdBuildVehicle; -CommandProc CmdSellVehicle; -CommandProc CmdRefitVehicle; -CommandProc CmdSendVehicleToDepot; -CommandProc CmdSetVehicleVisibility; - -CommandProc CmdForceTrainProceed; -CommandProc CmdReverseTrainDirection; - -CommandProc CmdClearOrderBackup; -CommandProc CmdModifyOrder; -CommandProc CmdSkipToOrder; -CommandProc CmdDeleteOrder; -CommandProc CmdInsertOrder; -CommandProc CmdChangeServiceInt; - -CommandProc CmdBuildIndustry; -CommandProc CmdIndustryCtrl; - -CommandProc CmdSetCompanyManagerFace; -CommandProc CmdSetCompanyColour; - -CommandProc CmdIncreaseLoan; -CommandProc CmdDecreaseLoan; - -CommandProc CmdWantEnginePreview; -CommandProc CmdEngineCtrl; - -CommandProc CmdRenameVehicle; -CommandProc CmdRenameEngine; - -CommandProc CmdRenameCompany; -CommandProc CmdRenamePresident; - -CommandProc CmdRenameStation; -CommandProc CmdRenameDepot; - -CommandProc CmdPlaceSign; -CommandProc CmdRenameSign; - -CommandProc CmdTurnRoadVeh; - -CommandProc CmdPause; - -CommandProc CmdBuyShareInCompany; -CommandProc CmdSellShareInCompany; -CommandProc CmdBuyCompany; - -CommandProc CmdFoundTown; -CommandProc CmdRenameTown; -CommandProc CmdDoTownAction; -CommandProc CmdTownGrowthRate; -CommandProc CmdTownRating; -CommandProc CmdTownCargoGoal; -CommandProc CmdTownSetText; -CommandProc CmdExpandTown; -CommandProc CmdDeleteTown; - -CommandProc CmdChangeSetting; -CommandProc CmdChangeCompanySetting; - -CommandProc CmdOrderRefit; -CommandProc CmdCloneOrder; - -CommandProc CmdClearArea; - -CommandProc CmdGiveMoney; -CommandProc CmdMoneyCheat; -CommandProc CmdChangeBankBalance; -CommandProc CmdBuildCanal; -CommandProc CmdBuildLock; - -CommandProc CmdCreateSubsidy; -CommandProc CmdCompanyCtrl; -CommandProc CmdCustomNewsItem; -CommandProc CmdCreateGoal; -CommandProc CmdRemoveGoal; -CommandProc CmdSetGoalText; -CommandProc CmdSetGoalProgress; -CommandProc CmdSetGoalCompleted; -CommandProc CmdGoalQuestion; -CommandProc CmdGoalQuestionAnswer; -CommandProc CmdCreateStoryPage; -CommandProc CmdCreateStoryPageElement; -CommandProc CmdUpdateStoryPageElement; -CommandProc CmdSetStoryPageTitle; -CommandProc CmdSetStoryPageDate; -CommandProc CmdShowStoryPage; -CommandProc CmdRemoveStoryPage; -CommandProc CmdRemoveStoryPageElement; -CommandProc CmdScrollViewport; -CommandProc CmdStoryPageButton; - -CommandProc CmdLevelLand; - -CommandProc CmdBuildSignalTrack; -CommandProc CmdRemoveSignalTrack; - -CommandProc CmdSetAutoReplace; - -CommandProc CmdCloneVehicle; -CommandProc CmdStartStopVehicle; -CommandProc CmdMassStartStopVehicle; -CommandProc CmdAutoreplaceVehicle; -CommandProc CmdDepotSellAllVehicles; -CommandProc CmdDepotMassAutoReplace; - -CommandProc CmdCreateGroup; -CommandProc CmdAlterGroup; -CommandProc CmdDeleteGroup; -CommandProc CmdAddVehicleGroup; -CommandProc CmdAddSharedVehicleGroup; -CommandProc CmdRemoveAllVehiclesGroup; -CommandProc CmdSetGroupFlag; -CommandProc CmdSetGroupLivery; - -CommandProc CmdMoveOrder; -CommandProc CmdChangeTimetable; -CommandProc CmdSetVehicleOnTime; -CommandProc CmdAutofillTimetable; -CommandProc CmdSetTimetableStart; - -CommandProc CmdOpenCloseAirport; - -#define DEF_CMD(proc, flags, type) {proc, #proc, (CommandFlags)flags, type} +template +inline constexpr auto MakeCommandsFromTraits(std::integer_sequence) noexcept { + return std::array{{ CommandFromTrait(i)>>()... }}; +} /** * The master command table @@ -213,162 +92,8 @@ CommandProc CmdOpenCloseAirport; * the flags which belongs to it. The indices are the same * as the value from the CMD_* enums. */ -static const Command _command_proc_table[] = { - DEF_CMD(CmdBuildRailroadTrack, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_RAILROAD_TRACK - DEF_CMD(CmdRemoveRailroadTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_RAILROAD_TRACK - DEF_CMD(CmdBuildSingleRail, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_SINGLE_RAIL - DEF_CMD(CmdRemoveSingleRail, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_SINGLE_RAIL - DEF_CMD(CmdLandscapeClear, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_LANDSCAPE_CLEAR - DEF_CMD(CmdBuildBridge, CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_BRIDGE - DEF_CMD(CmdBuildRailStation, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_RAIL_STATION - DEF_CMD(CmdBuildTrainDepot, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_TRAIN_DEPOT - DEF_CMD(CmdBuildSingleSignal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_SIGNALS - DEF_CMD(CmdRemoveSingleSignal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_SIGNALS - DEF_CMD(CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_TERRAFORM_LAND - DEF_CMD(CmdBuildObject, CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_OBJECT - DEF_CMD(CmdBuildTunnel, CMD_DEITY | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_TUNNEL - DEF_CMD(CmdRemoveFromRailStation, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_FROM_RAIL_STATION - DEF_CMD(CmdConvertRail, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_CONVERT_RAILD - DEF_CMD(CmdBuildRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_RAIL_WAYPOINT - DEF_CMD(CmdRenameWaypoint, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_WAYPOINT - DEF_CMD(CmdRemoveFromRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_FROM_RAIL_WAYPOINT +static constexpr auto _command_proc_table = MakeCommandsFromTraits(std::make_integer_sequence, CMD_END>{}); - DEF_CMD(CmdBuildRoadStop, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_ROAD_STOP - DEF_CMD(CmdRemoveRoadStop, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_ROAD_STOP - DEF_CMD(CmdBuildLongRoad,CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_LONG_ROAD - DEF_CMD(CmdRemoveLongRoad, CMD_NO_TEST | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_LONG_ROAD; towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed. - DEF_CMD(CmdBuildRoad, CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_ROAD - DEF_CMD(CmdBuildRoadDepot, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_ROAD_DEPOT - DEF_CMD(CmdConvertRoad, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_CONVERT_ROAD - - DEF_CMD(CmdBuildAirport, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_AIRPORT - DEF_CMD(CmdBuildDock, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_DOCK - DEF_CMD(CmdBuildShipDepot, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_SHIP_DEPOT - DEF_CMD(CmdBuildBuoy, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_BUOY - DEF_CMD(CmdPlantTree, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_PLANT_TREE - - DEF_CMD(CmdBuildVehicle, CMD_CLIENT_ID, CMDT_VEHICLE_CONSTRUCTION ), // CMD_BUILD_VEHICLE - DEF_CMD(CmdSellVehicle, CMD_CLIENT_ID, CMDT_VEHICLE_CONSTRUCTION ), // CMD_SELL_VEHICLE - DEF_CMD(CmdRefitVehicle, 0, CMDT_VEHICLE_CONSTRUCTION ), // CMD_REFIT_VEHICLE - DEF_CMD(CmdSendVehicleToDepot, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_SEND_VEHICLE_TO_DEPOT - DEF_CMD(CmdSetVehicleVisibility, 0, CMDT_COMPANY_SETTING ), // CMD_SET_VEHICLE_VISIBILITY - - DEF_CMD(CmdMoveRailVehicle, 0, CMDT_VEHICLE_CONSTRUCTION ), // CMD_MOVE_RAIL_VEHICLE - DEF_CMD(CmdForceTrainProceed, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_FORCE_TRAIN_PROCEED - DEF_CMD(CmdReverseTrainDirection, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_REVERSE_TRAIN_DIRECTION - - DEF_CMD(CmdClearOrderBackup, CMD_CLIENT_ID, CMDT_SERVER_SETTING ), // CMD_CLEAR_ORDER_BACKUP - DEF_CMD(CmdModifyOrder, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_MODIFY_ORDER - DEF_CMD(CmdSkipToOrder, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SKIP_TO_ORDER - DEF_CMD(CmdDeleteOrder, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_DELETE_ORDER - DEF_CMD(CmdInsertOrder, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_INSERT_ORDER - - DEF_CMD(CmdChangeServiceInt, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_CHANGE_SERVICE_INT - - DEF_CMD(CmdBuildIndustry, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_INDUSTRY - DEF_CMD(CmdIndustryCtrl, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_INDUSTRY_CTRL - - DEF_CMD(CmdSetCompanyManagerFace, 0, CMDT_OTHER_MANAGEMENT ), // CMD_SET_COMPANY_MANAGER_FACE - DEF_CMD(CmdSetCompanyColour, 0, CMDT_OTHER_MANAGEMENT ), // CMD_SET_COMPANY_COLOUR - - DEF_CMD(CmdIncreaseLoan, 0, CMDT_MONEY_MANAGEMENT ), // CMD_INCREASE_LOAN - DEF_CMD(CmdDecreaseLoan, 0, CMDT_MONEY_MANAGEMENT ), // CMD_DECREASE_LOAN - - DEF_CMD(CmdWantEnginePreview, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_WANT_ENGINE_PREVIEW - DEF_CMD(CmdEngineCtrl, CMD_DEITY, CMDT_VEHICLE_MANAGEMENT ), // CMD_ENGINE_CTRL - - DEF_CMD(CmdRenameVehicle, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_VEHICLE - DEF_CMD(CmdRenameEngine, CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_ENGINE - - DEF_CMD(CmdRenameCompany, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_COMPANY - DEF_CMD(CmdRenamePresident, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_PRESIDENT - - DEF_CMD(CmdRenameStation, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_STATION - DEF_CMD(CmdRenameDepot, 0, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_DEPOT - - DEF_CMD(CmdPlaceSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_PLACE_SIGN - DEF_CMD(CmdRenameSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_SIGN - - DEF_CMD(CmdTurnRoadVeh, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_TURN_ROADVEH - - DEF_CMD(CmdPause, CMD_SERVER | CMD_NO_EST, CMDT_SERVER_SETTING ), // CMD_PAUSE - - DEF_CMD(CmdBuyShareInCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_BUY_SHARE_IN_COMPANY - DEF_CMD(CmdSellShareInCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_SELL_SHARE_IN_COMPANY - DEF_CMD(CmdBuyCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_BUY_COMANY - - DEF_CMD(CmdFoundTown, CMD_DEITY | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_FOUND_TOWN; founding random town can fail only in exec run - DEF_CMD(CmdRenameTown, CMD_DEITY | CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_TOWN - DEF_CMD(CmdDoTownAction, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_DO_TOWN_ACTION - DEF_CMD(CmdTownCargoGoal, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_TOWN_CARGO_GOAL - DEF_CMD(CmdTownGrowthRate, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_TOWN_GROWTH_RATE - DEF_CMD(CmdTownRating, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_TOWN_RATING - DEF_CMD(CmdTownSetText, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_TOWN_SET_TEXT - DEF_CMD(CmdExpandTown, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_EXPAND_TOWN - DEF_CMD(CmdDeleteTown, CMD_OFFLINE, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_DELETE_TOWN - - DEF_CMD(CmdOrderRefit, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_ORDER_REFIT - DEF_CMD(CmdCloneOrder, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_CLONE_ORDER - - DEF_CMD(CmdClearArea, CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_CLEAR_AREA; destroying multi-tile houses makes town rating differ between test and execution - - DEF_CMD(CmdMoneyCheat, CMD_OFFLINE, CMDT_CHEAT ), // CMD_MONEY_CHEAT - DEF_CMD(CmdChangeBankBalance, CMD_DEITY, CMDT_MONEY_MANAGEMENT ), // CMD_CHANGE_BANK_BALANCE - DEF_CMD(CmdBuildCanal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_CANAL - DEF_CMD(CmdCreateSubsidy, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_CREATE_SUBSIDY - DEF_CMD(CmdCompanyCtrl, CMD_SPECTATOR | CMD_CLIENT_ID | CMD_NO_EST, CMDT_SERVER_SETTING ), // CMD_COMPANY_CTRL - DEF_CMD(CmdCustomNewsItem, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_CUSTOM_NEWS_ITEM - DEF_CMD(CmdCreateGoal, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_CREATE_GOAL - DEF_CMD(CmdRemoveGoal, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_GOAL - DEF_CMD(CmdSetGoalText, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SET_GOAL_TEXT - DEF_CMD(CmdSetGoalProgress, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SET_GOAL_PROGRESS - DEF_CMD(CmdSetGoalCompleted, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SET_GOAL_COMPLETED - DEF_CMD(CmdGoalQuestion, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_GOAL_QUESTION - DEF_CMD(CmdGoalQuestionAnswer, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_GOAL_QUESTION_ANSWER - DEF_CMD(CmdCreateStoryPage, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_CREATE_STORY_PAGE - DEF_CMD(CmdCreateStoryPageElement, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_CREATE_STORY_PAGE_ELEMENT - DEF_CMD(CmdUpdateStoryPageElement, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_UPDATE_STORY_PAGE_ELEMENT - DEF_CMD(CmdSetStoryPageTitle, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SET_STORY_PAGE_TITLE - DEF_CMD(CmdSetStoryPageDate, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SET_STORY_PAGE_DATE - DEF_CMD(CmdShowStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SHOW_STORY_PAGE - DEF_CMD(CmdRemoveStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_STORY_PAGE - DEF_CMD(CmdRemoveStoryPageElement, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_STORY_ELEMENT_PAGE - DEF_CMD(CmdScrollViewport, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SCROLL_VIEWPORT - DEF_CMD(CmdStoryPageButton, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_STORY_PAGE_BUTTON - - DEF_CMD(CmdLevelLand, CMD_ALL_TILES | CMD_NO_TEST | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once - - DEF_CMD(CmdBuildLock, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_LOCK - - DEF_CMD(CmdBuildSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_SIGNAL_TRACK - DEF_CMD(CmdRemoveSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_SIGNAL_TRACK - - DEF_CMD(CmdGiveMoney, 0, CMDT_MONEY_MANAGEMENT ), // CMD_GIVE_MONEY - DEF_CMD(CmdChangeSetting, CMD_SERVER, CMDT_SERVER_SETTING ), // CMD_CHANGE_SETTING - DEF_CMD(CmdChangeCompanySetting, 0, CMDT_COMPANY_SETTING ), // CMD_CHANGE_COMPANY_SETTING - DEF_CMD(CmdSetAutoReplace, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_SET_AUTOREPLACE - DEF_CMD(CmdCloneVehicle, CMD_NO_TEST, CMDT_VEHICLE_CONSTRUCTION ), // CMD_CLONE_VEHICLE; NewGRF callbacks influence building and refitting making it impossible to correctly estimate the cost - DEF_CMD(CmdStartStopVehicle, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_START_STOP_VEHICLE - DEF_CMD(CmdMassStartStopVehicle, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_MASS_START_STOP - DEF_CMD(CmdAutoreplaceVehicle, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_AUTOREPLACE_VEHICLE - DEF_CMD(CmdDepotSellAllVehicles, 0, CMDT_VEHICLE_CONSTRUCTION ), // CMD_DEPOT_SELL_ALL_VEHICLES - DEF_CMD(CmdDepotMassAutoReplace, 0, CMDT_VEHICLE_CONSTRUCTION ), // CMD_DEPOT_MASS_AUTOREPLACE - DEF_CMD(CmdCreateGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_CREATE_GROUP - DEF_CMD(CmdDeleteGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_DELETE_GROUP - DEF_CMD(CmdAlterGroup, 0, CMDT_OTHER_MANAGEMENT ), // CMD_ALTER_GROUP - DEF_CMD(CmdAddVehicleGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_ADD_VEHICLE_GROUP - DEF_CMD(CmdAddSharedVehicleGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_ADD_SHARE_VEHICLE_GROUP - DEF_CMD(CmdRemoveAllVehiclesGroup, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_REMOVE_ALL_VEHICLES_GROUP - DEF_CMD(CmdSetGroupFlag, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_GROUP_FLAG - DEF_CMD(CmdSetGroupLivery, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_GROUP_LIVERY - DEF_CMD(CmdMoveOrder, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_MOVE_ORDER - DEF_CMD(CmdChangeTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_CHANGE_TIMETABLE - DEF_CMD(CmdSetVehicleOnTime, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_VEHICLE_ON_TIME - DEF_CMD(CmdAutofillTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOFILL_TIMETABLE - DEF_CMD(CmdSetTimetableStart, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_TIMETABLE_START - - DEF_CMD(CmdOpenCloseAirport, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_OPEN_CLOSE_AIRPORT -}; /*! * This function range-checks a cmd, and checks if the cmd is not nullptr @@ -376,9 +101,9 @@ static const Command _command_proc_table[] = { * @param cmd The integer value of a command * @return true if the command is valid (and got a CommandProc function) */ -bool IsValidCommand(uint32 cmd) +bool IsValidCommand(Commands cmd) { - return cmd < lengthof(_command_proc_table) && _command_proc_table[cmd].proc != nullptr; + return cmd < _command_proc_table.size() && _command_proc_table[cmd].proc != nullptr; } /*! @@ -414,7 +139,7 @@ const char *GetCommandName(Commands cmd) * @param cmd The command to check. * @return True if the command is allowed while paused, false otherwise. */ -bool IsCommandAllowedWhilePaused(uint32 cmd) +bool IsCommandAllowedWhilePaused(Commands cmd) { /* Lookup table for the command types that are allowed for a given pause level setting. */ static const int command_type_lookup[] = { @@ -704,7 +429,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba _additional_cash_required = 0; /* Get pointer to command handler */ - assert(cmd < lengthof(_command_proc_table)); + assert(cmd < _command_proc_table.size()); CommandProc *proc = _command_proc_table[cmd].proc; /* Shouldn't happen, but you never know when someone adds * NULLs to the _command_proc_table. */ diff --git a/src/command_func.h b/src/command_func.h index 662ae00a5c..15c88ea034 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -47,11 +47,11 @@ void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *cal extern Money _additional_cash_required; -bool IsValidCommand(uint32 cmd); +bool IsValidCommand(Commands cmd); CommandFlags GetCommandFlags(Commands cmd); const char *GetCommandName(Commands cmd); Money GetAvailableMoneyForCommand(); -bool IsCommandAllowedWhilePaused(uint32 cmd); +bool IsCommandAllowedWhilePaused(Commands cmd); /** * Extracts the DC flags needed for DoCommand from the flags returned by GetCommandFlags diff --git a/src/command_type.h b/src/command_type.h index 972db596ea..ecb24df125 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -423,18 +423,17 @@ enum CommandPauseLevel { */ typedef CommandCost CommandProc(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text); -/** - * Define a command with the flags which belongs to it. - * - * This struct connect a command handler function with the flags created with - * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values. - */ -struct Command { - CommandProc *proc; ///< The procedure to actually executing - const char *name; ///< A human readable name for the procedure - CommandFlags flags; ///< The (command) flags to that apply to this command - CommandType type; ///< The type of command. -}; + +/** Defines the traits of a command. */ +template struct CommandTraits; + +#define DEF_CMD_TRAIT(cmd_, proc_, flags_, type_) \ + template<> struct CommandTraits { \ + static constexpr auto &proc = proc_; \ + static constexpr CommandFlags flags = (CommandFlags)(flags_); \ + static constexpr CommandType type = type_; \ + static inline constexpr const char *name = #proc_; \ + }; /** * Define a callback function for the client, after the command is finished. diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 792dd624b2..f18fe343ad 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -36,6 +36,7 @@ #include "goal_base.h" #include "story_base.h" #include "widgets/statusbar_widget.h" +#include "company_cmd.h" #include "table/strings.h" diff --git a/src/company_cmd.h b/src/company_cmd.h new file mode 100644 index 0000000000..0d3e2d2fd6 --- /dev/null +++ b/src/company_cmd.h @@ -0,0 +1,29 @@ +/* + * 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 company_cmd.h Command definitions related to companies. */ + +#ifndef COMPANY_CMD_H +#define COMPANY_CMD_H + +#include "command_type.h" + +CommandProc CmdCompanyCtrl; +CommandProc CmdGiveMoney; +CommandProc CmdRenameCompany; +CommandProc CmdRenamePresident; +CommandProc CmdSetCompanyManagerFace; +CommandProc CmdSetCompanyColour; + +DEF_CMD_TRAIT(CMD_COMPANY_CTRL, CmdCompanyCtrl, CMD_SPECTATOR | CMD_CLIENT_ID | CMD_NO_EST, CMDT_SERVER_SETTING) +DEF_CMD_TRAIT(CMD_GIVE_MONEY, CmdGiveMoney, 0, CMDT_MONEY_MANAGEMENT) +DEF_CMD_TRAIT(CMD_RENAME_COMPANY, CmdRenameCompany, 0, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_RENAME_PRESIDENT, CmdRenamePresident, 0, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_COMPANY_MANAGER_FACE, CmdSetCompanyManagerFace, 0, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_COMPANY_COLOUR, CmdSetCompanyColour, 0, CMDT_OTHER_MANAGEMENT) + +#endif /* COMPANY_CMD_H */ diff --git a/src/depot_cmd.cpp b/src/depot_cmd.cpp index 6f5ddda27e..e49936f552 100644 --- a/src/depot_cmd.cpp +++ b/src/depot_cmd.cpp @@ -16,6 +16,7 @@ #include "vehicle_gui.h" #include "vehiclelist.h" #include "window_func.h" +#include "depot_cmd.h" #include "table/strings.h" diff --git a/src/depot_cmd.h b/src/depot_cmd.h new file mode 100644 index 0000000000..9c39db1e2e --- /dev/null +++ b/src/depot_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 depot_cmd.h Command definitions related to depots. */ + +#ifndef DEPOT_CMD_H +#define DEPOT_CMD_H + +#include "command_type.h" + +CommandProc CmdRenameDepot; + +DEF_CMD_TRAIT(CMD_RENAME_DEPOT, CmdRenameDepot, 0, CMDT_OTHER_MANAGEMENT) + +#endif /* DEPOT_CMD_H */ diff --git a/src/economy.cpp b/src/economy.cpp index 3beeb25f58..329a0a5a81 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -48,6 +48,7 @@ #include "goal_base.h" #include "story_base.h" #include "linkgraph/refresh.h" +#include "economy_cmd.h" #include "table/strings.h" #include "table/pricebase.h" diff --git a/src/economy_cmd.h b/src/economy_cmd.h new file mode 100644 index 0000000000..f182af81f2 --- /dev/null +++ b/src/economy_cmd.h @@ -0,0 +1,23 @@ +/* + * 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 economy_cmd.h Command definitions related to the economy. */ + +#ifndef ECONOMY_CMD_H +#define ECONOMY_CMD_H + +#include "command_type.h" + +CommandProc CmdBuyShareInCompany; +CommandProc CmdSellShareInCompany; +CommandProc CmdBuyCompany; + +DEF_CMD_TRAIT(CMD_BUY_SHARE_IN_COMPANY, CmdBuyShareInCompany, 0, CMDT_MONEY_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SELL_SHARE_IN_COMPANY, CmdSellShareInCompany, 0, CMDT_MONEY_MANAGEMENT) +DEF_CMD_TRAIT(CMD_BUY_COMPANY, CmdBuyCompany, 0, CMDT_MONEY_MANAGEMENT) + +#endif /* ECONOMY_CMD_H */ diff --git a/src/engine.cpp b/src/engine.cpp index f330cf6048..56f81ffce9 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -29,6 +29,7 @@ #include "vehicle_func.h" #include "articulated_vehicles.h" #include "error.h" +#include "engine_base.h" #include "table/strings.h" #include "table/engines.h" diff --git a/src/engine_cmd.h b/src/engine_cmd.h new file mode 100644 index 0000000000..3ed47e8051 --- /dev/null +++ b/src/engine_cmd.h @@ -0,0 +1,25 @@ +/* + * 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 engine_cmd.h Command definitions related to engines. */ + +#ifndef ENGINE_CMD_H +#define ENGINE_CMD_H + +#include "command_type.h" + +CommandProc CmdWantEnginePreview; +CommandProc CmdEngineCtrl; +CommandProc CmdRenameEngine; +CommandProc CmdSetVehicleVisibility; + +DEF_CMD_TRAIT(CMD_WANT_ENGINE_PREVIEW, CmdWantEnginePreview, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_ENGINE_CTRL, CmdEngineCtrl, CMD_DEITY, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_RENAME_ENGINE, CmdRenameEngine, CMD_SERVER, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_VEHICLE_VISIBILITY, CmdSetVehicleVisibility, 0, CMDT_COMPANY_SETTING) + +#endif /* ENGINE_CMD_H */ diff --git a/src/goal.cpp b/src/goal.cpp index c611650597..7c24386d18 100644 --- a/src/goal.cpp +++ b/src/goal.cpp @@ -23,6 +23,7 @@ #include "network/network.h" #include "network/network_base.h" #include "network/network_func.h" +#include "goal_cmd.h" #include "safeguards.h" diff --git a/src/goal_cmd.h b/src/goal_cmd.h new file mode 100644 index 0000000000..3b047f11ac --- /dev/null +++ b/src/goal_cmd.h @@ -0,0 +1,31 @@ +/* + * 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 goal_cmd.h Command definitions related to goals. */ + +#ifndef GOAL_CMD_H +#define GOAL_CMD_H + +#include "command_type.h" + +CommandProc CmdCreateGoal; +CommandProc CmdRemoveGoal; +CommandProc CmdSetGoalText; +CommandProc CmdSetGoalProgress; +CommandProc CmdSetGoalCompleted; +CommandProc CmdGoalQuestion; +CommandProc CmdGoalQuestionAnswer; + +DEF_CMD_TRAIT(CMD_CREATE_GOAL, CmdCreateGoal, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_REMOVE_GOAL, CmdRemoveGoal, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_GOAL_TEXT, CmdSetGoalText, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_GOAL_PROGRESS, CmdSetGoalProgress, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_GOAL_COMPLETED, CmdSetGoalCompleted, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_GOAL_QUESTION, CmdGoalQuestion, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_GOAL_QUESTION_ANSWER, CmdGoalQuestionAnswer, CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* GOAL_CMD_H */ diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index ec4358f765..8b67fbeae8 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -19,6 +19,7 @@ #include "company_func.h" #include "core/pool_func.hpp" #include "order_backup.h" +#include "group_cmd.h" #include "table/strings.h" diff --git a/src/group_cmd.h b/src/group_cmd.h new file mode 100644 index 0000000000..a58a6f8aa5 --- /dev/null +++ b/src/group_cmd.h @@ -0,0 +1,33 @@ +/* + * 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 group_cmd.h Command definitions related to engine groups. */ + +#ifndef GROUP_CMD_H +#define GROUP_CMD_H + +#include "command_type.h" + +CommandProc CmdCreateGroup; +CommandProc CmdAlterGroup; +CommandProc CmdDeleteGroup; +CommandProc CmdAddVehicleGroup; +CommandProc CmdAddSharedVehicleGroup; +CommandProc CmdRemoveAllVehiclesGroup; +CommandProc CmdSetGroupFlag; +CommandProc CmdSetGroupLivery; + +DEF_CMD_TRAIT(CMD_CREATE_GROUP, CmdCreateGroup, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_DELETE_GROUP, CmdDeleteGroup, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_ALTER_GROUP, CmdAlterGroup, 0, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_ADD_VEHICLE_GROUP, CmdAddVehicleGroup, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_ADD_SHARED_VEHICLE_GROUP, CmdAddSharedVehicleGroup, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_REMOVE_ALL_VEHICLES_GROUP, CmdRemoveAllVehiclesGroup, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_GROUP_FLAG, CmdSetGroupFlag, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_GROUP_LIVERY, CmdSetGroupLivery, 0, CMDT_ROUTE_MANAGEMENT) + +#endif /* GROUP_CMD_H */ diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 529e01edbe..a24f35f756 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -42,6 +42,7 @@ #include "error.h" #include "cmd_helper.h" #include "string_func.h" +#include "industry_cmd.h" #include "table/strings.h" #include "table/industry_land.h" diff --git a/src/industry_cmd.h b/src/industry_cmd.h new file mode 100644 index 0000000000..e1f18932a9 --- /dev/null +++ b/src/industry_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 industry_cmd.h Command definitions related to industries. */ + +#ifndef INDUSTRY_CMD_H +#define INDUSTRY_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildIndustry; +CommandProc CmdIndustryCtrl; + +DEF_CMD_TRAIT(CMD_BUILD_INDUSTRY, CmdBuildIndustry, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_INDUSTRY_CTRL, CmdIndustryCtrl, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) + +#endif /* INDUSTRY_CMD_H */ diff --git a/src/landscape.cpp b/src/landscape.cpp index 242ee089ac..1cc3b1ad20 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -31,6 +31,7 @@ #include "pathfinder/npf/aystar.h" #include "saveload/saveload.h" #include "framerate_type.h" +#include "landscape_cmd.h" #include #include #include diff --git a/src/landscape_cmd.h b/src/landscape_cmd.h new file mode 100644 index 0000000000..f3b6fd3fca --- /dev/null +++ b/src/landscape_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 landscape_cmd.h Command definitions related to landscape (slopes etc.). */ + +#ifndef LANDSCAPE_CMD_H +#define LANDSCAPE_CMD_H + +#include "command_type.h" + +CommandProc CmdLandscapeClear; +CommandProc CmdClearArea; + +DEF_CMD_TRAIT(CMD_LANDSCAPE_CLEAR, CmdLandscapeClear, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_CLEAR_AREA, CmdClearArea, CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // destroying multi-tile houses makes town rating differ between test and execution + +#endif /* LANDSCAPE_CMD_H */ diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index c461d36dc8..2e70f5fdd3 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -22,6 +22,7 @@ #include "tile_map.h" #include "texteff.hpp" #include "core/backup_type.hpp" +#include "misc_cmd.h" #include "table/strings.h" diff --git a/src/misc_cmd.h b/src/misc_cmd.h new file mode 100644 index 0000000000..6827db3ac2 --- /dev/null +++ b/src/misc_cmd.h @@ -0,0 +1,27 @@ +/* + * 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 misc_cmd.h Miscellaneous command definitions. */ + +#ifndef MISC_CMD_H +#define MISC_CMD_H + +#include "command_type.h" + +CommandProc CmdMoneyCheat; +CommandProc CmdChangeBankBalance; +CommandProc CmdIncreaseLoan; +CommandProc CmdDecreaseLoan; +CommandProc CmdPause; + +DEF_CMD_TRAIT(CMD_MONEY_CHEAT, CmdMoneyCheat, CMD_OFFLINE, CMDT_CHEAT) +DEF_CMD_TRAIT(CMD_CHANGE_BANK_BALANCE, CmdChangeBankBalance, CMD_DEITY, CMDT_MONEY_MANAGEMENT) +DEF_CMD_TRAIT(CMD_INCREASE_LOAN, CmdIncreaseLoan, 0, CMDT_MONEY_MANAGEMENT) +DEF_CMD_TRAIT(CMD_DECREASE_LOAN, CmdDecreaseLoan, 0, CMDT_MONEY_MANAGEMENT) +DEF_CMD_TRAIT(CMD_PAUSE, CmdPause, CMD_SERVER | CMD_NO_EST, CMDT_SERVER_SETTING) + +#endif /* MISC_CMD_H */ diff --git a/src/news_cmd.h b/src/news_cmd.h new file mode 100644 index 0000000000..4a75037b3b --- /dev/null +++ b/src/news_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 news_cmd.h Command definitions related to news messages. */ + +#ifndef NEWS_CMD_H +#define NEWS_CMD_H + +#include "command_type.h" + +CommandProc CmdCustomNewsItem; + +DEF_CMD_TRAIT(CMD_CUSTOM_NEWS_ITEM, CmdCustomNewsItem, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* NEWS_CMD_H */ diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 10a49b62e8..3f3b918671 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -35,6 +35,7 @@ #include "guitimer_func.h" #include "group_gui.h" #include "zoom_func.h" +#include "news_cmd.h" #include "widgets/news_widget.h" diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 328cadd93d..f207d47867 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -33,6 +33,7 @@ #include "newgrf_debug.h" #include "vehicle_func.h" #include "station_func.h" +#include "object_cmd.h" #include "table/strings.h" #include "table/object_land.h" diff --git a/src/object_cmd.h b/src/object_cmd.h new file mode 100644 index 0000000000..b7119afc38 --- /dev/null +++ b/src/object_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 object_cmd.h Command definitions related to objects. */ + +#ifndef OBJECT_CMD_H +#define OBJECT_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildObject; + +DEF_CMD_TRAIT(CMD_BUILD_OBJECT, CmdBuildObject, CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) + +#endif /* OBJECT_CMD_H */ diff --git a/src/order_backup.cpp b/src/order_backup.cpp index cba46941c5..51e1b67ff0 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -16,6 +16,7 @@ #include "vehicle_base.h" #include "window_func.h" #include "station_map.h" +#include "order_cmd.h" #include "safeguards.h" diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index b681b63796..2f366b6743 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -26,6 +26,7 @@ #include "company_base.h" #include "order_backup.h" #include "cheat_type.h" +#include "order_cmd.h" #include "table/strings.h" diff --git a/src/order_cmd.h b/src/order_cmd.h new file mode 100644 index 0000000000..606cbef605 --- /dev/null +++ b/src/order_cmd.h @@ -0,0 +1,33 @@ +/* + * 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 order_cmd.h Command definitions related to orders. */ + +#ifndef ORDER_CMD_H +#define ORDER_CMD_H + +#include "command_type.h" + +CommandProc CmdModifyOrder; +CommandProc CmdSkipToOrder; +CommandProc CmdDeleteOrder; +CommandProc CmdInsertOrder; +CommandProc CmdOrderRefit; +CommandProc CmdCloneOrder; +CommandProc CmdMoveOrder; +CommandProc CmdClearOrderBackup; + +DEF_CMD_TRAIT(CMD_MODIFY_ORDER, CmdModifyOrder, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SKIP_TO_ORDER, CmdSkipToOrder, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_DELETE_ORDER, CmdDeleteOrder, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_INSERT_ORDER, CmdInsertOrder, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_ORDER_REFIT, CmdOrderRefit, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_CLONE_ORDER, CmdCloneOrder, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_MOVE_ORDER, CmdMoveOrder, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_CLEAR_ORDER_BACKUP, CmdClearOrderBackup, CMD_CLIENT_ID, CMDT_SERVER_SETTING) + +#endif /* ORDER_CMD_H */ diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 8ff8d64539..449254f516 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -31,6 +31,7 @@ #include "strings_func.h" #include "company_gui.h" #include "object_map.h" +#include "rail_cmd.h" #include "table/strings.h" #include "table/railtypes.h" diff --git a/src/rail_cmd.h b/src/rail_cmd.h new file mode 100644 index 0000000000..e625eb03db --- /dev/null +++ b/src/rail_cmd.h @@ -0,0 +1,37 @@ +/* + * 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 rail_cmd.h Command definitions for rail. */ + +#ifndef RAIL_CMD_H +#define RAIL_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildRailroadTrack; +CommandProc CmdRemoveRailroadTrack; +CommandProc CmdBuildSingleRail; +CommandProc CmdRemoveSingleRail; +CommandProc CmdBuildTrainDepot; +CommandProc CmdBuildSingleSignal; +CommandProc CmdRemoveSingleSignal; +CommandProc CmdConvertRail; +CommandProc CmdBuildSignalTrack; +CommandProc CmdRemoveSignalTrack; + +DEF_CMD_TRAIT(CMD_BUILD_RAILROAD_TRACK, CmdBuildRailroadTrack, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_RAILROAD_TRACK, CmdRemoveRailroadTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_SINGLE_RAIL, CmdBuildSingleRail, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_SINGLE_RAIL, CmdRemoveSingleRail, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_TRAIN_DEPOT, CmdBuildTrainDepot, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_SIGNALS, CmdBuildSingleSignal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_SIGNALS, CmdRemoveSingleSignal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_CONVERT_RAIL, CmdConvertRail, 0, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_SIGNAL_TRACK, CmdBuildSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_SIGNAL_TRACK, CmdRemoveSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) + +#endif /* RAIL_CMD_H */ diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 942cce7a5e..b3f6f4431c 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -37,6 +37,7 @@ #include "genworld.h" #include "company_gui.h" #include "road_func.h" +#include "road_cmd.h" #include "table/strings.h" #include "table/roadtypes.h" diff --git a/src/road_cmd.h b/src/road_cmd.h index 753ebd21d4..4908f72e31 100644 --- a/src/road_cmd.h +++ b/src/road_cmd.h @@ -12,8 +12,21 @@ #include "direction_type.h" #include "road_type.h" +#include "command_type.h" void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt); void UpdateNearestTownForRoadTiles(bool invalidate); +CommandProc CmdBuildLongRoad; +CommandProc CmdRemoveLongRoad; +CommandProc CmdBuildRoad; +CommandProc CmdBuildRoadDepot; +CommandProc CmdConvertRoad; + +DEF_CMD_TRAIT(CMD_BUILD_LONG_ROAD, CmdBuildLongRoad, CMD_AUTO | CMD_NO_WATER | CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_LONG_ROAD, CmdRemoveLongRoad, CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed. +DEF_CMD_TRAIT(CMD_BUILD_ROAD, CmdBuildRoad, CMD_AUTO | CMD_NO_WATER | CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_ROAD_DEPOT, CmdBuildRoadDepot, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_CONVERT_ROAD, CmdConvertRoad, 0, CMDT_LANDSCAPE_CONSTRUCTION) + #endif /* ROAD_CMD_H */ diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index b20748fa05..9e72fd30d8 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -34,6 +34,7 @@ #include "newgrf.h" #include "zoom_func.h" #include "framerate_type.h" +#include "roadveh_cmd.h" #include "table/strings.h" diff --git a/src/roadveh_cmd.h b/src/roadveh_cmd.h new file mode 100644 index 0000000000..42053df16d --- /dev/null +++ b/src/roadveh_cmd.h @@ -0,0 +1,23 @@ +/* + * 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 roadveh_cmd.h Command definitions related to road vehicles. */ + +#ifndef ROADVEH_CMD_H +#define ROADVEH_CMD_H + +#include "command_type.h" +#include "engine_type.h" +#include "vehicle_type.h" + +CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); + +CommandProc CmdTurnRoadVeh; + +DEF_CMD_TRAIT(CMD_TURN_ROADVEH, CmdTurnRoadVeh, 0, CMDT_VEHICLE_MANAGEMENT) + +#endif /* ROADVEH_CMD_H */ diff --git a/src/settings.cpp b/src/settings.cpp index b82fe6d9a1..10d87cf9d4 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -44,6 +44,7 @@ #include "newgrf_config.h" #include "fios.h" #include "fileio_func.h" +#include "settings_cmd.h" #include "table/strings.h" diff --git a/src/settings_cmd.h b/src/settings_cmd.h new file mode 100644 index 0000000000..15b9c31a48 --- /dev/null +++ b/src/settings_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 settings_cmd.h Command definitions related to settings. */ + +#ifndef SETTINGS_CMD_H +#define SETTINGS_CMD_H + +#include "command_type.h" + +CommandProc CmdChangeSetting; +CommandProc CmdChangeCompanySetting; + +DEF_CMD_TRAIT(CMD_CHANGE_SETTING, CmdChangeSetting, CMD_SERVER, CMDT_SERVER_SETTING) +DEF_CMD_TRAIT(CMD_CHANGE_COMPANY_SETTING, CmdChangeCompanySetting, 0, CMDT_COMPANY_SETTING) + +#endif /* SETTINGS_CMD_H */ diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 7f9dab0f1a..bab291b8a5 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -34,6 +34,7 @@ #include "framerate_type.h" #include "industry.h" #include "industry_map.h" +#include "ship_cmd.h" #include "table/strings.h" diff --git a/src/ship_cmd.h b/src/ship_cmd.h new file mode 100644 index 0000000000..a451cf0a40 --- /dev/null +++ b/src/ship_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 ship_cmd.h Command definitions related to ships. */ + +#ifndef SHIP_CMD_H +#define SHIP_CMD_H + +#include "command_type.h" +#include "engine_type.h" +#include "vehicle_type.h" + +CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); + +#endif /* SHIP_CMD_H */ diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 504bae0781..8aa3987556 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -17,6 +17,7 @@ #include "viewport_kdtree.h" #include "window_func.h" #include "string_func.h" +#include "signs_cmd.h" #include "table/strings.h" diff --git a/src/signs_cmd.h b/src/signs_cmd.h new file mode 100644 index 0000000000..85f0ffbdf5 --- /dev/null +++ b/src/signs_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 signs_cmd.h Command definitions related to signs. */ + +#ifndef SIGNS_CMD_H +#define SIGNS_CMD_H + +#include "command_type.h" + +CommandProc CmdPlaceSign; +CommandProc CmdRenameSign; + +DEF_CMD_TRAIT(CMD_PLACE_SIGN, CmdPlaceSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_RENAME_SIGN, CmdRenameSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* SIGNS_CMD_H */ diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 713d383743..20ef6c997a 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -56,6 +56,8 @@ #include "linkgraph/refresh.h" #include "widgets/station_widget.h" #include "tunnelbridge_map.h" +#include "station_cmd.h" +#include "waypoint_cmd.h" #include "table/strings.h" diff --git a/src/station_cmd.h b/src/station_cmd.h new file mode 100644 index 0000000000..8e1facc250 --- /dev/null +++ b/src/station_cmd.h @@ -0,0 +1,33 @@ +/* + * 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 station_cmd.h Command definitions related to stations. */ + +#ifndef STATION_CMD_H +#define STATION_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildAirport; +CommandProc CmdBuildDock; +CommandProc CmdBuildRailStation; +CommandProc CmdRemoveFromRailStation; +CommandProc CmdBuildRoadStop; +CommandProc CmdRemoveRoadStop; +CommandProc CmdRenameStation; +CommandProc CmdOpenCloseAirport; + +DEF_CMD_TRAIT(CMD_BUILD_AIRPORT, CmdBuildAirport, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_DOCK, CmdBuildDock, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_RAIL_STATION, CmdBuildRailStation, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_FROM_RAIL_STATION, CmdRemoveFromRailStation, 0, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_ROAD_STOP, CmdBuildRoadStop, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_ROAD_STOP, CmdRemoveRoadStop, 0, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_RENAME_STATION, CmdRenameStation, 0, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_OPEN_CLOSE_AIRPORT, CmdOpenCloseAirport, 0, CMDT_ROUTE_MANAGEMENT) + +#endif /* STATION_CMD_H */ diff --git a/src/story.cpp b/src/story.cpp index 641ed7fbf5..4c58b19a5c 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -25,6 +25,7 @@ #include "game/game.hpp" #include "script/api/script_story_page.hpp" #include "script/api/script_event_types.hpp" +#include "story_cmd.h" #include "safeguards.h" diff --git a/src/story_cmd.h b/src/story_cmd.h new file mode 100644 index 0000000000..a7323ec6bf --- /dev/null +++ b/src/story_cmd.h @@ -0,0 +1,35 @@ +/* + * 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 story_cmd.h Command definitions related to stories. */ + +#ifndef STORY_CMD_H +#define STORY_CMD_H + +#include "command_type.h" + +CommandProc CmdCreateStoryPage; +CommandProc CmdCreateStoryPageElement; +CommandProc CmdUpdateStoryPageElement; +CommandProc CmdSetStoryPageTitle; +CommandProc CmdSetStoryPageDate; +CommandProc CmdShowStoryPage; +CommandProc CmdRemoveStoryPage; +CommandProc CmdRemoveStoryPageElement; +CommandProc CmdStoryPageButton; + +DEF_CMD_TRAIT(CMD_CREATE_STORY_PAGE, CmdCreateStoryPage, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_CREATE_STORY_PAGE_ELEMENT, CmdCreateStoryPageElement, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_UPDATE_STORY_PAGE_ELEMENT, CmdUpdateStoryPageElement, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_STORY_PAGE_TITLE, CmdSetStoryPageTitle, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_STORY_PAGE_DATE, CmdSetStoryPageDate, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SHOW_STORY_PAGE, CmdShowStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_REMOVE_STORY_PAGE, CmdRemoveStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_REMOVE_STORY_PAGE_ELEMENT, CmdRemoveStoryPageElement, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_STORY_PAGE_BUTTON, CmdStoryPageButton, CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* STORY_CMD_H */ diff --git a/src/subsidy.cpp b/src/subsidy.cpp index e8fc951c4e..ecead2612e 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -24,6 +24,7 @@ #include "command_func.h" #include "string_func.h" #include "tile_cmd.h" +#include "subsidy_cmd.h" #include "table/strings.h" diff --git a/src/subsidy_cmd.h b/src/subsidy_cmd.h new file mode 100644 index 0000000000..f68c9b3034 --- /dev/null +++ b/src/subsidy_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 subsidy_cmd.h Command definitions related to subsidies. */ + +#ifndef SUBSIDY_CMD_H +#define SUBSIDY_CMD_H + +#include "command_type.h" + +CommandProc CmdCreateSubsidy; + +DEF_CMD_TRAIT(CMD_CREATE_SUBSIDY, CmdCreateSubsidy, CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* SUBSIDY_CMD_H */ diff --git a/src/table/CMakeLists.txt b/src/table/CMakeLists.txt index c4043681b7..3a615135ef 100644 --- a/src/table/CMakeLists.txt +++ b/src/table/CMakeLists.txt @@ -34,7 +34,7 @@ add_files( town_land.h townname.h track_land.h - train_cmd.h + train_sprites.h tree_land.h unicode.h water_land.h diff --git a/src/table/train_cmd.h b/src/table/train_sprites.h similarity index 97% rename from src/table/train_cmd.h rename to src/table/train_sprites.h index f9419990b9..5811ec7f32 100644 --- a/src/table/train_cmd.h +++ b/src/table/train_sprites.h @@ -5,7 +5,7 @@ * 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 train_cmd.h Sprites to use for trains. */ +/** @file train_sprites.h Sprites to use for trains. */ static const SpriteID _engine_sprite_base[] = { 0x0B59, 0x0B61, 0x0B69, 0x0BE1, 0x0B71, 0x0B75, 0x0B7D, 0x0B7D, diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index 205a364165..723b3953ed 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -17,6 +17,7 @@ #include "company_base.h" #include "company_func.h" #include "core/backup_type.hpp" +#include "terraform_cmd.h" #include "table/strings.h" diff --git a/src/terraform_cmd.h b/src/terraform_cmd.h new file mode 100644 index 0000000000..88aeaec4cb --- /dev/null +++ b/src/terraform_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 terraform_cmd.h Command definitions related to terraforming. */ + +#ifndef TERRAFORM_CMD_H +#define TERRAFORM_CMD_H + +#include "command_type.h" + +CommandProc CmdTerraformLand; +CommandProc CmdLevelLand; + +DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once + +#endif /* TERRAFORM_CMD_H */ diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index b8f3adc699..a83e877a7f 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -14,6 +14,7 @@ #include "window_func.h" #include "vehicle_base.h" #include "cmd_helper.h" +#include "timetable_cmd.h" #include "table/strings.h" diff --git a/src/timetable_cmd.h b/src/timetable_cmd.h new file mode 100644 index 0000000000..ba5e2b37e2 --- /dev/null +++ b/src/timetable_cmd.h @@ -0,0 +1,25 @@ +/* + * 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 timetable_cmd.h Command definitions related to timetables. */ + +#ifndef TIMETABLE_CMD_H +#define TIMETABLE_CMD_H + +#include "command_type.h" + +CommandProc CmdChangeTimetable; +CommandProc CmdSetVehicleOnTime; +CommandProc CmdAutofillTimetable; +CommandProc CmdSetTimetableStart; + +DEF_CMD_TRAIT(CMD_CHANGE_TIMETABLE, CmdChangeTimetable, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_VEHICLE_ON_TIME, CmdSetVehicleOnTime, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_AUTOFILL_TIMETABLE, CmdAutofillTimetable, 0, CMDT_ROUTE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_SET_TIMETABLE_START, CmdSetTimetableStart, 0, CMDT_ROUTE_MANAGEMENT) + +#endif /* TIMETABLE_CMD_H */ diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 27a9e69783..542d1bc394 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -48,6 +48,7 @@ #include "object_base.h" #include "ai/ai.hpp" #include "game/game.hpp" +#include "town_cmd.h" #include "table/strings.h" #include "table/town_land.h" diff --git a/src/town_cmd.h b/src/town_cmd.h new file mode 100644 index 0000000000..bd4f4de11c --- /dev/null +++ b/src/town_cmd.h @@ -0,0 +1,35 @@ +/* + * 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 town_cmd.h Command definitions related to towns. */ + +#ifndef TOWN_CMD_H +#define TOWN_CMD_H + +#include "command_type.h" + +CommandProc CmdFoundTown; +CommandProc CmdRenameTown; +CommandProc CmdDoTownAction; +CommandProc CmdTownGrowthRate; +CommandProc CmdTownRating; +CommandProc CmdTownCargoGoal; +CommandProc CmdTownSetText; +CommandProc CmdExpandTown; +CommandProc CmdDeleteTown; + +DEF_CMD_TRAIT(CMD_FOUND_TOWN, CmdFoundTown, CMD_DEITY | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // founding random town can fail only in exec run +DEF_CMD_TRAIT(CMD_RENAME_TOWN, CmdRenameTown, CMD_DEITY | CMD_SERVER, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_DO_TOWN_ACTION, CmdDoTownAction, 0, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_TOWN_CARGO_GOAL, CmdTownCargoGoal, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_TOWN_GROWTH_RATE, CmdTownGrowthRate, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_TOWN_RATING, CmdTownRating, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_TOWN_SET_TEXT, CmdTownSetText, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_EXPAND_TOWN, CmdExpandTown, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_DELETE_TOWN, CmdDeleteTown, CMD_OFFLINE, CMDT_LANDSCAPE_CONSTRUCTION) + +#endif /* TOWN_CMD_H */ diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index e0a70d14fb..ad9f6e90d3 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -34,9 +34,10 @@ #include "zoom_func.h" #include "newgrf_debug.h" #include "framerate_type.h" +#include "train_cmd.h" #include "table/strings.h" -#include "table/train_cmd.h" +#include "table/train_sprites.h" #include "safeguards.h" diff --git a/src/train_cmd.h b/src/train_cmd.h new file mode 100644 index 0000000000..3dc54678e8 --- /dev/null +++ b/src/train_cmd.h @@ -0,0 +1,28 @@ +/* + * 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 train_cmd.h Command definitions related to trains. */ + +#ifndef TRAIN_CMD_H +#define TRAIN_CMD_H + +#include "command_type.h" +#include "engine_type.h" +#include "vehicle_type.h" + +CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *v, uint16 data, uint32 user); + +CommandProc CmdMoveRailVehicle; +CommandProc CmdForceTrainProceed; +CommandProc CmdReverseTrainDirection; + +DEF_CMD_TRAIT(CMD_MOVE_RAIL_VEHICLE, CmdMoveRailVehicle, 0, CMDT_VEHICLE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_FORCE_TRAIN_PROCEED, CmdForceTrainProceed, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_REVERSE_TRAIN_DIRECTION, CmdReverseTrainDirection, 0, CMDT_VEHICLE_MANAGEMENT) + +#endif /* TRAIN_CMD_H */ diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 626f0386f7..20943e02e6 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -23,6 +23,7 @@ #include "core/random_func.hpp" #include "newgrf_generic.h" #include "date_func.h" +#include "tree_cmd.h" #include "table/strings.h" #include "table/tree_land.h" diff --git a/src/tree_cmd.h b/src/tree_cmd.h new file mode 100644 index 0000000000..de8d00179b --- /dev/null +++ b/src/tree_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 tree_cmd.h Command definitions related to tree tiles. */ + +#ifndef TREE_CMD_H +#define TREE_CMD_H + +#include "command_type.h" + +CommandProc CmdPlantTree; + +DEF_CMD_TRAIT(CMD_PLANT_TREE, CmdPlantTree, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) + +#endif /* TREE_CMD_H */ diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 9c77dff9dc..4c7836a7a3 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -40,6 +40,7 @@ #include "water.h" #include "company_gui.h" #include "station_func.h" +#include "tunnelbridge_cmd.h" #include "table/strings.h" #include "table/bridge_land.h" diff --git a/src/tunnelbridge_cmd.h b/src/tunnelbridge_cmd.h new file mode 100644 index 0000000000..58cb9b32ae --- /dev/null +++ b/src/tunnelbridge_cmd.h @@ -0,0 +1,21 @@ +/* + * 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 tunnelbridge_cmd.h Command definitions related to tunnels and bridges. */ + +#ifndef TUNNELBRIDGE_CMD_H +#define TUNNELBRIDGE_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildBridge; +CommandProc CmdBuildTunnel; + +DEF_CMD_TRAIT(CMD_BUILD_BRIDGE, CmdBuildBridge, CMD_DEITY | CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_TUNNEL, CmdBuildTunnel, CMD_DEITY | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) + +#endif /* TUNNELBRIDGE_CMD_H */ diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index a36abb59dd..472d10459b 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -30,6 +30,11 @@ #include "newgrf.h" #include "company_base.h" #include "core/random_func.hpp" +#include "vehicle_cmd.h" +#include "aircraft_cmd.h" +#include "roadveh_cmd.h" +#include "train_cmd.h" +#include "ship_cmd.h" #include #include @@ -67,13 +72,6 @@ const StringID _send_to_depot_msg_table[] = { }; -CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); -CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); -CommandCost CmdBuildShip (TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); -CommandCost CmdBuildAircraft (TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); - -CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text); - /** * Build a vehicle. * @param tile tile of depot where the vehicle is built @@ -192,8 +190,6 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint return value; } -CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *v, uint16 data, uint32 user); - /** * Sell a vehicle. * @param tile unused. diff --git a/src/vehicle_cmd.h b/src/vehicle_cmd.h new file mode 100644 index 0000000000..a2d8d62bf7 --- /dev/null +++ b/src/vehicle_cmd.h @@ -0,0 +1,39 @@ +/* + * 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 vehicle_cmd.h Command definitions for vehicles. */ + +#ifndef VEHICLE_CMD_H +#define VEHICLE_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildVehicle; +CommandProc CmdSellVehicle; +CommandProc CmdRefitVehicle; +CommandProc CmdSendVehicleToDepot; +CommandProc CmdChangeServiceInt; +CommandProc CmdRenameVehicle; +CommandProc CmdCloneVehicle; +CommandProc CmdStartStopVehicle; +CommandProc CmdMassStartStopVehicle; +CommandProc CmdDepotSellAllVehicles; +CommandProc CmdDepotMassAutoReplace; + +DEF_CMD_TRAIT(CMD_BUILD_VEHICLE, CmdBuildVehicle, CMD_CLIENT_ID, CMDT_VEHICLE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_SELL_VEHICLE, CmdSellVehicle, CMD_CLIENT_ID, CMDT_VEHICLE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REFIT_VEHICLE, CmdRefitVehicle, 0, CMDT_VEHICLE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_SEND_VEHICLE_TO_DEPOT, CmdSendVehicleToDepot, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_CHANGE_SERVICE_INT, CmdChangeServiceInt, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_RENAME_VEHICLE, CmdRenameVehicle, 0, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_CLONE_VEHICLE, CmdCloneVehicle, CMD_NO_TEST, CMDT_VEHICLE_CONSTRUCTION) // NewGRF callbacks influence building and refitting making it impossible to correctly estimate the cost +DEF_CMD_TRAIT(CMD_START_STOP_VEHICLE, CmdStartStopVehicle, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_MASS_START_STOP, CmdMassStartStopVehicle, 0, CMDT_VEHICLE_MANAGEMENT) +DEF_CMD_TRAIT(CMD_DEPOT_SELL_ALL_VEHICLES, CmdDepotSellAllVehicles, 0, CMDT_VEHICLE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_DEPOT_MASS_AUTOREPLACE, CmdDepotMassAutoReplace, 0, CMDT_VEHICLE_CONSTRUCTION) + +#endif /* VEHICLE_CMD_H */ diff --git a/src/viewport.cpp b/src/viewport.cpp index b3ccba2b5e..3a10041647 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -88,6 +88,7 @@ #include "command_func.h" #include "network/network_func.h" #include "framerate_type.h" +#include "viewport_cmd.h" #include #include diff --git a/src/viewport_cmd.h b/src/viewport_cmd.h new file mode 100644 index 0000000000..f549d755e3 --- /dev/null +++ b/src/viewport_cmd.h @@ -0,0 +1,19 @@ +/* + * 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 viewport_cmd.h Command definitions related to viewports. */ + +#ifndef VIEWPORT_CMD_H +#define VIEWPORT_CMD_H + +#include "command_type.h" + +CommandProc CmdScrollViewport; + +DEF_CMD_TRAIT(CMD_SCROLL_VIEWPORT, CmdScrollViewport, CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* VIEWPORT_CMD_H */ diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 12f300ac2c..152e956b11 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -38,6 +38,7 @@ #include "company_gui.h" #include "newgrf_generic.h" #include "industry.h" +#include "water_cmd.h" #include "table/strings.h" diff --git a/src/water_cmd.h b/src/water_cmd.h new file mode 100644 index 0000000000..ccd18f7639 --- /dev/null +++ b/src/water_cmd.h @@ -0,0 +1,23 @@ +/* + * 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 water_cmd.h Command definitions related to water tiles. */ + +#ifndef WATER_CMD_H +#define WATER_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildShipDepot; +CommandProc CmdBuildCanal; +CommandProc CmdBuildLock; + +DEF_CMD_TRAIT(CMD_BUILD_SHIP_DEPOT, CmdBuildShipDepot, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_CANAL, CmdBuildCanal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_LOCK, CmdBuildLock, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) + +#endif /* WATER_CMD_H */ diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 77b9fbd027..d55b8f0eba 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -28,6 +28,7 @@ #include "company_base.h" #include "water.h" #include "company_gui.h" +#include "waypoint_cmd.h" #include "table/strings.h" diff --git a/src/waypoint_cmd.h b/src/waypoint_cmd.h new file mode 100644 index 0000000000..09f7ec5d3e --- /dev/null +++ b/src/waypoint_cmd.h @@ -0,0 +1,25 @@ +/* + * 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 waypoint_cmd.h Command definitions related to waypoints. */ + +#ifndef WAYPOINT_CMD_H +#define WAYPOINT_CMD_H + +#include "command_type.h" + +CommandProc CmdBuildRailWaypoint; +CommandProc CmdRemoveFromRailWaypoint; +CommandProc CmdBuildBuoy; +CommandProc CmdRenameWaypoint; + +DEF_CMD_TRAIT(CMD_BUILD_RAIL_WAYPOINT, CmdBuildRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_REMOVE_FROM_RAIL_WAYPOINT, CmdRemoveFromRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_BUILD_BUOY, CmdBuildBuoy, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +DEF_CMD_TRAIT(CMD_RENAME_WAYPOINT, CmdRenameWaypoint, 0, CMDT_OTHER_MANAGEMENT) + +#endif /* WAYPOINT_CMD_H */ From 7048e1522f7095e7c716c2488d78711ab6ed912c Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 10 Oct 2021 02:08:52 +0200 Subject: [PATCH 108/710] Codechange: Move flags in CommandProc in front of the command arguments. --- src/aircraft_cmd.cpp | 4 +-- src/aircraft_cmd.h | 2 +- src/autoreplace_cmd.cpp | 8 +++--- src/command.cpp | 8 +++--- src/command_type.h | 2 +- src/company_cmd.cpp | 24 ++++++++--------- src/depot_cmd.cpp | 4 +-- src/economy.cpp | 12 ++++----- src/engine.cpp | 16 ++++++------ src/goal.cpp | 28 ++++++++++---------- src/group_cmd.cpp | 34 ++++++++++++------------ src/industry_cmd.cpp | 8 +++--- src/landscape.cpp | 8 +++--- src/misc_cmd.cpp | 20 +++++++------- src/news_gui.cpp | 4 +-- src/object_cmd.cpp | 6 ++--- src/order_backup.cpp | 4 +-- src/order_cmd.cpp | 28 ++++++++++---------- src/rail_cmd.cpp | 56 ++++++++++++++++++++-------------------- src/road_cmd.cpp | 18 ++++++------- src/roadveh_cmd.cpp | 8 +++--- src/roadveh_cmd.h | 2 +- src/settings.cpp | 8 +++--- src/ship_cmd.cpp | 4 +-- src/ship_cmd.h | 2 +- src/signs_cmd.cpp | 4 +-- src/station_cmd.cpp | 36 +++++++++++++------------- src/story.cpp | 36 +++++++++++++------------- src/subsidy.cpp | 4 +-- src/terraform_cmd.cpp | 8 +++--- src/timetable_cmd.cpp | 16 ++++++------ src/town_cmd.cpp | 36 +++++++++++++------------- src/train_cmd.cpp | 20 +++++++------- src/train_cmd.h | 2 +- src/tree_cmd.cpp | 4 +-- src/tunnelbridge_cmd.cpp | 8 +++--- src/vehicle_cmd.cpp | 52 ++++++++++++++++++------------------- src/viewport.cpp | 4 +-- src/water_cmd.cpp | 12 ++++----- src/waypoint_cmd.cpp | 12 ++++----- 40 files changed, 286 insertions(+), 286 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 2d9b2ae16a..5e0eea35bf 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -259,14 +259,14 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height, int &xoff /** * Build an aircraft. - * @param tile tile of the depot where aircraft is built. * @param flags type of operation. + * @param tile tile of the depot where aircraft is built. * @param e the engine to build. * @param data unused. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildAircraft(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) { const AircraftVehicleInfo *avi = &e->u.air; const Station *st = Station::GetByTile(tile); diff --git a/src/aircraft_cmd.h b/src/aircraft_cmd.h index 769a707c73..719974af7b 100644 --- a/src/aircraft_cmd.h +++ b/src/aircraft_cmd.h @@ -14,6 +14,6 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildAircraft(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); #endif /* AIRCRAFT_CMD_H */ diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index db14a4a1d4..a4a4e88a2f 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -708,14 +708,14 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon /** * Autoreplaces a vehicle * Trains are replaced as a whole chain, free wagons in depot are replaced on their own - * @param tile not used * @param flags type of operation + * @param tile not used * @param p1 Index of vehicle * @param p2 not used * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdAutoreplaceVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Vehicle *v = Vehicle::GetIfValid(p1); if (v == nullptr) return CMD_ERROR; @@ -797,8 +797,8 @@ CommandCost CmdAutoreplaceVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1 /** * Change engine renewal parameters - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 packed data * - bit 0 = replace when engine gets old? * - bits 16-31 = engine group @@ -808,7 +808,7 @@ CommandCost CmdAutoreplaceVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1 * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetAutoReplace(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Company *c = Company::GetIfValid(_current_company); if (c == nullptr) return CMD_ERROR; diff --git a/src/command.cpp b/src/command.cpp index b875884f97..fccbe6148f 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -204,7 +204,7 @@ CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) { if (_docommand_recursive == 1) _cleared_object_areas.clear(); SetTownRatingTestMode(true); - res = proc(tile, flags & ~DC_EXEC, p1, p2, text); + res = proc(flags & ~DC_EXEC, tile, p1, p2, text); SetTownRatingTestMode(false); if (res.Failed()) { goto error; @@ -226,7 +226,7 @@ CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 /* Execute the command here. All cost-relevant functions set the expenses type * themselves to the cost object at some point */ if (_docommand_recursive == 1) _cleared_object_areas.clear(); - res = proc(tile, flags, p1, p2, text); + res = proc(flags, tile, p1, p2, text); if (res.Failed()) { error: _docommand_recursive--; @@ -465,7 +465,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba _cleared_object_areas.clear(); SetTownRatingTestMode(true); BasePersistentStorageArray::SwitchMode(PSM_ENTER_TESTMODE); - CommandCost res = proc(tile, flags, p1, p2, text); + CommandCost res = proc(flags, tile, p1, p2, text); BasePersistentStorageArray::SwitchMode(PSM_LEAVE_TESTMODE); SetTownRatingTestMode(false); @@ -508,7 +508,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * use the construction one */ _cleared_object_areas.clear(); BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND); - CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text); + CommandCost res2 = proc(flags | DC_EXEC, tile, p1, p2, text); BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND); if (cmd == CMD_COMPANY_CTRL) { diff --git a/src/command_type.h b/src/command_type.h index ecb24df125..2bd0fee900 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -421,7 +421,7 @@ enum CommandPauseLevel { * @param text Additional text * @return The CommandCost of the command, which can be succeeded or failed. */ -typedef CommandCost CommandProc(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text); +typedef CommandCost CommandProc(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); /** Defines the traits of a command. */ diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index f18fe343ad..f659a43673 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -795,8 +795,8 @@ void CompanyAdminRemove(CompanyID company_id, CompanyRemoveReason reason) /** * Control the companies: add, delete, etc. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 various functionality * - bits 0..15: CompanyCtrlAction * - bits 16..23: CompanyID @@ -805,7 +805,7 @@ void CompanyAdminRemove(CompanyID company_id, CompanyRemoveReason reason) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCompanyCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { InvalidateWindowData(WC_COMPANY_LEAGUE, 0, 0); CompanyID company_id = (CompanyID)GB(p1, 16, 8); @@ -922,14 +922,14 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /** * Change the company manager's face. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 unused * @param p2 face bitmasked * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetCompanyManagerFace(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CompanyManagerFace cmf = (CompanyManagerFace)p2; @@ -944,8 +944,8 @@ CommandCost CmdSetCompanyManagerFace(TileIndex tile, DoCommandFlag flags, uint32 /** * Change the company's company-colour - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 bitstuffed: * p1 bits 0-7 scheme to set * p1 bit 8 set first/second colour @@ -953,7 +953,7 @@ CommandCost CmdSetCompanyManagerFace(TileIndex tile, DoCommandFlag flags, uint32 * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetCompanyColour(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetCompanyColour(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Colours colour = Extract(p2); LiveryScheme scheme = Extract(p1); @@ -1057,14 +1057,14 @@ static bool IsUniqueCompanyName(const std::string &name) /** * Change the name of the company. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 unused * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { bool reset = text.empty(); @@ -1103,14 +1103,14 @@ static bool IsUniquePresidentName(const std::string &name) /** * Change the name of the president. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 unused * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenamePresident(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenamePresident(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { bool reset = text.empty(); @@ -1188,14 +1188,14 @@ uint32 CompanyInfrastructure::GetTramTotal() const * To prevent abuse in multiplayer games you can only send money to other * companies if you have paid off your loan (either explicitly, or implicitly * given the fact that you have more money than loan). - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 the amount of money to transfer; max 20.000.000 * @param p2 the company to transfer the money to * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdGiveMoney(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdGiveMoney(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (!_settings_game.economy.give_money) return CMD_ERROR; diff --git a/src/depot_cmd.cpp b/src/depot_cmd.cpp index e49936f552..1ffaeb70b2 100644 --- a/src/depot_cmd.cpp +++ b/src/depot_cmd.cpp @@ -38,14 +38,14 @@ static bool IsUniqueDepotName(const std::string &name) /** * Rename a depot. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 id of depot * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Depot *d = Depot::GetIfValid(p1); if (d == nullptr) return CMD_ERROR; diff --git a/src/economy.cpp b/src/economy.cpp index 329a0a5a81..39e98342f9 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -2010,14 +2010,14 @@ extern int GetAmountOwnedBy(const Company *c, Owner owner); /** * Acquire shares in an opposing company. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 company to buy the shares from * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuyShareInCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost cost(EXPENSES_OTHER); CompanyID target_company = (CompanyID)p1; @@ -2062,14 +2062,14 @@ CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, /** * Sell shares in an opposing company. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 company to sell the shares from * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSellShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSellShareInCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CompanyID target_company = (CompanyID)p1; Company *c = Company::GetIfValid(target_company); @@ -2103,14 +2103,14 @@ CommandCost CmdSellShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1 * When a competing company is gone bankrupt you get the chance to purchase * that company. * @todo currently this only works for AI companies - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 company to buy up * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuyCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuyCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CompanyID target_company = (CompanyID)p1; Company *c = Company::GetIfValid(target_company); diff --git a/src/engine.cpp b/src/engine.cpp index 56f81ffce9..e9bb6c494b 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -875,14 +875,14 @@ void ClearEnginesHiddenFlagOfCompany(CompanyID cid) /** * Set the visibility of an engine. - * @param tile Unused. * @param flags Operation to perform. + * @param tile Unused. * @param p1 Unused. * @param p2 Bit 31: 0=visible, 1=hidden, other bits for the #EngineID. * @param text Unused. * @return The cost of this operation or an error. */ -CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Engine *e = Engine::GetIfValid(GB(p2, 0, 31)); if (e == nullptr || _current_company >= MAX_COMPANIES) return CMD_ERROR; @@ -899,14 +899,14 @@ CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32 /** * Accept an engine prototype. XXX - it is possible that the top-company * changes while you are waiting to accept the offer? Then it becomes invalid - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 engine-prototype offered * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdWantEnginePreview(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Engine *e = Engine::GetIfValid(p1); if (e == nullptr || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR; @@ -918,8 +918,8 @@ CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, /** * Allow or forbid a specific company to use an engine - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 engine id * @param p2 various bitstuffed elements * - p2 = (bit 0 - 7) - Company to allow/forbid the use of an engine. @@ -927,7 +927,7 @@ CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdEngineCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdEngineCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; EngineID engine_id = (EngineID)p1; @@ -1072,14 +1072,14 @@ static bool IsUniqueEngineName(const std::string &name) /** * Rename an engine. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 engine ID to rename * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameEngine(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameEngine(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Engine *e = Engine::GetIfValid(p1); if (e == nullptr) return CMD_ERROR; diff --git a/src/goal.cpp b/src/goal.cpp index 7c24386d18..a60853829d 100644 --- a/src/goal.cpp +++ b/src/goal.cpp @@ -35,8 +35,8 @@ INSTANTIATE_POOL_METHODS(Goal) /** * Create a new goal. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 7) - GoalType of destination. * - p1 = (bit 8 - 15) - Company for which this goal is. @@ -44,7 +44,7 @@ INSTANTIATE_POOL_METHODS(Goal) * @param text Text of the goal. * @return the cost of this operation or an error */ -CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (!Goal::CanAllocateItem()) return CMD_ERROR; @@ -110,14 +110,14 @@ CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /** * Remove a goal. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 GoalID to remove. * @param p2 unused. * @param text unused. * @return the cost of this operation or an error */ -CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; if (!Goal::IsValidID(p1)) return CMD_ERROR; @@ -140,14 +140,14 @@ CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /** * Update goal text of a goal. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 GoalID to update. * @param p2 unused * @param text Text of the goal. * @return the cost of this operation or an error */ -CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGoalText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; if (!Goal::IsValidID(p1)) return CMD_ERROR; @@ -170,14 +170,14 @@ CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /** * Update progress text of a goal. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 GoalID to update. * @param p2 unused * @param text Progress text of the goal. * @return the cost of this operation or an error */ -CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGoalProgress(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; if (!Goal::IsValidID(p1)) return CMD_ERROR; @@ -203,14 +203,14 @@ CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32 p1, u /** * Update completed state of a goal. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 GoalID to update. * @param p2 completed state. If goal is completed, set to 1, otherwise 0. * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGoalCompleted(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; if (!Goal::IsValidID(p1)) return CMD_ERROR; @@ -231,8 +231,8 @@ CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1, /** * Ask a goal related question - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 15) - Unique ID to use for this question. * - p1 = (bit 16 - 31) - Company or client for which this question is. @@ -243,7 +243,7 @@ CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1, * @param text Text of the question. * @return the cost of this operation or an error */ -CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdGoalQuestion(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { uint16 uniqueid = (uint16)GB(p1, 0, 16); CompanyID company = (CompanyID)GB(p1, 16, 8); @@ -283,14 +283,14 @@ CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /** * Reply to a goal question. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 Unique ID to use for this question. * @param p2 Button the company pressed * @param text Text of the question. * @return the cost of this operation or an error */ -CommandCost CmdGoalQuestionAnswer(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (p1 > UINT16_MAX) return CMD_ERROR; if (p2 >= GOAL_QUESTION_BUTTON_COUNT) return CMD_ERROR; diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index 8b67fbeae8..fbe08ffd0c 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -294,14 +294,14 @@ Group::Group(Owner owner) /** * Create a new vehicle group. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 vehicle type * @param p2 parent groupid * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdCreateGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleType vt = Extract(p1); if (!IsCompanyBuildableVehicleType(vt)) return CMD_ERROR; @@ -343,15 +343,15 @@ CommandCost CmdCreateGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /** * Add all vehicles in the given group to the default group and then deletes the group. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 index of array group * - p1 bit 0-15 : GroupID * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdDeleteGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDeleteGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Group *g = Group::GetIfValid(p1); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; @@ -395,8 +395,8 @@ CommandCost CmdDeleteGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /** * Alter a group - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 index of array group * - p1 bit 0-15 : GroupID * - p1 bit 16: 0 - Rename grouop @@ -405,7 +405,7 @@ CommandCost CmdDeleteGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdAlterGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAlterGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Group *g = Group::GetIfValid(GB(p1, 0, 16)); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; @@ -499,8 +499,8 @@ static void AddVehicleToGroup(Vehicle *v, GroupID new_g) /** * Add a vehicle to a group - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 index of array group * - p1 bit 0-15 : GroupID * @param p2 vehicle to add to a group @@ -509,7 +509,7 @@ static void AddVehicleToGroup(Vehicle *v, GroupID new_g) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdAddVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAddVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Vehicle *v = Vehicle::GetIfValid(GB(p2, 0, 20)); GroupID new_g = p1; @@ -525,7 +525,7 @@ CommandCost CmdAddVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (new_g == NEW_GROUP) { /* Create new group. */ - CommandCost ret = CmdCreateGroup(0, flags, v->type, INVALID_GROUP, {}); + CommandCost ret = CmdCreateGroup(flags, 0, v->type, INVALID_GROUP, {}); if (ret.Failed()) return ret; new_g = _new_group_id; @@ -558,15 +558,15 @@ CommandCost CmdAddVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, u /** * Add all shared vehicles of all vehicles from a group - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 index of group array * - p1 bit 0-15 : GroupID * @param p2 type of vehicles * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdAddSharedVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleType type = Extract(p2); GroupID id_g = p1; @@ -595,15 +595,15 @@ CommandCost CmdAddSharedVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 /** * Remove all vehicles from a group - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 index of group array * - p1 bit 0-15 : GroupID * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRemoveAllVehiclesGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { GroupID old_g = p1; Group *g = Group::GetIfValid(old_g); @@ -629,15 +629,15 @@ CommandCost CmdRemoveAllVehiclesGroup(TileIndex tile, DoCommandFlag flags, uint3 /** * Set the livery for a vehicle group. - * @param tile Unused. * @param flags Command flags. + * @param tile Unused. * @param p1 * - p1 bit 0-15 Group ID. * @param p2 * - p2 bit 8 Set secondary instead of primary colour * - p2 bit 16-23 Colour. */ -CommandCost CmdSetGroupLivery(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGroupLivery(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Group *g = Group::GetIfValid(p1); bool primary = !HasBit(p2, 8); @@ -687,8 +687,8 @@ static void SetGroupFlag(Group *g, GroupFlags flag, bool set, bool children) /** * (Un)set group flag from a group - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 index of group array * - p1 bit 0-15 : GroupID * - p1 bit 16-18 : Flag to set, by value not bit. @@ -698,7 +698,7 @@ static void SetGroupFlag(Group *g, GroupFlags flag, bool set, bool children) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetGroupFlag(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGroupFlag(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Group *g = Group::GetIfValid(GB(p1, 0, 16)); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index a24f35f756..e2fa1b7769 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1973,8 +1973,8 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do /** * Build/Fund an industry - * @param tile tile where industry is built * @param flags of operations to conduct + * @param tile tile where industry is built * @param p1 various bitstuffed elements * - p1 = (bit 0 - 7) - industry type see build_industry.h and see industry.h * - p1 = (bit 8 - 15) - first layout to try @@ -1983,7 +1983,7 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { IndustryType it = GB(p1, 0, 8); if (it >= NUM_INDUSTRYTYPES) return CMD_ERROR; @@ -2062,8 +2062,8 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin /** * Change industry properties - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 IndustryID * @param p2 various bitstuffed elements * - p2 = (bit 0 - 7) - IndustryAction to perform @@ -2075,7 +2075,7 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin * @param text - Additional industry text (only used with set text action) * @return Empty cost or an error. */ -CommandCost CmdIndustryCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdIndustryCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; diff --git a/src/landscape.cpp b/src/landscape.cpp index 1cc3b1ad20..1259617ace 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -684,14 +684,14 @@ void ClearSnowLine() /** * Clear a piece of landscape - * @param tile tile to clear * @param flags of operation to conduct + * @param tile tile to clear * @param p1 unused * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdLandscapeClear(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdLandscapeClear(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost cost(EXPENSES_CONSTRUCTION); bool do_clear = false; @@ -733,15 +733,15 @@ CommandCost CmdLandscapeClear(TileIndex tile, DoCommandFlag flags, uint32 p1, ui /** * Clear a big piece of landscape - * @param tile end tile of area dragging * @param flags of operation to conduct + * @param tile end tile of area dragging * @param p1 start tile of area dragging * @param p2 various bitstuffed data. * bit 0: Whether to use the Orthogonal (0) or Diagonal (1) iterator. * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdClearArea(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (p1 >= MapSize()) return CMD_ERROR; diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index 2e70f5fdd3..243c5347aa 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -33,8 +33,8 @@ static_assert((LOAN_INTERVAL & 3) == 0); /** * Increase the loan of your company. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 higher half of amount to increase the loan with, multitude of LOAN_INTERVAL. Only used when (p2 & 3) == 2. * @param p2 (bit 2-31) - lower half of amount (lower 2 bits assumed to be 0) * (bit 0-1) - when 0: loans LOAN_INTERVAL @@ -43,7 +43,7 @@ static_assert((LOAN_INTERVAL & 3) == 0); * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdIncreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdIncreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Company *c = Company::Get(_current_company); @@ -81,8 +81,8 @@ CommandCost CmdIncreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /** * Decrease the loan of your company. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 higher half of amount to decrease the loan with, multitude of LOAN_INTERVAL. Only used when (p2 & 3) == 2. * @param p2 (bit 2-31) - lower half of amount (lower 2 bits assumed to be 0) * (bit 0-1) - when 0: pays back LOAN_INTERVAL @@ -91,7 +91,7 @@ CommandCost CmdIncreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdDecreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDecreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Company *c = Company::Get(_current_company); @@ -144,14 +144,14 @@ static void AskUnsafeUnpauseCallback(Window *w, bool confirmed) * Set or unset a bit in the pause mode. If pause mode is zero the game is * unpaused. A bitset is used instead of a boolean value/counter to have * more control over the game when saving/loading, etc. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 the pause mode to change * @param p2 1 pauses, 0 unpauses this mode * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdPause(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { switch (p1) { case PM_PAUSED_SAVELOAD: @@ -196,29 +196,29 @@ CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, /** * Change the financial flow of your company. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 the amount of money to receive (if positive), or spend (if negative) * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdMoneyCheat(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMoneyCheat(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { return CommandCost(EXPENSES_OTHER, -(int32)p1); } /** * Change the bank bank balance of a company by inserting or removing money without affecting the loan. - * @param tile tile to show text effect on (if not 0) * @param flags operation to perform + * @param tile tile to show text effect on (if not 0) * @param p1 the amount of money to receive (if positive), or spend (if negative) * @param p2 (bit 0-7) - the company ID. * (bit 8-15) - the expenses type which should register the cost/income @see ExpensesType. * @param text unused * @return zero cost or an error */ -CommandCost CmdChangeBankBalance(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeBankBalance(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { int32 delta = (int32)p1; CompanyID company = (CompanyID) GB(p2, 0, 8); diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 3f3b918671..75b84a4438 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -836,8 +836,8 @@ void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceTy /** * Create a new custom news item. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 various bitstuffed elements * - p1 = (bit 0 - 7) - NewsType of the message. * - p1 = (bit 8 - 15) - NewsReferenceType of first reference. @@ -846,7 +846,7 @@ void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceTy * @param text The text of the news message. * @return the cost of this operation or an error */ -CommandCost CmdCustomNewsItem(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCustomNewsItem(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index f207d47867..b5271727ce 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -196,14 +196,14 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags); /** * Build an object object - * @param tile tile where the object will be located * @param flags type of operation + * @param tile tile where the object will be located * @param p1 the object type to build * @param p2 the view for the object * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost cost(EXPENSES_CONSTRUCTION); @@ -776,7 +776,7 @@ void GenerateObjects() default: uint8 view = RandomRange(spec->views); - if (CmdBuildObject(RandomTile(), DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, i, view, {}).Succeeded()) amount--; + if (CmdBuildObject(DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, RandomTile(), i, view, {}).Succeeded()) amount--; break; } } diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 51e1b67ff0..76c416abd3 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -141,14 +141,14 @@ void OrderBackup::DoRestore(Vehicle *v) /** * Clear an OrderBackup - * @param tile Tile related to the to-be-cleared OrderBackup. * @param flags For command. + * @param tile Tile related to the to-be-cleared OrderBackup. * @param p1 Unused. * @param p2 User that had the OrderBackup. * @param text Unused. * @return The cost of this operation or an error. */ -CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* No need to check anything. If the tile or user don't exist we just ignore it. */ if (flags & DC_EXEC) OrderBackup::ResetOfUser(tile == 0 ? INVALID_TILE : tile, p2); diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 2f366b6743..e48cc95c17 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -727,8 +727,8 @@ uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int /** * Add an order to the orderlist of a vehicle. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 various bitstuffed elements * - p1 = (bit 0 - 19) - ID of the vehicle * - p1 = (bit 24 - 31) - the selected order (if any). If the last order is given, @@ -738,7 +738,7 @@ uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdInsertOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh = GB(p1, 0, 20); VehicleOrderID sel_ord = GB(p1, 20, 8); @@ -1006,14 +1006,14 @@ static CommandCost DecloneOrder(Vehicle *dst, DoCommandFlag flags) /** * Delete an order from the orderlist of a vehicle. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 the ID of the vehicle * @param p2 the order to delete (max 255) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdDeleteOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDeleteOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh_id = GB(p1, 0, 20); VehicleOrderID sel_ord = GB(p2, 0, 8); @@ -1111,14 +1111,14 @@ void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord) /** * Goto order of order-list. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 The ID of the vehicle which order is skipped * @param p2 the selected order to which we want to skip * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSkipToOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh_id = GB(p1, 0, 20); VehicleOrderID sel_ord = GB(p2, 0, 8); @@ -1148,8 +1148,8 @@ CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /** * Move an order inside the orderlist - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 the ID of the vehicle * @param p2 order to move and target * bit 0-15 : the order to move @@ -1159,7 +1159,7 @@ CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 * @note The target order will move one place down in the orderlist * if you move the order upwards else it'll move it one place down */ -CommandCost CmdMoveOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMoveOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh = GB(p1, 0, 20); VehicleOrderID moving_order = GB(p2, 0, 16); @@ -1249,8 +1249,8 @@ CommandCost CmdMoveOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /** * Modify an order in the orderlist of a vehicle. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 various bitstuffed elements * - p1 = (bit 0 - 19) - ID of the vehicle * - p1 = (bit 24 - 31) - the selected order (if any). If the last order is given, @@ -1262,7 +1262,7 @@ CommandCost CmdMoveOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdModifyOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleOrderID sel_ord = GB(p1, 20, 8); VehicleID veh = GB(p1, 0, 20); @@ -1522,8 +1522,8 @@ static bool CheckAircraftOrderDistance(const Aircraft *v_new, const Vehicle *v_o /** * Clone/share/copy an order-list of another vehicle. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 various bitstuffed elements * - p1 = (bit 0-19) - destination vehicle to clone orders to * - p1 = (bit 30-31) - action to perform @@ -1531,7 +1531,7 @@ static bool CheckAircraftOrderDistance(const Aircraft *v_new, const Vehicle *v_o * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCloneOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh_src = GB(p2, 0, 20); VehicleID veh_dst = GB(p1, 0, 20); @@ -1669,8 +1669,8 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /** * Add/remove refit orders from an order - * @param tile Not used * @param flags operation to perform + * @param tile Not used * @param p1 VehicleIndex of the vehicle having the order * @param p2 bitmask * - bit 0-7 CargoID @@ -1678,7 +1678,7 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdOrderRefit(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdOrderRefit(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh = GB(p1, 0, 20); VehicleOrderID order_number = GB(p2, 16, 8); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 449254f516..af99b03ae2 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -426,8 +426,8 @@ static inline bool ValParamTrackOrientation(Track track) /** * Build a single piece of rail - * @param tile tile to build on * @param flags operation to perform + * @param tile tile to build on * @param p1 railtype of being built piece (normal, mono, maglev) * @param p2 various bitstuffed elements * - (bit 0- 2) - track-orientation, valid values: 0-5 (@see Track) @@ -435,7 +435,7 @@ static inline bool ValParamTrackOrientation(Track track) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { RailType railtype = Extract(p1); Track track = Extract(p2); @@ -616,14 +616,14 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u /** * Remove a single piece of track - * @param tile tile to remove track from * @param flags operation to perform + * @param tile tile to remove track from * @param p1 unused * @param p2 rail orientation * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Track track = Extract(p2); CommandCost cost(EXPENSES_CONSTRUCTION); @@ -873,8 +873,8 @@ static CommandCost ValidateAutoDrag(Trackdir *trackdir, TileIndex start, TileInd /** * Build or remove a stretch of railroad tracks. - * @param tile start tile of drag * @param flags operation to perform + * @param tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0-5) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev), only used for building @@ -885,7 +885,7 @@ static CommandCost ValidateAutoDrag(Trackdir *trackdir, TileIndex start, TileInd * @param text unused * @return the cost of this operation or an error */ -static CommandCost CmdRailTrackHelper(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost total_cost(EXPENSES_CONSTRUCTION); Track track = Extract(p2); @@ -935,8 +935,8 @@ static CommandCost CmdRailTrackHelper(TileIndex tile, DoCommandFlag flags, uint3 /** * Build rail on a stretch of track. * Stub for the unified rail builder/remover - * @param tile start tile of drag * @param flags operation to perform + * @param tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0-5) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev) @@ -946,16 +946,16 @@ static CommandCost CmdRailTrackHelper(TileIndex tile, DoCommandFlag flags, uint3 * @return the cost of this operation or an error * @see CmdRailTrackHelper */ -CommandCost CmdBuildRailroadTrack(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - return CmdRailTrackHelper(tile, flags, p1, ClrBit(p2, 9), text); + return CmdRailTrackHelper(flags, tile, p1, ClrBit(p2, 9), text); } /** * Build rail on a stretch of track. * Stub for the unified rail builder/remover - * @param tile start tile of drag * @param flags operation to perform + * @param tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0-5) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev), only used for building @@ -965,15 +965,15 @@ CommandCost CmdBuildRailroadTrack(TileIndex tile, DoCommandFlag flags, uint32 p1 * @return the cost of this operation or an error * @see CmdRailTrackHelper */ -CommandCost CmdRemoveRailroadTrack(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - return CmdRailTrackHelper(tile, flags, p1, SetBit(p2, 9), text); + return CmdRailTrackHelper(flags, tile, p1, SetBit(p2, 9), text); } /** * Build a train depot - * @param tile position of the train depot * @param flags operation to perform + * @param tile position of the train depot * @param p1 rail type * @param p2 bit 0..1 entrance direction (DiagDirection) * @param text unused @@ -982,7 +982,7 @@ CommandCost CmdRemoveRailroadTrack(TileIndex tile, DoCommandFlag flags, uint32 p * @todo When checking for the tile slope, * distinguish between "Flat land required" and "land sloped in wrong direction" */ -CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* check railtype and valid direction for depot (0 through 3), 4 in total */ RailType railtype = Extract(p1); @@ -1039,8 +1039,8 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u * Build signals, alternate between double/single, signal/semaphore, * pre/exit/combo-signals, and what-else not. If the rail piece does not * have any signals, bit 4 (cycle signal-type) is ignored - * @param tile tile where to build the signals * @param flags operation to perform + * @param tile tile where to build the signals * @param p1 various bitstuffed elements * - p1 = (bit 0-2) - track-orientation, valid values: 0-5 (Track enum) * - p1 = (bit 3) - 1 = override signal/semaphore, or pre/exit/combo signal or (for bit 7) toggle variant (CTRL-toggle) @@ -1056,7 +1056,7 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u * @return the cost of this operation or an error * @todo p2 should be replaced by two bits for "along" and "against" the track. */ -CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Track track = Extract(p1); bool ctrl_pressed = HasBit(p1, 3); // was the CTRL button pressed @@ -1256,8 +1256,8 @@ static bool AdvanceSignalAutoFill(TileIndex &tile, Trackdir &trackdir, bool remo /** * Build many signals by dragging; AutoSignals - * @param tile start tile of drag * @param flags operation to perform + * @param tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) @@ -1271,7 +1271,7 @@ static bool AdvanceSignalAutoFill(TileIndex &tile, Trackdir &trackdir, bool remo * @param text unused * @return the cost of this operation or an error */ -static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost total_cost(EXPENSES_CONSTRUCTION); TileIndex start_tile = tile; @@ -1467,8 +1467,8 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin /** * Build signals on a stretch of track. * Stub for the unified signal builder/remover - * @param tile start tile of drag * @param flags operation to perform + * @param tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) @@ -1482,15 +1482,15 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin * @return the cost of this operation or an error * @see CmdSignalTrackHelper */ -CommandCost CmdBuildSignalTrack(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - return CmdSignalTrackHelper(tile, flags, p1, p2, text); + return CmdSignalTrackHelper(flags, tile, p1, p2, text); } /** * Remove signals - * @param tile coordinates where signal is being deleted from * @param flags operation to perform + * @param tile coordinates where signal is being deleted from * @param p1 various bitstuffed elements, only track information is used * - (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) * - (bit 3) - override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) @@ -1499,7 +1499,7 @@ CommandCost CmdBuildSignalTrack(TileIndex tile, DoCommandFlag flags, uint32 p1, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Track track = Extract(p1); @@ -1559,8 +1559,8 @@ CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1 /** * Remove signals on a stretch of track. * Stub for the unified signal builder/remover - * @param tile start tile of drag * @param flags operation to perform + * @param tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) @@ -1574,9 +1574,9 @@ CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1 * @return the cost of this operation or an error * @see CmdSignalTrackHelper */ -CommandCost CmdRemoveSignalTrack(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveSignalTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { - return CmdSignalTrackHelper(tile, flags, p1, SetBit(p2, 5), text); // bit 5 is remove bit + return CmdSignalTrackHelper(flags, tile, p1, SetBit(p2, 5), text); // bit 5 is remove bit } /** Update power of train under which is the railtype being converted */ @@ -1593,8 +1593,8 @@ static Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data) /** * Convert one rail type to the other. You can convert normal rail to * monorail/maglev easily or vice-versa. - * @param tile end tile of rail conversion drag * @param flags operation to perform + * @param tile end tile of rail conversion drag * @param p1 start tile of drag * @param p2 various bitstuffed elements: * - p2 = (bit 0- 5) new railtype to convert to. @@ -1602,7 +1602,7 @@ static Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { RailType totype = Extract(p2); TileIndex area_start = p1; diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index b3f6f4431c..6fa8244e1e 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -602,8 +602,8 @@ static CommandCost CheckRoadSlope(Slope tileh, RoadBits *pieces, RoadBits existi /** * Build a piece of road. - * @param tile tile where to build road * @param flags operation to perform + * @param tile tile where to build road * @param p1 bit 0..3 road pieces to build (RoadBits) * bit 4..9 road type * bit 11..12 disallowed directions to toggle @@ -611,7 +611,7 @@ static CommandCost CheckRoadSlope(Slope tileh, RoadBits *pieces, RoadBits existi * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CompanyID company = _current_company; CommandCost cost(EXPENSES_CONSTRUCTION); @@ -967,8 +967,8 @@ static bool CanConnectToRoad(TileIndex tile, RoadType rt, DiagDirection dir) /** * Build a long piece of road. - * @param start_tile start tile of drag (the building cost will appear over this tile) * @param flags operation to perform + * @param start_tile start tile of drag (the building cost will appear over this tile) * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1). Only used if bit 6 is set or if we are building a single tile @@ -982,7 +982,7 @@ static bool CanConnectToRoad(TileIndex tile, RoadType rt, DiagDirection dir) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) { DisallowedRoadDirections drd = DRD_NORTHBOUND; @@ -1076,8 +1076,8 @@ CommandCost CmdBuildLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 p /** * Remove a long piece of road. - * @param start_tile start tile of drag * @param flags operation to perform + * @param start_tile start tile of drag * @param p1 end tile of drag * @param p2 various bitstuffed elements * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1) @@ -1087,7 +1087,7 @@ CommandCost CmdBuildLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 p * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRemoveLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost cost(EXPENSES_CONSTRUCTION); @@ -1164,7 +1164,7 @@ CommandCost CmdRemoveLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 * @todo When checking for the tile slope, * distinguish between "Flat land required" and "land sloped in wrong direction" */ -CommandCost CmdBuildRoadDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { DiagDirection dir = Extract(p1); @@ -2343,15 +2343,15 @@ static void ConvertRoadTypeOwner(TileIndex tile, uint num_pieces, Owner owner, R * Convert one road subtype to another. * Not meant to convert from road to tram. * - * @param tile end tile of road conversion drag * @param flags operation to perform + * @param tile end tile of road conversion drag * @param p1 start tile of drag * @param p2 various bitstuffed elements: * - p2 = (bit 0..5) new roadtype to convert to. * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdConvertRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { RoadType to_type = Extract(p2); diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 9e72fd30d8..4c83814033 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -250,14 +250,14 @@ void RoadVehUpdateCache(RoadVehicle *v, bool same_length) /** * Build a road vehicle. - * @param tile tile of the depot where road vehicle is built. * @param flags type of operation. + * @param tile tile of the depot where road vehicle is built. * @param e the engine to build. * @param data unused. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) { /* Check that the vehicle can drive on the road in question */ RoadType rt = e->u.road.roadtype; @@ -360,14 +360,14 @@ bool RoadVehicle::FindClosestDepot(TileIndex *location, DestinationID *destinati /** * Turn a roadvehicle around. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 vehicle ID to turn * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdTurnRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTurnRoadVeh(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { RoadVehicle *v = RoadVehicle::GetIfValid(p1); if (v == nullptr) return CMD_ERROR; diff --git a/src/roadveh_cmd.h b/src/roadveh_cmd.h index 42053df16d..ca99dee3ab 100644 --- a/src/roadveh_cmd.h +++ b/src/roadveh_cmd.h @@ -14,7 +14,7 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); CommandProc CmdTurnRoadVeh; diff --git a/src/settings.cpp b/src/settings.cpp index 10d87cf9d4..1bf6513044 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1486,8 +1486,8 @@ const SettingDesc *GetSettingFromName(const std::string_view name) /** * Network-safe changing of settings (server-only). - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 unused * @param p2 the new value for the setting * The new value is properly clamped to its minimum/maximum when setting @@ -1495,7 +1495,7 @@ const SettingDesc *GetSettingFromName(const std::string_view name) * @return the cost of this operation or an error * @see _settings */ -CommandCost CmdChangeSetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeSetting(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (text.empty()) return CMD_ERROR; const SettingDesc *sd = GetSettingFromName(text); @@ -1515,15 +1515,15 @@ CommandCost CmdChangeSetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uin /** * Change one of the per-company settings. - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 unused * @param p2 the new value for the setting * The new value is properly clamped to its minimum/maximum when setting * @param text the name of the company setting to change * @return the cost of this operation or an error */ -CommandCost CmdChangeCompanySetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeCompanySetting(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (text.empty()) return CMD_ERROR; const SettingDesc *sd = GetCompanySettingFromName(text.c_str()); diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index bab291b8a5..0e0bccce0f 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -838,14 +838,14 @@ void Ship::SetDestTile(TileIndex tile) /** * Build a ship. - * @param tile tile of the depot where ship is built. * @param flags type of operation. + * @param tile tile of the depot where ship is built. * @param e the engine to build. * @param data unused. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildShip(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) { tile = GetShipDepotNorthTile(tile); if (flags & DC_EXEC) { diff --git a/src/ship_cmd.h b/src/ship_cmd.h index a451cf0a40..8738f54207 100644 --- a/src/ship_cmd.h +++ b/src/ship_cmd.h @@ -14,6 +14,6 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildShip(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); #endif /* SHIP_CMD_H */ diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 8aa3987556..c025b10429 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -37,7 +37,7 @@ SignID _new_sign_id; * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdPlaceSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Try to locate a new sign */ if (!Sign::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_SIGNS); @@ -76,7 +76,7 @@ CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Sign *si = Sign::GetIfValid(p1); if (si == nullptr) return CMD_ERROR; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 20ef6c997a..f53523bc31 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1237,8 +1237,8 @@ static void RestoreTrainReservation(Train *v) /** * Build rail station - * @param tile_org northern most position of station dragging/placement * @param flags operation to perform + * @param tile_org northern most position of station dragging/placement * @param p1 various bitstuffed elements * - p1 = (bit 0- 5) - railtype * - p1 = (bit 6) - orientation (Axis) @@ -1252,7 +1252,7 @@ static void RestoreTrainReservation(Train *v) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, uint32 p1, uint32 p2, const std::string &text) { /* Unpack parameters */ RailType rt = Extract(p1); @@ -1653,15 +1653,15 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector &affected_st /** * Remove a single tile from a rail station. * This allows for custom-built station with holes and weird layouts - * @param start tile of station piece to remove * @param flags operation to perform + * @param start tile of station piece to remove * @param p1 start_tile * @param p2 various bitstuffed elements * - p2 = bit 0 - if set keep the rail * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, uint32 p1, uint32 p2, const std::string &text) { TileIndex end = p1 == 0 ? start : p1; if (start >= MapSize() || end >= MapSize()) return CMD_ERROR; @@ -1687,15 +1687,15 @@ CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint3 /** * Remove a single tile from a waypoint. * This allows for custom-built waypoint with holes and weird layouts - * @param start tile of waypoint piece to remove * @param flags operation to perform + * @param start tile of waypoint piece to remove * @param p1 start_tile * @param p2 various bitstuffed elements * - p2 = bit 0 - if set keep the rail * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRemoveFromRailWaypoint(TileIndex start, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveFromRailWaypoint(DoCommandFlag flags, TileIndex start, uint32 p1, uint32 p2, const std::string &text) { TileIndex end = p1 == 0 ? start : p1; if (start >= MapSize() || end >= MapSize()) return CMD_ERROR; @@ -1820,8 +1820,8 @@ static CommandCost FindJoiningRoadStop(StationID existing_stop, StationID statio /** * Build a bus or truck stop. - * @param tile Northernmost tile of the stop. * @param flags Operation to perform. + * @param tile Northernmost tile of the stop. * @param p1 bit 0..7: Width of the road stop. * bit 8..15: Length of the road stop. * @param p2 bit 0: 0 For bus stops, 1 for truck stops. @@ -1834,7 +1834,7 @@ static CommandCost FindJoiningRoadStop(StationID existing_stop, StationID statio * @param text Unused. * @return The cost of this operation or an error. */ -CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { bool type = HasBit(p2, 0); bool is_drive_through = HasBit(p2, 1); @@ -2075,8 +2075,8 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags) /** * Remove bus or truck stops. - * @param tile Northernmost tile of the removal area. * @param flags Operation to perform. + * @param tile Northernmost tile of the removal area. * @param p1 bit 0..7: Width of the removal area. * bit 8..15: Height of the removal area. * @param p2 bit 0: 0 For bus stops, 1 for truck stops. @@ -2084,7 +2084,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags) * @param text Unused. * @return The cost of this operation or an error. */ -CommandCost CmdRemoveRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { uint8 width = (uint8)GB(p1, 0, 8); uint8 height = (uint8)GB(p1, 8, 8); @@ -2232,8 +2232,8 @@ void UpdateAirportsNoise() /** * Place an Airport. - * @param tile tile where airport will be built * @param flags operation to perform + * @param tile tile where airport will be built * @param p1 * - p1 = (bit 0- 7) - airport type, @see airport.h * - p1 = (bit 8-15) - airport layout @@ -2243,7 +2243,7 @@ void UpdateAirportsNoise() * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { StationID station_to_join = GB(p2, 16, 16); bool reuse = (station_to_join != NEW_STATION); @@ -2453,14 +2453,14 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags) /** * Open/close an airport to incoming aircraft. - * @param tile Unused. * @param flags Operation to perform. + * @param tile Unused. * @param p1 Station ID of the airport. * @param p2 Unused. * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdOpenCloseAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdOpenCloseAirport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (!Station::IsValidID(p1)) return CMD_ERROR; Station *st = Station::Get(p1); @@ -2508,14 +2508,14 @@ static const byte _dock_h_chk[4] = { 1, 2, 1, 2 }; /** * Build a dock/haven. - * @param tile tile where dock will be built * @param flags operation to perform + * @param tile tile where dock will be built * @param p1 (bit 0) - allow docks directly adjacent to other docks. * @param p2 bit 16-31: station ID to join (NEW_STATION if build new one) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { StationID station_to_join = GB(p2, 16, 16); bool reuse = (station_to_join != NEW_STATION); @@ -3927,14 +3927,14 @@ static bool IsUniqueStationName(const std::string &name) /** * Rename a station - * @param tile unused * @param flags operation to perform + * @param tile unused * @param p1 station ID that is to be renamed * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameStation(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameStation(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Station *st = Station::GetIfValid(p1); if (st == nullptr) return CMD_ERROR; diff --git a/src/story.cpp b/src/story.cpp index 4c58b19a5c..24b09ade5d 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -197,15 +197,15 @@ bool StoryPageButtonData::ValidateVehicleType() const /** * Create a new story page. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 7) - Company for which this story page belongs to. * @param p2 unused. * @param text Title of the story page. Null is allowed in which case a generic page title is provided by OpenTTD. * @return the cost of this operation or an error */ -CommandCost CmdCreateStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (!StoryPage::CanAllocateItem()) return CMD_ERROR; @@ -242,8 +242,8 @@ CommandCost CmdCreateStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, u /** * Create a new story page element. - * @param tile Tile location if it is a location page element, otherwise unused. * @param flags type of operation + * @param tile Tile location if it is a location page element, otherwise unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 15) - The page which the element belongs to. * (bit 16 - 23) - Page element type @@ -251,7 +251,7 @@ CommandCost CmdCreateStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, u * @param text Text content in case it is a text or location page element * @return the cost of this operation or an error */ -CommandCost CmdCreateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (!StoryPageElement::CanAllocateItem()) return CMD_ERROR; @@ -292,8 +292,8 @@ CommandCost CmdCreateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint3 /** * Update a new story page element. - * @param tile Tile location if it is a location page element, otherwise unused. * @param flags type of operation + * @param tile Tile location if it is a location page element, otherwise unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 15) - The page element to update. * (bit 16 - 31) - unused @@ -301,7 +301,7 @@ CommandCost CmdCreateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint3 * @param text Text content in case it is a text or location page element * @return the cost of this operation or an error */ -CommandCost CmdUpdateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdUpdateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { StoryPageElementID page_element_id = (StoryPageElementID)GB(p1, 0, 16); @@ -324,14 +324,14 @@ CommandCost CmdUpdateStoryPageElement(TileIndex tile, DoCommandFlag flags, uint3 /** * Update title of a story page. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 = (bit 0 - 15) - StoryPageID to update. * @param p2 unused * @param text title text of the story page. * @return the cost of this operation or an error */ -CommandCost CmdSetStoryPageTitle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetStoryPageTitle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); @@ -354,14 +354,14 @@ CommandCost CmdSetStoryPageTitle(TileIndex tile, DoCommandFlag flags, uint32 p1, /** * Update date of a story page. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 = (bit 0 - 15) - StoryPageID to update. * @param p2 = (bit 0 - 31) - date * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetStoryPageDate(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetStoryPageDate(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); @@ -381,14 +381,14 @@ CommandCost CmdSetStoryPageDate(TileIndex tile, DoCommandFlag flags, uint32 p1, /** * Display a story page for all clients that are allowed to * view the story page. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 = (bit 0 - 15) - StoryPageID to show. * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdShowStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdShowStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); @@ -403,14 +403,14 @@ CommandCost CmdShowStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, uin } /** * Remove a story page and associated story page elements. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 = (bit 0 - 15) - StoryPageID to remove. * @param p2 unused. * @param text unused. * @return the cost of this operation or an error */ -CommandCost CmdRemoveStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; StoryPageID page_id = (StoryPageID)p1; @@ -436,14 +436,14 @@ CommandCost CmdRemoveStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, u /** * Remove a story page element - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 = (bit 0 - 15) - StoryPageElementID to remove. * @param p2 unused. * @param text unused. * @return the cost of this operation or an error */ -CommandCost CmdRemoveStoryPageElement(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveStoryPageElement(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; StoryPageElementID page_element_id = (StoryPageElementID)p1; @@ -463,14 +463,14 @@ CommandCost CmdRemoveStoryPageElement(TileIndex tile, DoCommandFlag flags, uint3 /** * Clicked/used a button on a story page. - * @param tile Tile selected, for tile selection buttons, otherwise unused. * @param flags Type of operation. + * @param tile Tile selected, for tile selection buttons, otherwise unused. * @param p1 Bit 0..15 = story page element id of button. * @param p2 ID of selected item for buttons that select an item (e.g. vehicle), otherwise unused. * @param text Unused. * @return The cost of the operation, or an error. */ -CommandCost CmdStoryPageButton(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdStoryPageButton(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { StoryPageElementID page_element_id = (StoryPageElementID)GB(p1, 0, 16); diff --git a/src/subsidy.cpp b/src/subsidy.cpp index ecead2612e..992c7a6726 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -231,8 +231,8 @@ void CreateSubsidy(CargoID cid, SourceType src_type, SourceID src, SourceType ds /** * Create a new subsidy. - * @param tile unused. * @param flags type of operation + * @param tile unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 7) - SourceType of source. * - p1 = (bit 8 - 23) - SourceID of source. @@ -243,7 +243,7 @@ void CreateSubsidy(CargoID cid, SourceType src_type, SourceID src, SourceType ds * @param text unused. * @return the cost of this operation or an error */ -CommandCost CmdCreateSubsidy(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateSubsidy(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (!Subsidy::CanAllocateItem()) return CMD_ERROR; diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index 723b3953ed..17da36ecc8 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -179,14 +179,14 @@ static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int /** * Terraform land - * @param tile tile to terraform * @param flags for this command type + * @param tile tile to terraform * @param p1 corners to terraform (SLOPE_xxx) * @param p2 direction; eg up (non-zero) or down (zero) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { _terraform_err_tile = INVALID_TILE; @@ -334,8 +334,8 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin /** * Levels a selected (rectangle) area of land - * @param tile end tile of area-drag * @param flags for this command type + * @param tile end tile of area-drag * @param p1 start tile of area drag * @param p2 various bitstuffed data. * bit 0: Whether to use the Orthogonal (0) or Diagonal (1) iterator. @@ -343,7 +343,7 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (p1 >= MapSize()) return CMD_ERROR; diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index a83e877a7f..c889e5374f 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -86,8 +86,8 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 val, /** * Change timetable data of an order. - * @param tile Not used. * @param flags Operation to perform. + * @param tile Not used. * @param p1 Various bitstuffed elements * - p1 = (bit 0-19) - Vehicle with the orders to change. * - p1 = (bit 20-27) - Order index to modify. @@ -98,7 +98,7 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 val, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdChangeTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh = GB(p1, 0, 20); @@ -184,15 +184,15 @@ CommandCost CmdChangeTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, u /** * Clear the lateness counter to make the vehicle on time. - * @param tile Not used. * @param flags Operation to perform. + * @param tile Not used. * @param p1 Various bitstuffed elements * - p1 = (bit 0-19) - Vehicle with the orders to change. * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSetVehicleOnTime(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetVehicleOnTime(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh = GB(p1, 0, 20); @@ -250,8 +250,8 @@ static bool VehicleTimetableSorter(Vehicle * const &a, Vehicle * const &b) /** * Set the start date of the timetable. - * @param tile Not used. * @param flags Operation to perform. + * @param tile Not used. * @param p2 Various bitstuffed elements * - p2 = (bit 0-19) - Vehicle ID. * - p2 = (bit 20) - Set to 1 to set timetable start for all vehicles sharing this order @@ -259,7 +259,7 @@ static bool VehicleTimetableSorter(Vehicle * const &a, Vehicle * const &b) * @param text Not used. * @return The error or cost of the operation. */ -CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetTimetableStart(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { bool timetable_all = HasBit(p1, 20); Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20)); @@ -315,8 +315,8 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, * Start or stop filling the timetable automatically from the time the vehicle * actually takes to complete it. When starting to autofill the current times * are cleared and the timetable will start again from scratch. - * @param tile Not used. * @param flags Operation to perform. + * @param tile Not used. * @param p1 Vehicle index. * @param p2 Various bitstuffed elements * - p2 = (bit 0) - Set to 1 to enable, 0 to disable autofill. @@ -324,7 +324,7 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdAutofillTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAutofillTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID veh = GB(p1, 0, 20); diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 542d1bc394..2f961b9cb0 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1923,8 +1923,8 @@ static bool IsUniqueTownName(const std::string &name) /** * Create a new town. - * @param tile coordinates where town is built * @param flags type of operation + * @param tile coordinates where town is built * @param p1 0..1 size of the town (@see TownSize) * 2 true iff it should be a city * 3..5 town road layout (@see TownLayout) @@ -1933,7 +1933,7 @@ static bool IsUniqueTownName(const std::string &name) * @param text Custom name for the town. If empty, the town name parts will be used. * @return the cost of this operation or an error */ -CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { TownSize size = Extract(p1); bool city = HasBit(p1, 2); @@ -2735,14 +2735,14 @@ void ClearTownHouse(Town *t, TileIndex tile) /** * Rename a town (server-only). - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 town ID to rename * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Town *t = Town::GetIfValid(p1); if (t == nullptr) return CMD_ERROR; @@ -2786,8 +2786,8 @@ const CargoSpec *FindFirstCargoWithTownEffect(TownEffect effect) /** * Change the cargo goal of a town. - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 various bitstuffed elements * - p1 = (bit 0 - 15) - Town ID to cargo game of. * - p1 = (bit 16 - 23) - TownEffect to change the game of. @@ -2795,7 +2795,7 @@ const CargoSpec *FindFirstCargoWithTownEffect(TownEffect effect) * @param text Unused. * @return Empty cost or an error. */ -CommandCost CmdTownCargoGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownCargoGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; @@ -2821,14 +2821,14 @@ CommandCost CmdTownCargoGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uin /** * Set a custom text in the Town window. - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 Town ID to change the text of. * @param p2 Unused. * @param text The new text (empty to remove the text). * @return Empty cost or an error. */ -CommandCost CmdTownSetText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownSetText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; Town *t = Town::GetIfValid(p1); @@ -2845,14 +2845,14 @@ CommandCost CmdTownSetText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /** * Change the growth rate of the town. - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 Town ID to cargo game of. * @param p2 Amount of days between growth, or TOWN_GROWTH_RATE_NONE, or 0 to reset custom growth rate. * @param text Unused. * @return Empty cost or an error. */ -CommandCost CmdTownGrowthRate(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownGrowthRate(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; if (GB(p2, 16, 16) != 0) return CMD_ERROR; @@ -2885,14 +2885,14 @@ CommandCost CmdTownGrowthRate(TileIndex tile, DoCommandFlag flags, uint32 p1, ui /** * Change the rating of a company in a town - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 Bit 0..15 = Town ID to change, bit 16..23 = Company ID to change. * @param p2 Bit 0..15 = New rating of company (signed int16). * @param text Unused. * @return Empty cost or an error. */ -CommandCost CmdTownRating(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownRating(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; @@ -2914,14 +2914,14 @@ CommandCost CmdTownRating(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /** * Expand a town (scenario editor only). - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 Town ID to expand. * @param p2 Amount to grow, or 0 to grow a random size up to the current amount of houses. * @param text Unused. * @return Empty cost or an error. */ -CommandCost CmdExpandTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdExpandTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_game_mode != GM_EDITOR && _current_company != OWNER_DEITY) return CMD_ERROR; Town *t = Town::GetIfValid(p1); @@ -2954,14 +2954,14 @@ CommandCost CmdExpandTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /** * Delete a town (scenario editor or worldgen only). - * @param tile Unused. * @param flags Type of operation. + * @param tile Unused. * @param p1 Town ID to delete. * @param p2 Unused. * @param text Unused. * @return Empty cost or an error. */ -CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDeleteTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_game_mode != GM_EDITOR && !_generating_world) return CMD_ERROR; Town *t = Town::GetIfValid(p1); @@ -3340,14 +3340,14 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t) * Do a town action. * This performs an action such as advertising, building a statue, funding buildings, * but also bribing the town-council - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 town to do the action at * @param p2 action to perform, @see _town_action_proc for the list of available actions * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdDoTownAction(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDoTownAction(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Town *t = Town::GetIfValid(p1); if (t == nullptr || p2 >= lengthof(_town_action_proc)) return CMD_ERROR; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index ad9f6e90d3..5a36d0d868 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -584,13 +584,13 @@ void GetTrainSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, /** * Build a railroad wagon. - * @param tile tile of the depot where rail-vehicle is built. * @param flags type of operation. + * @param tile tile of the depot where rail-vehicle is built. * @param e the engine to build. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const Engine *e, Vehicle **ret) +static CommandCost CmdBuildRailWagon(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **ret) { const RailVehicleInfo *rvi = &e->u.rail; @@ -714,18 +714,18 @@ static void AddRearEngineToMultiheadedTrain(Train *v) /** * Build a railroad vehicle. - * @param tile tile of the depot where rail-vehicle is built. * @param flags type of operation. + * @param tile tile of the depot where rail-vehicle is built. * @param e the engine to build. * @param data bit 0 prevents any free cars from being added to the train. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) { const RailVehicleInfo *rvi = &e->u.rail; - if (rvi->railveh_type == RAILVEH_WAGON) return CmdBuildRailWagon(tile, flags, e, ret); + if (rvi->railveh_type == RAILVEH_WAGON) return CmdBuildRailWagon(flags, tile, e, ret); /* Check if depot and new engine uses the same kind of tracks * * We need to see if the engine got power on the tile to avoid electric engines in non-electric depots */ @@ -1159,9 +1159,9 @@ static void NormaliseTrainHead(Train *head) /** * Move a rail vehicle around inside the depot. - * @param tile unused * @param flags type of operation * Note: DC_AUTOREPLACE is set when autoreplace tries to undo its modifications or moves vehicles to temporary locations inside the depot. + * @param tile unused * @param p1 various bitstuffed elements * - p1 (bit 0 - 19) source vehicle index * - p1 (bit 20) move all vehicles following the source vehicle @@ -1169,7 +1169,7 @@ static void NormaliseTrainHead(Train *head) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMoveRailVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleID s = GB(p1, 0, 20); VehicleID d = GB(p2, 0, 20); @@ -1916,7 +1916,7 @@ void ReverseTrainDirection(Train *v) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdReverseTrainDirection(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdReverseTrainDirection(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Train *v = Train::GetIfValid(p1); if (v == nullptr) return CMD_ERROR; @@ -1982,14 +1982,14 @@ CommandCost CmdReverseTrainDirection(TileIndex tile, DoCommandFlag flags, uint32 /** * Force a train through a red signal - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 train to ignore the red signal * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdForceTrainProceed(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdForceTrainProceed(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Train *t = Train::GetIfValid(p1); if (t == nullptr) return CMD_ERROR; diff --git a/src/train_cmd.h b/src/train_cmd.h index 3dc54678e8..f9452f1b51 100644 --- a/src/train_cmd.h +++ b/src/train_cmd.h @@ -14,7 +14,7 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *v, uint16 data, uint32 user); CommandProc CmdMoveRailVehicle; diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 20943e02e6..a16ad7b824 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -379,14 +379,14 @@ void GenerateTrees() /** * Plant a tree. - * @param tile end tile of area-drag * @param flags type of operation + * @param tile end tile of area-drag * @param p1 tree type, TREE_INVALID means random. * @param p2 start tile of area-drag of tree plantation * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdPlantTree(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { StringID msg = INVALID_STRING_ID; CommandCost cost(EXPENSES_OTHER); diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 4c7836a7a3..07fcd4446a 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -248,8 +248,8 @@ static Money TunnelBridgeClearCost(TileIndex tile, Price base_price) /** * Build a Bridge - * @param end_tile end tile * @param flags type of operation + * @param end_tile end tile * @param p1 packed start tile coords (~ dx) * @param p2 various bitstuffed elements * - p2 = (bit 0- 7) - bridge type (hi bh) @@ -258,7 +258,7 @@ static Money TunnelBridgeClearCost(TileIndex tile, Price base_price) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, uint32 p2, const std::string &text) { CompanyID company = _current_company; @@ -623,15 +623,15 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u /** * Build Tunnel. - * @param start_tile start tile of tunnel * @param flags type of operation + * @param start_tile start tile of tunnel * @param p1 bit 0-5 railtype or roadtype * bit 8-9 transport type * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) { CompanyID company = _current_company; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 472d10459b..fe400bdab2 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -74,8 +74,8 @@ const StringID _send_to_depot_msg_table[] = { /** * Build a vehicle. - * @param tile tile of depot where the vehicle is built * @param flags for command + * @param tile tile of depot where the vehicle is built * @param p1 various bitstuffed data * bits 0-15: vehicle type being built. * bits 16-23: vehicle type specific bits passed on to the vehicle build functions. @@ -84,7 +84,7 @@ const StringID _send_to_depot_msg_table[] = { * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Elementary check for valid location. */ if (!IsDepotTile(tile) || !IsTileOwner(tile, _current_company)) return CMD_ERROR; @@ -137,10 +137,10 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint Vehicle *v = nullptr; switch (type) { - case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(tile, subflags, e, GB(p1, 16, 8), &v)); break; - case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(tile, subflags, e, GB(p1, 16, 8), &v)); break; - case VEH_SHIP: value.AddCost(CmdBuildShip (tile, subflags, e, GB(p1, 16, 8), &v)); break; - case VEH_AIRCRAFT: value.AddCost(CmdBuildAircraft (tile, subflags, e, GB(p1, 16, 8), &v)); break; + case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(subflags, tile, e, GB(p1, 16, 8), &v)); break; + case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(subflags, tile, e, GB(p1, 16, 8), &v)); break; + case VEH_SHIP: value.AddCost(CmdBuildShip (subflags, tile, e, GB(p1, 16, 8), &v)); break; + case VEH_AIRCRAFT: value.AddCost(CmdBuildAircraft (subflags, tile, e, GB(p1, 16, 8), &v)); break; default: NOT_REACHED(); // Safe due to IsDepotTile() } @@ -152,7 +152,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (refitting) { /* Refit only one vehicle. If we purchased an engine, it may have gained free wagons. */ - value.AddCost(CmdRefitVehicle(tile, flags, v->index, cargo | (1 << 16), {})); + value.AddCost(CmdRefitVehicle(flags, tile, v->index, cargo | (1 << 16), {})); } else { /* Fill in non-refitted capacities */ _returned_refit_capacity = e->GetDisplayDefaultCapacity(&_returned_mail_refit_capacity); @@ -202,7 +202,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint * @param text unused. * @return the cost of this operation or an error. */ -CommandCost CmdSellVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20)); if (v == nullptr) return CMD_ERROR; @@ -451,8 +451,8 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, /** * Refits a vehicle to the specified cargo type. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 vehicle ID to refit * @param p2 various bitstuffed elements * - p2 = (bit 0-7) - New cargo type to refit to. @@ -464,7 +464,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRefitVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Vehicle *v = Vehicle::GetIfValid(p1); if (v == nullptr) return CMD_ERROR; @@ -545,14 +545,14 @@ CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /** * Start/Stop a vehicle - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 vehicle to start/stop, don't forget to change CcStartStopVehicle if you modify this! * @param p2 bit 0: Shall the start/stop newgrf callback be evaluated (only valid with DC_AUTOREPLACE for network safety) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* Disable the effect of p2 bit 0, when DC_AUTOREPLACE is not set */ if ((flags & DC_AUTOREPLACE) == 0) SetBit(p2, 0); @@ -627,8 +627,8 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, /** * Starts or stops a lot of vehicles - * @param tile Tile of the depot where the vehicles are started/stopped (only used for depots) * @param flags type of operation + * @param tile Tile of the depot where the vehicles are started/stopped (only used for depots) * @param p1 bitmask * - bit 0 set = start vehicles, unset = stop vehicles * - bit 1 if set, then it's a vehicle list window, not a depot and Tile is ignored in this case @@ -636,7 +636,7 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleList list; bool do_start = HasBit(p1, 0); @@ -669,14 +669,14 @@ CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 /** * Sells all vehicles in a depot - * @param tile Tile of the depot where the depot is * @param flags type of operation + * @param tile Tile of the depot where the depot is * @param p1 Vehicle type * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleList list; @@ -705,14 +705,14 @@ CommandCost CmdDepotSellAllVehicles(TileIndex tile, DoCommandFlag flags, uint32 /** * Autoreplace all vehicles in the depot - * @param tile Tile of the depot where the vehicles are * @param flags type of operation + * @param tile Tile of the depot where the vehicles are * @param p1 Type of vehicle * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdDepotMassAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDepotMassAutoReplace(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { VehicleList list; CommandCost cost = CommandCost(EXPENSES_NEW_VEHICLES); @@ -809,14 +809,14 @@ static void CloneVehicleName(const Vehicle *src, Vehicle *dst) /** * Clone a vehicle. If it is a train, it will clone all the cars too - * @param tile tile of the depot where the cloned vehicle is build * @param flags type of operation + * @param tile tile of the depot where the cloned vehicle is build * @param p1 the original vehicle's index * @param p2 1 = shared orders, else copied orders * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { CommandCost total_cost(EXPENSES_NEW_VEHICLES); @@ -1029,8 +1029,8 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con /** * Send a vehicle to the depot. - * @param tile unused * @param flags for command type + * @param tile unused * @param p1 bitmask * - p1 0-20: bitvehicle ID to send to the depot * - p1 bits 25-8 - DEPOT_ flags (see vehicle_type.h) @@ -1038,7 +1038,7 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdSendVehicleToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSendVehicleToDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (p1 & DEPOT_MASS_SEND) { /* Mass goto depot requested */ @@ -1056,14 +1056,14 @@ CommandCost CmdSendVehicleToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1 /** * Give a custom name to your vehicle - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 vehicle ID to name * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Vehicle *v = Vehicle::GetIfValid(p1); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; @@ -1094,8 +1094,8 @@ CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uin /** * Change the service interval of a vehicle - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 vehicle ID that is being service-interval-changed * @param p2 bitmask * - p2 = (bit 0-15) - new service interval @@ -1104,7 +1104,7 @@ CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uin * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdChangeServiceInt(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeServiceInt(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Vehicle *v = Vehicle::GetIfValid(p1); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; diff --git a/src/viewport.cpp b/src/viewport.cpp index 3a10041647..1509b028c6 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -3466,14 +3466,14 @@ void InitializeSpriteSorter() /** * Scroll players main viewport. - * @param tile tile to center viewport on * @param flags type of operation + * @param tile tile to center viewport on * @param p1 ViewportScrollTarget of scroll target * @param p2 company or client id depending on the target * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdScrollViewport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdScrollViewport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; ViewportScrollTarget target = (ViewportScrollTarget)p1; diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 152e956b11..145b8084dc 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -92,14 +92,14 @@ static void MarkCanalsAndRiversAroundDirty(TileIndex tile) /** * Build a ship depot. - * @param tile tile where ship depot is built * @param flags type of operation + * @param tile tile where ship depot is built * @param p1 bit 0 depot orientation (Axis) * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildShipDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Axis axis = Extract(p1); @@ -411,14 +411,14 @@ static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags) /** * Builds a lock. - * @param tile tile where to place the lock * @param flags type of operation + * @param tile tile where to place the lock * @param p1 unused * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildLock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildLock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); if (dir == INVALID_DIAGDIR) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); @@ -435,8 +435,8 @@ bool RiverModifyDesertZone(TileIndex tile, void *) /** * Build a piece of canal. - * @param tile end tile of stretch-dragging * @param flags type of operation + * @param tile end tile of stretch-dragging * @param p1 start tile of stretch-dragging * @param p2 various bitstuffed data * bits 0-1: waterclass to build. sea and river can only be built in scenario editor @@ -444,7 +444,7 @@ bool RiverModifyDesertZone(TileIndex tile, void *) * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { WaterClass wc = Extract(p2); if (p1 >= MapSize() || wc == WATER_CLASS_INVALID) return CMD_ERROR; diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index d55b8f0eba..a95d5c9540 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -161,8 +161,8 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, /** * Convert existing rail to waypoint. Eg build a waypoint station over * piece of rail - * @param start_tile northern most tile where waypoint will be built * @param flags type of operation + * @param start_tile northern most tile where waypoint will be built * @param p1 various bitstuffed elements * - p1 = (bit 0- 5) - railtype (not used) * - p1 = (bit 6) - orientation (Axis) @@ -175,7 +175,7 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) { /* Unpack parameters */ Axis axis = Extract(p1); @@ -296,14 +296,14 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint /** * Build a buoy. - * @param tile tile where to place the buoy * @param flags operation to perform + * @param tile tile where to place the buoy * @param p1 unused * @param p2 unused * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildBuoy(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildBuoy(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (tile == 0 || !HasTileWaterGround(tile)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE); if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -407,14 +407,14 @@ static bool IsUniqueWaypointName(const std::string &name) /** * Rename a waypoint. - * @param tile unused * @param flags type of operation + * @param tile unused * @param p1 id of waypoint * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameWaypoint(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { Waypoint *wp = Waypoint::GetIfValid(p1); if (wp == nullptr) return CMD_ERROR; From 123c7f99c342aa9eb7ca505f0b49257fc8eee7ff Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 10 Oct 2021 02:35:06 +0200 Subject: [PATCH 109/710] Codechange: Move command callback declarations to the cmd header files. --- src/CMakeLists.txt | 2 ++ src/airport_cmd.h | 17 ++++++++++ src/airport_gui.cpp | 1 + src/build_vehicle_gui.cpp | 2 ++ src/command_func.h | 56 --------------------------------- src/depot_cmd.h | 2 ++ src/dock_cmd.h | 18 +++++++++++ src/dock_gui.cpp | 2 ++ src/group_cmd.h | 3 ++ src/group_gui.cpp | 1 + src/industry_cmd.h | 2 ++ src/network/network_command.cpp | 13 ++++++++ src/object_gui.cpp | 1 + src/rail_cmd.h | 5 +++ src/road_cmd.h | 5 +++ src/script/CMakeLists.txt | 1 + src/script/script_cmd.h | 18 +++++++++++ src/terraform_cmd.h | 4 +++ src/terraform_gui.cpp | 2 ++ src/town_cmd.h | 3 ++ src/train_cmd.h | 2 ++ src/tunnelbridge_cmd.h | 2 ++ src/vehicle_cmd.h | 3 ++ src/vehicle_gui.cpp | 1 + 24 files changed, 110 insertions(+), 56 deletions(-) create mode 100644 src/airport_cmd.h create mode 100644 src/dock_cmd.h create mode 100644 src/script/script_cmd.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6950e32757..dd3a6c2f06 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,6 +42,7 @@ add_files( aircraft_gui.cpp airport.cpp airport.h + airport_cmd.h airport_gui.cpp animated_tile.cpp animated_tile_func.h @@ -131,6 +132,7 @@ add_files( direction_type.h disaster_vehicle.cpp disaster_vehicle.h + dock_cmd.h dock_gui.cpp driver.cpp driver.h diff --git a/src/airport_cmd.h b/src/airport_cmd.h new file mode 100644 index 0000000000..2e27057d8c --- /dev/null +++ b/src/airport_cmd.h @@ -0,0 +1,17 @@ +/* + * 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 airport_cmd.h Command definitions related to airports. */ + +#ifndef AIRPORT_CMD_H +#define AIRPORT_CMD_H + +#include "command_type.h" + +CommandCallback CcBuildAirport; + +#endif /* AIRPORT_CMD_H */ diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index a031c450c3..ca3d8aa71d 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -26,6 +26,7 @@ #include "hotkeys.h" #include "vehicle_func.h" #include "gui.h" +#include "airport_cmd.h" #include "widgets/airport_widget.h" diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index b1136ec302..34d771090a 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -30,6 +30,8 @@ #include "cargotype.h" #include "core/geometry_func.hpp" #include "autoreplace_func.h" +#include "train_cmd.h" +#include "vehicle_cmd.h" #include "widgets/build_vehicle_widget.h" diff --git a/src/command_func.h b/src/command_func.h index 15c88ea034..03bfc73f1b 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -67,60 +67,4 @@ static inline DoCommandFlag CommandFlagsToDCFlags(CommandFlags cmd_flags) return flags; } -/*** All command callbacks that exist ***/ - -/* ai/ai_instance.cpp */ -CommandCallback CcAI; - -/* airport_gui.cpp */ -CommandCallback CcBuildAirport; - -/* bridge_gui.cpp */ -CommandCallback CcBuildBridge; - -/* dock_gui.cpp */ -CommandCallback CcBuildDocks; -CommandCallback CcPlaySound_CONSTRUCTION_WATER; - -/* depot_gui.cpp */ -CommandCallback CcCloneVehicle; - -/* game/game_instance.cpp */ -CommandCallback CcGame; - -/* group_gui.cpp */ -CommandCallback CcCreateGroup; -CommandCallback CcAddVehicleNewGroup; - -/* industry_gui.cpp */ -CommandCallback CcBuildIndustry; - -/* main_gui.cpp */ -CommandCallback CcPlaySound_EXPLOSION; -CommandCallback CcPlaceSign; -CommandCallback CcTerraform; - -/* rail_gui.cpp */ -CommandCallback CcPlaySound_CONSTRUCTION_RAIL; -CommandCallback CcRailDepot; -CommandCallback CcStation; -CommandCallback CcBuildRailTunnel; - -/* road_gui.cpp */ -CommandCallback CcPlaySound_CONSTRUCTION_OTHER; -CommandCallback CcBuildRoadTunnel; -CommandCallback CcRoadDepot; -CommandCallback CcRoadStop; - -/* train_gui.cpp */ -CommandCallback CcBuildWagon; - -/* town_gui.cpp */ -CommandCallback CcFoundTown; -CommandCallback CcFoundRandomTown; - -/* vehicle_gui.cpp */ -CommandCallback CcBuildPrimaryVehicle; -CommandCallback CcStartStopVehicle; - #endif /* COMMAND_FUNC_H */ diff --git a/src/depot_cmd.h b/src/depot_cmd.h index 9c39db1e2e..cc9701fb7f 100644 --- a/src/depot_cmd.h +++ b/src/depot_cmd.h @@ -16,4 +16,6 @@ CommandProc CmdRenameDepot; DEF_CMD_TRAIT(CMD_RENAME_DEPOT, CmdRenameDepot, 0, CMDT_OTHER_MANAGEMENT) +CommandCallback CcCloneVehicle; + #endif /* DEPOT_CMD_H */ diff --git a/src/dock_cmd.h b/src/dock_cmd.h new file mode 100644 index 0000000000..d1c1324707 --- /dev/null +++ b/src/dock_cmd.h @@ -0,0 +1,18 @@ +/* + * 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 dock_cmd.h Command definitions related to docks. */ + +#ifndef DOCK_CMD_H +#define DOCK_CMD_H + +#include "command_type.h" + +CommandCallback CcBuildDocks; +CommandCallback CcPlaySound_CONSTRUCTION_WATER; + +#endif /* DOCK_CMD_H */ diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index c1f6156122..0ba34e2114 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -25,6 +25,8 @@ #include "hotkeys.h" #include "gui.h" #include "zoom_func.h" +#include "tunnelbridge_cmd.h" +#include "dock_cmd.h" #include "widgets/dock_widget.h" diff --git a/src/group_cmd.h b/src/group_cmd.h index a58a6f8aa5..7f3496cc9c 100644 --- a/src/group_cmd.h +++ b/src/group_cmd.h @@ -30,4 +30,7 @@ DEF_CMD_TRAIT(CMD_REMOVE_ALL_VEHICLES_GROUP, CmdRemoveAllVehiclesGroup, 0, CMDT_ DEF_CMD_TRAIT(CMD_SET_GROUP_FLAG, CmdSetGroupFlag, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_SET_GROUP_LIVERY, CmdSetGroupLivery, 0, CMDT_ROUTE_MANAGEMENT) +CommandCallback CcCreateGroup; +CommandCallback CcAddVehicleNewGroup; + #endif /* GROUP_CMD_H */ diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 316cdc4f3c..f72d9d2d6a 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -25,6 +25,7 @@ #include "company_base.h" #include "company_gui.h" #include "gui.h" +#include "group_cmd.h" #include "widgets/group_widget.h" diff --git a/src/industry_cmd.h b/src/industry_cmd.h index e1f18932a9..150b59da9b 100644 --- a/src/industry_cmd.h +++ b/src/industry_cmd.h @@ -18,4 +18,6 @@ CommandProc CmdIndustryCtrl; DEF_CMD_TRAIT(CMD_BUILD_INDUSTRY, CmdBuildIndustry, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_INDUSTRY_CTRL, CmdIndustryCtrl, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +CommandCallback CcBuildIndustry; + #endif /* INDUSTRY_CMD_H */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 6df53d7da1..0fae6bcbf0 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -14,6 +14,19 @@ #include "../command_func.h" #include "../company_func.h" #include "../settings_type.h" +#include "../airport_cmd.h" +#include "../depot_cmd.h" +#include "../dock_cmd.h" +#include "../group_cmd.h" +#include "../industry_cmd.h" +#include "../rail_cmd.h" +#include "../road_cmd.h" +#include "../terraform_cmd.h" +#include "../town_cmd.h" +#include "../train_cmd.h" +#include "../tunnelbridge_cmd.h" +#include "../vehicle_cmd.h" +#include "../script/script_cmd.h" #include "../safeguards.h" diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 234e3eab66..a3ea3f8b17 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -24,6 +24,7 @@ #include "window_gui.h" #include "window_func.h" #include "zoom_func.h" +#include "terraform_cmd.h" #include "widgets/object_widget.h" diff --git a/src/rail_cmd.h b/src/rail_cmd.h index e625eb03db..1fb0fdee0d 100644 --- a/src/rail_cmd.h +++ b/src/rail_cmd.h @@ -34,4 +34,9 @@ DEF_CMD_TRAIT(CMD_CONVERT_RAIL, CmdConvertRail, 0, DEF_CMD_TRAIT(CMD_BUILD_SIGNAL_TRACK, CmdBuildSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_REMOVE_SIGNAL_TRACK, CmdRemoveSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +CommandCallback CcPlaySound_CONSTRUCTION_RAIL; +CommandCallback CcRailDepot; +CommandCallback CcStation; +CommandCallback CcBuildRailTunnel; + #endif /* RAIL_CMD_H */ diff --git a/src/road_cmd.h b/src/road_cmd.h index 4908f72e31..05f064b0bc 100644 --- a/src/road_cmd.h +++ b/src/road_cmd.h @@ -29,4 +29,9 @@ DEF_CMD_TRAIT(CMD_BUILD_ROAD, CmdBuildRoad, CMD_AUTO | CMD_NO_WATER | DEF_CMD_TRAIT(CMD_BUILD_ROAD_DEPOT, CmdBuildRoadDepot, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_CONVERT_ROAD, CmdConvertRoad, 0, CMDT_LANDSCAPE_CONSTRUCTION) +CommandCallback CcPlaySound_CONSTRUCTION_OTHER; +CommandCallback CcBuildRoadTunnel; +CommandCallback CcRoadDepot; +CommandCallback CcRoadStop; + #endif /* ROAD_CMD_H */ diff --git a/src/script/CMakeLists.txt b/src/script/CMakeLists.txt index f4b87dc3b8..d1054ca5f8 100644 --- a/src/script/CMakeLists.txt +++ b/src/script/CMakeLists.txt @@ -5,6 +5,7 @@ if(OPTION_TOOLS_ONLY) endif() add_files( + script_cmd.h script_config.cpp script_config.hpp script_fatalerror.hpp diff --git a/src/script/script_cmd.h b/src/script/script_cmd.h new file mode 100644 index 0000000000..bf6aa50c72 --- /dev/null +++ b/src/script/script_cmd.h @@ -0,0 +1,18 @@ +/* + * 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_cmd.h Command definitions related to scripts. */ + +#ifndef SCRIPT_CMD_H +#define SCRIPT_CMD_H + +#include "../command_type.h" + +CommandCallback CcAI; +CommandCallback CcGame; + +#endif /* SCRIPT_CMD_H */ diff --git a/src/terraform_cmd.h b/src/terraform_cmd.h index 88aeaec4cb..9b5866efaf 100644 --- a/src/terraform_cmd.h +++ b/src/terraform_cmd.h @@ -18,4 +18,8 @@ CommandProc CmdLevelLand; DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once +CommandCallback CcPlaySound_EXPLOSION; +CommandCallback CcPlaceSign; +CommandCallback CcTerraform; + #endif /* TERRAFORM_CMD_H */ diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 0325a957ff..a558332791 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -31,7 +31,9 @@ #include "hotkeys.h" #include "engine_base.h" #include "terraform_gui.h" +#include "terraform_cmd.h" #include "zoom_func.h" +#include "rail_cmd.h" #include "widgets/terraform_widget.h" diff --git a/src/town_cmd.h b/src/town_cmd.h index bd4f4de11c..7842e7ddaa 100644 --- a/src/town_cmd.h +++ b/src/town_cmd.h @@ -32,4 +32,7 @@ DEF_CMD_TRAIT(CMD_TOWN_SET_TEXT, CmdTownSetText, CMD_DEITY | CMD_STR_CTRL, DEF_CMD_TRAIT(CMD_EXPAND_TOWN, CmdExpandTown, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_DELETE_TOWN, CmdDeleteTown, CMD_OFFLINE, CMDT_LANDSCAPE_CONSTRUCTION) +CommandCallback CcFoundTown; +CommandCallback CcFoundRandomTown; + #endif /* TOWN_CMD_H */ diff --git a/src/train_cmd.h b/src/train_cmd.h index f9452f1b51..7b286e9983 100644 --- a/src/train_cmd.h +++ b/src/train_cmd.h @@ -25,4 +25,6 @@ DEF_CMD_TRAIT(CMD_MOVE_RAIL_VEHICLE, CmdMoveRailVehicle, 0, CMDT_VEH DEF_CMD_TRAIT(CMD_FORCE_TRAIN_PROCEED, CmdForceTrainProceed, 0, CMDT_VEHICLE_MANAGEMENT) DEF_CMD_TRAIT(CMD_REVERSE_TRAIN_DIRECTION, CmdReverseTrainDirection, 0, CMDT_VEHICLE_MANAGEMENT) +CommandCallback CcBuildWagon; + #endif /* TRAIN_CMD_H */ diff --git a/src/tunnelbridge_cmd.h b/src/tunnelbridge_cmd.h index 58cb9b32ae..6c78db48b1 100644 --- a/src/tunnelbridge_cmd.h +++ b/src/tunnelbridge_cmd.h @@ -18,4 +18,6 @@ CommandProc CmdBuildTunnel; DEF_CMD_TRAIT(CMD_BUILD_BRIDGE, CmdBuildBridge, CMD_DEITY | CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_BUILD_TUNNEL, CmdBuildTunnel, CMD_DEITY | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) +CommandCallback CcBuildBridge; + #endif /* TUNNELBRIDGE_CMD_H */ diff --git a/src/vehicle_cmd.h b/src/vehicle_cmd.h index a2d8d62bf7..e6872e838b 100644 --- a/src/vehicle_cmd.h +++ b/src/vehicle_cmd.h @@ -36,4 +36,7 @@ DEF_CMD_TRAIT(CMD_MASS_START_STOP, CmdMassStartStopVehicle, 0, DEF_CMD_TRAIT(CMD_DEPOT_SELL_ALL_VEHICLES, CmdDepotSellAllVehicles, 0, CMDT_VEHICLE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_DEPOT_MASS_AUTOREPLACE, CmdDepotMassAutoReplace, 0, CMDT_VEHICLE_CONSTRUCTION) +CommandCallback CcBuildPrimaryVehicle; +CommandCallback CcStartStopVehicle; + #endif /* VEHICLE_CMD_H */ diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 69fb158460..abe1b9dd97 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -36,6 +36,7 @@ #include "station_base.h" #include "tilehighlight_func.h" #include "zoom_func.h" +#include "depot_cmd.h" #include "safeguards.h" From 4fc055d6e97e76faf53ff3f29e36a4a4549bf6e7 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 10 Oct 2021 17:20:27 +0200 Subject: [PATCH 110/710] Codechange: Align parameter order of command callbacks to command handlers. --- src/ai/ai_instance.cpp | 5 +++-- src/airport_gui.cpp | 2 +- src/bridge_gui.cpp | 5 +++-- src/command.cpp | 2 +- src/command_type.h | 4 +++- src/depot_gui.cpp | 5 +++-- src/dock_gui.cpp | 4 ++-- src/game/game_instance.cpp | 5 +++-- src/group_gui.cpp | 12 +++++++----- src/industry_gui.cpp | 5 +++-- src/main_gui.cpp | 2 +- src/rail_gui.cpp | 8 ++++---- src/road_gui.cpp | 14 ++++++++------ src/signs_cmd.cpp | 5 +++-- src/terraform_gui.cpp | 2 +- src/town_gui.cpp | 4 ++-- src/train_gui.cpp | 5 +++-- src/vehicle_gui.cpp | 9 ++++++--- 18 files changed, 57 insertions(+), 41 deletions(-) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index da79d7c132..509ed70d2e 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -93,12 +93,13 @@ ScriptInfo *AIInstance::FindLibrary(const char *library, int version) /** * DoCommand callback function for all commands executed by AIs. * @param result The result of the command. + * @param cmd cmd as given to DoCommandPInternal. * @param tile The tile on which the command was executed. * @param p1 p1 as given to DoCommandPInternal. * @param p2 p2 as given to DoCommandPInternal. - * @param cmd cmd as given to DoCommandPInternal. + * @param text text as given to DoCommandPInternal. */ -void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcAI(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { /* * The company might not exist anymore. Check for this. diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index ca3d8aa71d..41fde9b8ce 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -41,7 +41,7 @@ static void ShowBuildAirportPicker(Window *parent); SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout); -void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildAirport(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index d5347989ed..3524b357c3 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -50,15 +50,16 @@ typedef GUIList GUIBridgeList; ///< List of bridges, used in #B * Callback executed after a build Bridge CMD has been called * * @param result Whether the build succeeded + * @param cmd unused * @param end_tile End tile of the bridge. * @param p1 packed start tile coords (~ dx) * @param p2 various bitstuffed elements * - p2 = (bit 0- 7) - bridge type (hi bh) * - p2 = (bit 8-13) - rail type or road types. * - p2 = (bit 15-16) - transport type. - * @param cmd unused + * @param text unused */ -void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildBridge(const CommandCost &result, Commands cmd, TileIndex end_tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile); diff --git a/src/command.cpp b/src/command.cpp index fccbe6148f..001f2ee7d1 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -318,7 +318,7 @@ static bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *call } if (!estimate_only && !only_sending && callback != nullptr) { - callback(res, tile, p1, p2, cmd); + callback(res, cmd, tile, p1, p2, text); } return res.Succeeded(); diff --git a/src/command_type.h b/src/command_type.h index 2bd0fee900..fa381ce133 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -443,12 +443,14 @@ template struct CommandTraits; * command succeeded or failed. * * @param result The result of the executed command + * @param cmd The command that was executed * @param tile The tile of the command action * @param p1 Additional data of the command * @param p1 Additional data of the command + * @param text Text of the command * @see CommandProc */ -typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd); +typedef void CommandCallback(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); /** * Structure for buffering the build command when selecting a station to join. diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 8515258f0f..0aba48e40c 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -112,12 +112,13 @@ extern void DepotSortList(VehicleList *list); /** * This is the Callback method after the cloning attempt of a vehicle * @param result the result of the cloning command + * @param cmd unused * @param tile unused * @param p1 unused * @param p2 unused - * @param cmd unused + * @param text unused */ -void CcCloneVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcCloneVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 0ba34e2114..52b1483815 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -40,7 +40,7 @@ static void ShowBuildDocksDepotPicker(Window *parent); static Axis _ship_depot_direction; -void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildDocks(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; @@ -48,7 +48,7 @@ void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcPlaySound_CONSTRUCTION_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcPlaySound_CONSTRUCTION_WATER(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_CONSTRUCTION_WATER, tile); } diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index abd0541159..47374525fa 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -82,12 +82,13 @@ void GameInstance::Died() /** * DoCommand callback function for all commands executed by Game Scripts. * @param result The result of the command. + * @param cmd cmd as given to DoCommandPInternal. * @param tile The tile on which the command was executed. * @param p1 p1 as given to DoCommandPInternal. * @param p2 p2 as given to DoCommandPInternal. - * @param cmd cmd as given to DoCommandPInternal. + * @param text text as given to DoCommandPInternal. */ -void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcGame(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2, cmd)) { Game::GetGameInstance()->Continue(); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index f72d9d2d6a..e9ded95367 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1141,13 +1141,14 @@ static inline VehicleGroupWindow *FindVehicleGroupWindow(VehicleType vt, Owner o /** * Opens a 'Rename group' window for newly created group. * @param result Did command succeed? + * @param cmd Unused. * @param tile Unused. * @param p1 Vehicle type. * @param p2 Unused. - * @param cmd Unused. + * @param text Unused. * @see CmdCreateGroup */ -void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcCreateGroup(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; assert(p1 <= VEH_AIRCRAFT); @@ -1159,17 +1160,18 @@ void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 /** * Open rename window after adding a vehicle to a new group via drag and drop. * @param result Did command succeed? + * @param cmd Unused. * @param tile Unused. * @param p1 Unused. * @param p2 Bit 0-19: Vehicle ID. - * @param cmd Unused. + * @param text Unused. */ -void CcAddVehicleNewGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcAddVehicleNewGroup(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; assert(Vehicle::IsValidID(GB(p2, 0, 20))); - CcCreateGroup(result, 0, Vehicle::Get(GB(p2, 0, 20))->type, 0, cmd); + CcCreateGroup(result, cmd, 0, Vehicle::Get(GB(p2, 0, 20))->type, 0, text); } /** diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index cfdd2c6ca3..5aea6f59a4 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -219,12 +219,13 @@ void SortIndustryTypes() /** * Command callback. In case of failure to build an industry, show an error message. * @param result Result of the command. + * @param cmd Unused. * @param tile Tile where the industry is placed. * @param p1 Additional data of the #CMD_BUILD_INDUSTRY command. * @param p2 Additional data of the #CMD_BUILD_INDUSTRY command. - * @param cmd Unused. + * @param text Unused. */ -void CcBuildIndustry(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildIndustry(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded()) return; diff --git a/src/main_gui.cpp b/src/main_gui.cpp index d521f79d1a..a4bec45d5c 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -76,7 +76,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl } -void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcPlaySound_EXPLOSION(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 54bef88fdf..7cf1b0059f 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -85,7 +85,7 @@ static bool IsStationAvailable(const StationSpec *statspec) return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); } -void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); } @@ -128,7 +128,7 @@ static const DiagDirection _place_depot_extra_dir[12] = { DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE, }; -void CcRailDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcRailDepot(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; @@ -169,7 +169,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } } -void CcStation(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcStation(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; @@ -276,7 +276,7 @@ static void PlaceRail_Bridge(TileIndex tile, Window *w) } /** Command callback for building a tunnel */ -void CcBuildRailTunnel(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildRailTunnel(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); diff --git a/src/road_gui.cpp b/src/road_gui.cpp index bdd4353ca8..eedcc8f59c 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -66,7 +66,7 @@ static RoadType _cur_roadtype; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; -void CcPlaySound_CONSTRUCTION_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcPlaySound_CONSTRUCTION_OTHER(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); } @@ -90,13 +90,14 @@ static void PlaceRoad_Bridge(TileIndex tile, Window *w) * Callback executed after a build road tunnel command has been called. * * @param result Whether the build succeeded. + * @param cmd unused * @param start_tile Starting tile of the tunnel. * @param p1 bit 0-3 railtype or roadtypes * bit 8-9 transport type * @param p2 unused - * @param cmd unused + * @param text unused */ -void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildRoadTunnel(const CommandCost &result, Commands cmd, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, start_tile); @@ -129,7 +130,7 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) } } -void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcRoadDepot(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; @@ -142,6 +143,7 @@ void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 /** * Command callback for building road stops. * @param result Result of the build road stop command. + * @param cmd Unused. * @param tile Start tile. * @param p1 bit 0..7: Width of the road stop. * bit 8..15: Length of the road stop. @@ -152,10 +154,10 @@ void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 * bit 3: #Axis of the road for drive-through stops. * bit 5..9: The roadtype. * bit 16..31: Station ID to join (NEW_STATION if build new one). - * @param cmd Unused. + * @param text Unused. * @see CmdBuildRoadStop */ -void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcRoadStop(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index c025b10429..cf742df835 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -110,12 +110,13 @@ CommandCost CmdRenameSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Callback function that is called after a sign is placed * @param result of the operation + * @param cmd unused * @param tile unused * @param p1 unused * @param p2 unused - * @param cmd unused + * @param text unused */ -void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcPlaceSign(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index a558332791..498d057aa1 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -41,7 +41,7 @@ #include "safeguards.h" -void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcTerraform(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 9e1ba39680..660b1ac98a 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -1008,7 +1008,7 @@ void ShowTownDirectory() new TownDirectoryWindow(&_town_directory_desc); } -void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcFoundTown(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; @@ -1016,7 +1016,7 @@ void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcFoundRandomTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcFoundRandomTown(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(_new_town_id)->xy); } diff --git a/src/train_gui.cpp b/src/train_gui.cpp index a630c9fbd1..7031a89684 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -22,12 +22,13 @@ /** * Callback for building wagons. * @param result The result of the command. + * @param cmd Unused. * @param tile The tile the command was executed on. * @param p1 Additional data for the command (for the #CommandProc) * @param p2 Additional data for the command (for the #CommandProc) - * @param cmd Unused. + * @param text Unused. */ -void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildWagon(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index abe1b9dd97..cac1985b96 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2616,11 +2616,13 @@ static const StringID _vehicle_msg_translation_table[][4] = { /** * This is the Callback method after attempting to start/stop a vehicle * @param result the result of the start/stop command + * @param cmd unused * @param tile unused * @param p1 vehicle ID * @param p2 unused + * @param text unused */ -void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcStartStopVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; @@ -3119,12 +3121,13 @@ void StopGlobalFollowVehicle(const Vehicle *v) /** * This is the Callback method after the construction attempt of a primary vehicle * @param result indicates completion (or not) of the operation + * @param cmd unused * @param tile unused * @param p1 unused * @param p2 unused - * @param cmd unused + * @param text unused */ -void CcBuildPrimaryVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +void CcBuildPrimaryVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { if (result.Failed()) return; From b0990fcff7358e839468e5cf811ffddc8b9d73e2 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 6 Nov 2021 23:11:22 +0100 Subject: [PATCH 111/710] Codechange: Make TileIndex a "strong" typedef to give it a distinct type. This is accomplished by changing it to a single member struct with the appropriate operator overloads to make it all work with not too much source modifications. --- src/build_vehicle_gui.cpp | 6 +-- src/cargopacket.cpp | 2 +- src/company_func.h | 2 +- src/company_gui.cpp | 6 +-- src/core/CMakeLists.txt | 1 + src/core/strong_typedef_type.hpp | 73 +++++++++++++++++++++++++++++++ src/disaster_vehicle.cpp | 2 +- src/group_gui.cpp | 4 +- src/map.cpp | 2 +- src/map_func.h | 4 +- src/newgrf_railtype.cpp | 2 +- src/newgrf_roadtype.cpp | 2 +- src/news_gui.cpp | 2 +- src/saveload/oldloader_sl.cpp | 2 +- src/script/api/script_company.cpp | 2 +- src/script/api/script_types.hpp | 2 +- src/script/squirrel_helper.hpp | 3 ++ src/tile_type.h | 24 +++++++++- src/tilearea_type.h | 30 +++++++++++++ src/timetable_gui.cpp | 8 ++-- src/town_gui.cpp | 4 +- src/tree_cmd.cpp | 4 +- src/water_cmd.cpp | 6 +-- 23 files changed, 160 insertions(+), 33 deletions(-) create mode 100644 src/core/strong_typedef_type.hpp diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 34d771090a..7901b45740 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1081,7 +1081,7 @@ struct BuildVehicleWindow : Window { { this->vehicle_type = type; this->listview_mode = tile == INVALID_TILE; - this->window_number = this->listview_mode ? (int)type : tile; + this->window_number = this->listview_mode ? (int)type : (int)tile; this->sel_engine = INVALID_ENGINE; @@ -1116,7 +1116,7 @@ struct BuildVehicleWindow : Window { this->details_height = ((this->vehicle_type == VEH_TRAIN) ? 10 : 9); - this->FinishInitNested(tile == INVALID_TILE ? (int)type : tile); + this->FinishInitNested(tile == INVALID_TILE ? (int)type : (int)tile); this->owner = (tile != INVALID_TILE) ? GetTileOwner(tile) : _local_company; @@ -1683,7 +1683,7 @@ void ShowBuildVehicleWindow(TileIndex tile, VehicleType type) * so if tile == INVALID_TILE (Available XXX Window), use 'type' as unique number. * As it always is a low value, it won't collide with any real tile * number. */ - uint num = (tile == INVALID_TILE) ? (int)type : tile; + uint num = (tile == INVALID_TILE) ? (int)type : (int)tile; assert(IsCompanyBuildableVehicleType(type)); diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index 86bba0261b..e9c6e1aa77 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -75,7 +75,7 @@ CargoPacket::CargoPacket(uint16 count, byte days_in_transit, StationID source, T source_id(source_id), source(source), source_xy(source_xy), - loaded_at_xy(loaded_at_xy) + loaded_at_xy(loaded_at_xy.value) { assert(count != 0); this->source_type = source_type; diff --git a/src/company_func.h b/src/company_func.h index 01f5859104..97e1e6e828 100644 --- a/src/company_func.h +++ b/src/company_func.h @@ -27,7 +27,7 @@ void UpdateLandscapingLimits(); bool CheckCompanyHasMoney(CommandCost &cost); void SubtractMoneyFromCompany(const CommandCost& cost); void SubtractMoneyFromCompanyFract(CompanyID company, const CommandCost& cost); -CommandCost CheckOwnership(Owner owner, TileIndex tile = 0); +CommandCost CheckOwnership(Owner owner, TileIndex tile = 0U); CommandCost CheckTileOwnership(TileIndex tile); extern CompanyID _local_company; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 6ab3b0aa7d..7a6e68dea7 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2576,11 +2576,11 @@ struct CompanyWindow : Window break; case WID_C_BUY_SHARE: - DoCommandP(CMD_BUY_SHARE_IN_COMPANY, STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, 0, this->window_number, 0); + DoCommandP(CMD_BUY_SHARE_IN_COMPANY, STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, (TileIndex)0, this->window_number, 0); break; case WID_C_SELL_SHARE: - DoCommandP(CMD_SELL_SHARE_IN_COMPANY, STR_ERROR_CAN_T_SELL_25_SHARE_IN, 0, this->window_number, 0); + DoCommandP(CMD_SELL_SHARE_IN_COMPANY, STR_ERROR_CAN_T_SELL_25_SHARE_IN, (TileIndex)0, this->window_number, 0); break; case WID_C_COMPANY_PASSWORD: @@ -2771,7 +2771,7 @@ struct BuyCompanyWindow : Window { break; case WID_BC_YES: - DoCommandP(CMD_BUY_COMPANY, STR_ERROR_CAN_T_BUY_COMPANY, 0, this->window_number, 0); + DoCommandP(CMD_BUY_COMPANY, STR_ERROR_CAN_T_BUY_COMPANY, (TileIndex)0, this->window_number, 0); break; } } diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index b94ed77e91..1c14067ae4 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -28,4 +28,5 @@ add_files( smallvec_type.hpp span_type.hpp string_compare_type.hpp + strong_typedef_type.hpp ) diff --git a/src/core/strong_typedef_type.hpp b/src/core/strong_typedef_type.hpp new file mode 100644 index 0000000000..b5df28b2fb --- /dev/null +++ b/src/core/strong_typedef_type.hpp @@ -0,0 +1,73 @@ +/* + * 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 strong_typedef_type.hpp Type (helpers) for making a strong typedef that is a distinct type. */ + +#ifndef STRONG_TYPEDEF_TYPE_HPP +#define STRONG_TYPEDEF_TYPE_HPP + +/** Non-templated base for #StrongTypedef for use with type trait queries. */ +struct StrongTypedefBase {}; + +/** + * Templated helper to make a type-safe 'typedef' representing a single POD value. + * A normal 'typedef' is not distinct from its base type and will be treated as + * identical in many contexts. This class provides a distinct type that can still + * be assign from and compared to values of its base type. + * + * @note This is meant to be used as a base class, not directly. + * @tparam T Storage type + * @tparam Tthis Type of the derived class (i.e. the concrete usage of this class). + */ +template +struct StrongTypedef : StrongTypedefBase { + using Type = T; + + T value{}; ///< Backing storage field. + + constexpr StrongTypedef() = default; + constexpr StrongTypedef(const StrongTypedef &o) = default; + constexpr StrongTypedef(StrongTypedef &&o) = default; + + constexpr StrongTypedef(const T &value) : value(value) {} + + constexpr Tthis &operator =(const StrongTypedef &rhs) { this->value = rhs.value; return static_cast(*this); } + constexpr Tthis &operator =(StrongTypedef &&rhs) { this->value = std::move(rhs.value); return static_cast(*this); } + constexpr Tthis &operator =(const T &rhs) { this->value = rhs; return static_cast(*this); } + + explicit constexpr operator T() const { return this->value; } + + constexpr bool operator ==(const StrongTypedef &rhs) const { return this->value == rhs.value; } + constexpr bool operator !=(const StrongTypedef &rhs) const { return this->value != rhs.value; } + constexpr bool operator ==(const T &rhs) const { return this->value == rhs; } + constexpr bool operator !=(const T &rhs) const { return this->value != rhs; } +}; + +/** + * Extension of #StrongTypedef with operators for addition and subtraction. + * @tparam T Storage type + * @tparam Tthis Type of the derived class (i.e. the concrete usage of this class). + */ +template +struct StrongIntegralTypedef : StrongTypedef { + using StrongTypedef::StrongTypedef; + + constexpr Tthis &operator ++() { this->value++; return static_cast(*this); } + constexpr Tthis &operator --() { this->value--; return static_cast(*this); } + constexpr Tthis operator ++(int) { auto res = static_cast(*this); this->value++; return res; } + constexpr Tthis operator --(int) { auto res = static_cast(*this); this->value--; return res; } + + constexpr Tthis &operator +=(const Tthis &rhs) { this->value += rhs.value; return *static_cast(this); } + constexpr Tthis &operator -=(const Tthis &rhs) { this->value -= rhs.value; return *static_cast(this); } + + constexpr Tthis operator +(const Tthis &rhs) const { return Tthis{ this->value + rhs.value }; } + constexpr Tthis operator -(const Tthis &rhs) const { return Tthis{ this->value - rhs.value }; } + constexpr Tthis operator +(const T &rhs) const { return Tthis{ this->value + rhs }; } + constexpr Tthis operator -(const T &rhs) const { return Tthis{ this->value - rhs }; } +}; + +#endif /* STRONG_TYPEDEF_TYPE_HPP */ diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index 126e48f5fc..63f4188a88 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -941,7 +941,7 @@ void ReleaseDisastersTargetingIndustry(IndustryID i) /* primary disaster vehicles that have chosen target */ if (v->subtype == ST_AIRPLANE || v->subtype == ST_HELICOPTER) { /* if it has chosen target, and it is this industry (yes, dest_tile is IndustryID here), set order to "leaving map peacefully" */ - if (v->current_order.GetDestination() > 0 && v->dest_tile == i) v->current_order.SetDestination(3); + if (v->current_order.GetDestination() > 0 && v->dest_tile == (uint32)i) v->current_order.SetDestination(3); } } } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index e9ded95367..8beab1884b 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -641,7 +641,7 @@ public: if (confirmed) { VehicleGroupWindow *w = (VehicleGroupWindow*)win; w->vli.index = ALL_GROUP; - DoCommandP(CMD_DELETE_GROUP, STR_ERROR_GROUP_CAN_T_DELETE, 0, w->group_confirm, 0); + DoCommandP(CMD_DELETE_GROUP, STR_ERROR_GROUP_CAN_T_DELETE, (TileIndex)0, w->group_confirm, 0); } } @@ -965,7 +965,7 @@ public: case ADI_REMOVE_ALL: // Remove all Vehicles from the selected group assert(Group::IsValidID(this->vli.index)); - DoCommandP(CMD_REMOVE_ALL_VEHICLES_GROUP, STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, 0, this->vli.index, 0); + DoCommandP(CMD_REMOVE_ALL_VEHICLES_GROUP, STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, (TileIndex)0, this->vli.index, 0); break; default: NOT_REACHED(); } diff --git a/src/map.cpp b/src/map.cpp index 308e28e490..2a08d656e6 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -84,7 +84,7 @@ TileIndex TileAdd(TileIndex tile, TileIndexDiff add, char buf[512]; seprintf(buf, lastof(buf), "TILE_ADD(%s) when adding 0x%.4X and 0x%.4X failed", - exp, tile, add); + exp, (uint32)tile, add); #if !defined(_MSC_VER) fprintf(stderr, "%s:%d %s\n", file, line, buf); #else diff --git a/src/map_func.h b/src/map_func.h index b02ba57773..34cc5ee0ee 100644 --- a/src/map_func.h +++ b/src/map_func.h @@ -204,7 +204,7 @@ static inline TileIndex TileVirtXY(uint x, uint y) */ static inline uint TileX(TileIndex tile) { - return tile & MapMaxX(); + return tile.value & MapMaxX(); } /** @@ -214,7 +214,7 @@ static inline uint TileX(TileIndex tile) */ static inline uint TileY(TileIndex tile) { - return tile >> MapLogX(); + return tile.value >> MapLogX(); } /** diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp index 4719789529..c6e2b1c40d 100644 --- a/src/newgrf_railtype.cpp +++ b/src/newgrf_railtype.cpp @@ -18,7 +18,7 @@ /* virtual */ uint32 RailTypeScopeResolver::GetRandomBits() const { - uint tmp = CountBits(this->tile + (TileX(this->tile) + TileY(this->tile)) * TILE_SIZE); + uint tmp = CountBits(static_cast(this->tile + (TileX(this->tile) + TileY(this->tile)) * TILE_SIZE)); return GB(tmp, 0, 2); } diff --git a/src/newgrf_roadtype.cpp b/src/newgrf_roadtype.cpp index e4d29e4c5e..8eb8325c74 100644 --- a/src/newgrf_roadtype.cpp +++ b/src/newgrf_roadtype.cpp @@ -18,7 +18,7 @@ /* virtual */ uint32 RoadTypeScopeResolver::GetRandomBits() const { - uint tmp = CountBits(this->tile + (TileX(this->tile) + TileY(this->tile)) * TILE_SIZE); + uint tmp = CountBits(static_cast(this->tile + (TileX(this->tile) + TileY(this->tile)) * TILE_SIZE)); return GB(tmp, 0, 2); } diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 75b84a4438..69ab19b3b4 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -311,7 +311,7 @@ struct NewsWindow : Window { /* Initialize viewport if it exists. */ NWidgetViewport *nvp = this->GetWidget(WID_N_VIEWPORT); if (nvp != nullptr) { - nvp->InitializeViewport(this, ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS); + nvp->InitializeViewport(this, ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : (uint32)GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS); if (this->ni->flags & NF_NO_TRANSPARENT) nvp->disp_flags |= ND_NO_TRANSPARENCY; if ((this->ni->flags & NF_INCOLOUR) == 0) { nvp->disp_flags |= ND_SHADE_GREY; diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 8b33c02db5..cfcc6bd37f 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -1343,7 +1343,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num) if (_cargo_count != 0 && CargoPacket::CanAllocateItem()) { StationID source = (_cargo_source == 0xFF) ? INVALID_STATION : _cargo_source; - TileIndex source_xy = (source != INVALID_STATION) ? Station::Get(source)->xy : 0; + TileIndex source_xy = (source != INVALID_STATION) ? Station::Get(source)->xy : (TileIndex)0; v->cargo.Append(new CargoPacket(_cargo_count, _cargo_days, source, source_xy, source_xy)); } } diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp index dddcc950c7..876ad84c5e 100644 --- a/src/script/api/script_company.cpp +++ b/src/script/api/script_company.cpp @@ -238,7 +238,7 @@ EnforcePrecondition(false, company != COMPANY_INVALID); /* Network commands only allow 0 to indicate invalid tiles, not INVALID_TILE */ - return ScriptObject::DoCommand(tile == INVALID_TILE ? 0 : tile , (uint32)(delta), company | expenses_type << 8 , CMD_CHANGE_BANK_BALANCE); + return ScriptObject::DoCommand(tile == INVALID_TILE ? (TileIndex)0U : tile , (uint32)(delta), company | expenses_type << 8 , CMD_CHANGE_BANK_BALANCE); } /* static */ bool ScriptCompany::BuildCompanyHQ(TileIndex tile) diff --git a/src/script/api/script_types.hpp b/src/script/api/script_types.hpp index 0d652a2d2d..a570aabf7d 100644 --- a/src/script/api/script_types.hpp +++ b/src/script/api/script_types.hpp @@ -82,6 +82,7 @@ #include "../../core/overflowsafe_type.hpp" #include "../../company_type.h" +#include "../../tile_type.h" #include /* Define all types here, so we don't have to include the whole _type.h maze */ @@ -100,7 +101,6 @@ typedef uint32 StringID; ///< The ID of a string. typedef uint16 SubsidyID; ///< The ID of a subsidy. typedef uint16 StoryPageID; ///< The ID of a story page. typedef uint16 StoryPageElementID; ///< The ID of a story page element. -typedef uint32 TileIndex; ///< The ID of a tile (just named differently). typedef uint16 TownID; ///< The ID of a town. typedef uint32 VehicleID; ///< The ID of a vehicle. diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index 6a3ba6125b..7308006fa9 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -14,6 +14,7 @@ #include "../core/smallvec_type.hpp" #include "../economy_type.h" #include "../string_func.h" +#include "../tile_type.h" #include "squirrel_helper_type.hpp" template const char *GetClassName(); @@ -85,6 +86,7 @@ namespace SQConvert { template <> inline int Return (HSQUIRRELVM vm, int32 res) { sq_pushinteger(vm, res); return 1; } template <> inline int Return (HSQUIRRELVM vm, int64 res) { sq_pushinteger(vm, res); return 1; } template <> inline int Return (HSQUIRRELVM vm, Money res) { sq_pushinteger(vm, res); return 1; } + template <> inline int Return (HSQUIRRELVM vm, TileIndex res) { sq_pushinteger(vm, (int32)res.value); return 1; } template <> inline int Return (HSQUIRRELVM vm, bool res) { sq_pushbool (vm, res); return 1; } template <> inline int Return (HSQUIRRELVM vm, char *res) { if (res == nullptr) sq_pushnull(vm); else { sq_pushstring(vm, res, -1); free(res); } return 1; } template <> inline int Return(HSQUIRRELVM vm, const char *res) { if (res == nullptr) sq_pushnull(vm); else { sq_pushstring(vm, res, -1); } return 1; } @@ -103,6 +105,7 @@ namespace SQConvert { template <> inline int16 GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger (vm, index, &tmp); return tmp; } template <> inline int32 GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger (vm, index, &tmp); return tmp; } template <> inline int64 GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger (vm, index, &tmp); return tmp; } + template <> inline TileIndex GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger (vm, index, &tmp); return TileIndex((uint32)(int32)tmp); } template <> inline Money GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger (vm, index, &tmp); return tmp; } template <> inline bool GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQBool tmp; sq_getbool (vm, index, &tmp); return tmp != 0; } template <> inline void *GetParam(ForceType , HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer tmp; sq_getuserpointer(vm, index, &tmp); return tmp; } diff --git a/src/tile_type.h b/src/tile_type.h index 73fd0e97e1..6b5514d90e 100644 --- a/src/tile_type.h +++ b/src/tile_type.h @@ -10,6 +10,8 @@ #ifndef TILE_TYPE_H #define TILE_TYPE_H +#include "core/strong_typedef_type.hpp" + static const uint TILE_SIZE = 16; ///< Tile size in world coordinates. static const uint TILE_UNIT_MASK = TILE_SIZE - 1; ///< For masking in/out the inner-tile world coordinate units. static const uint TILE_PIXELS = 32; ///< Pixel distance between tile columns/rows in #ZOOM_LVL_BASE. @@ -80,11 +82,29 @@ enum TropicZone { /** * The index/ID of a Tile. */ -typedef uint32 TileIndex; +struct TileIndex : StrongIntegralTypedef { + using StrongIntegralTypedef::StrongIntegralTypedef; + + /** Implicit conversion to the base type for e.g. array indexing. */ + constexpr operator uint32() const { return this->value; } + + /* Import operators from the base class into our overload set. */ + using StrongIntegralTypedef::operator ==; + using StrongIntegralTypedef::operator !=; + using StrongIntegralTypedef::operator +; + using StrongIntegralTypedef::operator -; + + /* Add comparison and add/sub for signed ints as e.g. 0 is signed and will + * match ambiguously when only unsigned overloads are present. */ + constexpr bool operator ==(int rhs) const { return this->value == (uint32)rhs; } + constexpr bool operator !=(int rhs) const { return this->value != (uint32)rhs; } + constexpr TileIndex operator +(int rhs) const { return { (uint32)(this->value + rhs) }; } + constexpr TileIndex operator -(int rhs) const { return { (uint32)(this->value - rhs) }; } +}; /** * The very nice invalid tile marker */ -static const TileIndex INVALID_TILE = (TileIndex)-1; +static inline constexpr TileIndex INVALID_TILE = TileIndex{ (uint32)-1 }; #endif /* TILE_TYPE_H */ diff --git a/src/tilearea_type.h b/src/tilearea_type.h index e6d9bad602..b6af998a76 100644 --- a/src/tilearea_type.h +++ b/src/tilearea_type.h @@ -147,6 +147,36 @@ public: * Allocate a new iterator that is a copy of this one. */ virtual TileIterator *Clone() const = 0; + + /** + * Equality comparison. + */ + bool operator ==(const TileIterator &rhs) const + { + return this->tile == rhs.tile; + } + /** + * Inequality comparison. + */ + bool operator !=(const TileIterator &rhs) const + { + return this->tile != rhs.tile; + } + + /** + * Equality comparison. + */ + bool operator ==(const TileIndex &rhs) const + { + return this->tile == rhs; + } + /** + * Inequality comparison. + */ + bool operator !=(const TileIndex &rhs) const + { + return this->tile != rhs; + } }; /** Iterator to iterate over a tile area (rectangle) of the map. */ diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 00ab50115d..a205a505e8 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -578,25 +578,25 @@ struct TimetableWindow : Window { case WID_VT_CLEAR_TIME: { // Clear waiting time. uint32 p1 = PackTimetableArgs(v, this->sel_index, false); - DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, 0); + DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, p1, 0); break; } case WID_VT_CLEAR_SPEED: { // Clear max speed button. uint32 p1 = PackTimetableArgs(v, this->sel_index, true); - DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, UINT16_MAX); + DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, p1, UINT16_MAX); break; } case WID_VT_RESET_LATENESS: // Reset the vehicle's late counter. - DoCommandP(CMD_SET_VEHICLE_ON_TIME, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, 0); + DoCommandP(CMD_SET_VEHICLE_ON_TIME, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, v->index, 0); break; case WID_VT_AUTOFILL: { // Autofill the timetable. uint32 p2 = 0; if (!HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(p2, 0); if (_ctrl_pressed) SetBit(p2, 1); - DoCommandP(CMD_AUTOFILL_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, p2); + DoCommandP(CMD_AUTOFILL_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, v->index, p2); break; } diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 660b1ac98a..cb88c5c005 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -474,12 +474,12 @@ public: _warn_town_no_roads = true; } - DoCommandP(CMD_EXPAND_TOWN, STR_ERROR_CAN_T_EXPAND_TOWN, 0, this->window_number, 0); + DoCommandP(CMD_EXPAND_TOWN, STR_ERROR_CAN_T_EXPAND_TOWN, (TileIndex)0, this->window_number, 0); break; } case WID_TV_DELETE: // delete town - only available on Scenario editor - DoCommandP(CMD_DELETE_TOWN, STR_ERROR_TOWN_CAN_T_DELETE, 0, this->window_number, 0); + DoCommandP(CMD_DELETE_TOWN, STR_ERROR_TOWN_CAN_T_DELETE, (TileIndex)0, this->window_number, 0); break; } } diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index a16ad7b824..ab439cd58e 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -399,7 +399,7 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 Company *c = (_game_mode != GM_EDITOR) ? Company::GetIfValid(_current_company) : nullptr; int limit = (c == nullptr ? INT32_MAX : GB(c->tree_limit, 16, 16)); - TileArea ta(tile, p2); + TileArea ta(tile, (TileIndex)p2); for (TileIndex current_tile : ta) { switch (GetTileType(current_tile)) { case MP_TREES: @@ -528,7 +528,7 @@ static void DrawTile_Trees(TileInfo *ti) /* Do not draw trees when the invisible trees setting is set */ if (IsInvisibilitySet(TO_TREES)) return; - uint tmp = CountBits(ti->tile + ti->x + ti->y); + uint tmp = CountBits(static_cast(ti->tile + ti->x + ti->y)); uint index = GB(tmp, 0, 2) + (GetTreeType(ti->tile) << 2); /* different tree styles above one of the grounds */ diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 145b8084dc..6e357f9c68 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -454,7 +454,7 @@ CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Outside the editor you can only drag canals, and not areas */ if (_game_mode != GM_EDITOR) { - TileArea ta(tile, p1); + TileArea ta(tile, (TileIndex)p1); if (ta.w != 1 && ta.h != 1) return CMD_ERROR; } @@ -462,9 +462,9 @@ CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 std::unique_ptr iter; if (HasBit(p2, 2)) { - iter = std::make_unique(tile, p1); + iter = std::make_unique(tile, (TileIndex)p1); } else { - iter = std::make_unique(tile, p1); + iter = std::make_unique(tile, (TileIndex)p1); } for (; *iter != INVALID_TILE; ++(*iter)) { From a05fd7aa50ecbee425df2d6f9015ec3ea359232f Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Thu, 28 Oct 2021 23:48:26 +0200 Subject: [PATCH 112/710] Change: [Network] Transfer command data as serialized byte stream without fixed structure. The data will be transmitted as the length followed by the serialized data. This allows the command data to be different for every command type in the future. --- src/command.cpp | 32 ++++- src/command_func.h | 7 ++ src/command_type.h | 8 ++ src/core/span_type.hpp | 2 + src/misc/CMakeLists.txt | 1 + src/misc/endian_buffer.hpp | 206 ++++++++++++++++++++++++++++++++ src/network/core/packet.cpp | 28 +++++ src/network/core/packet.h | 2 + src/network/network.cpp | 28 +++-- src/network/network_admin.cpp | 5 +- src/network/network_command.cpp | 129 ++++++++++++++++++-- src/network/network_internal.h | 13 +- src/network/network_server.cpp | 8 +- src/string.cpp | 18 +++ src/string_func.h | 3 + 15 files changed, 455 insertions(+), 35 deletions(-) create mode 100644 src/misc/endian_buffer.hpp diff --git a/src/command.cpp b/src/command.cpp index 001f2ee7d1..788c71989c 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -55,6 +55,8 @@ #include "viewport_cmd.h" #include "water_cmd.h" #include "waypoint_cmd.h" +#include "misc/endian_buffer.hpp" +#include "string_func.h" #include @@ -399,12 +401,38 @@ bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, T return DoCommandP(cmd, err_message, callback, true, false, tile, p1, p2, text); } +/** + * Toplevel network safe docommand function for the current company. Must not be called recursively. + * The callback is called when the command succeeded or failed. The parameters + * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. + * + * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @param tile The tile to perform a command on (see #CommandProc) + * @param p1 Additional data for the command (see #CommandProc) + * @param p2 Additional data for the command (see #CommandProc) + * @param text The text to pass + * @return \c true if the command succeeded, else \c false. + */ +bool InjectNetworkCommand(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + return DoCommandP(cmd, err_message, callback, my_cmd, true, tile, p1, p2, text); +} + /** * Helper to deduplicate the code for returning. * @param cmd the command cost to return. */ #define return_dcpi(cmd) { _docommand_recursive = 0; return cmd; } +/** Helper to format command parameters into a hex string. */ +static std::string CommandParametersToHexString(TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + return FormatArrayAsHex(EndianBufferWriter<>::FromValue(std::make_tuple(tile, p1, p2, text))); +} + /*! * Helper function for the toplevel network safe docommand function for the current company. * @@ -482,7 +510,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba if (!_networking || _generating_world || network_command) { /* Log the failed command as well. Just to be able to be find * causes of desyncs due to bad command test implementations. */ - Debug(desync, 1, "cmdf: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd, err_message, text, GetCommandName(cmd)); + Debug(desync, 1, "cmdf: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cmd, err_message, tile, CommandParametersToHexString(tile, p1, p2, text), GetCommandName(cmd)); } cur_company.Restore(); return_dcpi(res); @@ -502,7 +530,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * reset the storages as we've not executed the command. */ return_dcpi(CommandCost()); } - Debug(desync, 1, "cmd: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd, err_message, text, GetCommandName(cmd)); + Debug(desync, 1, "cmd: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cmd, err_message, tile, CommandParametersToHexString(tile, p1, p2, text), GetCommandName(cmd)); /* Actually try and execute the command. If no cost-type is given * use the construction one */ diff --git a/src/command_func.h b/src/command_func.h index 03bfc73f1b..0d000755c8 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -12,6 +12,7 @@ #include "command_type.h" #include "company_type.h" +#include /** * Define a default return value for a failed command. @@ -32,6 +33,9 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); */ #define return_cmd_error(errcode) return CommandCost(errcode); +/** Storage buffer for serialized command data. */ +typedef std::vector CommandDataBuffer; + CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags); @@ -41,9 +45,12 @@ bool DoCommandP(Commands cmd, CommandCallback *callback, TileIndex tile, uint32 bool DoCommandP(Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(const CommandContainer *container, bool my_cmd = true, bool network_command = false); +bool InjectNetworkCommand(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); + CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); +void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex location, const CommandDataBuffer &cmd_data); extern Money _additional_cash_required; diff --git a/src/command_type.h b/src/command_type.h index fa381ce133..3a15087b9a 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -424,11 +424,19 @@ enum CommandPauseLevel { typedef CommandCost CommandProc(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); +template struct CommandFunctionTraitHelper; +template +struct CommandFunctionTraitHelper { + using Args = std::tuple...>; +}; + /** Defines the traits of a command. */ template struct CommandTraits; #define DEF_CMD_TRAIT(cmd_, proc_, flags_, type_) \ template<> struct CommandTraits { \ + using Args = typename CommandFunctionTraitHelper::Args; \ + static constexpr Commands cmd = cmd_; \ static constexpr auto &proc = proc_; \ static constexpr CommandFlags flags = (CommandFlags)(flags_); \ static constexpr CommandType type = type_; \ diff --git a/src/core/span_type.hpp b/src/core/span_type.hpp index 614be84567..0df528816e 100644 --- a/src/core/span_type.hpp +++ b/src/core/span_type.hpp @@ -92,6 +92,8 @@ public: constexpr const_iterator cbegin() const noexcept { return const_iterator(first); } constexpr const_iterator cend() const noexcept { return const_iterator(last); } + constexpr reference operator[](size_type idx) const { return first[idx]; } + private: pointer first; pointer last; diff --git a/src/misc/CMakeLists.txt b/src/misc/CMakeLists.txt index ee2ca6a41c..24cde73e41 100644 --- a/src/misc/CMakeLists.txt +++ b/src/misc/CMakeLists.txt @@ -5,6 +5,7 @@ add_files( countedptr.hpp dbg_helpers.cpp dbg_helpers.h + endian_buffer.hpp fixedsizearray.hpp getoptdata.cpp getoptdata.h diff --git a/src/misc/endian_buffer.hpp b/src/misc/endian_buffer.hpp new file mode 100644 index 0000000000..c20d9a8b99 --- /dev/null +++ b/src/misc/endian_buffer.hpp @@ -0,0 +1,206 @@ +/* + * 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 endian_buffer.hpp Endian-aware buffer. */ + +#ifndef ENDIAN_BUFFER_HPP +#define ENDIAN_BUFFER_HPP + +#include +#include +#include "../core/span_type.hpp" +#include "../core/bitmath_func.hpp" + +struct StrongTypedefBase; + +/** + * Endian-aware buffer adapter that always writes values in little endian order. + * @note This class uses operator overloading (<<, just like streams) for writing + * as this allows providing custom operator overloads for more complex types + * like e.g. structs without needing to modify this class. + */ +template , typename Titer = typename std::back_insert_iterator> +class EndianBufferWriter { + /** Output iterator for the destination buffer. */ + Titer buffer; + +public: + EndianBufferWriter(Titer buffer) : buffer(buffer) {} + EndianBufferWriter(typename Titer::container_type &container) : buffer(std::back_inserter(container)) {} + + EndianBufferWriter &operator <<(const std::string &data) { return *this << std::string_view{ data }; } + EndianBufferWriter &operator <<(const char *data) { return *this << std::string_view{ data }; } + EndianBufferWriter &operator <<(std::string_view data) { this->Write(data); return *this; } + EndianBufferWriter &operator <<(bool data) { return *this << static_cast(data ? 1 : 0); } + + template + EndianBufferWriter &operator <<(const std::tuple &data) + { + this->WriteTuple(data, std::index_sequence_for{}); + return *this; + } + + template >, std::is_base_of>, int> = 0> + EndianBufferWriter &operator <<(const T data) + { + if constexpr (std::is_enum_v) { + this->Write(static_cast>(data)); + } else if constexpr (std::is_base_of_v) { + this->Write(data.value); + } else { + this->Write(data); + } + return *this; + } + + template > + static Tbuf FromValue(const Tvalue &data) + { + Tbuf buffer; + EndianBufferWriter writer{ buffer }; + writer << data; + return buffer; + } + +private: + /** Helper function to write a tuple to the buffer. */ + template + void WriteTuple(const Ttuple &values, std::index_sequence) { + ((*this << std::get(values)), ...); + } + + /** Write overload for string values. */ + void Write(std::string_view value) + { + for (auto c : value) { + this->buffer++ = c; + } + this->buffer++ = '\0'; + } + + /** Fundamental write function. */ + template + void Write(T value) + { + static_assert(sizeof(T) <= 8, "Value can't be larger than 8 bytes"); + + if constexpr (sizeof(T) > 1) { + this->buffer++ = GB(value, 0, 8); + this->buffer++ = GB(value, 8, 8); + if constexpr (sizeof(T) > 2) { + this->buffer++ = GB(value, 16, 8); + this->buffer++ = GB(value, 24, 8); + } + if constexpr (sizeof(T) > 4) { + this->buffer++ = GB(value, 32, 8); + this->buffer++ = GB(value, 40, 8); + this->buffer++ = GB(value, 48, 8); + this->buffer++ = GB(value, 56, 8); + } + } else { + this->buffer++ = value; + } + } +}; + +/** + * Endian-aware buffer adapter that always reads values in little endian order. + * @note This class uses operator overloading (>>, just like streams) for reading + * as this allows providing custom operator overloads for more complex types + * like e.g. structs without needing to modify this class. + */ +class EndianBufferReader { + /** Reference to storage buffer. */ + span buffer; + /** Current read position. */ + size_t read_pos = 0; + +public: + EndianBufferReader(span buffer) : buffer(buffer) {} + + void rewind() { this->read_pos = 0; } + + EndianBufferReader &operator >>(std::string &data) { data = this->ReadStr(); return *this; } + EndianBufferReader &operator >>(bool &data) { data = this->Read() != 0; return *this; } + + template + EndianBufferReader &operator >>(std::tuple &data) + { + this->ReadTuple(data, std::index_sequence_for{}); + return *this; + } + + template >, std::is_base_of>, int> = 0> + EndianBufferReader &operator >>(T &data) + { + if constexpr (std::is_enum_v) { + data = static_cast(this->Read>()); + } else if constexpr (std::is_base_of_v) { + data.value = this->Read(); + } else { + data = this->Read(); + } + return *this; + } + + template + static Tvalue ToValue(span buffer) + { + Tvalue result{}; + EndianBufferReader reader{ buffer }; + reader >> result; + return result; + } + +private: + /** Helper function to read a tuple from the buffer. */ + template + void ReadTuple(Ttuple &values, std::index_sequence) { + ((*this >> std::get(values)), ...); + } + + /** Read overload for string data. */ + std::string ReadStr() + { + std::string str; + while (this->read_pos < this->buffer.size()) { + char ch = this->Read(); + if (ch == '\0') break; + str.push_back(ch); + } + return str; + } + + /** Fundamental read function. */ + template + T Read() + { + static_assert(!std::is_const_v, "Can't read into const variables"); + static_assert(sizeof(T) <= 8, "Value can't be larger than 8 bytes"); + + if (read_pos + sizeof(T) > this->buffer.size()) return {}; + + T value = static_cast(this->buffer[this->read_pos++]); + if constexpr (sizeof(T) > 1) { + value += static_cast(this->buffer[this->read_pos++]) << 8; + } + if constexpr (sizeof(T) > 2) { + value += static_cast(this->buffer[this->read_pos++]) << 16; + value += static_cast(this->buffer[this->read_pos++]) << 24; + } + if constexpr (sizeof(T) > 4) { + value += static_cast(this->buffer[this->read_pos++]) << 32; + value += static_cast(this->buffer[this->read_pos++]) << 40; + value += static_cast(this->buffer[this->read_pos++]) << 48; + value += static_cast(this->buffer[this->read_pos++]) << 56; + } + + return value; + } +}; + +#endif /* ENDIAN_BUFFER_HPP */ diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp index e106d5787f..ec0919757f 100644 --- a/src/network/core/packet.cpp +++ b/src/network/core/packet.cpp @@ -185,6 +185,17 @@ void Packet::Send_string(const std::string_view data) this->buffer.emplace_back('\0'); } +/** + * Copy a sized byte buffer into the packet. + * @param data The data to send. + */ +void Packet::Send_buffer(const std::vector &data) +{ + assert(this->CanWriteToPacket(sizeof(uint16) + data.size())); + this->Send_uint16((uint16)data.size()); + this->buffer.insert(this->buffer.end(), data.begin(), data.end()); +} + /** * Send as many of the bytes as possible in the packet. This can mean * that it is possible that not all bytes are sent. To cope with this @@ -366,6 +377,23 @@ uint64 Packet::Recv_uint64() return n; } +/** + * Extract a sized byte buffer from the packet. + * @return The extracted buffer. + */ +std::vector Packet::Recv_buffer() +{ + uint16 size = this->Recv_uint16(); + if (size == 0 || !this->CanReadFromPacket(size, true)) return {}; + + std::vector data; + while (size-- > 0) { + data.push_back(this->buffer[this->pos++]); + } + + return data; +} + /** * Reads characters (bytes) from the packet until it finds a '\0', or reaches a * maximum of \c length characters. diff --git a/src/network/core/packet.h b/src/network/core/packet.h index 277ff8bba1..04a232e1ca 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -72,6 +72,7 @@ public: void Send_uint32(uint32 data); void Send_uint64(uint64 data); void Send_string(const std::string_view data); + void Send_buffer(const std::vector &data); size_t Send_bytes (const byte *begin, const byte *end); /* Reading/receiving of packets */ @@ -87,6 +88,7 @@ public: uint16 Recv_uint16(); uint32 Recv_uint32(); uint64 Recv_uint64(); + std::vector Recv_buffer(); std::string Recv_string(size_t length, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK); size_t RemainingBytesToTransfer() const; diff --git a/src/network/network.cpp b/src/network/network.cpp index 13f2fe52a4..8194f34d07 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -35,6 +35,7 @@ #include "../core/pool_func.hpp" #include "../gfx_func.h" #include "../error.h" +#include "../misc_cmd.h" #include #include #include @@ -1064,8 +1065,8 @@ void NetworkGameLoop() while (f != nullptr && !feof(f)) { if (_date == next_date && _date_fract == next_date_fract) { if (cp != nullptr) { - NetworkSendCommand(cp->cmd, cp->err_msg, nullptr, cp->company, cp->tile, cp->p1, cp->p2, cp->text); - Debug(desync, 0, "Injecting: {:08x}; {:02x}; {:02x}; {:06x}; {:08x}; {:08x}; {:08x}; \"{}\" ({})", _date, _date_fract, (int)_current_company, cp->tile, cp->p1, cp->p2, cp->cmd, cp->text, GetCommandName(cp->cmd)); + NetworkSendCommand(cp->cmd, cp->err_msg, nullptr, cp->company, cp->data); + Debug(desync, 0, "Injecting: {:08x}; {:02x}; {:02x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cp->cmd, cp->tile, FormatArrayAsHex(cp->data), GetCommandName(cp->cmd)); delete cp; cp = nullptr; } @@ -1104,15 +1105,21 @@ void NetworkGameLoop() cp = new CommandPacket(); int company; uint cmd; - char buffer[128]; - int ret = sscanf(p, "%x; %x; %x; %x; %x; %x; %x; %x; \"%127[^\"]\"", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cmd, &cp->err_msg, buffer); - cp->text = buffer; - /* There are 8 pieces of data to read, however the last is a - * string that might or might not exist. Ignore it if that - * string misses because in 99% of the time it's not used. */ - assert(ret == 9 || ret == 8); + char buffer[256]; + int ret = sscanf(p, "%x; %x; %x; %x; %x; %x; %255s", &next_date, &next_date_fract, &company, &cmd, &cp->err_msg, &cp->tile, buffer); + assert(ret == 6); cp->company = (CompanyID)company; cp->cmd = (Commands)cmd; + + /* Parse command data. */ + std::vector args; + size_t arg_len = strlen(buffer); + for (size_t i = 0; i + 1 < arg_len; i += 2) { + byte e = 0; + std::from_chars(buffer + i, buffer + i + 1, e, 16); + args.emplace_back(e); + } + cp->data = args; } else if (strncmp(p, "join: ", 6) == 0) { /* Manually insert a pause when joining; this way the client can join at the exact right time. */ int ret = sscanf(p + 6, "%x; %x", &next_date, &next_date_fract); @@ -1121,8 +1128,7 @@ void NetworkGameLoop() cp = new CommandPacket(); cp->company = COMPANY_SPECTATOR; cp->cmd = CMD_PAUSE; - cp->p1 = PM_PAUSED_NORMAL; - cp->p2 = 1; + cp->data = EndianBufferWriter<>::FromValue(CommandTraits::Args{ 0, PM_PAUSED_NORMAL, 1, "" }); _ddc_fastforward = false; } else if (strncmp(p, "sync: ", 6) == 0) { int ret = sscanf(p + 6, "%x; %x; %x; %x", &next_date, &next_date_fract, &sync_state[0], &sync_state[1]); diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index 99f803e24e..4711cdf046 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -630,10 +630,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCmdLogging(ClientID clien p->Send_uint32(client_id); p->Send_uint8 (cp->company); p->Send_uint16(cp->cmd); - p->Send_uint32(cp->p1); - p->Send_uint32(cp->p2); - p->Send_uint32(cp->tile); - p->Send_string(cp->text); + p->Send_buffer(cp->data); p->Send_uint32(cp->frame); this->SendPacket(p); diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 0fae6bcbf0..472d5e60e2 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -15,18 +15,41 @@ #include "../company_func.h" #include "../settings_type.h" #include "../airport_cmd.h" +#include "../aircraft_cmd.h" +#include "../autoreplace_cmd.h" +#include "../company_cmd.h" #include "../depot_cmd.h" #include "../dock_cmd.h" +#include "../economy_cmd.h" +#include "../engine_cmd.h" +#include "../goal_cmd.h" #include "../group_cmd.h" #include "../industry_cmd.h" +#include "../landscape_cmd.h" +#include "../misc_cmd.h" +#include "../news_cmd.h" +#include "../object_cmd.h" +#include "../order_cmd.h" #include "../rail_cmd.h" #include "../road_cmd.h" +#include "../roadveh_cmd.h" +#include "../settings_cmd.h" +#include "../signs_cmd.h" +#include "../station_cmd.h" +#include "../story_cmd.h" +#include "../subsidy_cmd.h" #include "../terraform_cmd.h" +#include "../timetable_cmd.h" #include "../town_cmd.h" #include "../train_cmd.h" +#include "../tree_cmd.h" #include "../tunnelbridge_cmd.h" #include "../vehicle_cmd.h" +#include "../viewport_cmd.h" +#include "../water_cmd.h" +#include "../waypoint_cmd.h" #include "../script/script_cmd.h" +#include #include "../safeguards.h" @@ -62,6 +85,23 @@ static CommandCallback * const _callback_table[] = { /* 0x1B */ CcAddVehicleNewGroup, }; +/* Helpers to generate the command dispatch table from the command traits. */ + +template static CommandDataBuffer SanitizeCmdStrings(const CommandDataBuffer &data); +template static void UnpackNetworkCommand(const CommandPacket *cp); +struct CommandDispatch { + CommandDataBuffer(*Sanitize)(const CommandDataBuffer &); + void (*Unpack)(const CommandPacket *); +}; + +template +inline constexpr auto MakeDispatchTable(std::integer_sequence) noexcept +{ + return std::array{{ { &SanitizeCmdStrings(i)>, &UnpackNetworkCommand(i)> }... }}; +} +static constexpr auto _cmd_dispatch = MakeDispatchTable(std::make_integer_sequence, CMD_END>{}); + + /** * Append a CommandPacket at the end of the queue. * @param p The packet to append to the queue. @@ -148,16 +188,29 @@ static CommandQueue _local_execution_queue; * @param text The text to pass */ void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +{ + auto data = EndianBufferWriter::FromValue(std::make_tuple(tile, p1, p2, text)); + NetworkSendCommand(cmd, err_message, callback, company, tile, data); +} + +/** + * Prepare a DoCommand to be send over the network + * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param company The company that wants to send the command + * @param location Location of the command (e.g. for error message position) + * @param cmd_data The command proc arguments. + */ +void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex location, const CommandDataBuffer &cmd_data) { CommandPacket c; c.company = company; - c.tile = tile; - c.p1 = p1; - c.p2 = p2; c.cmd = cmd; c.err_msg = err_message; c.callback = callback; - c.text = text; + c.tile = location; + c.data = cmd_data; if (_network_server) { /* If we are the server, we queue the command in our 'special' queue. @@ -220,7 +273,7 @@ void NetworkExecuteLocalCommandQueue() /* We can execute this command */ _current_company = cp->company; - DoCommandP(cp, cp->my_cmd, true); + _cmd_dispatch[cp->cmd].Unpack(cp); queue.Pop(); delete cp; @@ -311,11 +364,8 @@ const char *NetworkGameSocketHandler::ReceiveCommand(Packet *p, CommandPacket *c if (!IsValidCommand(cp->cmd)) return "invalid command"; if (GetCommandFlags(cp->cmd) & CMD_OFFLINE) return "single-player only command"; cp->err_msg = p->Recv_uint16(); - - cp->p1 = p->Recv_uint32(); - cp->p2 = p->Recv_uint32(); cp->tile = p->Recv_uint32(); - cp->text = p->Recv_string(NETWORK_COMPANY_NAME_LENGTH, (!_network_server && GetCommandFlags(cp->cmd) & CMD_STR_CTRL) != 0 ? SVS_ALLOW_CONTROL_CODE | SVS_REPLACE_WITH_QUESTION_MARK : SVS_REPLACE_WITH_QUESTION_MARK); + cp->data = _cmd_dispatch[cp->cmd].Sanitize(p->Recv_buffer()); byte callback = p->Recv_uint8(); if (callback >= lengthof(_callback_table)) return "invalid callback"; @@ -331,13 +381,11 @@ const char *NetworkGameSocketHandler::ReceiveCommand(Packet *p, CommandPacket *c */ void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) { - p->Send_uint8 (cp->company); + p->Send_uint8(cp->company); p->Send_uint16(cp->cmd); p->Send_uint16(cp->err_msg); - p->Send_uint32(cp->p1); - p->Send_uint32(cp->p2); p->Send_uint32(cp->tile); - p->Send_string(cp->text); + p->Send_buffer(cp->data); byte callback = 0; while (callback < lengthof(_callback_table) && _callback_table[callback] != cp->callback) { @@ -350,3 +398,58 @@ void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) } p->Send_uint8 (callback); } + +/** + * Insert a client ID into the command data in a command packet. + * @param cp Command packet to modify. + * @param client_id Client id to insert. + */ +void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id) +{ + /* Unpack command parameters. */ + auto params = EndianBufferReader::ToValue>(cp.data); + + /* Insert client id. */ + std::get<2>(params) = client_id; + + /* Repack command parameters. */ + cp.data = EndianBufferWriter::FromValue(params); +} + + +/** Validate a single string argument coming from network. */ +template +static inline void SanitizeSingleStringHelper([[maybe_unused]] CommandFlags cmd_flags, T &data) +{ + if constexpr (std::is_same_v) { + data = StrMakeValid(data.substr(0, NETWORK_COMPANY_NAME_LENGTH), (!_network_server && cmd_flags & CMD_STR_CTRL) != 0 ? SVS_ALLOW_CONTROL_CODE | SVS_REPLACE_WITH_QUESTION_MARK : SVS_REPLACE_WITH_QUESTION_MARK); + } +} + +/** Helper function to perform validation on command data strings. */ +template +static inline void SanitizeStringsHelper(CommandFlags cmd_flags, Ttuple &values, std::index_sequence) +{ + ((SanitizeSingleStringHelper(cmd_flags, std::get(values))), ...); +} + +/** + * Validate and sanitize strings in command data. + * @tparam Tcmd Command this data belongs to. + * @param data Command data. + * @return Sanitized command data. + */ +template +CommandDataBuffer SanitizeCmdStrings(const CommandDataBuffer &data) +{ + auto args = EndianBufferReader::ToValue::Args>(data); + SanitizeStringsHelper(CommandTraits::flags, args, std::make_index_sequence::Args>>{}); + return EndianBufferWriter::FromValue(args); +} + +template +void UnpackNetworkCommand(const CommandPacket *cp) +{ + auto args = EndianBufferReader::ToValue::Args>(cp->data); + std::apply(&InjectNetworkCommand, std::tuple_cat(std::make_tuple(Tcmd, cp->err_msg, cp->callback, cp->my_cmd), args)); +} diff --git a/src/network/network_internal.h b/src/network/network_internal.h index 25240da5d7..58c99867c2 100644 --- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -15,6 +15,8 @@ #include "core/tcp_game.h" #include "../command_type.h" +#include "../command_func.h" +#include "../misc/endian_buffer.hpp" #ifdef RANDOM_DEBUG /** @@ -104,19 +106,26 @@ void UpdateNetworkGameWindow(); /** * Everything we need to know about a command to be able to execute it. */ -struct CommandPacket : CommandContainer { +struct CommandPacket { /** Make sure the pointer is nullptr. */ - CommandPacket() : next(nullptr), company(INVALID_COMPANY), frame(0), my_cmd(false) {} + CommandPacket() : next(nullptr), company(INVALID_COMPANY), frame(0), my_cmd(false), tile(0) {} CommandPacket *next; ///< the next command packet (if in queue) CompanyID company; ///< company that is executing the command uint32 frame; ///< the frame in which this packet is executed bool my_cmd; ///< did the command originate from "me" + + Commands cmd; ///< command being executed. + StringID err_msg; ///< string ID of error message to use. + CommandCallback *callback; ///< any callback function executed upon successful completion of the command. + TileIndex tile; ///< location of the command (for e.g. error message or effect display). + CommandDataBuffer data; ///< command parameters. }; void NetworkDistributeCommands(); void NetworkExecuteLocalCommandQueue(); void NetworkFreeLocalCommandQueue(); void NetworkSyncCommandQueue(NetworkClientSocket *cs); +void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id); void ShowNetworkError(StringID error_string); void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const std::string &name, const std::string &str = "", int64 data = 0, const std::string &data_str = ""); diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 50b46dfe10..967ad40a89 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -24,6 +24,7 @@ #include "../genworld.h" #include "../company_func.h" #include "../company_gui.h" +#include "../company_cmd.h" #include "../roadveh.h" #include "../order_backup.h" #include "../core/pool_func.hpp" @@ -1048,14 +1049,15 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet * to match the company in the packet. If it doesn't, the client has done * something pretty naughty (or a bug), and will be kicked */ - if (!(cp.cmd == CMD_COMPANY_CTRL && cp.p1 == 0 && ci->client_playas == COMPANY_NEW_COMPANY) && ci->client_playas != cp.company) { + uint32 company_p1 = cp.cmd == CMD_COMPANY_CTRL ? std::get<1>(EndianBufferReader::ToValue::Args>(cp.data)) : 0; + if (!(cp.cmd == CMD_COMPANY_CTRL && company_p1 == 0 && ci->client_playas == COMPANY_NEW_COMPANY) && ci->client_playas != cp.company) { IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to calling a command as another company {}.", ci->client_playas + 1, this->GetClientIP(), cp.company + 1); return this->SendError(NETWORK_ERROR_COMPANY_MISMATCH); } if (cp.cmd == CMD_COMPANY_CTRL) { - if (cp.p1 != 0 || cp.company != COMPANY_SPECTATOR) { + if (company_p1 != 0 || cp.company != COMPANY_SPECTATOR) { return this->SendError(NETWORK_ERROR_CHEATER); } @@ -1066,7 +1068,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet } } - if (GetCommandFlags(cp.cmd) & CMD_CLIENT_ID) cp.p2 = this->client_id; + if (GetCommandFlags(cp.cmd) & CMD_CLIENT_ID) NetworkReplaceCommandClientId(cp, this->client_id); this->incoming_queue.Append(&cp); return NETWORK_RECV_STATUS_OKAY; diff --git a/src/string.cpp b/src/string.cpp index d027cb7bff..aeac4fe84f 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -19,6 +19,7 @@ #include #include /* required for tolower() */ #include +#include #ifdef _MSC_VER #include // required by vsnprintf implementation for MSVC @@ -160,6 +161,23 @@ char *CDECL str_fmt(const char *str, ...) return p; } +/** + * Format a byte array into a continuous hex string. + * @param data Array to format + * @return Converted string. + */ +std::string FormatArrayAsHex(span data) +{ + std::ostringstream ss; + ss << std::uppercase << std::setfill('0') << std::setw(2) << std::hex; + + for (auto b : data) { + ss << b; + } + + return ss.str(); +} + /** * Scan the string for old values of SCC_ENCODED and fix it to * it's new, static value. diff --git a/src/string_func.h b/src/string_func.h index 0cbf26d6b2..a5d3499c76 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -28,6 +28,7 @@ #include #include "core/bitmath_func.hpp" +#include "core/span_type.hpp" #include "string_type.h" char *strecat(char *dst, const char *src, const char *last) NOACCESS(3); @@ -39,6 +40,8 @@ int CDECL vseprintf(char *str, const char *last, const char *format, va_list ap) char *CDECL str_fmt(const char *str, ...) WARN_FORMAT(1, 2); +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); void StrMakeValidInPlace(char *str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK); From 996b16de707c449a83676c614edbd5a81d37b253 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Fri, 29 Oct 2021 00:56:07 +0200 Subject: [PATCH 113/710] Codechange: Use lambdas instead of CommandContainer to manage station picker commands. --- src/airport_gui.cpp | 17 +++++++++++++++-- src/command.cpp | 26 -------------------------- src/command_func.h | 2 -- src/command_type.h | 13 ------------- src/dock_gui.cpp | 22 ++++++++++++++++------ src/rail_gui.cpp | 44 ++++++++++++++++++++++++++++++++++++++------ src/road_gui.cpp | 26 +++++++++++++++++++------- src/station_gui.cpp | 36 ++++++++++++++++-------------------- src/station_gui.h | 8 ++++++-- 9 files changed, 110 insertions(+), 84 deletions(-) diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 41fde9b8ce..65c59784b5 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -26,7 +26,9 @@ #include "hotkeys.h" #include "vehicle_func.h" #include "gui.h" +#include "command_func.h" #include "airport_cmd.h" +#include "station_cmd.h" #include "widgets/airport_widget.h" @@ -61,8 +63,19 @@ static void PlaceAirport(TileIndex tile) uint32 p1 = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex(); p1 |= _selected_airport_layout << 8; - CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_AIRPORT, STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, "" }; - ShowSelectStationIfNeeded(cmdcont, TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE)); + + auto proc = [=](bool test, StationID to_join) -> bool { + if (test) { + return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_AIRPORT)), CMD_BUILD_AIRPORT, tile, p1, p2).Succeeded(); + } else { + uint32 p2_final = p2; + if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); + + return DoCommandP(CMD_BUILD_AIRPORT, STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, p1, p2_final); + } + }; + + ShowSelectStationIfNeeded(TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE), proc); } /** Airport build toolbar window handler. */ diff --git a/src/command.cpp b/src/command.cpp index 788c71989c..e9ae695285 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -163,20 +163,6 @@ bool IsCommandAllowedWhilePaused(Commands cmd) static int _docommand_recursive = 0; - -/** - * Shorthand for calling the long DoCommand with a container. - * - * @param container Container with (almost) all information - * @param flags Flags for the command and how to execute the command - * @see CommandProc - * @return the cost - */ -CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags) -{ - return DoCommand(flags, container->cmd, container->tile, container->p1, container->p2, container->text); -} - /*! * This function executes a given command with the parameters from the #CommandProc parameter list. * Depending on the flags parameter it execute or test a command. @@ -326,18 +312,6 @@ static bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *call return res.Succeeded(); } -/** - * Shortcut for the long DoCommandP when having a container with the data. - * @param container the container with information. - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) - * @param network_command execute the command without sending it on the network - * @return true if the command succeeded, else false - */ -bool DoCommandP(const CommandContainer *container, bool my_cmd, bool network_command) -{ - return DoCommandP(container->cmd, container->err_msg, container->callback, my_cmd, network_command, container->tile, container->p1, container->p2, container->text); -} - /** * Shortcut for the long DoCommandP when not using a callback or error message. * @param cmd The command to execute (a CMD_* value) diff --git a/src/command_func.h b/src/command_func.h index 0d000755c8..0b539746d9 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -37,13 +37,11 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); typedef std::vector CommandDataBuffer; CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags); bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(Commands cmd, StringID err_message, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(Commands cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -bool DoCommandP(const CommandContainer *container, bool my_cmd = true, bool network_command = false); bool InjectNetworkCommand(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); diff --git a/src/command_type.h b/src/command_type.h index 3a15087b9a..cc5e97795e 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -460,17 +460,4 @@ template struct CommandTraits; */ typedef void CommandCallback(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); -/** - * Structure for buffering the build command when selecting a station to join. - */ -struct CommandContainer { - TileIndex tile; ///< tile command being executed on. - uint32 p1; ///< parameter p1. - uint32 p2; ///< parameter p2. - Commands cmd; ///< command being executed. - StringID err_msg; ///< string ID of error message to use. - CommandCallback *callback; ///< any callback function executed upon successful completion of the command. - std::string text; ///< possible text sent for name changes etc. -}; - #endif /* COMMAND_TYPE_H */ diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 52b1483815..da7e0518f4 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -27,6 +27,7 @@ #include "zoom_func.h" #include "tunnelbridge_cmd.h" #include "dock_cmd.h" +#include "station_cmd.h" #include "widgets/dock_widget.h" @@ -205,16 +206,25 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_STATION: { // Build station button - uint32 p2 = (uint32)INVALID_STATION << 16; // no station to join - - /* tile is always the land tile, so need to evaluate _thd.pos */ - CommandContainer cmdcont = { tile, _ctrl_pressed, p2, CMD_BUILD_DOCK, STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, "" }; - /* Determine the watery part of the dock. */ DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile, ReverseDiagDir(dir)) : tile); - ShowSelectStationIfNeeded(cmdcont, TileArea(tile, tile_to)); + uint32 p1 = _ctrl_pressed; + uint32 p2 = (uint32)INVALID_STATION << 16; // no station to join + + auto proc = [=](bool test, StationID to_join) -> bool { + if (test) { + return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_DOCK)), CMD_BUILD_DOCK, tile, p1, p2).Succeeded(); + } else { + uint32 p2_final = p2; + if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); + + return DoCommandP(CMD_BUILD_DOCK, STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, p1, p2_final); + } + }; + + ShowSelectStationIfNeeded(TileArea(tile, tile_to), proc); break; } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 7cf1b0059f..76d51ccb2c 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -36,6 +36,8 @@ #include "sortlist_type.h" #include "stringfilter_type.h" #include "string_func.h" +#include "station_cmd.h" +#include "waypoint_cmd.h" #include "station_map.h" #include "tunnelbridge_map.h" @@ -198,8 +200,18 @@ static void PlaceRail_Station(TileIndex tile) int h = _settings_client.gui.station_platlength; if (!_railstation.orientation) Swap(w, h); - CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, "" }; - ShowSelectStationIfNeeded(cmdcont, TileArea(tile, w, h)); + auto proc = [=](bool test, StationID to_join) -> bool { + if (test) { + return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_RAIL_STATION)), CMD_BUILD_RAIL_STATION, tile, p1, p2).Succeeded(); + } else { + uint32 p2_final = p2; + if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); + + return DoCommandP(CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, tile, p1, p2_final); + } + }; + + ShowSelectStationIfNeeded(TileArea(tile, w, h), proc); } } @@ -724,8 +736,18 @@ struct BuildRailToolbarWindow : Window { uint32 p1 = _cur_railtype | (select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y) << 6 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24; uint32 p2 = STAT_CLASS_WAYP | _cur_waypoint_type << 8 | INVALID_STATION << 16; - CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT, STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, "" }; - ShowSelectWaypointIfNeeded(cmdcont, ta); + auto proc = [=](bool test, StationID to_join) -> bool { + if (test) { + return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_RAIL_WAYPOINT)), CMD_BUILD_RAIL_WAYPOINT, ta.tile, p1, p2).Succeeded(); + } else { + uint32 p2_final = p2; + if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); + + return DoCommandP(CMD_BUILD_RAIL_WAYPOINT, STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, ta.tile, p1, p2_final); + } + }; + + ShowSelectWaypointIfNeeded(ta, proc); } } break; @@ -883,8 +905,18 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) uint32 p1 = _cur_railtype | _railstation.orientation << 6 | numtracks << 8 | platlength << 16 | _ctrl_pressed << 24; uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16; - CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, "" }; - ShowSelectStationIfNeeded(cmdcont, ta); + auto proc = [=](bool test, StationID to_join) -> bool { + if (test) { + return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_RAIL_STATION)), CMD_BUILD_RAIL_STATION, ta.tile, p1, p2).Succeeded(); + } else { + uint32 p2_final = p2; + if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); + + return DoCommandP(CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, ta.tile, p1, p2_final); + } + }; + + ShowSelectStationIfNeeded(ta, proc); } /** Enum referring to the Hotkeys in the build rail station window */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index eedcc8f59c..00ea29042d 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -31,6 +31,7 @@ #include "strings_func.h" #include "core/geometry_func.hpp" #include "date_func.h" +#include "station_cmd.h" #include "widgets/road_widget.h" @@ -179,12 +180,14 @@ void CcRoadStop(const CommandCost &result, Commands cmd, TileIndex tile, uint32 * @param p2 bit 0: 0 For bus stops, 1 for truck stops. * bit 2: Allow stations directly adjacent to other stations. * bit 5..10: The roadtypes. - * @param cmd Command to use. * @param err_msg Error message to show. * @see CcRoadStop() */ -static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, Commands cmd, StringID err_msg) +static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, StringID err_msg) { + TileArea ta(start_tile, end_tile); + uint32 p1 = (uint32)(ta.w | ta.h << 8); + uint8 ddir = _road_station_picker_orientation; SB(p2, 16, 16, INVALID_STATION); // no station to join @@ -194,9 +197,18 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, C } p2 |= ddir << 3; // Set the DiagDirecion into p2 bits 3 and 4. - TileArea ta(start_tile, end_tile); - CommandContainer cmdcont = { ta.tile, (uint32)(ta.w | ta.h << 8), p2, cmd, err_msg, CcRoadStop, "" }; - ShowSelectStationIfNeeded(cmdcont, ta); + auto proc = [=](bool test, StationID to_join) -> bool { + if (test) { + return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_ROAD_STOP)), CMD_BUILD_ROAD_STOP, ta.tile, p1, p2).Succeeded(); + } else { + uint32 p2_final = p2; + if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); + + return DoCommandP(CMD_BUILD_ROAD_STOP, err_msg, CcRoadStop, ta.tile, p1, p2_final); + } + }; + + ShowSelectStationIfNeeded(ta, proc); } /** @@ -684,7 +696,7 @@ struct BuildRoadToolbarWindow : Window { TileArea ta(start_tile, end_tile); DoCommandP(CMD_REMOVE_ROAD_STOP, this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS); } else { - PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, CMD_BUILD_ROAD_STOP, this->rti->strings.err_build_station[ROADSTOP_BUS]); + PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, this->rti->strings.err_build_station[ROADSTOP_BUS]); } } break; @@ -696,7 +708,7 @@ struct BuildRoadToolbarWindow : Window { TileArea ta(start_tile, end_tile); DoCommandP(CMD_REMOVE_ROAD_STOP, this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK); } else { - PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); + PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); } } break; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index e1229fe3d1..2e04e7ac44 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2264,13 +2264,13 @@ static const NWidgetPart _nested_select_station_widgets[] = { */ template struct SelectStationWindow : Window { - CommandContainer select_station_cmd; ///< Command to build new station + StationPickerCmdProc select_station_proc; TileArea area; ///< Location of new station Scrollbar *vscroll; - SelectStationWindow(WindowDesc *desc, const CommandContainer &cmd, TileArea ta) : + SelectStationWindow(WindowDesc *desc, TileArea ta, StationPickerCmdProc&& proc) : Window(desc), - select_station_cmd(cmd), + select_station_proc(std::move(proc)), area(ta) { this->CreateNestedTree(); @@ -2341,12 +2341,8 @@ struct SelectStationWindow : Window { if (distant_join && st_index >= _stations_nearby_list.size()) return; - /* Insert station to be joined into stored command */ - SB(this->select_station_cmd.p2, 16, 16, - (distant_join ? _stations_nearby_list[st_index] : NEW_STATION)); - /* Execute stored Command */ - DoCommandP(&this->select_station_cmd); + this->select_station_proc(false, distant_join ? _stations_nearby_list[st_index] : NEW_STATION); /* Close Window; this might cause double frees! */ CloseWindowById(WC_SELECT_STATION, 0); @@ -2412,7 +2408,7 @@ static WindowDesc _select_station_desc( * @return whether we need to show the station selection window. */ template -static bool StationJoinerNeeded(const CommandContainer &cmd, TileArea ta) +static bool StationJoinerNeeded(TileArea ta, const StationPickerCmdProc &proc) { /* Only show selection if distant join is enabled in the settings */ if (!_settings_game.station.distant_join_stations) return false; @@ -2430,7 +2426,7 @@ static bool StationJoinerNeeded(const CommandContainer &cmd, TileArea ta) if (!_ctrl_pressed) return false; /* Now check if we could build there */ - if (DoCommand(&cmd, CommandFlagsToDCFlags(GetCommandFlags(cmd.cmd))).Failed()) return false; + if (!proc(true, INVALID_STATION)) return false; /* Test for adjacent station or station below selection. * If adjacent-stations is disabled and we are building next to a station, do not show the selection window. @@ -2446,32 +2442,32 @@ static bool StationJoinerNeeded(const CommandContainer &cmd, TileArea ta) * @tparam the class to find stations for */ template -void ShowSelectBaseStationIfNeeded(const CommandContainer &cmd, TileArea ta) +void ShowSelectBaseStationIfNeeded(TileArea ta, StationPickerCmdProc&& proc) { - if (StationJoinerNeeded(cmd, ta)) { + if (StationJoinerNeeded(ta, proc)) { if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); - new SelectStationWindow(&_select_station_desc, cmd, ta); + new SelectStationWindow(&_select_station_desc, ta, std::move(proc)); } else { - DoCommandP(&cmd); + proc(false, INVALID_STATION); } } /** * Show the station selection window when needed. If not, build the station. - * @param cmd Command to build the station. * @param ta Area to build the station in + * @param proc Function called to execute the build command. */ -void ShowSelectStationIfNeeded(const CommandContainer &cmd, TileArea ta) +void ShowSelectStationIfNeeded(TileArea ta, StationPickerCmdProc proc) { - ShowSelectBaseStationIfNeeded(cmd, ta); + ShowSelectBaseStationIfNeeded(ta, std::move(proc)); } /** * Show the waypoint selection window when needed. If not, build the waypoint. - * @param cmd Command to build the waypoint. * @param ta Area to build the waypoint in + * @param proc Function called to execute the build command. */ -void ShowSelectWaypointIfNeeded(const CommandContainer &cmd, TileArea ta) +void ShowSelectWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc) { - ShowSelectBaseStationIfNeeded(cmd, ta); + ShowSelectBaseStationIfNeeded(ta, std::move(proc)); } diff --git a/src/station_gui.h b/src/station_gui.h index ac2fa2fc32..9bed30b672 100644 --- a/src/station_gui.h +++ b/src/station_gui.h @@ -13,6 +13,8 @@ #include "command_type.h" #include "tilearea_type.h" #include "window_type.h" +#include "station_type.h" +#include /** Types of cargo to display for station coverage. */ @@ -25,7 +27,9 @@ enum StationCoverageType { int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies); void CheckRedrawStationCoverage(const Window *w); -void ShowSelectStationIfNeeded(const CommandContainer &cmd, TileArea ta); -void ShowSelectWaypointIfNeeded(const CommandContainer &cmd, TileArea ta); +using StationPickerCmdProc = std::function; + +void ShowSelectStationIfNeeded(TileArea ta, StationPickerCmdProc proc); +void ShowSelectWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc); #endif /* STATION_GUI_H */ From c88b104ec662ea80bec89f58aa7ad9d0baac7704 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Fri, 29 Oct 2021 14:41:20 +0200 Subject: [PATCH 114/710] Codechange: Use wrapper struct to automatically manage command depth tracking. --- src/command.cpp | 59 ++++++++++++++++++---------------------------- src/command_func.h | 11 +++++++++ 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index e9ae695285..06025a949d 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -65,6 +65,9 @@ #include "safeguards.h" +int RecursiveCommandCounter::_counter = 0; + + /** * Define a command with the flags which belongs to it. * @@ -162,7 +165,6 @@ bool IsCommandAllowedWhilePaused(Commands cmd) } -static int _docommand_recursive = 0; /*! * This function executes a given command with the parameters from the #CommandProc parameter list. * Depending on the flags parameter it execute or test a command. @@ -186,43 +188,34 @@ CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 /* Chop of any CMD_MSG or other flags; we don't need those here */ CommandProc *proc = _command_proc_table[cmd].proc; - _docommand_recursive++; + RecursiveCommandCounter counter{}; /* only execute the test call if it's toplevel, or we're not execing. */ - if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) { - if (_docommand_recursive == 1) _cleared_object_areas.clear(); + if (counter.IsTopLevel() || !(flags & DC_EXEC) ) { + if (counter.IsTopLevel()) _cleared_object_areas.clear(); SetTownRatingTestMode(true); res = proc(flags & ~DC_EXEC, tile, p1, p2, text); SetTownRatingTestMode(false); - if (res.Failed()) { - goto error; - } + if (res.Failed()) return res; - if (_docommand_recursive == 1 && + if (counter.IsTopLevel() && !(flags & DC_QUERY_COST) && !(flags & DC_BANKRUPT) && !CheckCompanyHasMoney(res)) { // CheckCompanyHasMoney() modifies 'res' to an error if it fails. - goto error; - } - - if (!(flags & DC_EXEC)) { - _docommand_recursive--; return res; } + + if (!(flags & DC_EXEC)) return res; } /* Execute the command here. All cost-relevant functions set the expenses type * themselves to the cost object at some point */ - if (_docommand_recursive == 1) _cleared_object_areas.clear(); + if (counter.IsTopLevel()) _cleared_object_areas.clear(); res = proc(flags, tile, p1, p2, text); - if (res.Failed()) { -error: - _docommand_recursive--; - return res; - } + if (res.Failed()) return res; /* if toplevel, subtract the money. */ - if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) { + if (counter.IsTopLevel() && !(flags & DC_BANKRUPT)) { SubtractMoneyFromCompany(res); } @@ -395,12 +388,6 @@ bool InjectNetworkCommand(Commands cmd, StringID err_message, CommandCallback *c return DoCommandP(cmd, err_message, callback, my_cmd, true, tile, p1, p2, text); } -/** - * Helper to deduplicate the code for returning. - * @param cmd the command cost to return. - */ -#define return_dcpi(cmd) { _docommand_recursive = 0; return cmd; } - /** Helper to format command parameters into a hex string. */ static std::string CommandParametersToHexString(TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { @@ -423,9 +410,10 @@ static std::string CommandParametersToHexString(TileIndex tile, uint32 p1, uint3 */ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) { + RecursiveCommandCounter counter{}; + /* Prevent recursion; it gives a mess over the network */ - assert(_docommand_recursive == 0); - _docommand_recursive = 1; + assert(counter.IsTopLevel()); /* Reset the state. */ _additional_cash_required = 0; @@ -446,7 +434,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba assert(!(cmd_flags & CMD_CLIENT_ID) || p2 != 0); /* Do not even think about executing out-of-bounds tile-commands */ - if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return_dcpi(CMD_ERROR); + if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return CMD_ERROR; /* Always execute server and spectator commands as spectator */ bool exec_as_spectator = (cmd_flags & (CMD_SPECTATOR | CMD_SERVER)) != 0; @@ -455,7 +443,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * The server will ditch any server commands a client sends to it, so effectively * this guards the server from executing functions for an invalid company. */ if (_game_mode == GM_NORMAL && !exec_as_spectator && !Company::IsValidID(_current_company) && !(_current_company == OWNER_DEITY && (cmd_flags & CMD_DEITY) != 0)) { - return_dcpi(CMD_ERROR); + return CMD_ERROR; } Backup cur_company(_current_company, FILE_LINE); @@ -487,7 +475,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba Debug(desync, 1, "cmdf: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cmd, err_message, tile, CommandParametersToHexString(tile, p1, p2, text), GetCommandName(cmd)); } cur_company.Restore(); - return_dcpi(res); + return res; } /* @@ -502,7 +490,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * This way it's not handled by DoCommand and only the * actual execution of the command causes messages. Also * reset the storages as we've not executed the command. */ - return_dcpi(CommandCost()); + return CommandCost(); } Debug(desync, 1, "cmd: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cmd, err_message, tile, CommandParametersToHexString(tile, p1, p2, text), GetCommandName(cmd)); @@ -532,7 +520,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba if (!test_and_exec_can_differ) { assert(res.GetCost() == res2.GetCost() && res.Failed() == res2.Failed()); // sanity check } else if (res2.Failed()) { - return_dcpi(res2); + return res2; } /* If we're needing more money and we haven't done @@ -542,7 +530,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * So make sure the signal buffer is empty even in this case */ UpdateSignalsInBuffer(); SetDParam(0, _additional_cash_required); - return_dcpi(CommandCost(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY)); + return CommandCost(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY); } /* update last build coordinate of company. */ @@ -556,9 +544,8 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba /* update signals if needed */ UpdateSignalsInBuffer(); - return_dcpi(res2); + return res2; } -#undef return_dcpi /** diff --git a/src/command_func.h b/src/command_func.h index 0b539746d9..2a6f0c68a7 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -72,4 +72,15 @@ static inline DoCommandFlag CommandFlagsToDCFlags(CommandFlags cmd_flags) return flags; } +/** Helper class to keep track of command nesting level. */ +struct RecursiveCommandCounter { + RecursiveCommandCounter() noexcept { _counter++; } + ~RecursiveCommandCounter() noexcept { _counter--; } + + /** Are we in the top-level command execution? */ + bool IsTopLevel() const { return _counter == 1; } +private: + static int _counter; +}; + #endif /* COMMAND_FUNC_H */ From e740c24eb7a90bc771f5976d64d80639ee7576e5 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 30 Oct 2021 01:31:46 +0200 Subject: [PATCH 115/710] Codechange: Template DoCommand to automagically reflect the parameters of the command proc. When finished, this will allow each command handler to take individually different parameters, obliviating the need for bit-packing. --- src/aircraft_cmd.cpp | 7 ++- src/airport_gui.cpp | 2 +- src/autoreplace_cmd.cpp | 32 ++++++----- src/bridge_gui.cpp | 3 +- src/build_vehicle_gui.cpp | 2 +- src/clear_cmd.cpp | 3 +- src/command.cpp | 92 ++++++++++++------------------- src/command_func.h | 73 +++++++++++++++++++++++- src/command_type.h | 3 +- src/company_cmd.cpp | 2 +- src/disaster_vehicle.cpp | 5 +- src/dock_gui.cpp | 2 +- src/economy.cpp | 11 ++-- src/group_cmd.cpp | 8 +-- src/industry_cmd.cpp | 16 +++--- src/landscape.cpp | 4 +- src/misc_gui.cpp | 3 +- src/object_cmd.cpp | 13 +++-- src/order_backup.cpp | 5 +- src/order_cmd.cpp | 3 +- src/rail_cmd.cpp | 27 +++++---- src/rail_gui.cpp | 9 +-- src/road_cmd.cpp | 22 ++++---- src/road_gui.cpp | 5 +- src/roadveh_cmd.cpp | 3 +- src/script/api/script_object.cpp | 2 +- src/script/api/script_vehicle.cpp | 5 +- src/station_cmd.cpp | 24 ++++---- src/terraform_cmd.cpp | 7 ++- src/terraform_gui.cpp | 3 +- src/town_cmd.cpp | 50 +++++++++-------- src/train_cmd.cpp | 4 +- src/tree_cmd.cpp | 5 +- src/tunnelbridge_cmd.cpp | 18 +++--- src/vehicle.cpp | 12 ++-- src/vehicle_cmd.cpp | 33 ++++++----- src/vehicle_gui.cpp | 5 +- src/water_cmd.cpp | 23 ++++---- src/waypoint_cmd.cpp | 3 +- 39 files changed, 320 insertions(+), 229 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 5e0eea35bf..998f75e6bd 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -38,6 +38,7 @@ #include "newgrf_airporttiles.h" #include "framerate_type.h" #include "aircraft_cmd.h" +#include "vehicle_cmd.h" #include "table/strings.h" @@ -1275,7 +1276,7 @@ void HandleMissingAircraftOrders(Aircraft *v) const Station *st = GetTargetAirportIfValid(v); if (st == nullptr) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost ret = DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index, 0); + CommandCost ret = Command::Do(DC_EXEC, v->tile, v->index, 0, {}); cur_company.Restore(); if (ret.Failed()) CrashAirplane(v); @@ -1638,7 +1639,7 @@ static void AircraftEventHandler_HeliTakeOff(Aircraft *v, const AirportFTAClass /* Send the helicopter to a hangar if needed for replacement */ if (v->NeedsAutomaticServicing()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0); + Command::Do(DC_EXEC, v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0, {}); cur_company.Restore(); } } @@ -1689,7 +1690,7 @@ static void AircraftEventHandler_Landing(Aircraft *v, const AirportFTAClass *apc /* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */ if (v->NeedsAutomaticServicing()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | DEPOT_SERVICE, 0); + Command::Do(DC_EXEC, v->tile, v->index | DEPOT_SERVICE, 0, {}); cur_company.Restore(); } } diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 65c59784b5..98776e52fd 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -66,7 +66,7 @@ static void PlaceAirport(TileIndex tile) auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_AIRPORT)), CMD_BUILD_AIRPORT, tile, p1, p2).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, p1, p2, {}).Succeeded(); } else { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index a4a4e88a2f..4ba41942c9 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -23,6 +23,10 @@ #include "news_func.h" #include "strings_func.h" #include "autoreplace_cmd.h" +#include "group_cmd.h" +#include "order_cmd.h" +#include "train_cmd.h" +#include "vehicle_cmd.h" #include "table/strings.h" @@ -341,7 +345,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic } /* Build the new vehicle */ - cost = DoCommand(DC_EXEC | DC_AUTOREPLACE, CMD_BUILD_VEHICLE, old_veh->tile, e | (CT_INVALID << 24), 0); + cost = Command::Do(DC_EXEC | DC_AUTOREPLACE, old_veh->tile, e | (CT_INVALID << 24), 0, {}); if (cost.Failed()) return cost; Vehicle *new_veh = Vehicle::Get(_new_vehicle_id); @@ -351,13 +355,13 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic if (refit_cargo != CT_NO_REFIT) { byte subtype = GetBestFittingSubType(old_veh, new_veh, refit_cargo); - cost.AddCost(DoCommand(DC_EXEC, CMD_REFIT_VEHICLE, 0, new_veh->index, refit_cargo | (subtype << 8))); + cost.AddCost(Command::Do(DC_EXEC, 0, new_veh->index, refit_cargo | (subtype << 8), {})); assert(cost.Succeeded()); // This should be ensured by GetNewCargoTypeForReplace() } /* Try to reverse the vehicle, but do not care if it fails as the new type might not be reversible */ if (new_veh->type == VEH_TRAIN && HasBit(Train::From(old_veh)->flags, VRF_REVERSE_DIRECTION)) { - DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, 0, new_veh->index, true); + Command::Do(DC_EXEC, 0, new_veh->index, true, {}); } return cost; @@ -371,7 +375,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic */ static inline CommandCost CmdStartStopVehicle(const Vehicle *v, bool evaluate_callback) { - return DoCommand(DC_EXEC | DC_AUTOREPLACE, CMD_START_STOP_VEHICLE, 0, v->index, evaluate_callback ? 1 : 0); + return Command::Do(DC_EXEC | DC_AUTOREPLACE, 0, v->index, evaluate_callback ? 1 : 0, {}); } /** @@ -384,7 +388,7 @@ static inline CommandCost CmdStartStopVehicle(const Vehicle *v, bool evaluate_ca */ static inline CommandCost CmdMoveVehicle(const Vehicle *v, const Vehicle *after, DoCommandFlag flags, bool whole_chain) { - return DoCommand(flags | DC_NO_CARGO_CAP_CHECK, CMD_MOVE_RAIL_VEHICLE, 0, v->index | (whole_chain ? 1 : 0) << 20, after != nullptr ? after->index : INVALID_VEHICLE); + return Command::Do(flags | DC_NO_CARGO_CAP_CHECK, 0, v->index | (whole_chain ? 1 : 0) << 20, after != nullptr ? after->index : INVALID_VEHICLE, {}); } /** @@ -398,10 +402,10 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head, CommandCost cost = CommandCost(); /* Share orders */ - if (cost.Succeeded() && old_head != new_head) cost.AddCost(DoCommand(DC_EXEC, CMD_CLONE_ORDER, 0, new_head->index | CO_SHARE << 30, old_head->index)); + if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, 0, new_head->index | CO_SHARE << 30, old_head->index, {})); /* Copy group membership */ - if (cost.Succeeded() && old_head != new_head) cost.AddCost(DoCommand(DC_EXEC, CMD_ADD_VEHICLE_GROUP, 0, old_head->group_id, new_head->index)); + if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, 0, old_head->group_id, new_head->index, {})); /* Perform start/stop check whether the new vehicle suits newgrf restrictions etc. */ if (cost.Succeeded()) { @@ -467,11 +471,11 @@ static CommandCost ReplaceFreeUnit(Vehicle **single_unit, DoCommandFlag flags, b } /* Sell the old vehicle */ - cost.AddCost(DoCommand(flags, CMD_SELL_VEHICLE, 0, old_v->index, 0)); + cost.AddCost(Command::Do(flags, 0, old_v->index, 0, {})); /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, new_v->index, 0); + Command::Do(DC_EXEC, 0, new_v->index, 0, {}); } } @@ -598,7 +602,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon assert(RailVehInfo(wagon->engine_type)->railveh_type == RAILVEH_WAGON); /* Sell wagon */ - [[maybe_unused]] CommandCost ret = DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, wagon->index, 0); + [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC, 0, wagon->index, 0, {}); assert(ret.Succeeded()); new_vehs[i] = nullptr; @@ -630,7 +634,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon /* Sell the vehicle. * Note: This might temporarily construct new trains, so use DC_AUTOREPLACE to prevent * it from failing due to engine limits. */ - cost.AddCost(DoCommand(flags | DC_AUTOREPLACE, CMD_SELL_VEHICLE, 0, w->index, 0)); + cost.AddCost(Command::Do(flags | DC_AUTOREPLACE, 0, w->index, 0, {})); if ((flags & DC_EXEC) != 0) { old_vehs[i] = nullptr; if (i == 0) old_head = nullptr; @@ -661,7 +665,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon if ((flags & DC_EXEC) == 0) { for (int i = num_units - 1; i >= 0; i--) { if (new_vehs[i] != nullptr) { - DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, new_vehs[i]->index, 0); + Command::Do(DC_EXEC, 0, new_vehs[i]->index, 0, {}); new_vehs[i] = nullptr; } } @@ -692,12 +696,12 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon } /* Sell the old vehicle */ - cost.AddCost(DoCommand(flags, CMD_SELL_VEHICLE, 0, old_head->index, 0)); + cost.AddCost(Command::Do(flags, 0, old_head->index, 0, {})); } /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, new_head->index, 0); + Command::Do(DC_EXEC, 0, new_head->index, 0, {}); } } } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 3524b357c3..abd1f3da54 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -23,6 +23,7 @@ #include "cmd_helper.h" #include "tunnelbridge_map.h" #include "road_gui.h" +#include "tunnelbridge_cmd.h" #include "widgets/bridge_widget.h" @@ -391,7 +392,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo /* only query bridge building possibility once, result is the same for all bridges! * returns CMD_ERROR on failure, and price on success */ StringID errmsg = INVALID_STRING_ID; - CommandCost ret = DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)) | DC_QUERY_COST, CMD_BUILD_BRIDGE, end, start, type); + CommandCost ret = Command::Do(CommandFlagsToDCFlags(GetCommandFlags()) | DC_QUERY_COST, end, start, type, {}); GUIBridgeList *bl = nullptr; if (ret.Failed()) { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 7901b45740..9082de5a97 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1228,7 +1228,7 @@ struct BuildVehicleWindow : Window { if (!this->listview_mode) { /* Query for cost and refitted capacity */ - CommandCost ret = DoCommand(DC_QUERY_COST, CMD_BUILD_VEHICLE, this->window_number, this->sel_engine | (cargo << 24), 0); + CommandCost ret = Command::Do(DC_QUERY_COST, this->window_number, this->sel_engine | (cargo << 24), 0, {}); if (ret.Succeeded()) { this->te.cost = ret.GetCost() - e->GetCost(); this->te.capacity = _returned_refit_capacity; diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index 918f5c373c..f2f7ecc197 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -16,6 +16,7 @@ #include "water.h" #include "core/random_func.hpp" #include "newgrf_generic.h" +#include "landscape_cmd.h" #include "table/strings.h" #include "table/sprites.h" @@ -381,7 +382,7 @@ static void ChangeTileOwner_Clear(TileIndex tile, Owner old_owner, Owner new_own static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } extern const TileTypeProcs _tile_type_clear_procs = { diff --git a/src/command.cpp b/src/command.cpp index 06025a949d..69cbaa6c92 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -164,64 +164,6 @@ bool IsCommandAllowedWhilePaused(Commands cmd) return _game_mode == GM_EDITOR || command_type_lookup[_command_proc_table[cmd].type] <= _settings_game.construction.command_pause_level; } - -/*! - * This function executes a given command with the parameters from the #CommandProc parameter list. - * Depending on the flags parameter it execute or test a command. - * - * @param flags Flags for the command and how to execute the command - * @param cmd The command-id to execute (a value of the CMD_* enums) - * @param tile The tile to apply the command on (for the #CommandProc) - * @param p1 Additional data for the command (for the #CommandProc) - * @param p2 Additional data for the command (for the #CommandProc) - * @param text The text to pass - * @see CommandProc - * @return the cost - */ -CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - CommandCost res; - - /* Do not even think about executing out-of-bounds tile-commands */ - if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return CMD_ERROR; - - /* Chop of any CMD_MSG or other flags; we don't need those here */ - CommandProc *proc = _command_proc_table[cmd].proc; - - RecursiveCommandCounter counter{}; - - /* only execute the test call if it's toplevel, or we're not execing. */ - if (counter.IsTopLevel() || !(flags & DC_EXEC) ) { - if (counter.IsTopLevel()) _cleared_object_areas.clear(); - SetTownRatingTestMode(true); - res = proc(flags & ~DC_EXEC, tile, p1, p2, text); - SetTownRatingTestMode(false); - if (res.Failed()) return res; - - if (counter.IsTopLevel() && - !(flags & DC_QUERY_COST) && - !(flags & DC_BANKRUPT) && - !CheckCompanyHasMoney(res)) { // CheckCompanyHasMoney() modifies 'res' to an error if it fails. - return res; - } - - if (!(flags & DC_EXEC)) return res; - } - - /* Execute the command here. All cost-relevant functions set the expenses type - * themselves to the cost object at some point */ - if (counter.IsTopLevel()) _cleared_object_areas.clear(); - res = proc(flags, tile, p1, p2, text); - if (res.Failed()) return res; - - /* if toplevel, subtract the money. */ - if (counter.IsTopLevel() && !(flags & DC_BANKRUPT)) { - SubtractMoneyFromCompany(res); - } - - return res; -} - /*! * This functions returns the money which can be used to execute a command. * This is either the money of the current company or INT64_MAX if there @@ -237,6 +179,40 @@ Money GetAvailableMoneyForCommand() } +/** + * Prepare for calling a command proc. + * @param top_level Top level of command execution, i.e. command from a command. + * @param test Test run of command? + */ +void CommandHelperBase::InternalDoBefore(bool top_level, bool test) +{ + if (top_level) _cleared_object_areas.clear(); + if (test) SetTownRatingTestMode(true); +} + +/** + * Process result after calling a command proc. + * @param[in,out] res Command result, may be modified. + * @param flags Command flags. + * @param top_level Top level of command execution, i.e. command from a command. + * @param test Test run of command? + */ +void CommandHelperBase::InternalDoAfter(CommandCost &res, DoCommandFlag flags, bool top_level, bool test) +{ + if (test) { + SetTownRatingTestMode(false); + + if (res.Succeeded() && top_level && !(flags & DC_QUERY_COST) && !(flags & DC_BANKRUPT)) { + CheckCompanyHasMoney(res); // CheckCompanyHasMoney() modifies 'res' to an error if it fails. + } + } else { + /* If top-level, subtract the money. */ + if (res.Succeeded() && top_level && !(flags & DC_BANKRUPT)) { + SubtractMoneyFromCompany(res); + } + } +} + /*! * Toplevel network safe docommand function for the current company. Must not be called recursively. * The callback is called when the command succeeded or failed. The parameters diff --git a/src/command_func.h b/src/command_func.h index 2a6f0c68a7..1c24221cd2 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -13,6 +13,7 @@ #include "command_type.h" #include "company_type.h" #include +#include "tile_map.h" /** * Define a default return value for a failed command. @@ -36,7 +37,6 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); /** Storage buffer for serialized command data. */ typedef std::vector CommandDataBuffer; -CommandCost DoCommand(DoCommandFlag flags, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); bool DoCommandP(Commands cmd, StringID err_message, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); @@ -58,12 +58,18 @@ const char *GetCommandName(Commands cmd); Money GetAvailableMoneyForCommand(); bool IsCommandAllowedWhilePaused(Commands cmd); +template +constexpr CommandFlags GetCommandFlags() +{ + return CommandTraits::flags; +} + /** * Extracts the DC flags needed for DoCommand from the flags returned by GetCommandFlags * @param cmd_flags Flags from GetCommandFlags * @return flags for DoCommand */ -static inline DoCommandFlag CommandFlagsToDCFlags(CommandFlags cmd_flags) +static constexpr inline DoCommandFlag CommandFlagsToDCFlags(CommandFlags cmd_flags) { DoCommandFlag flags = DC_NONE; if (cmd_flags & CMD_NO_WATER) flags |= DC_NO_WATER; @@ -83,4 +89,67 @@ private: static int _counter; }; + +template struct CommandHelper; + +class CommandHelperBase { +protected: + static void InternalDoBefore(bool top_level, bool test); + static void InternalDoAfter(CommandCost &res, DoCommandFlag flags, bool top_level, bool test); +}; + +/** + * Templated wrapper that exposes the command parameter arguments + * for the various Command::Do/Post calls. + * @tparam Tcmd The command-id to execute. + * @tparam Targs The command parameter types. + */ +template +struct CommandHelper : protected CommandHelperBase { +public: + /** + * This function executes a given command with the parameters from the #CommandProc parameter list. + * Depending on the flags parameter it executes or tests a command. + * + * @note This function is to be called from the StateGameLoop or from within the execution of a Command. + * This function must not be called from the context of a "player" (real person, AI, game script). + * Use ::Post for commands directly triggered by "players". + * + * @param flags Flags for the command and how to execute the command + * @param args Parameters for the command + * @see CommandProc + * @return the cost + */ + static CommandCost Do(DoCommandFlag flags, Targs... args) + { + if constexpr (std::is_same_v>>) { + /* Do not even think about executing out-of-bounds tile-commands. */ + TileIndex tile = std::get<0>(std::make_tuple(args...)); + if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return CMD_ERROR; + } + + RecursiveCommandCounter counter{}; + + /* Only execute the test call if it's toplevel, or we're not execing. */ + if (counter.IsTopLevel() || !(flags & DC_EXEC)) { + InternalDoBefore(counter.IsTopLevel(), true); + CommandCost res = CommandTraits::proc(flags & ~DC_EXEC, args...); + InternalDoAfter(res, flags, counter.IsTopLevel(), true); // Can modify res. + + if (res.Failed() || !(flags & DC_EXEC)) return res; + } + + /* Execute the command here. All cost-relevant functions set the expenses type + * themselves to the cost object at some point. */ + InternalDoBefore(counter.IsTopLevel(), false); + CommandCost res = CommandTraits::proc(flags, args...); + InternalDoAfter(res, flags, counter.IsTopLevel(), false); + + return res; + } +}; + +template +using Command = CommandHelper::ProcType>; + #endif /* COMMAND_FUNC_H */ diff --git a/src/command_type.h b/src/command_type.h index cc5e97795e..c182ca393e 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -435,7 +435,8 @@ template struct CommandTraits; #define DEF_CMD_TRAIT(cmd_, proc_, flags_, type_) \ template<> struct CommandTraits { \ - using Args = typename CommandFunctionTraitHelper::Args; \ + using ProcType = decltype(&proc_); \ + using Args = typename CommandFunctionTraitHelper::Args; \ static constexpr Commands cmd = cmd_; \ static constexpr auto &proc = proc_; \ static constexpr CommandFlags flags = (CommandFlags)(flags_); \ diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index f659a43673..6bd60659b7 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -1128,7 +1128,7 @@ CommandCost CmdRenamePresident(DoCommandFlag flags, TileIndex tile, uint32 p1, u c->president_name = text; if (c->name_1 == STR_SV_UNNAMED && c->name.empty()) { - DoCommand(DC_EXEC, CMD_RENAME_COMPANY, 0, 0, 0, text + " Transport"); + Command::Do(DC_EXEC, 0, 0, 0, text + " Transport"); } } diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index 63f4188a88..6319af0ab2 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -45,6 +45,7 @@ #include "company_base.h" #include "core/random_func.hpp" #include "core/backup_type.hpp" +#include "landscape_cmd.h" #include "table/strings.h" @@ -61,7 +62,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_RAILWAY: if (Company::IsHumanID(GetTileOwner(tile)) && !IsRailDepot(tile)) { Backup cur_company(_current_company, OWNER_WATER, FILE_LINE); - DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(DC_EXEC, tile, 0, 0, {}); cur_company.Restore(); /* update signals in buffer */ @@ -71,7 +72,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_HOUSE: { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(DC_EXEC, tile, 0, 0, {}); cur_company.Restore(); break; } diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index da7e0518f4..571bfdcec0 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -215,7 +215,7 @@ struct BuildDocksToolbarWindow : Window { auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_DOCK)), CMD_BUILD_DOCK, tile, p1, p2).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, p1, p2, {}).Succeeded(); } else { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); diff --git a/src/economy.cpp b/src/economy.cpp index 39e98342f9..e7daf8e3d1 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -49,6 +49,7 @@ #include "story_base.h" #include "linkgraph/refresh.h" #include "economy_cmd.h" +#include "vehicle_cmd.h" #include "table/strings.h" #include "table/pricebase.h" @@ -313,7 +314,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) for (i = 0; i < 4; i++) { if (c->share_owners[i] == old_owner) { /* Sell its shares */ - CommandCost res = DoCommand(DC_EXEC | DC_BANKRUPT, CMD_SELL_SHARE_IN_COMPANY, 0, c->index, 0); + CommandCost res = Command::Do(DC_EXEC | DC_BANKRUPT, 0, c->index, 0, {}); /* Because we are in a DoCommand, we can't just execute another one and * expect the money to be removed. We need to do it ourself! */ SubtractMoneyFromCompany(res); @@ -333,7 +334,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) } else { cur_company2.Change(c->share_owners[i]); /* Sell the shares */ - CommandCost res = DoCommand(DC_EXEC | DC_BANKRUPT, CMD_SELL_SHARE_IN_COMPANY, 0, old_owner, 0); + CommandCost res = Command::Do(DC_EXEC | DC_BANKRUPT, 0, old_owner, 0, {}); /* Because we are in a DoCommand, we can't just execute another one and * expect the money to be removed. We need to do it ourself! */ SubtractMoneyFromCompany(res); @@ -449,7 +450,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) * However, do not rely on that behaviour. */ int interval = CompanyServiceInterval(new_company, v->type); - DoCommand(DC_EXEC | DC_BANKRUPT, CMD_CHANGE_SERVICE_INT, v->tile, v->index, interval | (new_company->settings.vehicle.servint_ispercent << 17)); + Command::Do(DC_EXEC | DC_BANKRUPT, v->tile, v->index, interval | (new_company->settings.vehicle.servint_ispercent << 17), {}); } v->owner = new_owner; @@ -1486,7 +1487,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station if (st->goods[cid].cargo.HasCargoFor(next_station)) { /* Try to find out if auto-refitting would succeed. In case the refit is allowed, * the returned refit capacity will be greater than zero. */ - DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. + Command::Do(DC_QUERY_COST, v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16, {}); // Auto-refit and only this vehicle including artic parts. /* Try to balance different loadable cargoes between parts of the consist, so that * all of them can be loaded. Avoid a situation where all vehicles suddenly switch * to the first loadable cargo for which there is only one packet. If the capacities @@ -1509,7 +1510,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station * "via any station" before reserving. We rather produce some more "any station" cargo than * misrouting it. */ IterateVehicleParts(v_start, ReturnCargoAction(st, INVALID_STATION)); - CommandCost cost = DoCommand(DC_EXEC, CMD_REFIT_VEHICLE, v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16); // Auto-refit and only this vehicle including artic parts. + CommandCost cost = Command::Do(DC_EXEC, v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16, {}); // Auto-refit and only this vehicle including artic parts. if (cost.Succeeded()) v->First()->profit_this_year -= cost.GetCost() << 8; } diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index fbe08ffd0c..2ff8a09dfd 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -357,12 +357,12 @@ CommandCost CmdDeleteGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 if (g == nullptr || g->owner != _current_company) return CMD_ERROR; /* Remove all vehicles from the group */ - DoCommand(flags, CMD_REMOVE_ALL_VEHICLES_GROUP, 0, p1, 0); + Command::Do(flags, 0, p1, 0, {}); /* Delete sub-groups */ for (const Group *gp : Group::Iterate()) { if (gp->parent == g->index) { - DoCommand(flags, CMD_DELETE_GROUP, 0, gp->index, 0); + Command::Do(flags, 0, gp->index, 0, {}); } } @@ -581,7 +581,7 @@ CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 /* For each shared vehicles add it to the group */ for (Vehicle *v2 = v->FirstShared(); v2 != nullptr; v2 = v2->NextShared()) { - if (v2->group_id != id_g) DoCommand(flags, CMD_ADD_VEHICLE_GROUP, tile, id_g, v2->index, text); + if (v2->group_id != id_g) Command::Do(flags, tile, id_g, v2->index, text); } } } @@ -617,7 +617,7 @@ CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, TileIndex tile, uint3 if (v->group_id != old_g) continue; /* Add The Vehicle to the default group */ - DoCommand(flags, CMD_ADD_VEHICLE_GROUP, tile, DEFAULT_GROUP, v->index, text); + Command::Do(flags,tile, DEFAULT_GROUP, v->index, text); } } diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index e2fa1b7769..b7d6d3714c 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -43,6 +43,8 @@ #include "cmd_helper.h" #include "string_func.h" #include "industry_cmd.h" +#include "landscape_cmd.h" +#include "terraform_cmd.h" #include "table/strings.h" #include "table/industry_land.h" @@ -1101,7 +1103,7 @@ static bool SearchLumberMillTrees(TileIndex tile, void *user_data) _industry_sound_tile = tile; if (_settings_client.sound.ambient) SndPlayTileFx(SND_38_LUMBER_MILL_1, tile); - DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(DC_EXEC, tile, 0, 0, {}); cur_company.Restore(); return true; @@ -1483,13 +1485,13 @@ static CommandCost CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTil /* Clear the tiles as OWNER_TOWN to not affect town rating, and to not clear protected buildings */ Backup cur_company(_current_company, OWNER_TOWN, FILE_LINE); - CommandCost ret = DoCommand(DC_NONE, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); + CommandCost ret = Command::Do(DC_NONE, cur_tile, 0, 0, {}); cur_company.Restore(); if (ret.Failed()) return ret; } else { /* Clear the tiles, but do not affect town ratings */ - CommandCost ret = DoCommand(DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); + CommandCost ret = Command::Do(DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, cur_tile, 0, 0, {}); if (ret.Failed()) return ret; } @@ -1599,7 +1601,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, } /* This is not 100% correct check, but the best we can do without modifying the map. * What is missing, is if the difference in height is more than 1.. */ - if (DoCommand(flags & ~DC_EXEC, CMD_TERRAFORM_LAND, tile_walk, SLOPE_N, (curh > h) ? 0 : 1).Failed()) { + if (Command::Do(flags & ~DC_EXEC, tile_walk, SLOPE_N, (curh > h) ? 0 : 1, {}).Failed()) { cur_company.Restore(); return false; } @@ -1614,7 +1616,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, /* We give the terraforming for free here, because we can't calculate * exact cost in the test-round, and as we all know, that will cause * a nice assert if they don't match ;) */ - DoCommand(flags, CMD_TERRAFORM_LAND, tile_walk, SLOPE_N, (curh > h) ? 0 : 1); + Command::Do(flags, tile_walk, SLOPE_N, (curh > h) ? 0 : 1, {}); curh += (curh > h) ? -1 : 1; } } @@ -1884,7 +1886,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, WaterClass wc = (IsWaterTile(cur_tile) ? GetWaterClass(cur_tile) : WATER_CLASS_INVALID); - DoCommand(DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); + Command::Do(DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, cur_tile, 0, 0, {}); MakeIndustry(cur_tile, i->index, it.gfx, Random(), wc); @@ -3060,7 +3062,7 @@ static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, i } } } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } extern const TileTypeProcs _tile_type_industry_procs = { diff --git a/src/landscape.cpp b/src/landscape.cpp index 1259617ace..6efa8dba29 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -756,7 +756,7 @@ CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 TileIterator *iter = HasBit(p2, 0) ? (TileIterator *)new DiagonalTileIterator(tile, p1) : new OrthogonalTileIterator(tile, p1); for (; *iter != INVALID_TILE; ++(*iter)) { TileIndex t = *iter; - CommandCost ret = DoCommand(flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR, t, 0, 0); + CommandCost ret = Command::Do(flags & ~DC_EXEC, t, 0, 0, {}); if (ret.Failed()) { last_error = ret; @@ -773,7 +773,7 @@ CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 delete iter; return cost; } - DoCommand(flags, CMD_LANDSCAPE_CLEAR, t, 0, 0); + Command::Do(flags, t, 0, 0, {}); /* draw explosion animation... * Disable explosions when game is paused. Looks silly and blocks the view. */ diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 859798deb1..b2e8b886e0 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -26,6 +26,7 @@ #include "zoom_func.h" #include "guitimer_func.h" #include "viewport_func.h" +#include "landscape_cmd.h" #include "rev.h" #include "widgets/misc_widget.h" @@ -191,7 +192,7 @@ public: Company *c = Company::GetIfValid(_local_company); if (c != nullptr) { assert(_current_company == _local_company); - CommandCost costclear = DoCommand(DC_QUERY_COST, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + CommandCost costclear = Command::Do(DC_QUERY_COST, tile, 0, 0, {}); if (costclear.Succeeded()) { Money cost = costclear.GetCost(); if (cost < 0) { diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index b5271727ce..a651239baf 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -34,6 +34,7 @@ #include "vehicle_func.h" #include "station_func.h" #include "object_cmd.h" +#include "landscape_cmd.h" #include "table/strings.h" #include "table/object_land.h" @@ -230,7 +231,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 if (type == OBJECT_OWNED_LAND) { /* Owned land is special as it can be placed on any slope. */ - cost.AddCost(DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0)); + cost.AddCost(Command::Do(flags, tile, 0, 0, {})); } else { /* Check the surface to build on. At this time we can't actually execute the * the CLEAR_TILE commands since the newgrf callback later on can check @@ -243,7 +244,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 if (!IsWaterTile(t)) { /* Normal water tiles don't have to be cleared. For all other tile types clear * the tile but leave the water. */ - cost.AddCost(DoCommand(flags & ~DC_NO_WATER & ~DC_EXEC, CMD_LANDSCAPE_CLEAR, t, 0, 0)); + cost.AddCost(Command::Do(flags & ~DC_NO_WATER & ~DC_EXEC, t, 0, 0, {})); } else { /* Can't build on water owned by another company. */ Owner o = GetTileOwner(t); @@ -261,7 +262,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 IsTileType(t, MP_OBJECT) && IsTileOwner(t, _current_company) && IsObjectType(t, OBJECT_HQ))) { - cost.AddCost(DoCommand(flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR, t, 0, 0)); + cost.AddCost(Command::Do(flags & ~DC_EXEC, t, 0, 0, {})); } } } @@ -293,10 +294,10 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 for (TileIndex t : ta) { if (HasTileWaterGround(t)) { if (!IsWaterTile(t)) { - DoCommand((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, t, 0, 0); + Command::Do((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, t, 0, 0, {}); } } else { - DoCommand(flags | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR, t, 0, 0); + Command::Do(flags | DC_NO_MODIFY_TOWN_RATING, t, 0, 0, {}); } } } @@ -848,7 +849,7 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, int } } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } extern const TileTypeProcs _tile_type_object_procs = { diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 76c416abd3..80fc9fa6d1 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -17,6 +17,7 @@ #include "window_func.h" #include "station_map.h" #include "order_cmd.h" +#include "group_cmd.h" #include "safeguards.h" @@ -74,7 +75,7 @@ void OrderBackup::DoRestore(Vehicle *v) { /* If we had shared orders, recover that */ if (this->clone != nullptr) { - DoCommand(DC_EXEC, CMD_CLONE_ORDER, 0, v->index | CO_SHARE << 30, this->clone->index); + Command::Do(DC_EXEC, 0, v->index | CO_SHARE << 30, this->clone->index, {}); } else if (this->orders != nullptr && OrderList::CanAllocateItem()) { v->orders.list = new OrderList(this->orders, v); this->orders = nullptr; @@ -89,7 +90,7 @@ void OrderBackup::DoRestore(Vehicle *v) if (v->cur_implicit_order_index >= v->GetNumOrders()) v->cur_implicit_order_index = v->cur_real_order_index; /* Restore vehicle group */ - DoCommand(DC_EXEC, CMD_ADD_VEHICLE_GROUP, 0, this->group, v->index); + Command::Do(DC_EXEC, 0, this->group, v->index, {}); } /** diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index e48cc95c17..45a0db99fe 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -27,6 +27,7 @@ #include "order_backup.h" #include "cheat_type.h" #include "order_cmd.h" +#include "train_cmd.h" #include "table/strings.h" @@ -2037,7 +2038,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo()); /* If there is no depot in front, reverse automatically (trains only) */ - if (v->type == VEH_TRAIN && reverse) DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, v->tile, v->index, 0); + if (v->type == VEH_TRAIN && reverse) Command::Do(DC_EXEC, v->tile, v->index, 0, {}); if (v->type == VEH_AIRCRAFT) { Aircraft *a = Aircraft::From(v); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index af99b03ae2..066fb78200 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -32,6 +32,7 @@ #include "company_gui.h" #include "object_map.h" #include "rail_cmd.h" +#include "landscape_cmd.h" #include "table/strings.h" #include "table/railtypes.h" @@ -452,7 +453,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u CommandCost ret = CheckTileOwnership(tile); if (ret.Failed()) return ret; - if (!IsPlainRail(tile)) return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); // just get appropriate error message + if (!IsPlainRail(tile)) return Command::Do(flags, tile, 0, 0, {}); // just get appropriate error message if (!IsCompatibleRail(GetRailType(tile), railtype)) return_cmd_error(STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION); @@ -470,7 +471,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u for (Track track_it = TRACK_BEGIN; track_it < TRACK_END; track_it++) { if (HasTrack(tile, track_it) && HasSignalOnTrack(tile, track_it)) { - CommandCost ret_remove_signals = DoCommand(flags, CMD_REMOVE_SIGNALS, tile, track_it, 0); + CommandCost ret_remove_signals = Command::Do(flags, tile, track_it, 0, {}); if (ret_remove_signals.Failed()) return ret_remove_signals; cost.AddCost(ret_remove_signals); } @@ -482,7 +483,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u * the present rail type are powered on the new rail type. */ if (GetRailType(tile) != railtype && !HasPowerOnRail(railtype, GetRailType(tile))) { if (HasPowerOnRail(GetRailType(tile), railtype)) { - ret = DoCommand(flags, CMD_CONVERT_RAIL, tile, tile, railtype); + ret = Command::Do(flags, tile, tile, railtype, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } else { @@ -582,7 +583,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u if (ret.Failed()) return ret; cost.AddCost(ret); - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + ret = Command::Do(flags, tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -692,7 +693,7 @@ CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, /* Charge extra to remove signals on the track, if they are there */ if (HasSignalOnTrack(tile, track)) { - cost.AddCost(DoCommand(flags, CMD_REMOVE_SIGNALS, tile, track, 0)); + cost.AddCost(Command::Do(flags, tile, track, 0, {})); } if (flags & DC_EXEC) { @@ -785,7 +786,7 @@ bool FloodHalftile(TileIndex t) TrackBits to_remove = lower_track & rail_bits; if (to_remove != 0) { Backup cur_company(_current_company, OWNER_WATER, FILE_LINE); - flooded = DoCommand(DC_EXEC, CMD_REMOVE_SINGLE_RAIL, t, 0, FIND_FIRST_BIT(to_remove)).Succeeded(); + flooded = Command::Do(DC_EXEC, t, 0, FIND_FIRST_BIT(to_remove), {}).Succeeded(); cur_company.Restore(); if (!flooded) return flooded; // not yet floodable rail_bits = rail_bits & ~to_remove; @@ -904,7 +905,8 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, uint3 bool had_success = false; CommandCost last_error = CMD_ERROR; for (;;) { - CommandCost ret = DoCommand(flags, remove ? CMD_REMOVE_SINGLE_RAIL : CMD_BUILD_SINGLE_RAIL, tile, remove ? 0 : railtype, TrackdirToTrack(trackdir) | (auto_remove_signals << 3)); + uint32 p2 = TrackdirToTrack(trackdir) | (auto_remove_signals << 3); + CommandCost ret = remove ? Command::Do(flags, tile, 0, p2, {}) : Command::Do(flags, tile, railtype, p2, {}); if (ret.Failed()) { last_error = ret; @@ -1008,7 +1010,7 @@ CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, u cost.AddCost(_price[PR_BUILD_FOUNDATION]); } - cost.AddCost(DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0)); + cost.AddCost(Command::Do(flags, tile, 0, 0, {})); if (cost.Failed()) return cost; if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -1359,7 +1361,8 @@ static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uin if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(trackdir); if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(trackdir); - CommandCost ret = DoCommand(test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS, tile, param1, signals); + DoCommandFlag do_flags = test_only ? flags & ~DC_EXEC : flags; + CommandCost ret = remove ? Command::Do(do_flags, tile, param1, signals, {}) : Command::Do(do_flags, tile, param1, signals, {}); if (test_only) return ret.Succeeded(); @@ -1879,7 +1882,7 @@ static CommandCost ClearTile_Track(TileIndex tile, DoCommandFlag flags) TrackBits tracks = GetTrackBits(tile); while (tracks != TRACK_BIT_NONE) { Track track = RemoveFirstTrack(&tracks); - CommandCost ret = DoCommand(flags, CMD_REMOVE_SINGLE_RAIL, tile, 0, track); + CommandCost ret = Command::Do(flags, tile, 0, track, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -2953,7 +2956,7 @@ static void ChangeTileOwner_Track(TileIndex tile, Owner old_owner, Owner new_own SetTileOwner(tile, new_owner); } else { - DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); } } @@ -3141,7 +3144,7 @@ static CommandCost TerraformTile_Track(TileIndex tile, DoCommandFlag flags, int AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRailDepotDirection(tile))) { return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 76d51ccb2c..f88352f9e6 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -37,6 +37,7 @@ #include "stringfilter_type.h" #include "string_func.h" #include "station_cmd.h" +#include "tunnelbridge_cmd.h" #include "waypoint_cmd.h" #include "station_map.h" @@ -202,7 +203,7 @@ static void PlaceRail_Station(TileIndex tile) auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_RAIL_STATION)), CMD_BUILD_RAIL_STATION, tile, p1, p2).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, p1, p2, {}).Succeeded(); } else { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); @@ -738,7 +739,7 @@ struct BuildRailToolbarWindow : Window { auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_RAIL_WAYPOINT)), CMD_BUILD_RAIL_WAYPOINT, ta.tile, p1, p2).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, p1, p2, {}).Succeeded(); } else { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); @@ -773,7 +774,7 @@ struct BuildRailToolbarWindow : Window { void OnPlacePresize(Point pt, TileIndex tile) override { - DoCommand(DC_AUTO, CMD_BUILD_TUNNEL, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0); + Command::Do(DC_AUTO, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, {}); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } @@ -907,7 +908,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_RAIL_STATION)), CMD_BUILD_RAIL_STATION, ta.tile, p1, p2).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, p1, p2, {}).Succeeded(); } else { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 6fa8244e1e..637b476d0d 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -38,6 +38,8 @@ #include "company_gui.h" #include "road_func.h" #include "road_cmd.h" +#include "landscape_cmd.h" +#include "rail_cmd.h" #include "table/strings.h" #include "table/roadtypes.h" @@ -367,7 +369,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec if (!IsTileType(tile, MP_ROAD)) { /* If it's the last roadtype, just clear the whole tile */ - if (GetRoadType(tile, OtherRoadTramType(rtt)) == INVALID_ROADTYPE) return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + if (GetRoadType(tile, OtherRoadTramType(rtt)) == INVALID_ROADTYPE) return Command::Do(flags, tile, 0, 0, {}); CommandCost cost(EXPENSES_CONSTRUCTION); if (IsTileType(tile, MP_TUNNELBRIDGE)) { @@ -822,7 +824,7 @@ do_clear:; } if (need_to_clear) { - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + CommandCost ret = Command::Do(flags, tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -868,7 +870,7 @@ do_clear:; if (HasPowerOnRoad(rt, existing_rt)) { rt = existing_rt; } else if (HasPowerOnRoad(existing_rt, rt)) { - CommandCost ret = DoCommand(flags, CMD_CONVERT_ROAD, tile, tile, rt); + CommandCost ret = Command::Do(flags, tile, tile, rt, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } else { @@ -1039,7 +1041,7 @@ CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p if (tile == start_tile && HasBit(p2, 0)) bits &= DiagDirToRoadBits(dir); } - CommandCost ret = DoCommand(flags, CMD_BUILD_ROAD, tile, drd << 11 | rt << 4 | bits, 0); + CommandCost ret = Command::Do(flags, tile, drd << 11 | rt << 4 | bits, 0, {}); if (ret.Failed()) { last_error = ret; if (last_error.GetErrorMessage() != STR_ERROR_ALREADY_BUILT) { @@ -1130,7 +1132,7 @@ CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 if (flags & DC_EXEC) { money_spent += ret.GetCost(); if (money_spent > 0 && money_spent > money_available) { - _additional_cash_required = DoCommand(flags & ~DC_EXEC, CMD_REMOVE_LONG_ROAD, start_tile, end_tile, p2).GetCost(); + _additional_cash_required = Command::Do(flags & ~DC_EXEC, start_tile, end_tile, p2, {}).GetCost(); return cost; } RemoveRoad(tile, flags, bits, rtt, true, false); @@ -1181,7 +1183,7 @@ CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, ui cost.AddCost(_price[PR_BUILD_FOUNDATION]); } - cost.AddCost(DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0)); + cost.AddCost(Command::Do(flags, tile, 0, 0, {})); if (cost.Failed()) return cost; if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -1267,7 +1269,7 @@ static CommandCost ClearTile_Road(TileIndex tile, DoCommandFlag flags) } if (flags & DC_EXEC) { - DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(flags, tile, 0, 0, {}); } return ret; } @@ -2195,7 +2197,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne if (IsRoadDepot(tile)) { if (GetTileOwner(tile) == old_owner) { if (new_owner == INVALID_OWNER) { - DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); } else { /* A road depot has two road bits. No need to dirty windows here, we'll redraw the whole screen anyway. */ RoadType rt = GetRoadTypeRoad(tile); @@ -2232,7 +2234,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne if (IsLevelCrossing(tile)) { if (GetTileOwner(tile) == old_owner) { if (new_owner == INVALID_OWNER) { - DoCommand(DC_EXEC | DC_BANKRUPT, CMD_REMOVE_SINGLE_RAIL, tile, 0, GetCrossingRailTrack(tile)); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, GetCrossingRailTrack(tile), {}); } else { /* Update infrastructure counts. No need to dirty windows here, we'll redraw the whole screen anyway. */ Company::Get(old_owner)->infrastructure.rail[GetRailType(tile)] -= LEVELCROSSING_TRACKBIT_FACTOR; @@ -2281,7 +2283,7 @@ static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, int z } } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } /** Update power of road vehicle under which is the roadtype being converted */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 00ea29042d..145934ffc5 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -32,6 +32,7 @@ #include "core/geometry_func.hpp" #include "date_func.h" #include "station_cmd.h" +#include "tunnelbridge_cmd.h" #include "widgets/road_widget.h" @@ -199,7 +200,7 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, S auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_ROAD_STOP)), CMD_BUILD_ROAD_STOP, ta.tile, p1, p2).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, p1, p2, {}).Succeeded(); } else { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); @@ -722,7 +723,7 @@ struct BuildRoadToolbarWindow : Window { void OnPlacePresize(Point pt, TileIndex tile) override { - DoCommand(DC_AUTO, CMD_BUILD_TUNNEL, tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0); + Command::Do(DC_AUTO, tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0, {}); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 4c83814033..efe45c507d 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -35,6 +35,7 @@ #include "zoom_func.h" #include "framerate_type.h" #include "roadveh_cmd.h" +#include "road_cmd.h" #include "table/strings.h" @@ -1134,7 +1135,7 @@ static bool CanBuildTramTrackOnTile(CompanyID c, TileIndex t, RoadType rt, RoadB /* The 'current' company is not necessarily the owner of the vehicle. */ Backup cur_company(_current_company, c, FILE_LINE); - CommandCost ret = DoCommand(DC_NO_WATER, CMD_BUILD_ROAD, t, rt << 4 | r, 0); + CommandCost ret = Command::Do(DC_NO_WATER, t, rt << 4 | r, 0, {}); cur_company.Restore(); return ret.Succeeded(); diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index 720e922f12..56fdde8261 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -9,13 +9,13 @@ #include "../../stdafx.h" #include "../../script/squirrel.hpp" -#include "../../command_func.h" #include "../../company_func.h" #include "../../company_base.h" #include "../../network/network.h" #include "../../genworld.h" #include "../../string_func.h" #include "../../strings_func.h" +#include "../../command_func.h" #include "../script_storage.hpp" #include "../script_instance.hpp" diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index 9e2a56e923..a062616185 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -20,6 +20,7 @@ #include "../../train.h" #include "../../vehicle_func.h" #include "../../aircraft.h" +#include "../../vehicle_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -91,7 +92,7 @@ if (!ScriptEngine::IsBuildable(engine_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - CommandCost res = ::DoCommand(DC_QUERY_COST, CMD_BUILD_VEHICLE, depot, engine_id | (cargo << 24), 0); + CommandCost res = ::Command::Do(DC_QUERY_COST, depot, engine_id | (cargo << 24), 0, {}); return res.Succeeded() ? _returned_refit_capacity : -1; } @@ -140,7 +141,7 @@ if (!IsValidVehicle(vehicle_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - CommandCost res = ::DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, 0, vehicle_id, cargo); + CommandCost res = ::Command::Do(DC_QUERY_COST, 0, vehicle_id, cargo, {}); return res.Succeeded() ? _returned_refit_capacity : -1; } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index f53523bc31..33f86146c4 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -58,6 +58,8 @@ #include "tunnelbridge_map.h" #include "station_cmd.h" #include "waypoint_cmd.h" +#include "landscape_cmd.h" +#include "rail_cmd.h" #include "table/strings.h" @@ -843,7 +845,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo if (ret.Failed()) return ret; cost.AddCost(ret); - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_iter, 0, 0); + ret = Command::Do(flags, tile_iter, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -923,14 +925,14 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl affected_vehicles.push_back(v); } } - CommandCost ret = DoCommand(flags, CMD_REMOVE_SINGLE_RAIL, tile_cur, 0, track); + CommandCost ret = Command::Do(flags, tile_cur, 0, track, {}); if (ret.Failed()) return ret; cost.AddCost(ret); /* With flags & ~DC_EXEC CmdLandscapeClear would fail since the rail still exists */ continue; } } - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_cur, 0, 0); + ret = Command::Do(flags, tile_cur, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -1048,7 +1050,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags cost.AddCost(RoadBuildCost(rt) * 2); } } else { - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0); + ret = Command::Do(flags, cur_tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(RoadBuildCost(rt) * 2); @@ -1754,7 +1756,7 @@ static CommandCost RemoveRailStation(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove platforms tile by tile */ if (_current_company == OWNER_WATER) { - return DoCommand(DC_EXEC, CMD_REMOVE_FROM_RAIL_STATION, tile, 0, 0); + return Command::Do(DC_EXEC, tile, 0, 0, {}); } Station *st = Station::GetByTile(tile); @@ -1775,7 +1777,7 @@ static CommandCost RemoveRailWaypoint(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove waypoints tile by tile */ if (_current_company == OWNER_WATER) { - return DoCommand(DC_EXEC, CMD_REMOVE_FROM_RAIL_WAYPOINT, tile, 0, 0); + return Command::Do(DC_EXEC, tile, 0, 0, {}); } return RemoveRailStation(Waypoint::GetByTile(tile), flags, _price[PR_CLEAR_WAYPOINT_RAIL]); @@ -2537,7 +2539,7 @@ CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]); - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + ret = Command::Do(flags, tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -2552,7 +2554,7 @@ CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Get the water class of the water tile before it is cleared.*/ WaterClass wc = GetWaterClass(tile_cur); - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_cur, 0, 0); + ret = Command::Do(flags, tile_cur, 0, 0, {}); if (ret.Failed()) return ret; tile_cur += TileOffsByDiagDir(direction); @@ -4242,12 +4244,12 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o } else { if (IsDriveThroughStopTile(tile)) { /* Remove the drive-through road stop */ - DoCommand(DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP, tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS, {}); assert(IsTileType(tile, MP_ROAD)); /* Change owner of tile and all roadtypes */ ChangeTileOwner(tile, old_owner, new_owner); } else { - DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); /* Set tile owner of water under (now removed) buoy and dock to OWNER_NONE. * Update owner of buoy if it was not removed (was in orders). * Do not update when owned by OWNER_WATER (sea and rivers). */ @@ -4364,7 +4366,7 @@ static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, in } } } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } /** diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index 17da36ecc8..df178e3abf 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -18,6 +18,7 @@ #include "company_func.h" #include "core/backup_type.hpp" #include "terraform_cmd.h" +#include "landscape_cmd.h" #include "table/strings.h" @@ -290,7 +291,7 @@ CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uin } CommandCost cost; if (indirectly_cleared) { - cost = DoCommand(tile_flags, CMD_LANDSCAPE_CLEAR, t, 0, 0); + cost = Command::Do(tile_flags, t, 0, 0, {}); } else { cost = _tile_type_procs[GetTileType(t)]->terraform_tile_proc(t, tile_flags, z_min, tileh); } @@ -379,7 +380,7 @@ CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 TileIndex t = *iter; uint curh = TileHeight(t); while (curh != h) { - CommandCost ret = DoCommand(flags & ~DC_EXEC, CMD_TERRAFORM_LAND, t, SLOPE_N, (curh > h) ? 0 : 1); + CommandCost ret = Command::Do(flags & ~DC_EXEC, t, SLOPE_N, (curh > h) ? 0 : 1, {}); if (ret.Failed()) { last_error = ret; @@ -395,7 +396,7 @@ CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 delete iter; return cost; } - DoCommand(flags, CMD_TERRAFORM_LAND, t, SLOPE_N, (curh > h) ? 0 : 1); + Command::Do(flags, t, SLOPE_N, (curh > h) ? 0 : 1, {}); } else { /* When we're at the terraform limit we better bail (unneeded) testing as well. * This will probably cause the terraforming cost to be underestimated, but only diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 498d057aa1..71d897c3d9 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -34,6 +34,7 @@ #include "terraform_cmd.h" #include "zoom_func.h" #include "rail_cmd.h" +#include "landscape_cmd.h" #include "widgets/terraform_widget.h" @@ -513,7 +514,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed) /* Delete all station signs */ for (BaseStation *st : BaseStation::Iterate()) { /* There can be buoys, remove them */ - if (IsBuoyTile(st->xy)) DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, st->xy, 0, 0); + if (IsBuoyTile(st->xy)) Command::Do(DC_EXEC | DC_BANKRUPT, st->xy, 0, 0, {}); if (!st->IsInUse()) delete st; } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 2f961b9cb0..8e87739d3d 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -49,6 +49,10 @@ #include "ai/ai.hpp" #include "game/game.hpp" #include "town_cmd.h" +#include "landscape_cmd.h" +#include "road_cmd.h" +#include "terraform_cmd.h" +#include "tunnelbridge_cmd.h" #include "table/strings.h" #include "table/town_land.h" @@ -939,8 +943,8 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) * If that fails clear the land, and if that fails exit. * This is to make sure that we can build a road here later. */ RoadType rt = GetTownRoadType(t); - if (DoCommand(DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD, tile, ((dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X) | (rt << 4), 0).Failed() && - DoCommand(DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Failed()) { + if (Command::Do(DC_AUTO | DC_NO_WATER, tile, ((dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X) | (rt << 4), 0, {}).Failed() && + Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Failed()) { return false; } } @@ -957,8 +961,8 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) CommandCost res = CMD_ERROR; if (!_generating_world && Chance16(1, 10)) { /* Note: Do not replace "^ SLOPE_ELEVATED" with ComplementSlope(). The slope might be steep. */ - res = DoCommand(DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND, - tile, Chance16(1, 16) ? cur_slope : cur_slope ^ SLOPE_ELEVATED, 0); + res = Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, + tile, Chance16(1, 16) ? cur_slope : cur_slope ^ SLOPE_ELEVATED, 0, {}); } if (res.Failed() && Chance16(1, 3)) { /* We can consider building on the slope, though. */ @@ -974,9 +978,9 @@ static bool TerraformTownTile(TileIndex tile, int edges, int dir) { assert(tile < MapSize()); - CommandCost r = DoCommand(DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND, tile, edges, dir); + CommandCost r = Command::Do(DC_AUTO | DC_NO_WATER, tile, edges, dir, {}); if (r.Failed() || r.GetCost() >= (_price[PR_TERRAFORM] + 2) * 8) return false; - DoCommand(DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_TERRAFORM_LAND, tile, edges, dir); + Command::Do(DC_AUTO | DC_NO_WATER | DC_EXEC, tile, edges, dir, {}); return true; } @@ -1108,7 +1112,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile) static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd) { RoadType rt = GetTownRoadType(t); - if (DoCommand(DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD, tile, rcmd | (rt << 4), t->index).Succeeded()) { + if (Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, tile, rcmd | (rt << 4), t->index, {}).Succeeded()) { _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1155,7 +1159,7 @@ static bool CanRoadContinueIntoNextTile(const Town *t, const TileIndex tile, con if (IsTileType(next_tile, MP_RAILWAY) && !_settings_game.economy.allow_town_level_crossings) return false; /* If a road tile can be built, the construction is allowed. */ - return DoCommand(DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD, next_tile, rcmd | (rt << 4), t->index).Succeeded(); + return Command::Do(DC_AUTO | DC_NO_WATER, next_tile, rcmd | (rt << 4), t->index, {}).Succeeded(); } /** @@ -1223,8 +1227,8 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi /* Can we actually build the bridge? */ RoadType rt = GetTownRoadType(t); - if (DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE, tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15).Succeeded()) { - DoCommand(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE, tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15); + if (Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15, {}).Succeeded()) { + Command::Do(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags()), tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15, {}); _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1294,8 +1298,8 @@ static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDi /* Attempt to build the tunnel. Return false if it fails to let the town build a road instead. */ RoadType rt = GetTownRoadType(t); - if (DoCommand(CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_TUNNEL)), CMD_BUILD_TUNNEL, tile, rt | (TRANSPORT_ROAD << 8), 0).Succeeded()) { - DoCommand(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_TUNNEL)), CMD_BUILD_TUNNEL, tile, rt | (TRANSPORT_ROAD << 8), 0); + if (Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, rt | (TRANSPORT_ROAD << 8), 0, {}).Succeeded()) { + Command::Do(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags()), tile, rt | (TRANSPORT_ROAD << 8), 0, {}); _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1733,9 +1737,9 @@ static bool GrowTown(Town *t) for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) { /* Only work with plain land that not already has a house */ if (!IsTileType(tile, MP_HOUSE) && IsTileFlat(tile)) { - if (DoCommand(DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Succeeded()) { + if (Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Succeeded()) { RoadType rt = GetTownRoadType(t); - DoCommand(DC_EXEC | DC_AUTO, CMD_BUILD_ROAD, tile, GenRandomRoadBits() | (rt << 4), t->index); + Command::Do(DC_EXEC | DC_AUTO, tile, GenRandomRoadBits() | (rt << 4), t->index, {}); cur_company.Restore(); return true; } @@ -2180,7 +2184,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size if (t->cache.population > 0) return t; Backup cur_company(_current_company, OWNER_TOWN, FILE_LINE); - [[maybe_unused]] CommandCost rc = DoCommand(DC_EXEC, CMD_DELETE_TOWN, t->xy, t->index, 0); + [[maybe_unused]] CommandCost rc = Command::Do(DC_EXEC, t->xy, t->index, 0, {}); cur_company.Restore(); assert(rc.Succeeded()); @@ -2281,7 +2285,7 @@ HouseZonesBits GetTownRadiusGroup(const Town *t, TileIndex tile) */ static inline void ClearMakeHouseTile(TileIndex tile, Town *t, byte counter, byte stage, HouseID type, byte random_bits) { - [[maybe_unused]] CommandCost cc = DoCommand(DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + [[maybe_unused]] CommandCost cc = Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, tile, 0, 0, {}); assert(cc.Succeeded()); IncreaseBuildingCount(t, type); @@ -2338,7 +2342,7 @@ static inline bool CanBuildHouseHere(TileIndex tile, bool noslope) if (IsBridgeAbove(tile)) return false; /* can we clear the land? */ - return DoCommand(DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Succeeded(); + return Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Succeeded(); } @@ -2973,7 +2977,7 @@ CommandCost CmdDeleteTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Non-oil rig stations are always a problem. */ if (!(st->facilities & FACIL_AIRPORT) || st->airport.type != AT_OILRIG) return CMD_ERROR; /* We can only automatically delete oil rigs *if* there's no vehicle on them. */ - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, st->airport.tile, 0, 0); + CommandCost ret = Command::Do(flags, st->airport.tile, 0, 0, {}); if (ret.Failed()) return ret; } } @@ -2989,7 +2993,7 @@ CommandCost CmdDeleteTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 * tile was already deleted earlier in the loop. */ for (TileIndex current_tile = 0; current_tile < MapSize(); ++current_tile) { if (IsTileType(current_tile, MP_TUNNELBRIDGE) && TestTownOwnsBridge(current_tile, t)) { - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); + CommandCost ret = Command::Do(flags, current_tile, 0, 0, {}); if (ret.Failed()) return ret; } } @@ -3032,7 +3036,7 @@ CommandCost CmdDeleteTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 break; } if (try_clear) { - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); + CommandCost ret = Command::Do(flags, current_tile, 0, 0, {}); if (ret.Failed()) return ret; } } @@ -3108,7 +3112,7 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags) static bool TryClearTile(TileIndex tile) { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - CommandCost r = DoCommand(DC_NONE, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + CommandCost r = Command::Do(DC_NONE, tile, 0, 0, {}); cur_company.Restore(); return r.Succeeded(); } @@ -3180,7 +3184,7 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags) if (flags & DC_EXEC) { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, statue_data.best_position, 0, 0); + Command::Do(DC_EXEC, statue_data.best_position, 0, 0, {}); cur_company.Restore(); BuildObject(OBJECT_STATUE, statue_data.best_position, _current_company, t); SetBit(t->statues, _current_company); // Once found and built, "inform" the Town. @@ -3787,7 +3791,7 @@ static CommandCost TerraformTile_Town(TileIndex tile, DoCommandFlag flags, int z } } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } /** Tile callback functions for a town */ diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 5a36d0d868..b060ecdbad 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -655,7 +655,7 @@ static CommandCost CmdBuildRailWagon(DoCommandFlag flags, TileIndex tile, const w->engine_type == e->index && ///< Same type w->First() != v && ///< Don't connect to ourself !(w->vehstatus & VS_CRASHED)) { ///< Not crashed/flooded - if (DoCommand(DC_EXEC, CMD_MOVE_RAIL_VEHICLE, 0, v->index | 1 << 20, w->Last()->index).Succeeded()) { + if (Command::Do(DC_EXEC, 0, v->index | 1 << 20, w->Last()->index, {}).Succeeded()) { break; } } @@ -671,7 +671,7 @@ static void NormalizeTrainVehInDepot(const Train *u) for (const Train *v : Train::Iterate()) { if (v->IsFreeWagon() && v->tile == u->tile && v->track == TRACK_BIT_DEPOT) { - if (DoCommand(DC_EXEC, CMD_MOVE_RAIL_VEHICLE, 0, v->index | 1 << 20, u->index).Failed()) { + if (Command::Do(DC_EXEC, 0, v->index | 1 << 20, u->index, {}).Failed()) { break; } } diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index ab439cd58e..79eaa04215 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -24,6 +24,7 @@ #include "newgrf_generic.h" #include "date_func.h" #include "tree_cmd.h" +#include "landscape_cmd.h" #include "table/strings.h" #include "table/tree_land.h" @@ -461,7 +462,7 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 switch (GetRawClearGround(current_tile)) { case CLEAR_FIELDS: case CLEAR_ROCKS: { - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); + CommandCost ret = Command::Do(flags, current_tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); break; @@ -882,7 +883,7 @@ void InitializeTrees() static CommandCost TerraformTile_Trees(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 07fcd4446a..85c611ae5d 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -41,6 +41,8 @@ #include "company_gui.h" #include "station_func.h" #include "tunnelbridge_cmd.h" +#include "landscape_cmd.h" +#include "terraform_cmd.h" #include "table/strings.h" #include "table/bridge_land.h" @@ -419,7 +421,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, u bool allow_on_slopes = (_settings_game.construction.build_on_slopes && transport_type != TRANSPORT_WATER); /* Try and clear the start landscape */ - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_start, 0, 0); + CommandCost ret = Command::Do(flags, tile_start, 0, 0, {}); if (ret.Failed()) return ret; cost = ret; @@ -427,7 +429,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, u cost.AddCost(terraform_cost_north); /* Try and clear the end landscape */ - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_end, 0, 0); + ret = Command::Do(flags, tile_end, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -499,7 +501,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, u default: not_valid_below:; /* try and clear the middle landscape */ - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + ret = Command::Do(flags, tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); break; @@ -673,7 +675,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, uint32 p1, if (HasTileWaterGround(start_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); - CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, start_tile, 0, 0); + CommandCost ret = Command::Do(flags, start_tile, 0, 0, {}); if (ret.Failed()) return ret; /* XXX - do NOT change 'ret' in the loop, as it is used as the price @@ -733,7 +735,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, uint32 p1, if (HasTileWaterGround(end_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); /* Clear the tile in any case */ - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, end_tile, 0, 0); + ret = Command::Do(flags, end_tile, 0, 0, {}); if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); cost.AddCost(ret); @@ -765,7 +767,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, uint32 p1, assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself coa = nullptr; - ret = DoCommand(flags, CMD_TERRAFORM_LAND, end_tile, end_tileh & start_tileh, 0); + ret = Command::Do(flags, end_tile, end_tileh & start_tileh, 0, {}); _cleared_object_areas[(uint)coa_index].first_tile = old_first_tile; if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); cost.AddCost(ret); @@ -1847,7 +1849,7 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, Owner old_owner, Owner if (tt == TRANSPORT_RAIL) { /* Since all of our vehicles have been removed, it is safe to remove the rail * bridge / tunnel. */ - [[maybe_unused]] CommandCost ret = DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); assert(ret.Succeeded()); } else { /* In any other case, we can safely reassign the ownership to OWNER_NONE. */ @@ -2038,7 +2040,7 @@ static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flag if (res.Succeeded() && (z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(flags, tile, 0, 0, {}); } extern const TileTypeProcs _tile_type_tunnelbridge_procs = { diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 82170ed4c0..f09edc9095 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -51,6 +51,10 @@ #include "linkgraph/linkgraph.h" #include "linkgraph/refresh.h" #include "framerate_type.h" +#include "autoreplace_cmd.h" +#include "misc_cmd.h" +#include "train_cmd.h" +#include "vehicle_cmd.h" #include "table/strings.h" @@ -307,7 +311,7 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF SetDParamStr(0, grfconfig->GetName()); SetDParam(1, engine); ShowErrorMessage(part1, part2, WL_CRITICAL); - if (!_networking) DoCommand(DC_EXEC, CMD_PAUSE, 0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1); + if (!_networking) Command::Do(DC_EXEC, 0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1, {}); } /* debug output */ @@ -1055,7 +1059,7 @@ void CallVehicleTicks() const Company *c = Company::Get(_current_company); SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, (Money)c->settings.engine_renew_money)); - CommandCost res = DoCommand(DC_EXEC, CMD_AUTOREPLACE_VEHICLE, 0, v->index, 0); + CommandCost res = Command::Do(DC_EXEC, 0, v->index, 0, {}); SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, -(Money)c->settings.engine_renew_money)); if (!IsLocalCompany()) continue; @@ -1561,7 +1565,7 @@ void VehicleEnterDepot(Vehicle *v) if (v->current_order.IsRefit()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost cost = DoCommand(DC_EXEC, CMD_REFIT_VEHICLE, v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8); + CommandCost cost = Command::Do(DC_EXEC, v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8, {}); cur_company.Restore(); if (cost.Failed()) { @@ -2443,7 +2447,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) /* If there is no depot in front and the train is not already reversing, reverse automatically (trains only) */ if (this->type == VEH_TRAIN && (reverse ^ HasBit(Train::From(this)->flags, VRF_REVERSING))) { - DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, this->tile, this->index, 0); + Command::Do(DC_EXEC, this->tile, this->index, 0, {}); } if (this->type == VEH_AIRCRAFT) { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index fe400bdab2..aeaefe68f4 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -32,6 +32,9 @@ #include "core/random_func.hpp" #include "vehicle_cmd.h" #include "aircraft_cmd.h" +#include "autoreplace_cmd.h" +#include "group_cmd.h" +#include "order_cmd.h" #include "roadveh_cmd.h" #include "train_cmd.h" #include "ship_cmd.h" @@ -180,7 +183,7 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint /* If we are not in DC_EXEC undo everything */ if (flags != subflags) { - DoCommand(DC_EXEC, CMD_SELL_VEHICLE, 0, v->index, 0); + Command::Do(DC_EXEC, 0, v->index, 0, {}); } } @@ -661,7 +664,7 @@ CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 if (!vehicle_list_window && !v->IsChainInDepot()) continue; /* Just try and don't care if some vehicle's can't be stopped. */ - DoCommand(flags, CMD_START_STOP_VEHICLE, tile, v->index, 0); + Command::Do(flags, tile, v->index, 0, {}); } return CommandCost(); @@ -691,7 +694,7 @@ CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, uint32 CommandCost last_error = CMD_ERROR; bool had_success = false; for (uint i = 0; i < list.size(); i++) { - CommandCost ret = DoCommand(flags, CMD_SELL_VEHICLE, tile, list[i]->index | (1 << 20), 0); + CommandCost ret = Command::Do(flags, tile, list[i]->index | (1 << 20), 0, {}); if (ret.Succeeded()) { cost.AddCost(ret); had_success = true; @@ -730,7 +733,7 @@ CommandCost CmdDepotMassAutoReplace(DoCommandFlag flags, TileIndex tile, uint32 /* Ensure that the vehicle completely in the depot */ if (!v->IsChainInDepot()) continue; - CommandCost ret = DoCommand(flags, CMD_AUTOREPLACE_VEHICLE, 0, v->index, 0); + CommandCost ret = Command::Do(flags, 0, v->index, 0, {}); if (ret.Succeeded()) cost.AddCost(ret); } @@ -869,11 +872,11 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint DoCommandFlag build_flags = flags; if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE; - CommandCost cost = DoCommand(build_flags, CMD_BUILD_VEHICLE, tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0); + CommandCost cost = Command::Do(build_flags, tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0, {}); if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ - if (w_front != nullptr) DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | (1 << 20), 0); + if (w_front != nullptr) Command::Do(flags, w_front->tile, w_front->index | (1 << 20), 0, {}); return cost; } @@ -889,12 +892,12 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (v->type == VEH_TRAIN && !v->IsFrontEngine()) { /* this s a train car * add this unit to the end of the train */ - CommandCost result = DoCommand(flags, CMD_MOVE_RAIL_VEHICLE, 0, w->index | 1 << 20, w_rear->index); + CommandCost result = Command::Do(flags, 0, w->index | 1 << 20, w_rear->index, {}); if (result.Failed()) { /* The train can't be joined to make the same consist as the original. * Sell what we already made (clean up) and return an error. */ - DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | 1 << 20, 0); - DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w->index | 1 << 20, 0); + Command::Do(flags, w_front->tile, w_front->index | 1 << 20, 0, {}); + Command::Do(flags, w_front->tile, w->index | 1 << 20, 0, {}); return result; // return error and the message returned from CMD_MOVE_RAIL_VEHICLE } } else { @@ -915,7 +918,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (flags & DC_EXEC) { /* Cloned vehicles belong to the same group */ - DoCommand(flags, CMD_ADD_VEHICLE_GROUP, 0, v_front->group_id, w_front->index); + Command::Do(flags, 0, v_front->group_id, w_front->index, {}); } @@ -937,7 +940,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint /* Find out what's the best sub type */ byte subtype = GetBestFittingSubType(v, w, v->cargo_type); if (w->cargo_type != v->cargo_type || w->cargo_subtype != subtype) { - CommandCost cost = DoCommand(flags, CMD_REFIT_VEHICLE, 0, w->index, v->cargo_type | 1U << 25 | (subtype << 8)); + CommandCost cost = Command::Do(flags, 0, w->index, v->cargo_type | 1U << 25 | (subtype << 8), {}); if (cost.Succeeded()) total_cost.AddCost(cost); } @@ -972,10 +975,10 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * the vehicle refitted before doing this, otherwise the moved * cargo types might not match (passenger vs non-passenger) */ - CommandCost result = DoCommand(flags, CMD_CLONE_ORDER, 0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index); + CommandCost result = Command::Do(flags, 0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index, {}); if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ - DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | 1 << 20, 0); + Command::Do(flags, w_front->tile, w_front->index | 1 << 20, 0, {}); return result; } @@ -986,7 +989,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * check whether the company has enough money manually. */ if (!CheckCompanyHasMoney(total_cost)) { /* The vehicle has already been bought, so now it must be sold again. */ - DoCommand(flags, CMD_SELL_VEHICLE, w_front->tile, w_front->index | 1 << 20, 0); + Command::Do(flags, w_front->tile, w_front->index | 1 << 20, 0, {}); return total_cost; } } @@ -1011,7 +1014,7 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con bool had_success = false; for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; - CommandCost ret = DoCommand(flags, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0); + CommandCost ret = Command::Do(flags, v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0, {}); if (ret.Succeeded()) { had_success = true; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index cac1985b96..d5d6978cc5 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -37,6 +37,7 @@ #include "tilehighlight_func.h" #include "zoom_func.h" #include "depot_cmd.h" +#include "vehicle_cmd.h" #include "safeguards.h" @@ -773,8 +774,8 @@ struct RefitWindow : public Window { { assert(_current_company == _local_company); Vehicle *v = Vehicle::Get(this->window_number); - CommandCost cost = DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, v->tile, this->selected_vehicle, option->cargo | - option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24); + CommandCost cost = Command::Do(DC_QUERY_COST, v->tile, this->selected_vehicle, option->cargo | + option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24, {}); if (cost.Failed()) return INVALID_STRING_ID; diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 6e357f9c68..07c13adcda 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -39,6 +39,7 @@ #include "newgrf_generic.h" #include "industry.h" #include "water_cmd.h" +#include "landscape_cmd.h" #include "table/strings.h" @@ -123,13 +124,13 @@ CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, ui CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_DEPOT_SHIP]); bool add_cost = !IsWaterTile(tile); - CommandCost ret = DoCommand(flags | DC_AUTO, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + CommandCost ret = Command::Do(flags | DC_AUTO, tile, 0, 0, {}); if (ret.Failed()) return ret; if (add_cost) { cost.AddCost(ret); } add_cost = !IsWaterTile(tile2); - ret = DoCommand(flags | DC_AUTO, CMD_LANDSCAPE_CLEAR, tile2, 0, 0); + ret = Command::Do(flags | DC_AUTO, tile2, 0, 0, {}); if (ret.Failed()) return ret; if (add_cost) { cost.AddCost(ret); @@ -307,13 +308,13 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag /* middle tile */ WaterClass wc_middle = HasTileWaterGround(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL; - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + ret = Command::Do(flags, tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); /* lower tile */ if (!IsWaterTile(tile - delta)) { - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile - delta, 0, 0); + ret = Command::Do(flags, tile - delta, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(_price[PR_BUILD_CANAL]); @@ -325,7 +326,7 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag /* upper tile */ if (!IsWaterTile(tile + delta)) { - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile + delta, 0, 0); + ret = Command::Do(flags, tile + delta, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(_price[PR_BUILD_CANAL]); @@ -481,7 +482,7 @@ CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Outside the editor, prevent building canals over your own or OWNER_NONE owned canals */ if (water && IsCanal(current_tile) && _game_mode != GM_EDITOR && (IsTileOwner(current_tile, _current_company) || IsTileOwner(current_tile, OWNER_NONE))) continue; - ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0); + ret = Command::Do(flags, current_tile, 0, 0, {}); if (ret.Failed()) return ret; if (!water) cost.AddCost(ret); @@ -1136,7 +1137,7 @@ void DoFloodTile(TileIndex target) FALLTHROUGH; case MP_CLEAR: - if (DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, target, 0, 0).Succeeded()) { + if (Command::Do(DC_EXEC, target, 0, 0, {}).Succeeded()) { MakeShore(target); MarkTileDirtyByTile(target); flooded = true; @@ -1151,7 +1152,7 @@ void DoFloodTile(TileIndex target) FloodVehicles(target); /* flood flat tile */ - if (DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, target, 0, 0).Succeeded()) { + if (Command::Do(DC_EXEC, target, 0, 0, {}).Succeeded()) { MakeSea(target); MarkTileDirtyByTile(target); flooded = true; @@ -1203,7 +1204,7 @@ static void DoDryUp(TileIndex tile) case MP_WATER: assert(IsCoast(tile)); - if (DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0).Succeeded()) { + if (Command::Do(DC_EXEC, tile, 0, 0, {}).Succeeded()) { MakeClear(tile, CLEAR_GRASS, 3); MarkTileDirtyByTile(tile); } @@ -1362,7 +1363,7 @@ static void ChangeTileOwner_Water(TileIndex tile, Owner old_owner, Owner new_own } /* Remove depot */ - if (IsShipDepot(tile)) DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + if (IsShipDepot(tile)) Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); /* Set owner of canals and locks ... and also canal under dock there was before. * Check if the new owner after removing depot isn't OWNER_WATER. */ @@ -1382,7 +1383,7 @@ static CommandCost TerraformTile_Water(TileIndex tile, DoCommandFlag flags, int /* Canals can't be terraformed */ if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST); - return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + return Command::Do(DC_EXEC, tile, 0, 0, {}); } diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index a95d5c9540..a3edf71e89 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -29,6 +29,7 @@ #include "water.h" #include "company_gui.h" #include "waypoint_cmd.h" +#include "landscape_cmd.h" #include "table/strings.h" @@ -316,7 +317,7 @@ CommandCost CmdBuildBuoy(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]); if (!IsWaterTile(tile)) { - CommandCost ret = DoCommand(flags | DC_AUTO, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + CommandCost ret = Command::Do(flags | DC_AUTO, tile, 0, 0, {}); if (ret.Failed()) return ret; cost.AddCost(ret); } From 0f64ee5ce1548d9cda69917f27c5b1a3cb91823d Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 31 Oct 2021 19:39:09 +0100 Subject: [PATCH 116/710] Codechange: Template DoCommandP to automagically reflect the parameters of the command proc. When finished, this will allow each command handler to take individually different parameters, obliviating the need for bit-packing. --- src/ai/ai_gui.cpp | 10 +- src/airport_gui.cpp | 2 +- src/autoreplace_gui.cpp | 13 ++- src/bridge_gui.cpp | 6 +- src/build_vehicle_gui.cpp | 7 +- src/cheat_gui.cpp | 3 +- src/command.cpp | 148 ++++++---------------------- src/command_func.h | 87 ++++++++++++++-- src/company_cmd.cpp | 2 +- src/company_gui.cpp | 29 +++--- src/console_cmds.cpp | 16 +-- src/depot_gui.cpp | 23 +++-- src/dock_gui.cpp | 16 +-- src/economy.cpp | 3 +- src/engine_gui.cpp | 3 +- src/fios_gui.cpp | 5 +- src/goal_gui.cpp | 7 +- src/group_gui.cpp | 25 ++--- src/highscore_gui.cpp | 9 +- src/industry_gui.cpp | 7 +- src/linkgraph/linkgraphschedule.cpp | 5 +- src/main_gui.cpp | 3 +- src/misc_cmd.cpp | 2 +- src/network/network.cpp | 2 +- src/network/network_command.cpp | 2 +- src/network/network_gui.cpp | 5 +- src/network/network_server.cpp | 5 +- src/object_gui.cpp | 5 +- src/openttd.cpp | 9 +- src/order_backup.cpp | 2 +- src/order_gui.cpp | 45 ++++----- src/rail_gui.cpp | 61 +++++++----- src/road_gui.cpp | 29 +++--- src/settings.cpp | 4 +- src/signs_cmd.cpp | 2 +- src/signs_gui.cpp | 3 +- src/station_gui.cpp | 5 +- src/story_gui.cpp | 7 +- src/terraform_gui.cpp | 18 ++-- src/timetable_gui.cpp | 13 +-- src/toolbar_gui.cpp | 3 +- src/town_gui.cpp | 11 ++- src/train_cmd.cpp | 3 +- src/train_gui.cpp | 3 +- src/tree_gui.cpp | 5 +- src/vehicle_gui.cpp | 31 +++--- src/waypoint_gui.cpp | 3 +- 47 files changed, 375 insertions(+), 332 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 340b6db956..5996039c9d 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -28,6 +28,8 @@ #include "../hotkeys.h" #include "../core/geometry_func.hpp" #include "../guitimer_func.h" +#include "../company_cmd.h" +#include "../misc_cmd.h" #include "ai.hpp" #include "ai_gui.hpp" @@ -1290,8 +1292,8 @@ struct AIDebugWindow : public Window { case WID_AID_RELOAD_TOGGLE: if (ai_debug_company == OWNER_DEITY) break; /* First kill the company of the AI, then start a new one. This should start the current AI again */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0); - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | ai_debug_company << 16, 0); + Command::Post(0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0, {}); + Command::Post(0, CCA_NEW_AI | ai_debug_company << 16, 0, {}); break; case WID_AID_SETTINGS: @@ -1330,7 +1332,7 @@ struct AIDebugWindow : public Window { } if (all_unpaused) { /* All scripts have been unpaused => unpause the game. */ - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); + Command::Post(0, PM_PAUSED_NORMAL, 0, {}); } } } @@ -1379,7 +1381,7 @@ struct AIDebugWindow : public Window { /* Pause the game. */ if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + Command::Post(0, PM_PAUSED_NORMAL, 1, {}); } /* Highlight row that matched */ diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 98776e52fd..af1fb1309f 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -71,7 +71,7 @@ static void PlaceAirport(TileIndex tile) uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - return DoCommandP(CMD_BUILD_AIRPORT, STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, p1, p2_final); + return Command::Post(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, p1, p2_final, {}); } }; diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index d4e392c971..c5cfd04cb6 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -25,6 +25,9 @@ #include "rail_gui.h" #include "road_gui.h" #include "widgets/dropdown_func.h" +#include "autoreplace_cmd.h" +#include "group_cmd.h" +#include "settings_cmd.h" #include "widgets/autoreplace_widget.h" @@ -217,7 +220,7 @@ class ReplaceVehicleWindow : public Window { { EngineID veh_from = this->sel_engine[0]; EngineID veh_to = this->sel_engine[1]; - DoCommandP(CMD_SET_AUTOREPLACE, 0, (replace_when_old ? 1 : 0) | (this->sel_group << 16), veh_from + (veh_to << 16)); + Command::Post(0, (replace_when_old ? 1 : 0) | (this->sel_group << 16), veh_from + (veh_to << 16), {}); } public: @@ -541,10 +544,10 @@ public: case WID_RV_TRAIN_WAGONREMOVE_TOGGLE: { const Group *g = Group::GetIfValid(this->sel_group); if (g != nullptr) { - DoCommandP(CMD_SET_GROUP_FLAG, 0, this->sel_group | (GroupFlags::GF_REPLACE_WAGON_REMOVAL << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL) ? 0 : 1) | (_ctrl_pressed << 1)); + Command::Post(0, this->sel_group | (GroupFlags::GF_REPLACE_WAGON_REMOVAL << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL) ? 0 : 1) | (_ctrl_pressed << 1), {}); } else { // toggle renew_keep_length - DoCommandP(CMD_CHANGE_COMPANY_SETTING, 0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, "company.renew_keep_length"); + Command::Post(0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, "company.renew_keep_length"); } break; } @@ -562,7 +565,7 @@ public: case WID_RV_STOP_REPLACE: { // Stop replacing EngineID veh_from = this->sel_engine[0]; - DoCommandP(CMD_SET_AUTOREPLACE, 0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16)); + Command::Post(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), {}); break; } @@ -584,7 +587,7 @@ public: if (click_side == 0 && _ctrl_pressed && e != INVALID_ENGINE && (GetGroupNumEngines(_local_company, sel_group, e) == 0 || GetGroupNumEngines(_local_company, ALL_GROUP, e) == 0)) { EngineID veh_from = e; - DoCommandP(CMD_SET_AUTOREPLACE, 0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16)); + Command::Post(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), {}); break; } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index abd1f3da54..e9e1f48f5a 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -119,8 +119,8 @@ private: case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->at(i).index; break; default: break; } - DoCommandP(CMD_BUILD_BRIDGE, STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, - this->end_tile, this->start_tile, this->type | this->bridges->at(i).index); + Command::Post(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, + this->end_tile, this->start_tile, this->type | this->bridges->at(i).index, {}); } /** Sort the builable bridges */ @@ -385,7 +385,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo default: break; // water ways and air routes don't have bridge types } if (_ctrl_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len).Succeeded()) { - DoCommandP(CMD_BUILD_BRIDGE, STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, end, start, type | last_bridge_type); + Command::Post(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, end, start, type | last_bridge_type, {}); return; } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 9082de5a97..639bab7a9f 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -30,6 +30,7 @@ #include "cargotype.h" #include "core/geometry_func.hpp" #include "autoreplace_func.h" +#include "engine_cmd.h" #include "train_cmd.h" #include "vehicle_cmd.h" @@ -1460,7 +1461,7 @@ struct BuildVehicleWindow : Window { case WID_BV_SHOW_HIDE: { const Engine *e = (this->sel_engine == INVALID_ENGINE) ? nullptr : Engine::Get(this->sel_engine); if (e != nullptr) { - DoCommandP(CMD_SET_VEHICLE_VISIBILITY, 0, 0, this->sel_engine | (e->IsHidden(_current_company) ? 0 : (1u << 31))); + Command::Post(0, 0, this->sel_engine | (e->IsHidden(_current_company) ? 0 : (1u << 31)), {}); } break; } @@ -1471,7 +1472,7 @@ struct BuildVehicleWindow : Window { CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle; CargoID cargo = this->cargo_filter[this->cargo_filter_criteria]; if (cargo == CF_ANY || cargo == CF_ENGINES) cargo = CF_NONE; - DoCommandP(CMD_BUILD_VEHICLE, GetCmdBuildVehMsg(this->vehicle_type), callback, this->window_number, sel_eng | (cargo << 24), 0); + Command::Post(GetCmdBuildVehMsg(this->vehicle_type), callback, this->window_number, sel_eng | (cargo << 24), 0, {}); } break; } @@ -1636,7 +1637,7 @@ struct BuildVehicleWindow : Window { { if (str == nullptr) return; - DoCommandP(CMD_RENAME_ENGINE, STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type, 0, this->rename_engine, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type, 0, this->rename_engine, 0, str); } void OnDropdownSelect(int widget, int index) override diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 84884b3ded..fcc9a3ef07 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -28,6 +28,7 @@ #include "tile_map.h" #include "newgrf.h" #include "error.h" +#include "misc_cmd.h" #include "widgets/cheat_widget.h" @@ -54,7 +55,7 @@ static int32 _money_cheat_amount = 10000000; */ static int32 ClickMoneyCheat(int32 p1, int32 p2) { - DoCommandP(CMD_MONEY_CHEAT, 0, (uint32)(p2 * _money_cheat_amount), 0); + Command::Post(0, (uint32)(p2 * _money_cheat_amount), 0, {}); return _money_cheat_amount; } diff --git a/src/command.cpp b/src/command.cpp index 69cbaa6c92..dc536a843c 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -213,51 +213,50 @@ void CommandHelperBase::InternalDoAfter(CommandCost &res, DoCommandFlag flags, b } } -/*! - * Toplevel network safe docommand function for the current company. Must not be called recursively. - * The callback is called when the command succeeded or failed. The parameters - * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. - * The parameter \a my_cmd is used to indicate if the command is from a company or the server. - * - * @param cmd The command to execute (a CMD_* value) - * @param callback A callback function to call after the command is finished - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) - * @param network_command execute the command without sending it on the network - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return \c true if the command succeeded, else \c false. +/** + * Decide what to do with the command depending on current game state. + * @param cmd Command to execute. + * @param flags Command flags. + * @param tile Tile of command execution. + * @param err_message Message prefix to show on error. + * @param network_command Does this command come from the network? + * @return error state + do only cost estimation? + send to network only? */ -static bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +std::tuple CommandHelperBase::InternalPostBefore(Commands cmd, CommandFlags flags, TileIndex tile, StringID err_message, bool network_command) { /* Cost estimation is generally only done when the * local user presses shift while doing something. * However, in case of incoming network commands, * map generation or the pause button we do want * to execute. */ - bool estimate_only = _shift_pressed && IsLocalCompany() && - !_generating_world && - !network_command && - !(GetCommandFlags(cmd) & CMD_NO_EST); + bool estimate_only = _shift_pressed && IsLocalCompany() && !_generating_world && !network_command && !(flags & CMD_NO_EST); /* We're only sending the command, so don't do * fancy things for 'success'. */ bool only_sending = _networking && !network_command; - /* Where to show the message? */ + if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cmd) && !estimate_only) { + ShowErrorMessage(err_message, STR_ERROR_NOT_ALLOWED_WHILE_PAUSED, WL_INFO, TileX(tile) * TILE_SIZE, TileY(tile) * TILE_SIZE); + return { true, estimate_only, only_sending }; + } else { + return { false, estimate_only, only_sending }; + } +} + +/** + * Process result of executing a command, possibly displaying any error to the player. + * @param res Command result. + * @param tile Tile of command execution. + * @param estimate_only Is this just cost estimation? + * @param only_sending Was the command only sent to network? + * @param err_message Message prefix to show on error. + * @param my_cmd Is the command from this client? + */ +void CommandHelperBase::InternalPostResult(const CommandCost &res, TileIndex tile, bool estimate_only, bool only_sending, StringID err_message, bool my_cmd) +{ int x = TileX(tile) * TILE_SIZE; int y = TileY(tile) * TILE_SIZE; - if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cmd) && !estimate_only) { - ShowErrorMessage(err_message, STR_ERROR_NOT_ALLOWED_WHILE_PAUSED, WL_INFO, x, y); - return false; - } - - /* Only set p2 when the command does not come from the network. */ - if (!network_command && GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = CLIENT_ID_SERVER; - - CommandCost res = DoCommandPInternal(cmd, err_message, callback, my_cmd, estimate_only, network_command, tile, p1, p2, text); if (res.Failed()) { /* Only show the error when it's for us. */ if (estimate_only || (IsLocalCompany() && err_message != 0 && my_cmd)) { @@ -273,95 +272,6 @@ static bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *call * concept of cost, so don't show it there either. */ ShowCostOrIncomeAnimation(x, y, GetSlopePixelZ(x, y), res.GetCost()); } - - if (!estimate_only && !only_sending && callback != nullptr) { - callback(res, cmd, tile, p1, p2, text); - } - - return res.Succeeded(); -} - -/** - * Shortcut for the long DoCommandP when not using a callback or error message. - * @param cmd The command to execute (a CMD_* value) - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return \c true if the command succeeded, else \c false. - */ -bool DoCommandP(Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - return DoCommandP(cmd, STR_NULL, nullptr, true, false, tile, p1, p2, text); -} - -/** - * Shortcut for the long DoCommandP when not using an error message. - * @param cmd The command to execute (a CMD_* value) - * @param callback A callback function to call after the command is finished - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return \c true if the command succeeded, else \c false. - */ -bool DoCommandP(Commands cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - return DoCommandP(cmd, STR_NULL, callback, true, false, tile, p1, p2, text); -} - -/** - * Shortcut for the long DoCommandP when not using a callback. - * @param cmd The command to execute (a CMD_* value) - * @param err_message Message prefix to show on error - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return \c true if the command succeeded, else \c false. - */ -bool DoCommandP(Commands cmd, StringID err_message, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - return DoCommandP(cmd, err_message, nullptr, true, false, tile, p1, p2, text); -} - -/*! - * Toplevel network safe docommand function for the current company. Must not be called recursively. - * The callback is called when the command succeeded or failed. The parameters - * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. - * - * @param cmd The command to execute (a CMD_* value) - * @param err_message Message prefix to show on error - * @param callback A callback function to call after the command is finished - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return \c true if the command succeeded, else \c false. - */ -bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - return DoCommandP(cmd, err_message, callback, true, false, tile, p1, p2, text); -} - -/** - * Toplevel network safe docommand function for the current company. Must not be called recursively. - * The callback is called when the command succeeded or failed. The parameters - * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute. - * - * @param cmd The command to execute (a CMD_* value) - * @param err_message Message prefix to show on error - * @param callback A callback function to call after the command is finished - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return \c true if the command succeeded, else \c false. - */ -bool InjectNetworkCommand(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - return DoCommandP(cmd, err_message, callback, my_cmd, true, tile, p1, p2, text); } /** Helper to format command parameters into a hex string. */ diff --git a/src/command_func.h b/src/command_func.h index 1c24221cd2..6a9b93ff54 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -37,14 +37,6 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); /** Storage buffer for serialized command data. */ typedef std::vector CommandDataBuffer; - -bool DoCommandP(Commands cmd, StringID err_message, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -bool DoCommandP(Commands cmd, StringID err_message, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -bool DoCommandP(Commands cmd, CommandCallback *callback, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); -bool DoCommandP(Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text = {}); - -bool InjectNetworkCommand(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); - CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); @@ -96,6 +88,8 @@ class CommandHelperBase { protected: static void InternalDoBefore(bool top_level, bool test); static void InternalDoAfter(CommandCost &res, DoCommandFlag flags, bool top_level, bool test); + static std::tuple InternalPostBefore(Commands cmd, CommandFlags flags, TileIndex tile, StringID err_message, bool network_command); + static void InternalPostResult(const CommandCost &res, TileIndex tile, bool estimate_only, bool only_sending, StringID err_message, bool my_cmd); }; /** @@ -147,6 +141,83 @@ public: return res; } + + /** + * Shortcut for the long Post when not using a callback. + * @param err_message Message prefix to show on error + * @param args Parameters for the command + */ + static inline bool Post(StringID err_message, Targs... args) { return Post(err_message, nullptr, std::forward(args)...); } + /** + * Shortcut for the long Post when not using an error message. + * @param callback A callback function to call after the command is finished + * @param args Parameters for the command + */ + static inline bool Post(CommandCallback *callback, Targs... args) { return Post((StringID)0, callback, std::forward(args)...); } + /** + * Shortcut for the long Post when not using a callback or an error message. + * @param args Parameters for the command + */ + static inline bool Post(Targs... args) { return Post((StringID)0, nullptr, std::forward(args)...); } + + /** + * Top-level network safe command execution for the current company. + * Must not be called recursively. The callback is called when the + * command succeeded or failed. + * + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param args Parameters for the command + * @return \c true if the command succeeded, else \c false. + */ + static bool Post(StringID err_message, CommandCallback *callback, Targs... args) + { + return InternalPost(err_message, callback, true, false, std::forward_as_tuple(args...)); + } + + /** + * Execute a command coming from the network. + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @param location Tile location for user feedback. + * @param args Parameters for the command + * @return \c true if the command succeeded, else \c false. + */ + static bool PostFromNet(StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex location, std::tuple args) + { + return InternalPost(err_message, callback, my_cmd, true, location, std::move(args)); + } + +protected: + static bool InternalPost(StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, std::tuple args) + { + /* Where to show the message? */ + TileIndex tile{}; + if constexpr (std::is_same_v>) { + tile = std::get<0>(args); + } + + return InternalPost(err_message, callback, my_cmd, network_command, tile, std::move(args)); + } + + static bool InternalPost(StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, TileIndex tile, std::tuple args) + { + auto [err, estimate_only, only_sending] = InternalPostBefore(Tcmd, GetCommandFlags(), tile, err_message, network_command); + if (err) return false; + + /* Only set p2 when the command does not come from the network. */ + if (!network_command && GetCommandFlags() & CMD_CLIENT_ID && std::get<2>(args) == 0) std::get<2>(args) = CLIENT_ID_SERVER; + + CommandCost res = std::apply(DoCommandPInternal, std::tuple_cat(std::make_tuple(Tcmd, err_message, callback, my_cmd, estimate_only, network_command), args)); + InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd); + + if (!estimate_only && !only_sending && callback != nullptr) { + std::apply(callback, std::tuple_cat(std::tuple{ res, Tcmd }, args)); + } + + return res.Succeeded(); + } }; template diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 6bd60659b7..cf44af25c7 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -604,7 +604,7 @@ static bool MaybeStartNewCompany() if (n < (uint)_settings_game.difficulty.max_no_competitors) { /* Send a command to all clients to start up a new AI. * Works fine for Multiplayer and Singleplayer */ - return DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | INVALID_COMPANY << 16, 0); + return Command::Post(0, CCA_NEW_AI | INVALID_COMPANY << 16, 0, {}); } return false; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 7a6e68dea7..c2695b9105 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -37,6 +37,11 @@ #include "station_func.h" #include "zoom_func.h" #include "sortlist_type.h" +#include "company_cmd.h" +#include "economy_cmd.h" +#include "group_cmd.h" +#include "misc_cmd.h" +#include "object_cmd.h" #include "widgets/company_widget.h" @@ -435,11 +440,11 @@ struct CompanyFinancesWindow : Window { break; case WID_CF_INCREASE_LOAN: // increase loan - DoCommandP(CMD_INCREASE_LOAN, STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, 0, 0, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, 0, 0, _ctrl_pressed, {}); break; case WID_CF_REPAY_LOAN: // repay loan - DoCommandP(CMD_DECREASE_LOAN, STR_ERROR_CAN_T_REPAY_LOAN, 0, 0, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_REPAY_LOAN, 0, 0, _ctrl_pressed, {}); break; case WID_CF_INFRASTRUCTURE: // show infrastructure details @@ -995,12 +1000,12 @@ public: for (LiveryScheme scheme = LS_DEFAULT; scheme < LS_END; scheme++) { /* Changed colour for the selected scheme, or all visible schemes if CTRL is pressed. */ if (HasBit(this->sel, scheme) || (_ctrl_pressed && _livery_class[scheme] == this->livery_class && HasBit(_loaded_newgrf_features.used_liveries, scheme))) { - DoCommandP(CMD_SET_COMPANY_COLOUR, 0, scheme | (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256), index); + Command::Post(0, scheme | (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256), index, {}); } } } else { /* Setting group livery */ - DoCommandP(CMD_SET_GROUP_LIVERY, 0, this->sel, (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256) | (index << 16)); + Command::Post(0, this->sel, (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256) | (index << 16), {}); } } @@ -1581,7 +1586,7 @@ public: /* OK button */ case WID_SCMF_ACCEPT: - DoCommandP(CMD_SET_COMPANY_MANAGER_FACE, 0, 0, this->face); + Command::Post(0, 0, this->face, {}); FALLTHROUGH; /* Cancel button */ @@ -2576,11 +2581,11 @@ struct CompanyWindow : Window break; case WID_C_BUY_SHARE: - DoCommandP(CMD_BUY_SHARE_IN_COMPANY, STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, (TileIndex)0, this->window_number, 0); + Command::Post(STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, 0, this->window_number, 0, {}); break; case WID_C_SELL_SHARE: - DoCommandP(CMD_SELL_SHARE_IN_COMPANY, STR_ERROR_CAN_T_SELL_25_SHARE_IN, (TileIndex)0, this->window_number, 0); + Command::Post(STR_ERROR_CAN_T_SELL_25_SHARE_IN, 0, this->window_number, 0, {}); break; case WID_C_COMPANY_PASSWORD: @@ -2613,7 +2618,7 @@ struct CompanyWindow : Window void OnPlaceObject(Point pt, TileIndex tile) override { - if (DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0) && !_shift_pressed) { + if (Command::Post(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0, {}) && !_shift_pressed) { ResetObjectToPlace(); this->RaiseButtons(); } @@ -2635,16 +2640,16 @@ struct CompanyWindow : Window Money money = (Money)(strtoull(str, nullptr, 10) / _currency->rate); uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 - DoCommandP(CMD_GIVE_MONEY, STR_ERROR_CAN_T_GIVE_MONEY, 0, money_c, this->window_number); + Command::Post(STR_ERROR_CAN_T_GIVE_MONEY, 0, money_c, this->window_number, {}); break; } case WID_C_PRESIDENT_NAME: - DoCommandP(CMD_RENAME_PRESIDENT, STR_ERROR_CAN_T_CHANGE_PRESIDENT, 0, 0, 0, str); + Command::Post(STR_ERROR_CAN_T_CHANGE_PRESIDENT, 0, 0, 0, str); break; case WID_C_COMPANY_NAME: - DoCommandP(CMD_RENAME_COMPANY, STR_ERROR_CAN_T_CHANGE_COMPANY_NAME, 0, 0, 0, str); + Command::Post(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME, 0, 0, 0, str); break; case WID_C_COMPANY_JOIN: @@ -2771,7 +2776,7 @@ struct BuyCompanyWindow : Window { break; case WID_BC_YES: - DoCommandP(CMD_BUY_COMPANY, STR_ERROR_CAN_T_BUY_COMPANY, (TileIndex)0, this->window_number, 0); + Command::Post(STR_ERROR_CAN_T_BUY_COMPANY, 0, this->window_number, 0, {}); break; } } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 040b938fe7..42a94aa89f 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -42,6 +42,8 @@ #include "game/game.hpp" #include "table/strings.h" #include "walltime_func.h" +#include "company_cmd.h" +#include "misc_cmd.h" #include "safeguards.h" @@ -630,7 +632,7 @@ DEF_CONSOLE_CMD(ConPauseGame) } if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + Command::Post(0, PM_PAUSED_NORMAL, 1, {}); if (!_networking) IConsolePrint(CC_DEFAULT, "Game paused."); } else { IConsolePrint(CC_DEFAULT, "Game is already paused."); @@ -652,7 +654,7 @@ DEF_CONSOLE_CMD(ConUnpauseGame) } if ((_pause_mode & PM_PAUSED_NORMAL) != PM_UNPAUSED) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); + Command::Post(0, PM_PAUSED_NORMAL, 0, {}); if (!_networking) IConsolePrint(CC_DEFAULT, "Game unpaused."); } else if ((_pause_mode & PM_PAUSED_ERROR) != PM_UNPAUSED) { IConsolePrint(CC_DEFAULT, "Game is in error state and cannot be unpaused via console."); @@ -863,7 +865,7 @@ DEF_CONSOLE_CMD(ConResetCompany) } /* It is safe to remove this company */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | index << 16 | CRR_MANUAL << 24, 0); + Command::Post(0, CCA_DELETE | index << 16 | CRR_MANUAL << 24, 0, {}); IConsolePrint(CC_DEFAULT, "Company deleted."); return true; @@ -1220,7 +1222,7 @@ DEF_CONSOLE_CMD(ConStartAI) } /* Start a new AI company */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | INVALID_COMPANY << 16, 0); + Command::Post(0, CCA_NEW_AI | INVALID_COMPANY << 16, 0, {}); return true; } @@ -1256,8 +1258,8 @@ DEF_CONSOLE_CMD(ConReloadAI) } /* First kill the company of the AI, then start a new one. This should start the current AI again */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0); - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW_AI | company_id << 16, 0); + Command::Post(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, {}); + Command::Post(0, CCA_NEW_AI | company_id << 16, 0, {}); IConsolePrint(CC_DEFAULT, "AI reloaded."); return true; @@ -1294,7 +1296,7 @@ DEF_CONSOLE_CMD(ConStopAI) } /* Now kill the company of the AI. */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0); + Command::Post(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, {}); IConsolePrint(CC_DEFAULT, "AI stopped, company deleted."); return true; diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 0aba48e40c..76e03ef396 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -26,6 +26,9 @@ #include "vehiclelist.h" #include "order_backup.h" #include "zoom_func.h" +#include "depot_cmd.h" +#include "train_cmd.h" +#include "vehicle_cmd.h" #include "widgets/depot_widget.h" @@ -142,7 +145,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh if (wagon == v) return; - DoCommandP(CMD_MOVE_RAIL_VEHICLE, STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index); + Command::Post(STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index, {}); } static VehicleCellSize _base_block_sizes_depot[VEH_COMPANY_END]; ///< Cell size for vehicle images in the depot view. @@ -803,7 +806,7 @@ struct DepotWindow : Window { case WID_D_STOP_ALL: case WID_D_START_ALL: { VehicleListIdentifier vli(VL_DEPOT_LIST, this->type, this->owner); - DoCommandP(CMD_MASS_START_STOP, this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack()); + Command::Post(this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack(), {}); break; } @@ -826,7 +829,7 @@ struct DepotWindow : Window { break; case WID_D_AUTOREPLACE: - DoCommandP(CMD_DEPOT_MASS_AUTOREPLACE, this->window_number, this->type, 0); + Command::Post(this->window_number, this->type, 0, {}); break; } @@ -837,7 +840,7 @@ struct DepotWindow : Window { if (str == nullptr) return; /* Do depot renaming */ - DoCommandP(CMD_RENAME_DEPOT, STR_ERROR_CAN_T_RENAME_DEPOT, 0, this->GetDepotIndex(), 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_DEPOT, 0, this->GetDepotIndex(), 0, str); } bool OnRightClick(Point pt, int widget) override @@ -905,10 +908,10 @@ struct DepotWindow : Window { { if (_ctrl_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ - DoCommandP(CMD_CLONE_VEHICLE, STR_ERROR_CAN_T_BUY_TRAIN + v->type, this->window_number, v->index, 1); + Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, this->window_number, v->index, 1, {}); } else { - /* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to changs things on new vehicle) */ - if (DoCommandP(CMD_CLONE_VEHICLE, STR_ERROR_CAN_T_BUY_TRAIN + v->type, CcCloneVehicle, this->window_number, v->index, 0)) { + /* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to change things on new vehicle) */ + if (Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, CcCloneVehicle, this->window_number, v->index, 0, {})) { ResetObjectToPlace(); } } @@ -1002,7 +1005,7 @@ struct DepotWindow : Window { if (this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, &gdvp) == MODE_DRAG_VEHICLE && sel != INVALID_VEHICLE) { if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _ctrl_pressed) { - DoCommandP(CMD_REVERSE_TRAIN_DIRECTION, STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE, Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true); + Command::Post(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE, Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true, {}); } else if (gdvp.wagon == nullptr || gdvp.wagon->index != sel) { this->vehicle_over = INVALID_VEHICLE; TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head); @@ -1027,7 +1030,7 @@ struct DepotWindow : Window { this->SetDirty(); int sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0; - DoCommandP(CMD_SELL_VEHICLE, GetCmdSellVehMsg(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0); + Command::Post(GetCmdSellVehMsg(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0, {}); break; } @@ -1091,7 +1094,7 @@ static void DepotSellAllConfirmationCallback(Window *win, bool confirmed) DepotWindow *w = (DepotWindow*)win; TileIndex tile = w->window_number; byte vehtype = w->type; - DoCommandP(CMD_DEPOT_SELL_ALL_VEHICLES, tile, vehtype, 0); + Command::Post(tile, vehtype, 0, {}); } } diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 571bfdcec0..3cb101f7ad 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -28,6 +28,8 @@ #include "tunnelbridge_cmd.h" #include "dock_cmd.h" #include "station_cmd.h" +#include "water_cmd.h" +#include "waypoint_cmd.h" #include "widgets/dock_widget.h" @@ -194,7 +196,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_LOCK: // Build lock button - DoCommandP(CMD_BUILD_LOCK, STR_ERROR_CAN_T_BUILD_LOCKS, CcBuildDocks, tile, 0, 0); + Command::Post(STR_ERROR_CAN_T_BUILD_LOCKS, CcBuildDocks, tile, 0, 0, {}); break; case WID_DT_DEMOLISH: // Demolish aka dynamite button @@ -202,7 +204,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_DEPOT: // Build depot button - DoCommandP(CMD_BUILD_SHIP_DEPOT, STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction, 0); + Command::Post(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction, 0, {}); break; case WID_DT_STATION: { // Build station button @@ -220,7 +222,7 @@ struct BuildDocksToolbarWindow : Window { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - return DoCommandP(CMD_BUILD_DOCK, STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, p1, p2_final); + return Command::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, p1, p2_final, {}); } }; @@ -229,7 +231,7 @@ struct BuildDocksToolbarWindow : Window { } case WID_DT_BUOY: // Build buoy button - DoCommandP(CMD_BUILD_BUOY, STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile, 0, 0); + Command::Post(STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile, 0, 0, {}); break; case WID_DT_RIVER: // Build river button (in scenario editor) @@ -237,7 +239,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_BUILD_AQUEDUCT: // Build aqueduct button - DoCommandP(CMD_BUILD_BRIDGE, STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE, CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15); + Command::Post(STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE, CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15, {}); break; default: NOT_REACHED(); @@ -257,10 +259,10 @@ struct BuildDocksToolbarWindow : Window { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); break; case DDSP_CREATE_WATER: - DoCommandP(CMD_BUILD_CANAL, STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL); + Command::Post(STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, {}); break; case DDSP_CREATE_RIVER: - DoCommandP(CMD_BUILD_CANAL, STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0)); + Command::Post(STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0), {}); break; default: break; diff --git a/src/economy.cpp b/src/economy.cpp index e7daf8e3d1..c65d997b80 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -48,6 +48,7 @@ #include "goal_base.h" #include "story_base.h" #include "linkgraph/refresh.h" +#include "company_cmd.h" #include "economy_cmd.h" #include "vehicle_cmd.h" @@ -629,7 +630,7 @@ static void CompanyCheckBankrupt(Company *c) * player we are sure (the above check) that we are not the local * company and thus we won't be moved. */ if (!_networking || _network_server) { - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | (c->index << 16) | (CRR_BANKRUPT << 24), 0); + Command::Post(0, CCA_DELETE | (c->index << 16) | (CRR_BANKRUPT << 24), 0, {}); return; } break; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 6710967f43..c3b9553a7e 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -23,6 +23,7 @@ #include "roadveh.h" #include "ship.h" #include "aircraft.h" +#include "engine_cmd.h" #include "widgets/engine_widget.h" @@ -125,7 +126,7 @@ struct EnginePreviewWindow : Window { { switch (widget) { case WID_EP_YES: - DoCommandP(CMD_WANT_ENGINE_PREVIEW, 0, this->window_number, 0); + Command::Post(0, this->window_number, 0, {}); FALLTHROUGH; case WID_EP_NO: if (!_shift_pressed) this->Close(); diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 9d7ab70d8c..73315edf0f 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -27,6 +27,7 @@ #include "core/geometry_func.hpp" #include "gamelog.h" #include "stringfilter_type.h" +#include "misc_cmd.h" #include "widgets/fios_widget.h" @@ -358,7 +359,7 @@ public: /* pause is only used in single-player, non-editor mode, non-menu mode. It * will be unpaused in the WE_DESTROY event handler. */ if (_game_mode != GM_MENU && !_networking && _game_mode != GM_EDITOR) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 1); + Command::Post(0, PM_PAUSED_SAVELOAD, 1, {}); } SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0); @@ -402,7 +403,7 @@ public: { /* pause is only used in single-player, non-editor mode, non menu mode */ if (!_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); + Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); } this->Window::Close(); } diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index d6180b0df2..ef63197d54 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -23,6 +23,7 @@ #include "story_base.h" #include "command_func.h" #include "string_func.h" +#include "goal_cmd.h" #include "widgets/goal_widget.h" @@ -382,17 +383,17 @@ struct GoalQuestionWindow : public Window { { switch (widget) { case WID_GQ_BUTTON_1: - DoCommandP(CMD_GOAL_QUESTION_ANSWER, 0, this->window_number, this->button[0]); + Command::Post(0, this->window_number, this->button[0], {}); this->Close(); break; case WID_GQ_BUTTON_2: - DoCommandP(CMD_GOAL_QUESTION_ANSWER, 0, this->window_number, this->button[1]); + Command::Post(0, this->window_number, this->button[1], {}); this->Close(); break; case WID_GQ_BUTTON_3: - DoCommandP(CMD_GOAL_QUESTION_ANSWER, 0, this->window_number, this->button[2]); + Command::Post(0, this->window_number, this->button[2], {}); this->Close(); break; } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 8beab1884b..b2deba3091 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -26,6 +26,7 @@ #include "company_gui.h" #include "gui.h" #include "group_cmd.h" +#include "vehicle_cmd.h" #include "widgets/group_widget.h" @@ -641,7 +642,7 @@ public: if (confirmed) { VehicleGroupWindow *w = (VehicleGroupWindow*)win; w->vli.index = ALL_GROUP; - DoCommandP(CMD_DELETE_GROUP, STR_ERROR_GROUP_CAN_T_DELETE, (TileIndex)0, w->group_confirm, 0); + Command::Post(STR_ERROR_GROUP_CAN_T_DELETE, 0, w->group_confirm, 0, {}); } } @@ -772,7 +773,7 @@ public: } case WID_GL_CREATE_GROUP: { // Create a new group - DoCommandP(CMD_CREATE_GROUP, STR_ERROR_GROUP_CAN_T_CREATE, CcCreateGroup, 0, this->vli.vtype, this->vli.index); + Command::Post(STR_ERROR_GROUP_CAN_T_CREATE, CcCreateGroup, 0, this->vli.vtype, this->vli.index, {}); break; } @@ -801,14 +802,14 @@ public: case WID_GL_START_ALL: case WID_GL_STOP_ALL: { // Start/stop all vehicles of the list - DoCommandP(CMD_MASS_START_STOP, 0, (1 << 1) | (widget == WID_GL_START_ALL ? (1 << 0) : 0), this->vli.Pack()); + Command::Post(0, (1 << 1) | (widget == WID_GL_START_ALL ? (1 << 0) : 0), this->vli.Pack(), {}); break; } case WID_GL_REPLACE_PROTECTION: { const Group *g = Group::GetIfValid(this->vli.index); if (g != nullptr) { - DoCommandP(CMD_SET_GROUP_FLAG, 0, this->vli.index | (GroupFlags::GF_REPLACE_PROTECTION << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION) ? 0 : 1) | (_ctrl_pressed << 1)); + Command::Post(0, this->vli.index | (GroupFlags::GF_REPLACE_PROTECTION << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION) ? 0 : 1) | (_ctrl_pressed << 1), {}); } break; } @@ -823,7 +824,7 @@ public: case WID_GL_ALL_VEHICLES: // All vehicles case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles if (g->parent != INVALID_GROUP) { - DoCommandP(CMD_ALTER_GROUP, STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), INVALID_GROUP); + Command::Post(STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), INVALID_GROUP, {}); } this->group_sel = INVALID_GROUP; @@ -836,7 +837,7 @@ public: GroupID new_g = id_g >= this->groups.size() ? INVALID_GROUP : this->groups[id_g]->index; if (this->group_sel != new_g && g->parent != new_g) { - DoCommandP(CMD_ALTER_GROUP, STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), new_g); + Command::Post(STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), new_g, {}); } this->group_sel = INVALID_GROUP; @@ -851,7 +852,7 @@ public: { switch (widget) { case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles - DoCommandP(CMD_ADD_VEHICLE_GROUP, STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, 0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, 0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), {}); this->vehicle_sel = INVALID_VEHICLE; this->group_over = INVALID_GROUP; @@ -868,7 +869,7 @@ public: uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; - DoCommandP(CMD_ADD_VEHICLE_GROUP, STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0)); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), {}); break; } @@ -923,7 +924,7 @@ public: void OnQueryTextFinished(char *str) override { - if (str != nullptr) DoCommandP(CMD_ALTER_GROUP, STR_ERROR_GROUP_CAN_T_RENAME, 0, this->group_rename, 0, str); + if (str != nullptr) Command::Post(STR_ERROR_GROUP_CAN_T_RENAME, 0, this->group_rename, 0, str); this->group_rename = INVALID_GROUP; } @@ -953,19 +954,19 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: { // Send to Depots - DoCommandP(CMD_SEND_VEHICLE_TO_DEPOT, GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack()); + Command::Post(GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack(), {}); break; } case ADI_ADD_SHARED: // Add shared Vehicles assert(Group::IsValidID(this->vli.index)); - DoCommandP(CMD_ADD_SHARED_VEHICLE_GROUP, STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE, 0, this->vli.index, this->vli.vtype); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE, 0, this->vli.index, this->vli.vtype, {}); break; case ADI_REMOVE_ALL: // Remove all Vehicles from the selected group assert(Group::IsValidID(this->vli.index)); - DoCommandP(CMD_REMOVE_ALL_VEHICLES_GROUP, STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, (TileIndex)0, this->vli.index, 0); + Command::Post(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, 0, this->vli.index, 0, {}); break; default: NOT_REACHED(); } diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 0dfaebc3b7..bf09b1b949 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -21,6 +21,7 @@ #include "strings_func.h" #include "hotkeys.h" #include "zoom_func.h" +#include "misc_cmd.h" #include "widgets/highscore_widget.h" @@ -96,7 +97,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { EndGameWindow(WindowDesc *desc) : EndGameHighScoreBaseWindow(desc) { /* Pause in single-player to have a look at the highscore at your own leisure */ - if (!_networking) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (!_networking) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); this->background_img = SPR_TYCOON_IMG1_BEGIN; @@ -124,7 +125,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { void Close() override { - if (!_networking) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); // unpause + if (!_networking) Command::Post(0, PM_PAUSED_NORMAL, 0, {}); // unpause ShowHighscoreTable(this->window_number, this->rank); this->EndGameHighScoreBaseWindow::Close(); } @@ -159,7 +160,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { /* pause game to show the chart */ this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL; - if (!_networking && !this->game_paused_by_player) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (!_networking && !this->game_paused_by_player) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); /* Close all always on-top windows to get a clean screen */ if (_game_mode != GM_MENU) HideVitalWindows(); @@ -174,7 +175,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { if (_game_mode != GM_MENU) ShowVitalWindows(); - if (!_networking && !this->game_paused_by_player) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); // unpause + if (!_networking && !this->game_paused_by_player) Command::Post(0, PM_PAUSED_NORMAL, 0, {}); // unpause this->EndGameHighScoreBaseWindow::Close(); } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 5aea6f59a4..29da3c76ef 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -39,6 +39,7 @@ #include "widgets/industry_widget.h" #include "clear_map.h" #include "zoom_func.h" +#include "industry_cmd.h" #include "table/strings.h" @@ -679,7 +680,7 @@ public: case WID_DPI_FUND_WIDGET: { if (this->selected_type != INVALID_INDUSTRYTYPE) { if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) { - DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom()); + Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom(), {}); this->HandleButtonClick(WID_DPI_FUND_WIDGET); } else { HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT); @@ -716,13 +717,13 @@ public: Backup old_generating_world(_generating_world, true, FILE_LINE); _ignore_restrictions = true; - DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed); + Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed, {}); cur_company.Restore(); old_generating_world.Restore(); _ignore_restrictions = false; } else { - success = DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed); + success = Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed, {}); } /* If an industry has been built, just reset the cursor and the system */ diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp index c4fc2d5f9c..0a6b891502 100644 --- a/src/linkgraph/linkgraphschedule.cpp +++ b/src/linkgraph/linkgraphschedule.cpp @@ -16,6 +16,7 @@ #include "../framerate_type.h" #include "../command_func.h" #include "../network/network.h" +#include "../misc_cmd.h" #include "../safeguards.h" @@ -173,7 +174,7 @@ void StateGameLoop_LinkGraphPauseControl() if (_pause_mode & PM_PAUSED_LINK_GRAPH) { /* We are paused waiting on a job, check the job every tick. */ if (!LinkGraphSchedule::instance.IsJoinWithUnfinishedJobDue()) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_LINK_GRAPH, 0); + Command::Post(0, PM_PAUSED_LINK_GRAPH, 0, {}); } } else if (_pause_mode == PM_UNPAUSED && _date_fract == LinkGraphSchedule::SPAWN_JOIN_TICK - 2 && @@ -181,7 +182,7 @@ void StateGameLoop_LinkGraphPauseControl() LinkGraphSchedule::instance.IsJoinWithUnfinishedJobDue()) { /* Perform check two _date_fract ticks before we would join, to make * sure it also works in multiplayer. */ - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_LINK_GRAPH, 1); + Command::Post(0, PM_PAUSED_LINK_GRAPH, 1, {}); } } diff --git a/src/main_gui.cpp b/src/main_gui.cpp index a4bec45d5c..847d328454 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -33,6 +33,7 @@ #include "guitimer_func.h" #include "error.h" #include "news_gui.h" +#include "misc_cmd.h" #include "saveload/saveload.h" @@ -326,7 +327,7 @@ struct MainWindow : Window case GHK_MONEY: // Gimme money /* You can only cheat for money in singleplayer mode. */ - if (!_networking) DoCommandP(CMD_MONEY_CHEAT, 0, 10000000, 0); + if (!_networking) Command::Post(0, 10000000, 0, {}); break; case GHK_UPDATE_COORDS: // Update the coordinates of all station signs diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index 243c5347aa..84c61e3f18 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -135,7 +135,7 @@ CommandCost CmdDecreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint static void AskUnsafeUnpauseCallback(Window *w, bool confirmed) { if (confirmed) { - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_ERROR, 0); + Command::Post(0, PM_PAUSED_ERROR, 0, {}); } } diff --git a/src/network/network.cpp b/src/network/network.cpp index 8194f34d07..3bd287f85a 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -395,7 +395,7 @@ static void CheckPauseHelper(bool pause, PauseMode pm) { if (pause == ((_pause_mode & pm) != PM_UNPAUSED)) return; - DoCommandP(CMD_PAUSE, 0, pm, pause ? 1 : 0); + Command::Post(0, pm, pause ? 1 : 0, {}); } /** diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 472d5e60e2..983f4b5659 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -451,5 +451,5 @@ template void UnpackNetworkCommand(const CommandPacket *cp) { auto args = EndianBufferReader::ToValue::Args>(cp->data); - std::apply(&InjectNetworkCommand, std::tuple_cat(std::make_tuple(Tcmd, cp->err_msg, cp->callback, cp->my_cmd), args)); + Command::PostFromNet(cp->err_msg, cp->callback, cp->my_cmd, cp->tile, args); } diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 82e01e81e2..a2b34593eb 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -36,6 +36,7 @@ #include "../zoom_func.h" #include "../sprite.h" #include "../settings_internal.h" +#include "../company_cmd.h" #include "../widgets/network_widget.h" @@ -1395,7 +1396,7 @@ static void AdminCompanyResetCallback(Window *w, bool confirmed) { if (confirmed) { if (NetworkCompanyHasClients(_admin_company_id)) return; - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | _admin_company_id << 16 | CRR_MANUAL << 24, 0); + Command::Post(0, CCA_DELETE | _admin_company_id << 16 | CRR_MANUAL << 24, 0, {}); } } @@ -1535,7 +1536,7 @@ private: static void OnClickCompanyNew(NetworkClientListWindow *w, Point pt, CompanyID company_id) { if (_network_server) { - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_NEW, _network_own_client_id); + Command::Post(0, CCA_NEW, _network_own_client_id, {}); } else { NetworkSendCommand(CMD_COMPANY_CTRL, STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 967ad40a89..65f3188de8 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -29,6 +29,7 @@ #include "../order_backup.h" #include "../core/pool_func.hpp" #include "../core/random_func.hpp" +#include "../company_cmd.h" #include "../rev.h" #include #include @@ -1555,7 +1556,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_unprotected-months, and is there no protection? */ if (_settings_client.network.autoclean_unprotected != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_unprotected && _network_company_states[c->index].password.empty()) { /* Shut the company down */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0); + Command::Post(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, {}); IConsolePrint(CC_INFO, "Auto-cleaned company #{} with no password.", c->index + 1); } /* Is the company empty for autoclean_protected-months, and there is a protection? */ @@ -1569,7 +1570,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_novehicles-months, and has no vehicles? */ if (_settings_client.network.autoclean_novehicles != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_novehicles && vehicles_in_company[c->index] == 0) { /* Shut the company down */ - DoCommandP(CMD_COMPANY_CTRL, 0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0); + Command::Post(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, {}); IConsolePrint(CC_INFO, "Auto-cleaned company #{} with no vehicles.", c->index + 1); } } else { diff --git a/src/object_gui.cpp b/src/object_gui.cpp index a3ea3f8b17..562af15ae8 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -25,6 +25,7 @@ #include "window_func.h" #include "zoom_func.h" #include "terraform_cmd.h" +#include "object_cmd.h" #include "widgets/object_widget.h" @@ -542,8 +543,8 @@ public: void OnPlaceObject(Point pt, TileIndex tile) override { ObjectClass *objclass = ObjectClass::Get(_selected_object_class); - DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_BUILD_OBJECT, CcTerraform, - tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view); + Command::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcTerraform, + tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view, {}); } void OnPlaceObjectAbort() override diff --git a/src/openttd.cpp b/src/openttd.cpp index abd5d99df6..c5c849e71c 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -66,6 +66,7 @@ #include "framerate_type.h" #include "industry.h" #include "network/network_gui.h" +#include "misc_cmd.h" #include "linkgraph/linkgraphschedule.h" @@ -851,7 +852,7 @@ static void MakeNewGameDone() /* In a dedicated server, the server does not play */ if (!VideoDriver::GetInstance()->HasGUI()) { OnStartGame(true); - if (_settings_client.gui.pause_on_newgame) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (_settings_client.gui.pause_on_newgame) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); return; } @@ -880,7 +881,7 @@ static void MakeNewGameDone() NetworkChangeCompanyPassword(_local_company, _settings_client.network.default_company_pass); } - if (_settings_client.gui.pause_on_newgame) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (_settings_client.gui.pause_on_newgame) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); CheckEngines(); CheckIndustries(); @@ -1045,7 +1046,7 @@ void SwitchToMode(SwitchMode new_mode) } OnStartGame(_network_dedicated); /* Decrease pause counter (was increased from opening load dialog) */ - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); + Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); } break; } @@ -1067,7 +1068,7 @@ void SwitchToMode(SwitchMode new_mode) SetLocalCompany(OWNER_NONE); _settings_newgame.game_creation.starting_year = _cur_year; /* Cancel the saveload pausing */ - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_SAVELOAD, 0); + Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); } else { SetDParamStr(0, GetSaveLoadErrorString()); ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR); diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 80fc9fa6d1..987b3154f2 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -171,7 +171,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, /* If it's not a backup of us, ignore it. */ if (ob->user != user) continue; - DoCommandP(CMD_CLEAR_ORDER_BACKUP, 0, 0, user); + Command::Post(0, 0, user, {}); return; } } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index b934b9d161..50413c7352 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -29,6 +29,7 @@ #include "aircraft.h" #include "engine_func.h" #include "vehicle_func.h" +#include "order_cmd.h" #include "widgets/order_widget.h" @@ -591,7 +592,7 @@ private: } if (order->GetLoadType() == load_type) return; // If we still match, do nothing - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4)); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4), {}); } /** @@ -606,7 +607,7 @@ private: if (order == nullptr) return; i = (order->GetDepotOrderType() & ODTFB_SERVICE) ? DA_ALWAYS_GO : DA_SERVICE; } - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4)); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4), {}); } /** @@ -621,7 +622,7 @@ private: _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); order.SetDepotActionType(ODATFB_NEAREST_DEPOT); - DoCommandP(CMD_INSERT_ORDER, STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); + Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack(), {}); } /** @@ -641,11 +642,11 @@ private: } if (order->GetUnloadType() == unload_type) return; // If we still match, do nothing - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4)); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4), {}); /* Transfer and unload orders with leave empty as default */ if (unload_type == OUFB_TRANSFER || unload_type == OUFB_UNLOAD) { - DoCommandP(CMD_MODIFY_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (OLFB_NO_LOAD << 4)); + Command::Post(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (OLFB_NO_LOAD << 4), {}); this->SetWidgetDirty(WID_O_FULL_LOAD); } } @@ -669,7 +670,7 @@ private: } this->SetWidgetDirty(WID_O_NON_STOP); - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4, {}); } /** @@ -682,8 +683,8 @@ private: if (_ctrl_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return; if (this->vehicle->GetNumOrders() <= 1) return; - DoCommandP(CMD_SKIP_TO_ORDER, _ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER, - this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())); + Command::Post(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER, + this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders()), {}); } /** @@ -694,7 +695,7 @@ private: /* When networking, move one order lower */ int selected = this->selected_order + (int)_networking; - if (DoCommandP(CMD_DELETE_ORDER, STR_ERROR_CAN_T_DELETE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel())) { + if (Command::Post(STR_ERROR_CAN_T_DELETE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), {})) { this->selected_order = selected >= this->vehicle->GetNumOrders() ? -1 : selected; this->UpdateButtonState(); } @@ -719,7 +720,7 @@ private: /* Get another vehicle that share orders with this vehicle. */ Vehicle *other_shared = (this->vehicle->FirstShared() == this->vehicle) ? this->vehicle->NextShared() : this->vehicle->PreviousShared(); /* Copy the order list of the other vehicle. */ - if (DoCommandP(CMD_CLONE_ORDER, STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST, this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index)) { + if (Command::Post(STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST, this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index, {})) { this->UpdateButtonState(); } } @@ -734,10 +735,10 @@ private: { if (_ctrl_pressed) { /* Cancel refitting */ - DoCommandP(CMD_ORDER_REFIT, this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT); + Command::Post(this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT, {}); } else { if (i == 1) { // Auto-refit to available cargo type. - DoCommandP(CMD_ORDER_REFIT, this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | CT_AUTO_REFIT); + Command::Post(this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | CT_AUTO_REFIT, {}); } else { ShowVehicleRefitWindow(this->vehicle, this->OrderGetSel(), this, auto_refit); } @@ -1159,7 +1160,7 @@ public: order.index = 0; order.MakeConditional(order_id); - DoCommandP(CMD_INSERT_ORDER, STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack()); + Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack(), {}); } ResetObjectToPlace(); break; @@ -1182,9 +1183,9 @@ public: this->selected_order = -1; } else if (sel == this->selected_order) { if (this->vehicle->type == VEH_TRAIN && sel < this->vehicle->GetNumOrders()) { - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel << 20), - MOF_STOP_LOCATION | ((this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END) << 4); + MOF_STOP_LOCATION | ((this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END) << 4, {}); } } else { /* Select clicked order */ @@ -1331,7 +1332,7 @@ public: default: break; } - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4, {}); } } @@ -1369,11 +1370,11 @@ public: break; case WID_O_COND_VARIABLE: - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4, {}); break; case WID_O_COND_COMPARATOR: - DoCommandP(CMD_MODIFY_ORDER, STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4, {}); break; } } @@ -1386,7 +1387,7 @@ public: VehicleOrderID to_order = this->GetOrderFromPt(pt.y); if (!(from_order == to_order || from_order == INVALID_VEH_ORDER_ID || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_VEH_ORDER_ID || to_order > this->vehicle->GetNumOrders()) && - DoCommandP(CMD_MOVE_ORDER, STR_ERROR_CAN_T_MOVE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16))) { + Command::Post(STR_ERROR_CAN_T_MOVE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16), {})) { this->selected_order = -1; this->UpdateButtonState(); } @@ -1438,7 +1439,7 @@ public: const Order cmd = GetOrderCmdFromTile(this->vehicle, tile); if (cmd.IsType(OT_NOTHING)) return; - if (DoCommandP(CMD_INSERT_ORDER, STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack())) { + if (Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack(), {})) { /* With quick goto the Go To button stays active */ if (!_settings_client.gui.quick_goto) ResetObjectToPlace(); } @@ -1455,8 +1456,8 @@ public: bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; - if (DoCommandP(CMD_CLONE_ORDER, share_order ? STR_ERROR_CAN_T_SHARE_ORDER_LIST : STR_ERROR_CAN_T_COPY_ORDER_LIST, - this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index)) { + if (Command::Post(share_order ? STR_ERROR_CAN_T_SHARE_ORDER_LIST : STR_ERROR_CAN_T_COPY_ORDER_LIST, + this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index, {})) { this->selected_order = -1; ResetObjectToPlace(); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index f88352f9e6..a57e2f8e53 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -39,6 +39,7 @@ #include "station_cmd.h" #include "tunnelbridge_cmd.h" #include "waypoint_cmd.h" +#include "rail_cmd.h" #include "station_map.h" #include "tunnelbridge_map.h" @@ -95,10 +96,13 @@ void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, Commands cmd, Tile static void GenericPlaceRail(TileIndex tile, int cmd) { - DoCommandP(_remove_button_clicked ? CMD_REMOVE_SINGLE_RAIL : CMD_BUILD_SINGLE_RAIL, - _remove_button_clicked ? STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK : STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, - CcPlaySound_CONSTRUCTION_RAIL, - tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3)); + if (_remove_button_clicked) { + Command::Post(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, + tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3), {}); + } else { + Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, + tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3), {}); + } } /** @@ -114,7 +118,7 @@ static void PlaceExtraDepotRail(TileIndex tile, DiagDirection dir, Track track) if (GetRailTileType(tile) == RAIL_TILE_SIGNALS && !_settings_client.gui.auto_remove_signals) return; if ((GetTrackBits(tile) & DiagdirReachesTracks(dir)) == 0) return; - DoCommandP(CMD_BUILD_SINGLE_RAIL, tile, _cur_railtype, track | (_settings_client.gui.auto_remove_signals << 3)); + Command::Post(tile, _cur_railtype, track | (_settings_client.gui.auto_remove_signals << 3), {}); } /** Additional pieces of track to add at the entrance of a depot. */ @@ -168,7 +172,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } else { /* Tile where we can't build rail waypoints. This is always going to fail, * but provides the user with a proper error message. */ - DoCommandP(CMD_BUILD_RAIL_WAYPOINT, STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16); + Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16, {}); } } @@ -208,7 +212,7 @@ static void PlaceRail_Station(TileIndex tile) uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - return DoCommandP(CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, tile, p1, p2_final); + return Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, tile, p1, p2_final, {}); } }; @@ -236,7 +240,7 @@ static void GenericPlaceSignals(TileIndex tile) Track track = FindFirstTrack(trackbits); if (_remove_button_clicked) { - DoCommandP(CMD_REMOVE_SIGNALS, STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, tile, track, 0); + Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, tile, track, 0, {}); } else { const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); @@ -267,8 +271,8 @@ static void GenericPlaceSignals(TileIndex tile) SB(p1, 9, 6, cycle_types); } - DoCommandP(CMD_BUILD_SIGNALS, (w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, - CcPlaySound_CONSTRUCTION_RAIL, tile, p1, 0); + Command::Post((w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, + CcPlaySound_CONSTRUCTION_RAIL, tile, p1, 0, {}); } } @@ -370,10 +374,13 @@ static void BuildRailClick_Remove(Window *w) static void DoRailroadTrack(int mode) { uint32 p2 = _cur_railtype | (mode << 6) | (_settings_client.gui.auto_remove_signals << 11); - DoCommandP(_remove_button_clicked ? CMD_REMOVE_RAILROAD_TRACK : CMD_BUILD_RAILROAD_TRACK, - _remove_button_clicked ? STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK : STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, - CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2); + if (_remove_button_clicked) { + Command::Post(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + } else { + Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + } } static void HandleAutodirPlacement() @@ -424,10 +431,13 @@ static void HandleAutoSignalPlacement() /* _settings_client.gui.drag_signals_density is given as a parameter such that each user * in a network game can specify their own signal density */ - DoCommandP(_remove_button_clicked ? CMD_REMOVE_SIGNAL_TRACK : CMD_BUILD_SIGNAL_TRACK, - _remove_button_clicked ? STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, - CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2); + if (_remove_button_clicked) { + Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + } else { + Command::Post(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + } } @@ -653,8 +663,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_DEPOT: - DoCommandP(CMD_BUILD_TRAIN_DEPOT, STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT, - CcRailDepot, tile, _cur_railtype, _build_depot_direction); + Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT, CcRailDepot, tile, _cur_railtype, _build_depot_direction, {}); break; case WID_RAT_BUILD_WAYPOINT: @@ -674,7 +683,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_TUNNEL: - DoCommandP(CMD_BUILD_TUNNEL, STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRailTunnel, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0); + Command::Post(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRailTunnel, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, {}); break; case WID_RAT_CONVERT_RAIL: @@ -716,7 +725,7 @@ struct BuildRailToolbarWindow : Window { break; case DDSP_CONVERT_RAIL: - DoCommandP(CMD_CONVERT_RAIL, STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0)); + Command::Post(STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0), {}); break; case DDSP_REMOVE_STATION: @@ -724,14 +733,14 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - DoCommandP(CMD_REMOVE_FROM_RAIL_STATION, STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); + Command::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1, {}); } else { HandleStationPlacement(start_tile, end_tile); } } else { /* Waypoint */ if (_remove_button_clicked) { - DoCommandP(CMD_REMOVE_FROM_RAIL_WAYPOINT, STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1); + Command::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1, {}); } else { TileArea ta(start_tile, end_tile); uint32 p1 = _cur_railtype | (select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y) << 6 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24; @@ -744,7 +753,7 @@ struct BuildRailToolbarWindow : Window { uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - return DoCommandP(CMD_BUILD_RAIL_WAYPOINT, STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, ta.tile, p1, p2_final); + return Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, ta.tile, p1, p2_final, {}); } }; @@ -913,7 +922,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - return DoCommandP(CMD_BUILD_RAIL_STATION, STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, ta.tile, p1, p2_final); + return Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, ta.tile, p1, p2_final, {}); } }; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 145934ffc5..948095f773 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -32,6 +32,7 @@ #include "core/geometry_func.hpp" #include "date_func.h" #include "station_cmd.h" +#include "road_cmd.h" #include "tunnelbridge_cmd.h" #include "widgets/road_widget.h" @@ -127,7 +128,7 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) /* if there is a roadpiece just outside of the station entrance, build a connecting route */ if (IsNormalRoadTile(tile)) { if (GetRoadBits(tile, GetRoadTramType(_cur_roadtype)) != ROAD_NONE) { - DoCommandP(CMD_BUILD_ROAD, tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0); + Command::Post(tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0, {}); } } } @@ -205,7 +206,7 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, S uint32 p2_final = p2; if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - return DoCommandP(CMD_BUILD_ROAD_STOP, err_msg, CcRoadStop, ta.tile, p1, p2_final); + return Command::Post(err_msg, CcRoadStop, ta.tile, p1, p2_final, {}); } }; @@ -566,8 +567,8 @@ struct BuildRoadToolbarWindow : Window { break; case WID_ROT_DEPOT: - DoCommandP(CMD_BUILD_ROAD_DEPOT, this->rti->strings.err_depot, CcRoadDepot, - tile, _cur_roadtype << 2 | _road_depot_orientation, 0); + Command::Post(this->rti->strings.err_depot, CcRoadDepot, + tile, _cur_roadtype << 2 | _road_depot_orientation, 0, {}); break; case WID_ROT_BUS_STATION: @@ -583,8 +584,8 @@ struct BuildRoadToolbarWindow : Window { break; case WID_ROT_BUILD_TUNNEL: - DoCommandP(CMD_BUILD_TUNNEL, STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRoadTunnel, - tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0); + Command::Post(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRoadTunnel, + tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0, {}); break; case WID_ROT_CONVERT_ROAD: @@ -685,9 +686,13 @@ struct BuildRoadToolbarWindow : Window { * flags */ _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3)); - DoCommandP(_remove_button_clicked ? CMD_REMOVE_LONG_ROAD : CMD_BUILD_LONG_ROAD, - _remove_button_clicked ? this->rti->strings.err_remove_road : this->rti->strings.err_build_road, CcPlaySound_CONSTRUCTION_OTHER, - start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10)); + if (_remove_button_clicked) { + Command::Post(this->rti->strings.err_remove_road, CcPlaySound_CONSTRUCTION_OTHER, + start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10), {}); + } else { + Command::Post(this->rti->strings.err_build_road, CcPlaySound_CONSTRUCTION_OTHER, + start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10), {}); + } break; case DDSP_BUILD_BUSSTOP: @@ -695,7 +700,7 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_BUS_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - DoCommandP(CMD_REMOVE_ROAD_STOP, this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS); + Command::Post(this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, {}); } else { PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, this->rti->strings.err_build_station[ROADSTOP_BUS]); } @@ -707,7 +712,7 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_TRUCK_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - DoCommandP(CMD_REMOVE_ROAD_STOP, this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK); + Command::Post(this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, {}); } else { PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); } @@ -715,7 +720,7 @@ struct BuildRoadToolbarWindow : Window { break; case DDSP_CONVERT_ROAD: - DoCommandP(CMD_CONVERT_ROAD, rti->strings.err_convert_road, CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype); + Command::Post(rti->strings.err_convert_road, CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype, {}); break; } } diff --git a/src/settings.cpp b/src/settings.cpp index 1bf6513044..63c7478a04 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1550,7 +1550,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame) const IntSettingDesc *setting = sd->AsIntSetting(); if ((setting->flags & SF_PER_COMPANY) != 0) { if (Company::IsValidID(_local_company) && _game_mode != GM_MENU) { - return DoCommandP(CMD_CHANGE_COMPANY_SETTING, 0, 0, value, setting->GetName()); + return Command::Post(0, 0, value, setting->GetName()); } setting->ChangeValue(&_settings_client.company, value); @@ -1576,7 +1576,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame) /* send non-company-based settings over the network */ if (!_networking || (_networking && _network_server)) { - return DoCommandP(CMD_CHANGE_SETTING, 0, 0, value, setting->GetName()); + return Command::Post(0, 0, value, setting->GetName()); } return false; } diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index cf742df835..4fdfc0ab5f 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -132,5 +132,5 @@ void CcPlaceSign(const CommandCost &result, Commands cmd, TileIndex tile, uint32 */ void PlaceProc_Sign(TileIndex tile) { - DoCommandP(CMD_PLACE_SIGN, STR_ERROR_CAN_T_PLACE_SIGN_HERE, CcPlaceSign, tile, 0, 0); + Command::Post(STR_ERROR_CAN_T_PLACE_SIGN_HERE, CcPlaceSign, tile, 0, 0, {}); } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 0bb9fa2daf..b10e6d38c5 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -26,6 +26,7 @@ #include "hotkeys.h" #include "transparency.h" #include "gui.h" +#include "signs_cmd.h" #include "widgets/sign_widget.h" @@ -413,7 +414,7 @@ Window *ShowSignList() static bool RenameSign(SignID index, const char *text) { bool remove = StrEmpty(text); - DoCommandP(CMD_RENAME_SIGN, StrEmpty(text) ? STR_ERROR_CAN_T_DELETE_SIGN : STR_ERROR_CAN_T_CHANGE_SIGN_NAME, 0, index, 0, text); + Command::Post(StrEmpty(text) ? STR_ERROR_CAN_T_DELETE_SIGN : STR_ERROR_CAN_T_CHANGE_SIGN_NAME, 0, index, 0, text); return remove; } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 2e04e7ac44..1177e558c1 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -31,6 +31,7 @@ #include "town.h" #include "linkgraph/linkgraph.h" #include "zoom_func.h" +#include "station_cmd.h" #include "widgets/station_widget.h" @@ -1947,7 +1948,7 @@ struct StationViewWindow : public Window { break; case WID_SV_CLOSE_AIRPORT: - DoCommandP(CMD_OPEN_CLOSE_AIRPORT, 0, this->window_number, 0); + Command::Post(0, this->window_number, 0, {}); break; case WID_SV_TRAINS: // Show list of scheduled trains to this station @@ -2084,7 +2085,7 @@ struct StationViewWindow : public Window { { if (str == nullptr) return; - DoCommandP(CMD_RENAME_STATION, STR_ERROR_CAN_T_RENAME_STATION, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_STATION, 0, this->window_number, 0, str); } void OnResize() override diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 5330b8a304..21dba8fd1a 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -25,6 +25,7 @@ #include "company_base.h" #include "tilehighlight_func.h" #include "vehicle_base.h" +#include "story_cmd.h" #include "widgets/story_widget.h" @@ -566,7 +567,7 @@ protected: this->SetTimeout(); this->SetWidgetDirty(WID_SB_PAGE_PANEL); - DoCommandP(CMD_STORY_PAGE_BUTTON, 0, pe.index, 0); + Command::Post(0, pe.index, 0, {}); break; case SPET_BUTTON_TILE: @@ -921,7 +922,7 @@ public: return; } - DoCommandP(CMD_STORY_PAGE_BUTTON, tile, pe->index, 0); + Command::Post(tile, pe->index, 0, {}); ResetObjectToPlace(); } @@ -940,7 +941,7 @@ public: VehicleType wanted_vehtype = data.GetVehicleType(); if (wanted_vehtype != VEH_INVALID && wanted_vehtype != v->type) return false; - DoCommandP(CMD_STORY_PAGE_BUTTON, 0, pe->index, v->index); + Command::Post(0, pe->index, v->index, {}); ResetObjectToPlace(); return true; } diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 71d897c3d9..c65adad7d1 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -35,6 +35,8 @@ #include "zoom_func.h" #include "rail_cmd.h" #include "landscape_cmd.h" +#include "terraform_cmd.h" +#include "object_cmd.h" #include "widgets/terraform_widget.h" @@ -63,7 +65,7 @@ static void GenerateDesertArea(TileIndex end, TileIndex start) TileArea ta(start, end); for (TileIndex tile : ta) { SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT); - DoCommandP(CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command::Post(tile, 0, 0, {}); MarkTileDirtyByTile(tile); } old_generating_world.Restore(); @@ -118,16 +120,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - DoCommandP(CMD_CLEAR_AREA, STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0); + Command::Post(STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0, {}); break; case DDSP_RAISE_AND_LEVEL_AREA: - DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0)); + Command::Post(STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0), {}); break; case DDSP_LOWER_AND_LEVEL_AREA: - DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0)); + Command::Post(STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0), {}); break; case DDSP_LEVEL_AREA: - DoCommandP(CMD_LEVEL_LAND, STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0)); + Command::Post(STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0), {}); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -241,7 +243,7 @@ struct TerraformToolbarWindow : Window { break; case WID_TT_BUY_LAND: // Buy land button - DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0); + Command::Post(STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0, {}); break; case WID_TT_PLACE_SIGN: // Place sign button @@ -398,7 +400,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) StringID msg = mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE; - DoCommandP(CMD_TERRAFORM_LAND, msg, CcTerraform, tile, SLOPE_N, (uint32)mode); + Command::Post(msg, CcTerraform, tile, SLOPE_N, (uint32)mode, {}); } else { assert(_terraform_size != 0); TileArea ta(tile, _terraform_size, _terraform_size); @@ -425,7 +427,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) for (TileIndex tile2 : ta) { if (TileHeight(tile2) == h) { - DoCommandP(CMD_TERRAFORM_LAND, tile2, SLOPE_N, (uint32)mode); + Command::Post(tile2, SLOPE_N, (uint32)mode, {}); } } } diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index a205a505e8..12c3914875 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -22,6 +22,7 @@ #include "date_gui.h" #include "vehicle_gui.h" #include "settings_type.h" +#include "timetable_cmd.h" #include "widgets/timetable_widget.h" @@ -142,7 +143,7 @@ static void FillTimetableArrivalDepartureTable(const Vehicle *v, VehicleOrderID */ static void ChangeTimetableStartCallback(const Window *w, Date date) { - DoCommandP(CMD_SET_TIMETABLE_START, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, w->window_number, date); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, w->window_number, date, {}); } @@ -578,25 +579,25 @@ struct TimetableWindow : Window { case WID_VT_CLEAR_TIME: { // Clear waiting time. uint32 p1 = PackTimetableArgs(v, this->sel_index, false); - DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, p1, 0); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, 0, {}); break; } case WID_VT_CLEAR_SPEED: { // Clear max speed button. uint32 p1 = PackTimetableArgs(v, this->sel_index, true); - DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, p1, UINT16_MAX); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, UINT16_MAX, {}); break; } case WID_VT_RESET_LATENESS: // Reset the vehicle's late counter. - DoCommandP(CMD_SET_VEHICLE_ON_TIME, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, v->index, 0); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, 0, {}); break; case WID_VT_AUTOFILL: { // Autofill the timetable. uint32 p2 = 0; if (!HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(p2, 0); if (_ctrl_pressed) SetBit(p2, 1); - DoCommandP(CMD_AUTOFILL_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (TileIndex)0, v->index, p2); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, p2, {}); break; } @@ -629,7 +630,7 @@ struct TimetableWindow : Window { uint32 p2 = std::min(val, UINT16_MAX); - DoCommandP(CMD_CHANGE_TIMETABLE, STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, p2); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, p2, {}); } void OnResize() override diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 665556e8ab..b2b25afa6c 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -49,6 +49,7 @@ #include "framerate_type.h" #include "guitimer_func.h" #include "screenshot_gui.h" +#include "misc_cmd.h" #include "widgets/toolbar_widget.h" @@ -265,7 +266,7 @@ static CallBackFunction ToolbarPauseClick(Window *w) { if (_networking && !_network_server) return CBF_NONE; // only server can pause the game - if (DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED)) { + if (Command::Post(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, {})) { if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP); } return CBF_NONE; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index cb88c5c005..8f315a0557 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -33,6 +33,7 @@ #include "stringfilter_type.h" #include "widgets/dropdown_func.h" #include "town_kdtree.h" +#include "town_cmd.h" #include "widgets/town_widget.h" @@ -287,7 +288,7 @@ public: } case WID_TA_EXECUTE: - DoCommandP(CMD_DO_TOWN_ACTION, STR_ERROR_CAN_T_DO_THIS, this->town->xy, this->window_number, this->sel_index); + Command::Post(STR_ERROR_CAN_T_DO_THIS, this->town->xy, this->window_number, this->sel_index, {}); break; } } @@ -474,12 +475,12 @@ public: _warn_town_no_roads = true; } - DoCommandP(CMD_EXPAND_TOWN, STR_ERROR_CAN_T_EXPAND_TOWN, (TileIndex)0, this->window_number, 0); + Command::Post(STR_ERROR_CAN_T_EXPAND_TOWN, 0, this->window_number, 0, {}); break; } case WID_TV_DELETE: // delete town - only available on Scenario editor - DoCommandP(CMD_DELETE_TOWN, STR_ERROR_TOWN_CAN_T_DELETE, (TileIndex)0, this->window_number, 0); + Command::Post(STR_ERROR_TOWN_CAN_T_DELETE, 0, this->window_number, 0, {}); break; } } @@ -561,7 +562,7 @@ public: { if (str == nullptr) return; - DoCommandP(CMD_RENAME_TOWN, STR_ERROR_CAN_T_RENAME_TOWN, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_TOWN, 0, this->window_number, 0, str); } }; @@ -1162,7 +1163,7 @@ public: if (strcmp(buf, this->townname_editbox.text.buf) != 0) name = this->townname_editbox.text.buf; } - bool success = DoCommandP(CMD_FOUND_TOWN, errstr, cc, + bool success = Command::Post(errstr, cc, tile, this->town_size | this->city << 2 | this->town_layout << 3 | random << 6, townnameparts, name); /* Rerandomise name, if success and no cost-estimation. */ diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index b060ecdbad..a86e835bd3 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -35,6 +35,7 @@ #include "newgrf_debug.h" #include "framerate_type.h" #include "train_cmd.h" +#include "misc_cmd.h" #include "table/strings.h" #include "table/train_sprites.h" @@ -87,7 +88,7 @@ void CheckTrainsLengths() if (!_networking && first) { first = false; - DoCommandP(CMD_PAUSE, 0, PM_PAUSED_ERROR, 1); + Command::Post(0, PM_PAUSED_ERROR, 1, {}); } /* Break so we warn only once for each train. */ break; diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 7031a89684..8fc97d8571 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -14,6 +14,7 @@ #include "strings_func.h" #include "vehicle_func.h" #include "zoom_func.h" +#include "train_cmd.h" #include "table/strings.h" @@ -45,7 +46,7 @@ void CcBuildWagon(const CommandCost &result, Commands cmd, TileIndex tile, uint3 if (found != nullptr) { found = found->Last(); /* put the new wagon at the end of the loco. */ - DoCommandP(CMD_MOVE_RAIL_VEHICLE, 0, _new_vehicle_id, found->index); + Command::Post(0, _new_vehicle_id, found->index, {}); InvalidateWindowClassesData(WC_TRAINS_LIST, 0); } } diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index f176668b1a..794135716b 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -19,6 +19,7 @@ #include "strings_func.h" #include "zoom_func.h" #include "tree_map.h" +#include "tree_cmd.h" #include "widgets/tree_widget.h" @@ -230,7 +231,7 @@ public: TileIndex tile = TileVirtXY(pt.x, pt.y); if (this->mode == PM_NORMAL) { - DoCommandP(CMD_PLANT_TREE, tile, this->tree_to_plant, tile); + Command::Post(tile, this->tree_to_plant, tile, {}); } else { this->DoPlantForest(tile); } @@ -240,7 +241,7 @@ public: void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL && pt.x != -1 && select_proc == DDSP_PLANT_TREES) { - DoCommandP(CMD_PLANT_TREE, STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, this->tree_to_plant, start_tile); + Command::Post(STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, this->tree_to_plant, start_tile, {}); } } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index d5d6978cc5..c549101504 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -38,6 +38,9 @@ #include "zoom_func.h" #include "depot_cmd.h" #include "vehicle_cmd.h" +#include "order_cmd.h" +#include "roadveh_cmd.h" +#include "train_cmd.h" #include "safeguards.h" @@ -1035,9 +1038,9 @@ struct RefitWindow : public Window { if (this->order == INVALID_VEH_ORDER_ID) { bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX; - if (DoCommandP(CMD_REFIT_VEHICLE, GetCmdRefitVehMsg(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16) && delete_window) this->Close(); + if (Command::Post(GetCmdRefitVehMsg(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16, {}) && delete_window) this->Close(); } else { - if (DoCommandP(CMD_ORDER_REFIT, v->tile, v->index, this->cargo->cargo | this->order << 16)) this->Close(); + if (Command::Post(v->tile, v->index, this->cargo->cargo | this->order << 16, {})) this->Close(); } } break; @@ -1896,7 +1899,7 @@ public: case WID_VL_STOP_ALL: case WID_VL_START_ALL: - DoCommandP(CMD_MASS_START_STOP, 0, (1 << 1) | (widget == WID_VL_START_ALL ? (1 << 0) : 0), this->window_number); + Command::Post(0, (1 << 1) | (widget == WID_VL_START_ALL ? (1 << 0) : 0), this->window_number, {}); break; } } @@ -1921,7 +1924,7 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: // Send to Depots - DoCommandP(CMD_SEND_VEHICLE_TO_DEPOT, GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number); + Command::Post(GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number, {}); break; default: NOT_REACHED(); @@ -2424,7 +2427,7 @@ struct VehicleDetailsWindow : Window { mod = GetServiceIntervalClamped(mod + v->GetServiceInterval(), v->ServiceIntervalIsPercent()); if (mod == v->GetServiceInterval()) return; - DoCommandP(CMD_CHANGE_SERVICE_INT, STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17)); + Command::Post(STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17), {}); break; } @@ -2460,7 +2463,7 @@ struct VehicleDetailsWindow : Window { bool iscustom = index != 0; bool ispercent = iscustom ? (index == 2) : Company::Get(v->owner)->settings.vehicle.servint_ispercent; uint16 interval = GetServiceIntervalClamped(v->GetServiceInterval(), ispercent); - DoCommandP(CMD_CHANGE_SERVICE_INT, STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17)); + Command::Post(STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17), {}); break; } } @@ -2643,7 +2646,7 @@ void CcStartStopVehicle(const CommandCost &result, Commands cmd, TileIndex tile, void StartStopVehicle(const Vehicle *v, bool texteffect) { assert(v->IsPrimaryVehicle()); - DoCommandP(CMD_START_STOP_VEHICLE, _vehicle_msg_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, 0); + Command::Post(_vehicle_msg_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, 0, {}); } /** Checks whether the vehicle may be refitted at the moment.*/ @@ -2967,7 +2970,7 @@ public: break; case WID_VV_GOTO_DEPOT: // goto hangar - DoCommandP(CMD_SEND_VEHICLE_TO_DEPOT, GetCmdSendToDepotMsg(v), v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0); + Command::Post(GetCmdSendToDepotMsg(v), v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0, {}); break; case WID_VV_REFIT: // refit ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID, this); @@ -2991,21 +2994,21 @@ public: * There is no point to it except for starting the vehicle. * For starting the vehicle the player has to open the depot GUI, which is * most likely already open, but is also visible in the vehicle viewport. */ - DoCommandP(CMD_CLONE_VEHICLE, _vehicle_msg_translation_table[VCT_CMD_CLONE_VEH][v->type], + Command::Post(_vehicle_msg_translation_table[VCT_CMD_CLONE_VEH][v->type], _ctrl_pressed ? nullptr : CcCloneVehicle, - v->tile, v->index, _ctrl_pressed ? 1 : 0); + v->tile, v->index, _ctrl_pressed ? 1 : 0, {}); break; case WID_VV_TURN_AROUND: // turn around assert(v->IsGroundVehicle()); if (v->type == VEH_ROAD) { - DoCommandP(CMD_TURN_ROADVEH, _vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0); + Command::Post(_vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0, {}); } else { - DoCommandP(CMD_REVERSE_TRAIN_DIRECTION, _vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0); + Command::Post(_vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0, {}); } break; case WID_VV_FORCE_PROCEED: // force proceed assert(v->type == VEH_TRAIN); - DoCommandP(CMD_FORCE_TRAIN_PROCEED, STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL, v->tile, v->index, 0); + Command::Post(STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL, v->tile, v->index, 0, {}); break; } } @@ -3014,7 +3017,7 @@ public: { if (str == nullptr) return; - DoCommandP(CMD_RENAME_VEHICLE, STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type, 0, this->window_number, 0, str); } void OnMouseOver(Point pt, int widget) override diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 44e2718b68..673601f89f 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -20,6 +20,7 @@ #include "company_base.h" #include "window_func.h" #include "waypoint_base.h" +#include "waypoint_cmd.h" #include "widgets/waypoint_widget.h" @@ -138,7 +139,7 @@ public: { if (str == nullptr) return; - DoCommandP(CMD_RENAME_WAYPOINT, STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME, 0, this->window_number, 0, str); } }; From eab18f06a47e558fe313cb86c855e8949b01feed Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 31 Oct 2021 22:07:22 +0100 Subject: [PATCH 117/710] Codechange: Pass additional data as byte stream to command callbacks. --- src/ai/ai_instance.cpp | 10 +++---- src/airport_gui.cpp | 2 +- src/bridge_gui.cpp | 11 +++----- src/command_func.h | 7 ++--- src/command_type.h | 12 ++++---- src/depot_gui.cpp | 5 +--- src/dock_gui.cpp | 4 +-- src/game/game_instance.cpp | 10 +++---- src/group_gui.cpp | 47 +++++++++++++++++++------------- src/industry_gui.cpp | 9 +++--- src/main_gui.cpp | 2 +- src/rail_gui.cpp | 9 +++--- src/road_gui.cpp | 18 ++++++------ src/script/api/script_object.cpp | 16 +++++------ src/script/api/script_object.hpp | 4 +-- src/script/script_instance.cpp | 6 ++-- src/script/script_instance.hpp | 5 ++-- src/script/script_storage.hpp | 5 +--- src/signs_cmd.cpp | 2 +- src/terraform_gui.cpp | 2 +- src/town_gui.cpp | 4 +-- src/train_gui.cpp | 7 ++--- src/vehicle_gui.cpp | 13 ++++----- 23 files changed, 98 insertions(+), 112 deletions(-) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 509ed70d2e..576a81637f 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -92,14 +92,12 @@ ScriptInfo *AIInstance::FindLibrary(const char *library, int version) /** * DoCommand callback function for all commands executed by AIs. - * @param result The result of the command. * @param cmd cmd as given to DoCommandPInternal. + * @param result The result of the command. * @param tile The tile on which the command was executed. - * @param p1 p1 as given to DoCommandPInternal. - * @param p2 p2 as given to DoCommandPInternal. - * @param text text as given to DoCommandPInternal. + * @param data Command data as given to Command<>::Post. */ -void CcAI(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { /* * The company might not exist anymore. Check for this. @@ -110,7 +108,7 @@ void CcAI(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, ui const Company *c = Company::GetIfValid(_current_company); if (c == nullptr || c->ai_instance == nullptr) return; - if (c->ai_instance->DoCommandCallback(result, tile, p1, p2, cmd)) { + if (c->ai_instance->DoCommandCallback(result, tile, data, cmd)) { c->ai_instance->Continue(); } } diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index af1fb1309f..0de11c9545 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -43,7 +43,7 @@ static void ShowBuildAirportPicker(Window *parent); SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout); -void CcBuildAirport(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildAirport(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index e9e1f48f5a..38ff698eb6 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -53,18 +53,15 @@ typedef GUIList GUIBridgeList; ///< List of bridges, used in #B * @param result Whether the build succeeded * @param cmd unused * @param end_tile End tile of the bridge. - * @param p1 packed start tile coords (~ dx) - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 7) - bridge type (hi bh) - * - p2 = (bit 8-13) - rail type or road types. - * - p2 = (bit 15-16) - transport type. - * @param text unused + * @param data Additional bitstuffed command data. */ -void CcBuildBridge(const CommandCost &result, Commands cmd, TileIndex end_tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildBridge(Commands cmd, const CommandCost &result, TileIndex end_tile, const CommandDataBuffer &data) { if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile); + auto [tile, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); + TransportType transport_type = Extract(p2); if (transport_type == TRANSPORT_ROAD) { diff --git a/src/command_func.h b/src/command_func.h index 6a9b93ff54..9d603abcf6 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -12,7 +12,7 @@ #include "command_type.h" #include "company_type.h" -#include +#include "misc/endian_buffer.hpp" #include "tile_map.h" /** @@ -34,9 +34,6 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); */ #define return_cmd_error(errcode) return CommandCost(errcode); -/** Storage buffer for serialized command data. */ -typedef std::vector CommandDataBuffer; - CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); @@ -213,7 +210,7 @@ protected: InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd); if (!estimate_only && !only_sending && callback != nullptr) { - std::apply(callback, std::tuple_cat(std::tuple{ res, Tcmd }, args)); + callback(Tcmd, res, tile, EndianBufferWriter::FromValue(args)); } return res.Succeeded(); diff --git a/src/command_type.h b/src/command_type.h index c182ca393e..59331dc7cc 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -13,6 +13,7 @@ #include "economy_type.h" #include "strings_type.h" #include "tile_type.h" +#include struct GRFFile; @@ -444,6 +445,9 @@ template struct CommandTraits; static inline constexpr const char *name = #proc_; \ }; +/** Storage buffer for serialized command data. */ +typedef std::vector CommandDataBuffer; + /** * Define a callback function for the client, after the command is finished. * @@ -451,14 +455,12 @@ template struct CommandTraits; * are from the #CommandProc callback type. The boolean parameter indicates if the * command succeeded or failed. * - * @param result The result of the executed command * @param cmd The command that was executed + * @param result The result of the executed command * @param tile The tile of the command action - * @param p1 Additional data of the command - * @param p1 Additional data of the command - * @param text Text of the command + * @param data Additional data of the command * @see CommandProc */ -typedef void CommandCallback(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); +typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data); #endif /* COMMAND_TYPE_H */ diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 76e03ef396..d316d97ca0 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -117,11 +117,8 @@ extern void DepotSortList(VehicleList *list); * @param result the result of the cloning command * @param cmd unused * @param tile unused - * @param p1 unused - * @param p2 unused - * @param text unused */ -void CcCloneVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcCloneVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 3cb101f7ad..328ce1c20c 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -43,7 +43,7 @@ static void ShowBuildDocksDepotPicker(Window *parent); static Axis _ship_depot_direction; -void CcBuildDocks(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildDocks(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; @@ -51,7 +51,7 @@ void CcBuildDocks(const CommandCost &result, Commands cmd, TileIndex tile, uint3 if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcPlaySound_CONSTRUCTION_WATER(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcPlaySound_CONSTRUCTION_WATER(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_CONSTRUCTION_WATER, tile); } diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index 47374525fa..8433567c7c 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -81,16 +81,14 @@ void GameInstance::Died() /** * DoCommand callback function for all commands executed by Game Scripts. - * @param result The result of the command. * @param cmd cmd as given to DoCommandPInternal. + * @param result The result of the command. * @param tile The tile on which the command was executed. - * @param p1 p1 as given to DoCommandPInternal. - * @param p2 p2 as given to DoCommandPInternal. - * @param text text as given to DoCommandPInternal. + * @param data Command data as given to Command<>::Post. */ -void CcGame(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcGame(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { - if (Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2, cmd)) { + if (Game::GetGameInstance()->DoCommandCallback(result, tile, data, cmd)) { Game::GetGameInstance()->Continue(); } } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index b2deba3091..22f2889712 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1141,38 +1141,47 @@ static inline VehicleGroupWindow *FindVehicleGroupWindow(VehicleType vt, Owner o /** * Opens a 'Rename group' window for newly created group. - * @param result Did command succeed? - * @param cmd Unused. - * @param tile Unused. - * @param p1 Vehicle type. - * @param p2 Unused. - * @param text Unused. - * @see CmdCreateGroup + * @param veh_type Vehicle type. */ -void CcCreateGroup(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +static void CcCreateGroup(VehicleType veh_type) { - if (result.Failed()) return; - assert(p1 <= VEH_AIRCRAFT); - - VehicleGroupWindow *w = FindVehicleGroupWindow((VehicleType)p1, _current_company); + VehicleGroupWindow *w = FindVehicleGroupWindow(veh_type, _current_company); if (w != nullptr) w->ShowRenameGroupWindow(_new_group_id, true); } /** - * Open rename window after adding a vehicle to a new group via drag and drop. - * @param result Did command succeed? + * Opens a 'Rename group' window for newly created group. * @param cmd Unused. + * @param result Did command succeed? * @param tile Unused. - * @param p1 Unused. - * @param p2 Bit 0-19: Vehicle ID. - * @param text Unused. + * @param data Command data. + * @see CmdCreateGroup */ -void CcAddVehicleNewGroup(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcCreateGroup(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; + + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); + assert(p1 <= VEH_AIRCRAFT); + + CcCreateGroup((VehicleType)p1); +} + +/** + * Open rename window after adding a vehicle to a new group via drag and drop. + * @param cmd Unused. + * @param result Did command succeed? + * @param tile Unused. + * @param data Command data. + */ +void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +{ + if (result.Failed()) return; + + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); assert(Vehicle::IsValidID(GB(p2, 0, 20))); - CcCreateGroup(result, cmd, 0, Vehicle::Get(GB(p2, 0, 20))->type, 0, text); + CcCreateGroup(Vehicle::Get(GB(p2, 0, 20))->type); } /** diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 29da3c76ef..b66d4f8bfc 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -219,17 +219,16 @@ void SortIndustryTypes() /** * Command callback. In case of failure to build an industry, show an error message. - * @param result Result of the command. * @param cmd Unused. + * @param result Result of the command. * @param tile Tile where the industry is placed. - * @param p1 Additional data of the #CMD_BUILD_INDUSTRY command. - * @param p2 Additional data of the #CMD_BUILD_INDUSTRY command. - * @param text Unused. + * @param data Additional data of the #CMD_BUILD_INDUSTRY command. */ -void CcBuildIndustry(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Succeeded()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); uint8 indtype = GB(p1, 0, 8); if (indtype < NUM_INDUSTRYTYPES) { const IndustrySpec *indsp = GetIndustrySpec(indtype); diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 847d328454..680493c12c 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -77,7 +77,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl } -void CcPlaySound_EXPLOSION(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcPlaySound_EXPLOSION(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index a57e2f8e53..c1c45d5d72 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -89,7 +89,7 @@ static bool IsStationAvailable(const StationSpec *statspec) return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); } -void CcPlaySound_CONSTRUCTION_RAIL(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcPlaySound_CONSTRUCTION_RAIL(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); } @@ -135,10 +135,11 @@ static const DiagDirection _place_depot_extra_dir[12] = { DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE, }; -void CcRailDepot(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); DiagDirection dir = (DiagDirection)p2; if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); @@ -176,7 +177,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } } -void CcStation(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcStation(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; @@ -293,7 +294,7 @@ static void PlaceRail_Bridge(TileIndex tile, Window *w) } /** Command callback for building a tunnel */ -void CcBuildRailTunnel(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildRailTunnel(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 948095f773..a777c9c1d1 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -69,7 +69,7 @@ static RoadType _cur_roadtype; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; -void CcPlaySound_CONSTRUCTION_OTHER(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcPlaySound_CONSTRUCTION_OTHER(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); } @@ -92,15 +92,11 @@ static void PlaceRoad_Bridge(TileIndex tile, Window *w) /** * Callback executed after a build road tunnel command has been called. * - * @param result Whether the build succeeded. * @param cmd unused + * @param result Whether the build succeeded. * @param start_tile Starting tile of the tunnel. - * @param p1 bit 0-3 railtype or roadtypes - * bit 8-9 transport type - * @param p2 unused - * @param text unused */ -void CcBuildRoadTunnel(const CommandCost &result, Commands cmd, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildRoadTunnel(Commands cmd, const CommandCost &result, TileIndex start_tile, const CommandDataBuffer &) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, start_tile); @@ -133,10 +129,12 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) } } -void CcRoadDepot(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); + DiagDirection dir = (DiagDirection)GB(p1, 0, 2); if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); @@ -160,10 +158,12 @@ void CcRoadDepot(const CommandCost &result, Commands cmd, TileIndex tile, uint32 * @param text Unused. * @see CmdBuildRoadStop */ -void CcRoadStop(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); + DiagDirection dir = (DiagDirection)GB(p2, 3, 2); if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index 56fdde8261..c63d2a2ea8 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -82,24 +82,22 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->mode_instance; } -/* static */ void ScriptObject::SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +/* static */ void ScriptObject::SetLastCommand(TileIndex tile, const CommandDataBuffer &data, Commands cmd) { ScriptStorage *s = GetStorage(); - Debug(script, 6, "SetLastCommand company={:02d} tile={:06x} p1={:08x} p2={:08x} cmd={}", s->root_company, tile, p1, p2, cmd); + Debug(script, 6, "SetLastCommand company={:02d} tile={:06x} cmd={} data={}", s->root_company, tile, cmd, FormatArrayAsHex(data)); s->last_tile = tile; - s->last_p1 = p1; - s->last_p2 = p2; + s->last_data = data; s->last_cmd = cmd; } -/* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +/* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, const CommandDataBuffer &data, Commands cmd) { ScriptStorage *s = GetStorage(); - Debug(script, 6, "CheckLastCommand company={:02d} tile={:06x} p1={:08x} p2={:08x} cmd={}", s->root_company, tile, p1, p2, cmd); + Debug(script, 6, "CheckLastCommand company={:02d} tile={:06x} cmd={} data={}", s->root_company, tile, cmd, FormatArrayAsHex(data)); if (s->last_tile != tile) return false; - if (s->last_p1 != p1) return false; - if (s->last_p2 != p2) return false; if (s->last_cmd != cmd) return false; + if (s->last_data != data) return false; return true; } @@ -326,7 +324,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() if (GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = UINT32_MAX; /* Store the command for command callback validation. */ - if (!estimate_only && _networking && !_generating_world) SetLastCommand(tile, p1, p2, cmd); + if (!estimate_only && _networking && !_generating_world) SetLastCommand(tile, EndianBufferWriter::FromValue(std::make_tuple(tile, p1, p2, command_text)), cmd); /* Try to perform the command. */ CommandCost res = ::DoCommandPInternal(cmd, STR_NULL, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, false, estimate_only, false, tile, p1, p2, command_text); diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index a1134aa5c3..40c8eaf854 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -75,12 +75,12 @@ protected: /** * Store the latest command executed by the script. */ - static void SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd); + static void SetLastCommand(TileIndex tile, const CommandDataBuffer &data, Commands cmd); /** * Check if it's the latest command executed by the script. */ - static bool CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd); + static bool CheckLastCommand(TileIndex tile, const CommandDataBuffer &data, Commands cmd); /** * Sets the DoCommand costs counter to a value. diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 03fad1491a..ecf846b9fd 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -687,11 +687,11 @@ SQInteger ScriptInstance::GetOpsTillSuspend() return this->engine->GetOpsTillSuspend(); } -bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd) +bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, const CommandDataBuffer &data, Commands cmd) { ScriptObject::ActiveInstance active(this); - if (!ScriptObject::CheckLastCommand(tile, p1, p2, cmd)) { + if (!ScriptObject::CheckLastCommand(tile, data, cmd)) { Debug(script, 1, "DoCommandCallback terminating a script, last command does not match expected command"); return false; } @@ -705,7 +705,7 @@ bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile ScriptObject::SetLastCost(result.GetCost()); } - ScriptObject::SetLastCommand(INVALID_TILE, 0, 0, CMD_END); + ScriptObject::SetLastCommand(INVALID_TILE, {}, CMD_END); return true; } diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 01415d4d4b..c30fd14996 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -178,12 +178,11 @@ public: * DoCommand callback function for all commands executed by scripts. * @param result The result of the command. * @param tile The tile on which the command was executed. - * @param p1 p1 as given to DoCommandPInternal. - * @param p2 p2 as given to DoCommandPInternal. + * @param data Command data as given to DoCommandPInternal. * @param cmd cmd as given to DoCommandPInternal. * @return true if we handled result. */ - bool DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, Commands cmd); + bool DoCommandCallback(const CommandCost &result, TileIndex tile, const CommandDataBuffer &data, Commands cmd); /** * Insert an event for this script. diff --git a/src/script/script_storage.hpp b/src/script/script_storage.hpp index 8dadf59ae4..3735adc1da 100644 --- a/src/script/script_storage.hpp +++ b/src/script/script_storage.hpp @@ -45,8 +45,7 @@ private: bool last_command_res; ///< The last result of the command. TileIndex last_tile; ///< The last tile passed to a command. - uint32 last_p1; ///< The last p1 passed to a command. - uint32 last_p2; ///< The last p2 passed to a command. + CommandDataBuffer last_data; ///< The last data passed to a command. Commands last_cmd; ///< The last cmd passed to a command. VehicleID new_vehicle_id; ///< The ID of the new Vehicle. @@ -77,8 +76,6 @@ public: last_error (STR_NULL), last_command_res (true), last_tile (INVALID_TILE), - last_p1 (0), - last_p2 (0), last_cmd (CMD_END), new_vehicle_id (0), new_sign_id (0), diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 4fdfc0ab5f..00baf45a88 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -116,7 +116,7 @@ CommandCost CmdRenameSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 * @param p2 unused * @param text unused */ -void CcPlaceSign(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcPlaceSign(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index c65adad7d1..7399d6ffa2 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -44,7 +44,7 @@ #include "safeguards.h" -void CcTerraform(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcTerraform(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 8f315a0557..6e955e103e 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -1009,7 +1009,7 @@ void ShowTownDirectory() new TownDirectoryWindow(&_town_directory_desc); } -void CcFoundTown(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcFoundTown(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; @@ -1017,7 +1017,7 @@ void CcFoundTown(const CommandCost &result, Commands cmd, TileIndex tile, uint32 if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcFoundRandomTown(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcFoundRandomTown(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(_new_town_id)->xy); } diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 8fc97d8571..e41bdf6aca 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -22,14 +22,11 @@ /** * Callback for building wagons. - * @param result The result of the command. * @param cmd Unused. + * @param result The result of the command. * @param tile The tile the command was executed on. - * @param p1 Additional data for the command (for the #CommandProc) - * @param p2 Additional data for the command (for the #CommandProc) - * @param text Unused. */ -void CcBuildWagon(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildWagon(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) { if (result.Failed()) return; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index c549101504..80b75e7ce8 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2622,14 +2622,13 @@ static const StringID _vehicle_msg_translation_table[][4] = { * @param result the result of the start/stop command * @param cmd unused * @param tile unused - * @param p1 vehicle ID - * @param p2 unused - * @param text unused + * @param data Command data */ -void CcStartStopVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcStartStopVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); const Vehicle *v = Vehicle::GetIfValid(p1); if (v == nullptr || !v->IsPrimaryVehicle() || v->owner != _local_company) return; @@ -3127,11 +3126,9 @@ void StopGlobalFollowVehicle(const Vehicle *v) * @param result indicates completion (or not) of the operation * @param cmd unused * @param tile unused - * @param p1 unused - * @param p2 unused - * @param text unused + * @param data unused */ -void CcBuildPrimaryVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildPrimaryVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; From 6691ee3b963ee3282490360bb3cc1ea09d0c58ea Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 1 Nov 2021 21:30:34 +0100 Subject: [PATCH 118/710] Codechange: Template script command calls. --- src/script/api/script_airport.cpp | 6 +- src/script/api/script_basestation.cpp | 8 ++- src/script/api/script_bridge.cpp | 13 +++-- src/script/api/script_company.cpp | 32 +++++----- src/script/api/script_controller.cpp | 3 +- src/script/api/script_engine.cpp | 5 +- src/script/api/script_event_types.cpp | 6 +- src/script/api/script_game.cpp | 5 +- src/script/api/script_gamesettings.cpp | 3 +- src/script/api/script_goal.cpp | 15 ++--- src/script/api/script_group.cpp | 25 ++++---- src/script/api/script_industry.cpp | 9 +-- src/script/api/script_industrytype.cpp | 5 +- src/script/api/script_marine.cpp | 25 ++++---- src/script/api/script_news.cpp | 3 +- src/script/api/script_object.cpp | 40 ++++++------- src/script/api/script_object.hpp | 81 +++++++++++++++++++++++++- src/script/api/script_objecttype.cpp | 3 +- src/script/api/script_order.cpp | 37 ++++++------ src/script/api/script_rail.cpp | 31 +++++----- src/script/api/script_road.cpp | 19 +++--- src/script/api/script_sign.cpp | 7 ++- src/script/api/script_station.cpp | 3 +- src/script/api/script_story_page.cpp | 30 +++++----- src/script/api/script_subsidy.cpp | 3 +- src/script/api/script_tile.cpp | 15 +++-- src/script/api/script_town.cpp | 17 +++--- src/script/api/script_tunnel.cpp | 13 +++-- src/script/api/script_vehicle.cpp | 26 +++++---- src/script/api/script_viewport.cpp | 7 ++- 30 files changed, 310 insertions(+), 185 deletions(-) diff --git a/src/script/api/script_airport.cpp b/src/script/api/script_airport.cpp index 9477191724..5927b16620 100644 --- a/src/script/api/script_airport.cpp +++ b/src/script/api/script_airport.cpp @@ -12,6 +12,8 @@ #include "script_station.hpp" #include "../../station_base.h" #include "../../town.h" +#include "../../landscape_cmd.h" +#include "../../station_cmd.h" #include "../../safeguards.h" @@ -77,7 +79,7 @@ uint p2 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 1; p2 |= (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::DoCommand(tile, type, p2, CMD_BUILD_AIRPORT); + return ScriptObject::Command::Do(tile, type, p2, {}); } /* static */ bool ScriptAirport::RemoveAirport(TileIndex tile) @@ -86,7 +88,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)) EnforcePrecondition(false, IsAirportTile(tile) || IsHangarTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ int32 ScriptAirport::GetNumHangars(TileIndex tile) diff --git a/src/script/api/script_basestation.cpp b/src/script/api/script_basestation.cpp index 860e54c787..a249344101 100644 --- a/src/script/api/script_basestation.cpp +++ b/src/script/api/script_basestation.cpp @@ -13,6 +13,8 @@ #include "../../station_base.h" #include "../../string_func.h" #include "../../strings_func.h" +#include "../../station_cmd.h" +#include "../../waypoint_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -42,7 +44,11 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_STATION_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::DoCommand(0, station_id, 0, ::Station::IsValidID(station_id) ? CMD_RENAME_STATION : CMD_RENAME_WAYPOINT, text); + if (::Station::IsValidID(station_id)) { + return ScriptObject::Command::Do(0, station_id, 0, text); + } else { + return ScriptObject::Command::Do(0, station_id, 0, text); + } } /* static */ TileIndex ScriptBaseStation::GetLocation(StationID station_id) diff --git a/src/script/api/script_bridge.cpp b/src/script/api/script_bridge.cpp index 4d685ca21f..dc357c2552 100644 --- a/src/script/api/script_bridge.cpp +++ b/src/script/api/script_bridge.cpp @@ -14,6 +14,9 @@ #include "../../bridge_map.h" #include "../../strings_func.h" #include "../../date_func.h" +#include "../../landscape_cmd.h" +#include "../../road_cmd.h" +#include "../../tunnelbridge_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -95,12 +98,12 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) /* For rail and water we do nothing special */ if (vehicle_type == ScriptVehicle::VT_RAIL || vehicle_type == ScriptVehicle::VT_WATER) { - return ScriptObject::DoCommand(end, start, type | bridge_id, CMD_BUILD_BRIDGE); + return ScriptObject::Command::Do(end, start, type | bridge_id, {}); } ScriptObject::SetCallbackVariable(0, start); ScriptObject::SetCallbackVariable(1, end); - return ScriptObject::DoCommand(end, start, type | bridge_id, CMD_BUILD_BRIDGE, nullptr, &::_DoCommandReturnBuildBridge1); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildBridge1, end, start, type | bridge_id, {}); } /* static */ bool ScriptBridge::_BuildBridgeRoad1() @@ -112,7 +115,7 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::DoCommand(start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (ScriptRoad::GetCurrentRoadType() << 4), 0, CMD_BUILD_ROAD, nullptr, &::_DoCommandReturnBuildBridge2); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildBridge2, start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (ScriptRoad::GetCurrentRoadType() << 4), 0, {}); } /* static */ bool ScriptBridge::_BuildBridgeRoad2() @@ -124,14 +127,14 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::DoCommand(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1) | (ScriptRoad::GetCurrentRoadType() << 4), 0, CMD_BUILD_ROAD); + return ScriptObject::Command::Do(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1) | (ScriptRoad::GetCurrentRoadType() << 4), 0, {}); } /* static */ bool ScriptBridge::RemoveBridge(TileIndex tile) { EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsBridgeTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ char *ScriptBridge::GetName(BridgeID bridge_id, ScriptVehicle::VehicleType vehicle_type) diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp index 876ad84c5e..c8f8a616fb 100644 --- a/src/script/api/script_company.cpp +++ b/src/script/api/script_company.cpp @@ -20,6 +20,10 @@ #include "../../tile_map.h" #include "../../string_func.h" #include "../../settings_func.h" +#include "../../company_cmd.h" +#include "../../misc_cmd.h" +#include "../../object_cmd.h" +#include "../../settings_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -48,7 +52,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_COMPANY_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::DoCommand(0, 0, 0, CMD_RENAME_COMPANY, text); + return ScriptObject::Command::Do(0, 0, 0, text); } /* static */ char *ScriptCompany::GetName(ScriptCompany::CompanyID company) @@ -69,7 +73,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_PRESIDENT_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::DoCommand(0, 0, 0, CMD_RENAME_PRESIDENT, text); + return ScriptObject::Command::Do(0, 0, 0, text); } /* static */ char *ScriptCompany::GetPresidentName(ScriptCompany::CompanyID company) @@ -97,7 +101,7 @@ GenderEthnicity ge = (GenderEthnicity)((gender == GENDER_FEMALE ? (1 << ::GENDER_FEMALE) : 0) | (::InteractiveRandom() & (1 << ETHNICITY_BLACK))); RandomCompanyManagerFaceBits(cmf, ge, false); - return ScriptObject::DoCommand(0, 0, cmf, CMD_SET_COMPANY_MANAGER_FACE); + return ScriptObject::Command::Do(0, 0, cmf, {}); } /* static */ ScriptCompany::Gender ScriptCompany::GetPresidentGender(CompanyID company) @@ -206,9 +210,11 @@ Money amount = abs(loan - GetLoanAmount()); - return ScriptObject::DoCommand(0, - amount >> 32, (amount & 0xFFFFFFFC) | 2, - (loan > GetLoanAmount()) ? CMD_INCREASE_LOAN : CMD_DECREASE_LOAN); + if (loan > GetLoanAmount()) { + return ScriptObject::Command::Do(0, amount >> 32, (amount & 0xFFFFFFFC) | 2, {}); + } else { + return ScriptObject::Command::Do(0, amount >> 32, (amount & 0xFFFFFFFC) | 2, {}); + } } /* static */ bool ScriptCompany::SetMinimumLoanAmount(Money loan) @@ -238,7 +244,7 @@ EnforcePrecondition(false, company != COMPANY_INVALID); /* Network commands only allow 0 to indicate invalid tiles, not INVALID_TILE */ - return ScriptObject::DoCommand(tile == INVALID_TILE ? (TileIndex)0U : tile , (uint32)(delta), company | expenses_type << 8 , CMD_CHANGE_BANK_BALANCE); + return ScriptObject::Command::Do(tile == INVALID_TILE ? (TileIndex)0U : tile, (uint32)(delta), company | expenses_type << 8, {}); } /* static */ bool ScriptCompany::BuildCompanyHQ(TileIndex tile) @@ -246,7 +252,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, OBJECT_HQ, 0, CMD_BUILD_OBJECT); + return ScriptObject::Command::Do(tile, OBJECT_HQ, 0, {}); } /* static */ TileIndex ScriptCompany::GetCompanyHQ(CompanyID company) @@ -260,7 +266,7 @@ /* static */ bool ScriptCompany::SetAutoRenewStatus(bool autorenew) { - return ScriptObject::DoCommand(0, 0, autorenew ? 1 : 0, CMD_CHANGE_COMPANY_SETTING, "company.engine_renew"); + return ScriptObject::Command::Do(0, 0, autorenew ? 1 : 0, "company.engine_renew"); } /* static */ bool ScriptCompany::GetAutoRenewStatus(CompanyID company) @@ -273,7 +279,7 @@ /* static */ bool ScriptCompany::SetAutoRenewMonths(int16 months) { - return ScriptObject::DoCommand(0, 0, months, CMD_CHANGE_COMPANY_SETTING, "company.engine_renew_months"); + return ScriptObject::Command::Do(0, 0, months, "company.engine_renew_months"); } /* static */ int16 ScriptCompany::GetAutoRenewMonths(CompanyID company) @@ -288,7 +294,7 @@ { EnforcePrecondition(false, money >= 0); EnforcePrecondition(false, (int64)money <= UINT32_MAX); - return ScriptObject::DoCommand(0, 0, money, CMD_CHANGE_COMPANY_SETTING, "company.engine_renew_money"); + return ScriptObject::Command::Do(0, 0, money, "company.engine_renew_money"); } /* static */ Money ScriptCompany::GetAutoRenewMoney(CompanyID company) @@ -301,12 +307,12 @@ /* static */ bool ScriptCompany::SetPrimaryLiveryColour(LiveryScheme scheme, Colours colour) { - return ScriptObject::DoCommand(0, scheme, colour, CMD_SET_COMPANY_COLOUR); + return ScriptObject::Command::Do(0, scheme, colour, {}); } /* static */ bool ScriptCompany::SetSecondaryLiveryColour(LiveryScheme scheme, Colours colour) { - return ScriptObject::DoCommand(0, scheme | 1 << 8, colour, CMD_SET_COMPANY_COLOUR); + return ScriptObject::Command::Do(0, scheme | 1 << 8, colour, {}); } /* static */ ScriptCompany::Colours ScriptCompany::GetPrimaryLiveryColour(ScriptCompany::LiveryScheme scheme) diff --git a/src/script/api/script_controller.cpp b/src/script/api/script_controller.cpp index 8af7b87a3c..74a3ad3ea8 100644 --- a/src/script/api/script_controller.cpp +++ b/src/script/api/script_controller.cpp @@ -21,6 +21,7 @@ #include "../../ai/ai_gui.hpp" #include "../../settings_type.h" #include "../../network/network.h" +#include "../../misc_cmd.h" #include "../../safeguards.h" @@ -59,7 +60,7 @@ ShowAIDebugWindow(ScriptObject::GetRootCompany()); if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - ScriptObject::DoCommand(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); + ScriptObject::Command::Do(0, PM_PAUSED_NORMAL, 1, {}); } } diff --git a/src/script/api/script_engine.cpp b/src/script/api/script_engine.cpp index 1ec1b23a8e..d6cab36b6c 100644 --- a/src/script/api/script_engine.cpp +++ b/src/script/api/script_engine.cpp @@ -17,6 +17,7 @@ #include "../../engine_base.h" #include "../../engine_func.h" #include "../../articulated_vehicles.h" +#include "../../engine_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -285,7 +286,7 @@ EnforcePrecondition(false, IsValidEngine(engine_id)); EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID); - return ScriptObject::DoCommand(0, engine_id, (uint32)company | (1 << 31), CMD_ENGINE_CTRL); + return ScriptObject::Command::Do(0, engine_id, (uint32)company | (1 << 31), {}); } /* static */ bool ScriptEngine::DisableForCompany(EngineID engine_id, ScriptCompany::CompanyID company) @@ -296,5 +297,5 @@ EnforcePrecondition(false, IsValidEngine(engine_id)); EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID); - return ScriptObject::DoCommand(0, engine_id, company, CMD_ENGINE_CTRL); + return ScriptObject::Command::Do(0, engine_id, company, {}); } diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index 3cc5287eb8..f7776c40e8 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -16,6 +16,8 @@ #include "../../engine_base.h" #include "../../articulated_vehicles.h" #include "../../string_func.h" +#include "../../economy_cmd.h" +#include "../../engine_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -110,12 +112,12 @@ int32 ScriptEventEnginePreview::GetVehicleType() bool ScriptEventEnginePreview::AcceptPreview() { if (!this->IsEngineValid()) return false; - return ScriptObject::DoCommand(0, this->engine, 0, CMD_WANT_ENGINE_PREVIEW); + return ScriptObject::Command::Do(0, this->engine, 0, {}); } bool ScriptEventCompanyAskMerger::AcceptMerger() { - return ScriptObject::DoCommand(0, this->owner, 0, CMD_BUY_COMPANY); + return ScriptObject::Command::Do(0, this->owner, 0, {}); } ScriptEventAdminPort::ScriptEventAdminPort(const std::string &json) : diff --git a/src/script/api/script_game.cpp b/src/script/api/script_game.cpp index 43674c6f37..9b40a1cd3b 100644 --- a/src/script/api/script_game.cpp +++ b/src/script/api/script_game.cpp @@ -12,17 +12,18 @@ #include "../../command_type.h" #include "../../settings_type.h" #include "../../network/network.h" +#include "../../misc_cmd.h" #include "../../safeguards.h" /* static */ bool ScriptGame::Pause() { - return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 1, CMD_PAUSE); + return ScriptObject::Command::Do(0, PM_PAUSED_GAME_SCRIPT, 1, {}); } /* static */ bool ScriptGame::Unpause() { - return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 0, CMD_PAUSE); + return ScriptObject::Command::Do(0, PM_PAUSED_GAME_SCRIPT, 0, {}); } /* static */ bool ScriptGame::IsPaused() diff --git a/src/script/api/script_gamesettings.cpp b/src/script/api/script_gamesettings.cpp index 78b26e9bb3..611b78b8b6 100644 --- a/src/script/api/script_gamesettings.cpp +++ b/src/script/api/script_gamesettings.cpp @@ -12,6 +12,7 @@ #include "../../settings_internal.h" #include "../../settings_type.h" #include "../../command_type.h" +#include "../../settings_cmd.h" #include "../../safeguards.h" @@ -37,7 +38,7 @@ if ((sd->flags & SF_NO_NETWORK_SYNC) != 0) return false; - return ScriptObject::DoCommand(0, 0, value, CMD_CHANGE_SETTING, sd->GetName().c_str()); + return ScriptObject::Command::Do(0, 0, value, sd->GetName()); } /* static */ bool ScriptGameSettings::IsDisabledVehicleType(ScriptVehicle::VehicleType vehicle_type) diff --git a/src/script/api/script_goal.cpp b/src/script/api/script_goal.cpp index f1b75b032f..dbc2c51e01 100644 --- a/src/script/api/script_goal.cpp +++ b/src/script/api/script_goal.cpp @@ -19,6 +19,7 @@ #include "../../goal_base.h" #include "../../string_func.h" #include "../../network/network_base.h" +#include "../../goal_cmd.h" #include "../../safeguards.h" @@ -49,7 +50,7 @@ (type == GT_COMPANY && ScriptCompany::ResolveCompanyID((ScriptCompany::CompanyID)destination) != ScriptCompany::COMPANY_INVALID) || (type == GT_STORY_PAGE && story_page != nullptr && (c == INVALID_COMPANY ? story_page->company == INVALID_COMPANY : story_page->company == INVALID_COMPANY || story_page->company == c))); - if (!ScriptObject::DoCommand(0, type | (c << 8), destination, CMD_CREATE_GOAL, text, &ScriptInstance::DoCommandReturnGoalID)) return GOAL_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnGoalID, 0, type | (c << 8), destination, text)) return GOAL_INVALID; /* In case of test-mode, we return GoalID 0 */ return (ScriptGoal::GoalID)0; @@ -60,7 +61,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, IsValidGoal(goal_id)); - return ScriptObject::DoCommand(0, goal_id, 0, CMD_REMOVE_GOAL); + return ScriptObject::Command::Do(0, goal_id, 0, {}); } /* static */ bool ScriptGoal::SetText(GoalID goal_id, Text *goal) @@ -72,7 +73,7 @@ EnforcePrecondition(false, goal != nullptr); EnforcePrecondition(false, !StrEmpty(goal->GetEncodedText())); - return ScriptObject::DoCommand(0, goal_id, 0, CMD_SET_GOAL_TEXT, goal->GetEncodedText()); + return ScriptObject::Command::Do(0, goal_id, 0, goal->GetEncodedText()); } /* static */ bool ScriptGoal::SetProgress(GoalID goal_id, Text *progress) @@ -87,7 +88,7 @@ progress = nullptr; } - return ScriptObject::DoCommand(0, goal_id, 0, CMD_SET_GOAL_PROGRESS, progress != nullptr ? progress->GetEncodedText() : nullptr); + return ScriptObject::Command::Do(0, goal_id, 0, progress != nullptr ? std::string{ progress->GetEncodedText() } : std::string{}); } /* static */ bool ScriptGoal::SetCompleted(GoalID goal_id, bool completed) @@ -95,7 +96,7 @@ EnforcePrecondition(false, IsValidGoal(goal_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::DoCommand(0, goal_id, completed ? 1 : 0, CMD_SET_GOAL_COMPLETED); + return ScriptObject::Command::Do(0, goal_id, completed ? 1 : 0, {}); } /* static */ bool ScriptGoal::IsCompleted(GoalID goal_id) @@ -120,7 +121,7 @@ EnforcePrecondition(false, buttons < (1 << ::GOAL_QUESTION_BUTTON_COUNT)); EnforcePrecondition(false, (int)type < ::GQT_END); - return ScriptObject::DoCommand(0, uniqueid | (target << 16), buttons | (type << 29) | (is_client ? (1 << 31) : 0), CMD_GOAL_QUESTION, text); + return ScriptObject::Command::Do(0, uniqueid | (target << 16), buttons | (type << 29) | (is_client ? (1 << 31) : 0), text); } /* static */ bool ScriptGoal::Question(uint16 uniqueid, ScriptCompany::CompanyID company, Text *question, QuestionType type, int buttons) @@ -145,5 +146,5 @@ { EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::DoCommand(0, uniqueid, 0, CMD_GOAL_QUESTION_ANSWER); + return ScriptObject::Command::Do(0, uniqueid, 0, {}); } diff --git a/src/script/api/script_group.cpp b/src/script/api/script_group.cpp index a6e2fdee25..f4535c35e4 100644 --- a/src/script/api/script_group.cpp +++ b/src/script/api/script_group.cpp @@ -16,6 +16,9 @@ #include "../../autoreplace_func.h" #include "../../settings_func.h" #include "../../vehicle_base.h" +#include "../../autoreplace_cmd.h" +#include "../../group_cmd.h" +#include "../../settings_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -28,7 +31,7 @@ /* static */ ScriptGroup::GroupID ScriptGroup::CreateGroup(ScriptVehicle::VehicleType vehicle_type, GroupID parent_group_id) { - if (!ScriptObject::DoCommand(0, (::VehicleType)vehicle_type, parent_group_id, CMD_CREATE_GROUP, nullptr, &ScriptInstance::DoCommandReturnGroupID)) return GROUP_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnGroupID, 0, (::VehicleType)vehicle_type, parent_group_id, {})) return GROUP_INVALID; /* In case of test-mode, we return GroupID 0 */ return (ScriptGroup::GroupID)0; @@ -38,7 +41,7 @@ { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::DoCommand(0, group_id, 0, CMD_DELETE_GROUP); + return ScriptObject::Command::Do(0, group_id, 0, {}); } /* static */ ScriptVehicle::VehicleType ScriptGroup::GetVehicleType(GroupID group_id) @@ -58,7 +61,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_GROUP_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::DoCommand(0, group_id, 0, CMD_ALTER_GROUP, text); + return ScriptObject::Command::Do(0, group_id, 0, text); } /* static */ char *ScriptGroup::GetName(GroupID group_id) @@ -74,7 +77,7 @@ EnforcePrecondition(false, IsValidGroup(group_id)); EnforcePrecondition(false, IsValidGroup(parent_group_id)); - return ScriptObject::DoCommand(0, group_id | 1 << 16, parent_group_id, CMD_ALTER_GROUP); + return ScriptObject::Command::Do(0, group_id | 1 << 16, parent_group_id, {}); } /* static */ ScriptGroup::GroupID ScriptGroup::GetParent(GroupID group_id) @@ -89,7 +92,7 @@ { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::DoCommand(0, group_id | GroupFlags::GF_REPLACE_PROTECTION, enable ? 1 : 0, CMD_SET_GROUP_FLAG); + return ScriptObject::Command::Do(0, group_id | GroupFlags::GF_REPLACE_PROTECTION, enable ? 1 : 0, {}); } /* static */ bool ScriptGroup::GetAutoReplaceProtection(GroupID group_id) @@ -120,14 +123,14 @@ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT); EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, group_id, vehicle_id, CMD_ADD_VEHICLE_GROUP); + return ScriptObject::Command::Do(0, group_id, vehicle_id, {}); } /* static */ bool ScriptGroup::EnableWagonRemoval(bool enable_removal) { if (HasWagonRemoval() == enable_removal) return true; - return ScriptObject::DoCommand(0, 0, enable_removal ? 1 : 0, CMD_CHANGE_COMPANY_SETTING, "company.renew_keep_length"); + return ScriptObject::Command::Do(0, 0, enable_removal ? 1 : 0, "company.renew_keep_length"); } /* static */ bool ScriptGroup::HasWagonRemoval() @@ -140,7 +143,7 @@ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL); EnforcePrecondition(false, ScriptEngine::IsBuildable(engine_id_new)); - return ScriptObject::DoCommand(0, group_id << 16, (engine_id_new << 16) | engine_id_old, CMD_SET_AUTOREPLACE); + return ScriptObject::Command::Do(0, group_id << 16, (engine_id_new << 16) | engine_id_old, {}); } /* static */ EngineID ScriptGroup::GetEngineReplacement(GroupID group_id, EngineID engine_id) @@ -154,7 +157,7 @@ { EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL); - return ScriptObject::DoCommand(0, group_id << 16, (::INVALID_ENGINE << 16) | engine_id, CMD_SET_AUTOREPLACE); + return ScriptObject::Command::Do(0, group_id << 16, (::INVALID_ENGINE << 16) | engine_id, {}); } /* static */ Money ScriptGroup::GetProfitThisYear(GroupID group_id) @@ -204,14 +207,14 @@ { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::DoCommand(0, group_id, colour << 16, CMD_SET_GROUP_LIVERY); + return ScriptObject::Command::Do(0, group_id, colour << 16, {}); } /* static */ bool ScriptGroup::SetSecondaryColour(GroupID group_id, ScriptCompany::Colours colour) { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::DoCommand(0, group_id, (1 << 8) | (colour << 16), CMD_SET_GROUP_LIVERY); + return ScriptObject::Command::Do(0, group_id, (1 << 8) | (colour << 16), {}); } /* static */ ScriptCompany::Colours ScriptGroup::GetPrimaryColour(GroupID group_id) diff --git a/src/script/api/script_industry.cpp b/src/script/api/script_industry.cpp index 6f54fda14c..afcaee5547 100644 --- a/src/script/api/script_industry.cpp +++ b/src/script/api/script_industry.cpp @@ -19,6 +19,7 @@ #include "../../strings_func.h" #include "../../station_base.h" #include "../../newgrf_industries.h" +#include "../../industry_cmd.h" #include "table/strings.h" #include @@ -59,7 +60,7 @@ } EnforcePrecondition(false, IsValidIndustry(industry_id)); - return ScriptObject::DoCommand(0, industry_id, static_cast(IndustryAction::SetText), CMD_INDUSTRY_CTRL, encoded_text); + return ScriptObject::Command::Do(0, industry_id, static_cast(IndustryAction::SetText), std::string{ encoded_text ? encoded_text : "" }); } /* static */ ScriptIndustry::CargoAcceptState ScriptIndustry::IsCargoAccepted(IndustryID industry_id, CargoID cargo_id) @@ -257,7 +258,7 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag if (ScriptObject::GetCompany() != OWNER_DEITY) return false; if (!IsValidIndustry(industry_id)) return false; - return ScriptObject::DoCommand(0, industry_id, 0 | ((control_flags & ::INDCTL_MASK) << 8), CMD_INDUSTRY_CTRL); + return ScriptObject::Command::Do(0, industry_id, 0 | ((control_flags & ::INDCTL_MASK) << 8), {}); } /* static */ ScriptCompany::CompanyID ScriptIndustry::GetExclusiveSupplier(IndustryID industry_id) @@ -276,7 +277,7 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag auto company = ScriptCompany::ResolveCompanyID(company_id); ::Owner owner = (company == ScriptCompany::COMPANY_INVALID ? ::INVALID_OWNER : (::Owner)company); - return ScriptObject::DoCommand(0, industry_id, 1 | (((uint8)owner) << 16), CMD_INDUSTRY_CTRL); + return ScriptObject::Command::Do(0, industry_id, 1 | (((uint8)owner) << 16), {}); } /* static */ ScriptCompany::CompanyID ScriptIndustry::GetExclusiveConsumer(IndustryID industry_id) @@ -295,5 +296,5 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag auto company = ScriptCompany::ResolveCompanyID(company_id); ::Owner owner = (company == ScriptCompany::COMPANY_INVALID ? ::INVALID_OWNER : (::Owner)company); - return ScriptObject::DoCommand(0, industry_id, 2 | (((uint8)owner) << 16), CMD_INDUSTRY_CTRL); + return ScriptObject::Command::Do(0, industry_id, 2 | (((uint8)owner) << 16), {}); } diff --git a/src/script/api/script_industrytype.cpp b/src/script/api/script_industrytype.cpp index ad1ee4feda..ebe28c4067 100644 --- a/src/script/api/script_industrytype.cpp +++ b/src/script/api/script_industrytype.cpp @@ -15,6 +15,7 @@ #include "../../industry.h" #include "../../newgrf_industries.h" #include "../../core/random_func.hpp" +#include "../../industry_cmd.h" #include "../../safeguards.h" @@ -122,7 +123,7 @@ uint32 seed = ::InteractiveRandom(); uint32 layout_index = ::InteractiveRandomRange((uint32)::GetIndustrySpec(industry_type)->layouts.size()); - return ScriptObject::DoCommand(tile, (1 << 16) | (layout_index << 8) | industry_type, seed, CMD_BUILD_INDUSTRY); + return ScriptObject::Command::Do(tile, (1 << 16) | (layout_index << 8) | industry_type, seed, {}); } /* static */ bool ScriptIndustryType::ProspectIndustry(IndustryType industry_type) @@ -130,7 +131,7 @@ EnforcePrecondition(false, CanProspectIndustry(industry_type)); uint32 seed = ::InteractiveRandom(); - return ScriptObject::DoCommand(0, industry_type, seed, CMD_BUILD_INDUSTRY); + return ScriptObject::Command::Do(0, industry_type, seed, {}); } /* static */ bool ScriptIndustryType::IsBuiltOnWater(IndustryType industry_type) diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp index 16f0228dbe..f368ec9185 100644 --- a/src/script/api/script_marine.cpp +++ b/src/script/api/script_marine.cpp @@ -11,7 +11,12 @@ #include "script_marine.hpp" #include "script_station.hpp" #include "../../station_base.h" +#include "../../dock_cmd.h" +#include "../../landscape_cmd.h" +#include "../../station_cmd.h" #include "../../tile_cmd.h" +#include "../../water_cmd.h" +#include "../../waypoint_cmd.h" #include "../../safeguards.h" @@ -78,7 +83,7 @@ EnforcePrecondition(false, ::IsValidTile(front)); EnforcePrecondition(false, (::TileX(front) == ::TileX(tile)) != (::TileY(front) == ::TileY(tile))); - return ScriptObject::DoCommand(tile, ::TileX(front) == ::TileX(tile), 0, CMD_BUILD_SHIP_DEPOT); + return ScriptObject::Command::Do(tile, ::TileX(front) == ::TileX(tile), 0, {}); } /* static */ bool ScriptMarine::BuildDock(TileIndex tile, StationID station_id) @@ -89,7 +94,7 @@ uint p1 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 1; uint p2 = (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::DoCommand(tile, p1, p2, CMD_BUILD_DOCK); + return ScriptObject::Command::Do(tile, p1, p2, {}); } /* static */ bool ScriptMarine::BuildBuoy(TileIndex tile) @@ -97,7 +102,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_BUILD_BUOY); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::BuildLock(TileIndex tile) @@ -105,7 +110,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_BUILD_LOCK); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::BuildCanal(TileIndex tile) @@ -113,7 +118,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, tile, WATER_CLASS_CANAL, CMD_BUILD_CANAL); + return ScriptObject::Command::Do(tile, tile, WATER_CLASS_CANAL, {}); } /* static */ bool ScriptMarine::RemoveWaterDepot(TileIndex tile) @@ -122,7 +127,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsWaterDepotTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveDock(TileIndex tile) @@ -131,7 +136,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsDockTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveBuoy(TileIndex tile) @@ -140,7 +145,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsBuoyTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveLock(TileIndex tile) @@ -149,7 +154,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsLockTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveCanal(TileIndex tile) @@ -158,7 +163,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsCanalTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ Money ScriptMarine::GetBuildCost(BuildType build_type) diff --git a/src/script/api/script_news.cpp b/src/script/api/script_news.cpp index 678cc69852..7f46f5aa6c 100644 --- a/src/script/api/script_news.cpp +++ b/src/script/api/script_news.cpp @@ -16,6 +16,7 @@ #include "script_error.hpp" #include "../../command_type.h" #include "../../string_func.h" +#include "../../news_cmd.h" #include "../../safeguards.h" @@ -38,5 +39,5 @@ if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; if (ref_type == NR_NONE) reference = 0; - return ScriptObject::DoCommand(0, type | (ref_type << 8) | (c << 16), reference, CMD_CUSTOM_NEWS_ITEM, encoded); + return ScriptObject::Command::Do(0, type | (ref_type << 8) | (c << 16), reference, encoded); } diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index c63d2a2ea8..de4fab481b 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -296,38 +296,34 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->callback_value[index]; } -/* static */ bool ScriptObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd, const char *text, Script_SuspendCallbackProc *callback) +/* static */ CommandCallback *ScriptObject::GetDoCommandCallback() +{ + return ScriptObject::GetActiveInstance()->GetDoCommandCallback(); +} + +std::tuple ScriptObject::DoCommandPrep() { if (!ScriptObject::CanSuspend()) { throw Script_FatalError("You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator."); } - if (ScriptObject::GetCompany() != OWNER_DEITY && !::Company::IsValidID(ScriptObject::GetCompany())) { - ScriptObject::SetLastError(ScriptError::ERR_PRECONDITION_INVALID_COMPANY); - return false; - } - - std::string command_text = text == nullptr ? std::string{} : text; - if (!command_text.empty() && (GetCommandFlags(cmd) & CMD_STR_CTRL) == 0) { - /* The string must be valid, i.e. not contain special codes. Since some - * can be made with GSText, make sure the control codes are removed. */ - command_text = ::StrMakeValid(command_text, SVS_NONE); - } - - /* Set the default callback to return a true/false result of the DoCommand */ - if (callback == nullptr) callback = &ScriptInstance::DoCommandReturn; - /* Are we only interested in the estimate costs? */ bool estimate_only = GetDoCommandMode() != nullptr && !GetDoCommandMode()(); - /* Only set p2 when the command does not come from the network. */ - if (GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = UINT32_MAX; + bool networking = _networking && !_generating_world; - /* Store the command for command callback validation. */ - if (!estimate_only && _networking && !_generating_world) SetLastCommand(tile, EndianBufferWriter::FromValue(std::make_tuple(tile, p1, p2, command_text)), cmd); + if (ScriptObject::GetCompany() != OWNER_DEITY && !::Company::IsValidID(ScriptObject::GetCompany())) { + ScriptObject::SetLastError(ScriptError::ERR_PRECONDITION_INVALID_COMPANY); + return { true, estimate_only, networking }; + } - /* Try to perform the command. */ - CommandCost res = ::DoCommandPInternal(cmd, STR_NULL, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, false, estimate_only, false, tile, p1, p2, command_text); + return { false, estimate_only, networking }; +} + +bool ScriptObject::DoCommandProcessResult(const CommandCost &res, Script_SuspendCallbackProc *callback, bool estimate_only) +{ + /* Set the default callback to return a true/false result of the DoCommand */ + if (callback == nullptr) callback = &ScriptInstance::DoCommandReturn; /* We failed; set the error and bail out */ if (res.Failed()) { diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index 40c8eaf854..cfb6d393a4 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -13,7 +13,8 @@ #include "../../misc/countedptr.hpp" #include "../../road_type.h" #include "../../rail_type.h" -#include "../../command_type.h" +#include "../../string_func.h" +#include "../../command_func.h" #include "script_types.hpp" #include "../script_suspend.hpp" @@ -67,10 +68,32 @@ public: static class ScriptInstance *GetActiveInstance(); protected: + template struct ScriptDoCommandHelper; + /** - * Executes a raw DoCommand for the script. + * Templated wrapper that exposes the command parameter arguments + * on the various DoCommand calls. + * @tparam Tcmd The command-id to execute. + * @tparam Targs The command parameter types. */ - static bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, Commands cmd, const char *text = nullptr, Script_SuspendCallbackProc *callback = nullptr); + template + struct ScriptDoCommandHelper { + static bool Do(Script_SuspendCallbackProc *callback, Targs... args) + { + return Execute(callback, std::forward_as_tuple(args...)); + } + + static bool Do(Targs... args) + { + return Execute(nullptr, std::forward_as_tuple(args...)); + } + + private: + static bool Execute(Script_SuspendCallbackProc *callback, std::tuple args); + }; + + template + using Command = ScriptDoCommandHelper::ProcType>; /** * Store the latest command executed by the script. @@ -299,6 +322,58 @@ private: * @param story_page_id The new StoryPageID. */ static void SetNewStoryPageElementID(StoryPageElementID story_page_element_id); + + /* Helper functions for DoCommand. */ + static std::tuple DoCommandPrep(); + static bool DoCommandProcessResult(const CommandCost &res, Script_SuspendCallbackProc *callback, bool estimate_only); + static CommandCallback *GetDoCommandCallback(); }; +namespace ScriptObjectInternal { + /** Validate a single string argument coming from network. */ + template + static inline void SanitizeSingleStringHelper(T &data) + { + if constexpr (std::is_same_v) { + /* The string must be valid, i.e. not contain special codes. Since some + * can be made with GSText, make sure the control codes are removed. */ + data = ::StrMakeValid(data, SVS_NONE); + } + } + + /** Helper function to perform validation on command data strings. */ + template + static inline void SanitizeStringsHelper(Ttuple &values, std::index_sequence) + { + ((SanitizeSingleStringHelper(std::get(values))), ...); + } +} + +template +bool ScriptObject::ScriptDoCommandHelper::Execute(Script_SuspendCallbackProc *callback, std::tuple args) +{ + auto [err, estimate_only, networking] = ScriptObject::DoCommandPrep(); + if (err) return false; + + if ((::GetCommandFlags() & CMD_STR_CTRL) == 0) { + ScriptObjectInternal::SanitizeStringsHelper(args, std::index_sequence_for{}); + } + + TileIndex tile{}; + if constexpr (std::is_same_v>) { + tile = std::get<0>(args); + } + + /* Only set p2 when the command does not come from the network. */ + if ((::GetCommandFlags() & CMD_CLIENT_ID) != 0 && std::get<2>(args) == 0) std::get<2>(args) = UINT32_MAX; + + /* Store the command for command callback validation. */ + if (!estimate_only && networking) ScriptObject::SetLastCommand(tile, EndianBufferWriter::FromValue(args), Tcmd); + + /* Try to perform the command. */ + CommandCost res = std::apply(&DoCommandPInternal, std::tuple_cat(std::make_tuple(Tcmd, (StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, false), args)); + + return ScriptObject::DoCommandProcessResult(res, callback, estimate_only); +} + #endif /* SCRIPT_OBJECT_HPP */ diff --git a/src/script/api/script_objecttype.cpp b/src/script/api/script_objecttype.cpp index 27519a664f..a4a8ef9843 100644 --- a/src/script/api/script_objecttype.cpp +++ b/src/script/api/script_objecttype.cpp @@ -13,6 +13,7 @@ #include "script_error.hpp" #include "script_map.hpp" +#include "../../object_cmd.h" #include "../../safeguards.h" @@ -41,5 +42,5 @@ EnforcePrecondition(false, IsValidObjectType(object_type)); EnforcePrecondition(false, ScriptMap::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, object_type, view, CMD_BUILD_OBJECT); + return ScriptObject::Command::Do(tile, object_type, view, {}); } diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp index ce0ee76dee..8faec672f0 100644 --- a/src/script/api/script_order.cpp +++ b/src/script/api/script_order.cpp @@ -18,6 +18,7 @@ #include "../../depot_base.h" #include "../../station_base.h" #include "../../waypoint_base.h" +#include "../../order_cmd.h" #include "../../safeguards.h" @@ -379,7 +380,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, order_position != ORDER_CURRENT && IsConditionalOrder(vehicle_id, order_position)); EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, jump_to) && jump_to != ORDER_CURRENT); - return ScriptObject::DoCommand(0, vehicle_id | (order_position << 20), MOF_COND_DESTINATION | (jump_to << 4), CMD_MODIFY_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | (order_position << 20), MOF_COND_DESTINATION | (jump_to << 4), {}); } /* static */ bool ScriptOrder::SetOrderCondition(VehicleID vehicle_id, OrderPosition order_position, OrderCondition condition) @@ -389,7 +390,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, condition >= OC_LOAD_PERCENTAGE && condition <= OC_REMAINING_LIFETIME); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), MOF_COND_VARIABLE | (condition << 4), CMD_MODIFY_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), MOF_COND_VARIABLE | (condition << 4), {}); } /* static */ bool ScriptOrder::SetOrderCompareFunction(VehicleID vehicle_id, OrderPosition order_position, CompareFunction compare) @@ -399,7 +400,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, compare >= CF_EQUALS && compare <= CF_IS_FALSE); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), MOF_COND_COMPARATOR | (compare << 4), CMD_MODIFY_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), MOF_COND_COMPARATOR | (compare << 4), {}); } /* static */ bool ScriptOrder::SetOrderCompareValue(VehicleID vehicle_id, OrderPosition order_position, int32 value) @@ -410,7 +411,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr if (GetOrderCondition(vehicle_id, order_position) == OC_MAX_SPEED) value = value * 10 / 16; int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), MOF_COND_VALUE | (value << 4), CMD_MODIFY_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), MOF_COND_VALUE | (value << 4), {}); } /* static */ bool ScriptOrder::SetStopLocation(VehicleID vehicle_id, OrderPosition order_position, StopLocation stop_location) @@ -425,7 +426,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); uint32 p1 = vehicle_id | (order_pos << 20); uint32 p2 = MOF_STOP_LOCATION | (stop_location << 4); - return ScriptObject::DoCommand(0, p1, p2, CMD_MODIFY_ORDER); + return ScriptObject::Command::Do(0, p1, p2, {}); } /* static */ bool ScriptOrder::SetOrderRefit(VehicleID vehicle_id, OrderPosition order_position, CargoID refit_cargo) @@ -436,7 +437,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr uint32 p1 = vehicle_id; uint32 p2 = refit_cargo | ScriptOrderPositionToRealOrderPosition(vehicle_id, ScriptOrder::ResolveOrderPosition(vehicle_id, order_position)) << 16; - return ScriptObject::DoCommand(0, p1, p2, CMD_ORDER_REFIT); + return ScriptObject::Command::Do(0, p1, p2, {}); } /* static */ bool ScriptOrder::AppendOrder(VehicleID vehicle_id, TileIndex destination, ScriptOrderFlags order_flags) @@ -506,7 +507,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr order.SetNonStopType((OrderNonStopFlags)GB(order_flags, 0, 2)); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), order.Pack(), CMD_INSERT_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), order.Pack(), {}); } /* static */ bool ScriptOrder::InsertConditionalOrder(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to) @@ -522,7 +523,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr order.MakeConditional(jump_to); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), order.Pack(), CMD_INSERT_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), order.Pack(), {}); } /* static */ bool ScriptOrder::RemoveOrder(VehicleID vehicle_id, OrderPosition order_position) @@ -532,7 +533,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position)); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::DoCommand(0, vehicle_id, order_pos, CMD_DELETE_ORDER); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, {}); } /* static */ bool ScriptOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order) @@ -542,7 +543,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order)); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, next_order); - return ScriptObject::DoCommand(0, vehicle_id, order_pos, CMD_SKIP_TO_ORDER); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, {}); } /** @@ -586,7 +587,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, (order_flags & OF_GOTO_NEAREST_DEPOT) == (current & OF_GOTO_NEAREST_DEPOT)); if ((current & OF_NON_STOP_FLAGS) != (order_flags & OF_NON_STOP_FLAGS)) { - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), (order_flags & OF_NON_STOP_FLAGS) << 4 | MOF_NON_STOP, CMD_MODIFY_ORDER, nullptr, &::_DoCommandReturnSetOrderFlags); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (order_flags & OF_NON_STOP_FLAGS) << 4 | MOF_NON_STOP, {}); } switch (order->GetType()) { @@ -595,16 +596,16 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) uint data = DA_ALWAYS_GO; if (order_flags & OF_SERVICE_IF_NEEDED) data = DA_SERVICE; if (order_flags & OF_STOP_IN_DEPOT) data = DA_STOP; - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), (data << 4) | MOF_DEPOT_ACTION, CMD_MODIFY_ORDER, nullptr, &::_DoCommandReturnSetOrderFlags); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (data << 4) | MOF_DEPOT_ACTION, {}); } break; case OT_GOTO_STATION: if ((current & OF_UNLOAD_FLAGS) != (order_flags & OF_UNLOAD_FLAGS)) { - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), (order_flags & OF_UNLOAD_FLAGS) << 2 | MOF_UNLOAD, CMD_MODIFY_ORDER, nullptr, &::_DoCommandReturnSetOrderFlags); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (order_flags & OF_UNLOAD_FLAGS) << 2 | MOF_UNLOAD, {}); } if ((current & OF_LOAD_FLAGS) != (order_flags & OF_LOAD_FLAGS)) { - return ScriptObject::DoCommand(0, vehicle_id | (order_pos << 20), (order_flags & OF_LOAD_FLAGS) >> 1 | MOF_LOAD, CMD_MODIFY_ORDER, nullptr, &::_DoCommandReturnSetOrderFlags); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (order_flags & OF_LOAD_FLAGS) >> 1 | MOF_LOAD, {}); } break; @@ -638,7 +639,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) int order_pos_move = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_move); int order_pos_target = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_target); - return ScriptObject::DoCommand(0, vehicle_id, order_pos_move | (order_pos_target << 16), CMD_MOVE_ORDER); + return ScriptObject::Command::Do(0, vehicle_id, order_pos_move | (order_pos_target << 16), {}); } /* static */ bool ScriptOrder::CopyOrders(VehicleID vehicle_id, VehicleID main_vehicle_id) @@ -646,7 +647,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(main_vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id | CO_COPY << 30, main_vehicle_id, CMD_CLONE_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | CO_COPY << 30, main_vehicle_id, {}); } /* static */ bool ScriptOrder::ShareOrders(VehicleID vehicle_id, VehicleID main_vehicle_id) @@ -654,14 +655,14 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(main_vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id | CO_SHARE << 30, main_vehicle_id, CMD_CLONE_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | CO_SHARE << 30, main_vehicle_id, {}); } /* static */ bool ScriptOrder::UnshareOrders(VehicleID vehicle_id) { EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id | CO_UNSHARE << 30, 0, CMD_CLONE_ORDER); + return ScriptObject::Command::Do(0, vehicle_id | CO_UNSHARE << 30, 0, {}); } /* static */ uint ScriptOrder::GetOrderDistance(ScriptVehicle::VehicleType vehicle_type, TileIndex origin_tile, TileIndex dest_tile) diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp index 8668906c28..ebba16343c 100644 --- a/src/script/api/script_rail.cpp +++ b/src/script/api/script_rail.cpp @@ -18,6 +18,9 @@ #include "../../newgrf_generic.h" #include "../../newgrf_station.h" #include "../../strings_func.h" +#include "../../rail_cmd.h" +#include "../../station_cmd.h" +#include "../../waypoint_cmd.h" #include "../../safeguards.h" @@ -113,7 +116,7 @@ EnforcePrecondition(false, ::IsValidTile(end_tile)); EnforcePrecondition(false, IsRailTypeAvailable(convert_to)); - return ScriptObject::DoCommand(start_tile, end_tile, convert_to, CMD_CONVERT_RAIL); + return ScriptObject::Command::Do(start_tile, end_tile, convert_to, {}); } /* static */ TileIndex ScriptRail::GetRailDepotFrontTile(TileIndex depot) @@ -141,7 +144,7 @@ uint entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0); - return ScriptObject::DoCommand(tile, ScriptObject::GetRailType(), entrance_dir, CMD_BUILD_TRAIN_DEPOT); + return ScriptObject::Command::Do(tile, ScriptObject::GetRailType(), entrance_dir, {}); } /* static */ bool ScriptRail::BuildRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id) @@ -157,7 +160,7 @@ uint32 p1 = GetCurrentRailType() | (platform_length << 16) | (num_platforms << 8); if (direction == RAILTRACK_NW_SE) p1 |= (1 << 6); if (station_id != ScriptStation::STATION_JOIN_ADJACENT) p1 |= (1 << 24); - return ScriptObject::DoCommand(tile, p1, (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16, CMD_BUILD_RAIL_STATION); + return ScriptObject::Command::Do(tile, p1, (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16, {}); } /* static */ bool ScriptRail::BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station) @@ -198,11 +201,11 @@ Debug(grf, 1, "{} returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename); } else { /* We might have gotten an usable station spec. Try to build it, but if it fails we'll fall back to the original station. */ - if (ScriptObject::DoCommand(tile, p1, p2 | spec->cls_id | index << 8, CMD_BUILD_RAIL_STATION)) return true; + if (ScriptObject::Command::Do(tile, p1, p2 | spec->cls_id | index << 8, {})) return true; } } - return ScriptObject::DoCommand(tile, p1, p2, CMD_BUILD_RAIL_STATION); + return ScriptObject::Command::Do(tile, p1, p2, {}); } /* static */ bool ScriptRail::BuildRailWaypoint(TileIndex tile) @@ -213,7 +216,7 @@ EnforcePrecondition(false, GetRailTracks(tile) == RAILTRACK_NE_SW || GetRailTracks(tile) == RAILTRACK_NW_SE); EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); - return ScriptObject::DoCommand(tile, GetCurrentRailType() | (GetRailTracks(tile) == RAILTRACK_NE_SW ? AXIS_X : AXIS_Y) << 6 | 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16, CMD_BUILD_RAIL_WAYPOINT); + return ScriptObject::Command::Do(tile, GetCurrentRailType() | (GetRailTracks(tile) == RAILTRACK_NE_SW ? AXIS_X : AXIS_Y) << 6 | 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16, {}); } /* static */ bool ScriptRail::RemoveRailWaypointTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail) @@ -222,7 +225,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, ::IsValidTile(tile2)); - return ScriptObject::DoCommand(tile, tile2, keep_rail ? 1 : 0, CMD_REMOVE_FROM_RAIL_WAYPOINT); + return ScriptObject::Command::Do(tile, tile2, keep_rail ? 1 : 0, {}); } /* static */ bool ScriptRail::RemoveRailStationTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail) @@ -231,7 +234,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, ::IsValidTile(tile2)); - return ScriptObject::DoCommand(tile, tile2, keep_rail ? 1 : 0, CMD_REMOVE_FROM_RAIL_STATION); + return ScriptObject::Command::Do(tile, tile2, keep_rail ? 1 : 0, {}); } /* static */ uint ScriptRail::GetRailTracks(TileIndex tile) @@ -253,7 +256,7 @@ EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0); EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); - return ScriptObject::DoCommand(tile, tile, GetCurrentRailType() | (FindFirstTrack((::TrackBits)rail_track) << 6), CMD_BUILD_RAILROAD_TRACK); + return ScriptObject::Command::Do(tile, tile, GetCurrentRailType() | (FindFirstTrack((::TrackBits)rail_track) << 6), {}); } /* static */ bool ScriptRail::RemoveRailTrack(TileIndex tile, RailTrack rail_track) @@ -264,7 +267,7 @@ EnforcePrecondition(false, GetRailTracks(tile) & rail_track); EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0); - return ScriptObject::DoCommand(tile, tile, FindFirstTrack((::TrackBits)rail_track) << 6, CMD_REMOVE_RAILROAD_TRACK); + return ScriptObject::Command::Do(tile, tile, FindFirstTrack((::TrackBits)rail_track) << 6, {}); } /* static */ bool ScriptRail::AreTilesConnected(TileIndex from, TileIndex tile, TileIndex to) @@ -365,7 +368,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) (::TileY(from) == ::TileY(tile) && ::TileY(tile) == ::TileY(to))); uint32 p2 = SimulateDrag(from, tile, &to) | 1 << 10 | ScriptRail::GetCurrentRailType();; - return ScriptObject::DoCommand(tile, to, p2, CMD_BUILD_RAILROAD_TRACK); + return ScriptObject::Command::Do(tile, to, p2, {}); } /* static */ bool ScriptRail::RemoveRail(TileIndex from, TileIndex tile, TileIndex to) @@ -382,7 +385,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) (::TileY(from) == ::TileY(tile) && ::TileY(tile) == ::TileY(to))); uint32 p2 = SimulateDrag(from, tile, &to); - return ScriptObject::DoCommand(tile, to, p2, CMD_REMOVE_RAILROAD_TRACK); + return ScriptObject::Command::Do(tile, to, p2, {}); } /** @@ -468,7 +471,7 @@ static bool IsValidSignalType(int signal_type) } p1 |= ((signal >= SIGNALTYPE_TWOWAY ? signal ^ SIGNALTYPE_TWOWAY : signal) << 5); - return ScriptObject::DoCommand(tile, p1, 0, CMD_BUILD_SIGNALS); + return ScriptObject::Command::Do(tile, p1, 0, {}); } /* static */ bool ScriptRail::RemoveSignal(TileIndex tile, TileIndex front) @@ -487,7 +490,7 @@ static bool IsValidSignalType(int signal_type) } EnforcePrecondition(false, track != INVALID_TRACK); - return ScriptObject::DoCommand(tile, track, 0, CMD_REMOVE_SIGNALS); + return ScriptObject::Command::Do(tile, track, 0, {}); } /* static */ Money ScriptRail::GetBuildCost(RailType railtype, BuildType build_type) diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp index e1549b0d77..26cdb5190a 100644 --- a/src/script/api/script_road.cpp +++ b/src/script/api/script_road.cpp @@ -12,6 +12,9 @@ #include "script_station.hpp" #include "script_cargo.hpp" #include "../../station_base.h" +#include "../../landscape_cmd.h" +#include "../../road_cmd.h" +#include "../../station_cmd.h" #include "../../script/squirrel_helper_type.hpp" #include "../../safeguards.h" @@ -126,7 +129,7 @@ EnforcePrecondition(false, ::IsValidTile(end_tile)); EnforcePrecondition(false, IsRoadTypeAvailable(road_type)); - return ScriptObject::DoCommand(start_tile, end_tile, (::RoadType)road_type, CMD_CONVERT_ROAD); + return ScriptObject::Command::Do(start_tile, end_tile, (::RoadType)road_type, {}); } /* Helper functions for ScriptRoad::CanBuildConnectedRoadParts(). */ @@ -492,7 +495,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, !one_way || RoadTypeIsRoad(ScriptObject::GetRoadType())); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - return ScriptObject::DoCommand(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (ScriptObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 10) | 1 << 11, CMD_BUILD_LONG_ROAD); + return ScriptObject::Command::Do(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (ScriptObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 10) | 1 << 11, {}); } /* static */ bool ScriptRoad::BuildRoad(TileIndex start, TileIndex end) @@ -528,7 +531,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD uint entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0); - return ScriptObject::DoCommand(tile, entrance_dir | (ScriptObject::GetRoadType() << 2), 0, CMD_BUILD_ROAD_DEPOT); + return ScriptObject::Command::Do(tile, entrance_dir | (ScriptObject::GetRoadType() << 2), 0, {}); } /* static */ bool ScriptRoad::_BuildRoadStationInternal(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, bool drive_through, StationID station_id) @@ -555,7 +558,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD p2 |= ScriptObject::GetRoadType() << 5; p2 |= entrance_dir << 3; p2 |= (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::DoCommand(tile, 1 | 1 << 8, p2, CMD_BUILD_ROAD_STOP); + return ScriptObject::Command::Do(tile, 1 | 1 << 8, p2, {}); } /* static */ bool ScriptRoad::BuildRoadStation(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, StationID station_id) @@ -577,7 +580,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - return ScriptObject::DoCommand(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 1 : 2) | (ScriptObject::GetRoadType() << 3), CMD_REMOVE_LONG_ROAD); + return ScriptObject::Command::Do(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 1 : 2) | (ScriptObject::GetRoadType() << 3), {}); } /* static */ bool ScriptRoad::RemoveRoadFull(TileIndex start, TileIndex end) @@ -589,7 +592,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - return ScriptObject::DoCommand(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 2 : 1) | (ScriptObject::GetRoadType() << 3), CMD_REMOVE_LONG_ROAD); + return ScriptObject::Command::Do(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 2 : 1) | (ScriptObject::GetRoadType() << 3), {}); } /* static */ bool ScriptRoad::RemoveRoadDepot(TileIndex tile) @@ -599,7 +602,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, IsTileType(tile, MP_ROAD)) EnforcePrecondition(false, GetRoadTileType(tile) == ROAD_TILE_DEPOT); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptRoad::RemoveRoadStation(TileIndex tile) @@ -609,7 +612,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, IsTileType(tile, MP_STATION)); EnforcePrecondition(false, IsRoadStop(tile)); - return ScriptObject::DoCommand(tile, 1 | 1 << 8, GetRoadStopType(tile), CMD_REMOVE_ROAD_STOP); + return ScriptObject::Command::Do(tile, 1 | 1 << 8, GetRoadStopType(tile), {}); } /* static */ Money ScriptRoad::GetBuildCost(RoadType roadtype, BuildType build_type) diff --git a/src/script/api/script_sign.cpp b/src/script/api/script_sign.cpp index 8908941cf7..6062497f0c 100644 --- a/src/script/api/script_sign.cpp +++ b/src/script/api/script_sign.cpp @@ -15,6 +15,7 @@ #include "../../string_func.h" #include "../../strings_func.h" #include "../../tile_map.h" +#include "../../signs_cmd.h" #include "../../safeguards.h" @@ -41,7 +42,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, text); + return ScriptObject::Command::Do(0, sign_id, 0, text); } /* static */ char *ScriptSign::GetName(SignID sign_id) @@ -63,7 +64,7 @@ /* static */ bool ScriptSign::RemoveSign(SignID sign_id) { EnforcePrecondition(false, IsValidSign(sign_id)); - return ScriptObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, ""); + return ScriptObject::Command::Do(0, sign_id, 0, ""); } /* static */ SignID ScriptSign::BuildSign(TileIndex location, Text *name) @@ -76,7 +77,7 @@ EnforcePreconditionEncodedText(INVALID_SIGN, text); EnforcePreconditionCustomError(INVALID_SIGN, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - if (!ScriptObject::DoCommand(location, 0, 0, CMD_PLACE_SIGN, text, &ScriptInstance::DoCommandReturnSignID)) return INVALID_SIGN; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnSignID, location, 0, 0, text)) return INVALID_SIGN; /* In case of test-mode, we return SignID 0 */ return 0; diff --git a/src/script/api/script_station.cpp b/src/script/api/script_station.cpp index a45c19d0d9..34e7d84341 100644 --- a/src/script/api/script_station.cpp +++ b/src/script/api/script_station.cpp @@ -15,6 +15,7 @@ #include "../../station_base.h" #include "../../roadstop_base.h" #include "../../town.h" +#include "../../station_cmd.h" #include "../../safeguards.h" @@ -239,5 +240,5 @@ template EnforcePrecondition(false, IsValidStation(station_id)); EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT)); - return ScriptObject::DoCommand(0, station_id, 0, CMD_OPEN_CLOSE_AIRPORT); + return ScriptObject::Command::Do(0, station_id, 0, {}); } diff --git a/src/script/api/script_story_page.cpp b/src/script/api/script_story_page.cpp index 4ee90e218d..afa2590414 100644 --- a/src/script/api/script_story_page.cpp +++ b/src/script/api/script_story_page.cpp @@ -19,6 +19,7 @@ #include "../../goal_base.h" #include "../../string_func.h" #include "../../tile_map.h" +#include "../../story_cmd.h" #include "../../safeguards.h" @@ -47,12 +48,11 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) uint8 c = company; if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; - if (!ScriptObject::DoCommand(0, + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnStoryPageID, + 0, c, 0, - CMD_CREATE_STORY_PAGE, - title != nullptr? title->GetEncodedText() : nullptr, - &ScriptInstance::DoCommandReturnStoryPageID)) return STORY_PAGE_INVALID; + title != nullptr ? std::string{ title->GetEncodedText() } : std::string{})) return STORY_PAGE_INVALID; /* In case of test-mode, we return StoryPageID 0 */ return (ScriptStoryPage::StoryPageID)0; @@ -89,12 +89,11 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) NOT_REACHED(); } - if (!ScriptObject::DoCommand(reftile, + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnStoryPageElementID, + reftile, story_page_id + (type << 16), refid, - CMD_CREATE_STORY_PAGE_ELEMENT, - StoryPageElementTypeRequiresText(btype) ? text->GetEncodedText() : nullptr, - &ScriptInstance::DoCommandReturnStoryPageElementID)) return STORY_PAGE_ELEMENT_INVALID; + StoryPageElementTypeRequiresText(btype) ? std::string{ text->GetEncodedText() } : std::string{})) return STORY_PAGE_ELEMENT_INVALID; /* In case of test-mode, we return StoryPageElementID 0 */ return (ScriptStoryPage::StoryPageElementID)0; @@ -134,11 +133,10 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) NOT_REACHED(); } - return ScriptObject::DoCommand(reftile, + return ScriptObject::Command::Do(reftile, story_page_element_id, refid, - CMD_UPDATE_STORY_PAGE_ELEMENT, - StoryPageElementTypeRequiresText(type) ? text->GetEncodedText() : nullptr); + StoryPageElementTypeRequiresText(type) ? std::string{ text->GetEncodedText() } : std::string{}); } /* static */ uint32 ScriptStoryPage::GetPageSortValue(StoryPageID story_page_id) @@ -162,7 +160,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, IsValidStoryPage(story_page_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::DoCommand(0, story_page_id, 0, CMD_SET_STORY_PAGE_TITLE, title != nullptr? title->GetEncodedText() : nullptr); + return ScriptObject::Command::Do(0, story_page_id, 0, title != nullptr ? std::string{ title->GetEncodedText() } : std::string{}); } /* static */ ScriptCompany::CompanyID ScriptStoryPage::GetCompany(StoryPageID story_page_id) @@ -188,7 +186,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, IsValidStoryPage(story_page_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::DoCommand(0, story_page_id, date, CMD_SET_STORY_PAGE_DATE, nullptr); + return ScriptObject::Command::Do(0, story_page_id, date, {}); } @@ -197,7 +195,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, IsValidStoryPage(story_page_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::DoCommand(0, story_page_id, 0, CMD_SHOW_STORY_PAGE); + return ScriptObject::Command::Do(0, story_page_id, 0, {}); } /* static */ bool ScriptStoryPage::Remove(StoryPageID story_page_id) @@ -205,7 +203,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, IsValidStoryPage(story_page_id)); - return ScriptObject::DoCommand(0, story_page_id, 0, CMD_REMOVE_STORY_PAGE); + return ScriptObject::Command::Do(0, story_page_id, 0, {}); } /* static */ bool ScriptStoryPage::RemoveElement(StoryPageElementID story_page_element_id) @@ -213,7 +211,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, IsValidStoryPageElement(story_page_element_id)); - return ScriptObject::DoCommand(0, story_page_element_id, 0, CMD_REMOVE_STORY_PAGE_ELEMENT); + return ScriptObject::Command::Do(0, story_page_element_id, 0, {}); } /* static */ ScriptStoryPage::StoryPageButtonFormatting ScriptStoryPage::MakePushButtonReference(StoryPageButtonColour colour, StoryPageButtonFlags flags) diff --git a/src/script/api/script_subsidy.cpp b/src/script/api/script_subsidy.cpp index c8ca6e3e35..32962d1581 100644 --- a/src/script/api/script_subsidy.cpp +++ b/src/script/api/script_subsidy.cpp @@ -15,6 +15,7 @@ #include "script_error.hpp" #include "../../subsidy_base.h" #include "../../station_base.h" +#include "../../subsidy_cmd.h" #include "../../safeguards.h" @@ -38,7 +39,7 @@ EnforcePrecondition(false, (from_type == SPT_INDUSTRY && ScriptIndustry::IsValidIndustry(from_id)) || (from_type == SPT_TOWN && ScriptTown::IsValidTown(from_id))); EnforcePrecondition(false, (to_type == SPT_INDUSTRY && ScriptIndustry::IsValidIndustry(to_id)) || (to_type == SPT_TOWN && ScriptTown::IsValidTown(to_id))); - return ScriptObject::DoCommand(0, from_type | (from_id << 8) | (cargo_type << 24), to_type | (to_id << 8), CMD_CREATE_SUBSIDY); + return ScriptObject::Command::Do(0, from_type | (from_id << 8) | (cargo_type << 24), to_type | (to_id << 8), {}); } /* static */ ScriptCompany::CompanyID ScriptSubsidy::GetAwardedTo(SubsidyID subsidy_id) diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp index 90411a7f76..9e67b074a2 100644 --- a/src/script/api/script_tile.cpp +++ b/src/script/api/script_tile.cpp @@ -17,6 +17,9 @@ #include "../../tree_map.h" #include "../../town.h" #include "../../landscape.h" +#include "../../landscape_cmd.h" +#include "../../terraform_cmd.h" +#include "../../tree_cmd.h" #include "../../safeguards.h" @@ -252,7 +255,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, tile < ::MapSize()); - return ScriptObject::DoCommand(tile, slope, 1, CMD_TERRAFORM_LAND); + return ScriptObject::Command::Do(tile, slope, 1, {}); } /* static */ bool ScriptTile::LowerTile(TileIndex tile, int32 slope) @@ -260,7 +263,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, tile < ::MapSize()); - return ScriptObject::DoCommand(tile, slope, 0, CMD_TERRAFORM_LAND); + return ScriptObject::Command::Do(tile, slope, 0, {}); } /* static */ bool ScriptTile::LevelTiles(TileIndex start_tile, TileIndex end_tile) @@ -269,14 +272,14 @@ EnforcePrecondition(false, start_tile < ::MapSize()); EnforcePrecondition(false, end_tile < ::MapSize()); - return ScriptObject::DoCommand(end_tile, start_tile, LM_LEVEL << 1, CMD_LEVEL_LAND); + return ScriptObject::Command::Do(end_tile, start_tile, LM_LEVEL << 1, {}); } /* static */ bool ScriptTile::DemolishTile(TileIndex tile) { EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } /* static */ bool ScriptTile::PlantTree(TileIndex tile) @@ -284,7 +287,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, TREE_INVALID, tile, CMD_PLANT_TREE); + return ScriptObject::Command::Do(tile, TREE_INVALID, tile, {}); } /* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, uint width, uint height) @@ -295,7 +298,7 @@ EnforcePrecondition(false, height >= 1 && height <= 20); TileIndex end_tile = tile + ::TileDiffXY(width - 1, height - 1); - return ScriptObject::DoCommand(tile, TREE_INVALID, end_tile, CMD_PLANT_TREE); + return ScriptObject::Command::Do(tile, TREE_INVALID, end_tile, {}); } /* static */ bool ScriptTile::IsWithinTownInfluence(TileIndex tile, TownID town_id) diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp index 161cf74fd8..e3fb26e893 100644 --- a/src/script/api/script_town.cpp +++ b/src/script/api/script_town.cpp @@ -17,6 +17,7 @@ #include "../../strings_func.h" #include "../../station_base.h" #include "../../landscape.h" +#include "../../town_cmd.h" #include "table/strings.h" #include "../../safeguards.h" @@ -51,7 +52,7 @@ } EnforcePrecondition(false, IsValidTown(town_id)); - return ScriptObject::DoCommand(0, town_id, 0, CMD_RENAME_TOWN, text); + return ScriptObject::Command::Do(0, town_id, 0, text != nullptr ? std::string{ text } : std::string{}); } /* static */ bool ScriptTown::SetText(TownID town_id, Text *text) @@ -65,7 +66,7 @@ } EnforcePrecondition(false, IsValidTown(town_id)); - return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, encoded_text); + return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, 0, encoded_text != nullptr ? std::string{ encoded_text } : std::string{}); } /* static */ int32 ScriptTown::GetPopulation(TownID town_id) @@ -133,7 +134,7 @@ EnforcePrecondition(false, IsValidTown(town_id)); EnforcePrecondition(false, ScriptCargo::IsValidTownEffect(towneffect_id)); - return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id | (towneffect_id << 16), goal, CMD_TOWN_CARGO_GOAL); + return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id | (towneffect_id << 16), goal, {}); } /* static */ uint32 ScriptTown::GetCargoGoal(TownID town_id, ScriptCargo::TownEffect towneffect_id) @@ -176,7 +177,7 @@ break; } - return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, growth_rate, CMD_TOWN_GROWTH_RATE); + return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, growth_rate, {}); } /* static */ int32 ScriptTown::GetGrowthRate(TownID town_id) @@ -266,7 +267,7 @@ EnforcePrecondition(false, IsValidTown(town_id)); EnforcePrecondition(false, IsActionAvailable(town_id, town_action)); - return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, town_action, CMD_DO_TOWN_ACTION); + return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, town_action, {}); } /* static */ bool ScriptTown::ExpandTown(TownID town_id, int houses) @@ -275,7 +276,7 @@ EnforcePrecondition(false, IsValidTown(town_id)); EnforcePrecondition(false, houses > 0); - return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, houses, CMD_EXPAND_TOWN); + return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, houses, {}); } /* static */ bool ScriptTown::FoundTown(TileIndex tile, TownSize size, bool city, RoadLayout layout, Text *name) @@ -305,7 +306,7 @@ return false; } - return ScriptObject::DoCommand(tile, size | (city ? 1 << 2 : 0) | layout << 3, townnameparts, CMD_FOUND_TOWN, text); + return ScriptObject::Command::Do(tile, size | (city ? 1 << 2 : 0) | layout << 3, townnameparts, text != nullptr ? std::string{ text } : std::string{}); } /* static */ ScriptTown::TownRating ScriptTown::GetRating(TownID town_id, ScriptCompany::CompanyID company_id) @@ -360,7 +361,7 @@ uint16 p2 = 0; memcpy(&p2, &new_rating, sizeof(p2)); - return ScriptObject::DoCommand(0, town_id | (company_id << 16), p2, CMD_TOWN_RATING); + return ScriptObject::Command::Do(0, town_id | (company_id << 16), p2, {}); } /* static */ int ScriptTown::GetAllowedNoise(TownID town_id) diff --git a/src/script/api/script_tunnel.cpp b/src/script/api/script_tunnel.cpp index c47c64e40e..ea9cbc5186 100644 --- a/src/script/api/script_tunnel.cpp +++ b/src/script/api/script_tunnel.cpp @@ -12,6 +12,9 @@ #include "script_rail.hpp" #include "../script_instance.hpp" #include "../../tunnel_map.h" +#include "../../landscape_cmd.h" +#include "../../road_cmd.h" +#include "../../tunnelbridge_cmd.h" #include "../../safeguards.h" @@ -96,11 +99,11 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) /* For rail we do nothing special */ if (vehicle_type == ScriptVehicle::VT_RAIL) { - return ScriptObject::DoCommand(start, type, 0, CMD_BUILD_TUNNEL); + return ScriptObject::Command::Do(start, type, 0, {}); } ScriptObject::SetCallbackVariable(0, start); - return ScriptObject::DoCommand(start, type, 0, CMD_BUILD_TUNNEL, nullptr, &::_DoCommandReturnBuildTunnel1); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildTunnel1, start, type, 0, {}); } /* static */ bool ScriptTunnel::_BuildTunnelRoad1() @@ -112,7 +115,7 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::DoCommand(start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (ScriptObject::GetRoadType() << 4), 0, CMD_BUILD_ROAD, nullptr, &::_DoCommandReturnBuildTunnel2); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildTunnel2, start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (ScriptObject::GetRoadType() << 4), 0, {}); } /* static */ bool ScriptTunnel::_BuildTunnelRoad2() @@ -124,7 +127,7 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::DoCommand(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1) | (ScriptObject::GetRoadType() << 4), 0, CMD_BUILD_ROAD); + return ScriptObject::Command::Do(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1) | (ScriptObject::GetRoadType() << 4), 0, {}); } /* static */ bool ScriptTunnel::RemoveTunnel(TileIndex tile) @@ -132,5 +135,5 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsTunnelTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command::Do(tile, 0, 0, {}); } diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index a062616185..d245f41327 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -20,6 +20,8 @@ #include "../../train.h" #include "../../vehicle_func.h" #include "../../aircraft.h" +#include "../../roadveh_cmd.h" +#include "../../train_cmd.h" #include "../../vehicle_cmd.h" #include "table/strings.h" @@ -70,7 +72,7 @@ EnforcePreconditionCustomError(VEHICLE_INVALID, !ScriptGameSettings::IsDisabledVehicleType((ScriptVehicle::VehicleType)type), ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED); - if (!ScriptObject::DoCommand(depot, engine_id | (cargo << 24), 0, CMD_BUILD_VEHICLE, nullptr, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, engine_id | (cargo << 24), 0, {})) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; @@ -101,7 +103,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - if (!ScriptObject::DoCommand(depot, vehicle_id, share_orders, CMD_CLONE_VEHICLE, nullptr, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, vehicle_id, share_orders, {})) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; @@ -123,7 +125,7 @@ while (dest_wagon-- > 0) w = w->GetNextUnit(); } - return ScriptObject::DoCommand(0, v->index | (move_attached_wagons ? 1 : 0) << 20, w == nullptr ? ::INVALID_VEHICLE : w->index, CMD_MOVE_RAIL_VEHICLE); + return ScriptObject::Command::Do(0, v->index | (move_attached_wagons ? 1 : 0) << 20, w == nullptr ? ::INVALID_VEHICLE : w->index, {}); } /* static */ bool ScriptVehicle::MoveWagon(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon) @@ -150,7 +152,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id) && ScriptCargo::IsValidCargo(cargo)); - return ScriptObject::DoCommand(0, vehicle_id, cargo, CMD_REFIT_VEHICLE); + return ScriptObject::Command::Do(0, vehicle_id, cargo, {}); } @@ -160,7 +162,7 @@ EnforcePrecondition(false, IsValidVehicle(vehicle_id)); const Vehicle *v = ::Vehicle::Get(vehicle_id); - return ScriptObject::DoCommand(0, vehicle_id | (v->type == VEH_TRAIN ? 1 : 0) << 20, 0, CMD_SELL_VEHICLE); + return ScriptObject::Command::Do(0, vehicle_id | (v->type == VEH_TRAIN ? 1 : 0) << 20, 0, {}); } /* static */ bool ScriptVehicle::_SellWagonInternal(VehicleID vehicle_id, int wagon, bool sell_attached_wagons) @@ -172,7 +174,7 @@ const Train *v = ::Train::Get(vehicle_id); while (wagon-- > 0) v = v->GetNextUnit(); - return ScriptObject::DoCommand(0, v->index | (sell_attached_wagons ? 1 : 0) << 20, 0, CMD_SELL_VEHICLE); + return ScriptObject::Command::Do(0, v->index | (sell_attached_wagons ? 1 : 0) << 20, 0, {}); } /* static */ bool ScriptVehicle::SellWagon(VehicleID vehicle_id, int wagon) @@ -190,7 +192,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_SEND_VEHICLE_TO_DEPOT); + return ScriptObject::Command::Do(0, vehicle_id, 0, {}); } /* static */ bool ScriptVehicle::SendVehicleToDepotForServicing(VehicleID vehicle_id) @@ -198,7 +200,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id | DEPOT_SERVICE, 0, CMD_SEND_VEHICLE_TO_DEPOT); + return ScriptObject::Command::Do(0, vehicle_id | DEPOT_SERVICE, 0, {}); } /* static */ bool ScriptVehicle::IsInDepot(VehicleID vehicle_id) @@ -218,7 +220,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_START_STOP_VEHICLE); + return ScriptObject::Command::Do(0, vehicle_id, 0, {}); } /* static */ bool ScriptVehicle::ReverseVehicle(VehicleID vehicle_id) @@ -228,8 +230,8 @@ EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_ROAD || ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN); switch (::Vehicle::Get(vehicle_id)->type) { - case VEH_ROAD: return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_TURN_ROADVEH); - case VEH_TRAIN: return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_REVERSE_TRAIN_DIRECTION); + case VEH_ROAD: return ScriptObject::Command::Do(0, vehicle_id, 0, {}); + case VEH_TRAIN: return ScriptObject::Command::Do(0, vehicle_id, 0, {}); default: NOT_REACHED(); } } @@ -245,7 +247,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_VEHICLE_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_RENAME_VEHICLE, text); + return ScriptObject::Command::Do(0, vehicle_id, 0, text); } /* static */ TileIndex ScriptVehicle::GetLocation(VehicleID vehicle_id) diff --git a/src/script/api/script_viewport.cpp b/src/script/api/script_viewport.cpp index 275ab33465..7d57bffb37 100644 --- a/src/script/api/script_viewport.cpp +++ b/src/script/api/script_viewport.cpp @@ -14,6 +14,7 @@ #include "script_map.hpp" #include "../script_instance.hpp" #include "../../viewport_func.h" +#include "../../viewport_cmd.h" #include "../../safeguards.h" @@ -30,7 +31,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, ScriptMap::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, VST_EVERYONE, 0, CMD_SCROLL_VIEWPORT); + return ScriptObject::Command::Do(tile, VST_EVERYONE, 0, {}); } /* static */ bool ScriptViewport::ScrollCompanyClientsTo(ScriptCompany::CompanyID company, TileIndex tile) @@ -41,7 +42,7 @@ company = ScriptCompany::ResolveCompanyID(company); EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID); - return ScriptObject::DoCommand(tile, VST_COMPANY, company, CMD_SCROLL_VIEWPORT); + return ScriptObject::Command::Do(tile, VST_COMPANY, company, {}); } /* static */ bool ScriptViewport::ScrollClientTo(ScriptClient::ClientID client, TileIndex tile) @@ -53,5 +54,5 @@ client = ScriptClient::ResolveClientID(client); EnforcePrecondition(false, client != ScriptClient::CLIENT_INVALID); - return ScriptObject::DoCommand(tile, VST_CLIENT, client, CMD_SCROLL_VIEWPORT); + return ScriptObject::Command::Do(tile, VST_CLIENT, client, {}); } From ccefa76a4686581b8d1a9bd13d7d754807a9f8d1 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 1 Nov 2021 23:07:27 +0100 Subject: [PATCH 119/710] Codechange: Template DoCommandPInternal. --- src/command.cpp | 138 +++++++++++++------------------ src/command_func.h | 96 ++++++++++++++++++++- src/network/network_client.cpp | 3 +- src/network/network_command.cpp | 16 ---- src/network/network_gui.cpp | 2 +- src/network/network_server.cpp | 2 +- src/order_backup.cpp | 2 +- src/script/api/script_object.hpp | 2 +- src/settings.cpp | 2 +- 9 files changed, 158 insertions(+), 105 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index dc536a843c..9997a66fec 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -274,53 +274,26 @@ void CommandHelperBase::InternalPostResult(const CommandCost &res, TileIndex til } } -/** Helper to format command parameters into a hex string. */ -static std::string CommandParametersToHexString(TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +/** Helper to make a desync log for a command. */ +void CommandHelperBase::LogCommandExecution(Commands cmd, StringID err_message, TileIndex tile, const CommandDataBuffer &args, bool failed) { - return FormatArrayAsHex(EndianBufferWriter<>::FromValue(std::make_tuple(tile, p1, p2, text))); + Debug(desync, 1, "{}: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", failed ? "cmdf" : "cmd", _date, _date_fract, (int)_current_company, cmd, err_message, tile, FormatArrayAsHex(args), GetCommandName(cmd)); } -/*! - * Helper function for the toplevel network safe docommand function for the current company. - * - * @param cmd The command to execute (a CMD_* value) - * @param err_message Message prefix to show on error - * @param callback A callback function to call after the command is finished - * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) - * @param estimate_only whether to give only the estimate or also execute the command - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - * @return the command cost of this function. +/** + * Prepare for the test run of a command proc call. + * @param cmd_flags Command flags. + * @param tile Tile of command execution. + * @param[in,out] cur_company Backup of current company at start of command execution. + * @return True if test run can go ahead, false on error. */ -CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +bool CommandHelperBase::InternalExecutePrepTest(CommandFlags cmd_flags, TileIndex tile, Backup &cur_company) { - RecursiveCommandCounter counter{}; - - /* Prevent recursion; it gives a mess over the network */ - assert(counter.IsTopLevel()); - /* Reset the state. */ _additional_cash_required = 0; - /* Get pointer to command handler */ - assert(cmd < _command_proc_table.size()); - CommandProc *proc = _command_proc_table[cmd].proc; - /* Shouldn't happen, but you never know when someone adds - * NULLs to the _command_proc_table. */ - assert(proc != nullptr); - - /* Command flags are used internally */ - CommandFlags cmd_flags = GetCommandFlags(cmd); - /* Flags get send to the DoCommand */ - DoCommandFlag flags = CommandFlagsToDCFlags(cmd_flags); - - /* Make sure p2 is properly set to a ClientID. */ - assert(!(cmd_flags & CMD_CLIENT_ID) || p2 != 0); - /* Do not even think about executing out-of-bounds tile-commands */ - if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return CMD_ERROR; + if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return false; /* Always execute server and spectator commands as spectator */ bool exec_as_spectator = (cmd_flags & (CMD_SPECTATOR | CMD_SERVER)) != 0; @@ -329,62 +302,68 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * The server will ditch any server commands a client sends to it, so effectively * this guards the server from executing functions for an invalid company. */ if (_game_mode == GM_NORMAL && !exec_as_spectator && !Company::IsValidID(_current_company) && !(_current_company == OWNER_DEITY && (cmd_flags & CMD_DEITY) != 0)) { - return CMD_ERROR; + return false; } - Backup cur_company(_current_company, FILE_LINE); if (exec_as_spectator) cur_company.Change(COMPANY_SPECTATOR); - bool test_and_exec_can_differ = (cmd_flags & CMD_NO_TEST) != 0; - - /* Test the command. */ + /* Enter test mode. */ _cleared_object_areas.clear(); SetTownRatingTestMode(true); BasePersistentStorageArray::SwitchMode(PSM_ENTER_TESTMODE); - CommandCost res = proc(flags, tile, p1, p2, text); + return true; +} + +/** + * Validate result of test run and prepare for real execution. + * @param cmd_flags Command flags. + * @param[in,out] res Command result of test run, may be modified. + * @param estimate_only Is this just cost estimation? + * @param network_command Does this command come from the network? + * @param[in,out] cur_company Backup of current company at start of command execution. + * @return True if test run can go ahead, false on error. + */ +std::tuple CommandHelperBase::InternalExecuteValidateTestAndPrepExec(CommandCost &res, CommandFlags cmd_flags, bool estimate_only, bool network_command, Backup &cur_company) +{ BasePersistentStorageArray::SwitchMode(PSM_LEAVE_TESTMODE); SetTownRatingTestMode(false); /* Make sure we're not messing things up here. */ - assert(exec_as_spectator ? _current_company == COMPANY_SPECTATOR : cur_company.Verify()); + assert((cmd_flags & (CMD_SPECTATOR | CMD_SERVER)) != 0 ? _current_company == COMPANY_SPECTATOR : cur_company.Verify()); /* If the command fails, we're doing an estimate * or the player does not have enough money * (unless it's a command where the test and * execution phase might return different costs) * we bail out here. */ - if (res.Failed() || estimate_only || - (!test_and_exec_can_differ && !CheckCompanyHasMoney(res))) { - if (!_networking || _generating_world || network_command) { - /* Log the failed command as well. Just to be able to be find - * causes of desyncs due to bad command test implementations. */ - Debug(desync, 1, "cmdf: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cmd, err_message, tile, CommandParametersToHexString(tile, p1, p2, text), GetCommandName(cmd)); - } - cur_company.Restore(); - return res; + bool test_and_exec_can_differ = (cmd_flags & CMD_NO_TEST) != 0; + if (res.Failed() || estimate_only || (!test_and_exec_can_differ && !CheckCompanyHasMoney(res))) { + return { true, !_networking || _generating_world || network_command, false }; } - /* - * If we are in network, and the command is not from the network - * send it to the command-queue and abort execution - */ - if (_networking && !_generating_world && !network_command) { - NetworkSendCommand(cmd, err_message, callback, _current_company, tile, p1, p2, text); - cur_company.Restore(); + bool send_net = _networking && !_generating_world && !network_command; - /* Don't return anything special here; no error, no costs. - * This way it's not handled by DoCommand and only the - * actual execution of the command causes messages. Also - * reset the storages as we've not executed the command. */ - return CommandCost(); + if (!send_net) { + /* Prepare for command execution. */ + _cleared_object_areas.clear(); + BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND); } - Debug(desync, 1, "cmd: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {:06x}; {} ({})", _date, _date_fract, (int)_current_company, cmd, err_message, tile, CommandParametersToHexString(tile, p1, p2, text), GetCommandName(cmd)); - /* Actually try and execute the command. If no cost-type is given - * use the construction one */ - _cleared_object_areas.clear(); - BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND); - CommandCost res2 = proc(flags | DC_EXEC, tile, p1, p2, text); + return { false, _debug_desync_level >= 1, send_net }; +} + +/** + * Process the result of a command test run and execution run. + * @param cmd Command that was executed. + * @param cmd_flags Command flags. + * @param res_test Command result of test run. + * @param tes_exec Command result of real run. + * @param tile Tile of command execution. + * @param[in,out] cur_company Backup of current company at start of command execution. + * @return Final command result. + */ +CommandCost CommandHelperBase::InternalExecuteProcessResult(Commands cmd, CommandFlags cmd_flags, const CommandCost &res_test, const CommandCost &res_exec, TileIndex tile, Backup &cur_company) +{ BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND); if (cmd == CMD_COMPANY_CTRL) { @@ -395,7 +374,7 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba _current_company = _local_company; } else { /* Make sure nothing bad happened, like changing the current company. */ - assert(exec_as_spectator ? _current_company == COMPANY_SPECTATOR : cur_company.Verify()); + assert((cmd_flags & (CMD_SPECTATOR | CMD_SERVER)) != 0 ? _current_company == COMPANY_SPECTATOR : cur_company.Verify()); cur_company.Restore(); } @@ -403,15 +382,16 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba * return of the command. Otherwise we can check whether the * test and execution have yielded the same result, * i.e. cost and error state are the same. */ + bool test_and_exec_can_differ = (cmd_flags & CMD_NO_TEST) != 0; if (!test_and_exec_can_differ) { - assert(res.GetCost() == res2.GetCost() && res.Failed() == res2.Failed()); // sanity check - } else if (res2.Failed()) { - return res2; + assert(res_test.GetCost() == res_exec.GetCost() && res_test.Failed() == res_exec.Failed()); // sanity check + } else if (res_exec.Failed()) { + return res_exec; } /* If we're needing more money and we haven't done * anything yet, ask for the money! */ - if (_additional_cash_required != 0 && res2.GetCost() == 0) { + if (_additional_cash_required != 0 && res_exec.GetCost() == 0) { /* It could happen we removed rail, thus gained money, and deleted something else. * So make sure the signal buffer is empty even in this case */ UpdateSignalsInBuffer(); @@ -425,12 +405,12 @@ CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallba if (c != nullptr) c->last_build_coordinate = tile; } - SubtractMoneyFromCompany(res2); + SubtractMoneyFromCompany(res_exec); /* update signals if needed */ UpdateSignalsInBuffer(); - return res2; + return res_exec; } diff --git a/src/command_func.h b/src/command_func.h index 9d603abcf6..b69e97b393 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -12,6 +12,8 @@ #include "command_type.h" #include "company_type.h" +#include "company_func.h" +#include "core/backup_type.hpp" #include "misc/endian_buffer.hpp" #include "tile_map.h" @@ -34,9 +36,6 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID); */ #define return_cmd_error(errcode) return CommandCost(errcode); -CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); - -void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex location, const CommandDataBuffer &cmd_data); extern Money _additional_cash_required; @@ -87,6 +86,10 @@ protected: static void InternalDoAfter(CommandCost &res, DoCommandFlag flags, bool top_level, bool test); static std::tuple InternalPostBefore(Commands cmd, CommandFlags flags, TileIndex tile, StringID err_message, bool network_command); static void InternalPostResult(const CommandCost &res, TileIndex tile, bool estimate_only, bool only_sending, StringID err_message, bool my_cmd); + static bool InternalExecutePrepTest(CommandFlags cmd_flags, TileIndex tile, Backup &cur_company); + static std::tuple InternalExecuteValidateTestAndPrepExec(CommandCost &res, CommandFlags cmd_flags, bool estimate_only, bool network_command, Backup &cur_company); + static CommandCost InternalExecuteProcessResult(Commands cmd, CommandFlags cmd_flags, const CommandCost &res_test, const CommandCost &res_exec, TileIndex tile, Backup &cur_company); + static void LogCommandExecution(Commands cmd, StringID err_message, TileIndex tile, const CommandDataBuffer &args, bool failed); }; /** @@ -186,6 +189,41 @@ public: return InternalPost(err_message, callback, my_cmd, true, location, std::move(args)); } + /** + * Prepare a command to be send over the network + * @param cmd The command to execute (a CMD_* value) + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param company The company that wants to send the command + * @param args Parameters for the command + */ + static void SendNet(StringID err_message, CommandCallback *callback, CompanyID company, Targs... args) + { + auto args_tuple = std::forward_as_tuple(args...); + + TileIndex tile{}; + if constexpr (std::is_same_v>) { + tile = std::get<0>(args_tuple); + } + + ::NetworkSendCommand(Tcmd, err_message, callback, _current_company, tile, EndianBufferWriter::FromValue(args_tuple)); + } + + /** + * Top-level network safe command execution without safety checks. + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param my_cmd indicator if the command is from a company or server (to display error messages for a user) + * @param estimate_only whether to give only the estimate or also execute the command + * @param location Tile location for user feedback. + * @param args Parameters for the command + * @return the command cost of this function. + */ + static CommandCost Unsafe(StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, TileIndex location, std::tuple args) + { + return Execute(err_message, callback, my_cmd, estimate_only, false, location, std::move(args)); + } + protected: static bool InternalPost(StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, std::tuple args) { @@ -206,7 +244,7 @@ protected: /* Only set p2 when the command does not come from the network. */ if (!network_command && GetCommandFlags() & CMD_CLIENT_ID && std::get<2>(args) == 0) std::get<2>(args) = CLIENT_ID_SERVER; - CommandCost res = std::apply(DoCommandPInternal, std::tuple_cat(std::make_tuple(Tcmd, err_message, callback, my_cmd, estimate_only, network_command), args)); + CommandCost res = Execute(err_message, callback, my_cmd, estimate_only, network_command, tile, args); InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd); if (!estimate_only && !only_sending && callback != nullptr) { @@ -215,6 +253,56 @@ protected: return res.Succeeded(); } + + static CommandCost Execute(StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, std::tuple args) + { + /* Prevent recursion; it gives a mess over the network */ + RecursiveCommandCounter counter{}; + assert(counter.IsTopLevel()); + + /* Command flags are used internally */ + CommandFlags cmd_flags = GetCommandFlags(); + + /* Make sure p2 is properly set to a ClientID also when processing external commands. */ + assert(!(cmd_flags & CMD_CLIENT_ID) || std::get<2>(args) != 0); + + Backup cur_company(_current_company, FILE_LINE); + if (!InternalExecutePrepTest(cmd_flags, tile, cur_company)) { + cur_company.Trash(); + return CMD_ERROR; + } + + /* Test the command. */ + DoCommandFlag flags = CommandFlagsToDCFlags(cmd_flags); + CommandCost res = std::apply(CommandTraits::proc, std::tuple_cat(std::make_tuple(flags), args)); + + auto [exit_test, desync_log, send_net] = InternalExecuteValidateTestAndPrepExec(res, cmd_flags, estimate_only, network_command, cur_company); + if (exit_test) { + if (desync_log) LogCommandExecution(Tcmd, err_message, tile, EndianBufferWriter::FromValue(args), true); + cur_company.Restore(); + return res; + } + + /* If we are in network, and the command is not from the network + * send it to the command-queue and abort execution. */ + if (send_net) { + ::NetworkSendCommand(Tcmd, err_message, callback, _current_company, tile, EndianBufferWriter::FromValue(args)); + cur_company.Restore(); + + /* Don't return anything special here; no error, no costs. + * This way it's not handled by DoCommand and only the + * actual execution of the command causes messages. Also + * reset the storages as we've not executed the command. */ + return CommandCost(); + } + + if (desync_log) LogCommandExecution(Tcmd, err_message, tile, EndianBufferWriter::FromValue(args), false); + + /* Actually try and execute the command. */ + CommandCost res2 = std::apply(CommandTraits::proc, std::tuple_cat(std::make_tuple(flags | DC_EXEC), args)); + + return InternalExecuteProcessResult(Tcmd, cmd_flags, res, res2, tile, cur_company); + } }; template diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index dd42f5f6ff..cc7cd8336e 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -18,6 +18,7 @@ #include "../company_func.h" #include "../company_base.h" #include "../company_gui.h" +#include "../company_cmd.h" #include "../core/random_func.hpp" #include "../date_func.h" #include "../gfx_func.h" @@ -839,7 +840,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(Packet * the server will give us a client-id and let us in */ _network_join_status = NETWORK_JOIN_STATUS_REGISTERING; ShowJoinStatusWindow(); - NetworkSendCommand(CMD_COMPANY_CTRL, STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); + Command::SendNet(STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } } else { /* take control over an existing company */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 983f4b5659..f99c71b97c 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -176,22 +176,6 @@ static CommandQueue _local_wait_queue; /** Local queue of packets waiting for execution. */ static CommandQueue _local_execution_queue; -/** - * Prepare a DoCommand to be send over the network - * @param cmd The command to execute (a CMD_* value) - * @param err_message Message prefix to show on error - * @param callback A callback function to call after the command is finished - * @param company The company that wants to send the command - * @param tile The tile to perform a command on (see #CommandProc) - * @param p1 Additional data for the command (see #CommandProc) - * @param p2 Additional data for the command (see #CommandProc) - * @param text The text to pass - */ -void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) -{ - auto data = EndianBufferWriter::FromValue(std::make_tuple(tile, p1, p2, text)); - NetworkSendCommand(cmd, err_message, callback, company, tile, data); -} /** * Prepare a DoCommand to be send over the network diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index a2b34593eb..ac12402ea5 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1538,7 +1538,7 @@ private: if (_network_server) { Command::Post(0, CCA_NEW, _network_own_client_id, {}); } else { - NetworkSendCommand(CMD_COMPANY_CTRL, STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); + Command::SendNet(STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); } } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 65f3188de8..ad891aef8c 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -2081,7 +2081,7 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci) /* ci is nullptr when replaying, or for AIs. In neither case there is a client. */ ci->client_playas = c->index; NetworkUpdateClientInfo(ci->client_id); - NetworkSendCommand(CMD_RENAME_PRESIDENT, STR_NULL, nullptr, c->index, 0, 0, 0, ci->client_name); + Command::SendNet(STR_NULL, nullptr, c->index, 0, 0, 0, ci->client_name); } /* Announce new company on network. */ diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 987b3154f2..6bececc0cc 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -200,7 +200,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, /* We need to circumvent the "prevention" from this command being executed * while the game is paused, so use the internal method. Nor do we want * this command to get its cost estimated when shift is pressed. */ - DoCommandPInternal(CMD_CLEAR_ORDER_BACKUP, STR_NULL, nullptr, true, false, false, ob->tile, 0, user, {}); + Command::Unsafe(STR_NULL, nullptr, true, false, ob->tile, CommandTraits::Args{ ob->tile, 0, user, {} }); } else { /* The command came from the game logic, i.e. the clearing of a tile. * In that case we have no need to actually sync this, just do it. */ diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index cfb6d393a4..26da500c4c 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -371,7 +371,7 @@ bool ScriptObject::ScriptDoCommandHelper::FromValue(args), Tcmd); /* Try to perform the command. */ - CommandCost res = std::apply(&DoCommandPInternal, std::tuple_cat(std::make_tuple(Tcmd, (StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, false), args)); + CommandCost res = ::Command::Unsafe((StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args); return ScriptObject::DoCommandProcessResult(res, callback, estimate_only); } diff --git a/src/settings.cpp b/src/settings.cpp index 63c7478a04..3c0f92f39b 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1604,7 +1604,7 @@ void SyncCompanySettings() const SettingDesc *sd = GetSettingDesc(desc); uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object); uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object); - if (old_value != new_value) NetworkSendCommand(CMD_CHANGE_COMPANY_SETTING, STR_NULL, nullptr, _local_company, 0, 0, new_value, sd->GetName()); + if (old_value != new_value) Command::SendNet(STR_NULL, nullptr, _local_company, 0, 0, new_value, sd->GetName()); } } From 4f3ea3907e23428461c626b6c861d834b358bc9f Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Tue, 2 Nov 2021 21:34:39 +0100 Subject: [PATCH 120/710] Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). --- src/ai/ai_gui.cpp | 4 +- src/aircraft_cmd.cpp | 3 +- src/aircraft_cmd.h | 2 +- src/autoreplace_cmd.cpp | 16 ++++---- src/build_vehicle_gui.cpp | 4 +- src/command.cpp | 8 ++-- src/command_func.h | 47 +++++++++++++++++++++--- src/company_cmd.cpp | 19 +++------- src/company_cmd.h | 4 +- src/company_type.h | 6 ++- src/console_cmds.cpp | 10 ++--- src/depot_gui.cpp | 4 +- src/economy.cpp | 2 +- src/network/network_client.cpp | 2 +- src/network/network_command.cpp | 42 ++++++++++++++++----- src/network/network_gui.cpp | 6 +-- src/network/network_server.cpp | 10 ++--- src/order_backup.cpp | 12 +++--- src/order_cmd.h | 2 +- src/roadveh_cmd.cpp | 3 +- src/roadveh_cmd.h | 2 +- src/script/api/script_object.hpp | 20 +++++++++- src/script/api/script_vehicle.cpp | 8 ++-- src/ship_cmd.cpp | 3 +- src/ship_cmd.h | 2 +- src/train_cmd.cpp | 22 +++++------ src/train_cmd.h | 4 +- src/vehicle_cmd.cpp | 61 ++++++++++++++----------------- src/vehicle_cmd.h | 4 +- 29 files changed, 196 insertions(+), 136 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 5996039c9d..5e0c720f00 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -1292,8 +1292,8 @@ struct AIDebugWindow : public Window { case WID_AID_RELOAD_TOGGLE: if (ai_debug_company == OWNER_DEITY) break; /* First kill the company of the AI, then start a new one. This should start the current AI again */ - Command::Post(0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0, {}); - Command::Post(0, CCA_NEW_AI | ai_debug_company << 16, 0, {}); + Command::Post(CCA_DELETE, ai_debug_company, CRR_MANUAL, INVALID_CLIENT_ID); + Command::Post(CCA_NEW_AI, ai_debug_company, CRR_NONE, INVALID_CLIENT_ID); break; case WID_AID_SETTINGS: diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 998f75e6bd..f1263f00cd 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -263,11 +263,10 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height, int &xoff * @param flags type of operation. * @param tile tile of the depot where aircraft is built. * @param e the engine to build. - * @param data unused. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildAircraft(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildAircraft(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **ret) { const AircraftVehicleInfo *avi = &e->u.air; const Station *st = Station::GetByTile(tile); diff --git a/src/aircraft_cmd.h b/src/aircraft_cmd.h index 719974af7b..df58739a54 100644 --- a/src/aircraft_cmd.h +++ b/src/aircraft_cmd.h @@ -14,6 +14,6 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildAircraft(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildAircraft(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v); #endif /* AIRCRAFT_CMD_H */ diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 4ba41942c9..6a8937cb65 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -345,7 +345,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic } /* Build the new vehicle */ - cost = Command::Do(DC_EXEC | DC_AUTOREPLACE, old_veh->tile, e | (CT_INVALID << 24), 0, {}); + cost = Command::Do(DC_EXEC | DC_AUTOREPLACE, old_veh->tile, e, true, CT_INVALID, INVALID_CLIENT_ID); if (cost.Failed()) return cost; Vehicle *new_veh = Vehicle::Get(_new_vehicle_id); @@ -471,11 +471,11 @@ static CommandCost ReplaceFreeUnit(Vehicle **single_unit, DoCommandFlag flags, b } /* Sell the old vehicle */ - cost.AddCost(Command::Do(flags, 0, old_v->index, 0, {})); + cost.AddCost(Command::Do(flags, 0, old_v->index, false, false, INVALID_CLIENT_ID)); /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - Command::Do(DC_EXEC, 0, new_v->index, 0, {}); + Command::Do(DC_EXEC, 0, new_v->index, false, false, INVALID_CLIENT_ID); } } @@ -602,7 +602,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon assert(RailVehInfo(wagon->engine_type)->railveh_type == RAILVEH_WAGON); /* Sell wagon */ - [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC, 0, wagon->index, 0, {}); + [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC, 0, wagon->index, false, false, INVALID_CLIENT_ID); assert(ret.Succeeded()); new_vehs[i] = nullptr; @@ -634,7 +634,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon /* Sell the vehicle. * Note: This might temporarily construct new trains, so use DC_AUTOREPLACE to prevent * it from failing due to engine limits. */ - cost.AddCost(Command::Do(flags | DC_AUTOREPLACE, 0, w->index, 0, {})); + cost.AddCost(Command::Do(flags | DC_AUTOREPLACE, 0, w->index, false, false, INVALID_CLIENT_ID)); if ((flags & DC_EXEC) != 0) { old_vehs[i] = nullptr; if (i == 0) old_head = nullptr; @@ -665,7 +665,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon if ((flags & DC_EXEC) == 0) { for (int i = num_units - 1; i >= 0; i--) { if (new_vehs[i] != nullptr) { - Command::Do(DC_EXEC, 0, new_vehs[i]->index, 0, {}); + Command::Do(DC_EXEC, 0, new_vehs[i]->index, false, false, INVALID_CLIENT_ID); new_vehs[i] = nullptr; } } @@ -696,12 +696,12 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon } /* Sell the old vehicle */ - cost.AddCost(Command::Do(flags, 0, old_head->index, 0, {})); + cost.AddCost(Command::Do(flags, 0, old_head->index, false, false, INVALID_CLIENT_ID)); } /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - Command::Do(DC_EXEC, 0, new_head->index, 0, {}); + Command::Do(DC_EXEC, 0, new_head->index, false, false, INVALID_CLIENT_ID); } } } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 639bab7a9f..ef87699ef8 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1229,7 +1229,7 @@ struct BuildVehicleWindow : Window { if (!this->listview_mode) { /* Query for cost and refitted capacity */ - CommandCost ret = Command::Do(DC_QUERY_COST, this->window_number, this->sel_engine | (cargo << 24), 0, {}); + CommandCost ret = Command::Do(DC_QUERY_COST, this->window_number, this->sel_engine, true, cargo, INVALID_CLIENT_ID); if (ret.Succeeded()) { this->te.cost = ret.GetCost() - e->GetCost(); this->te.capacity = _returned_refit_capacity; @@ -1472,7 +1472,7 @@ struct BuildVehicleWindow : Window { CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle; CargoID cargo = this->cargo_filter[this->cargo_filter_criteria]; if (cargo == CF_ANY || cargo == CF_ENGINES) cargo = CF_NONE; - Command::Post(GetCmdBuildVehMsg(this->vehicle_type), callback, this->window_number, sel_eng | (cargo << 24), 0, {}); + Command::Post(GetCmdBuildVehMsg(this->vehicle_type), callback, this->window_number, sel_eng, true, cargo, INVALID_CLIENT_ID); } break; } diff --git a/src/command.cpp b/src/command.cpp index 9997a66fec..08fe7b2659 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -75,15 +75,13 @@ int RecursiveCommandCounter::_counter = 0; * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values. */ struct CommandInfo { - CommandProc *proc; ///< The procedure to actually executing const char *name; ///< A human readable name for the procedure CommandFlags flags; ///< The (command) flags to that apply to this command CommandType type; ///< The type of command. }; /* Helpers to generate the master command table from the command traits. */ - template -inline constexpr CommandInfo CommandFromTrait() noexcept { return { T::proc, T::name, T::flags, T::type }; }; +inline constexpr CommandInfo CommandFromTrait() noexcept { return { T::name, T::flags, T::type }; }; template inline constexpr auto MakeCommandsFromTraits(std::integer_sequence) noexcept { @@ -101,14 +99,14 @@ static constexpr auto _command_proc_table = MakeCommandsFromTraits(std::make_int /*! - * This function range-checks a cmd, and checks if the cmd is not nullptr + * This function range-checks a cmd. * * @param cmd The integer value of a command * @return true if the command is valid (and got a CommandProc function) */ bool IsValidCommand(Commands cmd) { - return cmd < _command_proc_table.size() && _command_proc_table[cmd].proc != nullptr; + return cmd < _command_proc_table.size(); } /*! diff --git a/src/command_func.h b/src/command_func.h index b69e97b393..e1f958f5bd 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -11,6 +11,7 @@ #define COMMAND_FUNC_H #include "command_type.h" +#include "network/network_type.h" #include "company_type.h" #include "company_func.h" #include "core/backup_type.hpp" @@ -225,6 +226,22 @@ public: } protected: + /** Helper to process a single ClientID argument. */ + template + static inline void SetClientIdHelper(T &data) + { + if constexpr (std::is_same_v) { + if (data == INVALID_CLIENT_ID) data = CLIENT_ID_SERVER; + } + } + + /** Set all invalid ClientID's to the proper value. */ + template + static inline void SetClientIds(Ttuple &values, std::index_sequence) + { + ((SetClientIdHelper(std::get(values))), ...); + } + static bool InternalPost(StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, std::tuple args) { /* Where to show the message? */ @@ -241,8 +258,8 @@ protected: auto [err, estimate_only, only_sending] = InternalPostBefore(Tcmd, GetCommandFlags(), tile, err_message, network_command); if (err) return false; - /* Only set p2 when the command does not come from the network. */ - if (!network_command && GetCommandFlags() & CMD_CLIENT_ID && std::get<2>(args) == 0) std::get<2>(args) = CLIENT_ID_SERVER; + /* Only set client IDs when the command does not come from the network. */ + if (!network_command && GetCommandFlags() & CMD_CLIENT_ID) SetClientIds(args, std::index_sequence_for{}); CommandCost res = Execute(err_message, callback, my_cmd, estimate_only, network_command, tile, args); InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd); @@ -254,6 +271,24 @@ protected: return res.Succeeded(); } + /** Helper to process a single ClientID argument. */ + template + static inline bool ClientIdIsSet(T &data) + { + if constexpr (std::is_same_v) { + return data != INVALID_CLIENT_ID; + } else { + return true; + } + } + + /** Check if all ClientID arguments are set to valid values. */ + template + static inline bool AllClientIdsSet(Ttuple &values, std::index_sequence) + { + return (ClientIdIsSet(std::get(values)) && ...); + } + static CommandCost Execute(StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, std::tuple args) { /* Prevent recursion; it gives a mess over the network */ @@ -261,10 +296,12 @@ protected: assert(counter.IsTopLevel()); /* Command flags are used internally */ - CommandFlags cmd_flags = GetCommandFlags(); + constexpr CommandFlags cmd_flags = GetCommandFlags(); - /* Make sure p2 is properly set to a ClientID also when processing external commands. */ - assert(!(cmd_flags & CMD_CLIENT_ID) || std::get<2>(args) != 0); + if constexpr ((cmd_flags & CMD_CLIENT_ID) != 0) { + /* Make sure arguments are properly set to a ClientID also when processing external commands. */ + assert(AllClientIdsSet(args, std::index_sequence_for{})); + } Backup cur_company(_current_company, FILE_LINE); if (!InternalExecutePrepTest(cmd_flags, tile, cur_company)) { diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index cf44af25c7..87231f3eb6 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -604,7 +604,7 @@ static bool MaybeStartNewCompany() if (n < (uint)_settings_game.difficulty.max_no_competitors) { /* Send a command to all clients to start up a new AI. * Works fine for Multiplayer and Singleplayer */ - return Command::Post(0, CCA_NEW_AI | INVALID_COMPANY << 16, 0, {}); + return Command::Post(CCA_NEW_AI, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID ); } return false; @@ -796,21 +796,16 @@ void CompanyAdminRemove(CompanyID company_id, CompanyRemoveReason reason) /** * Control the companies: add, delete, etc. * @param flags operation to perform - * @param tile unused - * @param p1 various functionality - * - bits 0..15: CompanyCtrlAction - * - bits 16..23: CompanyID - * - bits 24..31: CompanyRemoveReason (with CCA_DELETE) - * @param p2 ClientID - * @param text unused + * @param cca action to perform + * @param company_id company to perform the action on + * @param client_id ClientID * @return the cost of this operation or an error */ -CommandCost CmdCompanyCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id) { InvalidateWindowData(WC_COMPANY_LEAGUE, 0, 0); - CompanyID company_id = (CompanyID)GB(p1, 16, 8); - switch ((CompanyCtrlAction)GB(p1, 0, 16)) { + switch (cca) { case CCA_NEW: { // Create a new company /* This command is only executed in a multiplayer game */ if (!_networking) return CMD_ERROR; @@ -818,7 +813,6 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 /* Has the network client a correct ClientIndex? */ if (!(flags & DC_EXEC)) return CommandCost(); - ClientID client_id = (ClientID)p2; NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id); /* Delete multiplayer progress bar */ @@ -873,7 +867,6 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 } case CCA_DELETE: { // Delete a company - CompanyRemoveReason reason = (CompanyRemoveReason)GB(p1, 24, 8); if (reason >= CRR_END) return CMD_ERROR; /* We can't delete the last existing company in singleplayer mode. */ diff --git a/src/company_cmd.h b/src/company_cmd.h index 0d3e2d2fd6..107a77f29c 100644 --- a/src/company_cmd.h +++ b/src/company_cmd.h @@ -12,7 +12,9 @@ #include "command_type.h" -CommandProc CmdCompanyCtrl; +enum ClientID : uint32; + +CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id); CommandProc CmdGiveMoney; CommandProc CmdRenameCompany; CommandProc CmdRenamePresident; diff --git a/src/company_type.h b/src/company_type.h index de2556b914..8da3133082 100644 --- a/src/company_type.h +++ b/src/company_type.h @@ -52,16 +52,18 @@ struct Company; typedef uint32 CompanyManagerFace; ///< Company manager face bits, info see in company_manager_face.h /** The reason why the company was removed. */ -enum CompanyRemoveReason { +enum CompanyRemoveReason : uint8 { CRR_MANUAL, ///< The company is manually removed. CRR_AUTOCLEAN, ///< The company is removed due to autoclean. CRR_BANKRUPT, ///< The company went belly-up. CRR_END, ///< Sentinel for end. + + CRR_NONE = CRR_MANUAL, ///< Dummy reason for actions that don't need one. }; /** The action to do with CMD_COMPANY_CTRL. */ -enum CompanyCtrlAction { +enum CompanyCtrlAction : uint8 { CCA_NEW, ///< Create a new company. CCA_NEW_AI, ///< Create a new AI company. CCA_DELETE, ///< Delete a company. diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 42a94aa89f..9e244dd439 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -865,7 +865,7 @@ DEF_CONSOLE_CMD(ConResetCompany) } /* It is safe to remove this company */ - Command::Post(0, CCA_DELETE | index << 16 | CRR_MANUAL << 24, 0, {}); + Command::Post(CCA_DELETE, index, CRR_MANUAL, INVALID_CLIENT_ID); IConsolePrint(CC_DEFAULT, "Company deleted."); return true; @@ -1222,7 +1222,7 @@ DEF_CONSOLE_CMD(ConStartAI) } /* Start a new AI company */ - Command::Post(0, CCA_NEW_AI | INVALID_COMPANY << 16, 0, {}); + Command::Post(CCA_NEW_AI, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); return true; } @@ -1258,8 +1258,8 @@ DEF_CONSOLE_CMD(ConReloadAI) } /* First kill the company of the AI, then start a new one. This should start the current AI again */ - Command::Post(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, {}); - Command::Post(0, CCA_NEW_AI | company_id << 16, 0, {}); + Command::Post(CCA_DELETE, company_id, CRR_MANUAL, INVALID_CLIENT_ID); + Command::Post(CCA_NEW_AI, company_id, CRR_NONE, INVALID_CLIENT_ID); IConsolePrint(CC_DEFAULT, "AI reloaded."); return true; @@ -1296,7 +1296,7 @@ DEF_CONSOLE_CMD(ConStopAI) } /* Now kill the company of the AI. */ - Command::Post(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, {}); + Command::Post(CCA_DELETE, company_id, CRR_MANUAL, INVALID_CLIENT_ID); IConsolePrint(CC_DEFAULT, "AI stopped, company deleted."); return true; diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index d316d97ca0..830bdbaeed 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -1026,8 +1026,8 @@ struct DepotWindow : Window { this->sel = INVALID_VEHICLE; this->SetDirty(); - int sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0; - Command::Post(GetCmdSellVehMsg(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0, {}); + bool sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)); + Command::Post(GetCmdSellVehMsg(v->type), v->tile, v->index, sell_cmd, true, INVALID_CLIENT_ID); break; } diff --git a/src/economy.cpp b/src/economy.cpp index c65d997b80..8bf608a864 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -630,7 +630,7 @@ static void CompanyCheckBankrupt(Company *c) * player we are sure (the above check) that we are not the local * company and thus we won't be moved. */ if (!_networking || _network_server) { - Command::Post(0, CCA_DELETE | (c->index << 16) | (CRR_BANKRUPT << 24), 0, {}); + Command::Post(CCA_DELETE, c->index, CRR_BANKRUPT, INVALID_CLIENT_ID); return; } break; diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index cc7cd8336e..1868f5e603 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -840,7 +840,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(Packet * the server will give us a client-id and let us in */ _network_join_status = NETWORK_JOIN_STATUS_REGISTERING; ShowJoinStatusWindow(); - Command::SendNet(STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); + Command::SendNet(STR_NULL, nullptr, _local_company, CCA_NEW, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); } } else { /* take control over an existing company */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index f99c71b97c..58de73b198 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -89,15 +89,17 @@ static CommandCallback * const _callback_table[] = { template static CommandDataBuffer SanitizeCmdStrings(const CommandDataBuffer &data); template static void UnpackNetworkCommand(const CommandPacket *cp); +template static void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id); struct CommandDispatch { CommandDataBuffer(*Sanitize)(const CommandDataBuffer &); + void (*ReplaceClientId)(CommandPacket &, ClientID); void (*Unpack)(const CommandPacket *); }; template inline constexpr auto MakeDispatchTable(std::integer_sequence) noexcept { - return std::array{{ { &SanitizeCmdStrings(i)>, &UnpackNetworkCommand(i)> }... }}; + return std::array{{ { &SanitizeCmdStrings(i)>, &NetworkReplaceCommandClientId(i)>, &UnpackNetworkCommand(i)> }... }}; } static constexpr auto _cmd_dispatch = MakeDispatchTable(std::make_integer_sequence, CMD_END>{}); @@ -383,6 +385,35 @@ void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) p->Send_uint8 (callback); } +/** Helper to process a single ClientID argument. */ +template +static inline void SetClientIdHelper(T &data, [[maybe_unused]] ClientID client_id) +{ + if constexpr (std::is_same_v) { + data = client_id; + } +} + +/** Set all invalid ClientID's to the proper value. */ +template +static inline void SetClientIds(Ttuple &values, ClientID client_id, std::index_sequence) +{ + ((SetClientIdHelper(std::get(values), client_id)), ...); +} + +template +static void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id) +{ + /* Unpack command parameters. */ + auto params = EndianBufferReader::ToValue::Args>(cp.data); + + /* Insert client id. */ + SetClientIds(params, client_id, std::make_index_sequence>{}); + + /* Repack command parameters. */ + cp.data = EndianBufferWriter::FromValue(params); +} + /** * Insert a client ID into the command data in a command packet. * @param cp Command packet to modify. @@ -390,14 +421,7 @@ void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) */ void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id) { - /* Unpack command parameters. */ - auto params = EndianBufferReader::ToValue>(cp.data); - - /* Insert client id. */ - std::get<2>(params) = client_id; - - /* Repack command parameters. */ - cp.data = EndianBufferWriter::FromValue(params); + _cmd_dispatch[cp.cmd].ReplaceClientId(cp, client_id); } diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index ac12402ea5..0c7e361dd4 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1396,7 +1396,7 @@ static void AdminCompanyResetCallback(Window *w, bool confirmed) { if (confirmed) { if (NetworkCompanyHasClients(_admin_company_id)) return; - Command::Post(0, CCA_DELETE | _admin_company_id << 16 | CRR_MANUAL << 24, 0, {}); + Command::Post(CCA_DELETE, _admin_company_id, CRR_MANUAL, INVALID_CLIENT_ID); } } @@ -1536,9 +1536,9 @@ private: static void OnClickCompanyNew(NetworkClientListWindow *w, Point pt, CompanyID company_id) { if (_network_server) { - Command::Post(0, CCA_NEW, _network_own_client_id, {}); + Command::Post(CCA_NEW, INVALID_COMPANY, CRR_NONE, _network_own_client_id); } else { - Command::SendNet(STR_NULL, nullptr, _local_company, 0, CCA_NEW, 0, {}); + Command::SendNet(STR_NULL, nullptr, _local_company, CCA_NEW, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); } } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index ad891aef8c..197d398bf6 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1050,15 +1050,15 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet * to match the company in the packet. If it doesn't, the client has done * something pretty naughty (or a bug), and will be kicked */ - uint32 company_p1 = cp.cmd == CMD_COMPANY_CTRL ? std::get<1>(EndianBufferReader::ToValue::Args>(cp.data)) : 0; - if (!(cp.cmd == CMD_COMPANY_CTRL && company_p1 == 0 && ci->client_playas == COMPANY_NEW_COMPANY) && ci->client_playas != cp.company) { + CompanyCtrlAction cca = cp.cmd == CMD_COMPANY_CTRL ? std::get<0>(EndianBufferReader::ToValue::Args>(cp.data)) : CCA_NEW; + if (!(cp.cmd == CMD_COMPANY_CTRL && cca == CCA_NEW && ci->client_playas == COMPANY_NEW_COMPANY) && ci->client_playas != cp.company) { IConsolePrint(CC_WARNING, "Kicking client #{} (IP: {}) due to calling a command as another company {}.", ci->client_playas + 1, this->GetClientIP(), cp.company + 1); return this->SendError(NETWORK_ERROR_COMPANY_MISMATCH); } if (cp.cmd == CMD_COMPANY_CTRL) { - if (company_p1 != 0 || cp.company != COMPANY_SPECTATOR) { + if (cca != CCA_NEW || cp.company != COMPANY_SPECTATOR) { return this->SendError(NETWORK_ERROR_CHEATER); } @@ -1556,7 +1556,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_unprotected-months, and is there no protection? */ if (_settings_client.network.autoclean_unprotected != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_unprotected && _network_company_states[c->index].password.empty()) { /* Shut the company down */ - Command::Post(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, {}); + Command::Post(CCA_DELETE, c->index, CRR_AUTOCLEAN, INVALID_CLIENT_ID); IConsolePrint(CC_INFO, "Auto-cleaned company #{} with no password.", c->index + 1); } /* Is the company empty for autoclean_protected-months, and there is a protection? */ @@ -1570,7 +1570,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_novehicles-months, and has no vehicles? */ if (_settings_client.network.autoclean_novehicles != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_novehicles && vehicles_in_company[c->index] == 0) { /* Shut the company down */ - Command::Post(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, {}); + Command::Post(CCA_DELETE, c->index, CRR_AUTOCLEAN, INVALID_CLIENT_ID); IConsolePrint(CC_INFO, "Auto-cleaned company #{} with no vehicles.", c->index + 1); } } else { diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 6bececc0cc..69ae6507db 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -144,15 +144,13 @@ void OrderBackup::DoRestore(Vehicle *v) * Clear an OrderBackup * @param flags For command. * @param tile Tile related to the to-be-cleared OrderBackup. - * @param p1 Unused. - * @param p2 User that had the OrderBackup. - * @param text Unused. + * @param user_id User that had the OrderBackup. * @return The cost of this operation or an error. */ -CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, ClientID user_id) { /* No need to check anything. If the tile or user don't exist we just ignore it. */ - if (flags & DC_EXEC) OrderBackup::ResetOfUser(tile == 0 ? INVALID_TILE : tile, p2); + if (flags & DC_EXEC) OrderBackup::ResetOfUser(tile == 0 ? INVALID_TILE : tile, user_id); return CommandCost(); } @@ -171,7 +169,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, /* If it's not a backup of us, ignore it. */ if (ob->user != user) continue; - Command::Post(0, 0, user, {}); + Command::Post(0, static_cast(user)); return; } } @@ -200,7 +198,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, /* We need to circumvent the "prevention" from this command being executed * while the game is paused, so use the internal method. Nor do we want * this command to get its cost estimated when shift is pressed. */ - Command::Unsafe(STR_NULL, nullptr, true, false, ob->tile, CommandTraits::Args{ ob->tile, 0, user, {} }); + Command::Unsafe(STR_NULL, nullptr, true, false, ob->tile, CommandTraits::Args{ ob->tile, static_cast(user) }); } else { /* The command came from the game logic, i.e. the clearing of a tile. * In that case we have no need to actually sync this, just do it. */ diff --git a/src/order_cmd.h b/src/order_cmd.h index 606cbef605..fa3424ce42 100644 --- a/src/order_cmd.h +++ b/src/order_cmd.h @@ -19,7 +19,7 @@ CommandProc CmdInsertOrder; CommandProc CmdOrderRefit; CommandProc CmdCloneOrder; CommandProc CmdMoveOrder; -CommandProc CmdClearOrderBackup; +CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, ClientID user_id); DEF_CMD_TRAIT(CMD_MODIFY_ORDER, CmdModifyOrder, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_SKIP_TO_ORDER, CmdSkipToOrder, 0, CMDT_ROUTE_MANAGEMENT) diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index efe45c507d..a6442430e0 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -254,11 +254,10 @@ void RoadVehUpdateCache(RoadVehicle *v, bool same_length) * @param flags type of operation. * @param tile tile of the depot where road vehicle is built. * @param e the engine to build. - * @param data unused. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **ret) { /* Check that the vehicle can drive on the road in question */ RoadType rt = e->u.road.roadtype; diff --git a/src/roadveh_cmd.h b/src/roadveh_cmd.h index ca99dee3ab..94aaee743f 100644 --- a/src/roadveh_cmd.h +++ b/src/roadveh_cmd.h @@ -14,7 +14,7 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v); CommandProc CmdTurnRoadVeh; diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index 26da500c4c..8d9be14c46 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -347,6 +347,22 @@ namespace ScriptObjectInternal { { ((SanitizeSingleStringHelper(std::get(values))), ...); } + + /** Helper to process a single ClientID argument. */ + template + static inline void SetClientIdHelper(T &data) + { + if constexpr (std::is_same_v) { + if (data == INVALID_CLIENT_ID) data = (ClientID)UINT32_MAX; + } + } + + /** Set all invalid ClientID's to the proper value. */ + template + static inline void SetClientIds(Ttuple &values, std::index_sequence) + { + ((SetClientIdHelper(std::get(values))), ...); + } } template @@ -364,8 +380,8 @@ bool ScriptObject::ScriptDoCommandHelper(args); } - /* Only set p2 when the command does not come from the network. */ - if ((::GetCommandFlags() & CMD_CLIENT_ID) != 0 && std::get<2>(args) == 0) std::get<2>(args) = UINT32_MAX; + /* Only set ClientID parameters when the command does not come from the network. */ + if constexpr ((::GetCommandFlags() & CMD_CLIENT_ID) != 0) ScriptObjectInternal::SetClientIds(args, std::index_sequence_for{}); /* Store the command for command callback validation. */ if (!estimate_only && networking) ScriptObject::SetLastCommand(tile, EndianBufferWriter::FromValue(args), Tcmd); diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index d245f41327..3da5739eeb 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -72,7 +72,7 @@ EnforcePreconditionCustomError(VEHICLE_INVALID, !ScriptGameSettings::IsDisabledVehicleType((ScriptVehicle::VehicleType)type), ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED); - if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, engine_id | (cargo << 24), 0, {})) return VEHICLE_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, engine_id, true, cargo, INVALID_CLIENT_ID)) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; @@ -94,7 +94,7 @@ if (!ScriptEngine::IsBuildable(engine_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - CommandCost res = ::Command::Do(DC_QUERY_COST, depot, engine_id | (cargo << 24), 0, {}); + CommandCost res = ::Command::Do(DC_QUERY_COST, depot, engine_id, true, cargo, INVALID_CLIENT_ID); return res.Succeeded() ? _returned_refit_capacity : -1; } @@ -162,7 +162,7 @@ EnforcePrecondition(false, IsValidVehicle(vehicle_id)); const Vehicle *v = ::Vehicle::Get(vehicle_id); - return ScriptObject::Command::Do(0, vehicle_id | (v->type == VEH_TRAIN ? 1 : 0) << 20, 0, {}); + return ScriptObject::Command::Do(0, vehicle_id, v->type == VEH_TRAIN, false, INVALID_CLIENT_ID); } /* static */ bool ScriptVehicle::_SellWagonInternal(VehicleID vehicle_id, int wagon, bool sell_attached_wagons) @@ -174,7 +174,7 @@ const Train *v = ::Train::Get(vehicle_id); while (wagon-- > 0) v = v->GetNextUnit(); - return ScriptObject::Command::Do(0, v->index | (sell_attached_wagons ? 1 : 0) << 20, 0, {}); + return ScriptObject::Command::Do(0, v->index, sell_attached_wagons, false, INVALID_CLIENT_ID); } /* static */ bool ScriptVehicle::SellWagon(VehicleID vehicle_id, int wagon) diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 0e0bccce0f..2729030d31 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -841,11 +841,10 @@ void Ship::SetDestTile(TileIndex tile) * @param flags type of operation. * @param tile tile of the depot where ship is built. * @param e the engine to build. - * @param data unused. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildShip(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildShip(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **ret) { tile = GetShipDepotNorthTile(tile); if (flags & DC_EXEC) { diff --git a/src/ship_cmd.h b/src/ship_cmd.h index 8738f54207..b17885e371 100644 --- a/src/ship_cmd.h +++ b/src/ship_cmd.h @@ -14,6 +14,6 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildShip(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); +CommandCost CmdBuildShip(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v); #endif /* SHIP_CMD_H */ diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index a86e835bd3..d2517d65ba 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -718,11 +718,11 @@ static void AddRearEngineToMultiheadedTrain(Train *v) * @param flags type of operation. * @param tile tile of the depot where rail-vehicle is built. * @param e the engine to build. - * @param data bit 0 prevents any free cars from being added to the train. + * @param free_cars add any free cars to the train. * @param[out] ret the vehicle that has been built. * @return the cost of this operation or an error. */ -CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **ret) +CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, bool free_cars, Vehicle **ret) { const RailVehicleInfo *rvi = &e->u.rail; @@ -789,7 +789,7 @@ CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engin v->ConsistChanged(CCF_ARRANGE); UpdateTrainGroupID(v); - if (!HasBit(data, 0) && !(flags & DC_AUTOREPLACE)) { // check if the cars should be added to the new vehicle + if (free_cars && !(flags & DC_AUTOREPLACE)) { // check if the cars should be added to the new vehicle NormalizeTrainVehInDepot(v); } @@ -1357,18 +1357,16 @@ CommandCost CmdMoveRailVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, u * Sell a (single) train wagon/engine. * @param flags type of operation * @param t the train wagon to sell - * @param data the selling mode - * - data = 0: only sell the single dragged wagon/engine (and any belonging rear-engines) - * - data = 1: sell the vehicle and all vehicles following it in the chain - * if the wagon is dragged, don't delete the possibly belonging rear-engine to some front + * @param sell_chain the selling mode + * - sell_chain = false: only sell the single dragged wagon/engine (and any belonging rear-engines) + * - sell_chain = true: sell the vehicle and all vehicles following it in the chain + * if the wagon is dragged, don't delete the possibly belonging rear-engine to some front + * @param backup_order make order backup? * @param user the user for the order backup. * @return the cost of this operation or an error */ -CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, uint16 data, uint32 user) +CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user) { - /* Sell a chain of vehicles or not? */ - bool sell_chain = HasBit(data, 0); - Train *v = Train::From(t)->GetFirstEnginePart(); Train *first = v->First(); @@ -1418,7 +1416,7 @@ CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, uint16 data, uint3 /* Copy other important data from the front engine */ new_head->CopyVehicleConfigAndStatistics(first); GroupStatistics::CountVehicle(new_head, 1); // after copying over the profit - } else if (v->IsPrimaryVehicle() && data & (MAKE_ORDER_BACKUP_FLAG >> 20)) { + } else if (v->IsPrimaryVehicle() && backup_order) { OrderBackup::Backup(v, user); } diff --git a/src/train_cmd.h b/src/train_cmd.h index 7b286e9983..4a7e5036ec 100644 --- a/src/train_cmd.h +++ b/src/train_cmd.h @@ -14,8 +14,8 @@ #include "engine_type.h" #include "vehicle_type.h" -CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, uint16 data, Vehicle **v); -CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *v, uint16 data, uint32 user); +CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, bool free_cars, Vehicle **ret); +CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user); CommandProc CmdMoveRailVehicle; CommandProc CmdForceTrainProceed; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index aeaefe68f4..f25a3cdd3e 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -79,15 +79,13 @@ const StringID _send_to_depot_msg_table[] = { * Build a vehicle. * @param flags for command * @param tile tile of depot where the vehicle is built - * @param p1 various bitstuffed data - * bits 0-15: vehicle type being built. - * bits 16-23: vehicle type specific bits passed on to the vehicle build functions. - * bits 24-31: refit cargo type. - * @param p2 User - * @param text unused + * @param eid vehicle type being built. + * @param use_free_vehicles use free vehicles when building the vehicle. + * @param cargo refit cargo type. + * @param client_id User * @return the cost of this operation or an error */ -CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, bool use_free_vehicles, CargoID cargo, ClientID client_id) { /* Elementary check for valid location. */ if (!IsDepotTile(tile) || !IsTileOwner(tile, _current_company)) return CMD_ERROR; @@ -95,11 +93,9 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint VehicleType type = GetDepotVehicleType(tile); /* Validate the engine type. */ - EngineID eid = GB(p1, 0, 16); if (!IsEngineBuildable(eid, type, _current_company)) return_cmd_error(STR_ERROR_RAIL_VEHICLE_NOT_AVAILABLE + type); /* Validate the cargo type. */ - CargoID cargo = GB(p1, 24, 8); if (cargo >= NUM_CARGO && cargo != CT_INVALID) return CMD_ERROR; const Engine *e = Engine::Get(eid); @@ -140,10 +136,10 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint Vehicle *v = nullptr; switch (type) { - case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(subflags, tile, e, GB(p1, 16, 8), &v)); break; - case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(subflags, tile, e, GB(p1, 16, 8), &v)); break; - case VEH_SHIP: value.AddCost(CmdBuildShip (subflags, tile, e, GB(p1, 16, 8), &v)); break; - case VEH_AIRCRAFT: value.AddCost(CmdBuildAircraft (subflags, tile, e, GB(p1, 16, 8), &v)); break; + case VEH_TRAIN: value.AddCost(CmdBuildRailVehicle(subflags, tile, e, use_free_vehicles, &v)); break; + case VEH_ROAD: value.AddCost(CmdBuildRoadVehicle(subflags, tile, e, &v)); break; + case VEH_SHIP: value.AddCost(CmdBuildShip (subflags, tile, e, &v)); break; + case VEH_AIRCRAFT: value.AddCost(CmdBuildAircraft (subflags, tile, e, &v)); break; default: NOT_REACHED(); // Safe due to IsDepotTile() } @@ -176,14 +172,14 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (v->IsPrimaryVehicle()) { GroupStatistics::CountVehicle(v, 1); - if (!(subflags & DC_AUTOREPLACE)) OrderBackup::Restore(v, p2); + if (!(subflags & DC_AUTOREPLACE)) OrderBackup::Restore(v, client_id); } } /* If we are not in DC_EXEC undo everything */ if (flags != subflags) { - Command::Do(DC_EXEC, 0, v->index, 0, {}); + Command::Do(DC_EXEC, 0, v->index, false, false, INVALID_CLIENT_ID); } } @@ -197,17 +193,16 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * Sell a vehicle. * @param tile unused. * @param flags for command. - * @param p1 various bitstuffed data. - * bits 0-19: vehicle ID being sold. - * bits 20-30: vehicle type specific bits passed on to the vehicle build functions. - * bit 31: make a backup of the vehicle's order (if an engine). - * @param p2 User. + * @aram v_id vehicle ID being sold. + * @param sell_chain sell the vehicle and all vehicles following it in the chain. + * @param backup_order make a backup of the vehicle's order (if an engine). + * @param client_id User. * @param text unused. * @return the cost of this operation or an error. */ -CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id) { - Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20)); + Vehicle *v = Vehicle::GetIfValid(v_id); if (v == nullptr) return CMD_ERROR; Vehicle *front = v->First(); @@ -220,22 +215,22 @@ CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 if (!front->IsStoppedInDepot()) return_cmd_error(STR_ERROR_TRAIN_MUST_BE_STOPPED_INSIDE_DEPOT + front->type); /* Can we actually make the order backup, i.e. are there enough orders? */ - if (p1 & MAKE_ORDER_BACKUP_FLAG && + if (backup_order && front->orders.list != nullptr && !front->orders.list->IsShared() && !Order::CanAllocateItem(front->orders.list->GetNumOrders())) { /* Only happens in exceptional cases when there aren't enough orders anyhow. * Thus it should be safe to just drop the orders in that case. */ - p1 &= ~MAKE_ORDER_BACKUP_FLAG; + backup_order = false; } if (v->type == VEH_TRAIN) { - ret = CmdSellRailWagon(flags, v, GB(p1, 20, 12), p2); + ret = CmdSellRailWagon(flags, v, sell_chain, backup_order, client_id); } else { ret = CommandCost(EXPENSES_NEW_VEHICLES, -front->value); if (flags & DC_EXEC) { - if (front->IsPrimaryVehicle() && p1 & MAKE_ORDER_BACKUP_FLAG) OrderBackup::Backup(front, p2); + if (front->IsPrimaryVehicle() && backup_order) OrderBackup::Backup(front, client_id); delete front; } } @@ -694,7 +689,7 @@ CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, uint32 CommandCost last_error = CMD_ERROR; bool had_success = false; for (uint i = 0; i < list.size(); i++) { - CommandCost ret = Command::Do(flags, tile, list[i]->index | (1 << 20), 0, {}); + CommandCost ret = Command::Do(flags, tile, list[i]->index, true, false, INVALID_CLIENT_ID); if (ret.Succeeded()) { cost.AddCost(ret); had_success = true; @@ -872,11 +867,11 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint DoCommandFlag build_flags = flags; if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE; - CommandCost cost = Command::Do(build_flags, tile, v->engine_type | (1 << 16) | (CT_INVALID << 24), 0, {}); + CommandCost cost = Command::Do(build_flags, tile, v->engine_type, false, CT_INVALID, INVALID_CLIENT_ID); if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ - if (w_front != nullptr) Command::Do(flags, w_front->tile, w_front->index | (1 << 20), 0, {}); + if (w_front != nullptr) Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); return cost; } @@ -896,8 +891,8 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (result.Failed()) { /* The train can't be joined to make the same consist as the original. * Sell what we already made (clean up) and return an error. */ - Command::Do(flags, w_front->tile, w_front->index | 1 << 20, 0, {}); - Command::Do(flags, w_front->tile, w->index | 1 << 20, 0, {}); + Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); + Command::Do(flags, w_front->tile, w->index, true, false, INVALID_CLIENT_ID); return result; // return error and the message returned from CMD_MOVE_RAIL_VEHICLE } } else { @@ -978,7 +973,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint CommandCost result = Command::Do(flags, 0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index, {}); if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ - Command::Do(flags, w_front->tile, w_front->index | 1 << 20, 0, {}); + Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); return result; } @@ -989,7 +984,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * check whether the company has enough money manually. */ if (!CheckCompanyHasMoney(total_cost)) { /* The vehicle has already been bought, so now it must be sold again. */ - Command::Do(flags, w_front->tile, w_front->index | 1 << 20, 0, {}); + Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); return total_cost; } } diff --git a/src/vehicle_cmd.h b/src/vehicle_cmd.h index e6872e838b..98444033cc 100644 --- a/src/vehicle_cmd.h +++ b/src/vehicle_cmd.h @@ -12,8 +12,8 @@ #include "command_type.h" -CommandProc CmdBuildVehicle; -CommandProc CmdSellVehicle; +CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, bool use_free_vehicles, CargoID cargo, ClientID client_id); +CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id); CommandProc CmdRefitVehicle; CommandProc CmdSendVehicleToDepot; CommandProc CmdChangeServiceInt; From de45a8729c0f1ab965e4adf4e6ad7095a4a678c8 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Fri, 5 Nov 2021 23:56:33 +0100 Subject: [PATCH 121/710] Codechange: Add DoCommand::Post specialization for commands that take no TileIndex. This adds a new Post overloads that still take a TileIndex which is used to place any error windows or text effects. --- src/command_func.h | 55 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/src/command_func.h b/src/command_func.h index e1f958f5bd..2a1c3dc37b 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -79,7 +79,7 @@ private: }; -template struct CommandHelper; +template struct CommandHelper; class CommandHelperBase { protected: @@ -100,7 +100,7 @@ protected: * @tparam Targs The command parameter types. */ template -struct CommandHelper : protected CommandHelperBase { +struct CommandHelper : protected CommandHelperBase { public: /** * This function executes a given command with the parameters from the #CommandProc parameter list. @@ -342,7 +342,56 @@ protected: } }; +/** + * Overload for #CommandHelper that exposes additional \c Post variants + * for commands that don't take a TileIndex themselves. + * @tparam Tcmd The command-id to execute. + * @tparam Targs The command parameter types. + */ +template +struct CommandHelper : CommandHelper +{ + /* Import Post overloads from our base class. */ + using CommandHelper::Post; + + /** + * Shortcut for Post when not using an error message. + * @param err_message Message prefix to show on error + * @param location Tile location for user feedback. + * @param args Parameters for the command + */ + static inline bool Post(StringID err_message, TileIndex location, Targs... args) { return Post(err_message, nullptr, location, std::forward(args)...); } + /** + * Shortcut for Post when not using a callback. + * @param callback A callback function to call after the command is finished + * @param location Tile location for user feedback. + * @param args Parameters for the command + */ + static inline bool Post(CommandCallback *callback, TileIndex location, Targs... args) { return Post((StringID)0, callback, location, std::forward(args)...); } + /** + * Shortcut for Post when not using a callback or an error message. + * @param location Tile location for user feedback. + * @param args Parameters for the command* + */ + static inline bool Post(TileIndex location, Targs... args) { return Post((StringID)0, nullptr, location, std::forward(args)...); } + + /** + * Post variant that takes a TileIndex (for error window location and text effects) for + * commands that don't take a TileIndex by themselves. + * @param err_message Message prefix to show on error + * @param callback A callback function to call after the command is finished + * @param location Tile location for user feedback. + * @param args Parameters for the command + * @return \c true if the command succeeded, else \c false. + */ + static inline bool Post(StringID err_message, CommandCallback *callback, TileIndex location, Targs... args) + { + return CommandHelper::InternalPost(err_message, callback, true, false, location, std::forward_as_tuple(args...)); + } +}; + + template -using Command = CommandHelper::ProcType>; +using Command = CommandHelper::ProcType, std::is_same_v::Args>>>; #endif /* COMMAND_FUNC_H */ From 211c630cbe4185a2adf8b8cd8f52ca58f8bf17ed Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Tue, 2 Nov 2021 22:58:40 +0100 Subject: [PATCH 122/710] Codechange: Un-bitstuff order commands. --- src/autoreplace_cmd.cpp | 2 +- src/order_backup.cpp | 2 +- src/order_base.h | 9 ++- src/order_cmd.cpp | 108 ++++++++++---------------------- src/order_cmd.h | 27 +++++--- src/order_gui.cpp | 41 ++++++------ src/order_type.h | 4 +- src/script/api/script_order.cpp | 40 ++++++------ src/vehicle_cmd.cpp | 2 +- src/vehicle_gui.cpp | 2 +- 10 files changed, 106 insertions(+), 131 deletions(-) diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 6a8937cb65..cda42643be 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -402,7 +402,7 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head, CommandCost cost = CommandCost(); /* Share orders */ - if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, 0, new_head->index | CO_SHARE << 30, old_head->index, {})); + if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, CO_SHARE, new_head->index, old_head->index)); /* Copy group membership */ if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, 0, old_head->group_id, new_head->index, {})); diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 69ae6507db..1818029f22 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -75,7 +75,7 @@ void OrderBackup::DoRestore(Vehicle *v) { /* If we had shared orders, recover that */ if (this->clone != nullptr) { - Command::Do(DC_EXEC, 0, v->index | CO_SHARE << 30, this->clone->index, {}); + Command::Do(DC_EXEC, CO_SHARE, v->index, this->clone->index); } else if (this->orders != nullptr && OrderList::CanAllocateItem()) { v->orders.list = new OrderList(this->orders, v); this->orders = nullptr; diff --git a/src/order_base.h b/src/order_base.h index a722ef5d45..836ceb4b04 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -25,6 +25,9 @@ typedef Pool OrderListPool; extern OrderPool _order_pool; extern OrderListPool _orderlist_pool; +template +class EndianBufferWriter; + /* If you change this, keep in mind that it is saved on 3 places: * - Load_ORDR, all the global orders * - Vehicle -> current_order @@ -38,6 +41,10 @@ private: friend class SlVehicleCommon; friend class SlVehicleDisaster; + template + friend EndianBufferWriter &operator <<(EndianBufferWriter &buffer, const Order &data); + friend class EndianBufferReader &operator >>(class EndianBufferReader &buffer, Order &order); + uint8 type; ///< The type of order + non-stop flags uint8 flags; ///< Load/unload types, depot order/action types. DestinationID dest; ///< The destination of the order. @@ -51,7 +58,7 @@ private: public: Order *next; ///< Pointer to next order. If nullptr, end of list - Order() : flags(0), refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {} + Order() : flags(0), refit_cargo(CT_NO_REFIT), wait_time(0), travel_time(0), max_speed(UINT16_MAX) {} ~Order(); Order(uint32 packed); diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 45a0db99fe..66e79989a8 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -729,28 +729,25 @@ uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int /** * Add an order to the orderlist of a vehicle. * @param flags operation to perform - * @param tile unused * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 19) - ID of the vehicle - * - p1 = (bit 24 - 31) - the selected order (if any). If the last order is given, + * @param veh ID of the vehicle + * @param sel_ord the selected order (if any). If the last order is given, * the order will be inserted before that one * the maximum vehicle order id is 254. - * @param p2 packed order to insert - * @param text unused + * @param new_order order to insert * @return the cost of this operation or an error */ -CommandCost CmdInsertOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdInsertOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, const Order &new_order) { - VehicleID veh = GB(p1, 0, 20); - VehicleOrderID sel_ord = GB(p1, 20, 8); - Order new_order(p2); - Vehicle *v = Vehicle::GetIfValid(veh); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; + /* Validate properties we don't want to have different from default as they are set by other commands. */ + if (new_order.GetRefitCargo() != CT_NO_REFIT || new_order.GetWaitTime() != 0 || new_order.GetTravelTime() != 0 || new_order.GetMaxSpeed() != UINT16_MAX) return CMD_ERROR; + /* Check if the inserted order is to the correct destination (owner, type), * and has the correct flags if any */ switch (new_order.GetType()) { @@ -1008,17 +1005,12 @@ static CommandCost DecloneOrder(Vehicle *dst, DoCommandFlag flags) /** * Delete an order from the orderlist of a vehicle. * @param flags operation to perform - * @param tile unused - * @param p1 the ID of the vehicle - * @param p2 the order to delete (max 255) - * @param text unused + * @param veh_id the ID of the vehicle + * @param sel_ord the order to delete (max 255) * @return the cost of this operation or an error */ -CommandCost CmdDeleteOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDeleteOrder(DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord) { - VehicleID veh_id = GB(p1, 0, 20); - VehicleOrderID sel_ord = GB(p2, 0, 8); - Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; @@ -1113,17 +1105,12 @@ void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord) /** * Goto order of order-list. * @param flags operation to perform - * @param tile unused - * @param p1 The ID of the vehicle which order is skipped - * @param p2 the selected order to which we want to skip - * @param text unused + * @param veh_id The ID of the vehicle which order is skipped + * @param sel_ord the selected order to which we want to skip * @return the cost of this operation or an error */ -CommandCost CmdSkipToOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSkipToOrder(DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord) { - VehicleID veh_id = GB(p1, 0, 20); - VehicleOrderID sel_ord = GB(p2, 0, 8); - Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle() || sel_ord == v->cur_implicit_order_index || sel_ord >= v->GetNumOrders() || v->GetNumOrders() < 2) return CMD_ERROR; @@ -1150,22 +1137,15 @@ CommandCost CmdSkipToOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 /** * Move an order inside the orderlist * @param flags operation to perform - * @param tile unused - * @param p1 the ID of the vehicle - * @param p2 order to move and target - * bit 0-15 : the order to move - * bit 16-31 : the target order - * @param text unused + * @param veh the ID of the vehicle + * @param moving_order the order to move + * @param target_order the target order * @return the cost of this operation or an error * @note The target order will move one place down in the orderlist * if you move the order upwards else it'll move it one place down */ -CommandCost CmdMoveOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMoveOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID moving_order, VehicleOrderID target_order) { - VehicleID veh = GB(p1, 0, 20); - VehicleOrderID moving_order = GB(p2, 0, 16); - VehicleOrderID target_order = GB(p2, 16, 16); - Vehicle *v = Vehicle::GetIfValid(veh); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; @@ -1251,25 +1231,16 @@ CommandCost CmdMoveOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Modify an order in the orderlist of a vehicle. * @param flags operation to perform - * @param tile unused - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 19) - ID of the vehicle - * - p1 = (bit 24 - 31) - the selected order (if any). If the last order is given, - * the order will be inserted before that one - * the maximum vehicle order id is 254. - * @param p2 various bitstuffed elements - * - p2 = (bit 0 - 3) - what data to modify (@see ModifyOrderFlags) - * - p2 = (bit 4 - 15) - the data to modify - * @param text unused + * @param veh ID of the vehicle + * @param sel_ord the selected order (if any). If the last order is given, + * the order will be inserted before that one + * the maximum vehicle order id is 254. + * @param mof what data to modify (@see ModifyOrderFlags) + * @param data the data to modify * @return the cost of this operation or an error */ -CommandCost CmdModifyOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdModifyOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, ModifyOrderFlags mof, uint16 data) { - VehicleOrderID sel_ord = GB(p1, 20, 8); - VehicleID veh = GB(p1, 0, 20); - ModifyOrderFlags mof = Extract(p2); - uint16 data = GB(p2, 4, 11); - if (mof >= MOF_END) return CMD_ERROR; Vehicle *v = Vehicle::GetIfValid(veh); @@ -1524,26 +1495,20 @@ static bool CheckAircraftOrderDistance(const Aircraft *v_new, const Vehicle *v_o /** * Clone/share/copy an order-list of another vehicle. * @param flags operation to perform - * @param tile unused - * @param p1 various bitstuffed elements - * - p1 = (bit 0-19) - destination vehicle to clone orders to - * - p1 = (bit 30-31) - action to perform - * @param p2 source vehicle to clone orders from, if any (none for CO_UNSHARE) - * @param text unused + * @param action action to perform + * @param veh_dst destination vehicle to clone orders to + * @param veh_src source vehicle to clone orders from, if any (none for CO_UNSHARE) * @return the cost of this operation or an error */ -CommandCost CmdCloneOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCloneOrder(DoCommandFlag flags, CloneOptions action, VehicleID veh_dst, VehicleID veh_src) { - VehicleID veh_src = GB(p2, 0, 20); - VehicleID veh_dst = GB(p1, 0, 20); - Vehicle *dst = Vehicle::GetIfValid(veh_dst); if (dst == nullptr || !dst->IsPrimaryVehicle()) return CMD_ERROR; CommandCost ret = CheckOwnership(dst->owner); if (ret.Failed()) return ret; - switch (GB(p1, 30, 2)) { + switch (action) { case CO_SHARE: { Vehicle *src = Vehicle::GetIfValid(veh_src); @@ -1671,20 +1636,13 @@ CommandCost CmdCloneOrder(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Add/remove refit orders from an order * @param flags operation to perform - * @param tile Not used - * @param p1 VehicleIndex of the vehicle having the order - * @param p2 bitmask - * - bit 0-7 CargoID - * - bit 16-23 number of order to modify - * @param text unused + * @param veh VehicleIndex of the vehicle having the order + * @param order_number number of order to modify + * @param cargo CargoID * @return the cost of this operation or an error */ -CommandCost CmdOrderRefit(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdOrderRefit(DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, CargoID cargo) { - VehicleID veh = GB(p1, 0, 20); - VehicleOrderID order_number = GB(p2, 16, 8); - CargoID cargo = GB(p2, 0, 8); - if (cargo >= NUM_CARGO && cargo != CT_NO_REFIT && cargo != CT_AUTO_REFIT) return CMD_ERROR; const Vehicle *v = Vehicle::GetIfValid(veh); diff --git a/src/order_cmd.h b/src/order_cmd.h index fa3424ce42..aeb42b6240 100644 --- a/src/order_cmd.h +++ b/src/order_cmd.h @@ -11,14 +11,16 @@ #define ORDER_CMD_H #include "command_type.h" +#include "order_base.h" +#include "misc/endian_buffer.hpp" -CommandProc CmdModifyOrder; -CommandProc CmdSkipToOrder; -CommandProc CmdDeleteOrder; -CommandProc CmdInsertOrder; -CommandProc CmdOrderRefit; -CommandProc CmdCloneOrder; -CommandProc CmdMoveOrder; +CommandCost CmdModifyOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, ModifyOrderFlags mof, uint16 data); +CommandCost CmdSkipToOrder(DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord); +CommandCost CmdDeleteOrder(DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord); +CommandCost CmdInsertOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, const Order &new_order); +CommandCost CmdOrderRefit(DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, CargoID cargo); +CommandCost CmdCloneOrder(DoCommandFlag flags, CloneOptions action, VehicleID veh_dst, VehicleID veh_src); +CommandCost CmdMoveOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID moving_order, VehicleOrderID target_order); CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, ClientID user_id); DEF_CMD_TRAIT(CMD_MODIFY_ORDER, CmdModifyOrder, 0, CMDT_ROUTE_MANAGEMENT) @@ -30,4 +32,15 @@ DEF_CMD_TRAIT(CMD_CLONE_ORDER, CmdCloneOrder, 0, CMDT_ DEF_CMD_TRAIT(CMD_MOVE_ORDER, CmdMoveOrder, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_CLEAR_ORDER_BACKUP, CmdClearOrderBackup, CMD_CLIENT_ID, CMDT_SERVER_SETTING) +template +inline EndianBufferWriter &operator <<(EndianBufferWriter &buffer, const Order &order) +{ + return buffer << order.type << order.flags << order.dest << order.refit_cargo << order.wait_time << order.travel_time << order.max_speed; +} + +inline EndianBufferReader &operator >>(EndianBufferReader &buffer, Order &order) +{ + return buffer >> order.type >> order.flags >> order.dest >> order.refit_cargo >> order.wait_time >> order.travel_time >> order.max_speed; +} + #endif /* ORDER_CMD_H */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 50413c7352..982c8f7b29 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -30,6 +30,7 @@ #include "engine_func.h" #include "vehicle_func.h" #include "order_cmd.h" +#include "company_cmd.h" #include "widgets/order_widget.h" @@ -592,7 +593,7 @@ private: } if (order->GetLoadType() == load_type) return; // If we still match, do nothing - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (load_type << 4), {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, sel_ord, MOF_LOAD, load_type); } /** @@ -607,7 +608,7 @@ private: if (order == nullptr) return; i = (order->GetDepotOrderType() & ODTFB_SERVICE) ? DA_ALWAYS_GO : DA_SERVICE; } - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_DEPOT_ACTION | (i << 4), {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, sel_ord, MOF_DEPOT_ACTION, i); } /** @@ -622,7 +623,7 @@ private: _settings_client.gui.new_nonstop && this->vehicle->IsGroundVehicle() ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); order.SetDepotActionType(ODATFB_NEAREST_DEPOT); - Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack(), {}); + Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), order); } /** @@ -642,11 +643,11 @@ private: } if (order->GetUnloadType() == unload_type) return; // If we still match, do nothing - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_UNLOAD | (unload_type << 4), {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, sel_ord, MOF_UNLOAD, unload_type); /* Transfer and unload orders with leave empty as default */ if (unload_type == OUFB_TRANSFER || unload_type == OUFB_UNLOAD) { - Command::Post(this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_LOAD | (OLFB_NO_LOAD << 4), {}); + Command::Post(this->vehicle->tile, this->vehicle->index, sel_ord, MOF_LOAD, OLFB_NO_LOAD); this->SetWidgetDirty(WID_O_FULL_LOAD); } } @@ -670,7 +671,7 @@ private: } this->SetWidgetDirty(WID_O_NON_STOP); - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel_ord << 20), MOF_NON_STOP | non_stop << 4, {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, sel_ord, MOF_NON_STOP, non_stop); } /** @@ -684,7 +685,7 @@ private: if (this->vehicle->GetNumOrders() <= 1) return; Command::Post(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER, - this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders()), {}); + this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())); } /** @@ -695,7 +696,7 @@ private: /* When networking, move one order lower */ int selected = this->selected_order + (int)_networking; - if (Command::Post(STR_ERROR_CAN_T_DELETE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), {})) { + if (Command::Post(STR_ERROR_CAN_T_DELETE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel())) { this->selected_order = selected >= this->vehicle->GetNumOrders() ? -1 : selected; this->UpdateButtonState(); } @@ -720,7 +721,7 @@ private: /* Get another vehicle that share orders with this vehicle. */ Vehicle *other_shared = (this->vehicle->FirstShared() == this->vehicle) ? this->vehicle->NextShared() : this->vehicle->PreviousShared(); /* Copy the order list of the other vehicle. */ - if (Command::Post(STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST, this->vehicle->tile, this->vehicle->index | CO_COPY << 30, other_shared->index, {})) { + if (Command::Post(STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST, this->vehicle->tile, CO_COPY, this->vehicle->index, other_shared->index)) { this->UpdateButtonState(); } } @@ -735,10 +736,10 @@ private: { if (_ctrl_pressed) { /* Cancel refitting */ - Command::Post(this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT, {}); + Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CT_NO_REFIT); } else { if (i == 1) { // Auto-refit to available cargo type. - Command::Post(this->vehicle->tile, this->vehicle->index, (this->OrderGetSel() << 16) | CT_AUTO_REFIT, {}); + Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CT_AUTO_REFIT); } else { ShowVehicleRefitWindow(this->vehicle, this->OrderGetSel(), this, auto_refit); } @@ -1160,7 +1161,7 @@ public: order.index = 0; order.MakeConditional(order_id); - Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), order.Pack(), {}); + Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), order); } ResetObjectToPlace(); break; @@ -1184,8 +1185,8 @@ public: } else if (sel == this->selected_order) { if (this->vehicle->type == VEH_TRAIN && sel < this->vehicle->GetNumOrders()) { Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, - this->vehicle->tile, this->vehicle->index + (sel << 20), - MOF_STOP_LOCATION | ((this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END) << 4, {}); + this->vehicle->tile, this->vehicle->index, sel, + MOF_STOP_LOCATION, (this->vehicle->GetOrder(sel)->GetStopLocation() + 1) % OSL_END); } } else { /* Select clicked order */ @@ -1332,7 +1333,7 @@ public: default: break; } - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (sel << 20), MOF_COND_VALUE | Clamp(value, 0, 2047) << 4, {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, sel, MOF_COND_VALUE, Clamp(value, 0, 2047)); } } @@ -1370,11 +1371,11 @@ public: break; case WID_O_COND_VARIABLE: - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_VARIABLE | index << 4, {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), MOF_COND_VARIABLE, index); break; case WID_O_COND_COMPARATOR: - Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), MOF_COND_COMPARATOR | index << 4, {}); + Command::Post(STR_ERROR_CAN_T_MODIFY_THIS_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), MOF_COND_COMPARATOR, index); break; } } @@ -1387,7 +1388,7 @@ public: VehicleOrderID to_order = this->GetOrderFromPt(pt.y); if (!(from_order == to_order || from_order == INVALID_VEH_ORDER_ID || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_VEH_ORDER_ID || to_order > this->vehicle->GetNumOrders()) && - Command::Post(STR_ERROR_CAN_T_MOVE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16), {})) { + Command::Post(STR_ERROR_CAN_T_MOVE_THIS_ORDER, this->vehicle->tile, this->vehicle->index, from_order, to_order)) { this->selected_order = -1; this->UpdateButtonState(); } @@ -1439,7 +1440,7 @@ public: const Order cmd = GetOrderCmdFromTile(this->vehicle, tile); if (cmd.IsType(OT_NOTHING)) return; - if (Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index + (this->OrderGetSel() << 20), cmd.Pack(), {})) { + if (Command::Post(STR_ERROR_CAN_T_INSERT_NEW_ORDER, this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), cmd)) { /* With quick goto the Go To button stays active */ if (!_settings_client.gui.quick_goto) ResetObjectToPlace(); } @@ -1457,7 +1458,7 @@ public: if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; if (Command::Post(share_order ? STR_ERROR_CAN_T_SHARE_ORDER_LIST : STR_ERROR_CAN_T_COPY_ORDER_LIST, - this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index, {})) { + this->vehicle->tile, share_order ? CO_SHARE : CO_COPY, this->vehicle->index, v->index)) { this->selected_order = -1; ResetObjectToPlace(); } diff --git a/src/order_type.h b/src/order_type.h index 9f4d0ba22b..6743529078 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -140,7 +140,7 @@ enum OrderConditionComparator { /** * Enumeration for the data to set in #CmdModifyOrder. */ -enum ModifyOrderFlags { +enum ModifyOrderFlags : byte { MOF_NON_STOP, ///< Passes an OrderNonStopFlags. MOF_STOP_LOCATION, ///< Passes an OrderStopLocation. MOF_UNLOAD, ///< Passes an OrderUnloadType. @@ -177,7 +177,7 @@ template <> struct EnumPropsT : MakeEnumPropsT::Do(0, vehicle_id | (order_position << 20), MOF_COND_DESTINATION | (jump_to << 4), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_position, MOF_COND_DESTINATION, jump_to); } /* static */ bool ScriptOrder::SetOrderCondition(VehicleID vehicle_id, OrderPosition order_position, OrderCondition condition) @@ -390,7 +390,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, condition >= OC_LOAD_PERCENTAGE && condition <= OC_REMAINING_LIFETIME); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), MOF_COND_VARIABLE | (condition << 4), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, MOF_COND_VARIABLE, condition); } /* static */ bool ScriptOrder::SetOrderCompareFunction(VehicleID vehicle_id, OrderPosition order_position, CompareFunction compare) @@ -400,7 +400,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, compare >= CF_EQUALS && compare <= CF_IS_FALSE); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), MOF_COND_COMPARATOR | (compare << 4), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, MOF_COND_COMPARATOR, compare); } /* static */ bool ScriptOrder::SetOrderCompareValue(VehicleID vehicle_id, OrderPosition order_position, int32 value) @@ -411,7 +411,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr if (GetOrderCondition(vehicle_id, order_position) == OC_MAX_SPEED) value = value * 10 / 16; int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), MOF_COND_VALUE | (value << 4), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, MOF_COND_VALUE, value); } /* static */ bool ScriptOrder::SetStopLocation(VehicleID vehicle_id, OrderPosition order_position, StopLocation stop_location) @@ -424,9 +424,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr order_position = ScriptOrder::ResolveOrderPosition(vehicle_id, order_position); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - uint32 p1 = vehicle_id | (order_pos << 20); - uint32 p2 = MOF_STOP_LOCATION | (stop_location << 4); - return ScriptObject::Command::Do(0, p1, p2, {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, MOF_STOP_LOCATION, stop_location); } /* static */ bool ScriptOrder::SetOrderRefit(VehicleID vehicle_id, OrderPosition order_position, CargoID refit_cargo) @@ -435,9 +433,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, IsGotoStationOrder(vehicle_id, order_position) || (IsGotoDepotOrder(vehicle_id, order_position) && refit_cargo != CT_AUTO_REFIT)); EnforcePrecondition(false, ScriptCargo::IsValidCargo(refit_cargo) || refit_cargo == CT_AUTO_REFIT || refit_cargo == CT_NO_REFIT); - uint32 p1 = vehicle_id; - uint32 p2 = refit_cargo | ScriptOrderPositionToRealOrderPosition(vehicle_id, ScriptOrder::ResolveOrderPosition(vehicle_id, order_position)) << 16; - return ScriptObject::Command::Do(0, p1, p2, {}); + return ScriptObject::Command::Do(0, vehicle_id, ScriptOrderPositionToRealOrderPosition(vehicle_id, ScriptOrder::ResolveOrderPosition(vehicle_id, order_position)), refit_cargo); } /* static */ bool ScriptOrder::AppendOrder(VehicleID vehicle_id, TileIndex destination, ScriptOrderFlags order_flags) @@ -507,7 +503,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr order.SetNonStopType((OrderNonStopFlags)GB(order_flags, 0, 2)); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), order.Pack(), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, order); } /* static */ bool ScriptOrder::InsertConditionalOrder(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to) @@ -523,7 +519,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr order.MakeConditional(jump_to); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::Command::Do(0, vehicle_id | (order_pos << 20), order.Pack(), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos, order); } /* static */ bool ScriptOrder::RemoveOrder(VehicleID vehicle_id, OrderPosition order_position) @@ -533,7 +529,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position)); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position); - return ScriptObject::Command::Do(0, vehicle_id, order_pos, {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos); } /* static */ bool ScriptOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order) @@ -543,7 +539,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order)); int order_pos = ScriptOrderPositionToRealOrderPosition(vehicle_id, next_order); - return ScriptObject::Command::Do(0, vehicle_id, order_pos, {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos); } /** @@ -587,7 +583,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, (order_flags & OF_GOTO_NEAREST_DEPOT) == (current & OF_GOTO_NEAREST_DEPOT)); if ((current & OF_NON_STOP_FLAGS) != (order_flags & OF_NON_STOP_FLAGS)) { - return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (order_flags & OF_NON_STOP_FLAGS) << 4 | MOF_NON_STOP, {}); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, vehicle_id, order_pos, MOF_NON_STOP, order_flags & OF_NON_STOP_FLAGS); } switch (order->GetType()) { @@ -596,16 +592,16 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) uint data = DA_ALWAYS_GO; if (order_flags & OF_SERVICE_IF_NEEDED) data = DA_SERVICE; if (order_flags & OF_STOP_IN_DEPOT) data = DA_STOP; - return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (data << 4) | MOF_DEPOT_ACTION, {}); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, vehicle_id, order_pos, MOF_DEPOT_ACTION, data); } break; case OT_GOTO_STATION: if ((current & OF_UNLOAD_FLAGS) != (order_flags & OF_UNLOAD_FLAGS)) { - return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (order_flags & OF_UNLOAD_FLAGS) << 2 | MOF_UNLOAD, {}); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, vehicle_id, order_pos, MOF_UNLOAD, (order_flags & OF_UNLOAD_FLAGS) >> 2); } if ((current & OF_LOAD_FLAGS) != (order_flags & OF_LOAD_FLAGS)) { - return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, 0, vehicle_id | (order_pos << 20), (order_flags & OF_LOAD_FLAGS) >> 1 | MOF_LOAD, {}); + return ScriptObject::Command::Do(&::_DoCommandReturnSetOrderFlags, vehicle_id, order_pos, MOF_LOAD, (order_flags & OF_LOAD_FLAGS) >> 5); } break; @@ -639,7 +635,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) int order_pos_move = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_move); int order_pos_target = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_target); - return ScriptObject::Command::Do(0, vehicle_id, order_pos_move | (order_pos_target << 16), {}); + return ScriptObject::Command::Do(0, vehicle_id, order_pos_move, order_pos_target); } /* static */ bool ScriptOrder::CopyOrders(VehicleID vehicle_id, VehicleID main_vehicle_id) @@ -647,7 +643,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(main_vehicle_id)); - return ScriptObject::Command::Do(0, vehicle_id | CO_COPY << 30, main_vehicle_id, {}); + return ScriptObject::Command::Do(0, CO_COPY, vehicle_id, main_vehicle_id); } /* static */ bool ScriptOrder::ShareOrders(VehicleID vehicle_id, VehicleID main_vehicle_id) @@ -655,14 +651,14 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance) EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(main_vehicle_id)); - return ScriptObject::Command::Do(0, vehicle_id | CO_SHARE << 30, main_vehicle_id, {}); + return ScriptObject::Command::Do(0, CO_SHARE, vehicle_id, main_vehicle_id); } /* static */ bool ScriptOrder::UnshareOrders(VehicleID vehicle_id) { EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); - return ScriptObject::Command::Do(0, vehicle_id | CO_UNSHARE << 30, 0, {}); + return ScriptObject::Command::Do(0, CO_UNSHARE, vehicle_id, 0); } /* static */ uint ScriptOrder::GetOrderDistance(ScriptVehicle::VehicleType vehicle_type, TileIndex origin_tile, TileIndex dest_tile) diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index f25a3cdd3e..3f4bd2a5a0 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -970,7 +970,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * the vehicle refitted before doing this, otherwise the moved * cargo types might not match (passenger vs non-passenger) */ - CommandCost result = Command::Do(flags, 0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index, {}); + CommandCost result = Command::Do(flags, (p2 & 1 ? CO_SHARE : CO_COPY), w_front->index, v_front->index); if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 80b75e7ce8..2b7446a5e8 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1040,7 +1040,7 @@ struct RefitWindow : public Window { bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX; if (Command::Post(GetCmdRefitVehMsg(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16, {}) && delete_window) this->Close(); } else { - if (Command::Post(v->tile, v->index, this->cargo->cargo | this->order << 16, {})) this->Close(); + if (Command::Post(v->tile, v->index, this->order, this->cargo->cargo)) this->Close(); } } break; From 2637c06f88ed6f9dea55449883f42a62c30f19d8 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Thu, 4 Nov 2021 00:10:13 +0100 Subject: [PATCH 123/710] Codechange: Un-bitstuff timetable commands. --- src/date_gui.cpp | 11 ++++--- src/date_gui.h | 4 +-- src/order_type.h | 2 +- src/timetable_cmd.cpp | 68 ++++++++++++++----------------------------- src/timetable_cmd.h | 8 ++--- src/timetable_gui.cpp | 33 +++++++++------------ 6 files changed, 50 insertions(+), 76 deletions(-) diff --git a/src/date_gui.cpp b/src/date_gui.cpp index 9327287201..66c9a378a3 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -24,6 +24,7 @@ /** Window to select a date graphically by using dropdowns */ struct SetDateWindow : Window { SetDateCallback *callback; ///< Callback to call when a date has been selected + void *callback_data; ///< Callback data pointer. YearMonthDay date; ///< The currently selected date Year min_year; ///< The minimum year in the year dropdown Year max_year; ///< The maximum year (inclusive) in the year dropdown @@ -38,9 +39,10 @@ struct SetDateWindow : Window { * @param max_year the maximum year (inclusive) to show in the year dropdown * @param callback the callback to call once a date has been selected */ - SetDateWindow(WindowDesc *desc, WindowNumber window_number, Window *parent, Date initial_date, Year min_year, Year max_year, SetDateCallback *callback) : + SetDateWindow(WindowDesc *desc, WindowNumber window_number, Window *parent, Date initial_date, Year min_year, Year max_year, SetDateCallback *callback, void *callback_data) : Window(desc), callback(callback), + callback_data(callback_data), min_year(std::max(MIN_YEAR, min_year)), max_year(std::min(MAX_YEAR, max_year)) { @@ -146,7 +148,7 @@ struct SetDateWindow : Window { break; case WID_SD_SET_DATE: - if (this->callback != nullptr) this->callback(this, ConvertYMDToDate(this->date.year, this->date.month, this->date.day)); + if (this->callback != nullptr) this->callback(this, ConvertYMDToDate(this->date.year, this->date.month, this->date.day), this->callback_data); this->Close(); break; } @@ -209,9 +211,10 @@ static WindowDesc _set_date_desc( * @param min_year the minimum year to show in the year dropdown * @param max_year the maximum year (inclusive) to show in the year dropdown * @param callback the callback to call once a date has been selected + * @param callback_data extra callback data */ -void ShowSetDateWindow(Window *parent, int window_number, Date initial_date, Year min_year, Year max_year, SetDateCallback *callback) +void ShowSetDateWindow(Window *parent, int window_number, Date initial_date, Year min_year, Year max_year, SetDateCallback *callback, void *callback_data) { CloseWindowByClass(WC_SET_DATE); - new SetDateWindow(&_set_date_desc, window_number, parent, initial_date, min_year, max_year, callback); + new SetDateWindow(&_set_date_desc, window_number, parent, initial_date, min_year, max_year, callback, callback_data); } diff --git a/src/date_gui.h b/src/date_gui.h index 8d41ee3e71..da866d01f5 100644 --- a/src/date_gui.h +++ b/src/date_gui.h @@ -18,8 +18,8 @@ * @param w the window that sends the callback * @param date the date that has been chosen */ -typedef void SetDateCallback(const Window *w, Date date); +typedef void SetDateCallback(const Window *w, Date date, void *data); -void ShowSetDateWindow(Window *parent, int window_number, Date initial_date, Year min_year, Year max_year, SetDateCallback *callback); +void ShowSetDateWindow(Window *parent, int window_number, Date initial_date, Year min_year, Year max_year, SetDateCallback *callback, void *callback_data); #endif /* DATE_GUI_H */ diff --git a/src/order_type.h b/src/order_type.h index 6743529078..1a0687794a 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -167,7 +167,7 @@ enum OrderDepotAction { /** * Enumeration for the data to set in #CmdChangeTimetable. */ -enum ModifyTimetableFlags { +enum ModifyTimetableFlags : byte { MTF_WAIT_TIME, ///< Set wait time. MTF_TRAVEL_TIME, ///< Set travel time. MTF_TRAVEL_SPEED, ///< Set max travel speed. diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index c889e5374f..3e5695b51a 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -87,32 +87,24 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 val, /** * Change timetable data of an order. * @param flags Operation to perform. - * @param tile Not used. - * @param p1 Various bitstuffed elements - * - p1 = (bit 0-19) - Vehicle with the orders to change. - * - p1 = (bit 20-27) - Order index to modify. - * - p1 = (bit 28-29) - Timetable data to change (@see ModifyTimetableFlags) - * @param p2 The amount of time to wait. - * - p2 = (bit 0-15) - The data to modify as specified by p1 bits 28-29. - * 0 to clear times, UINT16_MAX to clear speed limit. - * @param text unused + * @param veh Vehicle with the orders to change. + * @param order_number Order index to modify. + * @param mtf Timetable data to change (@see ModifyTimetableFlags) + * @param data The data to modify as specified by \c mtf. + * 0 to clear times, UINT16_MAX to clear speed limit. * @return the cost of this operation or an error */ -CommandCost CmdChangeTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeTimetable(DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, ModifyTimetableFlags mtf, uint16 data) { - VehicleID veh = GB(p1, 0, 20); - Vehicle *v = Vehicle::GetIfValid(veh); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; - VehicleOrderID order_number = GB(p1, 20, 8); Order *order = v->GetOrder(order_number); if (order == nullptr || order->IsType(OT_IMPLICIT)) return CMD_ERROR; - ModifyTimetableFlags mtf = Extract(p1); if (mtf >= MTF_END) return CMD_ERROR; int wait_time = order->GetWaitTime(); @@ -120,15 +112,15 @@ CommandCost CmdChangeTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, u int max_speed = order->GetMaxSpeed(); switch (mtf) { case MTF_WAIT_TIME: - wait_time = GB(p2, 0, 16); + wait_time = data; break; case MTF_TRAVEL_TIME: - travel_time = GB(p2, 0, 16); + travel_time = data; break; case MTF_TRAVEL_SPEED: - max_speed = GB(p2, 0, 16); + max_speed = data; if (max_speed == 0) max_speed = UINT16_MAX; // Disable speed limit. break; @@ -185,17 +177,11 @@ CommandCost CmdChangeTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, u /** * Clear the lateness counter to make the vehicle on time. * @param flags Operation to perform. - * @param tile Not used. - * @param p1 Various bitstuffed elements - * - p1 = (bit 0-19) - Vehicle with the orders to change. - * @param p2 unused - * @param text unused + * @param veh Vehicle with the orders to change. * @return the cost of this operation or an error */ -CommandCost CmdSetVehicleOnTime(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetVehicleOnTime(DoCommandFlag flags, VehicleID veh) { - VehicleID veh = GB(p1, 0, 20); - Vehicle *v = Vehicle::GetIfValid(veh); if (v == nullptr || !v->IsPrimaryVehicle() || v->orders.list == nullptr) return CMD_ERROR; @@ -251,25 +237,20 @@ static bool VehicleTimetableSorter(Vehicle * const &a, Vehicle * const &b) /** * Set the start date of the timetable. * @param flags Operation to perform. - * @param tile Not used. - * @param p2 Various bitstuffed elements - * - p2 = (bit 0-19) - Vehicle ID. - * - p2 = (bit 20) - Set to 1 to set timetable start for all vehicles sharing this order - * @param p2 The timetable start date. - * @param text Not used. + * @param veh_id Vehicle ID. + * @param timetable_all Set to set timetable start for all vehicles sharing this order + * @param start_date The timetable start date. * @return The error or cost of the operation. */ -CommandCost CmdSetTimetableStart(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetTimetableStart(DoCommandFlag flags, VehicleID veh_id, bool timetable_all, Date start_date) { - bool timetable_all = HasBit(p1, 20); - Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20)); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle() || v->orders.list == nullptr) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; /* Don't let a timetable start more than 15 years into the future or 1 year in the past. */ - Date start_date = (Date)p2; if (start_date < 0 || start_date > MAX_DAY) return CMD_ERROR; if (start_date - _date > 15 * DAYS_IN_LEAP_YEAR) return CMD_ERROR; if (_date - start_date > DAYS_IN_LEAP_YEAR) return CMD_ERROR; @@ -316,18 +297,13 @@ CommandCost CmdSetTimetableStart(DoCommandFlag flags, TileIndex tile, uint32 p1, * actually takes to complete it. When starting to autofill the current times * are cleared and the timetable will start again from scratch. * @param flags Operation to perform. - * @param tile Not used. - * @param p1 Vehicle index. - * @param p2 Various bitstuffed elements - * - p2 = (bit 0) - Set to 1 to enable, 0 to disable autofill. - * - p2 = (bit 1) - Set to 1 to preserve waiting times in non-destructive mode - * @param text unused + * @param veh Vehicle index. + * @param autofill Enable or disable autofill + * @param preserve_wait_time Set to preserve waiting times in non-destructive mode * @return the cost of this operation or an error */ -CommandCost CmdAutofillTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAutofillTimetable(DoCommandFlag flags, VehicleID veh, bool autofill, bool preserve_wait_time) { - VehicleID veh = GB(p1, 0, 20); - Vehicle *v = Vehicle::GetIfValid(veh); if (v == nullptr || !v->IsPrimaryVehicle() || v->orders.list == nullptr) return CMD_ERROR; @@ -335,7 +311,7 @@ CommandCost CmdAutofillTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, if (ret.Failed()) return ret; if (flags & DC_EXEC) { - if (HasBit(p2, 0)) { + if (autofill) { /* Start autofilling the timetable, which clears the * "timetable has started" bit. Times are not cleared anymore, but are * overwritten when the order is reached now. */ @@ -343,7 +319,7 @@ CommandCost CmdAutofillTimetable(DoCommandFlag flags, TileIndex tile, uint32 p1, ClrBit(v->vehicle_flags, VF_TIMETABLE_STARTED); /* Overwrite waiting times only if they got longer */ - if (HasBit(p2, 1)) SetBit(v->vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME); + if (preserve_wait_time) SetBit(v->vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME); v->timetable_start = 0; v->lateness_counter = 0; diff --git a/src/timetable_cmd.h b/src/timetable_cmd.h index ba5e2b37e2..ddf1277372 100644 --- a/src/timetable_cmd.h +++ b/src/timetable_cmd.h @@ -12,10 +12,10 @@ #include "command_type.h" -CommandProc CmdChangeTimetable; -CommandProc CmdSetVehicleOnTime; -CommandProc CmdAutofillTimetable; -CommandProc CmdSetTimetableStart; +CommandCost CmdChangeTimetable(DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, ModifyTimetableFlags mtf, uint16 data); +CommandCost CmdSetVehicleOnTime(DoCommandFlag flags, VehicleID veh); +CommandCost CmdAutofillTimetable(DoCommandFlag flags, VehicleID veh, bool autofill, bool preserve_wait_time); +CommandCost CmdSetTimetableStart(DoCommandFlag flags, VehicleID veh_id, bool timetable_all, Date start_date); DEF_CMD_TRAIT(CMD_CHANGE_TIMETABLE, CmdChangeTimetable, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_SET_VEHICLE_ON_TIME, CmdSetVehicleOnTime, 0, CMDT_ROUTE_MANAGEMENT) diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 12c3914875..9a09bce365 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -23,6 +23,7 @@ #include "vehicle_gui.h" #include "settings_type.h" #include "timetable_cmd.h" +#include #include "widgets/timetable_widget.h" @@ -141,9 +142,9 @@ static void FillTimetableArrivalDepartureTable(const Vehicle *v, VehicleOrderID * @param w the window related to the setting of the date * @param date the actually chosen date */ -static void ChangeTimetableStartCallback(const Window *w, Date date) +static void ChangeTimetableStartCallback(const Window *w, Date date, void *data) { - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, w->window_number, date, {}); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, (VehicleID)w->window_number, reinterpret_cast(data) != 0, date); } @@ -502,14 +503,14 @@ struct TimetableWindow : Window { } } - static inline uint32 PackTimetableArgs(const Vehicle *v, uint selected, bool speed) + static inline std::tuple PackTimetableArgs(const Vehicle *v, uint selected, bool speed) { uint order_number = (selected + 1) / 2; ModifyTimetableFlags mtf = (selected % 2 == 1) ? (speed ? MTF_TRAVEL_SPEED : MTF_TRAVEL_TIME) : MTF_WAIT_TIME; if (order_number >= v->GetNumOrders()) order_number = 0; - return v->index | (order_number << 20) | (mtf << 28); + return { order_number, mtf }; } void OnClick(Point pt, int widget, int click_count) override @@ -530,7 +531,7 @@ struct TimetableWindow : Window { } case WID_VT_START_DATE: // Change the date that the timetable starts. - ShowSetDateWindow(this, v->index | (v->orders.list->IsCompleteTimetable() && _ctrl_pressed ? 1U << 20 : 0), _date, _cur_year, _cur_year + 15, ChangeTimetableStartCallback); + ShowSetDateWindow(this, v->index, _date, _cur_year, _cur_year + 15, ChangeTimetableStartCallback, reinterpret_cast(static_cast(v->orders.list->IsCompleteTimetable() && _ctrl_pressed))); break; case WID_VT_CHANGE_TIME: { // "Wait For" button. @@ -578,26 +579,23 @@ struct TimetableWindow : Window { } case WID_VT_CLEAR_TIME: { // Clear waiting time. - uint32 p1 = PackTimetableArgs(v, this->sel_index, false); - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, 0, {}); + auto [order_id, mtf] = PackTimetableArgs(v, this->sel_index, false); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, 0); break; } case WID_VT_CLEAR_SPEED: { // Clear max speed button. - uint32 p1 = PackTimetableArgs(v, this->sel_index, true); - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, UINT16_MAX, {}); + auto [order_id, mtf] = PackTimetableArgs(v, this->sel_index, true); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, UINT16_MAX); break; } case WID_VT_RESET_LATENESS: // Reset the vehicle's late counter. - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, 0, {}); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index); break; case WID_VT_AUTOFILL: { // Autofill the timetable. - uint32 p2 = 0; - if (!HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(p2, 0); - if (_ctrl_pressed) SetBit(p2, 1); - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, v->index, p2, {}); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, !HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE), _ctrl_pressed); break; } @@ -619,8 +617,6 @@ struct TimetableWindow : Window { const Vehicle *v = this->vehicle; - uint32 p1 = PackTimetableArgs(v, this->sel_index, this->query_is_speed_query); - uint64 val = StrEmpty(str) ? 0 : strtoul(str, nullptr, 10); if (this->query_is_speed_query) { val = ConvertDisplaySpeedToKmhishSpeed(val); @@ -628,9 +624,8 @@ struct TimetableWindow : Window { if (!_settings_client.gui.timetable_in_ticks) val *= DAY_TICKS; } - uint32 p2 = std::min(val, UINT16_MAX); - - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, 0, p1, p2, {}); + auto [order_id, mtf] = PackTimetableArgs(v, this->sel_index, this->query_is_speed_query); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, std::min(val, UINT16_MAX)); } void OnResize() override From 21675ec7e22bfe53f20300cc27b4d50c84aeb4dc Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Fri, 5 Nov 2021 23:55:23 +0100 Subject: [PATCH 124/710] Codechange: Un-bitstuff vehicle/engine commands. --- src/aircraft_cmd.cpp | 6 +- src/autoreplace_cmd.cpp | 32 ++--- src/build_vehicle_gui.cpp | 4 +- src/core/enum_type.hpp | 6 +- src/depot_gui.cpp | 16 +-- src/economy.cpp | 6 +- src/engine.cpp | 45 +++---- src/engine_cmd.h | 8 +- src/engine_gui.cpp | 2 +- src/group_gui.cpp | 4 +- src/order_cmd.cpp | 2 +- src/roadveh_cmd.cpp | 9 +- src/roadveh_cmd.h | 2 +- src/script/api/script_engine.cpp | 4 +- src/script/api/script_event_types.cpp | 2 +- src/script/api/script_vehicle.cpp | 24 ++-- src/train_cmd.cpp | 46 +++---- src/train_cmd.h | 6 +- src/train_gui.cpp | 2 +- src/vehicle.cpp | 10 +- src/vehicle_cmd.cpp | 168 ++++++++++---------------- src/vehicle_cmd.h | 34 ++++-- src/vehicle_gui.cpp | 32 +++-- src/vehicle_type.h | 15 +-- src/vehiclelist.h | 4 +- 25 files changed, 221 insertions(+), 268 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index f1263f00cd..f0a50b012f 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1275,7 +1275,7 @@ void HandleMissingAircraftOrders(Aircraft *v) const Station *st = GetTargetAirportIfValid(v); if (st == nullptr) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost ret = Command::Do(DC_EXEC, v->tile, v->index, 0, {}); + CommandCost ret = Command::Do(DC_EXEC, v->index, DepotCommand::None, {}); cur_company.Restore(); if (ret.Failed()) CrashAirplane(v); @@ -1638,7 +1638,7 @@ static void AircraftEventHandler_HeliTakeOff(Aircraft *v, const AirportFTAClass /* Send the helicopter to a hangar if needed for replacement */ if (v->NeedsAutomaticServicing()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - Command::Do(DC_EXEC, v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0, {}); + Command::Do(DC_EXEC, v->index, DepotCommand::Service | DepotCommand::LocateHangar, {}); cur_company.Restore(); } } @@ -1689,7 +1689,7 @@ static void AircraftEventHandler_Landing(Aircraft *v, const AirportFTAClass *apc /* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */ if (v->NeedsAutomaticServicing()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - Command::Do(DC_EXEC, v->tile, v->index | DEPOT_SERVICE, 0, {}); + Command::Do(DC_EXEC, v->index, DepotCommand::Service, {}); cur_company.Restore(); } } diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index cda42643be..8338172b02 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -355,13 +355,13 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic if (refit_cargo != CT_NO_REFIT) { byte subtype = GetBestFittingSubType(old_veh, new_veh, refit_cargo); - cost.AddCost(Command::Do(DC_EXEC, 0, new_veh->index, refit_cargo | (subtype << 8), {})); + cost.AddCost(Command::Do(DC_EXEC, new_veh->index, refit_cargo, subtype, false, false, 0)); assert(cost.Succeeded()); // This should be ensured by GetNewCargoTypeForReplace() } /* Try to reverse the vehicle, but do not care if it fails as the new type might not be reversible */ if (new_veh->type == VEH_TRAIN && HasBit(Train::From(old_veh)->flags, VRF_REVERSE_DIRECTION)) { - Command::Do(DC_EXEC, 0, new_veh->index, true, {}); + Command::Do(DC_EXEC, new_veh->index, true); } return cost; @@ -373,9 +373,9 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic * @param evaluate_callback shall the start/stop callback be evaluated? * @return success or error */ -static inline CommandCost CmdStartStopVehicle(const Vehicle *v, bool evaluate_callback) +static inline CommandCost DoCmdStartStopVehicle(const Vehicle *v, bool evaluate_callback) { - return Command::Do(DC_EXEC | DC_AUTOREPLACE, 0, v->index, evaluate_callback ? 1 : 0, {}); + return Command::Do(DC_EXEC | DC_AUTOREPLACE, v->index, evaluate_callback); } /** @@ -388,7 +388,7 @@ static inline CommandCost CmdStartStopVehicle(const Vehicle *v, bool evaluate_ca */ static inline CommandCost CmdMoveVehicle(const Vehicle *v, const Vehicle *after, DoCommandFlag flags, bool whole_chain) { - return Command::Do(flags | DC_NO_CARGO_CAP_CHECK, 0, v->index | (whole_chain ? 1 : 0) << 20, after != nullptr ? after->index : INVALID_VEHICLE, {}); + return Command::Do(flags | DC_NO_CARGO_CAP_CHECK, v->index, after != nullptr ? after->index : INVALID_VEHICLE, whole_chain); } /** @@ -411,10 +411,10 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head, if (cost.Succeeded()) { /* Start the vehicle, might be denied by certain things */ assert((new_head->vehstatus & VS_STOPPED) != 0); - cost.AddCost(CmdStartStopVehicle(new_head, true)); + cost.AddCost(DoCmdStartStopVehicle(new_head, true)); /* Stop the vehicle again, but do not care about evil newgrfs allowing starting but not stopping :p */ - if (cost.Succeeded()) cost.AddCost(CmdStartStopVehicle(new_head, false)); + if (cost.Succeeded()) cost.AddCost(DoCmdStartStopVehicle(new_head, false)); } /* Last do those things which do never fail (resp. we do not care about), but which are not undo-able */ @@ -471,11 +471,11 @@ static CommandCost ReplaceFreeUnit(Vehicle **single_unit, DoCommandFlag flags, b } /* Sell the old vehicle */ - cost.AddCost(Command::Do(flags, 0, old_v->index, false, false, INVALID_CLIENT_ID)); + cost.AddCost(Command::Do(flags, old_v->index, false, false, INVALID_CLIENT_ID)); /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - Command::Do(DC_EXEC, 0, new_v->index, false, false, INVALID_CLIENT_ID); + Command::Do(DC_EXEC, new_v->index, false, false, INVALID_CLIENT_ID); } } @@ -602,7 +602,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon assert(RailVehInfo(wagon->engine_type)->railveh_type == RAILVEH_WAGON); /* Sell wagon */ - [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC, 0, wagon->index, false, false, INVALID_CLIENT_ID); + [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC, wagon->index, false, false, INVALID_CLIENT_ID); assert(ret.Succeeded()); new_vehs[i] = nullptr; @@ -634,7 +634,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon /* Sell the vehicle. * Note: This might temporarily construct new trains, so use DC_AUTOREPLACE to prevent * it from failing due to engine limits. */ - cost.AddCost(Command::Do(flags | DC_AUTOREPLACE, 0, w->index, false, false, INVALID_CLIENT_ID)); + cost.AddCost(Command::Do(flags | DC_AUTOREPLACE, w->index, false, false, INVALID_CLIENT_ID)); if ((flags & DC_EXEC) != 0) { old_vehs[i] = nullptr; if (i == 0) old_head = nullptr; @@ -665,7 +665,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon if ((flags & DC_EXEC) == 0) { for (int i = num_units - 1; i >= 0; i--) { if (new_vehs[i] != nullptr) { - Command::Do(DC_EXEC, 0, new_vehs[i]->index, false, false, INVALID_CLIENT_ID); + Command::Do(DC_EXEC, new_vehs[i]->index, false, false, INVALID_CLIENT_ID); new_vehs[i] = nullptr; } } @@ -696,12 +696,12 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon } /* Sell the old vehicle */ - cost.AddCost(Command::Do(flags, 0, old_head->index, false, false, INVALID_CLIENT_ID)); + cost.AddCost(Command::Do(flags, old_head->index, false, false, INVALID_CLIENT_ID)); } /* If we are not in DC_EXEC undo everything */ if ((flags & DC_EXEC) == 0) { - Command::Do(DC_EXEC, 0, new_head->index, false, false, INVALID_CLIENT_ID); + Command::Do(DC_EXEC, new_head->index, false, false, INVALID_CLIENT_ID); } } } @@ -764,7 +764,7 @@ CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1 bool was_stopped = free_wagon || ((v->vehstatus & VS_STOPPED) != 0); /* Stop the vehicle */ - if (!was_stopped) cost.AddCost(CmdStartStopVehicle(v, true)); + if (!was_stopped) cost.AddCost(DoCmdStartStopVehicle(v, true)); if (cost.Failed()) return cost; assert(free_wagon || v->IsStoppedInDepot()); @@ -792,7 +792,7 @@ CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1 } /* Restart the vehicle */ - if (!was_stopped) cost.AddCost(CmdStartStopVehicle(v, false)); + if (!was_stopped) cost.AddCost(DoCmdStartStopVehicle(v, false)); } if (cost.Succeeded() && nothing_to_do) cost = CommandCost(STR_ERROR_AUTOREPLACE_NOTHING_TO_DO); diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index ef87699ef8..39f840f73b 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1461,7 +1461,7 @@ struct BuildVehicleWindow : Window { case WID_BV_SHOW_HIDE: { const Engine *e = (this->sel_engine == INVALID_ENGINE) ? nullptr : Engine::Get(this->sel_engine); if (e != nullptr) { - Command::Post(0, 0, this->sel_engine | (e->IsHidden(_current_company) ? 0 : (1u << 31)), {}); + Command::Post(this->sel_engine, !e->IsHidden(_current_company)); } break; } @@ -1637,7 +1637,7 @@ struct BuildVehicleWindow : Window { { if (str == nullptr) return; - Command::Post(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type, 0, this->rename_engine, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_TRAIN_TYPE + this->vehicle_type, this->rename_engine, str); } void OnDropdownSelect(int widget, int index) override diff --git a/src/core/enum_type.hpp b/src/core/enum_type.hpp index 72e23ba363..f094bae914 100644 --- a/src/core/enum_type.hpp +++ b/src/core/enum_type.hpp @@ -29,9 +29,9 @@ /** Operators to allow to work with enum as with type safe bit set in C++ */ # define DECLARE_ENUM_AS_BIT_SET(mask_t) \ - inline constexpr mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 | m2);} \ - inline constexpr mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 & m2);} \ - inline constexpr mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 ^ m2);} \ + inline constexpr mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 | (std::underlying_type::type)m2);} \ + inline constexpr mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 & (std::underlying_type::type)m2);} \ + inline constexpr mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((std::underlying_type::type)m1 ^ (std::underlying_type::type)m2);} \ inline constexpr mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \ inline constexpr mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \ inline constexpr mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \ diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 830bdbaeed..1b5929de7e 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -142,7 +142,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh if (wagon == v) return; - Command::Post(STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index, {}); + Command::Post(STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index, wagon == nullptr ? INVALID_VEHICLE : wagon->index, _ctrl_pressed); } static VehicleCellSize _base_block_sizes_depot[VEH_COMPANY_END]; ///< Cell size for vehicle images in the depot view. @@ -803,7 +803,7 @@ struct DepotWindow : Window { case WID_D_STOP_ALL: case WID_D_START_ALL: { VehicleListIdentifier vli(VL_DEPOT_LIST, this->type, this->owner); - Command::Post(this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack(), {}); + Command::Post(this->window_number, widget == WID_D_START_ALL, false, vli); break; } @@ -826,7 +826,7 @@ struct DepotWindow : Window { break; case WID_D_AUTOREPLACE: - Command::Post(this->window_number, this->type, 0, {}); + Command::Post(this->window_number, this->type); break; } @@ -905,10 +905,10 @@ struct DepotWindow : Window { { if (_ctrl_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ - Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, this->window_number, v->index, 1, {}); + Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, this->window_number, v->index, true); } else { /* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to change things on new vehicle) */ - if (Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, CcCloneVehicle, this->window_number, v->index, 0, {})) { + if (Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, CcCloneVehicle, this->window_number, v->index, false)) { ResetObjectToPlace(); } } @@ -1002,7 +1002,7 @@ struct DepotWindow : Window { if (this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, &gdvp) == MODE_DRAG_VEHICLE && sel != INVALID_VEHICLE) { if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _ctrl_pressed) { - Command::Post(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE, Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true, {}); + Command::Post(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE, Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true); } else if (gdvp.wagon == nullptr || gdvp.wagon->index != sel) { this->vehicle_over = INVALID_VEHICLE; TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head); @@ -1090,8 +1090,8 @@ static void DepotSellAllConfirmationCallback(Window *win, bool confirmed) if (confirmed) { DepotWindow *w = (DepotWindow*)win; TileIndex tile = w->window_number; - byte vehtype = w->type; - Command::Post(tile, vehtype, 0, {}); + VehicleType vehtype = w->type; + Command::Post(tile, vehtype); } } diff --git a/src/economy.cpp b/src/economy.cpp index 8bf608a864..5c7c2cee51 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -451,7 +451,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) * However, do not rely on that behaviour. */ int interval = CompanyServiceInterval(new_company, v->type); - Command::Do(DC_EXEC | DC_BANKRUPT, v->tile, v->index, interval | (new_company->settings.vehicle.servint_ispercent << 17), {}); + Command::Do(DC_EXEC | DC_BANKRUPT, v->index, interval, false, new_company->settings.vehicle.servint_ispercent); } v->owner = new_owner; @@ -1488,7 +1488,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station if (st->goods[cid].cargo.HasCargoFor(next_station)) { /* Try to find out if auto-refitting would succeed. In case the refit is allowed, * the returned refit capacity will be greater than zero. */ - Command::Do(DC_QUERY_COST, v_start->tile, v_start->index, cid | 1U << 24 | 0xFF << 8 | 1U << 16, {}); // Auto-refit and only this vehicle including artic parts. + Command::Do(DC_QUERY_COST, v_start->index, cid, 0xFF, true, false, 1); // Auto-refit and only this vehicle including artic parts. /* Try to balance different loadable cargoes between parts of the consist, so that * all of them can be loaded. Avoid a situation where all vehicles suddenly switch * to the first loadable cargo for which there is only one packet. If the capacities @@ -1511,7 +1511,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station * "via any station" before reserving. We rather produce some more "any station" cargo than * misrouting it. */ IterateVehicleParts(v_start, ReturnCargoAction(st, INVALID_STATION)); - CommandCost cost = Command::Do(DC_EXEC, v_start->tile, v_start->index, new_cid | 1U << 24 | 0xFF << 8 | 1U << 16, {}); // Auto-refit and only this vehicle including artic parts. + CommandCost cost = Command::Do(DC_EXEC, v_start->index, new_cid, 0xFF, true, false, 1); // Auto-refit and only this vehicle including artic parts. if (cost.Succeeded()) v->First()->profit_this_year -= cost.GetCost() << 8; } diff --git a/src/engine.cpp b/src/engine.cpp index e9bb6c494b..6d0b25fcc7 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -876,20 +876,18 @@ void ClearEnginesHiddenFlagOfCompany(CompanyID cid) /** * Set the visibility of an engine. * @param flags Operation to perform. - * @param tile Unused. - * @param p1 Unused. - * @param p2 Bit 31: 0=visible, 1=hidden, other bits for the #EngineID. - * @param text Unused. + * @param engine_id Engine id.. + * @param hide Set for hidden, unset for visible. * @return The cost of this operation or an error. */ -CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, EngineID engine_id, bool hide) { - Engine *e = Engine::GetIfValid(GB(p2, 0, 31)); + Engine *e = Engine::GetIfValid(engine_id); if (e == nullptr || _current_company >= MAX_COMPANIES) return CMD_ERROR; if (!IsEngineBuildable(e->index, e->type, _current_company)) return CMD_ERROR; if ((flags & DC_EXEC) != 0) { - SB(e->company_hidden, _current_company, 1, GB(p2, 31, 1)); + SB(e->company_hidden, _current_company, 1, hide ? 1 : 0); AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type); } @@ -900,18 +898,15 @@ CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, TileIndex tile, uint32 * Accept an engine prototype. XXX - it is possible that the top-company * changes while you are waiting to accept the offer? Then it becomes invalid * @param flags operation to perform - * @param tile unused - * @param p1 engine-prototype offered - * @param p2 unused - * @param text unused + * @param engine_id engine-prototype offered * @return the cost of this operation or an error */ -CommandCost CmdWantEnginePreview(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdWantEnginePreview(DoCommandFlag flags, EngineID engine_id) { - Engine *e = Engine::GetIfValid(p1); + Engine *e = Engine::GetIfValid(engine_id); if (e == nullptr || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR; - if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company); + if (flags & DC_EXEC) AcceptEnginePreview(engine_id, _current_company); return CommandCost(); } @@ -919,20 +914,14 @@ CommandCost CmdWantEnginePreview(DoCommandFlag flags, TileIndex tile, uint32 p1, /** * Allow or forbid a specific company to use an engine * @param flags operation to perform - * @param tile unused - * @param p1 engine id - * @param p2 various bitstuffed elements - * - p2 = (bit 0 - 7) - Company to allow/forbid the use of an engine. - * - p2 = (bit 31) - 0 to forbid, 1 to allow. - * @param text unused + * @param engine_id engine id + * @param company_id Company to allow/forbid the use of an engine. + * @param allow false to forbid, true to allow. * @return the cost of this operation or an error */ -CommandCost CmdEngineCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdEngineCtrl(DoCommandFlag flags, EngineID engine_id, CompanyID company_id, bool allow) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - EngineID engine_id = (EngineID)p1; - CompanyID company_id = (CompanyID)GB(p2, 0, 8); - bool allow = HasBit(p2, 31); if (!Engine::IsValidID(engine_id) || !Company::IsValidID(company_id)) return CMD_ERROR; @@ -1073,15 +1062,13 @@ static bool IsUniqueEngineName(const std::string &name) /** * Rename an engine. * @param flags operation to perform - * @param tile unused - * @param p1 engine ID to rename - * @param p2 unused + * @param engine_id engine ID to rename * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameEngine(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameEngine(DoCommandFlag flags, EngineID engine_id, const std::string &text) { - Engine *e = Engine::GetIfValid(p1); + Engine *e = Engine::GetIfValid(engine_id); if (e == nullptr) return CMD_ERROR; bool reset = text.empty(); diff --git a/src/engine_cmd.h b/src/engine_cmd.h index 3ed47e8051..4b90c61d8a 100644 --- a/src/engine_cmd.h +++ b/src/engine_cmd.h @@ -12,10 +12,10 @@ #include "command_type.h" -CommandProc CmdWantEnginePreview; -CommandProc CmdEngineCtrl; -CommandProc CmdRenameEngine; -CommandProc CmdSetVehicleVisibility; +CommandCost CmdWantEnginePreview(DoCommandFlag flags, EngineID engine_id); +CommandCost CmdEngineCtrl(DoCommandFlag flags, EngineID engine_id, CompanyID company_id, bool allow); +CommandCost CmdRenameEngine(DoCommandFlag flags, EngineID engine_id, const std::string &text); +CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, EngineID engine_id, bool hide); DEF_CMD_TRAIT(CMD_WANT_ENGINE_PREVIEW, CmdWantEnginePreview, 0, CMDT_VEHICLE_MANAGEMENT) DEF_CMD_TRAIT(CMD_ENGINE_CTRL, CmdEngineCtrl, CMD_DEITY, CMDT_VEHICLE_MANAGEMENT) diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index c3b9553a7e..a14bc2652c 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -126,7 +126,7 @@ struct EnginePreviewWindow : Window { { switch (widget) { case WID_EP_YES: - Command::Post(0, this->window_number, 0, {}); + Command::Post(this->window_number); FALLTHROUGH; case WID_EP_NO: if (!_shift_pressed) this->Close(); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 22f2889712..d3d270f314 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -802,7 +802,7 @@ public: case WID_GL_START_ALL: case WID_GL_STOP_ALL: { // Start/stop all vehicles of the list - Command::Post(0, (1 << 1) | (widget == WID_GL_START_ALL ? (1 << 0) : 0), this->vli.Pack(), {}); + Command::Post(0, widget == WID_GL_START_ALL, true, this->vli); break; } @@ -954,7 +954,7 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: { // Send to Depots - Command::Post(GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), this->vli.Pack(), {}); + Command::Post(GetCmdSendToDepotMsg(this->vli.vtype), 0, DepotCommand::MassSend | (index == ADI_SERVICE ? DepotCommand::Service : DepotCommand::None), this->vli); break; } diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 66e79989a8..450de5681a 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1996,7 +1996,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo()); /* If there is no depot in front, reverse automatically (trains only) */ - if (v->type == VEH_TRAIN && reverse) Command::Do(DC_EXEC, v->tile, v->index, 0, {}); + if (v->type == VEH_TRAIN && reverse) Command::Do(DC_EXEC, v->index, false); if (v->type == VEH_AIRCRAFT) { Aircraft *a = Aircraft::From(v); diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index a6442430e0..0b8d9deff8 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -361,15 +361,12 @@ bool RoadVehicle::FindClosestDepot(TileIndex *location, DestinationID *destinati /** * Turn a roadvehicle around. * @param flags operation to perform - * @param tile unused - * @param p1 vehicle ID to turn - * @param p2 unused - * @param text unused + * @param veh_id vehicle ID to turn * @return the cost of this operation or an error */ -CommandCost CmdTurnRoadVeh(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTurnRoadVeh(DoCommandFlag flags, VehicleID veh_id) { - RoadVehicle *v = RoadVehicle::GetIfValid(p1); + RoadVehicle *v = RoadVehicle::GetIfValid(veh_id); if (v == nullptr) return CMD_ERROR; if (!v->IsPrimaryVehicle()) return CMD_ERROR; diff --git a/src/roadveh_cmd.h b/src/roadveh_cmd.h index 94aaee743f..3d71abce73 100644 --- a/src/roadveh_cmd.h +++ b/src/roadveh_cmd.h @@ -16,7 +16,7 @@ CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v); -CommandProc CmdTurnRoadVeh; +CommandCost CmdTurnRoadVeh(DoCommandFlag flags, VehicleID veh_id); DEF_CMD_TRAIT(CMD_TURN_ROADVEH, CmdTurnRoadVeh, 0, CMDT_VEHICLE_MANAGEMENT) diff --git a/src/script/api/script_engine.cpp b/src/script/api/script_engine.cpp index d6cab36b6c..7530693d07 100644 --- a/src/script/api/script_engine.cpp +++ b/src/script/api/script_engine.cpp @@ -286,7 +286,7 @@ EnforcePrecondition(false, IsValidEngine(engine_id)); EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID); - return ScriptObject::Command::Do(0, engine_id, (uint32)company | (1 << 31), {}); + return ScriptObject::Command::Do(engine_id, (::CompanyID)company, true); } /* static */ bool ScriptEngine::DisableForCompany(EngineID engine_id, ScriptCompany::CompanyID company) @@ -297,5 +297,5 @@ EnforcePrecondition(false, IsValidEngine(engine_id)); EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID); - return ScriptObject::Command::Do(0, engine_id, company, {}); + return ScriptObject::Command::Do(engine_id, (::CompanyID)company, false); } diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index f7776c40e8..e876febc28 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -112,7 +112,7 @@ int32 ScriptEventEnginePreview::GetVehicleType() bool ScriptEventEnginePreview::AcceptPreview() { if (!this->IsEngineValid()) return false; - return ScriptObject::Command::Do(0, this->engine, 0, {}); + return ScriptObject::Command::Do(this->engine); } bool ScriptEventCompanyAskMerger::AcceptMerger() diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index 3da5739eeb..c925026616 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -103,7 +103,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, vehicle_id, share_orders, {})) return VEHICLE_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, vehicle_id, share_orders)) return VEHICLE_INVALID; /* In case of test-mode, we return VehicleID 0 */ return 0; @@ -125,7 +125,7 @@ while (dest_wagon-- > 0) w = w->GetNextUnit(); } - return ScriptObject::Command::Do(0, v->index | (move_attached_wagons ? 1 : 0) << 20, w == nullptr ? ::INVALID_VEHICLE : w->index, {}); + return ScriptObject::Command::Do(v->index, w == nullptr ? ::INVALID_VEHICLE : w->index, move_attached_wagons); } /* static */ bool ScriptVehicle::MoveWagon(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon) @@ -143,7 +143,7 @@ if (!IsValidVehicle(vehicle_id)) return -1; if (!ScriptCargo::IsValidCargo(cargo)) return -1; - CommandCost res = ::Command::Do(DC_QUERY_COST, 0, vehicle_id, cargo, {}); + CommandCost res = ::Command::Do(DC_QUERY_COST, vehicle_id, cargo, 0, false, false, 0); return res.Succeeded() ? _returned_refit_capacity : -1; } @@ -152,7 +152,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id) && ScriptCargo::IsValidCargo(cargo)); - return ScriptObject::Command::Do(0, vehicle_id, cargo, {}); + return ScriptObject::Command::Do(vehicle_id, cargo, 0, false, false, 0); } @@ -162,7 +162,7 @@ EnforcePrecondition(false, IsValidVehicle(vehicle_id)); const Vehicle *v = ::Vehicle::Get(vehicle_id); - return ScriptObject::Command::Do(0, vehicle_id, v->type == VEH_TRAIN, false, INVALID_CLIENT_ID); + return ScriptObject::Command::Do(vehicle_id, v->type == VEH_TRAIN, false, INVALID_CLIENT_ID); } /* static */ bool ScriptVehicle::_SellWagonInternal(VehicleID vehicle_id, int wagon, bool sell_attached_wagons) @@ -174,7 +174,7 @@ const Train *v = ::Train::Get(vehicle_id); while (wagon-- > 0) v = v->GetNextUnit(); - return ScriptObject::Command::Do(0, v->index, sell_attached_wagons, false, INVALID_CLIENT_ID); + return ScriptObject::Command::Do(v->index, sell_attached_wagons, false, INVALID_CLIENT_ID); } /* static */ bool ScriptVehicle::SellWagon(VehicleID vehicle_id, int wagon) @@ -192,7 +192,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::Command::Do(0, vehicle_id, 0, {}); + return ScriptObject::Command::Do(vehicle_id, DepotCommand::None, {}); } /* static */ bool ScriptVehicle::SendVehicleToDepotForServicing(VehicleID vehicle_id) @@ -200,7 +200,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::Command::Do(0, vehicle_id | DEPOT_SERVICE, 0, {}); + return ScriptObject::Command::Do(vehicle_id, DepotCommand::Service, {}); } /* static */ bool ScriptVehicle::IsInDepot(VehicleID vehicle_id) @@ -220,7 +220,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsValidVehicle(vehicle_id)); - return ScriptObject::Command::Do(0, vehicle_id, 0, {}); + return ScriptObject::Command::Do(vehicle_id, false); } /* static */ bool ScriptVehicle::ReverseVehicle(VehicleID vehicle_id) @@ -230,8 +230,8 @@ EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_ROAD || ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN); switch (::Vehicle::Get(vehicle_id)->type) { - case VEH_ROAD: return ScriptObject::Command::Do(0, vehicle_id, 0, {}); - case VEH_TRAIN: return ScriptObject::Command::Do(0, vehicle_id, 0, {}); + case VEH_ROAD: return ScriptObject::Command::Do(vehicle_id); + case VEH_TRAIN: return ScriptObject::Command::Do(vehicle_id, false); default: NOT_REACHED(); } } @@ -247,7 +247,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_VEHICLE_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::Command::Do(0, vehicle_id, 0, text); + return ScriptObject::Command::Do(vehicle_id, text); } /* static */ TileIndex ScriptVehicle::GetLocation(VehicleID vehicle_id) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index d2517d65ba..8bfc332f65 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -656,7 +656,7 @@ static CommandCost CmdBuildRailWagon(DoCommandFlag flags, TileIndex tile, const w->engine_type == e->index && ///< Same type w->First() != v && ///< Don't connect to ourself !(w->vehstatus & VS_CRASHED)) { ///< Not crashed/flooded - if (Command::Do(DC_EXEC, 0, v->index | 1 << 20, w->Last()->index, {}).Succeeded()) { + if (Command::Do(DC_EXEC, v->index, w->Last()->index, true).Succeeded()) { break; } } @@ -672,7 +672,7 @@ static void NormalizeTrainVehInDepot(const Train *u) for (const Train *v : Train::Iterate()) { if (v->IsFreeWagon() && v->tile == u->tile && v->track == TRACK_BIT_DEPOT) { - if (Command::Do(DC_EXEC, 0, v->index | 1 << 20, u->index, {}).Failed()) { + if (Command::Do(DC_EXEC, v->index, u->index, true).Failed()) { break; } } @@ -1162,21 +1162,14 @@ static void NormaliseTrainHead(Train *head) * Move a rail vehicle around inside the depot. * @param flags type of operation * Note: DC_AUTOREPLACE is set when autoreplace tries to undo its modifications or moves vehicles to temporary locations inside the depot. - * @param tile unused - * @param p1 various bitstuffed elements - * - p1 (bit 0 - 19) source vehicle index - * - p1 (bit 20) move all vehicles following the source vehicle - * @param p2 what wagon to put the source wagon AFTER, XXX - INVALID_VEHICLE to make a new line - * @param text unused + * @param src_veh source vehicle index + * @param dest_veh what wagon to put the source wagon AFTER, XXX - INVALID_VEHICLE to make a new line + * @param move_chain move all vehicles following the source vehicle * @return the cost of this operation or an error */ -CommandCost CmdMoveRailVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID dest_veh, bool move_chain) { - VehicleID s = GB(p1, 0, 20); - VehicleID d = GB(p2, 0, 20); - bool move_chain = HasBit(p1, 20); - - Train *src = Train::GetIfValid(s); + Train *src = Train::GetIfValid(src_veh); if (src == nullptr) return CMD_ERROR; CommandCost ret = CheckOwnership(src->owner); @@ -1187,10 +1180,10 @@ CommandCost CmdMoveRailVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, u /* if nothing is selected as destination, try and find a matching vehicle to drag to. */ Train *dst; - if (d == INVALID_VEHICLE) { + if (dest_veh == INVALID_VEHICLE) { dst = (src->IsEngine() || (flags & DC_AUTOREPLACE)) ? nullptr : FindGoodVehiclePos(src); } else { - dst = Train::GetIfValid(d); + dst = Train::GetIfValid(dest_veh); if (dst == nullptr) return CMD_ERROR; CommandCost ret = CheckOwnership(dst->owner); @@ -1908,22 +1901,20 @@ void ReverseTrainDirection(Train *v) /** * Reverse train. - * @param tile unused * @param flags type of operation - * @param p1 train to reverse - * @param p2 if true, reverse a unit in a train (needs to be in a depot) - * @param text unused + * @param veh_id train to reverse + * @param reverse_single_veh if true, reverse a unit in a train (needs to be in a depot) * @return the cost of this operation or an error */ -CommandCost CmdReverseTrainDirection(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdReverseTrainDirection(DoCommandFlag flags, VehicleID veh_id, bool reverse_single_veh) { - Train *v = Train::GetIfValid(p1); + Train *v = Train::GetIfValid(veh_id); if (v == nullptr) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; - if (p2 != 0) { + if (reverse_single_veh) { /* turn a single unit around */ if (v->IsMultiheaded() || HasBit(EngInfo(v->engine_type)->callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) { @@ -1982,15 +1973,12 @@ CommandCost CmdReverseTrainDirection(DoCommandFlag flags, TileIndex tile, uint32 /** * Force a train through a red signal * @param flags type of operation - * @param tile unused - * @param p1 train to ignore the red signal - * @param p2 unused - * @param text unused + * @param veh_id train to ignore the red signal * @return the cost of this operation or an error */ -CommandCost CmdForceTrainProceed(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdForceTrainProceed(DoCommandFlag flags, VehicleID veh_id) { - Train *t = Train::GetIfValid(p1); + Train *t = Train::GetIfValid(veh_id); if (t == nullptr) return CMD_ERROR; if (!t->IsPrimaryVehicle()) return CMD_ERROR; diff --git a/src/train_cmd.h b/src/train_cmd.h index 4a7e5036ec..5d75171607 100644 --- a/src/train_cmd.h +++ b/src/train_cmd.h @@ -17,9 +17,9 @@ CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, bool free_cars, Vehicle **ret); CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user); -CommandProc CmdMoveRailVehicle; -CommandProc CmdForceTrainProceed; -CommandProc CmdReverseTrainDirection; +CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID dest_veh, bool move_chain); +CommandCost CmdForceTrainProceed(DoCommandFlag flags, VehicleID veh_id); +CommandCost CmdReverseTrainDirection(DoCommandFlag flags, VehicleID veh_id, bool reverse_single_veh); DEF_CMD_TRAIT(CMD_MOVE_RAIL_VEHICLE, CmdMoveRailVehicle, 0, CMDT_VEHICLE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_FORCE_TRAIN_PROCEED, CmdForceTrainProceed, 0, CMDT_VEHICLE_MANAGEMENT) diff --git a/src/train_gui.cpp b/src/train_gui.cpp index e41bdf6aca..268b5b40b8 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -43,7 +43,7 @@ void CcBuildWagon(Commands cmd, const CommandCost &result, TileIndex tile, const if (found != nullptr) { found = found->Last(); /* put the new wagon at the end of the loco. */ - Command::Post(0, _new_vehicle_id, found->index, {}); + Command::Post( _new_vehicle_id, found->index, false); InvalidateWindowClassesData(WC_TRAINS_LIST, 0); } } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f09edc9095..9a66053d33 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1565,7 +1565,7 @@ void VehicleEnterDepot(Vehicle *v) if (v->current_order.IsRefit()) { Backup cur_company(_current_company, v->owner, FILE_LINE); - CommandCost cost = Command::Do(DC_EXEC, v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8, {}); + CommandCost cost = Command::Do(DC_EXEC, v->index, v->current_order.GetRefitCargo(), 0xFF, false, false, 0); cur_company.Restore(); if (cost.Failed()) { @@ -2397,7 +2397,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) if (this->current_order.IsType(OT_GOTO_DEPOT)) { bool halt_in_depot = (this->current_order.GetDepotActionType() & ODATFB_HALT) != 0; - if (!!(command & DEPOT_SERVICE) == halt_in_depot) { + if (((command & DepotCommand::Service) != DepotCommand::None) == halt_in_depot) { /* We called with a different DEPOT_SERVICE setting. * Now we change the setting to apply the new one and let the vehicle head for the same depot. * Note: the if is (true for requesting service == true for ordered to stop in depot) */ @@ -2409,7 +2409,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) return CommandCost(); } - if (command & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancellation of depot orders + if ((command & DepotCommand::DontCancel) != DepotCommand::None) return CMD_ERROR; // Requested no cancellation of depot orders if (flags & DC_EXEC) { /* If the orders to 'goto depot' are in the orders list (forced servicing), * then skip to the next order; effectively cancelling this forced service */ @@ -2442,12 +2442,12 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) this->SetDestTile(location); this->current_order.MakeGoToDepot(destination, ODTF_MANUAL); - if (!(command & DEPOT_SERVICE)) this->current_order.SetDepotActionType(ODATFB_HALT); + if ((command & DepotCommand::Service) == DepotCommand::None) this->current_order.SetDepotActionType(ODATFB_HALT); SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP); /* If there is no depot in front and the train is not already reversing, reverse automatically (trains only) */ if (this->type == VEH_TRAIN && (reverse ^ HasBit(Train::From(this)->flags, VRF_REVERSING))) { - Command::Do(DC_EXEC, this->tile, this->index, 0, {}); + Command::Do(DC_EXEC, this->index, false); } if (this->type == VEH_AIRCRAFT) { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 3f4bd2a5a0..100b309f90 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -151,7 +151,7 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, b if (refitting) { /* Refit only one vehicle. If we purchased an engine, it may have gained free wagons. */ - value.AddCost(CmdRefitVehicle(flags, tile, v->index, cargo | (1 << 16), {})); + value.AddCost(CmdRefitVehicle(flags, v->index, cargo, 0, false, false, 1)); } else { /* Fill in non-refitted capacities */ _returned_refit_capacity = e->GetDisplayDefaultCapacity(&_returned_mail_refit_capacity); @@ -179,7 +179,7 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, b /* If we are not in DC_EXEC undo everything */ if (flags != subflags) { - Command::Do(DC_EXEC, 0, v->index, false, false, INVALID_CLIENT_ID); + Command::Do(DC_EXEC, v->index, false, false, INVALID_CLIENT_ID); } } @@ -191,7 +191,6 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, b /** * Sell a vehicle. - * @param tile unused. * @param flags for command. * @aram v_id vehicle ID being sold. * @param sell_chain sell the vehicle and all vehicles following it in the chain. @@ -200,7 +199,7 @@ CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, b * @param text unused. * @return the cost of this operation or an error. */ -CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id) +CommandCost CmdSellVehicle(DoCommandFlag flags, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id) { Vehicle *v = Vehicle::GetIfValid(v_id); if (v == nullptr) return CMD_ERROR; @@ -450,21 +449,18 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, /** * Refits a vehicle to the specified cargo type. * @param flags type of operation - * @param tile unused - * @param p1 vehicle ID to refit - * @param p2 various bitstuffed elements - * - p2 = (bit 0-7) - New cargo type to refit to. - * - p2 = (bit 8-15) - New cargo subtype to refit to. 0xFF means to try keeping the same subtype according to GetBestFittingSubType(). - * - p2 = (bit 16-23) - Number of vehicles to refit (not counting articulated parts). Zero means all vehicles. - * Only used if "refit only this vehicle" is false. - * - p2 = (bit 24) - Automatic refitting. - * - p2 = (bit 25) - Refit only this vehicle. Used only for cloning vehicles. - * @param text unused + * @param veh_id vehicle ID to refit + * @param new_cid New cargo type to refit to. + * @param new_subtype New cargo subtype to refit to. 0xFF means to try keeping the same subtype according to GetBestFittingSubType(). + * @param auto_refit Automatic refitting. + * @param only_this Refit only this vehicle. Used only for cloning vehicles. + * @param num_vehicles Number of vehicles to refit (not counting articulated parts). Zero means all vehicles. + * Only used if "refit only this vehicle" is false. * @return the cost of this operation or an error */ -CommandCost CmdRefitVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRefitVehicle(DoCommandFlag flags, VehicleID veh_id, CargoID new_cid, byte new_subtype, bool auto_refit, bool only_this, uint8 num_vehicles) { - Vehicle *v = Vehicle::GetIfValid(p1); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr) return CMD_ERROR; /* Don't allow disasters and sparks and such to be refitted. @@ -476,7 +472,6 @@ CommandCost CmdRefitVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint CommandCost ret = CheckOwnership(front->owner); if (ret.Failed()) return ret; - bool auto_refit = HasBit(p2, 24); bool free_wagon = v->type == VEH_TRAIN && Train::From(front)->IsFreeWagon(); // used by autoreplace/renew /* Don't allow shadows and such to be refitted. */ @@ -493,13 +488,10 @@ CommandCost CmdRefitVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (front->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); /* Check cargo */ - CargoID new_cid = GB(p2, 0, 8); - byte new_subtype = GB(p2, 8, 8); if (new_cid >= NUM_CARGO) return CMD_ERROR; /* For ships and aircraft there is always only one. */ - bool only_this = HasBit(p2, 25) || front->type == VEH_SHIP || front->type == VEH_AIRCRAFT; - uint8 num_vehicles = GB(p2, 16, 8); + only_this |= front->type == VEH_SHIP || front->type == VEH_AIRCRAFT; CommandCost cost = RefitVehicle(v, only_this, num_vehicles, new_cid, new_subtype, flags, auto_refit); @@ -544,18 +536,16 @@ CommandCost CmdRefitVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint /** * Start/Stop a vehicle * @param flags type of operation - * @param tile unused - * @param p1 vehicle to start/stop, don't forget to change CcStartStopVehicle if you modify this! - * @param p2 bit 0: Shall the start/stop newgrf callback be evaluated (only valid with DC_AUTOREPLACE for network safety) - * @param text unused + * @param veh_id vehicle to start/stop, don't forget to change CcStartStopVehicle if you modify this! + * @param evaluate_startstop_cb Shall the start/stop newgrf callback be evaluated (only valid with DC_AUTOREPLACE for network safety) * @return the cost of this operation or an error */ -CommandCost CmdStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdStartStopVehicle(DoCommandFlag flags, VehicleID veh_id, bool evaluate_startstop_cb) { /* Disable the effect of p2 bit 0, when DC_AUTOREPLACE is not set */ - if ((flags & DC_AUTOREPLACE) == 0) SetBit(p2, 0); + if ((flags & DC_AUTOREPLACE) == 0) evaluate_startstop_cb = true; - Vehicle *v = Vehicle::GetIfValid(p1); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); @@ -583,7 +573,7 @@ CommandCost CmdStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, default: return CMD_ERROR; } - if (HasBit(p2, 0)) { + if (evaluate_startstop_cb) { /* Check if this vehicle can be started/stopped. Failure means 'allow'. */ uint16 callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v); StringID error = STR_NULL; @@ -610,7 +600,7 @@ CommandCost CmdStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, } if (flags & DC_EXEC) { - if (v->IsStoppedInDepot() && (flags & DC_AUTOREPLACE) == 0) DeleteVehicleNews(p1, STR_NEWS_TRAIN_IS_WAITING + v->type); + if (v->IsStoppedInDepot() && (flags & DC_AUTOREPLACE) == 0) DeleteVehicleNews(veh_id, STR_NEWS_TRAIN_IS_WAITING + v->type); v->vehstatus ^= VS_STOPPED; if (v->type != VEH_TRAIN) v->cur_speed = 0; // trains can stop 'slowly' @@ -627,21 +617,16 @@ CommandCost CmdStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, * Starts or stops a lot of vehicles * @param flags type of operation * @param tile Tile of the depot where the vehicles are started/stopped (only used for depots) - * @param p1 bitmask - * - bit 0 set = start vehicles, unset = stop vehicles - * - bit 1 if set, then it's a vehicle list window, not a depot and Tile is ignored in this case - * @param p2 packed VehicleListIdentifier - * @param text unused + * @param do_start set = start vehicles, unset = stop vehicles + * @param vehicle_list_window if set, then it's a vehicle list window, not a depot and Tile is ignored in this case + * @param vli VehicleListIdentifier * @return the cost of this operation or an error */ -CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, bool do_start, bool vehicle_list_window, const VehicleListIdentifier &vli) { VehicleList list; - bool do_start = HasBit(p1, 0); - bool vehicle_list_window = HasBit(p1, 1); - VehicleListIdentifier vli; - if (!vli.UnpackIfValid(p2)) return CMD_ERROR; + if (!vli.Valid()) return CMD_ERROR; if (!IsCompanyBuildableVehicleType(vli.vtype)) return CMD_ERROR; if (vehicle_list_window) { @@ -659,7 +644,7 @@ CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 if (!vehicle_list_window && !v->IsChainInDepot()) continue; /* Just try and don't care if some vehicle's can't be stopped. */ - Command::Do(flags, tile, v->index, 0, {}); + Command::Do(flags, v->index, false); } return CommandCost(); @@ -669,17 +654,14 @@ CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, uint32 * Sells all vehicles in a depot * @param flags type of operation * @param tile Tile of the depot where the depot is - * @param p1 Vehicle type - * @param p2 unused - * @param text unused + * @param vehicle_type Vehicle type * @return the cost of this operation or an error */ -CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, VehicleType vehicle_type) { VehicleList list; CommandCost cost(EXPENSES_NEW_VEHICLES); - VehicleType vehicle_type = Extract(p1); if (!IsCompanyBuildableVehicleType(vehicle_type)) return CMD_ERROR; @@ -689,7 +671,7 @@ CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, uint32 CommandCost last_error = CMD_ERROR; bool had_success = false; for (uint i = 0; i < list.size(); i++) { - CommandCost ret = Command::Do(flags, tile, list[i]->index, true, false, INVALID_CLIENT_ID); + CommandCost ret = Command::Do(flags, list[i]->index, true, false, INVALID_CLIENT_ID); if (ret.Succeeded()) { cost.AddCost(ret); had_success = true; @@ -705,16 +687,13 @@ CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, uint32 * Autoreplace all vehicles in the depot * @param flags type of operation * @param tile Tile of the depot where the vehicles are - * @param p1 Type of vehicle - * @param p2 unused - * @param text unused + * @param vehicle_type Type of vehicle * @return the cost of this operation or an error */ -CommandCost CmdDepotMassAutoReplace(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDepotMassAutoReplace(DoCommandFlag flags, TileIndex tile, VehicleType vehicle_type) { VehicleList list; CommandCost cost = CommandCost(EXPENSES_NEW_VEHICLES); - VehicleType vehicle_type = Extract(p1); if (!IsCompanyBuildableVehicleType(vehicle_type)) return CMD_ERROR; if (!IsDepotTile(tile) || !IsTileOwner(tile, _current_company)) return CMD_ERROR; @@ -809,16 +788,15 @@ static void CloneVehicleName(const Vehicle *src, Vehicle *dst) * Clone a vehicle. If it is a train, it will clone all the cars too * @param flags type of operation * @param tile tile of the depot where the cloned vehicle is build - * @param p1 the original vehicle's index - * @param p2 1 = shared orders, else copied orders - * @param text unused + * @param veh_id the original vehicle's index + * @param share_orders shared orders, else copied orders * @return the cost of this operation or an error */ -CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, VehicleID veh_id, bool share_orders) { CommandCost total_cost(EXPENSES_NEW_VEHICLES); - Vehicle *v = Vehicle::GetIfValid(p1); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; Vehicle *v_front = v; Vehicle *w = nullptr; @@ -871,7 +849,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ - if (w_front != nullptr) Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); + if (w_front != nullptr) Command::Do(flags, w_front->index, true, false, INVALID_CLIENT_ID); return cost; } @@ -887,12 +865,12 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint if (v->type == VEH_TRAIN && !v->IsFrontEngine()) { /* this s a train car * add this unit to the end of the train */ - CommandCost result = Command::Do(flags, 0, w->index | 1 << 20, w_rear->index, {}); + CommandCost result = Command::Do(flags, w->index, w_rear->index, true); if (result.Failed()) { /* The train can't be joined to make the same consist as the original. * Sell what we already made (clean up) and return an error. */ - Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); - Command::Do(flags, w_front->tile, w->index, true, false, INVALID_CLIENT_ID); + Command::Do(flags, w_front->index, true, false, INVALID_CLIENT_ID); + Command::Do(flags, w->index, true, false, INVALID_CLIENT_ID); return result; // return error and the message returned from CMD_MOVE_RAIL_VEHICLE } } else { @@ -935,7 +913,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint /* Find out what's the best sub type */ byte subtype = GetBestFittingSubType(v, w, v->cargo_type); if (w->cargo_type != v->cargo_type || w->cargo_subtype != subtype) { - CommandCost cost = Command::Do(flags, 0, w->index, v->cargo_type | 1U << 25 | (subtype << 8), {}); + CommandCost cost = Command::Do(flags, w->index, v->cargo_type, subtype, false, true, 0); if (cost.Succeeded()) total_cost.AddCost(cost); } @@ -970,10 +948,10 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * the vehicle refitted before doing this, otherwise the moved * cargo types might not match (passenger vs non-passenger) */ - CommandCost result = Command::Do(flags, (p2 & 1 ? CO_SHARE : CO_COPY), w_front->index, v_front->index); + CommandCost result = Command::Do(flags, (share_orders ? CO_SHARE : CO_COPY), w_front->index, v_front->index); if (result.Failed()) { /* The vehicle has already been bought, so now it must be sold again. */ - Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); + Command::Do(flags, w_front->index, true, false, INVALID_CLIENT_ID); return result; } @@ -984,7 +962,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint * check whether the company has enough money manually. */ if (!CheckCompanyHasMoney(total_cost)) { /* The vehicle has already been bought, so now it must be sold again. */ - Command::Do(flags, w_front->tile, w_front->index, true, false, INVALID_CLIENT_ID); + Command::Do(flags, w_front->index, true, false, INVALID_CLIENT_ID); return total_cost; } } @@ -1009,7 +987,7 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con bool had_success = false; for (uint i = 0; i < list.size(); i++) { const Vehicle *v = list[i]; - CommandCost ret = Command::Do(flags, v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0, {}); + CommandCost ret = Command::Do(flags, v->index, (service ? DepotCommand::Service : DepotCommand::None) | DepotCommand::DontCancel, {}); if (ret.Succeeded()) { had_success = true; @@ -1028,42 +1006,36 @@ static CommandCost SendAllVehiclesToDepot(DoCommandFlag flags, bool service, con /** * Send a vehicle to the depot. * @param flags for command type - * @param tile unused - * @param p1 bitmask - * - p1 0-20: bitvehicle ID to send to the depot - * - p1 bits 25-8 - DEPOT_ flags (see vehicle_type.h) - * @param p2 packed VehicleListIdentifier. - * @param text unused + * @param veh_id vehicle ID to send to the depot + * @param depot_cmd DEPOT_ flags (see vehicle_type.h) + * @param vli VehicleListIdentifier. * @return the cost of this operation or an error */ -CommandCost CmdSendVehicleToDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSendVehicleToDepot(DoCommandFlag flags, VehicleID veh_id, DepotCommand depot_cmd, const VehicleListIdentifier &vli) { - if (p1 & DEPOT_MASS_SEND) { + if ((depot_cmd & DepotCommand::MassSend) != DepotCommand::None) { /* Mass goto depot requested */ - VehicleListIdentifier vli; - if (!vli.UnpackIfValid(p2)) return CMD_ERROR; - return SendAllVehiclesToDepot(flags, (p1 & DEPOT_SERVICE) != 0, vli); + if (!vli.Valid()) return CMD_ERROR; + return SendAllVehiclesToDepot(flags, (depot_cmd & DepotCommand::Service) != DepotCommand::None, vli); } - Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20)); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr) return CMD_ERROR; if (!v->IsPrimaryVehicle()) return CMD_ERROR; - return v->SendToDepot(flags, (DepotCommand)(p1 & DEPOT_COMMAND_MASK)); + return v->SendToDepot(flags, depot_cmd); } /** * Give a custom name to your vehicle * @param flags type of operation - * @param tile unused - * @param p1 vehicle ID to name - * @param p2 unused + * @param veh_id vehicle ID to name * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameVehicle(DoCommandFlag flags, VehicleID veh_id, const std::string &text) { - Vehicle *v = Vehicle::GetIfValid(p1); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); @@ -1093,39 +1065,33 @@ CommandCost CmdRenameVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uin /** * Change the service interval of a vehicle * @param flags type of operation - * @param tile unused - * @param p1 vehicle ID that is being service-interval-changed - * @param p2 bitmask - * - p2 = (bit 0-15) - new service interval - * - p2 = (bit 16) - service interval is custom flag - * - p2 = (bit 17) - service interval is percentage flag - * @param text unused + * @param veh_id vehicle ID that is being service-interval-changed + * @param serv_int new service interval + * @param is_custom service interval is custom flag + * @param is_percent service interval is percentage flag * @return the cost of this operation or an error */ -CommandCost CmdChangeServiceInt(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeServiceInt(DoCommandFlag flags, VehicleID veh_id, uint16 serv_int, bool is_custom, bool is_percent) { - Vehicle *v = Vehicle::GetIfValid(p1); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; const Company *company = Company::Get(v->owner); - bool iscustom = HasBit(p2, 16); - bool ispercent = iscustom ? HasBit(p2, 17) : company->settings.vehicle.servint_ispercent; + is_percent = is_custom ? is_percent : company->settings.vehicle.servint_ispercent; - uint16 serv_int; - if (iscustom) { - serv_int = GB(p2, 0, 16); - if (serv_int != GetServiceIntervalClamped(serv_int, ispercent)) return CMD_ERROR; + if (is_custom) { + if (serv_int != GetServiceIntervalClamped(serv_int, is_percent)) return CMD_ERROR; } else { serv_int = CompanyServiceInterval(company, v->type); } if (flags & DC_EXEC) { v->SetServiceInterval(serv_int); - v->SetServiceIntervalIsCustom(iscustom); - v->SetServiceIntervalIsPercent(ispercent); + v->SetServiceIntervalIsCustom(is_custom); + v->SetServiceIntervalIsPercent(is_percent); SetWindowDirty(WC_VEHICLE_DETAILS, v->index); } diff --git a/src/vehicle_cmd.h b/src/vehicle_cmd.h index 98444033cc..b2ad082286 100644 --- a/src/vehicle_cmd.h +++ b/src/vehicle_cmd.h @@ -11,18 +11,21 @@ #define VEHICLE_CMD_H #include "command_type.h" +#include "engine_type.h" +#include "vehicle_type.h" +#include "vehiclelist.h" CommandCost CmdBuildVehicle(DoCommandFlag flags, TileIndex tile, EngineID eid, bool use_free_vehicles, CargoID cargo, ClientID client_id); -CommandCost CmdSellVehicle(DoCommandFlag flags, TileIndex tile, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id); -CommandProc CmdRefitVehicle; -CommandProc CmdSendVehicleToDepot; -CommandProc CmdChangeServiceInt; -CommandProc CmdRenameVehicle; -CommandProc CmdCloneVehicle; -CommandProc CmdStartStopVehicle; -CommandProc CmdMassStartStopVehicle; -CommandProc CmdDepotSellAllVehicles; -CommandProc CmdDepotMassAutoReplace; +CommandCost CmdSellVehicle(DoCommandFlag flags, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id); +CommandCost CmdRefitVehicle(DoCommandFlag flags, VehicleID veh_id, CargoID new_cid, byte new_subtype, bool auto_refit, bool only_this, uint8 num_vehicles); +CommandCost CmdSendVehicleToDepot(DoCommandFlag flags, VehicleID veh_id, DepotCommand depot_cmd, const VehicleListIdentifier &vli); +CommandCost CmdChangeServiceInt(DoCommandFlag flags, VehicleID veh_id, uint16 serv_int, bool is_custom, bool is_percent); +CommandCost CmdRenameVehicle(DoCommandFlag flags, VehicleID veh_id, const std::string &text); +CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, VehicleID veh_id, bool share_orders); +CommandCost CmdStartStopVehicle(DoCommandFlag flags, VehicleID veh_id, bool evaluate_startstop_cb); +CommandCost CmdMassStartStopVehicle(DoCommandFlag flags, TileIndex tile, bool do_start, bool vehicle_list_window, const VehicleListIdentifier &vli); +CommandCost CmdDepotSellAllVehicles(DoCommandFlag flags, TileIndex tile, VehicleType vehicle_type); +CommandCost CmdDepotMassAutoReplace(DoCommandFlag flags, TileIndex tile, VehicleType vehicle_type); DEF_CMD_TRAIT(CMD_BUILD_VEHICLE, CmdBuildVehicle, CMD_CLIENT_ID, CMDT_VEHICLE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_SELL_VEHICLE, CmdSellVehicle, CMD_CLIENT_ID, CMDT_VEHICLE_CONSTRUCTION) @@ -39,4 +42,15 @@ DEF_CMD_TRAIT(CMD_DEPOT_MASS_AUTOREPLACE, CmdDepotMassAutoReplace, 0, CommandCallback CcBuildPrimaryVehicle; CommandCallback CcStartStopVehicle; +template +inline EndianBufferWriter &operator <<(EndianBufferWriter &buffer, const VehicleListIdentifier &vli) +{ + return buffer << vli.type << vli.vtype << vli.company << vli.index; +} + +inline EndianBufferReader &operator >>(EndianBufferReader &buffer, VehicleListIdentifier &vli) +{ + return buffer >> vli.type >> vli.vtype >> vli.company >> vli.index; +} + #endif /* VEHICLE_CMD_H */ diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 2b7446a5e8..289a821e56 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -776,9 +776,7 @@ struct RefitWindow : public Window { StringID GetCapacityString(RefitOption *option) const { assert(_current_company == _local_company); - Vehicle *v = Vehicle::Get(this->window_number); - CommandCost cost = Command::Do(DC_QUERY_COST, v->tile, this->selected_vehicle, option->cargo | - option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24, {}); + CommandCost cost = Command::Do(DC_QUERY_COST, this->selected_vehicle, option->cargo, option->subtype, this->auto_refit, false, this->num_vehicles); if (cost.Failed()) return INVALID_STRING_ID; @@ -1038,7 +1036,7 @@ struct RefitWindow : public Window { if (this->order == INVALID_VEH_ORDER_ID) { bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX; - if (Command::Post(GetCmdRefitVehMsg(v), v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16, {}) && delete_window) this->Close(); + if (Command::Post(GetCmdRefitVehMsg(v), v->tile, this->selected_vehicle, this->cargo->cargo, this->cargo->subtype, false, false, this->num_vehicles) && delete_window) this->Close(); } else { if (Command::Post(v->tile, v->index, this->order, this->cargo->cargo)) this->Close(); } @@ -1899,7 +1897,7 @@ public: case WID_VL_STOP_ALL: case WID_VL_START_ALL: - Command::Post(0, (1 << 1) | (widget == WID_VL_START_ALL ? (1 << 0) : 0), this->window_number, {}); + Command::Post(0, widget == WID_VL_START_ALL, true, this->vli); break; } } @@ -1924,7 +1922,7 @@ public: break; case ADI_SERVICE: // Send for servicing case ADI_DEPOT: // Send to Depots - Command::Post(GetCmdSendToDepotMsg(this->vli.vtype), 0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : (DepotCommand)0), this->window_number, {}); + Command::Post(GetCmdSendToDepotMsg(this->vli.vtype), 0, DepotCommand::MassSend | (index == ADI_SERVICE ? DepotCommand::Service : DepotCommand::None), this->vli); break; default: NOT_REACHED(); @@ -2427,7 +2425,7 @@ struct VehicleDetailsWindow : Window { mod = GetServiceIntervalClamped(mod + v->GetServiceInterval(), v->ServiceIntervalIsPercent()); if (mod == v->GetServiceInterval()) return; - Command::Post(STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, mod | (1 << 16) | (v->ServiceIntervalIsPercent() << 17), {}); + Command::Post(STR_ERROR_CAN_T_CHANGE_SERVICING, v->index, mod, true, v->ServiceIntervalIsPercent()); break; } @@ -2463,7 +2461,7 @@ struct VehicleDetailsWindow : Window { bool iscustom = index != 0; bool ispercent = iscustom ? (index == 2) : Company::Get(v->owner)->settings.vehicle.servint_ispercent; uint16 interval = GetServiceIntervalClamped(v->GetServiceInterval(), ispercent); - Command::Post(STR_ERROR_CAN_T_CHANGE_SERVICING, v->tile, v->index, interval | (iscustom << 16) | (ispercent << 17), {}); + Command::Post(STR_ERROR_CAN_T_CHANGE_SERVICING, v->index, interval, iscustom, ispercent); break; } } @@ -2628,8 +2626,8 @@ void CcStartStopVehicle(Commands cmd, const CommandCost &result, TileIndex tile, { if (result.Failed()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); - const Vehicle *v = Vehicle::GetIfValid(p1); + VehicleID veh_id = std::get<0>(EndianBufferReader::ToValue::Args>(data)); + const Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle() || v->owner != _local_company) return; StringID msg = (v->vehstatus & VS_STOPPED) ? STR_VEHICLE_COMMAND_STOPPED : STR_VEHICLE_COMMAND_STARTED; @@ -2645,7 +2643,7 @@ void CcStartStopVehicle(Commands cmd, const CommandCost &result, TileIndex tile, void StartStopVehicle(const Vehicle *v, bool texteffect) { assert(v->IsPrimaryVehicle()); - Command::Post(_vehicle_msg_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, 0, {}); + Command::Post(_vehicle_msg_translation_table[VCT_CMD_START_STOP][v->type], texteffect ? CcStartStopVehicle : nullptr, v->tile, v->index, false); } /** Checks whether the vehicle may be refitted at the moment.*/ @@ -2969,7 +2967,7 @@ public: break; case WID_VV_GOTO_DEPOT: // goto hangar - Command::Post(GetCmdSendToDepotMsg(v), v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0, {}); + Command::Post(GetCmdSendToDepotMsg(v), v->index, _ctrl_pressed ? DepotCommand::Service : DepotCommand::None, {}); break; case WID_VV_REFIT: // refit ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID, this); @@ -2995,19 +2993,19 @@ public: * most likely already open, but is also visible in the vehicle viewport. */ Command::Post(_vehicle_msg_translation_table[VCT_CMD_CLONE_VEH][v->type], _ctrl_pressed ? nullptr : CcCloneVehicle, - v->tile, v->index, _ctrl_pressed ? 1 : 0, {}); + v->tile, v->index, _ctrl_pressed); break; case WID_VV_TURN_AROUND: // turn around assert(v->IsGroundVehicle()); if (v->type == VEH_ROAD) { - Command::Post(_vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0, {}); + Command::Post(_vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index); } else { - Command::Post(_vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, 0, {}); + Command::Post(_vehicle_msg_translation_table[VCT_CMD_TURN_AROUND][v->type], v->tile, v->index, false); } break; case WID_VV_FORCE_PROCEED: // force proceed assert(v->type == VEH_TRAIN); - Command::Post(STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL, v->tile, v->index, 0, {}); + Command::Post(STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL, v->tile, v->index); break; } } @@ -3016,7 +3014,7 @@ public: { if (str == nullptr) return; - Command::Post(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_TRAIN + Vehicle::Get(this->window_number)->type, this->window_number, str); } void OnMouseOver(Point pt, int widget) override diff --git a/src/vehicle_type.h b/src/vehicle_type.h index ae4de36665..c302f5b9f5 100644 --- a/src/vehicle_type.h +++ b/src/vehicle_type.h @@ -61,14 +61,15 @@ enum VehiclePathFinders { VPF_YAPF = 2, ///< Yet Another PathFinder }; -/** Flags to add to p1 for goto depot commands. */ -enum DepotCommand { - DEPOT_SERVICE = (1U << 28), ///< The vehicle will leave the depot right after arrival (service only) - DEPOT_MASS_SEND = (1U << 29), ///< Tells that it's a mass send to depot command (type in VLW flag) - DEPOT_DONT_CANCEL = (1U << 30), ///< Don't cancel current goto depot command if any - DEPOT_LOCATE_HANGAR = (1U << 31), ///< Find another airport if the target one lacks a hangar - DEPOT_COMMAND_MASK = 0xFU << 28, +/** Flags for goto depot commands. */ +enum class DepotCommand : byte { + None = 0, ///< No special flags. + Service = (1U << 0), ///< The vehicle will leave the depot right after arrival (service only) + MassSend = (1U << 1), ///< Tells that it's a mass send to depot command (type in VLW flag) + DontCancel = (1U << 2), ///< Don't cancel current goto depot command if any + LocateHangar = (1U << 3), ///< Find another airport if the target one lacks a hangar }; +DECLARE_ENUM_AS_BIT_SET(DepotCommand) static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32; ///< The maximum length of a vehicle name in characters including '\0' diff --git a/src/vehiclelist.h b/src/vehiclelist.h index 6cb2588ea6..6f6e5cb5fe 100644 --- a/src/vehiclelist.h +++ b/src/vehiclelist.h @@ -16,7 +16,7 @@ #include "tile_type.h" /** Vehicle List type flags */ -enum VehicleListType { +enum VehicleListType : byte { VL_STANDARD, VL_SHARED_ORDERS, VL_STATION_LIST, @@ -36,6 +36,8 @@ struct VehicleListIdentifier { bool UnpackIfValid(uint32 data); static VehicleListIdentifier UnPack(uint32 data); + bool Valid() const { return this->type < VLT_END; } + /** * Create a simple vehicle list. * @param type List type. From 6fe445e6c0fa3163aba48b1ec6d810b6594777bd Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 14 Nov 2021 16:39:17 +0100 Subject: [PATCH 125/710] Codechange: Un-bitstuff station/depot/waypoint commands. --- src/airport_gui.cpp | 14 +- src/cmd_helper.h | 11 ++ src/core/math_func.hpp | 2 +- src/depot_cmd.cpp | 8 +- src/depot_cmd.h | 3 +- src/depot_gui.cpp | 2 +- src/dock_gui.cpp | 15 +- src/rail_cmd.cpp | 11 +- src/rail_cmd.h | 2 +- src/rail_gui.cpp | 51 +++---- src/road_cmd.cpp | 13 +- src/road_cmd.h | 2 +- src/road_gui.cpp | 59 +++----- src/script/api/script_airport.cpp | 4 +- src/script/api/script_basestation.cpp | 4 +- src/script/api/script_marine.cpp | 8 +- src/script/api/script_rail.cpp | 29 ++-- src/script/api/script_road.cpp | 24 +--- src/script/api/script_station.cpp | 2 +- src/station_cmd.cpp | 194 ++++++++++---------------- src/station_cmd.h | 19 +-- src/station_gui.cpp | 4 +- src/station_type.h | 3 +- src/water_cmd.cpp | 9 +- src/water_cmd.h | 2 +- src/waypoint_cmd.cpp | 43 ++---- src/waypoint_cmd.h | 11 +- src/waypoint_gui.cpp | 2 +- 28 files changed, 218 insertions(+), 333 deletions(-) diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 0de11c9545..5efbb98a30 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -58,20 +58,16 @@ void CcBuildAirport(Commands cmd, const CommandCost &result, TileIndex tile, con static void PlaceAirport(TileIndex tile) { if (_selected_airport_index == -1) return; - uint32 p2 = _ctrl_pressed; - SB(p2, 16, 16, INVALID_STATION); // no station to join - uint32 p1 = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex(); - p1 |= _selected_airport_layout << 8; + byte airport_type = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex(); + byte layout = _selected_airport_layout; + bool adjacent = _ctrl_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, p1, p2, {}).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, airport_type, layout, INVALID_STATION, adjacent).Succeeded(); } else { - uint32 p2_final = p2; - if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - - return Command::Post(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, p1, p2_final, {}); + return Command::Post(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, airport_type, layout, to_join, adjacent); } }; diff --git a/src/cmd_helper.h b/src/cmd_helper.h index ceb4d4bd9b..03b6e8ea77 100644 --- a/src/cmd_helper.h +++ b/src/cmd_helper.h @@ -31,4 +31,15 @@ template static inline T Extract(U v) return IsInsideMM(masked, EnumPropsT::begin, EnumPropsT::end) ? (T)masked : EnumPropsT::invalid; } +/** + * Check if an enum value is inside it's valid values. + * @tparam T Type of enum. + * @param v The value to validate + * @return True if enum is valid. + */ +template static constexpr inline bool IsEnumValid(T v) noexcept +{ + return IsInsideMM(v, EnumPropsT::begin, EnumPropsT::end); +} + #endif /* CMD_HELPER_H */ diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 222b4120e3..8f9b5626c9 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -201,7 +201,7 @@ static inline bool IsInsideBS(const T x, const size_t base, const size_t size) * @see IsInsideBS() */ template -static inline bool IsInsideMM(const T x, const size_t min, const size_t max) +static constexpr inline bool IsInsideMM(const T x, const size_t min, const size_t max) noexcept { return (size_t)(x - min) < (max - min); } diff --git a/src/depot_cmd.cpp b/src/depot_cmd.cpp index 1ffaeb70b2..294de69e32 100644 --- a/src/depot_cmd.cpp +++ b/src/depot_cmd.cpp @@ -39,15 +39,13 @@ static bool IsUniqueDepotName(const std::string &name) /** * Rename a depot. * @param flags type of operation - * @param tile unused - * @param p1 id of depot - * @param p2 unused + * @param depot_id id of depot * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameDepot(DoCommandFlag flags, DepotID depot_id, const std::string &text) { - Depot *d = Depot::GetIfValid(p1); + Depot *d = Depot::GetIfValid(depot_id); if (d == nullptr) return CMD_ERROR; CommandCost ret = CheckTileOwnership(d->xy); diff --git a/src/depot_cmd.h b/src/depot_cmd.h index cc9701fb7f..d476aecaf9 100644 --- a/src/depot_cmd.h +++ b/src/depot_cmd.h @@ -11,8 +11,9 @@ #define DEPOT_CMD_H #include "command_type.h" +#include "depot_type.h" -CommandProc CmdRenameDepot; +CommandCost CmdRenameDepot(DoCommandFlag flags, DepotID depot_id, const std::string &text); DEF_CMD_TRAIT(CMD_RENAME_DEPOT, CmdRenameDepot, 0, CMDT_OTHER_MANAGEMENT) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 1b5929de7e..7fd2e03471 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -837,7 +837,7 @@ struct DepotWindow : Window { if (str == nullptr) return; /* Do depot renaming */ - Command::Post(STR_ERROR_CAN_T_RENAME_DEPOT, 0, this->GetDepotIndex(), 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_DEPOT, this->GetDepotIndex(), str); } bool OnRightClick(Point pt, int widget) override diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 328ce1c20c..cdcb4ea84a 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -204,7 +204,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_DEPOT: // Build depot button - Command::Post(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction, 0, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction); break; case WID_DT_STATION: { // Build station button @@ -212,17 +212,12 @@ struct BuildDocksToolbarWindow : Window { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile, ReverseDiagDir(dir)) : tile); - uint32 p1 = _ctrl_pressed; - uint32 p2 = (uint32)INVALID_STATION << 16; // no station to join - + bool adjacent = _ctrl_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, p1, p2, {}).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, INVALID_STATION, adjacent).Succeeded(); } else { - uint32 p2_final = p2; - if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - - return Command::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, p1, p2_final, {}); + return Command::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, to_join, adjacent); } }; @@ -231,7 +226,7 @@ struct BuildDocksToolbarWindow : Window { } case WID_DT_BUOY: // Build buoy button - Command::Post(STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile, 0, 0, {}); + Command::Post(STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile); break; case WID_DT_RIVER: // Build river button (in scenario editor) diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 066fb78200..389c44dd98 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -976,24 +976,21 @@ CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p * Build a train depot * @param flags operation to perform * @param tile position of the train depot - * @param p1 rail type - * @param p2 bit 0..1 entrance direction (DiagDirection) + * @param railtype rail type + * @param dir entrance direction * @param text unused * @return the cost of this operation or an error * * @todo When checking for the tile slope, * distinguish between "Flat land required" and "land sloped in wrong direction" */ -CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType railtype, DiagDirection dir) { /* check railtype and valid direction for depot (0 through 3), 4 in total */ - RailType railtype = Extract(p1); - if (!ValParamRailtype(railtype)) return CMD_ERROR; + if (!ValParamRailtype(railtype) || !IsEnumValid(dir)) return CMD_ERROR; Slope tileh = GetTileSlope(tile); - DiagDirection dir = Extract(p2); - CommandCost cost(EXPENSES_CONSTRUCTION); /* Prohibit construction if diff --git a/src/rail_cmd.h b/src/rail_cmd.h index 1fb0fdee0d..31266e2b03 100644 --- a/src/rail_cmd.h +++ b/src/rail_cmd.h @@ -16,7 +16,7 @@ CommandProc CmdBuildRailroadTrack; CommandProc CmdRemoveRailroadTrack; CommandProc CmdBuildSingleRail; CommandProc CmdRemoveSingleRail; -CommandProc CmdBuildTrainDepot; +CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType railtype, DiagDirection dir); CommandProc CmdBuildSingleSignal; CommandProc CmdRemoveSingleSignal; CommandProc CmdConvertRail; diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index c1c45d5d72..60ac12c726 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -139,8 +139,7 @@ void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, const { if (result.Failed()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); - DiagDirection dir = (DiagDirection)p2; + auto [tile_, rt, dir] = EndianBufferReader::ToValue::Args>(data); if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); @@ -173,7 +172,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } else { /* Tile where we can't build rail waypoints. This is always going to fail, * but provides the user with a proper error message. */ - Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, tile, 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, tile, AXIS_X, 1, 1, STAT_CLASS_WAYP, 0, INVALID_STATION, false); } } @@ -199,21 +198,21 @@ static void PlaceRail_Station(TileIndex tile) VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION); VpSetPlaceSizingLimit(_settings_game.station.station_spread); } else { - uint32 p1 = _cur_railtype | _railstation.orientation << 6 | _settings_client.gui.station_numtracks << 8 | _settings_client.gui.station_platlength << 16 | _ctrl_pressed << 24; - uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16; - int w = _settings_client.gui.station_numtracks; int h = _settings_client.gui.station_platlength; if (!_railstation.orientation) Swap(w, h); + RailStationGUISettings params = _railstation; + RailType rt = _cur_railtype; + byte numtracks = _settings_client.gui.station_numtracks; + byte platlength = _settings_client.gui.station_platlength; + bool adjacent = _ctrl_pressed; + auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, p1, p2, {}).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, rt, params.orientation, numtracks, platlength, params.station_class, params.station_type, INVALID_STATION, adjacent).Succeeded(); } else { - uint32 p2_final = p2; - if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - - return Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, tile, p1, p2_final, {}); + return Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, tile, rt, params.orientation, numtracks, platlength, params.station_class, params.station_type, to_join, adjacent); } }; @@ -664,7 +663,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_DEPOT: - Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT, CcRailDepot, tile, _cur_railtype, _build_depot_direction, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT, CcRailDepot, tile, _cur_railtype, _build_depot_direction); break; case WID_RAT_BUILD_WAYPOINT: @@ -734,27 +733,25 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - Command::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1, {}); + Command::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed); } else { HandleStationPlacement(start_tile, end_tile); } } else { /* Waypoint */ if (_remove_button_clicked) { - Command::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed ? 0 : 1, {}); + Command::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _ctrl_pressed); } else { TileArea ta(start_tile, end_tile); - uint32 p1 = _cur_railtype | (select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y) << 6 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24; - uint32 p2 = STAT_CLASS_WAYP | _cur_waypoint_type << 8 | INVALID_STATION << 16; + Axis axis = select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y; + bool adjacent = _ctrl_pressed; + byte waypoint_type = _cur_waypoint_type; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, p1, p2, {}).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, axis, ta.w, ta.h, STAT_CLASS_WAYP, waypoint_type, INVALID_STATION, adjacent).Succeeded(); } else { - uint32 p2_final = p2; - if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - - return Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, ta.tile, p1, p2_final, {}); + return Command::Post(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, ta.tile, axis, ta.w, ta.h, STAT_CLASS_WAYP, waypoint_type, to_join, adjacent); } }; @@ -913,17 +910,15 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) if (_railstation.orientation == AXIS_X) Swap(numtracks, platlength); - uint32 p1 = _cur_railtype | _railstation.orientation << 6 | numtracks << 8 | platlength << 16 | _ctrl_pressed << 24; - uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16; + RailStationGUISettings params = _railstation; + RailType rt = _cur_railtype; + bool adjacent = _ctrl_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, p1, p2, {}).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, rt, params.orientation, numtracks, platlength, params.station_class, params.station_type, INVALID_STATION, adjacent).Succeeded(); } else { - uint32 p2_final = p2; - if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - - return Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, ta.tile, p1, p2_final, {}); + return Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION, CcStation, ta.tile, rt, params.orientation, numtracks, platlength, params.station_class, params.station_type, to_join, adjacent); } }; diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 637b476d0d..72dcb5276e 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1157,21 +1157,16 @@ CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 * Build a road depot. * @param tile tile where to build the depot * @param flags operation to perform - * @param p1 bit 0..1 entrance direction (DiagDirection) - * bit 2..7 road type - * @param p2 unused - * @param text unused + * @param rt road type + * @param dir entrance direction * @return the cost of this operation or an error * * @todo When checking for the tile slope, * distinguish between "Flat land required" and "land sloped in wrong direction" */ -CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, RoadType rt, DiagDirection dir) { - DiagDirection dir = Extract(p1); - - RoadType rt = Extract(p1); - if (!ValParamRoadType(rt)) return CMD_ERROR; + if (!ValParamRoadType(rt) || !IsEnumValid(dir)) return CMD_ERROR; CommandCost cost(EXPENSES_CONSTRUCTION); diff --git a/src/road_cmd.h b/src/road_cmd.h index 05f064b0bc..0cab1252f0 100644 --- a/src/road_cmd.h +++ b/src/road_cmd.h @@ -20,7 +20,7 @@ void UpdateNearestTownForRoadTiles(bool invalidate); CommandProc CmdBuildLongRoad; CommandProc CmdRemoveLongRoad; CommandProc CmdBuildRoad; -CommandProc CmdBuildRoadDepot; +CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, RoadType rt, DiagDirection dir); CommandProc CmdConvertRoad; DEF_CMD_TRAIT(CMD_BUILD_LONG_ROAD, CmdBuildLongRoad, CMD_AUTO | CMD_NO_WATER | CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/road_gui.cpp b/src/road_gui.cpp index a777c9c1d1..beba949e4c 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -133,9 +133,8 @@ void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, const { if (result.Failed()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); + auto [tile_, rt, dir] = EndianBufferReader::ToValue::Args>(data); - DiagDirection dir = (DiagDirection)GB(p1, 0, 2); if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); ConnectRoadToStructure(tile, dir); @@ -146,32 +145,22 @@ void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, const * @param result Result of the build road stop command. * @param cmd Unused. * @param tile Start tile. - * @param p1 bit 0..7: Width of the road stop. - * bit 8..15: Length of the road stop. - * @param p2 bit 0: 0 For bus stops, 1 for truck stops. - * bit 1: 0 For normal stops, 1 for drive-through. - * bit 2: Allow stations directly adjacent to other stations. - * bit 3..4: Entrance direction (#DiagDirection) for normal stops. - * bit 3: #Axis of the road for drive-through stops. - * bit 5..9: The roadtype. - * bit 16..31: Station ID to join (NEW_STATION if build new one). - * @param text Unused. + * @param data Command data. * @see CmdBuildRoadStop */ void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); + auto [tile_, width, length, stop_type, is_drive_through, dir, rt, station_to_join, adjacent] = EndianBufferReader::ToValue::Args>(data); - DiagDirection dir = (DiagDirection)GB(p2, 3, 2); if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); - TileArea roadstop_area(tile, GB(p1, 0, 8), GB(p1, 8, 8)); + TileArea roadstop_area(tile, width, length); for (TileIndex cur_tile : roadstop_area) { ConnectRoadToStructure(cur_tile, dir); /* For a drive-through road stop build connecting road for other entrance. */ - if (HasBit(p2, 1)) ConnectRoadToStructure(cur_tile, ReverseDiagDir(dir)); + if (is_drive_through) ConnectRoadToStructure(cur_tile, ReverseDiagDir(dir)); } } @@ -179,34 +168,24 @@ void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, const C * Place a new road stop. * @param start_tile First tile of the area. * @param end_tile Last tile of the area. - * @param p2 bit 0: 0 For bus stops, 1 for truck stops. - * bit 2: Allow stations directly adjacent to other stations. - * bit 5..10: The roadtypes. + * @param stop_type Type of stop (bus/truck). + * @param adjacent Allow stations directly adjacent to other stations. + * @param rt The roadtypes. * @param err_msg Error message to show. * @see CcRoadStop() */ -static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, StringID err_msg) +static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, RoadStopType stop_type, bool adjacent, RoadType rt, StringID err_msg) { TileArea ta(start_tile, end_tile); - uint32 p1 = (uint32)(ta.w | ta.h << 8); - - uint8 ddir = _road_station_picker_orientation; - SB(p2, 16, 16, INVALID_STATION); // no station to join - - if (ddir >= DIAGDIR_END) { - SetBit(p2, 1); // It's a drive-through stop. - ddir -= DIAGDIR_END; // Adjust picker result to actual direction. - } - p2 |= ddir << 3; // Set the DiagDirecion into p2 bits 3 and 4. + DiagDirection ddir = _road_station_picker_orientation; + bool drive_through = ddir >= DIAGDIR_END; + if (drive_through) ddir = static_cast(ddir - DIAGDIR_END); // Adjust picker result to actual direction. auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, p1, p2, {}).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), ta.tile, ta.w, ta.h, stop_type, drive_through, ddir, rt, INVALID_STATION, adjacent).Succeeded(); } else { - uint32 p2_final = p2; - if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join); - - return Command::Post(err_msg, CcRoadStop, ta.tile, p1, p2_final, {}); + return Command::Post(err_msg, CcRoadStop, ta.tile, ta.w, ta.h, stop_type, drive_through, ddir, rt, to_join, adjacent); } }; @@ -568,7 +547,7 @@ struct BuildRoadToolbarWindow : Window { case WID_ROT_DEPOT: Command::Post(this->rti->strings.err_depot, CcRoadDepot, - tile, _cur_roadtype << 2 | _road_depot_orientation, 0, {}); + tile, _cur_roadtype, _road_depot_orientation); break; case WID_ROT_BUS_STATION: @@ -700,9 +679,9 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_BUS_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - Command::Post(this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, {}); + Command::Post(this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w, ta.h, ROADSTOP_BUS, _ctrl_pressed); } else { - PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_BUS, this->rti->strings.err_build_station[ROADSTOP_BUS]); + PlaceRoadStop(start_tile, end_tile, ROADSTOP_BUS, _ctrl_pressed, _cur_roadtype, this->rti->strings.err_build_station[ROADSTOP_BUS]); } } break; @@ -712,9 +691,9 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_TRUCK_STATION)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - Command::Post(this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, {}); + Command::Post(this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w, ta.h, ROADSTOP_TRUCK, _ctrl_pressed); } else { - PlaceRoadStop(start_tile, end_tile, _cur_roadtype << 5 | (_ctrl_pressed << 2) | ROADSTOP_TRUCK, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); + PlaceRoadStop(start_tile, end_tile, ROADSTOP_TRUCK, _ctrl_pressed, _cur_roadtype, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); } } break; diff --git a/src/script/api/script_airport.cpp b/src/script/api/script_airport.cpp index 5927b16620..8ed4dbfcac 100644 --- a/src/script/api/script_airport.cpp +++ b/src/script/api/script_airport.cpp @@ -77,9 +77,7 @@ EnforcePrecondition(false, IsValidAirportType(type)); EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id)); - uint p2 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 1; - p2 |= (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::Command::Do(tile, type, p2, {}); + return ScriptObject::Command::Do(tile, type, 0, (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION), station_id == ScriptStation::STATION_JOIN_ADJACENT); } /* static */ bool ScriptAirport::RemoveAirport(TileIndex tile) diff --git a/src/script/api/script_basestation.cpp b/src/script/api/script_basestation.cpp index a249344101..788d549500 100644 --- a/src/script/api/script_basestation.cpp +++ b/src/script/api/script_basestation.cpp @@ -45,9 +45,9 @@ EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_STATION_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); if (::Station::IsValidID(station_id)) { - return ScriptObject::Command::Do(0, station_id, 0, text); + return ScriptObject::Command::Do(station_id, text); } else { - return ScriptObject::Command::Do(0, station_id, 0, text); + return ScriptObject::Command::Do(station_id, text); } } diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp index f368ec9185..8093233948 100644 --- a/src/script/api/script_marine.cpp +++ b/src/script/api/script_marine.cpp @@ -83,7 +83,7 @@ EnforcePrecondition(false, ::IsValidTile(front)); EnforcePrecondition(false, (::TileX(front) == ::TileX(tile)) != (::TileY(front) == ::TileY(tile))); - return ScriptObject::Command::Do(tile, ::TileX(front) == ::TileX(tile), 0, {}); + return ScriptObject::Command::Do(tile, ::TileX(front) == ::TileX(tile) ? AXIS_Y : AXIS_X); } /* static */ bool ScriptMarine::BuildDock(TileIndex tile, StationID station_id) @@ -92,9 +92,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id)); - uint p1 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 1; - uint p2 = (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::Command::Do(tile, p1, p2, {}); + return ScriptObject::Command::Do(tile, ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION, station_id != ScriptStation::STATION_JOIN_ADJACENT); } /* static */ bool ScriptMarine::BuildBuoy(TileIndex tile) @@ -102,7 +100,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptMarine::BuildLock(TileIndex tile) diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp index ebba16343c..30a1085d48 100644 --- a/src/script/api/script_rail.cpp +++ b/src/script/api/script_rail.cpp @@ -142,9 +142,9 @@ EnforcePrecondition(false, ::TileX(tile) == ::TileX(front) || ::TileY(tile) == ::TileY(front)); EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); - uint entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0); + DiagDirection entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? DIAGDIR_SE : DIAGDIR_NW) : (::TileX(tile) < ::TileX(front) ? DIAGDIR_SW : DIAGDIR_NE); - return ScriptObject::Command::Do(tile, ScriptObject::GetRailType(), entrance_dir, {}); + return ScriptObject::Command::Do(tile, (::RailType)ScriptObject::GetRailType(), entrance_dir); } /* static */ bool ScriptRail::BuildRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id) @@ -157,10 +157,8 @@ EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id)); - uint32 p1 = GetCurrentRailType() | (platform_length << 16) | (num_platforms << 8); - if (direction == RAILTRACK_NW_SE) p1 |= (1 << 6); - if (station_id != ScriptStation::STATION_JOIN_ADJACENT) p1 |= (1 << 24); - return ScriptObject::Command::Do(tile, p1, (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16, {}); + bool adjacent = station_id != ScriptStation::STATION_JOIN_ADJACENT; + return ScriptObject::Command::Do(tile, (::RailType)GetCurrentRailType(), direction == RAILTRACK_NW_SE ? AXIS_Y : AXIS_X, num_platforms, platform_length, STAT_CLASS_DFLT, 0, ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION, adjacent); } /* static */ bool ScriptRail::BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station) @@ -176,10 +174,6 @@ EnforcePrecondition(false, source_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || source_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(source_industry)); EnforcePrecondition(false, goal_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || goal_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(goal_industry)); - uint32 p1 = GetCurrentRailType() | (platform_length << 16) | (num_platforms << 8); - if (direction == RAILTRACK_NW_SE) p1 |= 1 << 6; - if (station_id != ScriptStation::STATION_JOIN_ADJACENT) p1 |= (1 << 24); - const GRFFile *file; uint16 res = GetAiPurchaseCallbackResult( GSF_STATIONS, @@ -193,7 +187,10 @@ std::min(15u, num_platforms) << 4 | std::min(15u, platform_length), &file ); - uint32 p2 = (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; + + Axis axis = direction == RAILTRACK_NW_SE ? AXIS_Y : AXIS_X; + bool adjacent = station_id != ScriptStation::STATION_JOIN_ADJACENT; + StationID to_join = ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION; if (res != CALLBACK_FAILED) { int index = 0; const StationSpec *spec = StationClass::GetByGrf(file->grfid, res, &index); @@ -201,11 +198,11 @@ Debug(grf, 1, "{} returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename); } else { /* We might have gotten an usable station spec. Try to build it, but if it fails we'll fall back to the original station. */ - if (ScriptObject::Command::Do(tile, p1, p2 | spec->cls_id | index << 8, {})) return true; + if (ScriptObject::Command::Do(tile, (::RailType)GetCurrentRailType(), axis, num_platforms, platform_length, spec->cls_id, index, to_join, adjacent)) return true; } } - return ScriptObject::Command::Do(tile, p1, p2, {}); + return ScriptObject::Command::Do(tile, (::RailType)GetCurrentRailType(), axis, num_platforms, platform_length, STAT_CLASS_DFLT, 0, to_join, adjacent); } /* static */ bool ScriptRail::BuildRailWaypoint(TileIndex tile) @@ -216,7 +213,7 @@ EnforcePrecondition(false, GetRailTracks(tile) == RAILTRACK_NE_SW || GetRailTracks(tile) == RAILTRACK_NW_SE); EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); - return ScriptObject::Command::Do(tile, GetCurrentRailType() | (GetRailTracks(tile) == RAILTRACK_NE_SW ? AXIS_X : AXIS_Y) << 6 | 1 << 8 | 1 << 16, STAT_CLASS_WAYP | INVALID_STATION << 16, {}); + return ScriptObject::Command::Do(tile, GetRailTracks(tile) == RAILTRACK_NE_SW ? AXIS_X : AXIS_Y, 1, 1, STAT_CLASS_WAYP, 0, INVALID_STATION, false); } /* static */ bool ScriptRail::RemoveRailWaypointTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail) @@ -225,7 +222,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, ::IsValidTile(tile2)); - return ScriptObject::Command::Do(tile, tile2, keep_rail ? 1 : 0, {}); + return ScriptObject::Command::Do(tile, tile2, keep_rail); } /* static */ bool ScriptRail::RemoveRailStationTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail) @@ -234,7 +231,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, ::IsValidTile(tile2)); - return ScriptObject::Command::Do(tile, tile2, keep_rail ? 1 : 0, {}); + return ScriptObject::Command::Do(tile, tile2, keep_rail); } /* static */ uint ScriptRail::GetRailTracks(TileIndex tile) diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp index 26cdb5190a..c629396b70 100644 --- a/src/script/api/script_road.cpp +++ b/src/script/api/script_road.cpp @@ -529,9 +529,9 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, ::TileX(tile) == ::TileX(front) || ::TileY(tile) == ::TileY(front)); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - uint entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0); + DiagDirection entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? DIAGDIR_SE : DIAGDIR_NW) : (::TileX(tile) < ::TileX(front) ? DIAGDIR_SW : DIAGDIR_NE); - return ScriptObject::Command::Do(tile, entrance_dir | (ScriptObject::GetRoadType() << 2), 0, {}); + return ScriptObject::Command::Do(tile, ScriptObject::GetRoadType(), entrance_dir); } /* static */ bool ScriptRoad::_BuildRoadStationInternal(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, bool drive_through, StationID station_id) @@ -545,20 +545,10 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, road_veh_type == ROADVEHTYPE_BUS || road_veh_type == ROADVEHTYPE_TRUCK); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - uint entrance_dir; - if (drive_through) { - entrance_dir = ::TileY(tile) != ::TileY(front); - } else { - entrance_dir = (::TileX(tile) == ::TileX(front)) ? (::TileY(tile) < ::TileY(front) ? 1 : 3) : (::TileX(tile) < ::TileX(front) ? 2 : 0); - } - - uint p2 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 4; - p2 |= drive_through ? 2 : 0; - p2 |= road_veh_type == ROADVEHTYPE_TRUCK ? 1 : 0; - p2 |= ScriptObject::GetRoadType() << 5; - p2 |= entrance_dir << 3; - p2 |= (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::Command::Do(tile, 1 | 1 << 8, p2, {}); + DiagDirection entrance_dir = DiagdirBetweenTiles(tile, front); + RoadStopType stop_type = road_veh_type == ROADVEHTYPE_TRUCK ? ROADSTOP_TRUCK : ROADSTOP_BUS; + StationID to_join = ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION; + return ScriptObject::Command::Do(tile, 1, 1, stop_type, drive_through, entrance_dir, ScriptObject::GetRoadType(), to_join, station_id != ScriptStation::STATION_JOIN_ADJACENT); } /* static */ bool ScriptRoad::BuildRoadStation(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, StationID station_id) @@ -612,7 +602,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, IsTileType(tile, MP_STATION)); EnforcePrecondition(false, IsRoadStop(tile)); - return ScriptObject::Command::Do(tile, 1 | 1 << 8, GetRoadStopType(tile), {}); + return ScriptObject::Command::Do(tile, 1, 1, GetRoadStopType(tile), false); } /* static */ Money ScriptRoad::GetBuildCost(RoadType roadtype, BuildType build_type) diff --git a/src/script/api/script_station.cpp b/src/script/api/script_station.cpp index 34e7d84341..3b38844df6 100644 --- a/src/script/api/script_station.cpp +++ b/src/script/api/script_station.cpp @@ -240,5 +240,5 @@ template EnforcePrecondition(false, IsValidStation(station_id)); EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT)); - return ScriptObject::Command::Do(0, station_id, 0, {}); + return ScriptObject::Command::Do(station_id); } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 33f86146c4..bdc58588b9 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1241,37 +1241,23 @@ static void RestoreTrainReservation(Train *v) * Build rail station * @param flags operation to perform * @param tile_org northern most position of station dragging/placement - * @param p1 various bitstuffed elements - * - p1 = (bit 0- 5) - railtype - * - p1 = (bit 6) - orientation (Axis) - * - p1 = (bit 8-15) - number of tracks - * - p1 = (bit 16-23) - platform length - * - p1 = (bit 24) - allow stations directly adjacent to other stations. - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 7) - custom station class - * - p2 = (bit 8-15) - custom station id - * - p2 = (bit 16-31) - station ID to join (NEW_STATION if build new one) - * @param text unused + * @param rt railtype + * @param axis orientation (Axis) + * @param numtracks number of tracks + * @param plat_len platform length + * @param spec_class custom station class + * @param spec_index custom station id + * @param station_to_join station ID to join (NEW_STATION if build new one) + * @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, uint32 p1, uint32 p2, const std::string &text) +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) { - /* Unpack parameters */ - RailType rt = Extract(p1); - Axis axis = Extract(p1); - byte numtracks = GB(p1, 8, 8); - byte plat_len = GB(p1, 16, 8); - bool adjacent = HasBit(p1, 24); - - StationClassID spec_class = Extract(p2); - byte spec_index = GB(p2, 8, 8); - StationID station_to_join = GB(p2, 16, 16); - /* Does the authority allow this? */ CommandCost ret = CheckIfAuthorityAllowsNewStation(tile_org, flags); if (ret.Failed()) return ret; - if (!ValParamRailtype(rt)) return CMD_ERROR; + if (!ValParamRailtype(rt) || !IsEnumValid(axis)) return CMD_ERROR; /* Check if the given station class is valid */ if ((uint)spec_class >= StationClass::GetClassCount() || spec_class == STAT_CLASS_WAYP) return CMD_ERROR; @@ -1657,21 +1643,19 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector &affected_st * This allows for custom-built station with holes and weird layouts * @param flags operation to perform * @param start tile of station piece to remove - * @param p1 start_tile - * @param p2 various bitstuffed elements - * - p2 = bit 0 - if set keep the rail - * @param text unused + * @param end other edge of the rect to remove + * @param keep_rail if set keep the rail * @return the cost of this operation or an error */ -CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail) { - TileIndex end = p1 == 0 ? start : p1; + if (end == 0) end = start; if (start >= MapSize() || end >= MapSize()) return CMD_ERROR; TileArea ta(start, end); std::vector affected_stations; - CommandCost ret = RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_STATION_RAIL], HasBit(p2, 0)); + CommandCost ret = RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_STATION_RAIL], keep_rail); if (ret.Failed()) return ret; /* Do all station specific functions here. */ @@ -1691,21 +1675,19 @@ CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, uint3 * This allows for custom-built waypoint with holes and weird layouts * @param flags operation to perform * @param start tile of waypoint piece to remove - * @param p1 start_tile - * @param p2 various bitstuffed elements - * - p2 = bit 0 - if set keep the rail - * @param text unused + * @param end other edge of the rect to remove + * @param keep_rail if set keep the rail * @return the cost of this operation or an error */ -CommandCost CmdRemoveFromRailWaypoint(DoCommandFlag flags, TileIndex start, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveFromRailWaypoint(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail) { - TileIndex end = p1 == 0 ? start : p1; + if (end == 0) end = start; if (start >= MapSize() || end >= MapSize()) return CMD_ERROR; TileArea ta(start, end); std::vector affected_stations; - return RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_WAYPOINT_RAIL], HasBit(p2, 0)); + return RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_WAYPOINT_RAIL], keep_rail); } @@ -1756,7 +1738,7 @@ static CommandCost RemoveRailStation(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove platforms tile by tile */ if (_current_company == OWNER_WATER) { - return Command::Do(DC_EXEC, tile, 0, 0, {}); + return Command::Do(DC_EXEC, tile, 0, false); } Station *st = Station::GetByTile(tile); @@ -1777,7 +1759,7 @@ static CommandCost RemoveRailWaypoint(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove waypoints tile by tile */ if (_current_company == OWNER_WATER) { - return Command::Do(DC_EXEC, tile, 0, 0, {}); + return Command::Do(DC_EXEC, tile, 0, false); } return RemoveRailStation(Waypoint::GetByTile(tile), flags, _price[PR_CLEAR_WAYPOINT_RAIL]); @@ -1824,32 +1806,23 @@ static CommandCost FindJoiningRoadStop(StationID existing_stop, StationID statio * Build a bus or truck stop. * @param flags Operation to perform. * @param tile Northernmost tile of the stop. - * @param p1 bit 0..7: Width of the road stop. - * bit 8..15: Length of the road stop. - * @param p2 bit 0: 0 For bus stops, 1 for truck stops. - * bit 1: 0 For normal stops, 1 for drive-through. - * bit 2: Allow stations directly adjacent to other stations. - * bit 3..4: Entrance direction (#DiagDirection) for normal stops. - * bit 3: #Axis of the road for drive-through stops. - * bit 5..10: The roadtype. - * bit 16..31: Station ID to join (NEW_STATION if build new one). - * @param text Unused. + * @param width Width of the road stop. + * @param length Length of the road stop. + * @param stop_type Type of road stop (bus/truck). + * @param is_drive_through False for normal stops, true for drive-through. + * @param ddir Entrance direction (#DiagDirection) for normal stops. Converted to the axis for drive-through stops. + * @param rt The roadtype. + * @param station_to_join Station ID to join (NEW_STATION if build new one). + * @param adjacent Allow stations directly adjacent to other stations. * @return The cost of this operation or an error. */ -CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, StationID station_to_join, bool adjacent) { - bool type = HasBit(p2, 0); - bool is_drive_through = HasBit(p2, 1); - RoadType rt = Extract(p2); - if (!ValParamRoadType(rt)) return CMD_ERROR; - StationID station_to_join = GB(p2, 16, 16); + if (!ValParamRoadType(rt) || !IsEnumValid(ddir) || stop_type >= ROADSTOP_END) return CMD_ERROR; bool reuse = (station_to_join != NEW_STATION); if (!reuse) station_to_join = INVALID_STATION; bool distant_join = (station_to_join != INVALID_STATION); - uint8 width = (uint8)GB(p1, 0, 8); - uint8 length = (uint8)GB(p1, 8, 8); - /* Check if the requested road stop is too big */ if (width > _settings_game.station.station_spread || length > _settings_game.station.station_spread) return_cmd_error(STR_ERROR_STATION_TOO_SPREAD_OUT); /* Check for incorrect width / length. */ @@ -1864,34 +1837,26 @@ CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uin /* Trams only have drive through stops */ if (!is_drive_through && RoadTypeIsTram(rt)) return CMD_ERROR; - DiagDirection ddir; - Axis axis; - if (is_drive_through) { - /* By definition axis is valid, due to there being 2 axes and reading 1 bit. */ - axis = Extract(p2); - ddir = AxisToDiagDir(axis); - } else { - /* By definition ddir is valid, due to there being 4 diagonal directions and reading 2 bits. */ - ddir = Extract(p2); - axis = DiagDirToAxis(ddir); - } + Axis axis = DiagDirToAxis(ddir); CommandCost ret = CheckIfAuthorityAllowsNewStation(tile, flags); if (ret.Failed()) return ret; + bool is_truck_stop = stop_type != ROADSTOP_BUS; + /* Total road stop cost. */ - CommandCost cost(EXPENSES_CONSTRUCTION, roadstop_area.w * roadstop_area.h * _price[type ? PR_BUILD_STATION_TRUCK : PR_BUILD_STATION_BUS]); + CommandCost cost(EXPENSES_CONSTRUCTION, roadstop_area.w * roadstop_area.h * _price[is_truck_stop ? PR_BUILD_STATION_TRUCK : PR_BUILD_STATION_BUS]); StationID est = INVALID_STATION; - ret = CheckFlatLandRoadStop(roadstop_area, flags, is_drive_through ? 5 << axis : 1 << ddir, is_drive_through, type, axis, &est, rt); + ret = CheckFlatLandRoadStop(roadstop_area, flags, is_drive_through ? 5 << axis : 1 << ddir, is_drive_through, is_truck_stop, axis, &est, rt); if (ret.Failed()) return ret; cost.AddCost(ret); Station *st = nullptr; - ret = FindJoiningRoadStop(est, station_to_join, HasBit(p2, 2), roadstop_area, &st); + ret = FindJoiningRoadStop(est, station_to_join, adjacent, roadstop_area, &st); if (ret.Failed()) return ret; /* Check if this number of road stops can be allocated. */ - if (!RoadStop::CanAllocateItem(roadstop_area.w * roadstop_area.h)) return_cmd_error(type ? STR_ERROR_TOO_MANY_TRUCK_STOPS : STR_ERROR_TOO_MANY_BUS_STOPS); + if (!RoadStop::CanAllocateItem(roadstop_area.w * roadstop_area.h)) return_cmd_error(is_truck_stop ? STR_ERROR_TOO_MANY_TRUCK_STOPS : STR_ERROR_TOO_MANY_BUS_STOPS); ret = BuildStationPart(&st, flags, reuse, roadstop_area, STATIONNAMING_ROAD); if (ret.Failed()) return ret; @@ -1911,21 +1876,21 @@ CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uin RoadStop *road_stop = new RoadStop(cur_tile); /* Insert into linked list of RoadStops. */ - RoadStop **currstop = FindRoadStopSpot(type, st); + RoadStop **currstop = FindRoadStopSpot(is_truck_stop, st); *currstop = road_stop; - if (type) { + if (is_truck_stop) { st->truck_station.Add(cur_tile); } else { st->bus_station.Add(cur_tile); } /* Initialize an empty station. */ - st->AddFacility((type) ? FACIL_TRUCK_STOP : FACIL_BUS_STOP, cur_tile); + st->AddFacility(is_truck_stop ? FACIL_TRUCK_STOP : FACIL_BUS_STOP, cur_tile); st->rect.BeforeAddTile(cur_tile, StationRect::ADD_TRY); - RoadStopType rs_type = type ? ROADSTOP_TRUCK : ROADSTOP_BUS; + RoadStopType rs_type = is_truck_stop ? ROADSTOP_TRUCK : ROADSTOP_BUS; if (is_drive_through) { /* Update company infrastructure counts. If the current tile is a normal road tile, remove the old * bits first. */ @@ -1956,7 +1921,7 @@ CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uin } if (st != nullptr) { - st->AfterStationTileSetChange(true, type ? STATION_TRUCK: STATION_BUS); + st->AfterStationTileSetChange(true, is_truck_stop ? STATION_TRUCK: STATION_BUS); } return cost; } @@ -2079,25 +2044,21 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags) * Remove bus or truck stops. * @param flags Operation to perform. * @param tile Northernmost tile of the removal area. - * @param p1 bit 0..7: Width of the removal area. - * bit 8..15: Height of the removal area. - * @param p2 bit 0: 0 For bus stops, 1 for truck stops. - * @param p2 bit 1: 0 to keep roads of all drive-through stops, 1 to remove them. - * @param text Unused. + * @param width Width of the removal area. + * @param height Height of the removal area. + * @param stop_type Type of stop (bus/truck). + * @param remove_road Remove roads of drive-through stops? * @return The cost of this operation or an error. */ -CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint height, RoadStopType stop_type, bool remove_road) { - uint8 width = (uint8)GB(p1, 0, 8); - uint8 height = (uint8)GB(p1, 8, 8); - bool keep_drive_through_roads = !HasBit(p2, 1); - + if (stop_type >= ROADSTOP_END) return CMD_ERROR; /* Check for incorrect width / height. */ if (width == 0 || height == 0) return CMD_ERROR; /* Check if the first tile and the last tile are valid */ if (!IsValidTile(tile) || TileAddWrap(tile, width - 1, height - 1) == INVALID_TILE) return CMD_ERROR; /* Bankrupting company is not supposed to remove roads, there may be road vehicles. */ - if (!keep_drive_through_roads && (flags & DC_BANKRUPT)) return CMD_ERROR; + if (remove_road && (flags & DC_BANKRUPT)) return CMD_ERROR; TileArea roadstop_area(tile, width, height); @@ -2107,7 +2068,7 @@ CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, ui for (TileIndex cur_tile : roadstop_area) { /* Make sure the specified tile is a road stop of the correct type */ - if (!IsTileType(cur_tile, MP_STATION) || !IsRoadStop(cur_tile) || (uint32)GetRoadStopType(cur_tile) != GB(p2, 0, 1)) continue; + if (!IsTileType(cur_tile, MP_STATION) || !IsRoadStop(cur_tile) || GetRoadStopType(cur_tile) != stop_type) continue; /* Save information on to-be-restored roads before the stop is removed. */ RoadBits road_bits = ROAD_NONE; @@ -2119,7 +2080,7 @@ CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint32 p1, ui if (road_type[rtt] == INVALID_ROADTYPE) continue; road_owner[rtt] = GetRoadOwner(cur_tile, rtt); /* If we don't want to preserve our roads then restore only roads of others. */ - if (!keep_drive_through_roads && road_owner[rtt] == _current_company) road_type[rtt] = INVALID_ROADTYPE; + if (remove_road && road_owner[rtt] == _current_company) road_type[rtt] = INVALID_ROADTYPE; } road_bits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(cur_tile))); } @@ -2236,23 +2197,17 @@ void UpdateAirportsNoise() * Place an Airport. * @param flags operation to perform * @param tile tile where airport will be built - * @param p1 - * - p1 = (bit 0- 7) - airport type, @see airport.h - * - p1 = (bit 8-15) - airport layout - * @param p2 various bitstuffed elements - * - p2 = (bit 0) - allow airports directly adjacent to other airports. - * - p2 = (bit 16-31) - station ID to join (NEW_STATION if build new one) - * @param text unused + * @param airport_type airport type, @see airport.h + * @param layout airport layout + * @param station_to_join station ID to join (NEW_STATION if build new one) + * @param allow_adjacent allow airports directly adjacent to other airports. * @return the cost of this operation or an error */ -CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, byte airport_type, byte layout, StationID station_to_join, bool allow_adjacent) { - StationID station_to_join = GB(p2, 16, 16); bool reuse = (station_to_join != NEW_STATION); if (!reuse) station_to_join = INVALID_STATION; bool distant_join = (station_to_join != INVALID_STATION); - byte airport_type = GB(p1, 0, 8); - byte layout = GB(p1, 8, 8); if (distant_join && (!_settings_game.station.distant_join_stations || !Station::IsValidID(station_to_join))) return CMD_ERROR; @@ -2313,7 +2268,7 @@ CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint } Station *st = nullptr; - ret = FindJoiningStation(INVALID_STATION, station_to_join, HasBit(p2, 0), airport_area, &st); + ret = FindJoiningStation(INVALID_STATION, station_to_join, allow_adjacent, airport_area, &st); if (ret.Failed()) return ret; /* Distant join */ @@ -2456,16 +2411,13 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags) /** * Open/close an airport to incoming aircraft. * @param flags Operation to perform. - * @param tile Unused. - * @param p1 Station ID of the airport. - * @param p2 Unused. - * @param text unused + * @param station_id Station ID of the airport. * @return the cost of this operation or an error */ -CommandCost CmdOpenCloseAirport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdOpenCloseAirport(DoCommandFlag flags, StationID station_id) { - if (!Station::IsValidID(p1)) return CMD_ERROR; - Station *st = Station::Get(p1); + if (!Station::IsValidID(station_id)) return CMD_ERROR; + Station *st = Station::Get(station_id); if (!(st->facilities & FACIL_AIRPORT) || st->owner == OWNER_NONE) return CMD_ERROR; @@ -2512,14 +2464,12 @@ static const byte _dock_h_chk[4] = { 1, 2, 1, 2 }; * Build a dock/haven. * @param flags operation to perform * @param tile tile where dock will be built - * @param p1 (bit 0) - allow docks directly adjacent to other docks. - * @param p2 bit 16-31: station ID to join (NEW_STATION if build new one) - * @param text unused + * @param station_to_join station ID to join (NEW_STATION if build new one) + * @param adjacent allow docks directly adjacent to other docks. * @return the cost of this operation or an error */ -CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent) { - StationID station_to_join = GB(p2, 16, 16); bool reuse = (station_to_join != NEW_STATION); if (!reuse) station_to_join = INVALID_STATION; bool distant_join = (station_to_join != INVALID_STATION); @@ -2567,7 +2517,7 @@ CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* middle */ Station *st = nullptr; - ret = FindJoiningStation(INVALID_STATION, station_to_join, HasBit(p1, 0), dock_area, &st); + ret = FindJoiningStation(INVALID_STATION, station_to_join, adjacent, dock_area, &st); if (ret.Failed()) return ret; /* Distant join */ @@ -3930,15 +3880,13 @@ static bool IsUniqueStationName(const std::string &name) /** * Rename a station * @param flags operation to perform - * @param tile unused - * @param p1 station ID that is to be renamed - * @param p2 unused + * @param station_id station ID that is to be renamed * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameStation(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameStation(DoCommandFlag flags, StationID station_id, const std::string &text) { - Station *st = Station::GetIfValid(p1); + Station *st = Station::GetIfValid(station_id); if (st == nullptr) return CMD_ERROR; CommandCost ret = CheckOwnership(st->owner); @@ -4244,7 +4192,7 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o } else { if (IsDriveThroughStopTile(tile)) { /* Remove the drive-through road stop */ - Command::Do(DC_EXEC | DC_BANKRUPT, tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS, {}); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, 1, 1, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS, false); assert(IsTileType(tile, MP_ROAD)); /* Change owner of tile and all roadtypes */ ChangeTileOwner(tile, old_owner, new_owner); diff --git a/src/station_cmd.h b/src/station_cmd.h index 8e1facc250..6e85ffbfa2 100644 --- a/src/station_cmd.h +++ b/src/station_cmd.h @@ -11,15 +11,18 @@ #define STATION_CMD_H #include "command_type.h" +#include "station_type.h" -CommandProc CmdBuildAirport; -CommandProc CmdBuildDock; -CommandProc CmdBuildRailStation; -CommandProc CmdRemoveFromRailStation; -CommandProc CmdBuildRoadStop; -CommandProc CmdRemoveRoadStop; -CommandProc CmdRenameStation; -CommandProc CmdOpenCloseAirport; +enum StationClassID : byte; + +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 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, StationID station_to_join, bool adjacent); +CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint 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); DEF_CMD_TRAIT(CMD_BUILD_AIRPORT, CmdBuildAirport, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_BUILD_DOCK, CmdBuildDock, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 1177e558c1..9233878212 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1948,7 +1948,7 @@ struct StationViewWindow : public Window { break; case WID_SV_CLOSE_AIRPORT: - Command::Post(0, this->window_number, 0, {}); + Command::Post(this->window_number); break; case WID_SV_TRAINS: // Show list of scheduled trains to this station @@ -2085,7 +2085,7 @@ struct StationViewWindow : public Window { { if (str == nullptr) return; - Command::Post(STR_ERROR_CAN_T_RENAME_STATION, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_STATION, this->window_number, str); } void OnResize() override diff --git a/src/station_type.h b/src/station_type.h index 36ce7c3ce7..7696c0f087 100644 --- a/src/station_type.h +++ b/src/station_type.h @@ -41,9 +41,10 @@ enum StationType { }; /** Types of RoadStops */ -enum RoadStopType { +enum RoadStopType : byte { ROADSTOP_BUS, ///< A standard stop for buses ROADSTOP_TRUCK, ///< A standard stop for trucks + ROADSTOP_END, ///< End of valid types }; /** The facilities a station might be having */ diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 07c13adcda..3c96f79ad8 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -95,15 +95,12 @@ static void MarkCanalsAndRiversAroundDirty(TileIndex tile) * Build a ship depot. * @param flags type of operation * @param tile tile where ship depot is built - * @param p1 bit 0 depot orientation (Axis) - * @param p2 unused - * @param text unused + * @param axis depot orientation (Axis) * @return the cost of this operation or an error */ -CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, Axis axis) { - Axis axis = Extract(p1); - + if (!IsEnumValid(axis)) return CMD_ERROR; TileIndex tile2 = tile + (axis == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1)); if (!HasTileWaterGround(tile) || !HasTileWaterGround(tile2)) { diff --git a/src/water_cmd.h b/src/water_cmd.h index ccd18f7639..4d3375aa39 100644 --- a/src/water_cmd.h +++ b/src/water_cmd.h @@ -12,7 +12,7 @@ #include "command_type.h" -CommandProc CmdBuildShipDepot; +CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, Axis axis); CommandProc CmdBuildCanal; CommandProc CmdBuildLock; diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index a3edf71e89..85c52c98fa 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -164,30 +164,18 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, * piece of rail * @param flags type of operation * @param start_tile northern most tile where waypoint will be built - * @param p1 various bitstuffed elements - * - p1 = (bit 0- 5) - railtype (not used) - * - p1 = (bit 6) - orientation (Axis) - * - p1 = (bit 8-15) - width of waypoint - * - p1 = (bit 16-23) - height of waypoint - * - p1 = (bit 24) - allow waypoints directly adjacent to other waypoints. - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 7) - custom station class - * - p2 = (bit 8-15) - custom station id - * @param text unused + * @param axis orientation (Axis) + * @param width width of waypoint + * @param height height of waypoint + * @param spec_class custom station class + * @param spec_index custom station id + * @param station_to_join station ID to join (NEW_STATION if build new one) + * @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, uint32 p1, uint32 p2, const std::string &text) +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) { - /* Unpack parameters */ - Axis axis = Extract(p1); - byte width = GB(p1, 8, 8); - byte height = GB(p1, 16, 8); - bool adjacent = HasBit(p1, 24); - - StationClassID spec_class = Extract(p2); - byte spec_index = GB(p2, 8, 8); - StationID station_to_join = GB(p2, 16, 16); - + if (!IsEnumValid(axis)) return CMD_ERROR; /* Check if the given station class is valid */ if (spec_class != STAT_CLASS_WAYP) return CMD_ERROR; if (spec_index >= StationClass::Get(spec_class)->GetSpecCount()) return CMD_ERROR; @@ -299,12 +287,9 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, uint * Build a buoy. * @param flags operation to perform * @param tile tile where to place the buoy - * @param p1 unused - * @param p2 unused - * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildBuoy(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildBuoy(DoCommandFlag flags, TileIndex tile) { if (tile == 0 || !HasTileWaterGround(tile)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE); if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -409,15 +394,13 @@ static bool IsUniqueWaypointName(const std::string &name) /** * Rename a waypoint. * @param flags type of operation - * @param tile unused - * @param p1 id of waypoint - * @param p2 unused + * @param waypoint_id id of waypoint * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameWaypoint(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameWaypoint(DoCommandFlag flags, StationID waypoint_id, const std::string &text) { - Waypoint *wp = Waypoint::GetIfValid(p1); + Waypoint *wp = Waypoint::GetIfValid(waypoint_id); if (wp == nullptr) return CMD_ERROR; if (wp->owner != OWNER_NONE) { diff --git a/src/waypoint_cmd.h b/src/waypoint_cmd.h index 09f7ec5d3e..29855be2c8 100644 --- a/src/waypoint_cmd.h +++ b/src/waypoint_cmd.h @@ -11,11 +11,14 @@ #define WAYPOINT_CMD_H #include "command_type.h" +#include "station_type.h" -CommandProc CmdBuildRailWaypoint; -CommandProc CmdRemoveFromRailWaypoint; -CommandProc CmdBuildBuoy; -CommandProc CmdRenameWaypoint; +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 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); DEF_CMD_TRAIT(CMD_BUILD_RAIL_WAYPOINT, CmdBuildRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_REMOVE_FROM_RAIL_WAYPOINT, CmdRemoveFromRailWaypoint, 0, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 673601f89f..4fca572242 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -139,7 +139,7 @@ public: { if (str == nullptr) return; - Command::Post(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME, this->window_number, str); } }; From 55170ae703dd2f55ae5c2151aa97dd12da1e917e Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 14 Nov 2021 20:07:23 +0100 Subject: [PATCH 126/710] Codechange: Un-bitstuff rail commands. --- src/rail_cmd.cpp | 251 ++++++++++++--------------------- src/rail_cmd.h | 21 +-- src/rail_gui.cpp | 83 ++++------- src/road_cmd.cpp | 2 +- src/script/api/script_rail.cpp | 48 +++---- src/signal_type.h | 4 +- src/station_cmd.cpp | 2 +- 7 files changed, 153 insertions(+), 258 deletions(-) diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 389c44dd98..35c58a1d74 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -429,18 +429,13 @@ static inline bool ValParamTrackOrientation(Track track) * Build a single piece of rail * @param flags operation to perform * @param tile tile to build on - * @param p1 railtype of being built piece (normal, mono, maglev) - * @param p2 various bitstuffed elements - * - (bit 0- 2) - track-orientation, valid values: 0-5 (@see Track) - * - (bit 3) - 0 = error on signal in the way, 1 = auto remove signals when in the way - * @param text unused + * @param railtype railtype of being built piece (normal, mono, maglev) + * @param track track-orientation + * @param auto_remove_signals false = error on signal in the way, true = auto remove signals when in the way * @return the cost of this operation or an error */ -CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType railtype, Track track, bool auto_remove_signals) { - RailType railtype = Extract(p1); - Track track = Extract(p2); - bool auto_remove_signals = HasBit(p2, 3); CommandCost cost(EXPENSES_CONSTRUCTION); if (!ValParamRailtype(railtype) || !ValParamTrackOrientation(track)) return CMD_ERROR; @@ -471,7 +466,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u for (Track track_it = TRACK_BEGIN; track_it < TRACK_END; track_it++) { if (HasTrack(tile, track_it) && HasSignalOnTrack(tile, track_it)) { - CommandCost ret_remove_signals = Command::Do(flags, tile, track_it, 0, {}); + CommandCost ret_remove_signals = Command::Do(flags, tile, track_it); if (ret_remove_signals.Failed()) return ret_remove_signals; cost.AddCost(ret_remove_signals); } @@ -483,7 +478,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u * the present rail type are powered on the new rail type. */ if (GetRailType(tile) != railtype && !HasPowerOnRail(railtype, GetRailType(tile))) { if (HasPowerOnRail(GetRailType(tile), railtype)) { - ret = Command::Do(flags, tile, tile, railtype, {}); + ret = Command::Do(flags, tile, tile, railtype, false); if (ret.Failed()) return ret; cost.AddCost(ret); } else { @@ -619,14 +614,11 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, u * Remove a single piece of track * @param flags operation to perform * @param tile tile to remove track from - * @param p1 unused - * @param p2 rail orientation - * @param text unused + * @param track rail orientation * @return the cost of this operation or an error */ -CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, Track track) { - Track track = Extract(p2); CommandCost cost(EXPENSES_CONSTRUCTION); bool crossing = false; @@ -693,7 +685,7 @@ CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, uint32 p1, /* Charge extra to remove signals on the track, if they are there */ if (HasSignalOnTrack(tile, track)) { - cost.AddCost(Command::Do(flags, tile, track, 0, {})); + cost.AddCost(Command::Do(flags, tile, track)); } if (flags & DC_EXEC) { @@ -786,7 +778,7 @@ bool FloodHalftile(TileIndex t) TrackBits to_remove = lower_track & rail_bits; if (to_remove != 0) { Backup cur_company(_current_company, OWNER_WATER, FILE_LINE); - flooded = Command::Do(DC_EXEC, t, 0, FIND_FIRST_BIT(to_remove), {}).Succeeded(); + flooded = Command::Do(DC_EXEC, t, FindFirstTrack(to_remove)).Succeeded(); cur_company.Restore(); if (!flooded) return flooded; // not yet floodable rail_bits = rail_bits & ~to_remove; @@ -876,27 +868,21 @@ static CommandCost ValidateAutoDrag(Trackdir *trackdir, TileIndex start, TileInd * Build or remove a stretch of railroad tracks. * @param flags operation to perform * @param tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0-5) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev), only used for building - * - p2 = (bit 6-8) - track-orientation, valid values: 0-5 (Track enum) - * - p2 = (bit 9) - 0 = build, 1 = remove tracks - * - p2 = (bit 10) - 0 = build up to an obstacle, 1 = fail if an obstacle is found (used for AIs). - * - p2 = (bit 11) - 0 = error on signal in the way, 1 = auto remove signals when in the way - * @param text unused + * @param end_tile end tile of drag + * @param railtype railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev), only used for building + * @param track track-orientation + * @param remove remove tracks? + * @param auto_remove_signals false = build up to an obstacle, true = fail if an obstacle is found (used for AIs), only used for building + * @param fail_on_obstacle false = error on signal in the way, true = auto remove signals when in the way, only used for building * @return the cost of this operation or an error */ -static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, RailType railtype, Track track, bool remove, bool auto_remove_signals, bool fail_on_obstacle) { CommandCost total_cost(EXPENSES_CONSTRUCTION); - Track track = Extract(p2); - bool remove = HasBit(p2, 9); - bool auto_remove_signals = HasBit(p2, 11); - RailType railtype = Extract(p2); if ((!remove && !ValParamRailtype(railtype)) || !ValParamTrackOrientation(track)) return CMD_ERROR; - if (p1 >= MapSize()) return CMD_ERROR; - TileIndex end_tile = p1; + if (end_tile >= MapSize()) return CMD_ERROR; + Trackdir trackdir = TrackToTrackdir(track); CommandCost ret = ValidateAutoDrag(&trackdir, tile, end_tile); @@ -905,13 +891,12 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, uint3 bool had_success = false; CommandCost last_error = CMD_ERROR; for (;;) { - uint32 p2 = TrackdirToTrack(trackdir) | (auto_remove_signals << 3); - CommandCost ret = remove ? Command::Do(flags, tile, 0, p2, {}) : Command::Do(flags, tile, railtype, p2, {}); + CommandCost ret = remove ? Command::Do(flags, tile, TrackdirToTrack(trackdir)) : Command::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals); if (ret.Failed()) { last_error = ret; if (last_error.GetErrorMessage() != STR_ERROR_ALREADY_BUILT && !remove) { - if (HasBit(p2, 10)) return last_error; + if (fail_on_obstacle) return last_error; break; } @@ -939,18 +924,17 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, uint3 * Stub for the unified rail builder/remover * @param flags operation to perform * @param tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0-5) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev) - * - p2 = (bit 6-8) - track-orientation, valid values: 0-5 (Track enum) - * - p2 = (bit 9) - 0 = build, 1 = remove tracks - * @param text unused - * @return the cost of this operation or an error + * @param end_tile end tile of drag + * @param railtype railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev), only used for building + * @param track track-orientation + * @param auto_remove_signals false = build up to an obstacle, true = fail if an obstacle is found (used for AIs). + * @param fail_on_obstacle false = error on signal in the way, true = auto remove signals when in the way + * @see CmdRailTrackHelper */ -CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle) { - return CmdRailTrackHelper(flags, tile, p1, ClrBit(p2, 9), text); + return CmdRailTrackHelper(flags, tile, end_tile, railtype, track, false, auto_remove_signals, fail_on_obstacle); } /** @@ -958,18 +942,14 @@ CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p1 * Stub for the unified rail builder/remover * @param flags operation to perform * @param tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0-5) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev), only used for building - * - p2 = (bit 6-8) - track-orientation, valid values: 0-5 (Track enum) - * - p2 = (bit 9) - 0 = build, 1 = remove tracks - * @param text unused + * @param end_tile end tile of drag + * @param track track-orientation * @return the cost of this operation or an error * @see CmdRailTrackHelper */ -CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track) { - return CmdRailTrackHelper(flags, tile, p1, SetBit(p2, 9), text); + return CmdRailTrackHelper(flags, tile, end_tile, INVALID_RAILTYPE, track, true, false, false); } /** @@ -1037,45 +1017,36 @@ CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType rai /** * Build signals, alternate between double/single, signal/semaphore, * pre/exit/combo-signals, and what-else not. If the rail piece does not - * have any signals, bit 4 (cycle signal-type) is ignored + * have any signals, signal cycling is ignored * @param flags operation to perform * @param tile tile where to build the signals - * @param p1 various bitstuffed elements - * - p1 = (bit 0-2) - track-orientation, valid values: 0-5 (Track enum) - * - p1 = (bit 3) - 1 = override signal/semaphore, or pre/exit/combo signal or (for bit 7) toggle variant (CTRL-toggle) - * - p1 = (bit 4) - 0 = signals, 1 = semaphores - * - p1 = (bit 5-7) - type of the signal, for valid values see enum SignalType in rail_map.h - * - p1 = (bit 8) - convert the present signal type and variant - * - p1 = (bit 9-11)- start cycle from this signal type - * - p1 = (bit 12-14)-wrap around after this signal type - * - p1 = (bit 15-16)-cycle the signal direction this many times - * - p1 = (bit 17) - 1 = don't modify an existing signal but don't fail either, 0 = always set new signal type - * @param p2 used for CmdBuildManySignals() to copy direction of first signal - * @param text unused + * @param track track-orientation + * @param sigtype type of the signal + * @param sigvar variant of signal type (normal/semaphore) + * @param ctrl_pressed true = override signal/semaphore, or pre/exit/combo signal or toggle variant (CTRL-toggle) + * @param convert_signal convert the present signal type and variant + * @param cycle_start start cycle from this signal type + * @param cycle_stop wrap around after this signal type + * @param num_dir_cycle cycle the signal direction this many times + * @param skip_existing_signals true = don't modify an existing signal but don't fail either, false = always set new signal type + * @param signals_copy used for CmdBuildManySignals() to copy direction of first signal * @return the cost of this operation or an error * @todo p2 should be replaced by two bits for "along" and "against" the track. */ -CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8 num_dir_cycle, byte signals_copy) { - Track track = Extract(p1); - bool ctrl_pressed = HasBit(p1, 3); // was the CTRL button pressed - SignalVariant sigvar = (ctrl_pressed ^ HasBit(p1, 4)) ? SIG_SEMAPHORE : SIG_ELECTRIC; // the signal variant of the new signal - SignalType sigtype = Extract(p1); // the signal type of the new signal - bool convert_signal = HasBit(p1, 8); // convert button pressed - SignalType cycle_start = Extract(p1); - SignalType cycle_stop = Extract(p1); - uint num_dir_cycle = GB(p1, 15, 2); - - if (sigtype > SIGTYPE_LAST) return CMD_ERROR; + if (sigtype > SIGTYPE_LAST || sigvar > SIG_SEMAPHORE) return CMD_ERROR; if (cycle_start > cycle_stop || cycle_stop > SIGTYPE_LAST) return CMD_ERROR; + if (ctrl_pressed) sigvar = (SignalVariant)(sigvar ^ SIG_SEMAPHORE); + /* You can only build signals on plain rail tiles, and the selected track must exist */ if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) || !HasTrack(tile, track)) { return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK); } /* Protect against invalid signal copying */ - if (p2 != 0 && (p2 & SignalOnTrack(track)) == 0) return CMD_ERROR; + if (signals_copy != 0 && (signals_copy & SignalOnTrack(track)) == 0) return CMD_ERROR; CommandCost ret = CheckTileOwnership(tile); if (ret.Failed()) return ret; @@ -1084,7 +1055,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, if (TracksOverlap(GetTrackBits(tile))) return_cmd_error(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK); /* In case we don't want to change an existing signal, return without error. */ - if (HasBit(p1, 17) && HasSignalOnTrack(tile, track)) return CommandCost(); + if (skip_existing_signals && HasSignalOnTrack(tile, track)) return CommandCost(); /* you can not convert a signal if no signal is on track */ if (convert_signal && !HasSignalOnTrack(tile, track)) return_cmd_error(STR_ERROR_THERE_ARE_NO_SIGNALS); @@ -1094,7 +1065,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, /* build new signals */ cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_SIGNALS]); } else { - if (p2 != 0 && sigvar != GetSignalVariant(tile, track)) { + if (signals_copy != 0 && sigvar != GetSignalVariant(tile, track)) { /* convert signals <-> semaphores */ cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_SIGNALS] + _price[PR_CLEAR_SIGNALS]); @@ -1136,7 +1107,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, /* Subtract old signal infrastructure count. */ Company::Get(GetTileOwner(tile))->infrastructure.signal -= CountBits(GetPresentSignals(tile)); - if (p2 == 0) { + if (signals_copy == 0) { if (!HasSignalOnTrack(tile, track)) { /* build new signals */ SetPresentSignals(tile, GetPresentSignals(tile) | (IsPbsSignal(sigtype) ? KillFirstBit(SignalOnTrack(track)) : SignalOnTrack(track))); @@ -1180,7 +1151,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, } else { /* If CmdBuildManySignals is called with copying signals, just copy the * direction of the first signal given as parameter by CmdBuildManySignals */ - SetPresentSignals(tile, (GetPresentSignals(tile) & ~SignalOnTrack(track)) | (p2 & SignalOnTrack(track))); + SetPresentSignals(tile, (GetPresentSignals(tile) & ~SignalOnTrack(track)) | (signals_copy & SignalOnTrack(track))); SetSignalVariant(tile, track, sigvar); SetSignalType(tile, track, sigtype); } @@ -1257,37 +1228,27 @@ static bool AdvanceSignalAutoFill(TileIndex &tile, Trackdir &trackdir, bool remo * Build many signals by dragging; AutoSignals * @param flags operation to perform * @param tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) - * - p2 = (bit 3) - 1 = override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) - * - p2 = (bit 4) - 0 = signals, 1 = semaphores - * - p2 = (bit 5) - 0 = build, 1 = remove signals - * - p2 = (bit 6) - 0 = selected stretch, 1 = auto fill - * - p2 = (bit 7- 9) - default signal type - * - p2 = (bit 10) - 0 = keep fixed distance, 1 = minimise gaps between signals - * - p2 = (bit 24-31) - user defined signals_density - * @param text unused + * @param end_tile end tile of drag + * @param track track-orientation + * @param sigtype default signal type + * @param sigvar signal variant to build + * @param mode true = override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) + * @param remove remove signals? + * @param autofill fill beyond selected stretch? + * @param minimise_gaps false = keep fixed distance, true = minimise gaps between signals + * @param signal_density user defined signals_density * @return the cost of this operation or an error */ -static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool remove, bool autofill, bool minimise_gaps, int signal_density) { CommandCost total_cost(EXPENSES_CONSTRUCTION); - TileIndex start_tile = tile; - Track track = Extract(p2); - bool mode = HasBit(p2, 3); - bool semaphores = HasBit(p2, 4); - bool remove = HasBit(p2, 5); - bool autofill = HasBit(p2, 6); - bool minimise_gaps = HasBit(p2, 10); - int signal_density = GB(p2, 24, 8); - - if (p1 >= MapSize() || !ValParamTrackOrientation(track)) return CMD_ERROR; - TileIndex end_tile = p1; + if (end_tile >= MapSize() || !ValParamTrackOrientation(track)) return CMD_ERROR; if (signal_density == 0 || signal_density > 20) return CMD_ERROR; + if (!remove && (sigtype > SIGTYPE_LAST || sigvar > SIG_SEMAPHORE)) return CMD_ERROR; if (!IsPlainRailTile(tile)) return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK); + TileIndex start_tile = tile; /* Interpret signal_density as the logical length of said amount of tiles in X/Y direction. */ signal_density *= TILE_AXIAL_DISTANCE; @@ -1302,9 +1263,6 @@ static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uin /* Must start on a valid track to be able to avoid loops */ if (!HasTrack(tile, track)) return CMD_ERROR; - SignalType sigtype = (SignalType)GB(p2, 7, 3); - if (sigtype > SIGTYPE_LAST) return CMD_ERROR; - byte signals; /* copy the signal-style of the first rail-piece if existing */ if (HasSignalOnTrack(tile, track)) { @@ -1312,7 +1270,7 @@ static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uin assert(signals != 0); /* copy signal/semaphores style (independent of CTRL) */ - semaphores = GetSignalVariant(tile, track) != SIG_ELECTRIC; + sigvar = GetSignalVariant(tile, track); sigtype = GetSignalType(tile, track); /* Don't but copy entry or exit-signal type */ @@ -1344,22 +1302,14 @@ static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uin Trackdir last_suitable_trackdir = INVALID_TRACKDIR; CommandCost last_error = CMD_ERROR; bool had_success = false; - uint32 param1 = 0; - SB(param1, 3, 1, mode); - SB(param1, 4, 1, semaphores); - SB(param1, 5, 3, sigtype); - auto build_signal = [&](TileIndex tile, Trackdir trackdir, bool test_only) { - SB(param1, 0, 3, TrackdirToTrack(trackdir)); - SB(param1, 17, 1, (!remove && signal_ctr == 0 ? 1 : 0)); - /* Pick the correct orientation for the track direction */ byte signals = 0; if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(trackdir); if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(trackdir); DoCommandFlag do_flags = test_only ? flags & ~DC_EXEC : flags; - CommandCost ret = remove ? Command::Do(do_flags, tile, param1, signals, {}) : Command::Do(do_flags, tile, param1, signals, {}); + CommandCost ret = remove ? Command::Do(do_flags, tile, TrackdirToTrack(trackdir)) : Command::Do(do_flags, tile, TrackdirToTrack(trackdir), sigtype, sigvar, false, signal_ctr == 0, mode, SIGTYPE_NORMAL, SIGTYPE_NORMAL, 0, signals); if (test_only) return ret.Succeeded(); @@ -1469,40 +1419,31 @@ static CommandCost CmdSignalTrackHelper(DoCommandFlag flags, TileIndex tile, uin * Stub for the unified signal builder/remover * @param flags operation to perform * @param tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) - * - p2 = (bit 3) - 1 = override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) - * - p2 = (bit 4) - 0 = signals, 1 = semaphores - * - p2 = (bit 5) - 0 = build, 1 = remove signals - * - p2 = (bit 6) - 0 = selected stretch, 1 = auto fill - * - p2 = (bit 7- 9) - default signal type - * - p2 = (bit 24-31) - user defined signals_density - * @param text unused + * @param end_tile end tile of drag + * @param track track-orientation + * @param sigtype default signal type + * @param sigvar signal variant to build + * @param mode true = override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) + * @param autofill fill beyond selected stretch? + * @param minimise_gaps false = keep fixed distance, true = minimise gaps between signals + * @param signal_density user defined signals_density * @return the cost of this operation or an error * @see CmdSignalTrackHelper */ -CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, byte signal_density) { - return CmdSignalTrackHelper(flags, tile, p1, p2, text); + return CmdSignalTrackHelper(flags, tile, end_tile, track, sigtype, sigvar, mode, false, autofill, minimise_gaps, signal_density); } /** * Remove signals * @param flags operation to perform * @param tile coordinates where signal is being deleted from - * @param p1 various bitstuffed elements, only track information is used - * - (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) - * - (bit 3) - override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) - * - (bit 4) - 0 = signals, 1 = semaphores - * @param p2 unused - * @param text unused + * @param track track-orientation * @return the cost of this operation or an error */ -CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, Track track) { - Track track = Extract(p1); - if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) || !HasTrack(tile, track)) { return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK); } @@ -1561,22 +1502,15 @@ CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, uint32 p1 * Stub for the unified signal builder/remover * @param flags operation to perform * @param tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 2) - track-orientation, valid values: 0-5 (Track enum) - * - p2 = (bit 3) - 1 = override signal/semaphore, or pre/exit/combo signal (CTRL-toggle) - * - p2 = (bit 4) - 0 = signals, 1 = semaphores - * - p2 = (bit 5) - 0 = build, 1 = remove signals - * - p2 = (bit 6) - 0 = selected stretch, 1 = auto fill - * - p2 = (bit 7- 9) - default signal type - * - p2 = (bit 24-31) - user defined signals_density - * @param text unused + * @param end_tile end tile of drag + * @param track track-orientation + * @param autofill fill beyond selected stretch? * @return the cost of this operation or an error * @see CmdSignalTrackHelper */ -CommandCost CmdRemoveSignalTrack(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, bool autofill) { - return CmdSignalTrackHelper(flags, tile, p1, SetBit(p2, 5), text); // bit 5 is remove bit + return CmdSignalTrackHelper(flags, tile, end_tile, track, SIGTYPE_NORMAL, SIG_ELECTRIC, false, true, autofill, false, 1); // bit 5 is remove bit } /** Update power of train under which is the railtype being converted */ @@ -1595,19 +1529,14 @@ static Vehicle *UpdateTrainPowerProc(Vehicle *v, void *data) * monorail/maglev easily or vice-versa. * @param flags operation to perform * @param tile end tile of rail conversion drag - * @param p1 start tile of drag - * @param p2 various bitstuffed elements: - * - p2 = (bit 0- 5) new railtype to convert to. - * - p2 = (bit 6) build diagonally or not. - * @param text unused + * @param area_start start tile of drag + * @param totype new railtype to convert to. + * @param diagonal build diagonally or not. * @return the cost of this operation or an error */ -CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RailType totype, bool diagonal) { - RailType totype = Extract(p2); - TileIndex area_start = p1; TileIndex area_end = tile; - bool diagonal = HasBit(p2, 6); if (!ValParamRailtype(totype)) return CMD_ERROR; if (area_start >= MapSize()) return CMD_ERROR; @@ -1879,7 +1808,7 @@ static CommandCost ClearTile_Track(TileIndex tile, DoCommandFlag flags) TrackBits tracks = GetTrackBits(tile); while (tracks != TRACK_BIT_NONE) { Track track = RemoveFirstTrack(&tracks); - CommandCost ret = Command::Do(flags, tile, 0, track, {}); + CommandCost ret = Command::Do(flags, tile, track); if (ret.Failed()) return ret; cost.AddCost(ret); } diff --git a/src/rail_cmd.h b/src/rail_cmd.h index 31266e2b03..2299435c20 100644 --- a/src/rail_cmd.h +++ b/src/rail_cmd.h @@ -11,17 +11,20 @@ #define RAIL_CMD_H #include "command_type.h" +#include "track_type.h" +#include "rail_type.h" +#include "signal_type.h" -CommandProc CmdBuildRailroadTrack; -CommandProc CmdRemoveRailroadTrack; -CommandProc CmdBuildSingleRail; -CommandProc CmdRemoveSingleRail; +CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle); +CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track); +CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType railtype, Track track, bool auto_remove_signals); +CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, Track track); CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType railtype, DiagDirection dir); -CommandProc CmdBuildSingleSignal; -CommandProc CmdRemoveSingleSignal; -CommandProc CmdConvertRail; -CommandProc CmdBuildSignalTrack; -CommandProc CmdRemoveSignalTrack; +CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8 num_dir_cycle, byte signals_copy); +CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, Track track); +CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RailType totype, bool diagonal); +CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, byte signal_density); +CommandCost CmdRemoveSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, bool autofill); DEF_CMD_TRAIT(CMD_BUILD_RAILROAD_TRACK, CmdBuildRailroadTrack, CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_REMOVE_RAILROAD_TRACK, CmdRemoveRailroadTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 60ac12c726..a8e8b68b42 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -94,14 +94,14 @@ void CcPlaySound_CONSTRUCTION_RAIL(Commands cmd, const CommandCost &result,TileI if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); } -static void GenericPlaceRail(TileIndex tile, int cmd) +static void GenericPlaceRail(TileIndex tile, Track track) { if (_remove_button_clicked) { Command::Post(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, - tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3), {}); + tile, track); } else { Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, - tile, _cur_railtype, cmd | (_settings_client.gui.auto_remove_signals << 3), {}); + tile, _cur_railtype, track, _settings_client.gui.auto_remove_signals); } } @@ -118,7 +118,7 @@ static void PlaceExtraDepotRail(TileIndex tile, DiagDirection dir, Track track) if (GetRailTileType(tile) == RAIL_TILE_SIGNALS && !_settings_client.gui.auto_remove_signals) return; if ((GetTrackBits(tile) & DiagdirReachesTracks(dir)) == 0) return; - Command::Post(tile, _cur_railtype, track | (_settings_client.gui.auto_remove_signals << 3), {}); + Command::Post(tile, _cur_railtype, track, _settings_client.gui.auto_remove_signals); } /** Additional pieces of track to add at the entrance of a depot. */ @@ -240,39 +240,21 @@ static void GenericPlaceSignals(TileIndex tile) Track track = FindFirstTrack(trackbits); if (_remove_button_clicked) { - Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, tile, track, 0, {}); + Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, tile, track); } else { - const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); - - /* various bitstuffed elements for CmdBuildSingleSignal() */ - uint32 p1 = track; - /* Which signals should we cycle through? */ - uint8 cycle_types; + SignalType cycle_start = _settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_ALL && _settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL ? SIGTYPE_NORMAL : SIGTYPE_PBS; - if (_settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_ALL && _settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL) { - cycle_types = SIGTYPE_NORMAL | (SIGTYPE_LAST << 3); - } else { - cycle_types = SIGTYPE_PBS | (SIGTYPE_LAST << 3); - } - - if (w != nullptr) { + if (FindWindowById(WC_BUILD_SIGNAL, 0) != nullptr) { /* signal GUI is used */ - SB(p1, 3, 1, _ctrl_pressed); - SB(p1, 4, 1, _cur_signal_variant); - SB(p1, 5, 3, _cur_signal_type); - SB(p1, 8, 1, _convert_signal_button); - SB(p1, 9, 6, cycle_types); + Command::Post(_convert_signal_button ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, + tile, track, _cur_signal_type, _cur_signal_variant, _convert_signal_button, false, _ctrl_pressed, cycle_start, SIGTYPE_LAST, 0, 0); } else { - SB(p1, 3, 1, _ctrl_pressed); - SB(p1, 4, 1, (_cur_year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC)); - SB(p1, 5, 3, SIGTYPE_PBS_ONEWAY); - SB(p1, 8, 1, 0); - SB(p1, 9, 6, cycle_types); - } + SignalVariant sigvar = _cur_year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC; + Command::Post(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, + tile, track, SIGTYPE_PBS_ONEWAY, sigvar, false, false, _ctrl_pressed, cycle_start, SIGTYPE_LAST, 0, 0); - Command::Post((w != nullptr && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, - CcPlaySound_CONSTRUCTION_RAIL, tile, p1, 0, {}); + } } } @@ -371,21 +353,20 @@ static void BuildRailClick_Remove(Window *w) } } -static void DoRailroadTrack(int mode) +static void DoRailroadTrack(Track track) { - uint32 p2 = _cur_railtype | (mode << 6) | (_settings_client.gui.auto_remove_signals << 11); if (_remove_button_clicked) { Command::Post(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track); } else { Command::Post(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK, CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), _cur_railtype, track, _settings_client.gui.auto_remove_signals, false); } } static void HandleAutodirPlacement() { - int trackstat = _thd.drawstyle & HT_DIR_MASK; // 0..5 + Track trackstat = static_cast( _thd.drawstyle & HT_DIR_MASK); // 0..5 if (_thd.drawstyle & HT_RAIL) { // one tile case GenericPlaceRail(TileVirtXY(_thd.selend.x, _thd.selend.y), trackstat); @@ -403,40 +384,24 @@ static void HandleAutodirPlacement() */ static void HandleAutoSignalPlacement() { - uint32 p2 = GB(_thd.drawstyle, 0, 3); // 0..5 + Track track = (Track)GB(_thd.drawstyle, 0, 3); // 0..5 if ((_thd.drawstyle & HT_DRAG_MASK) == HT_RECT) { // one tile case GenericPlaceSignals(TileVirtXY(_thd.selend.x, _thd.selend.y)); return; } - const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); - - if (w != nullptr) { - /* signal GUI is used */ - SB(p2, 3, 1, 0); - SB(p2, 4, 1, _cur_signal_variant); - SB(p2, 6, 1, _ctrl_pressed); - SB(p2, 7, 3, _cur_signal_type); - SB(p2, 24, 8, _settings_client.gui.drag_signals_density); - SB(p2, 10, 1, !_settings_client.gui.drag_signals_fixed_distance); - } else { - SB(p2, 3, 1, 0); - SB(p2, 4, 1, (_cur_year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC)); - SB(p2, 6, 1, _ctrl_pressed); - SB(p2, 7, 3, SIGTYPE_PBS_ONEWAY); - SB(p2, 24, 8, _settings_client.gui.drag_signals_density); - SB(p2, 10, 1, !_settings_client.gui.drag_signals_fixed_distance); - } - /* _settings_client.gui.drag_signals_density is given as a parameter such that each user * in a network game can specify their own signal density */ if (_remove_button_clicked) { Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track, _ctrl_pressed); } else { + bool sig_gui = FindWindowById(WC_BUILD_SIGNAL, 0) != nullptr; + SignalType sigtype = sig_gui ? _cur_signal_type : SIGTYPE_PBS_ONEWAY; + SignalVariant sigvar = sig_gui ? _cur_signal_variant : (_cur_year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC); Command::Post(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, {}); + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track, sigtype, sigvar, false, _ctrl_pressed, !_settings_client.gui.drag_signals_fixed_distance, _settings_client.gui.drag_signals_density); } } @@ -725,7 +690,7 @@ struct BuildRailToolbarWindow : Window { break; case DDSP_CONVERT_RAIL: - Command::Post(STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 1 << 6 : 0), {}); + Command::Post(STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype, _ctrl_pressed); break; case DDSP_REMOVE_STATION: diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 72dcb5276e..ece49676be 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -2229,7 +2229,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne if (IsLevelCrossing(tile)) { if (GetTileOwner(tile) == old_owner) { if (new_owner == INVALID_OWNER) { - Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, GetCrossingRailTrack(tile), {}); + Command::Do(DC_EXEC | DC_BANKRUPT, tile, GetCrossingRailTrack(tile)); } else { /* Update infrastructure counts. No need to dirty windows here, we'll redraw the whole screen anyway. */ Company::Get(old_owner)->infrastructure.rail[GetRailType(tile)] -= LEVELCROSSING_TRACKBIT_FACTOR; diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp index 30a1085d48..4dc06553d0 100644 --- a/src/script/api/script_rail.cpp +++ b/src/script/api/script_rail.cpp @@ -116,7 +116,7 @@ EnforcePrecondition(false, ::IsValidTile(end_tile)); EnforcePrecondition(false, IsRailTypeAvailable(convert_to)); - return ScriptObject::Command::Do(start_tile, end_tile, convert_to, {}); + return ScriptObject::Command::Do(start_tile, end_tile, (::RailType)convert_to, false); } /* static */ TileIndex ScriptRail::GetRailDepotFrontTile(TileIndex depot) @@ -253,7 +253,7 @@ EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0); EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); - return ScriptObject::Command::Do(tile, tile, GetCurrentRailType() | (FindFirstTrack((::TrackBits)rail_track) << 6), {}); + return ScriptObject::Command::Do(tile, tile, (::RailType)GetCurrentRailType(), FindFirstTrack((::TrackBits)rail_track), false, false); } /* static */ bool ScriptRail::RemoveRailTrack(TileIndex tile, RailTrack rail_track) @@ -264,7 +264,7 @@ EnforcePrecondition(false, GetRailTracks(tile) & rail_track); EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0); - return ScriptObject::Command::Do(tile, tile, FindFirstTrack((::TrackBits)rail_track) << 6, {}); + return ScriptObject::Command::Do(tile, tile, FindFirstTrack((::TrackBits)rail_track)); } /* static */ bool ScriptRail::AreTilesConnected(TileIndex from, TileIndex tile, TileIndex to) @@ -292,21 +292,21 @@ * Prepare the second parameter for CmdBuildRailroadTrack and CmdRemoveRailroadTrack. The direction * depends on all three tiles. Sometimes the third tile needs to be adjusted. */ -static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) +static Track SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) { int diag_offset = abs(abs((int)::TileX(*to) - (int)::TileX(tile)) - abs((int)::TileY(*to) - (int)::TileY(tile))); - uint32 p2 = 0; + Track track = TRACK_BEGIN; if (::TileY(from) == ::TileY(*to)) { - p2 |= (TRACK_X << 6); + track = TRACK_X; *to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1); } else if (::TileX(from) == ::TileX(*to)) { - p2 |= (TRACK_Y << 6); + track = TRACK_Y; *to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1); } else if (::TileY(from) < ::TileY(tile)) { if (::TileX(*to) < ::TileX(tile)) { - p2 |= (TRACK_UPPER << 6); + track = TRACK_UPPER; } else { - p2 |= (TRACK_LEFT << 6); + track = TRACK_LEFT; } if (diag_offset != 0) { *to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1); @@ -315,9 +315,9 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) } } else if (::TileY(from) > ::TileY(tile)) { if (::TileX(*to) < ::TileX(tile)) { - p2 |= (TRACK_RIGHT << 6); + track = TRACK_RIGHT; } else { - p2 |= (TRACK_LOWER << 6); + track = TRACK_LOWER; } if (diag_offset != 0) { *to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1); @@ -326,9 +326,9 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) } } else if (::TileX(from) < ::TileX(tile)) { if (::TileY(*to) < ::TileY(tile)) { - p2 |= (TRACK_UPPER << 6); + track = TRACK_UPPER; } else { - p2 |= (TRACK_RIGHT << 6); + track = TRACK_RIGHT; } if (diag_offset == 0) { *to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1); @@ -337,9 +337,9 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) } } else if (::TileX(from) > ::TileX(tile)) { if (::TileY(*to) < ::TileY(tile)) { - p2 |= (TRACK_LEFT << 6); + track = TRACK_LEFT; } else { - p2 |= (TRACK_LOWER << 6); + track = TRACK_LOWER; } if (diag_offset == 0) { *to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1); @@ -347,7 +347,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) *to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1); } } - return p2; + return track; } /* static */ bool ScriptRail::BuildRail(TileIndex from, TileIndex tile, TileIndex to) @@ -364,8 +364,8 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) (::TileX(from) == ::TileX(tile) && ::TileX(tile) == ::TileX(to)) || (::TileY(from) == ::TileY(tile) && ::TileY(tile) == ::TileY(to))); - uint32 p2 = SimulateDrag(from, tile, &to) | 1 << 10 | ScriptRail::GetCurrentRailType();; - return ScriptObject::Command::Do(tile, to, p2, {}); + Track track = SimulateDrag(from, tile, &to); + return ScriptObject::Command::Do(tile, to, (::RailType)ScriptRail::GetCurrentRailType(), track, false, true); } /* static */ bool ScriptRail::RemoveRail(TileIndex from, TileIndex tile, TileIndex to) @@ -381,8 +381,8 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to) (::TileX(from) == ::TileX(tile) && ::TileX(tile) == ::TileX(to)) || (::TileY(from) == ::TileY(tile) && ::TileY(tile) == ::TileY(to))); - uint32 p2 = SimulateDrag(from, tile, &to); - return ScriptObject::Command::Do(tile, to, p2, {}); + Track track = SimulateDrag(from, tile, &to); + return ScriptObject::Command::Do(tile, to, track); } /** @@ -461,14 +461,12 @@ static bool IsValidSignalType(int signal_type) } EnforcePrecondition(false, track != INVALID_TRACK); - uint p1 = track; if (signal < SIGNALTYPE_TWOWAY) { if (signal != SIGNALTYPE_PBS && signal != SIGNALTYPE_PBS_ONEWAY) signal_cycles++; - p1 |= (signal_cycles << 15); } - p1 |= ((signal >= SIGNALTYPE_TWOWAY ? signal ^ SIGNALTYPE_TWOWAY : signal) << 5); + ::SignalType sig_type = (::SignalType)(signal >= SIGNALTYPE_TWOWAY ? signal ^ SIGNALTYPE_TWOWAY : signal); - return ScriptObject::Command::Do(tile, p1, 0, {}); + return ScriptObject::Command::Do(tile, track, sig_type, ::SIG_ELECTRIC, false, false, false, ::SIGTYPE_NORMAL, ::SIGTYPE_NORMAL, signal_cycles, 0); } /* static */ bool ScriptRail::RemoveSignal(TileIndex tile, TileIndex front) @@ -487,7 +485,7 @@ static bool IsValidSignalType(int signal_type) } EnforcePrecondition(false, track != INVALID_TRACK); - return ScriptObject::Command::Do(tile, track, 0, {}); + return ScriptObject::Command::Do(tile, track); } /* static */ Money ScriptRail::GetBuildCost(RailType railtype, BuildType build_type) diff --git a/src/signal_type.h b/src/signal_type.h index 5af2a2c94a..ff5dd3b553 100644 --- a/src/signal_type.h +++ b/src/signal_type.h @@ -13,14 +13,14 @@ #include "core/enum_type.hpp" /** Variant of the signal, i.e. how does the signal look? */ -enum SignalVariant { +enum SignalVariant : byte { SIG_ELECTRIC = 0, ///< Light signal SIG_SEMAPHORE = 1, ///< Old-fashioned semaphore signal }; /** Type of signal, i.e. how does the signal behave? */ -enum SignalType { +enum SignalType : byte { SIGTYPE_NORMAL = 0, ///< normal signal SIGTYPE_ENTRY = 1, ///< presignal block entry SIGTYPE_EXIT = 2, ///< presignal block exit diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index bdc58588b9..6424a73e15 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -925,7 +925,7 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl affected_vehicles.push_back(v); } } - CommandCost ret = Command::Do(flags, tile_cur, 0, track, {}); + CommandCost ret = Command::Do(flags, tile_cur, track); if (ret.Failed()) return ret; cost.AddCost(ret); /* With flags & ~DC_EXEC CmdLandscapeClear would fail since the rail still exists */ From 46bd2f1cedde365218a3f1a52116fe169587af89 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 15 Nov 2021 00:03:01 +0100 Subject: [PATCH 127/710] Codechange: Un-bitstuff remaining transport infrastructure commands. --- src/bridge_gui.cpp | 38 ++++----- src/dock_gui.cpp | 8 +- src/rail_gui.cpp | 4 +- src/road_cmd.cpp | 130 ++++++++++++------------------- src/road_cmd.h | 8 +- src/road_gui.cpp | 75 +++++++----------- src/road_map.h | 13 +--- src/road_type.h | 16 +++- src/roadveh_cmd.cpp | 2 +- src/script/api/script_bridge.cpp | 27 ++----- src/script/api/script_marine.cpp | 4 +- src/script/api/script_road.cpp | 9 ++- src/script/api/script_tunnel.cpp | 23 ++---- src/town_cmd.cpp | 16 ++-- src/transport_type.h | 2 +- src/tunnelbridge_cmd.cpp | 40 ++++------ src/tunnelbridge_cmd.h | 6 +- src/water_cmd.cpp | 26 +++---- src/water_cmd.h | 5 +- src/water_map.h | 2 +- 20 files changed, 180 insertions(+), 274 deletions(-) diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 38ff698eb6..77261932b3 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -60,16 +60,14 @@ void CcBuildBridge(Commands cmd, const CommandCost &result, TileIndex end_tile, if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile); - auto [tile, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); - - TransportType transport_type = Extract(p2); + auto [tile, tile_start, transport_type, bridge_type, road_rail_type] = EndianBufferReader::ToValue::Args>(data); if (transport_type == TRANSPORT_ROAD) { DiagDirection end_direction = ReverseDiagDir(GetTunnelBridgeDirection(end_tile)); ConnectRoadToStructure(end_tile, end_direction); - DiagDirection start_direction = ReverseDiagDir(GetTunnelBridgeDirection(p1)); - ConnectRoadToStructure(p1, start_direction); + DiagDirection start_direction = ReverseDiagDir(GetTunnelBridgeDirection(tile_start)); + ConnectRoadToStructure(tile_start, start_direction); } } @@ -86,7 +84,8 @@ private: /* Internal variables */ TileIndex start_tile; TileIndex end_tile; - uint32 type; + TransportType transport_type; + byte road_rail_type; GUIBridgeList *bridges; int bridgetext_offset; ///< Horizontal offset of the text describing the bridge properties in #WID_BBS_BRIDGE_LIST relative to the left edge. Scrollbar *vscroll; @@ -111,13 +110,13 @@ private: void BuildBridge(uint8 i) { - switch ((TransportType)(this->type >> 15)) { + switch (this->transport_type) { case TRANSPORT_RAIL: _last_railbridge_type = this->bridges->at(i).index; break; case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->at(i).index; break; default: break; } Command::Post(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, - this->end_tile, this->start_tile, this->type | this->bridges->at(i).index, {}); + this->end_tile, this->start_tile, this->transport_type, this->bridges->at(i).index, this->road_rail_type); } /** Sort the builable bridges */ @@ -134,19 +133,20 @@ private: } public: - BuildBridgeWindow(WindowDesc *desc, TileIndex start, TileIndex end, uint32 br_type, GUIBridgeList *bl) : Window(desc), + BuildBridgeWindow(WindowDesc *desc, TileIndex start, TileIndex end, TransportType transport_type, byte road_rail_type, GUIBridgeList *bl) : Window(desc), start_tile(start), end_tile(end), - type(br_type), + transport_type(transport_type), + road_rail_type(road_rail_type), bridges(bl) { this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_BBS_SCROLLBAR); /* Change the data, or the caption of the gui. Set it to road or rail, accordingly. */ - this->GetWidget(WID_BBS_CAPTION)->widget_data = (GB(this->type, 15, 2) == TRANSPORT_ROAD) ? STR_SELECT_ROAD_BRIDGE_CAPTION : STR_SELECT_RAIL_BRIDGE_CAPTION; - this->FinishInitNested(GB(br_type, 15, 2)); // Initializes 'this->bridgetext_offset'. + this->GetWidget(WID_BBS_CAPTION)->widget_data = (transport_type == TRANSPORT_ROAD) ? STR_SELECT_ROAD_BRIDGE_CAPTION : STR_SELECT_RAIL_BRIDGE_CAPTION; + this->FinishInitNested(transport_type); // Initializes 'this->bridgetext_offset'. - this->parent = FindWindowById(WC_BUILD_TOOLBAR, GB(this->type, 15, 2)); + this->parent = FindWindowById(WC_BUILD_TOOLBAR, transport_type); this->bridges->SetListing(this->last_sorting); this->bridges->SetSortFuncs(this->sorter_funcs); this->bridges->NeedResort(); @@ -361,12 +361,6 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo { CloseWindowByClass(WC_BUILD_BRIDGE); - /* Data type for the bridge. - * Bit 16,15 = transport type, - * 14..8 = road/rail types, - * 7..0 = type of bridge */ - uint32 type = (transport_type << 15) | (road_rail_type << 8); - /* The bridge length without ramps. */ const uint bridge_len = GetTunnelBridgeLength(start, end); @@ -382,14 +376,14 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo default: break; // water ways and air routes don't have bridge types } if (_ctrl_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len).Succeeded()) { - Command::Post(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, end, start, type | last_bridge_type, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, end, start, transport_type, last_bridge_type, road_rail_type); return; } /* only query bridge building possibility once, result is the same for all bridges! * returns CMD_ERROR on failure, and price on success */ StringID errmsg = INVALID_STRING_ID; - CommandCost ret = Command::Do(CommandFlagsToDCFlags(GetCommandFlags()) | DC_QUERY_COST, end, start, type, {}); + CommandCost ret = Command::Do(CommandFlagsToDCFlags(GetCommandFlags()) | DC_QUERY_COST, end, start, transport_type, 0, road_rail_type); GUIBridgeList *bl = nullptr; if (ret.Failed()) { @@ -449,7 +443,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo } if (bl != nullptr && bl->size() != 0) { - new BuildBridgeWindow(&_build_bridge_desc, start, end, type, bl); + new BuildBridgeWindow(&_build_bridge_desc, start, end, transport_type, road_rail_type, bl); } else { delete bl; ShowErrorMessage(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, errmsg, WL_INFO, TileX(end) * TILE_SIZE, TileY(end) * TILE_SIZE); diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index cdcb4ea84a..d8cd7c5d46 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -196,7 +196,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_LOCK: // Build lock button - Command::Post(STR_ERROR_CAN_T_BUILD_LOCKS, CcBuildDocks, tile, 0, 0, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_LOCKS, CcBuildDocks, tile); break; case WID_DT_DEMOLISH: // Demolish aka dynamite button @@ -234,7 +234,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_BUILD_AQUEDUCT: // Build aqueduct button - Command::Post(STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE, CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER << 15, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_AQUEDUCT_HERE, CcBuildBridge, tile, GetOtherAqueductEnd(tile), TRANSPORT_WATER, 0, 0); break; default: NOT_REACHED(); @@ -254,10 +254,10 @@ struct BuildDocksToolbarWindow : Window { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); break; case DDSP_CREATE_WATER: - Command::Post(STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, false); break; case DDSP_CREATE_RIVER: - Command::Post(STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER | (_ctrl_pressed ? 1 << 2 : 0), {}); + Command::Post(STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER, _ctrl_pressed); break; default: break; diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index a8e8b68b42..bac59d7474 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -648,7 +648,7 @@ struct BuildRailToolbarWindow : Window { break; case WID_RAT_BUILD_TUNNEL: - Command::Post(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRailTunnel, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, {}); + Command::Post(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRailTunnel, tile, TRANSPORT_RAIL, _cur_railtype); break; case WID_RAT_CONVERT_RAIL: @@ -746,7 +746,7 @@ struct BuildRailToolbarWindow : Window { void OnPlacePresize(Point pt, TileIndex tile) override { - Command::Do(DC_AUTO, tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, {}); + Command::Do(DC_AUTO, tile, TRANSPORT_RAIL, _cur_railtype); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index ece49676be..e160a2b842 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -606,14 +606,13 @@ static CommandCost CheckRoadSlope(Slope tileh, RoadBits *pieces, RoadBits existi * Build a piece of road. * @param flags operation to perform * @param tile tile where to build road - * @param p1 bit 0..3 road pieces to build (RoadBits) - * bit 4..9 road type - * bit 11..12 disallowed directions to toggle - * @param p2 the town that is building the road (0 if not applicable) - * @param text unused + * @param pieces road pieces to build (RoadBits) + * @param rt road type + * @param toggle_drd disallowed directions to toggle + * @param town_id the town that is building the road (0 if not applicable) * @return the cost of this operation or an error */ -CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, RoadBits pieces, RoadType rt, DisallowedRoadDirections toggle_drd, TownID town_id) { CompanyID company = _current_company; CommandCost cost(EXPENSES_CONSTRUCTION); @@ -623,10 +622,10 @@ CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Road pieces are max 4 bitset values (NE, NW, SE, SW) and town can only be non-zero * if a non-company is building the road */ - if ((Company::IsValidID(company) && p2 != 0) || (company == OWNER_TOWN && !Town::IsValidID(p2)) || (company == OWNER_DEITY && p2 != 0)) return CMD_ERROR; + if ((Company::IsValidID(company) && town_id != 0) || (company == OWNER_TOWN && !Town::IsValidID(town_id)) || (company == OWNER_DEITY && town_id != 0)) return CMD_ERROR; if (company != OWNER_TOWN) { const Town *town = CalcClosestTownFromTile(tile); - p2 = (town != nullptr) ? town->index : INVALID_TOWN; + town_id = (town != nullptr) ? town->index : INVALID_TOWN; if (company == OWNER_DEITY) { company = OWNER_TOWN; @@ -638,16 +637,10 @@ CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 } } - RoadBits pieces = Extract(p1); - /* do not allow building 'zero' road bits, code wouldn't handle it */ - if (pieces == ROAD_NONE) return CMD_ERROR; - - RoadType rt = Extract(p1); + if (pieces == ROAD_NONE || !IsEnumValid(pieces) || !IsEnumValid(toggle_drd)) return CMD_ERROR; if (!ValParamRoadType(rt)) return CMD_ERROR; - DisallowedRoadDirections toggle_drd = Extract(p1); - Slope tileh = GetTileSlope(tile); RoadTramType rtt = GetRoadTramType(rt); @@ -785,7 +778,7 @@ CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Always add road to the roadtypes (can't draw without it) */ bool reserved = HasBit(GetRailReservationTrackBits(tile), railtrack); - MakeRoadCrossing(tile, company, company, GetTileOwner(tile), roaddir, GetRailType(tile), rtt == RTT_ROAD ? rt : INVALID_ROADTYPE, (rtt == RTT_TRAM) ? rt : INVALID_ROADTYPE, p2); + MakeRoadCrossing(tile, company, company, GetTileOwner(tile), roaddir, GetRailType(tile), rtt == RTT_ROAD ? rt : INVALID_ROADTYPE, (rtt == RTT_TRAM) ? rt : INVALID_ROADTYPE, town_id); SetCrossingReservation(tile, reserved); UpdateLevelCrossing(tile, false); MarkTileDirtyByTile(tile); @@ -870,7 +863,7 @@ do_clear:; if (HasPowerOnRoad(rt, existing_rt)) { rt = existing_rt; } else if (HasPowerOnRoad(existing_rt, rt)) { - CommandCost ret = Command::Do(flags, tile, tile, rt, {}); + CommandCost ret = Command::Do(flags, tile, tile, rt); if (ret.Failed()) return ret; cost.AddCost(ret); } else { @@ -895,7 +888,7 @@ do_clear:; if (existing == ROAD_NONE || rttype == ROAD_TILE_CROSSING) { SetRoadType(tile, rtt, rt); SetRoadOwner(tile, rtt, company); - if (rtt == RTT_ROAD) SetTownIndex(tile, p2); + if (rtt == RTT_ROAD) SetTownIndex(tile, town_id); } if (rttype != ROAD_TILE_CROSSING) SetRoadBits(tile, existing | pieces, rtt); break; @@ -927,7 +920,7 @@ do_clear:; } default: - MakeRoadNormal(tile, pieces, (rtt == RTT_ROAD) ? rt : INVALID_ROADTYPE, (rtt == RTT_TRAM) ? rt : INVALID_ROADTYPE, p2, company, company); + MakeRoadNormal(tile, pieces, (rtt == RTT_ROAD) ? rt : INVALID_ROADTYPE, (rtt == RTT_TRAM) ? rt : INVALID_ROADTYPE, town_id, company, company); break; } @@ -971,49 +964,40 @@ static bool CanConnectToRoad(TileIndex tile, RoadType rt, DiagDirection dir) * Build a long piece of road. * @param flags operation to perform * @param start_tile start tile of drag (the building cost will appear over this tile) - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1). Only used if bit 6 is set or if we are building a single tile - * - p2 = (bit 1) - end tile starts in the 2nd half of tile (p2 & 2). Only used if bit 6 is set or if we are building a single tile - * - p2 = (bit 2) - direction: 0 = along x-axis, 1 = along y-axis (p2 & 4) - * - p2 = (bit 3..8) - road type - * - p2 = (bit 10) - set road direction - * - p2 = (bit 11) - defines two different behaviors for this command: - * - 0 = Build up to an obstacle. Do not build the first and last roadbits unless they can be connected to something, or if we are building a single tile - * - 1 = Fail if an obstacle is found. Always take into account bit 0 and 1. This behavior is used for scripts - * @param text unused + * @param end_tile end tile of drag + * @param rt road type + * @param axis direction + * @param drd set road direction + * @param start_half start tile starts in the 2nd half of tile (p2 & 1). Only used if \c is_ai is set or if we are building a single tile + * @param end_half end tile starts in the 2nd half of tile (p2 & 2). Only used if \c is_ai is set or if we are building a single tile + * @param is_ai defines two different behaviors for this command: + * - false = Build up to an obstacle. Do not build the first and last roadbits unless they can be connected to something, or if we are building a single tile + * - true = Fail if an obstacle is found. Always take into account start_half and end_half. This behavior is used for scripts * @return the cost of this operation or an error */ -CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, TileIndex end_tile, RoadType rt, Axis axis, DisallowedRoadDirections drd, bool start_half, bool end_half, bool is_ai) { - DisallowedRoadDirections drd = DRD_NORTHBOUND; + if (end_tile >= MapSize()) return CMD_ERROR; - if (p1 >= MapSize()) return CMD_ERROR; - TileIndex end_tile = p1; + if (!ValParamRoadType(rt) || !IsEnumValid(axis) || !IsEnumValid(drd)) return CMD_ERROR; - RoadType rt = Extract(p2); - if (!ValParamRoadType(rt)) return CMD_ERROR; - - Axis axis = Extract(p2); /* Only drag in X or Y direction dictated by the direction variable */ if (axis == AXIS_X && TileY(start_tile) != TileY(end_tile)) return CMD_ERROR; // x-axis if (axis == AXIS_Y && TileX(start_tile) != TileX(end_tile)) return CMD_ERROR; // y-axis DiagDirection dir = AxisToDiagDir(axis); - /* Swap direction, also the half-tile drag var (bit 0 and 1) */ - if (start_tile > end_tile || (start_tile == end_tile && HasBit(p2, 0))) { + /* Swap direction, also the half-tile drag vars. */ + if (start_tile > end_tile || (start_tile == end_tile && start_half)) { dir = ReverseDiagDir(dir); - p2 ^= 3; - drd = DRD_SOUTHBOUND; + std::swap(start_half, end_half); + if (drd == DRD_NORTHBOUND || drd == DRD_SOUTHBOUND) drd ^= DRD_BOTH; } /* On the X-axis, we have to swap the initial bits, so they * will be interpreted correctly in the GTTS. Furthermore * when you just 'click' on one tile to build them. */ - if ((axis == AXIS_Y) == (start_tile == end_tile && HasBit(p2, 0) == HasBit(p2, 1))) drd ^= DRD_BOTH; - /* No disallowed direction bits have to be toggled */ - if (!HasBit(p2, 10)) drd = DRD_NONE; + if ((drd == DRD_NORTHBOUND || drd == DRD_SOUTHBOUND) && (axis == AXIS_Y) == (start_tile == end_tile && start_half == end_half)) drd ^= DRD_BOTH; CommandCost cost(EXPENSES_CONSTRUCTION); CommandCost last_error = CMD_ERROR; @@ -1021,7 +1005,6 @@ CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p bool had_bridge = false; bool had_tunnel = false; bool had_success = false; - bool is_ai = HasBit(p2, 11); /* Start tile is the first tile clicked by the user. */ for (;;) { @@ -1037,11 +1020,11 @@ CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p } } else { /* Road parts only have to be built at the start tile or at the end tile. */ - if (tile == end_tile && !HasBit(p2, 1)) bits &= DiagDirToRoadBits(ReverseDiagDir(dir)); - if (tile == start_tile && HasBit(p2, 0)) bits &= DiagDirToRoadBits(dir); + if (tile == end_tile && !end_half) bits &= DiagDirToRoadBits(ReverseDiagDir(dir)); + if (tile == start_tile && start_half) bits &= DiagDirToRoadBits(dir); } - CommandCost ret = Command::Do(flags, tile, drd << 11 | rt << 4 | bits, 0, {}); + CommandCost ret = Command::Do(flags, tile, bits, rt, drd, 0); if (ret.Failed()) { last_error = ret; if (last_error.GetErrorMessage() != STR_ERROR_ALREADY_BUILT) { @@ -1080,36 +1063,28 @@ CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p * Remove a long piece of road. * @param flags operation to perform * @param start_tile start tile of drag - * @param p1 end tile of drag - * @param p2 various bitstuffed elements - * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1) - * - p2 = (bit 1) - end tile starts in the 2nd half of tile (p2 & 2) - * - p2 = (bit 2) - direction: 0 = along x-axis, 1 = along y-axis (p2 & 4) - * - p2 = (bit 3 - 8) - road type - * @param text unused + * @param end_tile end tile of drag + * @param rt road type + * @param axis direction + * @param start_half start tile starts in the 2nd half of tile + * @param end_half end tile starts in the 2nd half of tile (p2 & 2) * @return the cost of this operation or an error */ -CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, TileIndex end_tile, RoadType rt, Axis axis, bool start_half, bool end_half) { CommandCost cost(EXPENSES_CONSTRUCTION); - if (p1 >= MapSize()) return CMD_ERROR; + if (end_tile >= MapSize()) return CMD_ERROR; + if (!ValParamRoadType(rt) || !IsEnumValid(axis)) return CMD_ERROR; - TileIndex end_tile = p1; - RoadType rt = Extract(p2); - if (!ValParamRoadType(rt)) return CMD_ERROR; - - Axis axis = Extract(p2); /* Only drag in X or Y direction dictated by the direction variable */ if (axis == AXIS_X && TileY(start_tile) != TileY(end_tile)) return CMD_ERROR; // x-axis if (axis == AXIS_Y && TileX(start_tile) != TileX(end_tile)) return CMD_ERROR; // y-axis - /* Swap start and ending tile, also the half-tile drag var (bit 0 and 1) */ - if (start_tile > end_tile || (start_tile == end_tile && HasBit(p2, 0))) { - TileIndex t = start_tile; - start_tile = end_tile; - end_tile = t; - p2 ^= IsInsideMM(p2 & 3, 1, 3) ? 3 : 0; + /* Swap start and ending tile, also the half-tile drag vars. */ + if (start_tile > end_tile || (start_tile == end_tile && start_half)) { + std::swap(start_tile, end_tile); + std::swap(start_half, end_half); } Money money_available = GetAvailableMoneyForCommand(); @@ -1121,8 +1096,8 @@ CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 for (;;) { RoadBits bits = AxisToRoadBits(axis); - if (tile == end_tile && !HasBit(p2, 1)) bits &= ROAD_NW | ROAD_NE; - if (tile == start_tile && HasBit(p2, 0)) bits &= ROAD_SE | ROAD_SW; + if (tile == end_tile && !end_half) bits &= ROAD_NW | ROAD_NE; + if (tile == start_tile && start_half) bits &= ROAD_SE | ROAD_SW; /* try to remove the halves. */ if (bits != 0) { @@ -1132,7 +1107,7 @@ CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32 if (flags & DC_EXEC) { money_spent += ret.GetCost(); if (money_spent > 0 && money_spent > money_available) { - _additional_cash_required = Command::Do(flags & ~DC_EXEC, start_tile, end_tile, p2, {}).GetCost(); + _additional_cash_required = Command::Do(flags & ~DC_EXEC, start_tile, end_tile, rt, axis, start_half, end_half).GetCost(); return cost; } RemoveRoad(tile, flags, bits, rtt, true, false); @@ -2342,17 +2317,12 @@ static void ConvertRoadTypeOwner(TileIndex tile, uint num_pieces, Owner owner, R * * @param flags operation to perform * @param tile end tile of road conversion drag - * @param p1 start tile of drag - * @param p2 various bitstuffed elements: - * - p2 = (bit 0..5) new roadtype to convert to. - * @param text unused + * @param area_start start tile of drag + * @param to_type new roadtype to convert to. * @return the cost of this operation or an error */ -CommandCost CmdConvertRoad(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdConvertRoad(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RoadType to_type) { - RoadType to_type = Extract(p2); - - TileIndex area_start = p1; TileIndex area_end = tile; if (!ValParamRoadType(to_type)) return CMD_ERROR; diff --git a/src/road_cmd.h b/src/road_cmd.h index 0cab1252f0..3c142bdfed 100644 --- a/src/road_cmd.h +++ b/src/road_cmd.h @@ -17,11 +17,11 @@ void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt); void UpdateNearestTownForRoadTiles(bool invalidate); -CommandProc CmdBuildLongRoad; -CommandProc CmdRemoveLongRoad; -CommandProc CmdBuildRoad; +CommandCost CmdBuildLongRoad(DoCommandFlag flags, TileIndex start_tile, TileIndex end_tile, RoadType rt, Axis axis, DisallowedRoadDirections drd, bool start_half, bool end_half, bool is_ai); +CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, TileIndex end_tile, RoadType rt, Axis axis, bool start_half, bool end_half); +CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, RoadBits pieces, RoadType rt, DisallowedRoadDirections toggle_drd, TownID town_id); CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, RoadType rt, DiagDirection dir); -CommandProc CmdConvertRoad; +CommandCost CmdConvertRoad(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RoadType to_type); DEF_CMD_TRAIT(CMD_BUILD_LONG_ROAD, CmdBuildLongRoad, CMD_AUTO | CMD_NO_WATER | CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_REMOVE_LONG_ROAD, CmdRemoveLongRoad, CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // towns may disallow removing road bits (as they are connected) in test, but in exec they're removed and thus removing is allowed. diff --git a/src/road_gui.cpp b/src/road_gui.cpp index beba949e4c..1aa0b59ac4 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -47,22 +47,10 @@ static void ShowRoadDepotPicker(Window *parent); static bool _remove_button_clicked; static bool _one_way_button_clicked; -/** - * Define the values of the RoadFlags - * @see CmdBuildLongRoad - */ -enum RoadFlags { - RF_NONE = 0x00, - RF_START_HALFROAD_Y = 0x01, // The start tile in Y-dir should have only a half road - RF_END_HALFROAD_Y = 0x02, // The end tile in Y-dir should have only a half road - RF_DIR_Y = 0x04, // The direction is Y-dir - RF_DIR_X = RF_NONE, // Dummy; Dir X is set when RF_DIR_Y is not set - RF_START_HALFROAD_X = 0x08, // The start tile in X-dir should have only a half road - RF_END_HALFROAD_X = 0x10, // The end tile in X-dir should have only a half road -}; -DECLARE_ENUM_AS_BIT_SET(RoadFlags) - -static RoadFlags _place_road_flag; +static Axis _place_road_dir; +static bool _place_road_start_half_x; +static bool _place_road_start_half_y; +static bool _place_road_end_half; static RoadType _cur_roadtype; @@ -124,7 +112,7 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) /* if there is a roadpiece just outside of the station entrance, build a connecting route */ if (IsNormalRoadTile(tile)) { if (GetRoadBits(tile, GetRoadTramType(_cur_roadtype)) != ROAD_NONE) { - Command::Post(tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0, {}); + Command::Post(tile, DiagDirToRoadBits(ReverseDiagDir(direction)), _cur_roadtype, DRD_NONE, 0); } } } @@ -523,21 +511,21 @@ struct BuildRoadToolbarWindow : Window { _one_way_button_clicked = RoadTypeIsRoad(this->roadtype) ? this->IsWidgetLowered(WID_ROT_ONE_WAY) : false; switch (this->last_started_action) { case WID_ROT_ROAD_X: - _place_road_flag = RF_DIR_X; - if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X; + _place_road_dir = AXIS_X; + _place_road_start_half_x = _tile_fract_coords.x >= 8; VpStartPlaceSizing(tile, VPM_FIX_Y, DDSP_PLACE_ROAD_X_DIR); break; case WID_ROT_ROAD_Y: - _place_road_flag = RF_DIR_Y; - if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y; + _place_road_dir = AXIS_Y; + _place_road_start_half_y = _tile_fract_coords.y >= 8; VpStartPlaceSizing(tile, VPM_FIX_X, DDSP_PLACE_ROAD_Y_DIR); break; case WID_ROT_AUTOROAD: - _place_road_flag = RF_NONE; - if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X; - if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y; + _place_road_dir = INVALID_AXIS; + _place_road_start_half_x = _tile_fract_coords.x >= 8; + _place_road_start_half_y = _tile_fract_coords.y >= 8; VpStartPlaceSizing(tile, VPM_X_OR_Y, DDSP_PLACE_AUTOROAD); break; @@ -564,7 +552,7 @@ struct BuildRoadToolbarWindow : Window { case WID_ROT_BUILD_TUNNEL: Command::Post(STR_ERROR_CAN_T_BUILD_TUNNEL_HERE, CcBuildRoadTunnel, - tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0, {}); + tile, TRANSPORT_ROAD, _cur_roadtype); break; case WID_ROT_CONVERT_ROAD: @@ -603,30 +591,26 @@ struct BuildRoadToolbarWindow : Window { * bits and if needed we set them again. */ switch (select_proc) { case DDSP_PLACE_ROAD_X_DIR: - _place_road_flag &= ~RF_END_HALFROAD_X; - if (pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X; + _place_road_end_half = pt.x & 8; break; case DDSP_PLACE_ROAD_Y_DIR: - _place_road_flag &= ~RF_END_HALFROAD_Y; - if (pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y; + _place_road_end_half = pt.y & 8; break; case DDSP_PLACE_AUTOROAD: - _place_road_flag &= ~(RF_END_HALFROAD_Y | RF_END_HALFROAD_X); - if (pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y; - if (pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X; - /* For autoroad we need to update the * direction of the road */ if (_thd.size.x > _thd.size.y || (_thd.size.x == _thd.size.y && ( (_tile_fract_coords.x < _tile_fract_coords.y && (_tile_fract_coords.x + _tile_fract_coords.y) < 16) || (_tile_fract_coords.x > _tile_fract_coords.y && (_tile_fract_coords.x + _tile_fract_coords.y) > 16) ))) { /* Set dir = X */ - _place_road_flag &= ~RF_DIR_Y; + _place_road_dir = AXIS_X; + _place_road_end_half = pt.x & 8; } else { /* Set dir = Y */ - _place_road_flag |= RF_DIR_Y; + _place_road_dir = AXIS_Y; + _place_road_end_half = pt.y & 8; } break; @@ -654,25 +638,18 @@ struct BuildRoadToolbarWindow : Window { case DDSP_PLACE_ROAD_X_DIR: case DDSP_PLACE_ROAD_Y_DIR: - case DDSP_PLACE_AUTOROAD: - /* Flag description: - * Use the first three bits (0x07) if dir == Y - * else use the last 2 bits (X dir has - * not the 3rd bit set) */ - - /* Even if _cur_roadtype_id is a uint8 we only use 5 bits so - * we could ignore the last 3 bits and reuse them for other - * flags */ - _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3)); + case DDSP_PLACE_AUTOROAD: { + bool start_half = _place_road_dir == AXIS_Y ? _place_road_start_half_y : _place_road_start_half_y; if (_remove_button_clicked) { Command::Post(this->rti->strings.err_remove_road, CcPlaySound_CONSTRUCTION_OTHER, - start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10), {}); + start_tile, end_tile, _cur_roadtype, _place_road_dir, start_half, _place_road_end_half); } else { Command::Post(this->rti->strings.err_build_road, CcPlaySound_CONSTRUCTION_OTHER, - start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10), {}); + start_tile, end_tile, _cur_roadtype, _place_road_dir, _one_way_button_clicked ? DRD_NORTHBOUND : DRD_NONE, start_tile, _place_road_end_half, false); } break; + } case DDSP_BUILD_BUSSTOP: case DDSP_REMOVE_BUSSTOP: @@ -699,7 +676,7 @@ struct BuildRoadToolbarWindow : Window { break; case DDSP_CONVERT_ROAD: - Command::Post(rti->strings.err_convert_road, CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype, {}); + Command::Post(rti->strings.err_convert_road, CcPlaySound_CONSTRUCTION_OTHER, end_tile, start_tile, _cur_roadtype); break; } } @@ -707,7 +684,7 @@ struct BuildRoadToolbarWindow : Window { void OnPlacePresize(Point pt, TileIndex tile) override { - Command::Do(DC_AUTO, tile, _cur_roadtype | (TRANSPORT_ROAD << 8), 0, {}); + Command::Do(DC_AUTO, tile, TRANSPORT_ROAD, _cur_roadtype); VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } diff --git a/src/road_map.h b/src/road_map.h index 22d0fa54d3..4cb9125ea6 100644 --- a/src/road_map.h +++ b/src/road_map.h @@ -15,6 +15,7 @@ #include "rail_type.h" #include "road_func.h" #include "tile_map.h" +#include "road_type.h" /** The different types of road tiles. */ @@ -281,18 +282,6 @@ static inline bool HasTownOwnedRoad(TileIndex t) return HasTileRoadType(t, RTT_ROAD) && IsRoadOwner(t, RTT_ROAD, OWNER_TOWN); } -/** Which directions are disallowed ? */ -enum DisallowedRoadDirections { - DRD_NONE, ///< None of the directions are disallowed - DRD_SOUTHBOUND, ///< All southbound traffic is disallowed - DRD_NORTHBOUND, ///< All northbound traffic is disallowed - DRD_BOTH, ///< All directions are disallowed - DRD_END, ///< Sentinel -}; -DECLARE_ENUM_AS_BIT_SET(DisallowedRoadDirections) -/** Helper information for extract tool. */ -template <> struct EnumPropsT : MakeEnumPropsT {}; - /** * Gets the disallowed directions * @param t the tile to get the directions from diff --git a/src/road_type.h b/src/road_type.h index 969b141ba2..a792db7ba5 100644 --- a/src/road_type.h +++ b/src/road_type.h @@ -19,7 +19,7 @@ typedef uint32 RoadTypeLabel; * * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported. */ -enum RoadType { +enum RoadType : byte { ROADTYPE_BEGIN = 0, ///< Used for iterations ROADTYPE_ROAD = 0, ///< Basic road type ROADTYPE_TRAM = 1, ///< Trams @@ -47,7 +47,7 @@ DECLARE_ENUM_AS_BIT_SET(RoadTypes) * This enumeration defines the possible road parts which * can be build on a tile. */ -enum RoadBits { +enum RoadBits : byte { ROAD_NONE = 0U, ///< No road-part is build ROAD_NW = 1U, ///< North-west part ROAD_SW = 2U, ///< South-west part @@ -68,4 +68,16 @@ enum RoadBits { DECLARE_ENUM_AS_BIT_SET(RoadBits) template <> struct EnumPropsT : MakeEnumPropsT {}; +/** Which directions are disallowed ? */ +enum DisallowedRoadDirections : byte { + DRD_NONE, ///< None of the directions are disallowed + DRD_SOUTHBOUND, ///< All southbound traffic is disallowed + DRD_NORTHBOUND, ///< All northbound traffic is disallowed + DRD_BOTH, ///< All directions are disallowed + DRD_END, ///< Sentinel +}; +DECLARE_ENUM_AS_BIT_SET(DisallowedRoadDirections) +/** Helper information for extract tool. */ +template <> struct EnumPropsT : MakeEnumPropsT {}; + #endif /* ROAD_TYPE_H */ diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 0b8d9deff8..c1e510273a 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1131,7 +1131,7 @@ static bool CanBuildTramTrackOnTile(CompanyID c, TileIndex t, RoadType rt, RoadB /* The 'current' company is not necessarily the owner of the vehicle. */ Backup cur_company(_current_company, c, FILE_LINE); - CommandCost ret = Command::Do(DC_NO_WATER, t, rt << 4 | r, 0, {}); + CommandCost ret = Command::Do(DC_NO_WATER, t, r, rt, DRD_NONE, 0); cur_company.Restore(); return ret.Succeeded(); diff --git a/src/script/api/script_bridge.cpp b/src/script/api/script_bridge.cpp index dc357c2552..fbea9fb127 100644 --- a/src/script/api/script_bridge.cpp +++ b/src/script/api/script_bridge.cpp @@ -80,30 +80,17 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) EnforcePrecondition(false, vehicle_type != ScriptVehicle::VT_ROAD || ScriptRoad::IsRoadTypeAvailable(ScriptRoad::GetCurrentRoadType())); EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY || vehicle_type == ScriptVehicle::VT_ROAD); - uint type = 0; switch (vehicle_type) { case ScriptVehicle::VT_ROAD: - type |= (TRANSPORT_ROAD << 15); - type |= (ScriptRoad::GetCurrentRoadType() << 8); - break; + ScriptObject::SetCallbackVariable(0, start); + ScriptObject::SetCallbackVariable(1, end); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildBridge1, end, start, TRANSPORT_ROAD, bridge_id, ScriptRoad::GetCurrentRoadType()); case ScriptVehicle::VT_RAIL: - type |= (TRANSPORT_RAIL << 15); - type |= (ScriptRail::GetCurrentRailType() << 8); - break; + return ScriptObject::Command::Do(end, start, TRANSPORT_RAIL, bridge_id, ScriptRail::GetCurrentRailType()); case ScriptVehicle::VT_WATER: - type |= (TRANSPORT_WATER << 15); - break; + return ScriptObject::Command::Do(end, start, TRANSPORT_WATER, bridge_id, 0); default: NOT_REACHED(); } - - /* For rail and water we do nothing special */ - if (vehicle_type == ScriptVehicle::VT_RAIL || vehicle_type == ScriptVehicle::VT_WATER) { - return ScriptObject::Command::Do(end, start, type | bridge_id, {}); - } - - ScriptObject::SetCallbackVariable(0, start); - ScriptObject::SetCallbackVariable(1, end); - return ScriptObject::Command::Do(&::_DoCommandReturnBuildBridge1, end, start, type | bridge_id, {}); } /* static */ bool ScriptBridge::_BuildBridgeRoad1() @@ -115,7 +102,7 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::Command::Do(&::_DoCommandReturnBuildBridge2, start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (ScriptRoad::GetCurrentRoadType() << 4), 0, {}); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildBridge2, start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2), (::RoadType)ScriptRoad::GetCurrentRoadType(), DRD_NONE, 0); } /* static */ bool ScriptBridge::_BuildBridgeRoad2() @@ -127,7 +114,7 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::Command::Do(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1) | (ScriptRoad::GetCurrentRoadType() << 4), 0, {}); + return ScriptObject::Command::Do(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1), (::RoadType)ScriptRoad::GetCurrentRoadType(), DRD_NONE, 0); } /* static */ bool ScriptBridge::RemoveBridge(TileIndex tile) diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp index 8093233948..059157e276 100644 --- a/src/script/api/script_marine.cpp +++ b/src/script/api/script_marine.cpp @@ -108,7 +108,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptMarine::BuildCanal(TileIndex tile) @@ -116,7 +116,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, tile, WATER_CLASS_CANAL, {}); + return ScriptObject::Command::Do(tile, tile, WATER_CLASS_CANAL, false); } /* static */ bool ScriptMarine::RemoveWaterDepot(TileIndex tile) diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp index c629396b70..297a8f56c1 100644 --- a/src/script/api/script_road.cpp +++ b/src/script/api/script_road.cpp @@ -129,7 +129,7 @@ EnforcePrecondition(false, ::IsValidTile(end_tile)); EnforcePrecondition(false, IsRoadTypeAvailable(road_type)); - return ScriptObject::Command::Do(start_tile, end_tile, (::RoadType)road_type, {}); + return ScriptObject::Command::Do(start_tile, end_tile, (::RoadType)road_type); } /* Helper functions for ScriptRoad::CanBuildConnectedRoadParts(). */ @@ -495,7 +495,8 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, !one_way || RoadTypeIsRoad(ScriptObject::GetRoadType())); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - return ScriptObject::Command::Do(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (((start < end) == !full) ? 1 : 2) | (ScriptObject::GetRoadType() << 3) | ((one_way ? 1 : 0) << 10) | 1 << 11, {}); + Axis axis = ::TileY(start) != ::TileY(end) ? AXIS_Y : AXIS_X; + return ScriptObject::Command::Do(start, end, ScriptObject::GetRoadType(), axis, one_way ? DRD_NORTHBOUND : DRD_NONE, (start < end) == !full, (start < end) != !full, true); } /* static */ bool ScriptRoad::BuildRoad(TileIndex start, TileIndex end) @@ -570,7 +571,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - return ScriptObject::Command::Do(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 1 : 2) | (ScriptObject::GetRoadType() << 3), {}); + return ScriptObject::Command::Do(start, end, ScriptObject::GetRoadType(), ::TileY(start) != ::TileY(end) ? AXIS_Y : AXIS_X, start < end, start >= end); } /* static */ bool ScriptRoad::RemoveRoadFull(TileIndex start, TileIndex end) @@ -582,7 +583,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end)); EnforcePrecondition(false, IsRoadTypeAvailable(GetCurrentRoadType())); - return ScriptObject::Command::Do(start, end, (::TileY(start) != ::TileY(end) ? 4 : 0) | (start < end ? 2 : 1) | (ScriptObject::GetRoadType() << 3), {}); + return ScriptObject::Command::Do(start, end, ScriptObject::GetRoadType(), ::TileY(start) != ::TileY(end) ? AXIS_Y : AXIS_X, start >= end, start < end); } /* static */ bool ScriptRoad::RemoveRoadDepot(TileIndex tile) diff --git a/src/script/api/script_tunnel.cpp b/src/script/api/script_tunnel.cpp index ea9cbc5186..8529f908db 100644 --- a/src/script/api/script_tunnel.cpp +++ b/src/script/api/script_tunnel.cpp @@ -88,22 +88,13 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) EnforcePrecondition(false, vehicle_type != ScriptVehicle::VT_ROAD || ScriptRoad::IsRoadTypeAvailable(ScriptRoad::GetCurrentRoadType())); EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY || vehicle_type == ScriptVehicle::VT_ROAD); - uint type = 0; - if (vehicle_type == ScriptVehicle::VT_ROAD) { - type |= (TRANSPORT_ROAD << 8); - type |= ScriptRoad::GetCurrentRoadType(); - } else { - type |= (TRANSPORT_RAIL << 8); - type |= ScriptRail::GetCurrentRailType(); - } - - /* For rail we do nothing special */ if (vehicle_type == ScriptVehicle::VT_RAIL) { - return ScriptObject::Command::Do(start, type, 0, {}); + /* For rail we do nothing special */ + return ScriptObject::Command::Do(start, TRANSPORT_RAIL, ScriptRail::GetCurrentRailType()); + } else { + ScriptObject::SetCallbackVariable(0, start); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildTunnel1, start, TRANSPORT_ROAD, ScriptRoad::GetCurrentRoadType()); } - - ScriptObject::SetCallbackVariable(0, start); - return ScriptObject::Command::Do(&::_DoCommandReturnBuildTunnel1, start, type, 0, {}); } /* static */ bool ScriptTunnel::_BuildTunnelRoad1() @@ -115,7 +106,7 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::Command::Do(&::_DoCommandReturnBuildTunnel2, start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2) | (ScriptObject::GetRoadType() << 4), 0, {}); + return ScriptObject::Command::Do(&::_DoCommandReturnBuildTunnel2, start + ::TileOffsByDiagDir(dir_1), ::DiagDirToRoadBits(dir_2), ScriptRoad::GetRoadType(), DRD_NONE, 0); } /* static */ bool ScriptTunnel::_BuildTunnelRoad2() @@ -127,7 +118,7 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start); DiagDirection dir_2 = ::ReverseDiagDir(dir_1); - return ScriptObject::Command::Do(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1) | (ScriptObject::GetRoadType() << 4), 0, {}); + return ScriptObject::Command::Do(end + ::TileOffsByDiagDir(dir_2), ::DiagDirToRoadBits(dir_1), ScriptRoad::GetRoadType(), DRD_NONE, 0); } /* static */ bool ScriptTunnel::RemoveTunnel(TileIndex tile) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 8e87739d3d..7a564d48ab 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -943,7 +943,7 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) * If that fails clear the land, and if that fails exit. * This is to make sure that we can build a road here later. */ RoadType rt = GetTownRoadType(t); - if (Command::Do(DC_AUTO | DC_NO_WATER, tile, ((dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X) | (rt << 4), 0, {}).Failed() && + if (Command::Do(DC_AUTO | DC_NO_WATER, tile, (dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X, rt, DRD_NONE, 0).Failed() && Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Failed()) { return false; } @@ -1112,7 +1112,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile) static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd) { RoadType rt = GetTownRoadType(t); - if (Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, tile, rcmd | (rt << 4), t->index, {}).Succeeded()) { + if (Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, tile, rcmd, rt, DRD_NONE, t->index).Succeeded()) { _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1159,7 +1159,7 @@ static bool CanRoadContinueIntoNextTile(const Town *t, const TileIndex tile, con if (IsTileType(next_tile, MP_RAILWAY) && !_settings_game.economy.allow_town_level_crossings) return false; /* If a road tile can be built, the construction is allowed. */ - return Command::Do(DC_AUTO | DC_NO_WATER, next_tile, rcmd | (rt << 4), t->index, {}).Succeeded(); + return Command::Do(DC_AUTO | DC_NO_WATER, next_tile, rcmd, rt, DRD_NONE, t->index).Succeeded(); } /** @@ -1227,8 +1227,8 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi /* Can we actually build the bridge? */ RoadType rt = GetTownRoadType(t); - if (Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15, {}).Succeeded()) { - Command::Do(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags()), tile, bridge_tile, bridge_type | rt << 8 | TRANSPORT_ROAD << 15, {}); + if (Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, bridge_tile, TRANSPORT_ROAD, bridge_type, rt).Succeeded()) { + Command::Do(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags()), tile, bridge_tile, TRANSPORT_ROAD, bridge_type, rt); _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1298,8 +1298,8 @@ static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDi /* Attempt to build the tunnel. Return false if it fails to let the town build a road instead. */ RoadType rt = GetTownRoadType(t); - if (Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, rt | (TRANSPORT_ROAD << 8), 0, {}).Succeeded()) { - Command::Do(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags()), tile, rt | (TRANSPORT_ROAD << 8), 0, {}); + if (Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, TRANSPORT_ROAD, rt).Succeeded()) { + Command::Do(DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags()), tile, TRANSPORT_ROAD, rt); _grow_town_result = GROWTH_SUCCEED; return true; } @@ -1739,7 +1739,7 @@ static bool GrowTown(Town *t) if (!IsTileType(tile, MP_HOUSE) && IsTileFlat(tile)) { if (Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Succeeded()) { RoadType rt = GetTownRoadType(t); - Command::Do(DC_EXEC | DC_AUTO, tile, GenRandomRoadBits() | (rt << 4), t->index, {}); + Command::Do(DC_EXEC | DC_AUTO, tile, GenRandomRoadBits(), rt, DRD_NONE, t->index); cur_company.Restore(); return true; } diff --git a/src/transport_type.h b/src/transport_type.h index b244e48b31..172649aba5 100644 --- a/src/transport_type.h +++ b/src/transport_type.h @@ -16,7 +16,7 @@ typedef uint16 UnitID; /** Available types of transport */ -enum TransportType { +enum TransportType : byte { /* These constants are for now linked to the representation of bridges * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge. * In an ideal world, these constants would be used everywhere when diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 85c611ae5d..14ff79854d 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -251,38 +251,31 @@ static Money TunnelBridgeClearCost(TileIndex tile, Price base_price) /** * Build a Bridge * @param flags type of operation - * @param end_tile end tile - * @param p1 packed start tile coords (~ dx) - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 7) - bridge type (hi bh) - * - p2 = (bit 8-13) - rail type or road types. - * - p2 = (bit 15-16) - transport type. - * @param text unused + * @param tile_end end tile + * @param tile_start start tile + * @param transport_type transport type. + * @param bridge_type bridge type (hi bh) + * @param road_rail_type rail type or road types. * @return the cost of this operation or an error */ -CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, byte road_rail_type) { CompanyID company = _current_company; RailType railtype = INVALID_RAILTYPE; RoadType roadtype = INVALID_ROADTYPE; - /* unpack parameters */ - BridgeType bridge_type = GB(p2, 0, 8); - - if (!IsValidTile(p1)) return_cmd_error(STR_ERROR_BRIDGE_THROUGH_MAP_BORDER); - - TransportType transport_type = Extract(p2); + if (!IsValidTile(tile_start)) return_cmd_error(STR_ERROR_BRIDGE_THROUGH_MAP_BORDER); /* type of bridge */ switch (transport_type) { case TRANSPORT_ROAD: - roadtype = Extract(p2); + roadtype = (RoadType)road_rail_type; if (!ValParamRoadType(roadtype)) return CMD_ERROR; break; case TRANSPORT_RAIL: - railtype = Extract(p2); + railtype = (RailType)road_rail_type; if (!ValParamRailtype(railtype)) return CMD_ERROR; break; @@ -293,8 +286,6 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, u /* Airports don't have bridges. */ return CMD_ERROR; } - TileIndex tile_start = p1; - TileIndex tile_end = end_tile; if (company == OWNER_DEITY) { if (transport_type != TRANSPORT_ROAD) return CMD_ERROR; @@ -627,28 +618,25 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex end_tile, uint32 p1, u * Build Tunnel. * @param flags type of operation * @param start_tile start tile of tunnel - * @param p1 bit 0-5 railtype or roadtype - * bit 8-9 transport type - * @param p2 unused - * @param text unused + * @param transport_type transport type + * @param road_rail_type railtype or roadtype * @return the cost of this operation or an error */ -CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportType transport_type, byte road_rail_type) { CompanyID company = _current_company; - TransportType transport_type = Extract(p1); RailType railtype = INVALID_RAILTYPE; RoadType roadtype = INVALID_ROADTYPE; _build_tunnel_endtile = 0; switch (transport_type) { case TRANSPORT_RAIL: - railtype = Extract(p1); + railtype = (RailType)road_rail_type; if (!ValParamRailtype(railtype)) return CMD_ERROR; break; case TRANSPORT_ROAD: - roadtype = Extract(p1); + roadtype = (RoadType)road_rail_type; if (!ValParamRoadType(roadtype)) return CMD_ERROR; break; diff --git a/src/tunnelbridge_cmd.h b/src/tunnelbridge_cmd.h index 6c78db48b1..ae924cf69d 100644 --- a/src/tunnelbridge_cmd.h +++ b/src/tunnelbridge_cmd.h @@ -11,9 +11,11 @@ #define TUNNELBRIDGE_CMD_H #include "command_type.h" +#include "transport_type.h" +#include "bridge.h" -CommandProc CmdBuildBridge; -CommandProc CmdBuildTunnel; +CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, byte road_rail_type); +CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportType transport_type, byte road_rail_type); DEF_CMD_TRAIT(CMD_BUILD_BRIDGE, CmdBuildBridge, CMD_DEITY | CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_BUILD_TUNNEL, CmdBuildTunnel, CMD_DEITY | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 3c96f79ad8..ee911312ef 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -411,12 +411,9 @@ static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags) * Builds a lock. * @param flags type of operation * @param tile tile where to place the lock - * @param p1 unused - * @param p2 unused - * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuildLock(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildLock(DoCommandFlag flags, TileIndex tile) { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); if (dir == INVALID_DIAGDIR) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); @@ -435,34 +432,31 @@ bool RiverModifyDesertZone(TileIndex tile, void *) * Build a piece of canal. * @param flags type of operation * @param tile end tile of stretch-dragging - * @param p1 start tile of stretch-dragging - * @param p2 various bitstuffed data - * bits 0-1: waterclass to build. sea and river can only be built in scenario editor - * bit 2: Whether to use the Orthogonal (0) or Diagonal (1) iterator. - * @param text unused + * @param start_tile start tile of stretch-dragging + * @param wc waterclass to build. sea and river can only be built in scenario editor + * @param diagonal Whether to use the Orthogonal (0) or Diagonal (1) iterator. * @return the cost of this operation or an error */ -CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, WaterClass wc, bool diagonal) { - WaterClass wc = Extract(p2); - if (p1 >= MapSize() || wc == WATER_CLASS_INVALID) return CMD_ERROR; + if (start_tile >= MapSize() || !IsEnumValid(wc)) return CMD_ERROR; /* Outside of the editor you can only build canals, not oceans */ if (wc != WATER_CLASS_CANAL && _game_mode != GM_EDITOR) return CMD_ERROR; /* Outside the editor you can only drag canals, and not areas */ if (_game_mode != GM_EDITOR) { - TileArea ta(tile, (TileIndex)p1); + TileArea ta(tile, start_tile); if (ta.w != 1 && ta.h != 1) return CMD_ERROR; } CommandCost cost(EXPENSES_CONSTRUCTION); std::unique_ptr iter; - if (HasBit(p2, 2)) { - iter = std::make_unique(tile, (TileIndex)p1); + if (diagonal) { + iter = std::make_unique(tile, start_tile); } else { - iter = std::make_unique(tile, (TileIndex)p1); + iter = std::make_unique(tile, start_tile); } for (; *iter != INVALID_TILE; ++(*iter)) { diff --git a/src/water_cmd.h b/src/water_cmd.h index 4d3375aa39..1c56790327 100644 --- a/src/water_cmd.h +++ b/src/water_cmd.h @@ -11,10 +11,11 @@ #define WATER_CMD_H #include "command_type.h" +#include "water_map.h" CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, Axis axis); -CommandProc CmdBuildCanal; -CommandProc CmdBuildLock; +CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, WaterClass wc, bool diagonal); +CommandCost CmdBuildLock(DoCommandFlag flags, TileIndex tile); DEF_CMD_TRAIT(CMD_BUILD_SHIP_DEPOT, CmdBuildShipDepot, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_BUILD_CANAL, CmdBuildCanal, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/water_map.h b/src/water_map.h index 22e54e967f..793d07c8a2 100644 --- a/src/water_map.h +++ b/src/water_map.h @@ -44,7 +44,7 @@ enum WaterTileType { }; /** classes of water (for #WATER_TILE_CLEAR water tile type). */ -enum WaterClass { +enum WaterClass : byte { WATER_CLASS_SEA, ///< Sea. WATER_CLASS_CANAL, ///< Canal. WATER_CLASS_RIVER, ///< River. From e08b3abe7ff65c193781a74c170f45b2f1dcf0a5 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Wed, 17 Nov 2021 00:40:06 +0100 Subject: [PATCH 128/710] Codechange: Un-bitstuff group and autoreplace commands. --- src/autoreplace_cmd.cpp | 30 +++----- src/autoreplace_cmd.h | 7 +- src/autoreplace_gui.cpp | 8 +- src/company_gui.cpp | 2 +- src/gfx_type.h | 2 +- src/group_cmd.cpp | 129 ++++++++++++-------------------- src/group_cmd.h | 27 +++++-- src/group_gui.cpp | 32 ++++---- src/order_backup.cpp | 2 +- src/script/api/script_group.cpp | 20 ++--- src/vehicle.cpp | 2 +- src/vehicle_cmd.cpp | 4 +- 12 files changed, 118 insertions(+), 147 deletions(-) diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 8338172b02..f2ef317f04 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -405,7 +405,7 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head, if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, CO_SHARE, new_head->index, old_head->index)); /* Copy group membership */ - if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, 0, old_head->group_id, new_head->index, {})); + if (cost.Succeeded() && old_head != new_head) cost.AddCost(Command::Do(DC_EXEC, old_head->group_id, new_head->index, false)); /* Perform start/stop check whether the new vehicle suits newgrf restrictions etc. */ if (cost.Succeeded()) { @@ -713,15 +713,12 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon * Autoreplaces a vehicle * Trains are replaced as a whole chain, free wagons in depot are replaced on their own * @param flags type of operation - * @param tile not used - * @param p1 Index of vehicle - * @param p2 not used - * @param text unused + * @param veh_id Index of vehicle * @return the cost of this operation or an error */ -CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, VehicleID veh_id) { - Vehicle *v = Vehicle::GetIfValid(p1); + Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr) return CMD_ERROR; CommandCost ret = CheckOwnership(v->owner); @@ -802,24 +799,17 @@ CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, TileIndex tile, uint32 p1 /** * Change engine renewal parameters * @param flags operation to perform - * @param tile unused - * @param p1 packed data - * - bit 0 = replace when engine gets old? - * - bits 16-31 = engine group - * @param p2 packed data - * - bits 0-15 = old engine type - * - bits 16-31 = new engine type - * @param text unused + * @param id_g engine group + * @param old_engine_type old engine type + * @param new_engine_type new engine type + * @param when_old replace when engine gets old? * @return the cost of this operation or an error */ -CommandCost CmdSetAutoReplace(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetAutoReplace(DoCommandFlag flags, GroupID id_g, EngineID old_engine_type, EngineID new_engine_type, bool when_old) { Company *c = Company::GetIfValid(_current_company); if (c == nullptr) return CMD_ERROR; - EngineID old_engine_type = GB(p2, 0, 16); - EngineID new_engine_type = GB(p2, 16, 16); - GroupID id_g = GB(p1, 16, 16); CommandCost cost; if (Group::IsValidID(id_g) ? Group::Get(id_g)->owner != _current_company : !IsAllGroupID(id_g) && !IsDefaultGroupID(id_g)) return CMD_ERROR; @@ -829,7 +819,7 @@ CommandCost CmdSetAutoReplace(DoCommandFlag flags, TileIndex tile, uint32 p1, ui if (!Engine::IsValidID(new_engine_type)) return CMD_ERROR; if (!CheckAutoreplaceValidity(old_engine_type, new_engine_type, _current_company)) return CMD_ERROR; - cost = AddEngineReplacementForCompany(c, old_engine_type, new_engine_type, id_g, HasBit(p1, 0), flags); + cost = AddEngineReplacementForCompany(c, old_engine_type, new_engine_type, id_g, when_old, flags); } else { cost = RemoveEngineReplacementForCompany(c, old_engine_type, id_g, flags); } diff --git a/src/autoreplace_cmd.h b/src/autoreplace_cmd.h index 14088d6dc5..c42e740c93 100644 --- a/src/autoreplace_cmd.h +++ b/src/autoreplace_cmd.h @@ -11,9 +11,12 @@ #define AUTOREPLACE_CMD_H #include "command_type.h" +#include "vehicle_type.h" +#include "engine_type.h" +#include "group_type.h" -CommandProc CmdAutoreplaceVehicle; -CommandProc CmdSetAutoReplace; +CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, VehicleID veh_id); +CommandCost CmdSetAutoReplace(DoCommandFlag flags, GroupID id_g, EngineID old_engine_type, EngineID new_engine_type, bool when_old); DEF_CMD_TRAIT(CMD_AUTOREPLACE_VEHICLE, CmdAutoreplaceVehicle, 0, CMDT_VEHICLE_MANAGEMENT) DEF_CMD_TRAIT(CMD_SET_AUTOREPLACE, CmdSetAutoReplace, 0, CMDT_VEHICLE_MANAGEMENT) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index c5cfd04cb6..00eba4044b 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -220,7 +220,7 @@ class ReplaceVehicleWindow : public Window { { EngineID veh_from = this->sel_engine[0]; EngineID veh_to = this->sel_engine[1]; - Command::Post(0, (replace_when_old ? 1 : 0) | (this->sel_group << 16), veh_from + (veh_to << 16), {}); + Command::Post(this->sel_group, veh_from, veh_to, replace_when_old); } public: @@ -544,7 +544,7 @@ public: case WID_RV_TRAIN_WAGONREMOVE_TOGGLE: { const Group *g = Group::GetIfValid(this->sel_group); if (g != nullptr) { - Command::Post(0, this->sel_group | (GroupFlags::GF_REPLACE_WAGON_REMOVAL << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL) ? 0 : 1) | (_ctrl_pressed << 1), {}); + Command::Post(this->sel_group, GroupFlags::GF_REPLACE_WAGON_REMOVAL, !HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL), _ctrl_pressed); } else { // toggle renew_keep_length Command::Post(0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, "company.renew_keep_length"); @@ -565,7 +565,7 @@ public: case WID_RV_STOP_REPLACE: { // Stop replacing EngineID veh_from = this->sel_engine[0]; - Command::Post(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), {}); + Command::Post(this->sel_group, veh_from, INVALID_ENGINE, false); break; } @@ -587,7 +587,7 @@ public: if (click_side == 0 && _ctrl_pressed && e != INVALID_ENGINE && (GetGroupNumEngines(_local_company, sel_group, e) == 0 || GetGroupNumEngines(_local_company, ALL_GROUP, e) == 0)) { EngineID veh_from = e; - Command::Post(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), {}); + Command::Post(this->sel_group, veh_from, INVALID_ENGINE, false); break; } diff --git a/src/company_gui.cpp b/src/company_gui.cpp index c2695b9105..cefab6d127 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1005,7 +1005,7 @@ public: } } else { /* Setting group livery */ - Command::Post(0, this->sel, (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256) | (index << 16), {}); + Command::Post(this->sel, widget == WID_SCL_PRI_COL_DROPDOWN, (Colours)index); } } diff --git a/src/gfx_type.h b/src/gfx_type.h index a6bf3cf6d5..932a6cb87d 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -223,7 +223,7 @@ struct SubSprite { int left, top, right, bottom; }; -enum Colours { +enum Colours : byte { COLOUR_BEGIN, COLOUR_DARK_BLUE = COLOUR_BEGIN, COLOUR_PALE_GREEN, diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index 2ff8a09dfd..4b34ad382a 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -295,20 +295,17 @@ Group::Group(Owner owner) /** * Create a new vehicle group. * @param flags type of operation - * @param tile unused - * @param p1 vehicle type - * @param p2 parent groupid - * @param text unused + * @param vt vehicle type + * @param parent_group parent groupid * @return the cost of this operation or an error */ -CommandCost CmdCreateGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateGroup(DoCommandFlag flags, VehicleType vt, GroupID parent_group) { - VehicleType vt = Extract(p1); if (!IsCompanyBuildableVehicleType(vt)) return CMD_ERROR; if (!Group::CanAllocateItem()) return CMD_ERROR; - const Group *pg = Group::GetIfValid(GB(p2, 0, 16)); + const Group *pg = Group::GetIfValid(parent_group); if (pg != nullptr) { if (pg->owner != _current_company) return CMD_ERROR; if (pg->vehicle_type != vt) return CMD_ERROR; @@ -344,25 +341,21 @@ CommandCost CmdCreateGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 /** * Add all vehicles in the given group to the default group and then deletes the group. * @param flags type of operation - * @param tile unused - * @param p1 index of array group - * - p1 bit 0-15 : GroupID - * @param p2 unused - * @param text unused + * @param group_id index of group * @return the cost of this operation or an error */ -CommandCost CmdDeleteGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDeleteGroup(DoCommandFlag flags, GroupID group_id) { - Group *g = Group::GetIfValid(p1); + Group *g = Group::GetIfValid(group_id); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; /* Remove all vehicles from the group */ - Command::Do(flags, 0, p1, 0, {}); + Command::Do(flags, group_id); /* Delete sub-groups */ for (const Group *gp : Group::Iterate()) { if (gp->parent == g->index) { - Command::Do(flags, 0, gp->index, 0, {}); + Command::Do(flags, gp->index); } } @@ -396,21 +389,18 @@ CommandCost CmdDeleteGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 /** * Alter a group * @param flags type of operation - * @param tile unused - * @param p1 index of array group - * - p1 bit 0-15 : GroupID - * - p1 bit 16: 0 - Rename grouop - * 1 - Set group parent - * @param p2 parent group index + * @param mode Operation to perform. + * @param group_id GroupID + * @param parent_id parent group index * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdAlterGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAlterGroup(DoCommandFlag flags, AlterGroupMode mode, GroupID group_id, GroupID parent_id, const std::string &text) { - Group *g = Group::GetIfValid(GB(p1, 0, 16)); + Group *g = Group::GetIfValid(group_id); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; - if (!HasBit(p1, 16)) { + if (mode == AlterGroupMode::Rename) { /* Rename group */ bool reset = text.empty(); @@ -426,9 +416,9 @@ CommandCost CmdAlterGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 g->name = text; } } - } else { + } else if (mode == AlterGroupMode::SetParent) { /* Set group parent */ - const Group *pg = Group::GetIfValid(GB(p2, 0, 16)); + const Group *pg = Group::GetIfValid(parent_id); if (pg != nullptr) { if (pg->owner != _current_company) return CMD_ERROR; @@ -452,6 +442,8 @@ CommandCost CmdAlterGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 MarkWholeScreenDirty(); } } + } else { + return CMD_ERROR; } if (flags & DC_EXEC) { @@ -500,19 +492,15 @@ static void AddVehicleToGroup(Vehicle *v, GroupID new_g) /** * Add a vehicle to a group * @param flags type of operation - * @param tile unused - * @param p1 index of array group - * - p1 bit 0-15 : GroupID - * @param p2 vehicle to add to a group - * - p2 bit 0-19 : VehicleID - * - p2 bit 31 : Add shared vehicles as well. - * @param text unused + * @param group_id index of group + * @param veh_id vehicle to add to a group + * @param add_shared Add shared vehicles as well. * @return the cost of this operation or an error */ -CommandCost CmdAddVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAddVehicleGroup(DoCommandFlag flags, GroupID group_id, VehicleID veh_id, bool add_shared) { - Vehicle *v = Vehicle::GetIfValid(GB(p2, 0, 20)); - GroupID new_g = p1; + Vehicle *v = Vehicle::GetIfValid(veh_id); + GroupID new_g = group_id; if (v == nullptr || (!Group::IsValidID(new_g) && !IsDefaultGroupID(new_g) && new_g != NEW_GROUP)) return CMD_ERROR; @@ -525,7 +513,7 @@ CommandCost CmdAddVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, u if (new_g == NEW_GROUP) { /* Create new group. */ - CommandCost ret = CmdCreateGroup(flags, 0, v->type, INVALID_GROUP, {}); + CommandCost ret = CmdCreateGroup(flags, v->type, INVALID_GROUP); if (ret.Failed()) return ret; new_g = _new_group_id; @@ -534,7 +522,7 @@ CommandCost CmdAddVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, u if (flags & DC_EXEC) { AddVehicleToGroup(v, new_g); - if (HasBit(p2, 31)) { + if (add_shared) { /* Add vehicles in the shared order list as well. */ for (Vehicle *v2 = v->FirstShared(); v2 != nullptr; v2 = v2->NextShared()) { if (v2->group_id != new_g) AddVehicleToGroup(v2, new_g); @@ -559,17 +547,12 @@ CommandCost CmdAddVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, u /** * Add all shared vehicles of all vehicles from a group * @param flags type of operation - * @param tile unused - * @param p1 index of group array - * - p1 bit 0-15 : GroupID - * @param p2 type of vehicles - * @param text unused + * @param id_g index of group + * @param type type of vehicles * @return the cost of this operation or an error */ -CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, GroupID id_g, VehicleType type) { - VehicleType type = Extract(p2); - GroupID id_g = p1; if (!Group::IsValidID(id_g) || !IsCompanyBuildableVehicleType(type)) return CMD_ERROR; if (flags & DC_EXEC) { @@ -581,7 +564,7 @@ CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 /* For each shared vehicles add it to the group */ for (Vehicle *v2 = v->FirstShared(); v2 != nullptr; v2 = v2->NextShared()) { - if (v2->group_id != id_g) Command::Do(flags, tile, id_g, v2->index, text); + if (v2->group_id != id_g) Command::Do(flags, id_g, v2->index, false); } } } @@ -596,17 +579,12 @@ CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, TileIndex tile, uint32 /** * Remove all vehicles from a group * @param flags type of operation - * @param tile unused - * @param p1 index of group array - * - p1 bit 0-15 : GroupID - * @param p2 unused - * @param text unused + * @param group_id index of group * @return the cost of this operation or an error */ -CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, GroupID group_id) { - GroupID old_g = p1; - Group *g = Group::GetIfValid(old_g); + Group *g = Group::GetIfValid(group_id); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; @@ -614,10 +592,10 @@ CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, TileIndex tile, uint3 /* Find each Vehicle that belongs to the group old_g and add it to the default group */ for (const Vehicle *v : Vehicle::Iterate()) { if (v->IsPrimaryVehicle()) { - if (v->group_id != old_g) continue; + if (v->group_id != group_id) continue; /* Add The Vehicle to the default group */ - Command::Do(flags,tile, DEFAULT_GROUP, v->index, text); + Command::Do(flags, DEFAULT_GROUP, v->index, false); } } @@ -630,18 +608,13 @@ CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, TileIndex tile, uint3 /** * Set the livery for a vehicle group. * @param flags Command flags. - * @param tile Unused. - * @param p1 - * - p1 bit 0-15 Group ID. - * @param p2 - * - p2 bit 8 Set secondary instead of primary colour - * - p2 bit 16-23 Colour. + * @param group_id Group ID. + * @param primary Set primary instead of secondary colour + * @param colour Colour. */ -CommandCost CmdSetGroupLivery(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGroupLivery(DoCommandFlag flags, GroupID group_id, bool primary, Colours colour) { - Group *g = Group::GetIfValid(p1); - bool primary = !HasBit(p2, 8); - Colours colour = Extract(p2); + Group *g = Group::GetIfValid(group_id); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; @@ -689,27 +662,21 @@ static void SetGroupFlag(Group *g, GroupFlags flag, bool set, bool children) * (Un)set group flag from a group * @param flags type of operation * @param tile unused - * @param p1 index of group array - * - p1 bit 0-15 : GroupID - * - p1 bit 16-18 : Flag to set, by value not bit. - * @param p2 - * - p2 bit 0 : 1 to set or 0 to clear protection. - * - p2 bit 1 : 1 to apply to sub-groups. - * @param text unused + * @param group_id index of group array + * @param flag flag to set, by value not bit. + * @param value value to set the flag to. + * @param recursive to apply to sub-groups. * @return the cost of this operation or an error */ -CommandCost CmdSetGroupFlag(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGroupFlag(DoCommandFlag flags, GroupID group_id, GroupFlags flag, bool value, bool recursive) { - Group *g = Group::GetIfValid(GB(p1, 0, 16)); + Group *g = Group::GetIfValid(group_id); if (g == nullptr || g->owner != _current_company) return CMD_ERROR; - /* GroupFlags are stored in as an 8 bit bitfield but passed here by value, - * so 3 bits is sufficient to cover each possible value. */ - GroupFlags flag = (GroupFlags)GB(p1, 16, 3); if (flag >= GroupFlags::GF_END) return CMD_ERROR; if (flags & DC_EXEC) { - SetGroupFlag(g, flag, HasBit(p2, 0), HasBit(p2, 1)); + SetGroupFlag(g, flag, value, recursive); SetWindowDirty(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack()); InvalidateWindowData(WC_REPLACE_VEHICLE, g->vehicle_type); diff --git a/src/group_cmd.h b/src/group_cmd.h index 7f3496cc9c..70610de756 100644 --- a/src/group_cmd.h +++ b/src/group_cmd.h @@ -11,15 +11,26 @@ #define GROUP_CMD_H #include "command_type.h" +#include "group_type.h" +#include "vehicle_type.h" -CommandProc CmdCreateGroup; -CommandProc CmdAlterGroup; -CommandProc CmdDeleteGroup; -CommandProc CmdAddVehicleGroup; -CommandProc CmdAddSharedVehicleGroup; -CommandProc CmdRemoveAllVehiclesGroup; -CommandProc CmdSetGroupFlag; -CommandProc CmdSetGroupLivery; +enum Colours : byte; +enum GroupFlags : uint8; + +/** Action for \c CmdAlterGroup. */ +enum class AlterGroupMode : byte { + Rename, ///< Change group name. + SetParent, ///< Change group parent. +}; + +CommandCost CmdCreateGroup(DoCommandFlag flags, VehicleType vt, GroupID parent_group); +CommandCost CmdAlterGroup(DoCommandFlag flags, AlterGroupMode mode, GroupID group_id, GroupID parent_id, const std::string &text); +CommandCost CmdDeleteGroup(DoCommandFlag flags, GroupID group_id); +CommandCost CmdAddVehicleGroup(DoCommandFlag flags, GroupID group_id, VehicleID veh_id, bool add_shared); +CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, GroupID id_g, VehicleType type); +CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, GroupID group_id); +CommandCost CmdSetGroupFlag(DoCommandFlag flags, GroupID group_id, GroupFlags flag, bool value, bool recursive); +CommandCost CmdSetGroupLivery(DoCommandFlag flags, GroupID group_id, bool primary, Colours colour); DEF_CMD_TRAIT(CMD_CREATE_GROUP, CmdCreateGroup, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_DELETE_GROUP, CmdDeleteGroup, 0, CMDT_ROUTE_MANAGEMENT) diff --git a/src/group_gui.cpp b/src/group_gui.cpp index d3d270f314..3175909f0f 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -642,7 +642,7 @@ public: if (confirmed) { VehicleGroupWindow *w = (VehicleGroupWindow*)win; w->vli.index = ALL_GROUP; - Command::Post(STR_ERROR_GROUP_CAN_T_DELETE, 0, w->group_confirm, 0, {}); + Command::Post(STR_ERROR_GROUP_CAN_T_DELETE, w->group_confirm); } } @@ -773,7 +773,7 @@ public: } case WID_GL_CREATE_GROUP: { // Create a new group - Command::Post(STR_ERROR_GROUP_CAN_T_CREATE, CcCreateGroup, 0, this->vli.vtype, this->vli.index, {}); + Command::Post(STR_ERROR_GROUP_CAN_T_CREATE, CcCreateGroup, this->vli.vtype, this->vli.index); break; } @@ -809,7 +809,7 @@ public: case WID_GL_REPLACE_PROTECTION: { const Group *g = Group::GetIfValid(this->vli.index); if (g != nullptr) { - Command::Post(0, this->vli.index | (GroupFlags::GF_REPLACE_PROTECTION << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION) ? 0 : 1) | (_ctrl_pressed << 1), {}); + Command::Post(this->vli.index, GroupFlags::GF_REPLACE_PROTECTION, !HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), _ctrl_pressed); } break; } @@ -824,7 +824,7 @@ public: case WID_GL_ALL_VEHICLES: // All vehicles case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles if (g->parent != INVALID_GROUP) { - Command::Post(STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), INVALID_GROUP, {}); + Command::Post(STR_ERROR_GROUP_CAN_T_SET_PARENT, AlterGroupMode::SetParent, this->group_sel, INVALID_GROUP, {}); } this->group_sel = INVALID_GROUP; @@ -837,7 +837,7 @@ public: GroupID new_g = id_g >= this->groups.size() ? INVALID_GROUP : this->groups[id_g]->index; if (this->group_sel != new_g && g->parent != new_g) { - Command::Post(STR_ERROR_GROUP_CAN_T_SET_PARENT, 0, this->group_sel | (1 << 16), new_g, {}); + Command::Post(STR_ERROR_GROUP_CAN_T_SET_PARENT, AlterGroupMode::SetParent, this->group_sel, new_g, {}); } this->group_sel = INVALID_GROUP; @@ -852,7 +852,7 @@ public: { switch (widget) { case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles - Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, 0, DEFAULT_GROUP, this->vehicle_sel | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), {}); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, DEFAULT_GROUP, this->vehicle_sel, _ctrl_pressed || this->grouping == GB_SHARED_ORDERS); this->vehicle_sel = INVALID_VEHICLE; this->group_over = INVALID_GROUP; @@ -869,7 +869,7 @@ public: uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; - Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), {}); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, 0, new_g, vindex, _ctrl_pressed || this->grouping == GB_SHARED_ORDERS); break; } @@ -924,7 +924,7 @@ public: void OnQueryTextFinished(char *str) override { - if (str != nullptr) Command::Post(STR_ERROR_GROUP_CAN_T_RENAME, 0, this->group_rename, 0, str); + if (str != nullptr) Command::Post(STR_ERROR_GROUP_CAN_T_RENAME, AlterGroupMode::Rename, this->group_rename, 0, str); this->group_rename = INVALID_GROUP; } @@ -961,12 +961,12 @@ public: case ADI_ADD_SHARED: // Add shared Vehicles assert(Group::IsValidID(this->vli.index)); - Command::Post(STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE, 0, this->vli.index, this->vli.vtype, {}); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE, this->vli.index, this->vli.vtype); break; case ADI_REMOVE_ALL: // Remove all Vehicles from the selected group assert(Group::IsValidID(this->vli.index)); - Command::Post(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, 0, this->vli.index, 0, {}); + Command::Post(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES, this->vli.index); break; default: NOT_REACHED(); } @@ -1161,10 +1161,10 @@ void CcCreateGroup(Commands cmd, const CommandCost &result, TileIndex tile, cons { if (result.Failed()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); - assert(p1 <= VEH_AIRCRAFT); + auto [vt, parent_group] = EndianBufferReader::ToValue::Args>(data); + assert(vt <= VEH_AIRCRAFT); - CcCreateGroup((VehicleType)p1); + CcCreateGroup(vt); } /** @@ -1178,10 +1178,10 @@ void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, TileIndex til { if (result.Failed()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); - assert(Vehicle::IsValidID(GB(p2, 0, 20))); + auto [group_id, veh_id, shared] = EndianBufferReader::ToValue::Args>(data); + assert(Vehicle::IsValidID(veh_id)); - CcCreateGroup(Vehicle::Get(GB(p2, 0, 20))->type); + CcCreateGroup(Vehicle::Get(veh_id)->type); } /** diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 1818029f22..46a55991da 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -90,7 +90,7 @@ void OrderBackup::DoRestore(Vehicle *v) if (v->cur_implicit_order_index >= v->GetNumOrders()) v->cur_implicit_order_index = v->cur_real_order_index; /* Restore vehicle group */ - Command::Do(DC_EXEC, 0, this->group, v->index, {}); + Command::Do(DC_EXEC, this->group, v->index, false); } /** diff --git a/src/script/api/script_group.cpp b/src/script/api/script_group.cpp index f4535c35e4..5047dc5c0e 100644 --- a/src/script/api/script_group.cpp +++ b/src/script/api/script_group.cpp @@ -31,7 +31,7 @@ /* static */ ScriptGroup::GroupID ScriptGroup::CreateGroup(ScriptVehicle::VehicleType vehicle_type, GroupID parent_group_id) { - if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnGroupID, 0, (::VehicleType)vehicle_type, parent_group_id, {})) return GROUP_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnGroupID, (::VehicleType)vehicle_type, parent_group_id)) return GROUP_INVALID; /* In case of test-mode, we return GroupID 0 */ return (ScriptGroup::GroupID)0; @@ -41,7 +41,7 @@ { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::Command::Do(0, group_id, 0, {}); + return ScriptObject::Command::Do(group_id); } /* static */ ScriptVehicle::VehicleType ScriptGroup::GetVehicleType(GroupID group_id) @@ -61,7 +61,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_GROUP_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::Command::Do(0, group_id, 0, text); + return ScriptObject::Command::Do(AlterGroupMode::Rename, group_id, 0, text); } /* static */ char *ScriptGroup::GetName(GroupID group_id) @@ -77,7 +77,7 @@ EnforcePrecondition(false, IsValidGroup(group_id)); EnforcePrecondition(false, IsValidGroup(parent_group_id)); - return ScriptObject::Command::Do(0, group_id | 1 << 16, parent_group_id, {}); + return ScriptObject::Command::Do(AlterGroupMode::SetParent, group_id, parent_group_id, {}); } /* static */ ScriptGroup::GroupID ScriptGroup::GetParent(GroupID group_id) @@ -92,7 +92,7 @@ { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::Command::Do(0, group_id | GroupFlags::GF_REPLACE_PROTECTION, enable ? 1 : 0, {}); + return ScriptObject::Command::Do(group_id, GroupFlags::GF_REPLACE_PROTECTION, enable, false); } /* static */ bool ScriptGroup::GetAutoReplaceProtection(GroupID group_id) @@ -123,7 +123,7 @@ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT); EnforcePrecondition(false, ScriptVehicle::IsValidVehicle(vehicle_id)); - return ScriptObject::Command::Do(0, group_id, vehicle_id, {}); + return ScriptObject::Command::Do(group_id, vehicle_id, false); } /* static */ bool ScriptGroup::EnableWagonRemoval(bool enable_removal) @@ -143,7 +143,7 @@ EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL); EnforcePrecondition(false, ScriptEngine::IsBuildable(engine_id_new)); - return ScriptObject::Command::Do(0, group_id << 16, (engine_id_new << 16) | engine_id_old, {}); + return ScriptObject::Command::Do(group_id, engine_id_old, engine_id_new, false); } /* static */ EngineID ScriptGroup::GetEngineReplacement(GroupID group_id, EngineID engine_id) @@ -157,7 +157,7 @@ { EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_DEFAULT || group_id == GROUP_ALL); - return ScriptObject::Command::Do(0, group_id << 16, (::INVALID_ENGINE << 16) | engine_id, {}); + return ScriptObject::Command::Do(group_id, engine_id, ::INVALID_ENGINE, false); } /* static */ Money ScriptGroup::GetProfitThisYear(GroupID group_id) @@ -207,14 +207,14 @@ { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::Command::Do(0, group_id, colour << 16, {}); + return ScriptObject::Command::Do(group_id, true, (::Colours)colour); } /* static */ bool ScriptGroup::SetSecondaryColour(GroupID group_id, ScriptCompany::Colours colour) { EnforcePrecondition(false, IsValidGroup(group_id)); - return ScriptObject::Command::Do(0, group_id, (1 << 8) | (colour << 16), {}); + return ScriptObject::Command::Do(group_id, false, (::Colours)colour); } /* static */ ScriptCompany::Colours ScriptGroup::GetPrimaryColour(GroupID group_id) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9a66053d33..d5d39b6e8d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1059,7 +1059,7 @@ void CallVehicleTicks() const Company *c = Company::Get(_current_company); SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, (Money)c->settings.engine_renew_money)); - CommandCost res = Command::Do(DC_EXEC, 0, v->index, 0, {}); + CommandCost res = Command::Do(DC_EXEC, v->index); SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, -(Money)c->settings.engine_renew_money)); if (!IsLocalCompany()) continue; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 100b309f90..2f6a01cab7 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -707,7 +707,7 @@ CommandCost CmdDepotMassAutoReplace(DoCommandFlag flags, TileIndex tile, Vehicle /* Ensure that the vehicle completely in the depot */ if (!v->IsChainInDepot()) continue; - CommandCost ret = Command::Do(flags, 0, v->index, 0, {}); + CommandCost ret = Command::Do(flags, v->index); if (ret.Succeeded()) cost.AddCost(ret); } @@ -891,7 +891,7 @@ CommandCost CmdCloneVehicle(DoCommandFlag flags, TileIndex tile, VehicleID veh_i if (flags & DC_EXEC) { /* Cloned vehicles belong to the same group */ - Command::Do(flags, 0, v_front->group_id, w_front->index, {}); + Command::Do(flags, v_front->group_id, w_front->index, false); } From 1a42a8a5d50e917a3b7158feadc70205cf912cba Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Wed, 17 Nov 2021 23:54:46 +0100 Subject: [PATCH 129/710] Codechange: Un-bitstuff town-related commands. --- src/cargotype.h | 2 +- src/script/api/script_town.cpp | 16 ++-- src/town_cmd.cpp | 140 ++++++++++++++------------------- src/town_cmd.h | 22 +++--- src/town_gui.cpp | 10 +-- src/town_type.h | 2 +- 6 files changed, 86 insertions(+), 106 deletions(-) diff --git a/src/cargotype.h b/src/cargotype.h index 22c1bf7f54..54d24f1d7a 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -23,7 +23,7 @@ typedef uint32 CargoLabel; /** Town growth effect when delivering cargo. */ -enum TownEffect { +enum TownEffect : byte { TE_BEGIN = 0, TE_NONE = TE_BEGIN, ///< Cargo has no effect. TE_PASSENGERS, ///< Cargo behaves passenger-like. diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp index e3fb26e893..78a1734441 100644 --- a/src/script/api/script_town.cpp +++ b/src/script/api/script_town.cpp @@ -52,7 +52,7 @@ } EnforcePrecondition(false, IsValidTown(town_id)); - return ScriptObject::Command::Do(0, town_id, 0, text != nullptr ? std::string{ text } : std::string{}); + return ScriptObject::Command::Do(town_id, text != nullptr ? std::string{ text } : std::string{}); } /* static */ bool ScriptTown::SetText(TownID town_id, Text *text) @@ -66,7 +66,7 @@ } EnforcePrecondition(false, IsValidTown(town_id)); - return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, 0, encoded_text != nullptr ? std::string{ encoded_text } : std::string{}); + return ScriptObject::Command::Do(town_id, encoded_text != nullptr ? std::string{ encoded_text } : std::string{}); } /* static */ int32 ScriptTown::GetPopulation(TownID town_id) @@ -134,7 +134,7 @@ EnforcePrecondition(false, IsValidTown(town_id)); EnforcePrecondition(false, ScriptCargo::IsValidTownEffect(towneffect_id)); - return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id | (towneffect_id << 16), goal, {}); + return ScriptObject::Command::Do(town_id, (::TownEffect)towneffect_id, goal); } /* static */ uint32 ScriptTown::GetCargoGoal(TownID town_id, ScriptCargo::TownEffect towneffect_id) @@ -177,7 +177,7 @@ break; } - return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, growth_rate, {}); + return ScriptObject::Command::Do(town_id, growth_rate); } /* static */ int32 ScriptTown::GetGrowthRate(TownID town_id) @@ -267,7 +267,7 @@ EnforcePrecondition(false, IsValidTown(town_id)); EnforcePrecondition(false, IsActionAvailable(town_id, town_action)); - return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, town_action, {}); + return ScriptObject::Command::Do(town_id, town_action); } /* static */ bool ScriptTown::ExpandTown(TownID town_id, int houses) @@ -276,7 +276,7 @@ EnforcePrecondition(false, IsValidTown(town_id)); EnforcePrecondition(false, houses > 0); - return ScriptObject::Command::Do(::Town::Get(town_id)->xy, town_id, houses, {}); + return ScriptObject::Command::Do(town_id, houses); } /* static */ bool ScriptTown::FoundTown(TileIndex tile, TownSize size, bool city, RoadLayout layout, Text *name) @@ -306,7 +306,7 @@ return false; } - return ScriptObject::Command::Do(tile, size | (city ? 1 << 2 : 0) | layout << 3, townnameparts, text != nullptr ? std::string{ text } : std::string{}); + return ScriptObject::Command::Do(tile, (::TownSize)size, city, (::TownLayout)layout, false, townnameparts, text != nullptr ? std::string{ text } : std::string{}); } /* static */ ScriptTown::TownRating ScriptTown::GetRating(TownID town_id, ScriptCompany::CompanyID company_id) @@ -361,7 +361,7 @@ uint16 p2 = 0; memcpy(&p2, &new_rating, sizeof(p2)); - return ScriptObject::Command::Do(0, town_id | (company_id << 16), p2, {}); + return ScriptObject::Command::Do(town_id, (::CompanyID)company_id, p2); } /* static */ int ScriptTown::GetAllowedNoise(TownID town_id) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 7a564d48ab..7ef07aa6aa 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1929,22 +1929,17 @@ static bool IsUniqueTownName(const std::string &name) * Create a new town. * @param flags type of operation * @param tile coordinates where town is built - * @param p1 0..1 size of the town (@see TownSize) - * 2 true iff it should be a city - * 3..5 town road layout (@see TownLayout) - * 6 use random location (randomize \c tile ) - * @param p2 town name parts + * @param size size of the town (@see TownSize) + * @param city true iff it should be a city + * @param layout town road layout (@see TownLayout) + * @param random_location use random location (randomize \c tile ) + * @param townnameparts town name parts * @param text Custom name for the town. If empty, the town name parts will be used. * @return the cost of this operation or an error */ -CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, TownSize size, bool city, TownLayout layout, bool random_location, uint32 townnameparts, const std::string &text) { - TownSize size = Extract(p1); - bool city = HasBit(p1, 2); - TownLayout layout = Extract(p1); TownNameParams par(_settings_game.game_creation.town_name); - bool random = HasBit(p1, 6); - uint32 townnameparts = p2; if (size >= TSZ_END) return CMD_ERROR; if (layout >= NUM_TLS) return CMD_ERROR; @@ -1953,11 +1948,11 @@ CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 if (_game_mode != GM_EDITOR && _current_company != OWNER_DEITY) { if (_settings_game.economy.found_town == TF_FORBIDDEN) return CMD_ERROR; if (size == TSZ_LARGE) return CMD_ERROR; - if (random) return CMD_ERROR; + if (random_location) return CMD_ERROR; if (_settings_game.economy.found_town != TF_CUSTOM_LAYOUT && layout != _settings_game.economy.town_layout) { return CMD_ERROR; } - } else if (_current_company == OWNER_DEITY && random) { + } else if (_current_company == OWNER_DEITY && random_location) { /* Random parameter is not allowed for Game Scripts. */ return CMD_ERROR; } @@ -1974,7 +1969,7 @@ CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /* Allocate town struct */ if (!Town::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_TOWNS); - if (!random) { + if (!random_location) { CommandCost ret = TownCanBePlacedHere(tile); if (ret.Failed()) return ret; } @@ -1998,7 +1993,7 @@ CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 Backup old_generating_world(_generating_world, true, FILE_LINE); UpdateNearestTownForRoadTiles(true); Town *t; - if (random) { + if (random_location) { t = CreateRandomTown(20, townnameparts, size, city, layout); if (t == nullptr) { cost = CommandCost(STR_ERROR_NO_SPACE_FOR_TOWN); @@ -2019,7 +2014,7 @@ CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 if (_game_mode != GM_EDITOR) { /* 't' can't be nullptr since 'random' is false outside scenedit */ - assert(!random); + assert(!random_location); if (_current_company == OWNER_DEITY) { SetDParam(0, t->index); @@ -2184,7 +2179,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size if (t->cache.population > 0) return t; Backup cur_company(_current_company, OWNER_TOWN, FILE_LINE); - [[maybe_unused]] CommandCost rc = Command::Do(DC_EXEC, t->xy, t->index, 0, {}); + [[maybe_unused]] CommandCost rc = Command::Do(DC_EXEC, t->index); cur_company.Restore(); assert(rc.Succeeded()); @@ -2740,15 +2735,13 @@ void ClearTownHouse(Town *t, TileIndex tile) /** * Rename a town (server-only). * @param flags type of operation - * @param tile unused - * @param p1 town ID to rename - * @param p2 unused + * @param town_id town ID to rename * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameTown(DoCommandFlag flags, TownID town_id, const std::string &text) { - Town *t = Town::GetIfValid(p1); + Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; bool reset = text.empty(); @@ -2793,21 +2786,19 @@ const CargoSpec *FindFirstCargoWithTownEffect(TownEffect effect) * @param flags Type of operation. * @param tile Unused. * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 15) - Town ID to cargo game of. - * - p1 = (bit 16 - 23) - TownEffect to change the game of. - * @param p2 The new goal value. + * @param town_id Town ID to cargo game of. + * @param te TownEffect to change the game of. + * @param goal The new goal value. * @param text Unused. * @return Empty cost or an error. */ -CommandCost CmdTownCargoGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownCargoGoal(DoCommandFlag flags, TownID town_id, TownEffect te, uint32 goal) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - TownEffect te = (TownEffect)GB(p1, 16, 8); if (te < TE_BEGIN || te >= TE_END) return CMD_ERROR; - uint16 index = GB(p1, 0, 16); - Town *t = Town::GetIfValid(index); + Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; /* Validate if there is a cargo which is the requested TownEffect */ @@ -2815,9 +2806,9 @@ CommandCost CmdTownCargoGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uin if (cargo == nullptr) return CMD_ERROR; if (flags & DC_EXEC) { - t->goal[te] = p2; + t->goal[te] = goal; UpdateTownGrowth(t); - InvalidateWindowData(WC_TOWN_VIEW, index); + InvalidateWindowData(WC_TOWN_VIEW, town_id); } return CommandCost(); @@ -2826,22 +2817,20 @@ CommandCost CmdTownCargoGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uin /** * Set a custom text in the Town window. * @param flags Type of operation. - * @param tile Unused. - * @param p1 Town ID to change the text of. - * @param p2 Unused. + * @param town_id Town ID to change the text of. * @param text The new text (empty to remove the text). * @return Empty cost or an error. */ -CommandCost CmdTownSetText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownSetText(DoCommandFlag flags, TownID town_id, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - Town *t = Town::GetIfValid(p1); + Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; if (flags & DC_EXEC) { t->text.clear(); if (!text.empty()) t->text = text; - InvalidateWindowData(WC_TOWN_VIEW, p1); + InvalidateWindowData(WC_TOWN_VIEW, town_id); } return CommandCost(); @@ -2850,38 +2839,35 @@ CommandCost CmdTownSetText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 /** * Change the growth rate of the town. * @param flags Type of operation. - * @param tile Unused. - * @param p1 Town ID to cargo game of. - * @param p2 Amount of days between growth, or TOWN_GROWTH_RATE_NONE, or 0 to reset custom growth rate. - * @param text Unused. + * @param town_id Town ID to cargo game of. + * @param growth_rate Amount of days between growth, or TOWN_GROWTH_RATE_NONE, or 0 to reset custom growth rate. * @return Empty cost or an error. */ -CommandCost CmdTownGrowthRate(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownGrowthRate(DoCommandFlag flags, TownID town_id, uint16 growth_rate) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - if (GB(p2, 16, 16) != 0) return CMD_ERROR; - Town *t = Town::GetIfValid(p1); + Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; if (flags & DC_EXEC) { - if (p2 == 0) { + if (growth_rate == 0) { /* Just clear the flag, UpdateTownGrowth will determine a proper growth rate */ ClrBit(t->flags, TOWN_CUSTOM_GROWTH); } else { uint old_rate = t->growth_rate; if (t->grow_counter >= old_rate) { /* This also catches old_rate == 0 */ - t->grow_counter = p2; + t->grow_counter = growth_rate; } else { /* Scale grow_counter, so half finished houses stay half finished */ - t->grow_counter = t->grow_counter * p2 / old_rate; + t->grow_counter = t->grow_counter * growth_rate / old_rate; } - t->growth_rate = p2; + t->growth_rate = growth_rate; SetBit(t->flags, TOWN_CUSTOM_GROWTH); } UpdateTownGrowth(t); - InvalidateWindowData(WC_TOWN_VIEW, p1); + InvalidateWindowData(WC_TOWN_VIEW, town_id); } return CommandCost(); @@ -2890,24 +2876,21 @@ CommandCost CmdTownGrowthRate(DoCommandFlag flags, TileIndex tile, uint32 p1, ui /** * Change the rating of a company in a town * @param flags Type of operation. - * @param tile Unused. - * @param p1 Bit 0..15 = Town ID to change, bit 16..23 = Company ID to change. - * @param p2 Bit 0..15 = New rating of company (signed int16). - * @param text Unused. + * @param town_id Town ID to change, bit 16..23 = + * @param company_id Company ID to change. + * @param rating New rating of company (signed int16). * @return Empty cost or an error. */ -CommandCost CmdTownRating(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTownRating(DoCommandFlag flags, TownID town_id, CompanyID company_id, int16 rating) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - TownID town_id = (TownID)GB(p1, 0, 16); Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; - CompanyID company_id = (CompanyID)GB(p1, 16, 8); if (!Company::IsValidID(company_id)) return CMD_ERROR; - int16 new_rating = Clamp((int16)GB(p2, 0, 16), RATING_MINIMUM, RATING_MAXIMUM); + int16 new_rating = Clamp(rating, RATING_MINIMUM, RATING_MAXIMUM); if (flags & DC_EXEC) { t->ratings[company_id] = new_rating; InvalidateWindowData(WC_TOWN_AUTHORITY, town_id); @@ -2919,21 +2902,19 @@ CommandCost CmdTownRating(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Expand a town (scenario editor only). * @param flags Type of operation. - * @param tile Unused. - * @param p1 Town ID to expand. - * @param p2 Amount to grow, or 0 to grow a random size up to the current amount of houses. - * @param text Unused. + * @param TownID Town ID to expand. + * @param grow_amount Amount to grow, or 0 to grow a random size up to the current amount of houses. * @return Empty cost or an error. */ -CommandCost CmdExpandTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdExpandTown(DoCommandFlag flags, TownID town_id, uint32 grow_amount) { if (_game_mode != GM_EDITOR && _current_company != OWNER_DEITY) return CMD_ERROR; - Town *t = Town::GetIfValid(p1); + Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; if (flags & DC_EXEC) { /* The more houses, the faster we grow */ - if (p2 == 0) { + if (grow_amount == 0) { uint amount = RandomRange(ClampToU16(t->cache.num_houses / 10)) + 3; t->cache.num_houses += amount; UpdateTownRadius(t); @@ -2943,7 +2924,7 @@ CommandCost CmdExpandTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 t->cache.num_houses -= amount; } else { - for (; p2 > 0; p2--) { + for (; grow_amount > 0; grow_amount--) { /* Try several times to grow, as we are really suppose to grow */ for (uint i = 0; i < 25; i++) if (GrowTown(t)) break; } @@ -2959,16 +2940,13 @@ CommandCost CmdExpandTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Delete a town (scenario editor or worldgen only). * @param flags Type of operation. - * @param tile Unused. - * @param p1 Town ID to delete. - * @param p2 Unused. - * @param text Unused. + * @param town_id Town ID to delete. * @return Empty cost or an error. */ -CommandCost CmdDeleteTown(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDeleteTown(DoCommandFlag flags, TownID town_id) { if (_game_mode != GM_EDITOR && !_generating_world) return CMD_ERROR; - Town *t = Town::GetIfValid(p1); + Town *t = Town::GetIfValid(town_id); if (t == nullptr) return CMD_ERROR; /* Stations refer to towns. */ @@ -3345,26 +3323,24 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t) * This performs an action such as advertising, building a statue, funding buildings, * but also bribing the town-council * @param flags type of operation - * @param tile unused - * @param p1 town to do the action at - * @param p2 action to perform, @see _town_action_proc for the list of available actions - * @param text unused + * @param town_id town to do the action at + * @param action action to perform, @see _town_action_proc for the list of available actions * @return the cost of this operation or an error */ -CommandCost CmdDoTownAction(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDoTownAction(DoCommandFlag flags, TownID town_id, uint8 action) { - Town *t = Town::GetIfValid(p1); - if (t == nullptr || p2 >= lengthof(_town_action_proc)) return CMD_ERROR; + Town *t = Town::GetIfValid(town_id); + if (t == nullptr || action >= lengthof(_town_action_proc)) return CMD_ERROR; - if (!HasBit(GetMaskOfTownActions(nullptr, _current_company, t), p2)) return CMD_ERROR; + if (!HasBit(GetMaskOfTownActions(nullptr, _current_company, t), action)) return CMD_ERROR; - CommandCost cost(EXPENSES_OTHER, _price[PR_TOWN_ACTION] * _town_action_costs[p2] >> 8); + CommandCost cost(EXPENSES_OTHER, _price[PR_TOWN_ACTION] * _town_action_costs[action] >> 8); - CommandCost ret = _town_action_proc[p2](t, flags); + CommandCost ret = _town_action_proc[action](t, flags); if (ret.Failed()) return ret; if (flags & DC_EXEC) { - SetWindowDirty(WC_TOWN_AUTHORITY, p1); + SetWindowDirty(WC_TOWN_AUTHORITY, town_id); } return cost; diff --git a/src/town_cmd.h b/src/town_cmd.h index 7842e7ddaa..4c9782e487 100644 --- a/src/town_cmd.h +++ b/src/town_cmd.h @@ -11,16 +11,20 @@ #define TOWN_CMD_H #include "command_type.h" +#include "company_type.h" +#include "town_type.h" -CommandProc CmdFoundTown; -CommandProc CmdRenameTown; -CommandProc CmdDoTownAction; -CommandProc CmdTownGrowthRate; -CommandProc CmdTownRating; -CommandProc CmdTownCargoGoal; -CommandProc CmdTownSetText; -CommandProc CmdExpandTown; -CommandProc CmdDeleteTown; +enum TownEffect : byte; + +CommandCost CmdFoundTown(DoCommandFlag flags, TileIndex tile, TownSize size, bool city, TownLayout layout, bool random_location, uint32 townnameparts, const std::string &text); +CommandCost CmdRenameTown(DoCommandFlag flags, TownID town_id, const std::string &text); +CommandCost CmdDoTownAction(DoCommandFlag flags, TownID town_id, uint8 action); +CommandCost CmdTownGrowthRate(DoCommandFlag flags, TownID town_id, uint16 growth_rate); +CommandCost CmdTownRating(DoCommandFlag flags, TownID town_id, CompanyID company_id, int16 rating); +CommandCost CmdTownCargoGoal(DoCommandFlag flags, TownID town_id, TownEffect te, uint32 goal); +CommandCost CmdTownSetText(DoCommandFlag flags, TownID town_id, const std::string &text); +CommandCost CmdExpandTown(DoCommandFlag flags, TownID town_id, uint32 grow_amount); +CommandCost CmdDeleteTown(DoCommandFlag flags, TownID town_id); DEF_CMD_TRAIT(CMD_FOUND_TOWN, CmdFoundTown, CMD_DEITY | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // founding random town can fail only in exec run DEF_CMD_TRAIT(CMD_RENAME_TOWN, CmdRenameTown, CMD_DEITY | CMD_SERVER, CMDT_OTHER_MANAGEMENT) diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 6e955e103e..90aa588552 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -288,7 +288,7 @@ public: } case WID_TA_EXECUTE: - Command::Post(STR_ERROR_CAN_T_DO_THIS, this->town->xy, this->window_number, this->sel_index, {}); + Command::Post(STR_ERROR_CAN_T_DO_THIS, this->town->xy, this->window_number, this->sel_index); break; } } @@ -475,12 +475,12 @@ public: _warn_town_no_roads = true; } - Command::Post(STR_ERROR_CAN_T_EXPAND_TOWN, 0, this->window_number, 0, {}); + Command::Post(STR_ERROR_CAN_T_EXPAND_TOWN, this->window_number, 0); break; } case WID_TV_DELETE: // delete town - only available on Scenario editor - Command::Post(STR_ERROR_TOWN_CAN_T_DELETE, 0, this->window_number, 0, {}); + Command::Post(STR_ERROR_TOWN_CAN_T_DELETE, this->window_number); break; } } @@ -562,7 +562,7 @@ public: { if (str == nullptr) return; - Command::Post(STR_ERROR_CAN_T_RENAME_TOWN, 0, this->window_number, 0, str); + Command::Post(STR_ERROR_CAN_T_RENAME_TOWN, this->window_number, str); } }; @@ -1164,7 +1164,7 @@ public: } bool success = Command::Post(errstr, cc, - tile, this->town_size | this->city << 2 | this->town_layout << 3 | random << 6, townnameparts, name); + tile, this->town_size, this->city, this->town_layout, random, townnameparts, name); /* Rerandomise name, if success and no cost-estimation. */ if (success && !_shift_pressed) this->RandomTownName(); diff --git a/src/town_type.h b/src/town_type.h index f373a3c043..3ea1a4e983 100644 --- a/src/town_type.h +++ b/src/town_type.h @@ -16,7 +16,7 @@ typedef uint16 TownID; struct Town; /** Supported initial town sizes */ -enum TownSize { +enum TownSize : byte { TSZ_SMALL, ///< Small town. TSZ_MEDIUM, ///< Medium town. TSZ_LARGE, ///< Large town. From e6e69d528921ab731c4c38ee708ff31b7055fd27 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 20 Nov 2021 22:30:56 +0100 Subject: [PATCH 130/710] Codechange: Un-bitstuff goal and story page commands. --- src/goal.cpp | 115 +++++++++++---------------- src/goal_cmd.h | 16 ++-- src/goal_gui.cpp | 6 +- src/script/api/script_goal.cpp | 16 ++-- src/script/api/script_story_page.cpp | 17 ++-- src/story.cpp | 93 +++++++--------------- src/story_cmd.h | 22 ++--- src/story_gui.cpp | 6 +- src/story_type.h | 1 + 9 files changed, 119 insertions(+), 173 deletions(-) diff --git a/src/goal.cpp b/src/goal.cpp index a60853829d..99322ec2cf 100644 --- a/src/goal.cpp +++ b/src/goal.cpp @@ -36,49 +36,44 @@ INSTANTIATE_POOL_METHODS(Goal) /** * Create a new goal. * @param flags type of operation - * @param tile unused. - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 7) - GoalType of destination. - * - p1 = (bit 8 - 15) - Company for which this goal is. - * @param p2 GoalTypeID of destination. + * @param company Company for which this goal is. + * @param type GoalType of destination. + * @param dest GoalTypeID of destination. * @param text Text of the goal. * @return the cost of this operation or an error */ -CommandCost CmdCreateGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateGoal(DoCommandFlag flags, CompanyID company, GoalType type, GoalTypeID dest, const std::string &text) { if (!Goal::CanAllocateItem()) return CMD_ERROR; - GoalType type = (GoalType)GB(p1, 0, 8); - CompanyID company = (CompanyID)GB(p1, 8, 8); - if (_current_company != OWNER_DEITY) return CMD_ERROR; if (text.empty()) return CMD_ERROR; if (company != INVALID_COMPANY && !Company::IsValidID(company)) return CMD_ERROR; switch (type) { case GT_NONE: - if (p2 != 0) return CMD_ERROR; + if (dest != 0) return CMD_ERROR; break; case GT_TILE: - if (!IsValidTile(p2)) return CMD_ERROR; + if (!IsValidTile(dest)) return CMD_ERROR; break; case GT_INDUSTRY: - if (!Industry::IsValidID(p2)) return CMD_ERROR; + if (!Industry::IsValidID(dest)) return CMD_ERROR; break; case GT_TOWN: - if (!Town::IsValidID(p2)) return CMD_ERROR; + if (!Town::IsValidID(dest)) return CMD_ERROR; break; case GT_COMPANY: - if (!Company::IsValidID(p2)) return CMD_ERROR; + if (!Company::IsValidID(dest)) return CMD_ERROR; break; case GT_STORY_PAGE: { - if (!StoryPage::IsValidID(p2)) return CMD_ERROR; - CompanyID story_company = StoryPage::Get(p2)->company; + if (!StoryPage::IsValidID(dest)) return CMD_ERROR; + CompanyID story_company = StoryPage::Get(dest)->company; if (company == INVALID_COMPANY ? story_company != INVALID_COMPANY : story_company != INVALID_COMPANY && story_company != company) return CMD_ERROR; break; } @@ -89,7 +84,7 @@ CommandCost CmdCreateGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 if (flags & DC_EXEC) { Goal *g = new Goal(); g->type = type; - g->dst = p2; + g->dst = dest; g->company = company; g->text = stredup(text.c_str()); g->progress = nullptr; @@ -111,19 +106,16 @@ CommandCost CmdCreateGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Remove a goal. * @param flags type of operation - * @param tile unused. - * @param p1 GoalID to remove. - * @param p2 unused. - * @param text unused. + * @param goal GoalID to remove. * @return the cost of this operation or an error */ -CommandCost CmdRemoveGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveGoal(DoCommandFlag flags, GoalID goal) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - if (!Goal::IsValidID(p1)) return CMD_ERROR; + if (!Goal::IsValidID(goal)) return CMD_ERROR; if (flags & DC_EXEC) { - Goal *g = Goal::Get(p1); + Goal *g = Goal::Get(goal); CompanyID c = g->company; delete g; @@ -141,20 +133,18 @@ CommandCost CmdRemoveGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 /** * Update goal text of a goal. * @param flags type of operation - * @param tile unused. - * @param p1 GoalID to update. - * @param p2 unused + * @param goal GoalID to update. * @param text Text of the goal. * @return the cost of this operation or an error */ -CommandCost CmdSetGoalText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGoalText(DoCommandFlag flags, GoalID goal, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - if (!Goal::IsValidID(p1)) return CMD_ERROR; + if (!Goal::IsValidID(goal)) return CMD_ERROR; if (text.empty()) return CMD_ERROR; if (flags & DC_EXEC) { - Goal *g = Goal::Get(p1); + Goal *g = Goal::Get(goal); free(g->text); g->text = stredup(text.c_str()); @@ -171,19 +161,17 @@ CommandCost CmdSetGoalText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 /** * Update progress text of a goal. * @param flags type of operation - * @param tile unused. - * @param p1 GoalID to update. - * @param p2 unused + * @param goal GoalID to update. * @param text Progress text of the goal. * @return the cost of this operation or an error */ -CommandCost CmdSetGoalProgress(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGoalProgress(DoCommandFlag flags, GoalID goal, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - if (!Goal::IsValidID(p1)) return CMD_ERROR; + if (!Goal::IsValidID(goal)) return CMD_ERROR; if (flags & DC_EXEC) { - Goal *g = Goal::Get(p1); + Goal *g = Goal::Get(goal); free(g->progress); if (text.empty()) { g->progress = nullptr; @@ -204,20 +192,18 @@ CommandCost CmdSetGoalProgress(DoCommandFlag flags, TileIndex tile, uint32 p1, u /** * Update completed state of a goal. * @param flags type of operation - * @param tile unused. - * @param p1 GoalID to update. - * @param p2 completed state. If goal is completed, set to 1, otherwise 0. - * @param text unused + * @param goal GoalID to update. + * @param completed completed state of goal. * @return the cost of this operation or an error */ -CommandCost CmdSetGoalCompleted(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetGoalCompleted(DoCommandFlag flags, GoalID goal, bool completed) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - if (!Goal::IsValidID(p1)) return CMD_ERROR; + if (!Goal::IsValidID(goal)) return CMD_ERROR; if (flags & DC_EXEC) { - Goal *g = Goal::Get(p1); - g->completed = p2 == 1; + Goal *g = Goal::Get(goal); + g->completed = completed; if (g->company == INVALID_COMPANY) { InvalidateWindowClassesData(WC_GOALS_LIST); @@ -232,27 +218,21 @@ CommandCost CmdSetGoalCompleted(DoCommandFlag flags, TileIndex tile, uint32 p1, /** * Ask a goal related question * @param flags type of operation - * @param tile unused. - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 15) - Unique ID to use for this question. - * - p1 = (bit 16 - 31) - Company or client for which this question is. - * @param p2 various bitstuffed elements - * - p2 = (bit 0 - 17) - Buttons of the question. - * - p2 = (bit 29 - 30) - Question type. - * - p2 = (bit 31) - Question target: 0 - company, 1 - client. + * @param uniqueid Unique ID to use for this question. + * @param target Company or client for which this question is. + * @param is_client Question target: false - company, true - client. + * @param button_mask Buttons of the question. + * @param type Question type. * @param text Text of the question. * @return the cost of this operation or an error */ -CommandCost CmdGoalQuestion(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdGoalQuestion(DoCommandFlag flags, uint16 uniqueid, uint16 target, bool is_client, uint32 button_mask, GoalQuestionType type, const std::string &text) { - uint16 uniqueid = (uint16)GB(p1, 0, 16); - CompanyID company = (CompanyID)GB(p1, 16, 8); - ClientID client = (ClientID)GB(p1, 16, 16); + CompanyID company = (CompanyID)target; + ClientID client = (ClientID)target; static_assert(GOAL_QUESTION_BUTTON_COUNT < 29); - uint32 button_mask = GB(p2, 0, GOAL_QUESTION_BUTTON_COUNT); - byte type = GB(p2, 29, 2); - bool is_client = HasBit(p2, 31); + button_mask &= (1U << GOAL_QUESTION_BUTTON_COUNT) - 1; if (_current_company != OWNER_DEITY) return CMD_ERROR; if (text.empty()) return CMD_ERROR; @@ -284,31 +264,28 @@ CommandCost CmdGoalQuestion(DoCommandFlag flags, TileIndex tile, uint32 p1, uint /** * Reply to a goal question. * @param flags type of operation - * @param tile unused. - * @param p1 Unique ID to use for this question. - * @param p2 Button the company pressed - * @param text Text of the question. + * @param uniqueid Unique ID to use for this question. + * @param button Button the company pressed * @return the cost of this operation or an error */ -CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, uint16 uniqueid, uint8 button) { - if (p1 > UINT16_MAX) return CMD_ERROR; - if (p2 >= GOAL_QUESTION_BUTTON_COUNT) return CMD_ERROR; + if (button >= GOAL_QUESTION_BUTTON_COUNT) return CMD_ERROR; if (_current_company == OWNER_DEITY) { /* It has been requested to close this specific question on all clients */ - if (flags & DC_EXEC) CloseWindowById(WC_GOAL_QUESTION, p1); + if (flags & DC_EXEC) CloseWindowById(WC_GOAL_QUESTION, uniqueid); return CommandCost(); } if (_networking && _local_company == _current_company) { /* Somebody in the same company answered the question. Close the window */ - if (flags & DC_EXEC) CloseWindowById(WC_GOAL_QUESTION, p1); + if (flags & DC_EXEC) CloseWindowById(WC_GOAL_QUESTION, uniqueid); if (!_network_server) return CommandCost(); } if (flags & DC_EXEC) { - Game::NewEvent(new ScriptEventGoalQuestionAnswer(p1, (ScriptCompany::CompanyID)(byte)_current_company, (ScriptGoal::QuestionButton)(1 << p2))); + Game::NewEvent(new ScriptEventGoalQuestionAnswer(uniqueid, (ScriptCompany::CompanyID)(byte)_current_company, (ScriptGoal::QuestionButton)(1 << button))); } return CommandCost(); diff --git a/src/goal_cmd.h b/src/goal_cmd.h index 3b047f11ac..5c3e4954f8 100644 --- a/src/goal_cmd.h +++ b/src/goal_cmd.h @@ -11,14 +11,16 @@ #define GOAL_CMD_H #include "command_type.h" +#include "command_type.h" +#include "goal_type.h" -CommandProc CmdCreateGoal; -CommandProc CmdRemoveGoal; -CommandProc CmdSetGoalText; -CommandProc CmdSetGoalProgress; -CommandProc CmdSetGoalCompleted; -CommandProc CmdGoalQuestion; -CommandProc CmdGoalQuestionAnswer; +CommandCost CmdCreateGoal(DoCommandFlag flags, CompanyID company, GoalType type, GoalTypeID dest, const std::string &text); +CommandCost CmdRemoveGoal(DoCommandFlag flags, GoalID goal); +CommandCost CmdSetGoalText(DoCommandFlag flags, GoalID goal, const std::string &text); +CommandCost CmdSetGoalProgress(DoCommandFlag flags, GoalID goal, const std::string &text); +CommandCost CmdSetGoalCompleted(DoCommandFlag flags, GoalID goal, bool completed); +CommandCost CmdGoalQuestion(DoCommandFlag flags, uint16 uniqueid, uint16 target, bool is_client, uint32 button_mask, GoalQuestionType type, const std::string &text); +CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, uint16 uniqueid, uint8 button); DEF_CMD_TRAIT(CMD_CREATE_GOAL, CmdCreateGoal, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) DEF_CMD_TRAIT(CMD_REMOVE_GOAL, CmdRemoveGoal, CMD_DEITY, CMDT_OTHER_MANAGEMENT) diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index ef63197d54..639901ee5b 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -383,17 +383,17 @@ struct GoalQuestionWindow : public Window { { switch (widget) { case WID_GQ_BUTTON_1: - Command::Post(0, this->window_number, this->button[0], {}); + Command::Post(this->window_number, this->button[0]); this->Close(); break; case WID_GQ_BUTTON_2: - Command::Post(0, this->window_number, this->button[1], {}); + Command::Post(this->window_number, this->button[1]); this->Close(); break; case WID_GQ_BUTTON_3: - Command::Post(0, this->window_number, this->button[2], {}); + Command::Post(this->window_number, this->button[2]); this->Close(); break; } diff --git a/src/script/api/script_goal.cpp b/src/script/api/script_goal.cpp index dbc2c51e01..70f040dd45 100644 --- a/src/script/api/script_goal.cpp +++ b/src/script/api/script_goal.cpp @@ -38,7 +38,7 @@ EnforcePreconditionEncodedText(GOAL_INVALID, text); EnforcePrecondition(GOAL_INVALID, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID); - uint8 c = company; + CompanyID c = (::CompanyID)company; if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; StoryPage *story_page = nullptr; if (type == GT_STORY_PAGE && ScriptStoryPage::IsValidStoryPage((ScriptStoryPage::StoryPageID)destination)) story_page = ::StoryPage::Get((ScriptStoryPage::StoryPageID)destination); @@ -50,7 +50,7 @@ (type == GT_COMPANY && ScriptCompany::ResolveCompanyID((ScriptCompany::CompanyID)destination) != ScriptCompany::COMPANY_INVALID) || (type == GT_STORY_PAGE && story_page != nullptr && (c == INVALID_COMPANY ? story_page->company == INVALID_COMPANY : story_page->company == INVALID_COMPANY || story_page->company == c))); - if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnGoalID, 0, type | (c << 8), destination, text)) return GOAL_INVALID; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnGoalID, c, (::GoalType)type, destination, text)) return GOAL_INVALID; /* In case of test-mode, we return GoalID 0 */ return (ScriptGoal::GoalID)0; @@ -61,7 +61,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, IsValidGoal(goal_id)); - return ScriptObject::Command::Do(0, goal_id, 0, {}); + return ScriptObject::Command::Do(goal_id); } /* static */ bool ScriptGoal::SetText(GoalID goal_id, Text *goal) @@ -73,7 +73,7 @@ EnforcePrecondition(false, goal != nullptr); EnforcePrecondition(false, !StrEmpty(goal->GetEncodedText())); - return ScriptObject::Command::Do(0, goal_id, 0, goal->GetEncodedText()); + return ScriptObject::Command::Do(goal_id, goal->GetEncodedText()); } /* static */ bool ScriptGoal::SetProgress(GoalID goal_id, Text *progress) @@ -88,7 +88,7 @@ progress = nullptr; } - return ScriptObject::Command::Do(0, goal_id, 0, progress != nullptr ? std::string{ progress->GetEncodedText() } : std::string{}); + return ScriptObject::Command::Do(goal_id, progress != nullptr ? std::string{ progress->GetEncodedText() } : std::string{}); } /* static */ bool ScriptGoal::SetCompleted(GoalID goal_id, bool completed) @@ -96,7 +96,7 @@ EnforcePrecondition(false, IsValidGoal(goal_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::Command::Do(0, goal_id, completed ? 1 : 0, {}); + return ScriptObject::Command::Do(goal_id, completed); } /* static */ bool ScriptGoal::IsCompleted(GoalID goal_id) @@ -121,7 +121,7 @@ EnforcePrecondition(false, buttons < (1 << ::GOAL_QUESTION_BUTTON_COUNT)); EnforcePrecondition(false, (int)type < ::GQT_END); - return ScriptObject::Command::Do(0, uniqueid | (target << 16), buttons | (type << 29) | (is_client ? (1 << 31) : 0), text); + return ScriptObject::Command::Do(uniqueid, target, is_client, buttons, (::GoalQuestionType)type, text); } /* static */ bool ScriptGoal::Question(uint16 uniqueid, ScriptCompany::CompanyID company, Text *question, QuestionType type, int buttons) @@ -146,5 +146,5 @@ { EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::Command::Do(0, uniqueid, 0, {}); + return ScriptObject::Command::Do(uniqueid, 0); } diff --git a/src/script/api/script_story_page.cpp b/src/script/api/script_story_page.cpp index afa2590414..f767472e02 100644 --- a/src/script/api/script_story_page.cpp +++ b/src/script/api/script_story_page.cpp @@ -49,10 +49,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnStoryPageID, - 0, - c, - 0, - title != nullptr ? std::string{ title->GetEncodedText() } : std::string{})) return STORY_PAGE_INVALID; + (::CompanyID)c, title != nullptr ? std::string{ title->GetEncodedText() } : std::string{})) return STORY_PAGE_INVALID; /* In case of test-mode, we return StoryPageID 0 */ return (ScriptStoryPage::StoryPageID)0; @@ -91,7 +88,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnStoryPageElementID, reftile, - story_page_id + (type << 16), + (::StoryPageID)story_page_id, (::StoryPageElementType)type, refid, StoryPageElementTypeRequiresText(btype) ? std::string{ text->GetEncodedText() } : std::string{})) return STORY_PAGE_ELEMENT_INVALID; @@ -160,7 +157,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, IsValidStoryPage(story_page_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::Command::Do(0, story_page_id, 0, title != nullptr ? std::string{ title->GetEncodedText() } : std::string{}); + return ScriptObject::Command::Do(story_page_id, title != nullptr ? std::string{ title->GetEncodedText() } : std::string{}); } /* static */ ScriptCompany::CompanyID ScriptStoryPage::GetCompany(StoryPageID story_page_id) @@ -186,7 +183,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, IsValidStoryPage(story_page_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::Command::Do(0, story_page_id, date, {}); + return ScriptObject::Command::Do(story_page_id, date); } @@ -195,7 +192,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, IsValidStoryPage(story_page_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - return ScriptObject::Command::Do(0, story_page_id, 0, {}); + return ScriptObject::Command::Do(story_page_id); } /* static */ bool ScriptStoryPage::Remove(StoryPageID story_page_id) @@ -203,7 +200,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, IsValidStoryPage(story_page_id)); - return ScriptObject::Command::Do(0, story_page_id, 0, {}); + return ScriptObject::Command::Do(story_page_id); } /* static */ bool ScriptStoryPage::RemoveElement(StoryPageElementID story_page_element_id) @@ -211,7 +208,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, IsValidStoryPageElement(story_page_element_id)); - return ScriptObject::Command::Do(0, story_page_element_id, 0, {}); + return ScriptObject::Command::Do(story_page_element_id); } /* static */ ScriptStoryPage::StoryPageButtonFormatting ScriptStoryPage::MakePushButtonReference(StoryPageButtonColour colour, StoryPageButtonFlags flags) diff --git a/src/story.cpp b/src/story.cpp index 24b09ade5d..259bfbd615 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -198,19 +198,14 @@ bool StoryPageButtonData::ValidateVehicleType() const /** * Create a new story page. * @param flags type of operation - * @param tile unused. - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 7) - Company for which this story page belongs to. - * @param p2 unused. + * @param company Company for which this story page belongs to. * @param text Title of the story page. Null is allowed in which case a generic page title is provided by OpenTTD. * @return the cost of this operation or an error */ -CommandCost CmdCreateStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateStoryPage(DoCommandFlag flags, CompanyID company, const std::string &text) { if (!StoryPage::CanAllocateItem()) return CMD_ERROR; - CompanyID company = (CompanyID)GB(p1, 0, 8); - if (_current_company != OWNER_DEITY) return CMD_ERROR; if (company != INVALID_COMPANY && !Company::IsValidID(company)) return CMD_ERROR; @@ -244,20 +239,16 @@ CommandCost CmdCreateStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, u * Create a new story page element. * @param flags type of operation * @param tile Tile location if it is a location page element, otherwise unused. - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 15) - The page which the element belongs to. - * (bit 16 - 23) - Page element type - * @param p2 Id of referenced object + * @param page_id The page which the element belongs to. + * @param type Page element type + * @param reference Id of referenced object * @param text Text content in case it is a text or location page element * @return the cost of this operation or an error */ -CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, StoryPageID page_id, StoryPageElementType type, uint32 reference, const std::string &text) { if (!StoryPageElement::CanAllocateItem()) return CMD_ERROR; - StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); - StoryPageElementType type = Extract(p1); - /* Allow at most 128 elements per page. */ uint16 element_count = 0; for (StoryPageElement *iter : StoryPageElement::Iterate()) { @@ -267,7 +258,7 @@ CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint3 if (_current_company != OWNER_DEITY) return CMD_ERROR; if (!StoryPage::IsValidID(page_id)) return CMD_ERROR; - if (!VerifyElementContentParameters(page_id, type, tile, p2, text.c_str())) return CMD_ERROR; + if (!VerifyElementContentParameters(page_id, type, tile, reference, text.c_str())) return CMD_ERROR; if (flags & DC_EXEC) { if (_story_page_element_pool.items == 0) { @@ -279,7 +270,7 @@ CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint3 pe->sort_value = _story_page_element_next_sort_value; pe->type = type; pe->page = page_id; - UpdateElement(*pe, tile, p2, text.c_str()); + UpdateElement(*pe, tile, reference, text.c_str()); InvalidateWindowClassesData(WC_STORY_BOOK, page_id); @@ -294,17 +285,13 @@ CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint3 * Update a new story page element. * @param flags type of operation * @param tile Tile location if it is a location page element, otherwise unused. - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 15) - The page element to update. - * (bit 16 - 31) - unused - * @param p2 Id of referenced object + * @param page_element_id The page element to update. + * @param reference Id of referenced object * @param text Text content in case it is a text or location page element * @return the cost of this operation or an error */ -CommandCost CmdUpdateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdUpdateStoryPageElement(DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, uint32 reference, const std::string &text) { - StoryPageElementID page_element_id = (StoryPageElementID)GB(p1, 0, 16); - if (_current_company != OWNER_DEITY) return CMD_ERROR; if (!StoryPageElement::IsValidID(page_element_id)) return CMD_ERROR; @@ -312,10 +299,10 @@ CommandCost CmdUpdateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint3 StoryPageID page_id = pe->page; StoryPageElementType type = pe->type; - if (!VerifyElementContentParameters(page_id, type, tile, p2, text.c_str())) return CMD_ERROR; + if (!VerifyElementContentParameters(page_id, type, tile, reference, text.c_str())) return CMD_ERROR; if (flags & DC_EXEC) { - UpdateElement(*pe, tile, p2, text.c_str()); + UpdateElement(*pe, tile, reference, text.c_str()); InvalidateWindowClassesData(WC_STORY_BOOK, pe->page); } @@ -325,16 +312,13 @@ CommandCost CmdUpdateStoryPageElement(DoCommandFlag flags, TileIndex tile, uint3 /** * Update title of a story page. * @param flags type of operation - * @param tile unused. - * @param p1 = (bit 0 - 15) - StoryPageID to update. - * @param p2 unused + * @param page_id StoryPageID to update. * @param text title text of the story page. * @return the cost of this operation or an error */ -CommandCost CmdSetStoryPageTitle(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetStoryPageTitle(DoCommandFlag flags, StoryPageID page_id, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); if (!StoryPage::IsValidID(page_id)) return CMD_ERROR; if (flags & DC_EXEC) { @@ -355,18 +339,14 @@ CommandCost CmdSetStoryPageTitle(DoCommandFlag flags, TileIndex tile, uint32 p1, /** * Update date of a story page. * @param flags type of operation - * @param tile unused. - * @param p1 = (bit 0 - 15) - StoryPageID to update. - * @param p2 = (bit 0 - 31) - date - * @param text unused + * @param page_id StoryPageID to update. + * @param date date * @return the cost of this operation or an error */ -CommandCost CmdSetStoryPageDate(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetStoryPageDate(DoCommandFlag flags, StoryPageID page_id, Date date) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); if (!StoryPage::IsValidID(page_id)) return CMD_ERROR; - Date date = (Date)p2; if (flags & DC_EXEC) { StoryPage *p = StoryPage::Get(page_id); @@ -382,16 +362,12 @@ CommandCost CmdSetStoryPageDate(DoCommandFlag flags, TileIndex tile, uint32 p1, * Display a story page for all clients that are allowed to * view the story page. * @param flags type of operation - * @param tile unused. - * @param p1 = (bit 0 - 15) - StoryPageID to show. - * @param p2 unused - * @param text unused + * @param page_id StoryPageID to show. * @return the cost of this operation or an error */ -CommandCost CmdShowStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdShowStoryPage(DoCommandFlag flags, StoryPageID page_id) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - StoryPageID page_id = (StoryPageID)GB(p1, 0, 16); if (!StoryPage::IsValidID(page_id)) return CMD_ERROR; if (flags & DC_EXEC) { @@ -404,16 +380,12 @@ CommandCost CmdShowStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uin /** * Remove a story page and associated story page elements. * @param flags type of operation - * @param tile unused. - * @param p1 = (bit 0 - 15) - StoryPageID to remove. - * @param p2 unused. - * @param text unused. + * @param page_id StoryPageID to remove. * @return the cost of this operation or an error */ -CommandCost CmdRemoveStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveStoryPage(DoCommandFlag flags, StoryPageID page_id) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - StoryPageID page_id = (StoryPageID)p1; if (!StoryPage::IsValidID(page_id)) return CMD_ERROR; if (flags & DC_EXEC) { @@ -437,16 +409,12 @@ CommandCost CmdRemoveStoryPage(DoCommandFlag flags, TileIndex tile, uint32 p1, u /** * Remove a story page element * @param flags type of operation - * @param tile unused. - * @param p1 = (bit 0 - 15) - StoryPageElementID to remove. - * @param p2 unused. - * @param text unused. + * @param page_element_id StoryPageElementID to remove. * @return the cost of this operation or an error */ -CommandCost CmdRemoveStoryPageElement(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRemoveStoryPageElement(DoCommandFlag flags, StoryPageElementID page_element_id) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - StoryPageElementID page_element_id = (StoryPageElementID)p1; if (!StoryPageElement::IsValidID(page_element_id)) return CMD_ERROR; if (flags & DC_EXEC) { @@ -465,15 +433,12 @@ CommandCost CmdRemoveStoryPageElement(DoCommandFlag flags, TileIndex tile, uint3 * Clicked/used a button on a story page. * @param flags Type of operation. * @param tile Tile selected, for tile selection buttons, otherwise unused. - * @param p1 Bit 0..15 = story page element id of button. - * @param p2 ID of selected item for buttons that select an item (e.g. vehicle), otherwise unused. - * @param text Unused. + * @param page_element_id story page element id of button. + * @param reference ID of selected item for buttons that select an item (e.g. vehicle), otherwise unused. * @return The cost of the operation, or an error. */ -CommandCost CmdStoryPageButton(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdStoryPageButton(DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference) { - StoryPageElementID page_element_id = (StoryPageElementID)GB(p1, 0, 16); - if (!StoryPageElement::IsValidID(page_element_id)) return CMD_ERROR; const StoryPageElement *const pe = StoryPageElement::Get(page_element_id); @@ -491,8 +456,8 @@ CommandCost CmdStoryPageButton(DoCommandFlag flags, TileIndex tile, uint32 p1, u if (flags & DC_EXEC) Game::NewEvent(new ScriptEventStoryPageTileSelect(_current_company, pe->page, page_element_id, tile)); break; case SPET_BUTTON_VEHICLE: - if (!Vehicle::IsValidID(p2)) return CMD_ERROR; - if (flags & DC_EXEC) Game::NewEvent(new ScriptEventStoryPageVehicleSelect(_current_company, pe->page, page_element_id, (VehicleID)p2)); + if (!Vehicle::IsValidID(reference)) return CMD_ERROR; + if (flags & DC_EXEC) Game::NewEvent(new ScriptEventStoryPageVehicleSelect(_current_company, pe->page, page_element_id, reference)); break; default: /* Invalid page element type, not a button. */ diff --git a/src/story_cmd.h b/src/story_cmd.h index a7323ec6bf..9dbfd412a3 100644 --- a/src/story_cmd.h +++ b/src/story_cmd.h @@ -11,16 +11,20 @@ #define STORY_CMD_H #include "command_type.h" +#include "company_type.h" +#include "date_type.h" +#include "story_type.h" +#include "vehicle_type.h" -CommandProc CmdCreateStoryPage; -CommandProc CmdCreateStoryPageElement; -CommandProc CmdUpdateStoryPageElement; -CommandProc CmdSetStoryPageTitle; -CommandProc CmdSetStoryPageDate; -CommandProc CmdShowStoryPage; -CommandProc CmdRemoveStoryPage; -CommandProc CmdRemoveStoryPageElement; -CommandProc CmdStoryPageButton; +CommandCost CmdCreateStoryPage(DoCommandFlag flags, CompanyID company, const std::string &text); +CommandCost CmdCreateStoryPageElement(DoCommandFlag flags, TileIndex tile, StoryPageID page_id, StoryPageElementType type, uint32 reference, const std::string &text); +CommandCost CmdUpdateStoryPageElement(DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, uint32 reference, const std::string &text); +CommandCost CmdSetStoryPageTitle(DoCommandFlag flags, StoryPageID page_id, const std::string &text); +CommandCost CmdSetStoryPageDate(DoCommandFlag flags, StoryPageID page_id, Date date); +CommandCost CmdShowStoryPage(DoCommandFlag flags, StoryPageID page_id); +CommandCost CmdRemoveStoryPage(DoCommandFlag flags, StoryPageID page_id); +CommandCost CmdRemoveStoryPageElement(DoCommandFlag flags, StoryPageElementID page_element_id); +CommandCost CmdStoryPageButton(DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference); DEF_CMD_TRAIT(CMD_CREATE_STORY_PAGE, CmdCreateStoryPage, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) DEF_CMD_TRAIT(CMD_CREATE_STORY_PAGE_ELEMENT, CmdCreateStoryPageElement, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 21dba8fd1a..b456b39e9a 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -567,7 +567,7 @@ protected: this->SetTimeout(); this->SetWidgetDirty(WID_SB_PAGE_PANEL); - Command::Post(0, pe.index, 0, {}); + Command::Post(0, pe.index, 0); break; case SPET_BUTTON_TILE: @@ -922,7 +922,7 @@ public: return; } - Command::Post(tile, pe->index, 0, {}); + Command::Post(tile, pe->index, 0); ResetObjectToPlace(); } @@ -941,7 +941,7 @@ public: VehicleType wanted_vehtype = data.GetVehicleType(); if (wanted_vehtype != VEH_INVALID && wanted_vehtype != v->type) return false; - Command::Post(0, pe->index, v->index, {}); + Command::Post(0, pe->index, v->index); ResetObjectToPlace(); return true; } diff --git a/src/story_type.h b/src/story_type.h index 1dce00008b..e919564a7f 100644 --- a/src/story_type.h +++ b/src/story_type.h @@ -16,6 +16,7 @@ typedef uint16 StoryPageElementID; ///< ID of a story page element typedef uint16 StoryPageID; ///< ID of a story page struct StoryPageElement; struct StoryPage; +enum StoryPageElementType : byte; extern StoryPageElementID _new_story_page_element_id; extern StoryPageID _new_story_page_id; From c6d7b98808575f31103121528565ed252a3cfc6c Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 21 Nov 2021 23:02:29 +0100 Subject: [PATCH 131/710] Codechange: Un-bitstuff landscape commands. --- src/clear_cmd.cpp | 2 +- src/disaster_vehicle.cpp | 4 ++-- src/industry_cmd.cpp | 14 +++++------ src/landscape.cpp | 25 ++++++++----------- src/landscape_cmd.h | 4 ++-- src/map_type.h | 2 +- src/misc_gui.cpp | 2 +- src/object_cmd.cpp | 12 +++++----- src/rail_cmd.cpp | 10 ++++---- src/road_cmd.cpp | 12 +++++----- src/script/api/script_airport.cpp | 2 +- src/script/api/script_bridge.cpp | 2 +- src/script/api/script_marine.cpp | 10 ++++---- src/script/api/script_road.cpp | 2 +- src/script/api/script_tile.cpp | 8 +++---- src/script/api/script_tunnel.cpp | 2 +- src/slope_type.h | 2 +- src/station_cmd.cpp | 14 +++++------ src/terraform_cmd.cpp | 40 ++++++++++++++----------------- src/terraform_cmd.h | 6 +++-- src/terraform_gui.cpp | 24 +++++++++---------- src/town_cmd.cpp | 32 ++++++++++++------------- src/tree_cmd.cpp | 4 ++-- src/tunnelbridge_cmd.cpp | 16 ++++++------- src/water_cmd.cpp | 22 ++++++++--------- src/waypoint_cmd.cpp | 2 +- 26 files changed, 134 insertions(+), 141 deletions(-) diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index f2f7ecc197..17711a6267 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -382,7 +382,7 @@ static void ChangeTileOwner_Clear(TileIndex tile, Owner old_owner, Owner new_own static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } extern const TileTypeProcs _tile_type_clear_procs = { diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index 6319af0ab2..668a1caea5 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -62,7 +62,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_RAILWAY: if (Company::IsHumanID(GetTileOwner(tile)) && !IsRailDepot(tile)) { Backup cur_company(_current_company, OWNER_WATER, FILE_LINE); - Command::Do(DC_EXEC, tile, 0, 0, {}); + Command::Do(DC_EXEC, tile); cur_company.Restore(); /* update signals in buffer */ @@ -72,7 +72,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_HOUSE: { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - Command::Do(DC_EXEC, tile, 0, 0, {}); + Command::Do(DC_EXEC, tile); cur_company.Restore(); break; } diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index b7d6d3714c..2c45a84729 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1103,7 +1103,7 @@ static bool SearchLumberMillTrees(TileIndex tile, void *user_data) _industry_sound_tile = tile; if (_settings_client.sound.ambient) SndPlayTileFx(SND_38_LUMBER_MILL_1, tile); - Command::Do(DC_EXEC, tile, 0, 0, {}); + Command::Do(DC_EXEC, tile); cur_company.Restore(); return true; @@ -1485,13 +1485,13 @@ static CommandCost CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTil /* Clear the tiles as OWNER_TOWN to not affect town rating, and to not clear protected buildings */ Backup cur_company(_current_company, OWNER_TOWN, FILE_LINE); - CommandCost ret = Command::Do(DC_NONE, cur_tile, 0, 0, {}); + CommandCost ret = Command::Do(DC_NONE, cur_tile); cur_company.Restore(); if (ret.Failed()) return ret; } else { /* Clear the tiles, but do not affect town ratings */ - CommandCost ret = Command::Do(DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, cur_tile, 0, 0, {}); + CommandCost ret = Command::Do(DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, cur_tile); if (ret.Failed()) return ret; } @@ -1601,7 +1601,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, } /* This is not 100% correct check, but the best we can do without modifying the map. * What is missing, is if the difference in height is more than 1.. */ - if (Command::Do(flags & ~DC_EXEC, tile_walk, SLOPE_N, (curh > h) ? 0 : 1, {}).Failed()) { + if (Command::Do(flags & ~DC_EXEC, tile_walk, SLOPE_N, curh <= h).Failed()) { cur_company.Restore(); return false; } @@ -1616,7 +1616,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, /* We give the terraforming for free here, because we can't calculate * exact cost in the test-round, and as we all know, that will cause * a nice assert if they don't match ;) */ - Command::Do(flags, tile_walk, SLOPE_N, (curh > h) ? 0 : 1, {}); + Command::Do(flags, tile_walk, SLOPE_N, curh <= h); curh += (curh > h) ? -1 : 1; } } @@ -1886,7 +1886,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, WaterClass wc = (IsWaterTile(cur_tile) ? GetWaterClass(cur_tile) : WATER_CLASS_INVALID); - Command::Do(DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, cur_tile, 0, 0, {}); + Command::Do(DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, cur_tile); MakeIndustry(cur_tile, i->index, it.gfx, Random(), wc); @@ -3062,7 +3062,7 @@ static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, i } } } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } extern const TileTypeProcs _tile_type_industry_procs = { diff --git a/src/landscape.cpp b/src/landscape.cpp index 6efa8dba29..43bc238ac9 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -686,12 +686,9 @@ void ClearSnowLine() * Clear a piece of landscape * @param flags of operation to conduct * @param tile tile to clear - * @param p1 unused - * @param p2 unused - * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdLandscapeClear(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdLandscapeClear(DoCommandFlag flags, TileIndex tile) { CommandCost cost(EXPENSES_CONSTRUCTION); bool do_clear = false; @@ -735,15 +732,13 @@ CommandCost CmdLandscapeClear(DoCommandFlag flags, TileIndex tile, uint32 p1, ui * Clear a big piece of landscape * @param flags of operation to conduct * @param tile end tile of area dragging - * @param p1 start tile of area dragging - * @param p2 various bitstuffed data. - * bit 0: Whether to use the Orthogonal (0) or Diagonal (1) iterator. - * @param text unused + * @param start_tile start tile of area dragging + * @param diagonal Whether to use the Orthogonal (false) or Diagonal (true) iterator. * @return the cost of this operation or an error */ -CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal) { - if (p1 >= MapSize()) return CMD_ERROR; + if (start_tile >= MapSize()) return CMD_ERROR; Money money = GetAvailableMoneyForCommand(); CommandCost cost(EXPENSES_CONSTRUCTION); @@ -753,10 +748,10 @@ CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 const Company *c = (flags & (DC_AUTO | DC_BANKRUPT)) ? nullptr : Company::GetIfValid(_current_company); int limit = (c == nullptr ? INT32_MAX : GB(c->clear_limit, 16, 16)); - TileIterator *iter = HasBit(p2, 0) ? (TileIterator *)new DiagonalTileIterator(tile, p1) : new OrthogonalTileIterator(tile, p1); + TileIterator *iter = diagonal ? (TileIterator *)new DiagonalTileIterator(tile, start_tile) : new OrthogonalTileIterator(tile, start_tile); for (; *iter != INVALID_TILE; ++(*iter)) { TileIndex t = *iter; - CommandCost ret = Command::Do(flags & ~DC_EXEC, t, 0, 0, {}); + CommandCost ret = Command::Do(flags & ~DC_EXEC, t); if (ret.Failed()) { last_error = ret; @@ -773,14 +768,14 @@ CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 delete iter; return cost; } - Command::Do(flags, t, 0, 0, {}); + Command::Do(flags, t); /* draw explosion animation... * Disable explosions when game is paused. Looks silly and blocks the view. */ - if ((t == tile || t == p1) && _pause_mode == PM_UNPAUSED) { + if ((t == tile || t == start_tile) && _pause_mode == PM_UNPAUSED) { /* big explosion in two corners, or small explosion for single tiles */ CreateEffectVehicleAbove(TileX(t) * TILE_SIZE + TILE_SIZE / 2, TileY(t) * TILE_SIZE + TILE_SIZE / 2, 2, - TileX(tile) == TileX(p1) && TileY(tile) == TileY(p1) ? EV_EXPLOSION_SMALL : EV_EXPLOSION_LARGE + TileX(tile) == TileX(start_tile) && TileY(tile) == TileY(start_tile) ? EV_EXPLOSION_SMALL : EV_EXPLOSION_LARGE ); } } else { diff --git a/src/landscape_cmd.h b/src/landscape_cmd.h index f3b6fd3fca..5af2787231 100644 --- a/src/landscape_cmd.h +++ b/src/landscape_cmd.h @@ -12,8 +12,8 @@ #include "command_type.h" -CommandProc CmdLandscapeClear; -CommandProc CmdClearArea; +CommandCost CmdLandscapeClear(DoCommandFlag flags, TileIndex tile); +CommandCost CmdClearArea(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal); DEF_CMD_TRAIT(CMD_LANDSCAPE_CLEAR, CmdLandscapeClear, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_CLEAR_AREA, CmdClearArea, CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // destroying multi-tile houses makes town rating differ between test and execution diff --git a/src/map_type.h b/src/map_type.h index f34f137c64..f0fae28a6c 100644 --- a/src/map_type.h +++ b/src/map_type.h @@ -78,7 +78,7 @@ static const uint MAX_MAP_SIZE = 1 << MAX_MAP_SIZE_BITS; ///< Maximal map s #define STRAIGHT_TRACK_LENGTH 7071/10000 /** Argument for CmdLevelLand describing what to do. */ -enum LevelMode { +enum LevelMode : byte { LM_LEVEL, ///< Level the land. LM_LOWER, ///< Lower the land. LM_RAISE, ///< Raise the land. diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index b2e8b886e0..bc5179f82f 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -192,7 +192,7 @@ public: Company *c = Company::GetIfValid(_local_company); if (c != nullptr) { assert(_current_company == _local_company); - CommandCost costclear = Command::Do(DC_QUERY_COST, tile, 0, 0, {}); + CommandCost costclear = Command::Do(DC_QUERY_COST, tile); if (costclear.Succeeded()) { Money cost = costclear.GetCost(); if (cost < 0) { diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index a651239baf..9968424e0a 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -231,7 +231,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 if (type == OBJECT_OWNED_LAND) { /* Owned land is special as it can be placed on any slope. */ - cost.AddCost(Command::Do(flags, tile, 0, 0, {})); + cost.AddCost(Command::Do(flags, tile)); } else { /* Check the surface to build on. At this time we can't actually execute the * the CLEAR_TILE commands since the newgrf callback later on can check @@ -244,7 +244,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 if (!IsWaterTile(t)) { /* Normal water tiles don't have to be cleared. For all other tile types clear * the tile but leave the water. */ - cost.AddCost(Command::Do(flags & ~DC_NO_WATER & ~DC_EXEC, t, 0, 0, {})); + cost.AddCost(Command::Do(flags & ~DC_NO_WATER & ~DC_EXEC, t)); } else { /* Can't build on water owned by another company. */ Owner o = GetTileOwner(t); @@ -262,7 +262,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 IsTileType(t, MP_OBJECT) && IsTileOwner(t, _current_company) && IsObjectType(t, OBJECT_HQ))) { - cost.AddCost(Command::Do(flags & ~DC_EXEC, t, 0, 0, {})); + cost.AddCost(Command::Do(flags & ~DC_EXEC, t)); } } } @@ -294,10 +294,10 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3 for (TileIndex t : ta) { if (HasTileWaterGround(t)) { if (!IsWaterTile(t)) { - Command::Do((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, t, 0, 0, {}); + Command::Do((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, t); } } else { - Command::Do(flags | DC_NO_MODIFY_TOWN_RATING, t, 0, 0, {}); + Command::Do(flags | DC_NO_MODIFY_TOWN_RATING, t); } } } @@ -849,7 +849,7 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, int } } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } extern const TileTypeProcs _tile_type_object_procs = { diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 35c58a1d74..ee36afb039 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -448,7 +448,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType rai CommandCost ret = CheckTileOwnership(tile); if (ret.Failed()) return ret; - if (!IsPlainRail(tile)) return Command::Do(flags, tile, 0, 0, {}); // just get appropriate error message + if (!IsPlainRail(tile)) return Command::Do(flags, tile); // just get appropriate error message if (!IsCompatibleRail(GetRailType(tile), railtype)) return_cmd_error(STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION); @@ -578,7 +578,7 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType rai if (ret.Failed()) return ret; cost.AddCost(ret); - ret = Command::Do(flags, tile, 0, 0, {}); + ret = Command::Do(flags, tile); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -987,7 +987,7 @@ CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType rai cost.AddCost(_price[PR_BUILD_FOUNDATION]); } - cost.AddCost(Command::Do(flags, tile, 0, 0, {})); + cost.AddCost(Command::Do(flags, tile)); if (cost.Failed()) return cost; if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -2882,7 +2882,7 @@ static void ChangeTileOwner_Track(TileIndex tile, Owner old_owner, Owner new_own SetTileOwner(tile, new_owner); } else { - Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); + Command::Do(DC_EXEC | DC_BANKRUPT, tile); } } @@ -3070,7 +3070,7 @@ static CommandCost TerraformTile_Track(TileIndex tile, DoCommandFlag flags, int AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRailDepotDirection(tile))) { return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index e160a2b842..8cf07e8d61 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -369,7 +369,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec if (!IsTileType(tile, MP_ROAD)) { /* If it's the last roadtype, just clear the whole tile */ - if (GetRoadType(tile, OtherRoadTramType(rtt)) == INVALID_ROADTYPE) return Command::Do(flags, tile, 0, 0, {}); + if (GetRoadType(tile, OtherRoadTramType(rtt)) == INVALID_ROADTYPE) return Command::Do(flags, tile); CommandCost cost(EXPENSES_CONSTRUCTION); if (IsTileType(tile, MP_TUNNELBRIDGE)) { @@ -817,7 +817,7 @@ do_clear:; } if (need_to_clear) { - CommandCost ret = Command::Do(flags, tile, 0, 0, {}); + CommandCost ret = Command::Do(flags, tile); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -1153,7 +1153,7 @@ CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, RoadType rt, cost.AddCost(_price[PR_BUILD_FOUNDATION]); } - cost.AddCost(Command::Do(flags, tile, 0, 0, {})); + cost.AddCost(Command::Do(flags, tile)); if (cost.Failed()) return cost; if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); @@ -1239,7 +1239,7 @@ static CommandCost ClearTile_Road(TileIndex tile, DoCommandFlag flags) } if (flags & DC_EXEC) { - Command::Do(flags, tile, 0, 0, {}); + Command::Do(flags, tile); } return ret; } @@ -2167,7 +2167,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne if (IsRoadDepot(tile)) { if (GetTileOwner(tile) == old_owner) { if (new_owner == INVALID_OWNER) { - Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); + Command::Do(DC_EXEC | DC_BANKRUPT, tile); } else { /* A road depot has two road bits. No need to dirty windows here, we'll redraw the whole screen anyway. */ RoadType rt = GetRoadTypeRoad(tile); @@ -2253,7 +2253,7 @@ static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, int z } } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } /** Update power of road vehicle under which is the roadtype being converted */ diff --git a/src/script/api/script_airport.cpp b/src/script/api/script_airport.cpp index 8ed4dbfcac..4416a4bcda 100644 --- a/src/script/api/script_airport.cpp +++ b/src/script/api/script_airport.cpp @@ -86,7 +86,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)) EnforcePrecondition(false, IsAirportTile(tile) || IsHangarTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ int32 ScriptAirport::GetNumHangars(TileIndex tile) diff --git a/src/script/api/script_bridge.cpp b/src/script/api/script_bridge.cpp index fbea9fb127..b0fda24128 100644 --- a/src/script/api/script_bridge.cpp +++ b/src/script/api/script_bridge.cpp @@ -121,7 +121,7 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance) { EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsBridgeTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ char *ScriptBridge::GetName(BridgeID bridge_id, ScriptVehicle::VehicleType vehicle_type) diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp index 059157e276..ba5163e49e 100644 --- a/src/script/api/script_marine.cpp +++ b/src/script/api/script_marine.cpp @@ -125,7 +125,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsWaterDepotTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptMarine::RemoveDock(TileIndex tile) @@ -134,7 +134,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsDockTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptMarine::RemoveBuoy(TileIndex tile) @@ -143,7 +143,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsBuoyTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptMarine::RemoveLock(TileIndex tile) @@ -152,7 +152,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsLockTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptMarine::RemoveCanal(TileIndex tile) @@ -161,7 +161,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsCanalTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ Money ScriptMarine::GetBuildCost(BuildType build_type) diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp index 297a8f56c1..cae144a871 100644 --- a/src/script/api/script_road.cpp +++ b/src/script/api/script_road.cpp @@ -593,7 +593,7 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD EnforcePrecondition(false, IsTileType(tile, MP_ROAD)) EnforcePrecondition(false, GetRoadTileType(tile) == ROAD_TILE_DEPOT); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptRoad::RemoveRoadStation(TileIndex tile) diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp index 9e67b074a2..8be74c0304 100644 --- a/src/script/api/script_tile.cpp +++ b/src/script/api/script_tile.cpp @@ -255,7 +255,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, tile < ::MapSize()); - return ScriptObject::Command::Do(tile, slope, 1, {}); + return ScriptObject::Command::Do(tile, (::Slope)slope, true); } /* static */ bool ScriptTile::LowerTile(TileIndex tile, int32 slope) @@ -263,7 +263,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, tile < ::MapSize()); - return ScriptObject::Command::Do(tile, slope, 0, {}); + return ScriptObject::Command::Do(tile, (::Slope)slope, false); } /* static */ bool ScriptTile::LevelTiles(TileIndex start_tile, TileIndex end_tile) @@ -272,14 +272,14 @@ EnforcePrecondition(false, start_tile < ::MapSize()); EnforcePrecondition(false, end_tile < ::MapSize()); - return ScriptObject::Command::Do(end_tile, start_tile, LM_LEVEL << 1, {}); + return ScriptObject::Command::Do(end_tile, start_tile, false, LM_LEVEL); } /* static */ bool ScriptTile::DemolishTile(TileIndex tile) { EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } /* static */ bool ScriptTile::PlantTree(TileIndex tile) diff --git a/src/script/api/script_tunnel.cpp b/src/script/api/script_tunnel.cpp index 8529f908db..04c182c1fb 100644 --- a/src/script/api/script_tunnel.cpp +++ b/src/script/api/script_tunnel.cpp @@ -126,5 +126,5 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance) EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, IsTunnelTile(tile)); - return ScriptObject::Command::Do(tile, 0, 0, {}); + return ScriptObject::Command::Do(tile); } diff --git a/src/slope_type.h b/src/slope_type.h index a2c51bd19e..ea2ed1aca5 100644 --- a/src/slope_type.h +++ b/src/slope_type.h @@ -45,7 +45,7 @@ enum Corner { * slopes would mean that it is not a steep slope as halftile * slopes only span one height level. */ -enum Slope { +enum Slope : byte { SLOPE_FLAT = 0x00, ///< a flat tile SLOPE_W = 0x01, ///< the west corner of the tile is raised SLOPE_S = 0x02, ///< the south corner of the tile is raised diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 6424a73e15..b0603485df 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -845,7 +845,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo if (ret.Failed()) return ret; cost.AddCost(ret); - ret = Command::Do(flags, tile_iter, 0, 0, {}); + ret = Command::Do(flags, tile_iter); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -932,7 +932,7 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl continue; } } - ret = Command::Do(flags, tile_cur, 0, 0, {}); + ret = Command::Do(flags, tile_cur); if (ret.Failed()) return ret; cost.AddCost(ret); } @@ -1050,7 +1050,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags cost.AddCost(RoadBuildCost(rt) * 2); } } else { - ret = Command::Do(flags, cur_tile, 0, 0, {}); + ret = Command::Do(flags, cur_tile); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(RoadBuildCost(rt) * 2); @@ -2489,7 +2489,7 @@ CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_ if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]); - ret = Command::Do(flags, tile, 0, 0, {}); + ret = Command::Do(flags, tile); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -2504,7 +2504,7 @@ CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_ /* Get the water class of the water tile before it is cleared.*/ WaterClass wc = GetWaterClass(tile_cur); - ret = Command::Do(flags, tile_cur, 0, 0, {}); + ret = Command::Do(flags, tile_cur); if (ret.Failed()) return ret; tile_cur += TileOffsByDiagDir(direction); @@ -4197,7 +4197,7 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o /* Change owner of tile and all roadtypes */ ChangeTileOwner(tile, old_owner, new_owner); } else { - Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); + Command::Do(DC_EXEC | DC_BANKRUPT, tile); /* Set tile owner of water under (now removed) buoy and dock to OWNER_NONE. * Update owner of buoy if it was not removed (was in orders). * Do not update when owned by OWNER_WATER (sea and rivers). */ @@ -4314,7 +4314,7 @@ static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, in } } } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } /** diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index df178e3abf..e4f6b141a9 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -182,42 +182,41 @@ static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int * Terraform land * @param flags for this command type * @param tile tile to terraform - * @param p1 corners to terraform (SLOPE_xxx) - * @param p2 direction; eg up (non-zero) or down (zero) - * @param text unused + * @param slope corners to terraform (SLOPE_xxx) + * @param dir_up direction; eg up (true) or down (false) * @return the cost of this operation or an error */ -CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up) { _terraform_err_tile = INVALID_TILE; CommandCost total_cost(EXPENSES_CONSTRUCTION); - int direction = (p2 != 0 ? 1 : -1); + int direction = (dir_up ? 1 : -1); TerraformerState ts; /* Compute the costs and the terraforming result in a model of the landscape */ - if ((p1 & SLOPE_W) != 0 && tile + TileDiffXY(1, 0) < MapSize()) { + if ((slope & SLOPE_W) != 0 && tile + TileDiffXY(1, 0) < MapSize()) { TileIndex t = tile + TileDiffXY(1, 0); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); if (cost.Failed()) return cost; total_cost.AddCost(cost); } - if ((p1 & SLOPE_S) != 0 && tile + TileDiffXY(1, 1) < MapSize()) { + if ((slope & SLOPE_S) != 0 && tile + TileDiffXY(1, 1) < MapSize()) { TileIndex t = tile + TileDiffXY(1, 1); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); if (cost.Failed()) return cost; total_cost.AddCost(cost); } - if ((p1 & SLOPE_E) != 0 && tile + TileDiffXY(0, 1) < MapSize()) { + if ((slope & SLOPE_E) != 0 && tile + TileDiffXY(0, 1) < MapSize()) { TileIndex t = tile + TileDiffXY(0, 1); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); if (cost.Failed()) return cost; total_cost.AddCost(cost); } - if ((p1 & SLOPE_N) != 0) { + if ((slope & SLOPE_N) != 0) { TileIndex t = tile + TileDiffXY(0, 0); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); if (cost.Failed()) return cost; @@ -291,7 +290,7 @@ CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uin } CommandCost cost; if (indirectly_cleared) { - cost = Command::Do(tile_flags, t, 0, 0, {}); + cost = Command::Do(tile_flags, t); } else { cost = _tile_type_procs[GetTileType(t)]->terraform_tile_proc(t, tile_flags, z_min, tileh); } @@ -337,25 +336,22 @@ CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uin * Levels a selected (rectangle) area of land * @param flags for this command type * @param tile end tile of area-drag - * @param p1 start tile of area drag - * @param p2 various bitstuffed data. - * bit 0: Whether to use the Orthogonal (0) or Diagonal (1) iterator. - * bits 1 - 2: Mode of leveling \c LevelMode. - * @param text unused + * @param start_tile start tile of area drag + * @param diagonal Whether to use the Orthogonal (false) or Diagonal (true) iterator. + * @param LevelMode Mode of leveling \c LevelMode. * @return the cost of this operation or an error */ -CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm) { - if (p1 >= MapSize()) return CMD_ERROR; + if (start_tile >= MapSize()) return CMD_ERROR; _terraform_err_tile = INVALID_TILE; /* remember level height */ - uint oldh = TileHeight(p1); + uint oldh = TileHeight(start_tile); /* compute new height */ uint h = oldh; - LevelMode lm = (LevelMode)GB(p2, 1, 2); switch (lm) { case LM_LEVEL: break; case LM_RAISE: h++; break; @@ -375,12 +371,12 @@ CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 int limit = (c == nullptr ? INT32_MAX : GB(c->terraform_limit, 16, 16)); if (limit == 0) return_cmd_error(STR_ERROR_TERRAFORM_LIMIT_REACHED); - TileIterator *iter = HasBit(p2, 0) ? (TileIterator *)new DiagonalTileIterator(tile, p1) : new OrthogonalTileIterator(tile, p1); + TileIterator *iter = diagonal ? (TileIterator *)new DiagonalTileIterator(tile, start_tile) : new OrthogonalTileIterator(tile, start_tile); for (; *iter != INVALID_TILE; ++(*iter)) { TileIndex t = *iter; uint curh = TileHeight(t); while (curh != h) { - CommandCost ret = Command::Do(flags & ~DC_EXEC, t, SLOPE_N, (curh > h) ? 0 : 1, {}); + CommandCost ret = Command::Do(flags & ~DC_EXEC, t, SLOPE_N, curh <= h); if (ret.Failed()) { last_error = ret; @@ -396,7 +392,7 @@ CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 delete iter; return cost; } - Command::Do(flags, t, SLOPE_N, (curh > h) ? 0 : 1, {}); + Command::Do(flags, t, SLOPE_N, curh <= h); } else { /* When we're at the terraform limit we better bail (unneeded) testing as well. * This will probably cause the terraforming cost to be underestimated, but only diff --git a/src/terraform_cmd.h b/src/terraform_cmd.h index 9b5866efaf..861e0d9949 100644 --- a/src/terraform_cmd.h +++ b/src/terraform_cmd.h @@ -11,9 +11,11 @@ #define TERRAFORM_CMD_H #include "command_type.h" +#include "map_type.h" +#include "slope_type.h" -CommandProc CmdTerraformLand; -CommandProc CmdLevelLand; +CommandCost CmdTerraformLand(DoCommandFlag flags, TileIndex tile, Slope slope, bool dir_up); +CommandCost CmdLevelLand(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm); DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_LEVEL_LAND, CmdLevelLand, CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 7399d6ffa2..c12f10dedc 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -65,7 +65,7 @@ static void GenerateDesertArea(TileIndex end, TileIndex start) TileArea ta(start, end); for (TileIndex tile : ta) { SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT); - Command::Post(tile, 0, 0, {}); + Command::Post(tile); MarkTileDirtyByTile(tile); } old_generating_world.Restore(); @@ -120,16 +120,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - Command::Post(STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed ? 1 : 0, {}); + Command::Post(STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed); break; case DDSP_RAISE_AND_LEVEL_AREA: - Command::Post(STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0), {}); + Command::Post(STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, _ctrl_pressed, LM_RAISE); break; case DDSP_LOWER_AND_LEVEL_AREA: - Command::Post(STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LOWER << 1 | (_ctrl_pressed ? 1 : 0), {}); + Command::Post(STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, _ctrl_pressed, LM_LOWER); break; case DDSP_LEVEL_AREA: - Command::Post(STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, LM_LEVEL << 1 | (_ctrl_pressed ? 1 : 0), {}); + Command::Post(STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, _ctrl_pressed, LM_LEVEL); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -392,15 +392,15 @@ static byte _terraform_size = 1; * @todo : Incorporate into game itself to allow for ingame raising/lowering of * larger chunks at the same time OR remove altogether, as we have 'level land' ? * @param tile The top-left tile where the terraforming will start - * @param mode 1 for raising, 0 for lowering land + * @param mode true for raising, false for lowering land */ -static void CommonRaiseLowerBigLand(TileIndex tile, int mode) +static void CommonRaiseLowerBigLand(TileIndex tile, bool mode) { if (_terraform_size == 1) { StringID msg = mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE; - Command::Post(msg, CcTerraform, tile, SLOPE_N, (uint32)mode, {}); + Command::Post(msg, CcTerraform, tile, SLOPE_N, mode); } else { assert(_terraform_size != 0); TileArea ta(tile, _terraform_size, _terraform_size); @@ -427,7 +427,7 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) for (TileIndex tile2 : ta) { if (TileHeight(tile2) == h) { - Command::Post(tile2, SLOPE_N, (uint32)mode, {}); + Command::Post(tile2, SLOPE_N, mode); } } } @@ -516,7 +516,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed) /* Delete all station signs */ for (BaseStation *st : BaseStation::Iterate()) { /* There can be buoys, remove them */ - if (IsBuoyTile(st->xy)) Command::Do(DC_EXEC | DC_BANKRUPT, st->xy, 0, 0, {}); + if (IsBuoyTile(st->xy)) Command::Do(DC_EXEC | DC_BANKRUPT, st->xy); if (!st->IsInUse()) delete st; } @@ -659,11 +659,11 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { break; case WID_ETT_LOWER_LAND: // Lower land button - CommonRaiseLowerBigLand(tile, 0); + CommonRaiseLowerBigLand(tile, false); break; case WID_ETT_RAISE_LAND: // Raise land button - CommonRaiseLowerBigLand(tile, 1); + CommonRaiseLowerBigLand(tile, true); break; case WID_ETT_LEVEL_LAND: // Level land button diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 7ef07aa6aa..ea5a81eb7b 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -944,7 +944,7 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) * This is to make sure that we can build a road here later. */ RoadType rt = GetTownRoadType(t); if (Command::Do(DC_AUTO | DC_NO_WATER, tile, (dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X, rt, DRD_NONE, 0).Failed() && - Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Failed()) { + Command::Do(DC_AUTO | DC_NO_WATER, tile).Failed()) { return false; } } @@ -962,7 +962,7 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) if (!_generating_world && Chance16(1, 10)) { /* Note: Do not replace "^ SLOPE_ELEVATED" with ComplementSlope(). The slope might be steep. */ res = Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, - tile, Chance16(1, 16) ? cur_slope : cur_slope ^ SLOPE_ELEVATED, 0, {}); + tile, Chance16(1, 16) ? cur_slope : cur_slope ^ SLOPE_ELEVATED, false); } if (res.Failed() && Chance16(1, 3)) { /* We can consider building on the slope, though. */ @@ -974,13 +974,13 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) return ret; } -static bool TerraformTownTile(TileIndex tile, int edges, int dir) +static bool TerraformTownTile(TileIndex tile, Slope edges, bool dir) { assert(tile < MapSize()); - CommandCost r = Command::Do(DC_AUTO | DC_NO_WATER, tile, edges, dir, {}); + CommandCost r = Command::Do(DC_AUTO | DC_NO_WATER, tile, edges, dir); if (r.Failed() || r.GetCost() >= (_price[PR_TERRAFORM] + 2) * 8) return false; - Command::Do(DC_AUTO | DC_NO_WATER | DC_EXEC, tile, edges, dir, {}); + Command::Do(DC_AUTO | DC_NO_WATER | DC_EXEC, tile, edges, dir); return true; } @@ -994,8 +994,8 @@ static void LevelTownLand(TileIndex tile) if (tileh == SLOPE_FLAT) return; /* First try up, then down */ - if (!TerraformTownTile(tile, ~tileh & SLOPE_ELEVATED, 1)) { - TerraformTownTile(tile, tileh & SLOPE_ELEVATED, 0); + if (!TerraformTownTile(tile, ~tileh & SLOPE_ELEVATED, true)) { + TerraformTownTile(tile, tileh & SLOPE_ELEVATED, false); } } @@ -1737,7 +1737,7 @@ static bool GrowTown(Town *t) for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) { /* Only work with plain land that not already has a house */ if (!IsTileType(tile, MP_HOUSE) && IsTileFlat(tile)) { - if (Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Succeeded()) { + if (Command::Do(DC_AUTO | DC_NO_WATER, tile).Succeeded()) { RoadType rt = GetTownRoadType(t); Command::Do(DC_EXEC | DC_AUTO, tile, GenRandomRoadBits(), rt, DRD_NONE, t->index); cur_company.Restore(); @@ -2280,7 +2280,7 @@ HouseZonesBits GetTownRadiusGroup(const Town *t, TileIndex tile) */ static inline void ClearMakeHouseTile(TileIndex tile, Town *t, byte counter, byte stage, HouseID type, byte random_bits) { - [[maybe_unused]] CommandCost cc = Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, tile, 0, 0, {}); + [[maybe_unused]] CommandCost cc = Command::Do(DC_EXEC | DC_AUTO | DC_NO_WATER, tile); assert(cc.Succeeded()); IncreaseBuildingCount(t, type); @@ -2337,7 +2337,7 @@ static inline bool CanBuildHouseHere(TileIndex tile, bool noslope) if (IsBridgeAbove(tile)) return false; /* can we clear the land? */ - return Command::Do(DC_AUTO | DC_NO_WATER, tile, 0, 0, {}).Succeeded(); + return Command::Do(DC_AUTO | DC_NO_WATER, tile).Succeeded(); } @@ -2955,7 +2955,7 @@ CommandCost CmdDeleteTown(DoCommandFlag flags, TownID town_id) /* Non-oil rig stations are always a problem. */ if (!(st->facilities & FACIL_AIRPORT) || st->airport.type != AT_OILRIG) return CMD_ERROR; /* We can only automatically delete oil rigs *if* there's no vehicle on them. */ - CommandCost ret = Command::Do(flags, st->airport.tile, 0, 0, {}); + CommandCost ret = Command::Do(flags, st->airport.tile); if (ret.Failed()) return ret; } } @@ -2971,7 +2971,7 @@ CommandCost CmdDeleteTown(DoCommandFlag flags, TownID town_id) * tile was already deleted earlier in the loop. */ for (TileIndex current_tile = 0; current_tile < MapSize(); ++current_tile) { if (IsTileType(current_tile, MP_TUNNELBRIDGE) && TestTownOwnsBridge(current_tile, t)) { - CommandCost ret = Command::Do(flags, current_tile, 0, 0, {}); + CommandCost ret = Command::Do(flags, current_tile); if (ret.Failed()) return ret; } } @@ -3014,7 +3014,7 @@ CommandCost CmdDeleteTown(DoCommandFlag flags, TownID town_id) break; } if (try_clear) { - CommandCost ret = Command::Do(flags, current_tile, 0, 0, {}); + CommandCost ret = Command::Do(flags, current_tile); if (ret.Failed()) return ret; } } @@ -3090,7 +3090,7 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags) static bool TryClearTile(TileIndex tile) { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - CommandCost r = Command::Do(DC_NONE, tile, 0, 0, {}); + CommandCost r = Command::Do(DC_NONE, tile); cur_company.Restore(); return r.Succeeded(); } @@ -3162,7 +3162,7 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags) if (flags & DC_EXEC) { Backup cur_company(_current_company, OWNER_NONE, FILE_LINE); - Command::Do(DC_EXEC, statue_data.best_position, 0, 0, {}); + Command::Do(DC_EXEC, statue_data.best_position); cur_company.Restore(); BuildObject(OBJECT_STATUE, statue_data.best_position, _current_company, t); SetBit(t->statues, _current_company); // Once found and built, "inform" the Town. @@ -3767,7 +3767,7 @@ static CommandCost TerraformTile_Town(TileIndex tile, DoCommandFlag flags, int z } } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } /** Tile callback functions for a town */ diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 79eaa04215..123255dd47 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -462,7 +462,7 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 switch (GetRawClearGround(current_tile)) { case CLEAR_FIELDS: case CLEAR_ROCKS: { - CommandCost ret = Command::Do(flags, current_tile, 0, 0, {}); + CommandCost ret = Command::Do(flags, current_tile); if (ret.Failed()) return ret; cost.AddCost(ret); break; @@ -883,7 +883,7 @@ void InitializeTrees() static CommandCost TerraformTile_Trees(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 14ff79854d..4b95e2de0f 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -412,7 +412,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex ti bool allow_on_slopes = (_settings_game.construction.build_on_slopes && transport_type != TRANSPORT_WATER); /* Try and clear the start landscape */ - CommandCost ret = Command::Do(flags, tile_start, 0, 0, {}); + CommandCost ret = Command::Do(flags, tile_start); if (ret.Failed()) return ret; cost = ret; @@ -420,7 +420,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex ti cost.AddCost(terraform_cost_north); /* Try and clear the end landscape */ - ret = Command::Do(flags, tile_end, 0, 0, {}); + ret = Command::Do(flags, tile_end); if (ret.Failed()) return ret; cost.AddCost(ret); @@ -492,7 +492,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex ti default: not_valid_below:; /* try and clear the middle landscape */ - ret = Command::Do(flags, tile, 0, 0, {}); + ret = Command::Do(flags, tile); if (ret.Failed()) return ret; cost.AddCost(ret); break; @@ -663,7 +663,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT if (HasTileWaterGround(start_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); - CommandCost ret = Command::Do(flags, start_tile, 0, 0, {}); + CommandCost ret = Command::Do(flags, start_tile); if (ret.Failed()) return ret; /* XXX - do NOT change 'ret' in the loop, as it is used as the price @@ -723,7 +723,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT if (HasTileWaterGround(end_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); /* Clear the tile in any case */ - ret = Command::Do(flags, end_tile, 0, 0, {}); + ret = Command::Do(flags, end_tile); if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); cost.AddCost(ret); @@ -755,7 +755,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself coa = nullptr; - ret = Command::Do(flags, end_tile, end_tileh & start_tileh, 0, {}); + ret = Command::Do(flags, end_tile, end_tileh & start_tileh, false); _cleared_object_areas[(uint)coa_index].first_tile = old_first_tile; if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND); cost.AddCost(ret); @@ -1837,7 +1837,7 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, Owner old_owner, Owner if (tt == TRANSPORT_RAIL) { /* Since all of our vehicles have been removed, it is safe to remove the rail * bridge / tunnel. */ - [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); + [[maybe_unused]] CommandCost ret = Command::Do(DC_EXEC | DC_BANKRUPT, tile); assert(ret.Succeeded()); } else { /* In any other case, we can safely reassign the ownership to OWNER_NONE. */ @@ -2028,7 +2028,7 @@ static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flag if (res.Succeeded() && (z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } - return Command::Do(flags, tile, 0, 0, {}); + return Command::Do(flags, tile); } extern const TileTypeProcs _tile_type_tunnelbridge_procs = { diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index ee911312ef..c02a1e9b4f 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -121,13 +121,13 @@ CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, Axis axis) CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_DEPOT_SHIP]); bool add_cost = !IsWaterTile(tile); - CommandCost ret = Command::Do(flags | DC_AUTO, tile, 0, 0, {}); + CommandCost ret = Command::Do(flags | DC_AUTO, tile); if (ret.Failed()) return ret; if (add_cost) { cost.AddCost(ret); } add_cost = !IsWaterTile(tile2); - ret = Command::Do(flags | DC_AUTO, tile2, 0, 0, {}); + ret = Command::Do(flags | DC_AUTO, tile2); if (ret.Failed()) return ret; if (add_cost) { cost.AddCost(ret); @@ -305,13 +305,13 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag /* middle tile */ WaterClass wc_middle = HasTileWaterGround(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL; - ret = Command::Do(flags, tile, 0, 0, {}); + ret = Command::Do(flags, tile); if (ret.Failed()) return ret; cost.AddCost(ret); /* lower tile */ if (!IsWaterTile(tile - delta)) { - ret = Command::Do(flags, tile - delta, 0, 0, {}); + ret = Command::Do(flags, tile - delta); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(_price[PR_BUILD_CANAL]); @@ -323,7 +323,7 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag /* upper tile */ if (!IsWaterTile(tile + delta)) { - ret = Command::Do(flags, tile + delta, 0, 0, {}); + ret = Command::Do(flags, tile + delta); if (ret.Failed()) return ret; cost.AddCost(ret); cost.AddCost(_price[PR_BUILD_CANAL]); @@ -473,7 +473,7 @@ CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, TileIndex start_t /* Outside the editor, prevent building canals over your own or OWNER_NONE owned canals */ if (water && IsCanal(current_tile) && _game_mode != GM_EDITOR && (IsTileOwner(current_tile, _current_company) || IsTileOwner(current_tile, OWNER_NONE))) continue; - ret = Command::Do(flags, current_tile, 0, 0, {}); + ret = Command::Do(flags, current_tile); if (ret.Failed()) return ret; if (!water) cost.AddCost(ret); @@ -1128,7 +1128,7 @@ void DoFloodTile(TileIndex target) FALLTHROUGH; case MP_CLEAR: - if (Command::Do(DC_EXEC, target, 0, 0, {}).Succeeded()) { + if (Command::Do(DC_EXEC, target).Succeeded()) { MakeShore(target); MarkTileDirtyByTile(target); flooded = true; @@ -1143,7 +1143,7 @@ void DoFloodTile(TileIndex target) FloodVehicles(target); /* flood flat tile */ - if (Command::Do(DC_EXEC, target, 0, 0, {}).Succeeded()) { + if (Command::Do(DC_EXEC, target).Succeeded()) { MakeSea(target); MarkTileDirtyByTile(target); flooded = true; @@ -1195,7 +1195,7 @@ static void DoDryUp(TileIndex tile) case MP_WATER: assert(IsCoast(tile)); - if (Command::Do(DC_EXEC, tile, 0, 0, {}).Succeeded()) { + if (Command::Do(DC_EXEC, tile).Succeeded()) { MakeClear(tile, CLEAR_GRASS, 3); MarkTileDirtyByTile(tile); } @@ -1354,7 +1354,7 @@ static void ChangeTileOwner_Water(TileIndex tile, Owner old_owner, Owner new_own } /* Remove depot */ - if (IsShipDepot(tile)) Command::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {}); + if (IsShipDepot(tile)) Command::Do(DC_EXEC | DC_BANKRUPT, tile); /* Set owner of canals and locks ... and also canal under dock there was before. * Check if the new owner after removing depot isn't OWNER_WATER. */ @@ -1374,7 +1374,7 @@ static CommandCost TerraformTile_Water(TileIndex tile, DoCommandFlag flags, int /* Canals can't be terraformed */ if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST); - return Command::Do(DC_EXEC, tile, 0, 0, {}); + return Command::Do(DC_EXEC, tile); } diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 85c52c98fa..56095a0796 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -302,7 +302,7 @@ CommandCost CmdBuildBuoy(DoCommandFlag flags, TileIndex tile) CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]); if (!IsWaterTile(tile)) { - CommandCost ret = Command::Do(flags | DC_AUTO, tile, 0, 0, {}); + CommandCost ret = Command::Do(flags | DC_AUTO, tile); if (ret.Failed()) return ret; cost.AddCost(ret); } From 58cff7b081ce9ea4b5314cf8324ca60607389d15 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 21 Nov 2021 23:03:44 +0100 Subject: [PATCH 132/710] Codechange: Un-bitstuff the remaining on-map commands. --- src/company_gui.cpp | 2 +- src/industry_cmd.cpp | 48 ++++++++++---------------- src/industry_cmd.h | 9 +++-- src/industry_gui.cpp | 9 +++-- src/object_cmd.cpp | 11 +++--- src/object_cmd.h | 3 +- src/object_gui.cpp | 2 +- src/script/api/script_company.cpp | 2 +- src/script/api/script_industry.cpp | 8 ++--- src/script/api/script_industrytype.cpp | 4 +-- src/script/api/script_objecttype.cpp | 2 +- src/script/api/script_sign.cpp | 6 ++-- src/script/api/script_tile.cpp | 4 +-- src/script/api/script_viewport.cpp | 6 ++-- src/signs_cmd.cpp | 16 ++++----- src/signs_cmd.h | 5 +-- src/signs_gui.cpp | 2 +- src/terraform_gui.cpp | 2 +- src/tree_cmd.cpp | 12 +++---- src/tree_cmd.h | 2 +- src/tree_gui.cpp | 4 +-- src/viewport.cpp | 12 +++---- src/viewport_cmd.h | 3 +- src/viewport_type.h | 2 +- 24 files changed, 80 insertions(+), 96 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index cefab6d127..7e65b43ac2 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2618,7 +2618,7 @@ struct CompanyWindow : Window void OnPlaceObject(Point pt, TileIndex tile) override { - if (Command::Post(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0, {}) && !_shift_pressed) { + if (Command::Post(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0) && !_shift_pressed) { ResetObjectToPlace(); this->RaiseButtons(); } diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 2c45a84729..ef5f24315a 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1977,17 +1977,14 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do * Build/Fund an industry * @param flags of operations to conduct * @param tile tile where industry is built - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 7) - industry type see build_industry.h and see industry.h - * - p1 = (bit 8 - 15) - first layout to try - * - p1 = (bit 16 ) - 0 = prospect, 1 = fund (only valid if current company is DEITY) - * @param p2 seed to use for desyncfree randomisations - * @param text unused + * @param it industry type see build_industry.h and see industry.h + * @param first_layout first layout to try + * @param fund false = prospect, true = fund (only valid if current company is DEITY) + * @param seed seed to use for desyncfree randomisations * @return the cost of this operation or an error */ -CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, IndustryType it, uint32 first_layout, bool fund, uint32 seed) { - IndustryType it = GB(p1, 0, 8); if (it >= NUM_INDUSTRYTYPES) return CMD_ERROR; const IndustrySpec *indspec = GetIndustrySpec(it); @@ -2006,12 +2003,12 @@ CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, uint32 p1, uin } Randomizer randomizer; - randomizer.SetSeed(p2); - uint16 random_initial_bits = GB(p2, 0, 16); + randomizer.SetSeed(seed); + uint16 random_initial_bits = GB(seed, 0, 16); uint32 random_var8f = randomizer.Next(); size_t num_layouts = indspec->layouts.size(); CommandCost ret = CommandCost(STR_ERROR_SITE_UNSUITABLE); - const bool deity_prospect = _current_company == OWNER_DEITY && !HasBit(p1, 16); + const bool deity_prospect = _current_company == OWNER_DEITY && !fund; Industry *ind = nullptr; if (deity_prospect || (_game_mode != GM_EDITOR && _current_company != OWNER_DEITY && _settings_game.construction.raw_industry_construction == 2 && indspec->IsRawIndustry())) { @@ -2041,7 +2038,7 @@ CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, uint32 p1, uin cur_company.Restore(); } } else { - size_t layout = GB(p1, 8, 8); + size_t layout = first_layout; if (layout >= num_layouts) return CMD_ERROR; /* Check subsequently each layout, starting with the given layout in p1 */ @@ -2065,40 +2062,31 @@ CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, uint32 p1, uin /** * Change industry properties * @param flags Type of operation. - * @param tile Unused. - * @param p1 IndustryID - * @param p2 various bitstuffed elements - * - p2 = (bit 0 - 7) - IndustryAction to perform - * - p2 = (bit 8 - 15) - IndustryControlFlags - * (only used with set control flags) - * - p2 = (bit 16 - 23) - CompanyID to set or INVALID_OWNER (available to everyone) or - * OWNER_NONE (neutral stations only) or OWNER_DEITY (no one) - * (only used with set exclusive supplier / consumer) + * @param ind_id IndustryID + * @param action IndustryAction to perform + * @param ctlflags IndustryControlFlags (only used with set control flags) + * @param company_id CompanyID to set or INVALID_OWNER (available to everyone) or + * OWNER_NONE (neutral stations only) or OWNER_DEITY (no one) + * (only used with set exclusive supplier / consumer) * @param text - Additional industry text (only used with set text action) * @return Empty cost or an error. */ -CommandCost CmdIndustryCtrl(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdIndustryCtrl(DoCommandFlag flags, IndustryID ind_id, IndustryAction action, IndustryControlFlags ctlflags, Owner company_id, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - Industry *ind = Industry::GetIfValid(p1); + Industry *ind = Industry::GetIfValid(ind_id); if (ind == nullptr) return CMD_ERROR; - auto action = static_cast(GB(p2, 0, 8)); - switch (action) { case IndustryAction::SetControlFlags: { - IndustryControlFlags ctlflags = (IndustryControlFlags)GB(p2, 8, 8) & INDCTL_MASK; - - if (flags & DC_EXEC) ind->ctlflags = ctlflags; + if (flags & DC_EXEC) ind->ctlflags = ctlflags & INDCTL_MASK; break; } case IndustryAction::SetExclusiveSupplier: case IndustryAction::SetExclusiveConsumer: { - Owner company_id = (Owner)GB(p2, 16, 8); - if (company_id != OWNER_NONE && company_id != INVALID_OWNER && company_id != OWNER_DEITY && !Company::IsValidID(company_id)) return CMD_ERROR; diff --git a/src/industry_cmd.h b/src/industry_cmd.h index 150b59da9b..b4d965f649 100644 --- a/src/industry_cmd.h +++ b/src/industry_cmd.h @@ -11,9 +11,14 @@ #define INDUSTRY_CMD_H #include "command_type.h" +#include "company_type.h" +#include "industry_type.h" -CommandProc CmdBuildIndustry; -CommandProc CmdIndustryCtrl; +enum class IndustryAction : byte; +enum IndustryControlFlags : byte; + +CommandCost CmdBuildIndustry(DoCommandFlag flags, TileIndex tile, IndustryType it, uint32 first_layout, bool fund, uint32 seed); +CommandCost CmdIndustryCtrl(DoCommandFlag flags, IndustryID ind_id, IndustryAction action, IndustryControlFlags ctlflags, Owner company_id, const std::string &text); DEF_CMD_TRAIT(CMD_BUILD_INDUSTRY, CmdBuildIndustry, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_INDUSTRY_CTRL, CmdIndustryCtrl, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index b66d4f8bfc..8bd4dc5741 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -228,8 +228,7 @@ void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, co { if (result.Succeeded()) return; - auto [tile_, p1, p2, text] = EndianBufferReader::ToValue::Args>(data); - uint8 indtype = GB(p1, 0, 8); + auto [tile_, indtype, first_layout, fund, seed] = EndianBufferReader::ToValue::Args>(data); if (indtype < NUM_INDUSTRYTYPES) { const IndustrySpec *indsp = GetIndustrySpec(indtype); if (indsp->enabled) { @@ -679,7 +678,7 @@ public: case WID_DPI_FUND_WIDGET: { if (this->selected_type != INVALID_INDUSTRYTYPE) { if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) { - Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom(), {}); + Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, 0, false, InteractiveRandom()); this->HandleButtonClick(WID_DPI_FUND_WIDGET); } else { HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT); @@ -716,13 +715,13 @@ public: Backup old_generating_world(_generating_world, true, FILE_LINE); _ignore_restrictions = true; - Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed, {}); + Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, this->selected_type, layout_index, false, seed); cur_company.Restore(); old_generating_world.Restore(); _ignore_restrictions = false; } else { - success = Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed, {}); + success = Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, this->selected_type, layout_index, false, seed); } /* If an industry has been built, just reset the cursor and the system */ diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 9968424e0a..b6ea0b4084 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -199,18 +199,15 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags); * Build an object object * @param flags type of operation * @param tile tile where the object will be located - * @param p1 the object type to build - * @param p2 the view for the object - * @param text unused + * @param type the object type to build + * @param view the view for the object * @return the cost of this operation or an error */ -CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, ObjectType type, uint8 view) { CommandCost cost(EXPENSES_CONSTRUCTION); - ObjectType type = (ObjectType)GB(p1, 0, 16); if (type >= NUM_OBJECTS) return CMD_ERROR; - uint8 view = GB(p2, 0, 2); const ObjectSpec *spec = ObjectSpec::Get(type); if (_game_mode == GM_NORMAL && !spec->IsAvailable() && !_generating_world) return CMD_ERROR; if ((_game_mode == GM_EDITOR || _generating_world) && !spec->WasEverAvailable()) return CMD_ERROR; @@ -777,7 +774,7 @@ void GenerateObjects() default: uint8 view = RandomRange(spec->views); - if (CmdBuildObject(DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, RandomTile(), i, view, {}).Succeeded()) amount--; + if (CmdBuildObject(DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, RandomTile(), i, view).Succeeded()) amount--; break; } } diff --git a/src/object_cmd.h b/src/object_cmd.h index b7119afc38..ea7412544c 100644 --- a/src/object_cmd.h +++ b/src/object_cmd.h @@ -11,8 +11,9 @@ #define OBJECT_CMD_H #include "command_type.h" +#include "object_type.h" -CommandProc CmdBuildObject; +CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, ObjectType type, uint8 view); DEF_CMD_TRAIT(CMD_BUILD_OBJECT, CmdBuildObject, CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 562af15ae8..fa90eb43b6 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -544,7 +544,7 @@ public: { ObjectClass *objclass = ObjectClass::Get(_selected_object_class); Command::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcTerraform, - tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view, {}); + tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view); } void OnPlaceObjectAbort() override diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp index c8f8a616fb..1cc69bc93f 100644 --- a/src/script/api/script_company.cpp +++ b/src/script/api/script_company.cpp @@ -252,7 +252,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, OBJECT_HQ, 0, {}); + return ScriptObject::Command::Do(tile, OBJECT_HQ, 0); } /* static */ TileIndex ScriptCompany::GetCompanyHQ(CompanyID company) diff --git a/src/script/api/script_industry.cpp b/src/script/api/script_industry.cpp index afcaee5547..ca0eaafc43 100644 --- a/src/script/api/script_industry.cpp +++ b/src/script/api/script_industry.cpp @@ -60,7 +60,7 @@ } EnforcePrecondition(false, IsValidIndustry(industry_id)); - return ScriptObject::Command::Do(0, industry_id, static_cast(IndustryAction::SetText), std::string{ encoded_text ? encoded_text : "" }); + return ScriptObject::Command::Do(industry_id, IndustryAction::SetText, INDCTL_NONE, INVALID_OWNER, std::string{ encoded_text ? encoded_text : "" }); } /* static */ ScriptIndustry::CargoAcceptState ScriptIndustry::IsCargoAccepted(IndustryID industry_id, CargoID cargo_id) @@ -258,7 +258,7 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag if (ScriptObject::GetCompany() != OWNER_DEITY) return false; if (!IsValidIndustry(industry_id)) return false; - return ScriptObject::Command::Do(0, industry_id, 0 | ((control_flags & ::INDCTL_MASK) << 8), {}); + return ScriptObject::Command::Do(industry_id, IndustryAction::SetControlFlags, (::IndustryControlFlags)control_flags & ::INDCTL_MASK, INVALID_OWNER, {}); } /* static */ ScriptCompany::CompanyID ScriptIndustry::GetExclusiveSupplier(IndustryID industry_id) @@ -277,7 +277,7 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag auto company = ScriptCompany::ResolveCompanyID(company_id); ::Owner owner = (company == ScriptCompany::COMPANY_INVALID ? ::INVALID_OWNER : (::Owner)company); - return ScriptObject::Command::Do(0, industry_id, 1 | (((uint8)owner) << 16), {}); + return ScriptObject::Command::Do(industry_id, IndustryAction::SetExclusiveSupplier, INDCTL_NONE, owner, {}); } /* static */ ScriptCompany::CompanyID ScriptIndustry::GetExclusiveConsumer(IndustryID industry_id) @@ -296,5 +296,5 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag auto company = ScriptCompany::ResolveCompanyID(company_id); ::Owner owner = (company == ScriptCompany::COMPANY_INVALID ? ::INVALID_OWNER : (::Owner)company); - return ScriptObject::Command::Do(0, industry_id, 2 | (((uint8)owner) << 16), {}); + return ScriptObject::Command::Do(industry_id, IndustryAction::SetExclusiveConsumer, INDCTL_NONE, owner, {}); } diff --git a/src/script/api/script_industrytype.cpp b/src/script/api/script_industrytype.cpp index ebe28c4067..ce8d63e512 100644 --- a/src/script/api/script_industrytype.cpp +++ b/src/script/api/script_industrytype.cpp @@ -123,7 +123,7 @@ uint32 seed = ::InteractiveRandom(); uint32 layout_index = ::InteractiveRandomRange((uint32)::GetIndustrySpec(industry_type)->layouts.size()); - return ScriptObject::Command::Do(tile, (1 << 16) | (layout_index << 8) | industry_type, seed, {}); + return ScriptObject::Command::Do(tile, industry_type, layout_index, true, seed); } /* static */ bool ScriptIndustryType::ProspectIndustry(IndustryType industry_type) @@ -131,7 +131,7 @@ EnforcePrecondition(false, CanProspectIndustry(industry_type)); uint32 seed = ::InteractiveRandom(); - return ScriptObject::Command::Do(0, industry_type, seed, {}); + return ScriptObject::Command::Do(0, industry_type, 0, false, seed); } /* static */ bool ScriptIndustryType::IsBuiltOnWater(IndustryType industry_type) diff --git a/src/script/api/script_objecttype.cpp b/src/script/api/script_objecttype.cpp index a4a8ef9843..cd97761de2 100644 --- a/src/script/api/script_objecttype.cpp +++ b/src/script/api/script_objecttype.cpp @@ -42,5 +42,5 @@ EnforcePrecondition(false, IsValidObjectType(object_type)); EnforcePrecondition(false, ScriptMap::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, object_type, view, {}); + return ScriptObject::Command::Do(tile, object_type, view); } diff --git a/src/script/api/script_sign.cpp b/src/script/api/script_sign.cpp index 6062497f0c..c95093a791 100644 --- a/src/script/api/script_sign.cpp +++ b/src/script/api/script_sign.cpp @@ -42,7 +42,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::Command::Do(0, sign_id, 0, text); + return ScriptObject::Command::Do(sign_id, text); } /* static */ char *ScriptSign::GetName(SignID sign_id) @@ -64,7 +64,7 @@ /* static */ bool ScriptSign::RemoveSign(SignID sign_id) { EnforcePrecondition(false, IsValidSign(sign_id)); - return ScriptObject::Command::Do(0, sign_id, 0, ""); + return ScriptObject::Command::Do(sign_id, ""); } /* static */ SignID ScriptSign::BuildSign(TileIndex location, Text *name) @@ -77,7 +77,7 @@ EnforcePreconditionEncodedText(INVALID_SIGN, text); EnforcePreconditionCustomError(INVALID_SIGN, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnSignID, location, 0, 0, text)) return INVALID_SIGN; + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnSignID, location, text)) return INVALID_SIGN; /* In case of test-mode, we return SignID 0 */ return 0; diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp index 8be74c0304..d8bcc399fa 100644 --- a/src/script/api/script_tile.cpp +++ b/src/script/api/script_tile.cpp @@ -287,7 +287,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, TREE_INVALID, tile, {}); + return ScriptObject::Command::Do(tile, tile, TREE_INVALID); } /* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, uint width, uint height) @@ -298,7 +298,7 @@ EnforcePrecondition(false, height >= 1 && height <= 20); TileIndex end_tile = tile + ::TileDiffXY(width - 1, height - 1); - return ScriptObject::Command::Do(tile, TREE_INVALID, end_tile, {}); + return ScriptObject::Command::Do(tile, end_tile, TREE_INVALID); } /* static */ bool ScriptTile::IsWithinTownInfluence(TileIndex tile, TownID town_id) diff --git a/src/script/api/script_viewport.cpp b/src/script/api/script_viewport.cpp index 7d57bffb37..86a4c12dbd 100644 --- a/src/script/api/script_viewport.cpp +++ b/src/script/api/script_viewport.cpp @@ -31,7 +31,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); EnforcePrecondition(false, ScriptMap::IsValidTile(tile)); - return ScriptObject::Command::Do(tile, VST_EVERYONE, 0, {}); + return ScriptObject::Command::Do(tile, VST_EVERYONE, 0); } /* static */ bool ScriptViewport::ScrollCompanyClientsTo(ScriptCompany::CompanyID company, TileIndex tile) @@ -42,7 +42,7 @@ company = ScriptCompany::ResolveCompanyID(company); EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID); - return ScriptObject::Command::Do(tile, VST_COMPANY, company, {}); + return ScriptObject::Command::Do(tile, VST_COMPANY, company); } /* static */ bool ScriptViewport::ScrollClientTo(ScriptClient::ClientID client, TileIndex tile) @@ -54,5 +54,5 @@ client = ScriptClient::ResolveClientID(client); EnforcePrecondition(false, client != ScriptClient::CLIENT_INVALID); - return ScriptObject::Command::Do(tile, VST_CLIENT, client, {}); + return ScriptObject::Command::Do(tile, VST_CLIENT, client); } diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 00baf45a88..8d20137b4a 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -32,12 +32,10 @@ SignID _new_sign_id; * but everybody is able to rename/remove it. * @param tile tile to place sign at * @param flags type of operation - * @param p1 unused - * @param p2 unused - * @param text unused + * @param text contents of the sign * @return the cost of this operation or an error */ -CommandCost CmdPlaceSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdPlaceSign(DoCommandFlag flags, TileIndex tile, const std::string &text) { /* Try to locate a new sign */ if (!Sign::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_SIGNS); @@ -69,16 +67,14 @@ CommandCost CmdPlaceSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 * Rename a sign. If the new name of the sign is empty, we assume * the user wanted to delete it. So delete it. Ownership of signs * has no meaning/effect whatsoever except for eyecandy - * @param tile unused * @param flags type of operation - * @param p1 index of the sign to be renamed/removed - * @param p2 unused + * @param sign_id index of the sign to be renamed/removed * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameSign(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameSign(DoCommandFlag flags, SignID sign_id, const std::string &text) { - Sign *si = Sign::GetIfValid(p1); + Sign *si = Sign::GetIfValid(sign_id); if (si == nullptr) return CMD_ERROR; if (!CompanyCanRenameSign(si)) return CMD_ERROR; @@ -132,5 +128,5 @@ void CcPlaceSign(Commands cmd, const CommandCost &result, TileIndex tile, const */ void PlaceProc_Sign(TileIndex tile) { - Command::Post(STR_ERROR_CAN_T_PLACE_SIGN_HERE, CcPlaceSign, tile, 0, 0, {}); + Command::Post(STR_ERROR_CAN_T_PLACE_SIGN_HERE, CcPlaceSign, tile, {}); } diff --git a/src/signs_cmd.h b/src/signs_cmd.h index 85f0ffbdf5..1c4e1b4657 100644 --- a/src/signs_cmd.h +++ b/src/signs_cmd.h @@ -11,9 +11,10 @@ #define SIGNS_CMD_H #include "command_type.h" +#include "signs_type.h" -CommandProc CmdPlaceSign; -CommandProc CmdRenameSign; +CommandCost CmdPlaceSign(DoCommandFlag flags, TileIndex tile, const std::string &text); +CommandCost CmdRenameSign(DoCommandFlag flags, SignID sign_id, const std::string &text); DEF_CMD_TRAIT(CMD_PLACE_SIGN, CmdPlaceSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT) DEF_CMD_TRAIT(CMD_RENAME_SIGN, CmdRenameSign, CMD_DEITY, CMDT_OTHER_MANAGEMENT) diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index b10e6d38c5..a3685c5c50 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -414,7 +414,7 @@ Window *ShowSignList() static bool RenameSign(SignID index, const char *text) { bool remove = StrEmpty(text); - Command::Post(StrEmpty(text) ? STR_ERROR_CAN_T_DELETE_SIGN : STR_ERROR_CAN_T_CHANGE_SIGN_NAME, 0, index, 0, text); + Command::Post(StrEmpty(text) ? STR_ERROR_CAN_T_DELETE_SIGN : STR_ERROR_CAN_T_CHANGE_SIGN_NAME, index, text); return remove; } diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index c12f10dedc..2e3fec0956 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -243,7 +243,7 @@ struct TerraformToolbarWindow : Window { break; case WID_TT_BUY_LAND: // Buy land button - Command::Post(STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0, {}); + Command::Post(STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0); break; case WID_TT_PLACE_SIGN: // Place sign button diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 123255dd47..c98758062f 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -382,25 +382,23 @@ void GenerateTrees() * Plant a tree. * @param flags type of operation * @param tile end tile of area-drag - * @param p1 tree type, TREE_INVALID means random. - * @param p2 start tile of area-drag of tree plantation - * @param text unused + * @param start_tile start tile of area-drag of tree plantation + * @param tree_to_plant tree type, TREE_INVALID means random. * @return the cost of this operation or an error */ -CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, byte tree_to_plant) { StringID msg = INVALID_STRING_ID; CommandCost cost(EXPENSES_OTHER); - const byte tree_to_plant = GB(p1, 0, 8); // We cannot use Extract as min and max are climate specific. - if (p2 >= MapSize()) return CMD_ERROR; + if (start_tile >= MapSize()) return CMD_ERROR; /* Check the tree type within the current climate */ if (tree_to_plant != TREE_INVALID && !IsInsideBS(tree_to_plant, _tree_base_by_landscape[_settings_game.game_creation.landscape], _tree_count_by_landscape[_settings_game.game_creation.landscape])) return CMD_ERROR; Company *c = (_game_mode != GM_EDITOR) ? Company::GetIfValid(_current_company) : nullptr; int limit = (c == nullptr ? INT32_MAX : GB(c->tree_limit, 16, 16)); - TileArea ta(tile, (TileIndex)p2); + TileArea ta(tile, start_tile); for (TileIndex current_tile : ta) { switch (GetTileType(current_tile)) { case MP_TREES: diff --git a/src/tree_cmd.h b/src/tree_cmd.h index de8d00179b..8f2199e3e8 100644 --- a/src/tree_cmd.h +++ b/src/tree_cmd.h @@ -12,7 +12,7 @@ #include "command_type.h" -CommandProc CmdPlantTree; +CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, TileIndex start_tile, byte tree_to_plant); DEF_CMD_TRAIT(CMD_PLANT_TREE, CmdPlantTree, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 794135716b..0b0eeda22b 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -231,7 +231,7 @@ public: TileIndex tile = TileVirtXY(pt.x, pt.y); if (this->mode == PM_NORMAL) { - Command::Post(tile, this->tree_to_plant, tile, {}); + Command::Post(tile, tile, this->tree_to_plant); } else { this->DoPlantForest(tile); } @@ -241,7 +241,7 @@ public: void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override { if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL && pt.x != -1 && select_proc == DDSP_PLANT_TREES) { - Command::Post(STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, this->tree_to_plant, start_tile, {}); + Command::Post(STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, start_tile, this->tree_to_plant); } } diff --git a/src/viewport.cpp b/src/viewport.cpp index 1509b028c6..69db0aeab5 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -3468,23 +3468,21 @@ void InitializeSpriteSorter() * Scroll players main viewport. * @param flags type of operation * @param tile tile to center viewport on - * @param p1 ViewportScrollTarget of scroll target - * @param p2 company or client id depending on the target - * @param text unused + * @param target ViewportScrollTarget of scroll target + * @param ref company or client id depending on the target * @return the cost of this operation or an error */ -CommandCost CmdScrollViewport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdScrollViewport(DoCommandFlag flags, TileIndex tile, ViewportScrollTarget target, uint32 ref) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - ViewportScrollTarget target = (ViewportScrollTarget)p1; switch (target) { case VST_EVERYONE: break; case VST_COMPANY: - if (_local_company != (CompanyID)p2) return CommandCost(); + if (_local_company != (CompanyID)ref) return CommandCost(); break; case VST_CLIENT: - if (_network_own_client_id != (ClientID)p2) return CommandCost(); + if (_network_own_client_id != (ClientID)ref) return CommandCost(); break; default: return CMD_ERROR; diff --git a/src/viewport_cmd.h b/src/viewport_cmd.h index f549d755e3..0cae1d9317 100644 --- a/src/viewport_cmd.h +++ b/src/viewport_cmd.h @@ -11,8 +11,9 @@ #define VIEWPORT_CMD_H #include "command_type.h" +#include "viewport_type.h" -CommandProc CmdScrollViewport; +CommandCost CmdScrollViewport(DoCommandFlag flags, TileIndex tile, ViewportScrollTarget target, uint32 ref); DEF_CMD_TRAIT(CMD_SCROLL_VIEWPORT, CmdScrollViewport, CMD_DEITY, CMDT_OTHER_MANAGEMENT) diff --git a/src/viewport_type.h b/src/viewport_type.h index 6665af19e7..a317734b61 100644 --- a/src/viewport_type.h +++ b/src/viewport_type.h @@ -146,7 +146,7 @@ enum ViewportDragDropSelectionProcess { /** * Target of the viewport scrolling GS method */ -enum ViewportScrollTarget { +enum ViewportScrollTarget : byte { VST_EVERYONE, ///< All players VST_COMPANY, ///< All players in specific company VST_CLIENT, ///< Single player From 13528bfcd0f11d738ec23409e26052e70dd233f6 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Tue, 23 Nov 2021 01:05:58 +0100 Subject: [PATCH 133/710] Codechange: Un-bitstuff all remaining commands. --- src/ai/ai_gui.cpp | 4 +- src/autoreplace_gui.cpp | 2 +- src/cheat_gui.cpp | 2 +- src/command_type.h | 20 ------ src/company_cmd.cpp | 51 +++++--------- src/company_cmd.h | 13 ++-- src/company_gui.cpp | 20 +++--- src/console_cmds.cpp | 4 +- src/core/overflowsafe_type.hpp | 5 +- src/economy.cpp | 26 ++----- src/economy_cmd.h | 7 +- src/fios_gui.cpp | 4 +- src/highscore_gui.cpp | 8 +-- src/linkgraph/linkgraphschedule.cpp | 4 +- src/livery.h | 2 +- src/main_gui.cpp | 2 +- src/misc/endian_buffer.hpp | 7 ++ src/misc_cmd.cpp | 93 ++++++++++---------------- src/misc_cmd.h | 19 ++++-- src/network/network.cpp | 4 +- src/network/network_server.cpp | 2 +- src/news_cmd.h | 4 +- src/news_gui.cpp | 30 ++++----- src/news_type.h | 4 +- src/openttd.cpp | 8 +-- src/script/api/script_company.cpp | 22 +++--- src/script/api/script_controller.cpp | 2 +- src/script/api/script_event_types.cpp | 2 +- src/script/api/script_game.cpp | 4 +- src/script/api/script_gamesettings.cpp | 2 +- src/script/api/script_group.cpp | 2 +- src/script/api/script_news.cpp | 2 +- src/script/api/script_subsidy.cpp | 2 +- src/settings.cpp | 34 +++++----- src/settings_cmd.h | 4 +- src/subsidy.cpp | 22 ++---- src/subsidy_cmd.h | 3 +- src/toolbar_gui.cpp | 2 +- src/train_cmd.cpp | 2 +- src/vehicle.cpp | 2 +- 40 files changed, 192 insertions(+), 260 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 5e0c720f00..c4a8667620 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -1332,7 +1332,7 @@ struct AIDebugWindow : public Window { } if (all_unpaused) { /* All scripts have been unpaused => unpause the game. */ - Command::Post(0, PM_PAUSED_NORMAL, 0, {}); + Command::Post(PM_PAUSED_NORMAL, false); } } } @@ -1381,7 +1381,7 @@ struct AIDebugWindow : public Window { /* Pause the game. */ if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - Command::Post(0, PM_PAUSED_NORMAL, 1, {}); + Command::Post(PM_PAUSED_NORMAL, true); } /* Highlight row that matched */ diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 00eba4044b..4dae0eedc7 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -547,7 +547,7 @@ public: Command::Post(this->sel_group, GroupFlags::GF_REPLACE_WAGON_REMOVAL, !HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL), _ctrl_pressed); } else { // toggle renew_keep_length - Command::Post(0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, "company.renew_keep_length"); + Command::Post("company.renew_keep_length", Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1); } break; } diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index fcc9a3ef07..eb62dc0317 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -55,7 +55,7 @@ static int32 _money_cheat_amount = 10000000; */ static int32 ClickMoneyCheat(int32 p1, int32 p2) { - Command::Post(0, (uint32)(p2 * _money_cheat_amount), 0, {}); + Command::Post(p2 * _money_cheat_amount); return _money_cheat_amount; } diff --git a/src/command_type.h b/src/command_type.h index 59331dc7cc..0424782a23 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -404,26 +404,6 @@ enum CommandPauseLevel { CMDPL_ALL_ACTIONS, ///< All actions may be executed. }; -/** - * Defines the callback type for all command handler functions. - * - * This type defines the function header for all functions which handles a CMD_* command. - * A command handler use the parameters to act according to the meaning of the command. - * The tile parameter defines the tile to perform an action on. - * The flag parameter is filled with flags from the DC_* enumeration. The parameters - * p1 and p2 are filled with parameters for the command like "which road type", "which - * order" or "direction". Each function should mentioned in there doxygen comments - * the usage of these parameters. - * - * @param tile The tile to apply a command on - * @param flags Flags for the command, from the DC_* enumeration - * @param p1 Additional data for the command - * @param p2 Additional data for the command - * @param text Additional text - * @return The CommandCost of the command, which can be succeeded or failed. - */ -typedef CommandCost CommandProc(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text); - template struct CommandFunctionTraitHelper; template diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 87231f3eb6..016a830bf9 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -916,16 +916,11 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID /** * Change the company manager's face. * @param flags operation to perform - * @param tile unused - * @param p1 unused - * @param p2 face bitmasked - * @param text unused + * @param cmf face bitmasked * @return the cost of this operation or an error */ -CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf) { - CompanyManagerFace cmf = (CompanyManagerFace)p2; - if (!IsValidCompanyManagerFace(cmf)) return CMD_ERROR; if (flags & DC_EXEC) { @@ -938,20 +933,13 @@ CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, TileIndex tile, uint32 /** * Change the company's company-colour * @param flags operation to perform - * @param tile unused - * @param p1 bitstuffed: - * p1 bits 0-7 scheme to set - * p1 bit 8 set first/second colour - * @param p2 new colour for vehicles, property, etc. - * @param text unused + * @param scheme scheme to set + * @param primary set first/second colour + * @param colour new colour for vehicles, property, etc. * @return the cost of this operation or an error */ -CommandCost CmdSetCompanyColour(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour) { - Colours colour = Extract(p2); - LiveryScheme scheme = Extract(p1); - bool second = HasBit(p1, 8); - if (scheme >= LS_END || (colour >= COLOUR_END && colour != INVALID_COLOUR)) return CMD_ERROR; /* Default scheme can't be reset to invalid. */ @@ -960,14 +948,14 @@ CommandCost CmdSetCompanyColour(DoCommandFlag flags, TileIndex tile, uint32 p1, Company *c = Company::Get(_current_company); /* Ensure no two companies have the same primary colour */ - if (scheme == LS_DEFAULT && !second) { + if (scheme == LS_DEFAULT && primary) { for (const Company *cc : Company::Iterate()) { if (cc != c && cc->colour == colour) return CMD_ERROR; } } if (flags & DC_EXEC) { - if (!second) { + if (primary) { if (scheme != LS_DEFAULT) SB(c->livery[scheme].in_use, 0, 1, colour != INVALID_COLOUR); if (colour == INVALID_COLOUR) colour = (Colours)c->livery[LS_DEFAULT].colour1; c->livery[scheme].colour1 = colour; @@ -1051,13 +1039,10 @@ static bool IsUniqueCompanyName(const std::string &name) /** * Change the name of the company. * @param flags operation to perform - * @param tile unused - * @param p1 unused - * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenameCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text) { bool reset = text.empty(); @@ -1097,13 +1082,10 @@ static bool IsUniquePresidentName(const std::string &name) /** * Change the name of the president. * @param flags operation to perform - * @param tile unused - * @param p1 unused - * @param p2 unused * @param text the new name or an empty string when resetting to the default * @return the cost of this operation or an error */ -CommandCost CmdRenamePresident(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text) { bool reset = text.empty(); @@ -1121,7 +1103,7 @@ CommandCost CmdRenamePresident(DoCommandFlag flags, TileIndex tile, uint32 p1, u c->president_name = text; if (c->name_1 == STR_SV_UNNAMED && c->name.empty()) { - Command::Do(DC_EXEC, 0, 0, 0, text + " Transport"); + Command::Do(DC_EXEC, text + " Transport"); } } @@ -1182,19 +1164,16 @@ uint32 CompanyInfrastructure::GetTramTotal() const * companies if you have paid off your loan (either explicitly, or implicitly * given the fact that you have more money than loan). * @param flags operation to perform - * @param tile unused - * @param p1 the amount of money to transfer; max 20.000.000 - * @param p2 the company to transfer the money to - * @param text unused + * @param money the amount of money to transfer; max 20.000.000 + * @param dest_company the company to transfer the money to * @return the cost of this operation or an error */ -CommandCost CmdGiveMoney(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdGiveMoney(DoCommandFlag flags, uint32 money, CompanyID dest_company) { if (!_settings_game.economy.give_money) return CMD_ERROR; const Company *c = Company::Get(_current_company); - CommandCost amount(EXPENSES_OTHER, std::min(p1, 20000000LL)); - CompanyID dest_company = (CompanyID)p2; + CommandCost amount(EXPENSES_OTHER, std::min(money, 20000000LL)); /* You can only transfer funds that is in excess of your loan */ if (c->money - c->current_loan < amount.GetCost() || amount.GetCost() < 0) return_cmd_error(STR_ERROR_INSUFFICIENT_FUNDS); diff --git a/src/company_cmd.h b/src/company_cmd.h index 107a77f29c..5ffac5cbde 100644 --- a/src/company_cmd.h +++ b/src/company_cmd.h @@ -11,15 +11,18 @@ #define COMPANY_CMD_H #include "command_type.h" +#include "company_type.h" +#include "livery.h" enum ClientID : uint32; +enum Colours : byte; CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id); -CommandProc CmdGiveMoney; -CommandProc CmdRenameCompany; -CommandProc CmdRenamePresident; -CommandProc CmdSetCompanyManagerFace; -CommandProc CmdSetCompanyColour; +CommandCost CmdGiveMoney(DoCommandFlag flags, uint32 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); +CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour); DEF_CMD_TRAIT(CMD_COMPANY_CTRL, CmdCompanyCtrl, CMD_SPECTATOR | CMD_CLIENT_ID | CMD_NO_EST, CMDT_SERVER_SETTING) DEF_CMD_TRAIT(CMD_GIVE_MONEY, CmdGiveMoney, 0, CMDT_MONEY_MANAGEMENT) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 7e65b43ac2..66ef1a9898 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -440,11 +440,11 @@ struct CompanyFinancesWindow : Window { break; case WID_CF_INCREASE_LOAN: // increase loan - Command::Post(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, 0, 0, _ctrl_pressed, {}); + Command::Post(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, _ctrl_pressed ? LoanCommand::Max : LoanCommand::Interval, 0); break; case WID_CF_REPAY_LOAN: // repay loan - Command::Post(STR_ERROR_CAN_T_REPAY_LOAN, 0, 0, _ctrl_pressed, {}); + Command::Post(STR_ERROR_CAN_T_REPAY_LOAN, _ctrl_pressed ? LoanCommand::Max : LoanCommand::Interval, 0); break; case WID_CF_INFRASTRUCTURE: // show infrastructure details @@ -1000,7 +1000,7 @@ public: for (LiveryScheme scheme = LS_DEFAULT; scheme < LS_END; scheme++) { /* Changed colour for the selected scheme, or all visible schemes if CTRL is pressed. */ if (HasBit(this->sel, scheme) || (_ctrl_pressed && _livery_class[scheme] == this->livery_class && HasBit(_loaded_newgrf_features.used_liveries, scheme))) { - Command::Post(0, scheme | (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256), index, {}); + Command::Post(scheme, widget == WID_SCL_PRI_COL_DROPDOWN, (Colours)index); } } } else { @@ -1586,7 +1586,7 @@ public: /* OK button */ case WID_SCMF_ACCEPT: - Command::Post(0, 0, this->face, {}); + Command::Post(this->face); FALLTHROUGH; /* Cancel button */ @@ -2581,11 +2581,11 @@ struct CompanyWindow : Window break; case WID_C_BUY_SHARE: - Command::Post(STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, 0, this->window_number, 0, {}); + Command::Post(STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS, (CompanyID)this->window_number); break; case WID_C_SELL_SHARE: - Command::Post(STR_ERROR_CAN_T_SELL_25_SHARE_IN, 0, this->window_number, 0, {}); + Command::Post(STR_ERROR_CAN_T_SELL_25_SHARE_IN, (CompanyID)this->window_number); break; case WID_C_COMPANY_PASSWORD: @@ -2640,16 +2640,16 @@ struct CompanyWindow : Window Money money = (Money)(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, 0, money_c, this->window_number, {}); + Command::Post(STR_ERROR_CAN_T_GIVE_MONEY, money_c, (CompanyID)this->window_number); break; } case WID_C_PRESIDENT_NAME: - Command::Post(STR_ERROR_CAN_T_CHANGE_PRESIDENT, 0, 0, 0, str); + Command::Post(STR_ERROR_CAN_T_CHANGE_PRESIDENT, str); break; case WID_C_COMPANY_NAME: - Command::Post(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME, 0, 0, 0, str); + Command::Post(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME, str); break; case WID_C_COMPANY_JOIN: @@ -2776,7 +2776,7 @@ struct BuyCompanyWindow : Window { break; case WID_BC_YES: - Command::Post(STR_ERROR_CAN_T_BUY_COMPANY, 0, this->window_number, 0, {}); + Command::Post(STR_ERROR_CAN_T_BUY_COMPANY, (CompanyID)this->window_number); break; } } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 9e244dd439..7f663fe863 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -632,7 +632,7 @@ DEF_CONSOLE_CMD(ConPauseGame) } if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - Command::Post(0, PM_PAUSED_NORMAL, 1, {}); + Command::Post(PM_PAUSED_NORMAL, true); if (!_networking) IConsolePrint(CC_DEFAULT, "Game paused."); } else { IConsolePrint(CC_DEFAULT, "Game is already paused."); @@ -654,7 +654,7 @@ DEF_CONSOLE_CMD(ConUnpauseGame) } if ((_pause_mode & PM_PAUSED_NORMAL) != PM_UNPAUSED) { - Command::Post(0, PM_PAUSED_NORMAL, 0, {}); + Command::Post(PM_PAUSED_NORMAL, false); if (!_networking) IConsolePrint(CC_DEFAULT, "Game unpaused."); } else if ((_pause_mode & PM_PAUSED_ERROR) != PM_UNPAUSED) { IConsolePrint(CC_DEFAULT, "Game is in error state and cannot be unpaused via console."); diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp index 29aab175b3..14f0eaa7a7 100644 --- a/src/core/overflowsafe_type.hpp +++ b/src/core/overflowsafe_type.hpp @@ -39,9 +39,10 @@ public: constexpr OverflowSafeInt() : m_value(0) { } constexpr OverflowSafeInt(const OverflowSafeInt& other) : m_value(other.m_value) { } - constexpr OverflowSafeInt(const int64 int_) : m_value(int_) { } + constexpr OverflowSafeInt(const T int_) : m_value(int_) { } inline constexpr OverflowSafeInt& operator = (const OverflowSafeInt& other) { this->m_value = other.m_value; return *this; } + inline constexpr OverflowSafeInt& operator = (T other) { this->m_value = other; return *this; } inline constexpr OverflowSafeInt operator - () const { return OverflowSafeInt(this->m_value == T_MIN ? T_MAX : -this->m_value); } @@ -174,7 +175,7 @@ public: inline constexpr bool operator < (const int other) const { return !(*this >= other); } inline constexpr bool operator <= (const int other) const { return !(*this > other); } - inline constexpr operator int64 () const { return this->m_value; } + inline constexpr operator T () const { return this->m_value; } }; diff --git a/src/economy.cpp b/src/economy.cpp index 5c7c2cee51..6fb3d2795d 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -315,7 +315,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) for (i = 0; i < 4; i++) { if (c->share_owners[i] == old_owner) { /* Sell its shares */ - CommandCost res = Command::Do(DC_EXEC | DC_BANKRUPT, 0, c->index, 0, {}); + CommandCost res = Command::Do(DC_EXEC | DC_BANKRUPT, c->index); /* Because we are in a DoCommand, we can't just execute another one and * expect the money to be removed. We need to do it ourself! */ SubtractMoneyFromCompany(res); @@ -335,7 +335,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) } else { cur_company2.Change(c->share_owners[i]); /* Sell the shares */ - CommandCost res = Command::Do(DC_EXEC | DC_BANKRUPT, 0, old_owner, 0, {}); + CommandCost res = Command::Do(DC_EXEC | DC_BANKRUPT, old_owner); /* Because we are in a DoCommand, we can't just execute another one and * expect the money to be removed. We need to do it ourself! */ SubtractMoneyFromCompany(res); @@ -2013,16 +2013,12 @@ extern int GetAmountOwnedBy(const Company *c, Owner owner); /** * Acquire shares in an opposing company. * @param flags type of operation - * @param tile unused * @param p1 company to buy the shares from - * @param p2 unused - * @param text unused * @return the cost of this operation or an error */ -CommandCost CmdBuyShareInCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuyShareInCompany(DoCommandFlag flags, TileIndex tile, CompanyID target_company) { CommandCost cost(EXPENSES_OTHER); - CompanyID target_company = (CompanyID)p1; Company *c = Company::GetIfValid(target_company); /* Check if buying shares is allowed (protection against modified clients) @@ -2065,15 +2061,11 @@ CommandCost CmdBuyShareInCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, /** * Sell shares in an opposing company. * @param flags type of operation - * @param tile unused - * @param p1 company to sell the shares from - * @param p2 unused - * @param text unused + * @param target_company company to sell the shares from * @return the cost of this operation or an error */ -CommandCost CmdSellShareInCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdSellShareInCompany(DoCommandFlag flags, CompanyID target_company) { - CompanyID target_company = (CompanyID)p1; Company *c = Company::GetIfValid(target_company); /* Cannot sell own shares */ @@ -2106,15 +2098,11 @@ CommandCost CmdSellShareInCompany(DoCommandFlag flags, TileIndex tile, uint32 p1 * that company. * @todo currently this only works for AI companies * @param flags type of operation - * @param tile unused - * @param p1 company to buy up - * @param p2 unused - * @param text unused + * @param target_company company to buy up * @return the cost of this operation or an error */ -CommandCost CmdBuyCompany(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdBuyCompany(DoCommandFlag flags, CompanyID target_company) { - CompanyID target_company = (CompanyID)p1; Company *c = Company::GetIfValid(target_company); if (c == nullptr) return CMD_ERROR; diff --git a/src/economy_cmd.h b/src/economy_cmd.h index f182af81f2..e5cc282c99 100644 --- a/src/economy_cmd.h +++ b/src/economy_cmd.h @@ -11,10 +11,11 @@ #define ECONOMY_CMD_H #include "command_type.h" +#include "company_type.h" -CommandProc CmdBuyShareInCompany; -CommandProc CmdSellShareInCompany; -CommandProc CmdBuyCompany; +CommandCost CmdBuyShareInCompany(DoCommandFlag flags, TileIndex tile, CompanyID target_company); +CommandCost CmdSellShareInCompany(DoCommandFlag flags, CompanyID target_company); +CommandCost CmdBuyCompany(DoCommandFlag flags, CompanyID target_company); DEF_CMD_TRAIT(CMD_BUY_SHARE_IN_COMPANY, CmdBuyShareInCompany, 0, CMDT_MONEY_MANAGEMENT) DEF_CMD_TRAIT(CMD_SELL_SHARE_IN_COMPANY, CmdSellShareInCompany, 0, CMDT_MONEY_MANAGEMENT) diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 73315edf0f..3014bc00ec 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -359,7 +359,7 @@ public: /* pause is only used in single-player, non-editor mode, non-menu mode. It * will be unpaused in the WE_DESTROY event handler. */ if (_game_mode != GM_MENU && !_networking && _game_mode != GM_EDITOR) { - Command::Post(0, PM_PAUSED_SAVELOAD, 1, {}); + Command::Post(PM_PAUSED_SAVELOAD, true); } SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0); @@ -403,7 +403,7 @@ public: { /* pause is only used in single-player, non-editor mode, non menu mode */ if (!_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) { - Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); + Command::Post(PM_PAUSED_SAVELOAD, false); } this->Window::Close(); } diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index bf09b1b949..0ccc288f05 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -97,7 +97,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { EndGameWindow(WindowDesc *desc) : EndGameHighScoreBaseWindow(desc) { /* Pause in single-player to have a look at the highscore at your own leisure */ - if (!_networking) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); + if (!_networking) Command::Post(PM_PAUSED_NORMAL, true); this->background_img = SPR_TYCOON_IMG1_BEGIN; @@ -125,7 +125,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { void Close() override { - if (!_networking) Command::Post(0, PM_PAUSED_NORMAL, 0, {}); // unpause + if (!_networking) Command::Post(PM_PAUSED_NORMAL, false); // unpause ShowHighscoreTable(this->window_number, this->rank); this->EndGameHighScoreBaseWindow::Close(); } @@ -160,7 +160,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { /* pause game to show the chart */ this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL; - if (!_networking && !this->game_paused_by_player) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); + if (!_networking && !this->game_paused_by_player) Command::Post(PM_PAUSED_NORMAL, true); /* Close all always on-top windows to get a clean screen */ if (_game_mode != GM_MENU) HideVitalWindows(); @@ -175,7 +175,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { if (_game_mode != GM_MENU) ShowVitalWindows(); - if (!_networking && !this->game_paused_by_player) Command::Post(0, PM_PAUSED_NORMAL, 0, {}); // unpause + if (!_networking && !this->game_paused_by_player) Command::Post(PM_PAUSED_NORMAL, false); // unpause this->EndGameHighScoreBaseWindow::Close(); } diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp index 0a6b891502..3581c72ac9 100644 --- a/src/linkgraph/linkgraphschedule.cpp +++ b/src/linkgraph/linkgraphschedule.cpp @@ -174,7 +174,7 @@ void StateGameLoop_LinkGraphPauseControl() if (_pause_mode & PM_PAUSED_LINK_GRAPH) { /* We are paused waiting on a job, check the job every tick. */ if (!LinkGraphSchedule::instance.IsJoinWithUnfinishedJobDue()) { - Command::Post(0, PM_PAUSED_LINK_GRAPH, 0, {}); + Command::Post(PM_PAUSED_LINK_GRAPH, false); } } else if (_pause_mode == PM_UNPAUSED && _date_fract == LinkGraphSchedule::SPAWN_JOIN_TICK - 2 && @@ -182,7 +182,7 @@ void StateGameLoop_LinkGraphPauseControl() LinkGraphSchedule::instance.IsJoinWithUnfinishedJobDue()) { /* Perform check two _date_fract ticks before we would join, to make * sure it also works in multiplayer. */ - Command::Post(0, PM_PAUSED_LINK_GRAPH, 1, {}); + Command::Post(PM_PAUSED_LINK_GRAPH, true); } } diff --git a/src/livery.h b/src/livery.h index dc01c390a7..352cf6972e 100644 --- a/src/livery.h +++ b/src/livery.h @@ -17,7 +17,7 @@ static const byte LIT_COMPANY = 1; ///< Show the liveries of your own company static const byte LIT_ALL = 2; ///< Show the liveries of all companies /** List of different livery schemes. */ -enum LiveryScheme { +enum LiveryScheme : byte { LS_BEGIN = 0, LS_DEFAULT = 0, diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 680493c12c..c25186164a 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -327,7 +327,7 @@ struct MainWindow : Window case GHK_MONEY: // Gimme money /* You can only cheat for money in singleplayer mode. */ - if (!_networking) Command::Post(0, 10000000, 0, {}); + if (!_networking) Command::Post(10000000); break; case GHK_UPDATE_COORDS: // Update the coordinates of all station signs diff --git a/src/misc/endian_buffer.hpp b/src/misc/endian_buffer.hpp index c20d9a8b99..87d527d9d8 100644 --- a/src/misc/endian_buffer.hpp +++ b/src/misc/endian_buffer.hpp @@ -14,6 +14,7 @@ #include #include "../core/span_type.hpp" #include "../core/bitmath_func.hpp" +#include "../core/overflowsafe_type.hpp" struct StrongTypedefBase; @@ -37,6 +38,9 @@ public: EndianBufferWriter &operator <<(std::string_view data) { this->Write(data); return *this; } EndianBufferWriter &operator <<(bool data) { return *this << static_cast(data ? 1 : 0); } + template + EndianBufferWriter &operator <<(const OverflowSafeInt &data) { return *this << static_cast(data); }; + template EndianBufferWriter &operator <<(const std::tuple &data) { @@ -127,6 +131,9 @@ public: EndianBufferReader &operator >>(std::string &data) { data = this->ReadStr(); return *this; } EndianBufferReader &operator >>(bool &data) { data = this->Read() != 0; return *this; } + template + EndianBufferReader &operator >>(OverflowSafeInt &data) { data = this->Read(); return *this; }; + template EndianBufferReader &operator >>(std::tuple &data) { diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index 84c61e3f18..fd8f79476e 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -28,22 +28,16 @@ #include "safeguards.h" -/* Make sure we can discard lower 2 bits of 64bit amount when passing it to Cmd[In|De]creaseLoan() */ -static_assert((LOAN_INTERVAL & 3) == 0); - /** * Increase the loan of your company. * @param flags operation to perform - * @param tile unused - * @param p1 higher half of amount to increase the loan with, multitude of LOAN_INTERVAL. Only used when (p2 & 3) == 2. - * @param p2 (bit 2-31) - lower half of amount (lower 2 bits assumed to be 0) - * (bit 0-1) - when 0: loans LOAN_INTERVAL - * when 1: loans the maximum loan permitting money (press CTRL), - * when 2: loans the amount specified in p1 and p2 - * @param text unused + * @param cmd when LoanCommand::Interval: loans LOAN_INTERVAL, + * when LoanCommand::Max: loans the maximum loan permitting money (press CTRL), + * when LoanCommand::Amount: loans the amount specified in \c amount + * @param amount amount to increase the loan with, multitude of LOAN_INTERVAL. Only used when cmd == LoanCommand::Amount. * @return the cost of this operation or an error */ -CommandCost CmdIncreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdIncreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount) { Company *c = Company::Get(_current_company); @@ -53,16 +47,16 @@ CommandCost CmdIncreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint } Money loan; - switch (p2 & 3) { + switch (cmd) { default: return CMD_ERROR; // Invalid method - case 0: // Take some extra loan + case LoanCommand::Interval: // Take some extra loan loan = LOAN_INTERVAL; break; - case 1: // Take a loan as big as possible + case LoanCommand::Max: // Take a loan as big as possible loan = _economy.max_loan - c->current_loan; break; - case 2: // Take the given amount of loan - loan = ((uint64)p1 << 32) | (p2 & 0xFFFFFFFC); + case LoanCommand::Amount: // Take the given amount of loan + loan = amount; if (loan < LOAN_INTERVAL || c->current_loan + loan > _economy.max_loan || loan % LOAN_INTERVAL != 0) return CMD_ERROR; break; } @@ -82,33 +76,30 @@ CommandCost CmdIncreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint /** * Decrease the loan of your company. * @param flags operation to perform - * @param tile unused - * @param p1 higher half of amount to decrease the loan with, multitude of LOAN_INTERVAL. Only used when (p2 & 3) == 2. - * @param p2 (bit 2-31) - lower half of amount (lower 2 bits assumed to be 0) - * (bit 0-1) - when 0: pays back LOAN_INTERVAL - * when 1: pays back the maximum loan permitting money (press CTRL), - * when 2: pays back the amount specified in p1 and p2 - * @param text unused + * @param cmd when LoanCommand::Interval: pays back LOAN_INTERVAL, + * when LoanCommand::Max: pays back the maximum loan permitting money (press CTRL), + * when LoanCommand::Amount: pays back the amount specified in \c amount + * @param amount amount to decrease the loan with, multitude of LOAN_INTERVAL. Only used when cmd == LoanCommand::Amount. * @return the cost of this operation or an error */ -CommandCost CmdDecreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdDecreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount) { Company *c = Company::Get(_current_company); if (c->current_loan == 0) return_cmd_error(STR_ERROR_LOAN_ALREADY_REPAYED); Money loan; - switch (p2 & 3) { + switch (cmd) { default: return CMD_ERROR; // Invalid method - case 0: // Pay back one step + case LoanCommand::Interval: // Pay back one step loan = std::min(c->current_loan, (Money)LOAN_INTERVAL); break; - case 1: // Pay back as much as possible + case LoanCommand::Max: // Pay back as much as possible loan = std::max(std::min(c->current_loan, c->money), (Money)LOAN_INTERVAL); loan -= loan % LOAN_INTERVAL; break; - case 2: // Repay the given amount of loan - loan = ((uint64)p1 << 32) | (p2 & 0xFFFFFFFC); + case LoanCommand::Amount: // Repay the given amount of loan + loan = amount; if (loan % LOAN_INTERVAL != 0 || loan < LOAN_INTERVAL || loan > c->current_loan) return CMD_ERROR; // Invalid amount to loan break; } @@ -135,7 +126,7 @@ CommandCost CmdDecreaseLoan(DoCommandFlag flags, TileIndex tile, uint32 p1, uint static void AskUnsafeUnpauseCallback(Window *w, bool confirmed) { if (confirmed) { - Command::Post(0, PM_PAUSED_ERROR, 0, {}); + Command::Post(PM_PAUSED_ERROR, false); } } @@ -145,15 +136,13 @@ static void AskUnsafeUnpauseCallback(Window *w, bool confirmed) * unpaused. A bitset is used instead of a boolean value/counter to have * more control over the game when saving/loading, etc. * @param flags operation to perform - * @param tile unused - * @param p1 the pause mode to change - * @param p2 1 pauses, 0 unpauses this mode - * @param text unused + * @param mode the pause mode to change + * @param pause true pauses, false unpauses this mode * @return the cost of this operation or an error */ -CommandCost CmdPause(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdPause(DoCommandFlag flags, PauseMode mode, bool pause) { - switch (p1) { + switch (mode) { case PM_PAUSED_SAVELOAD: case PM_PAUSED_ERROR: case PM_PAUSED_NORMAL: @@ -169,7 +158,7 @@ CommandCost CmdPause(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, default: return CMD_ERROR; } if (flags & DC_EXEC) { - if (p1 == PM_PAUSED_NORMAL && _pause_mode & PM_PAUSED_ERROR) { + if (mode == PM_PAUSED_NORMAL && _pause_mode & PM_PAUSED_ERROR) { ShowQuery( STR_NEWGRF_UNPAUSE_WARNING_TITLE, STR_NEWGRF_UNPAUSE_WARNING, @@ -179,13 +168,13 @@ CommandCost CmdPause(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, } else { PauseMode prev_mode = _pause_mode; - if (p2 == 0) { - _pause_mode = static_cast(_pause_mode & (byte)~p1); + if (pause) { + _pause_mode |= mode; } else { - _pause_mode = static_cast(_pause_mode | (byte)p1); + _pause_mode &= ~mode; } - NetworkHandlePauseChange(prev_mode, (PauseMode)p1); + NetworkHandlePauseChange(prev_mode, mode); } SetWindowDirty(WC_STATUS_BAR, 0); @@ -197,33 +186,25 @@ CommandCost CmdPause(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, /** * Change the financial flow of your company. * @param flags operation to perform - * @param tile unused - * @param p1 the amount of money to receive (if positive), or spend (if negative) - * @param p2 unused - * @param text unused + * @param amount the amount of money to receive (if positive), or spend (if negative) * @return the cost of this operation or an error */ -CommandCost CmdMoneyCheat(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdMoneyCheat(DoCommandFlag flags, Money amount) { - return CommandCost(EXPENSES_OTHER, -(int32)p1); + return CommandCost(EXPENSES_OTHER, -amount); } /** * Change the bank bank balance of a company by inserting or removing money without affecting the loan. * @param flags operation to perform * @param tile tile to show text effect on (if not 0) - * @param p1 the amount of money to receive (if positive), or spend (if negative) - * @param p2 (bit 0-7) - the company ID. - * (bit 8-15) - the expenses type which should register the cost/income @see ExpensesType. - * @param text unused + * @param delta the amount of money to receive (if positive), or spend (if negative) + * @param company the company ID. + * @param expenses_type the expenses type which should register the cost/income @see ExpensesType. * @return zero cost or an error */ -CommandCost CmdChangeBankBalance(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeBankBalance(DoCommandFlag flags, TileIndex tile, Money delta, CompanyID company, ExpensesType expenses_type) { - int32 delta = (int32)p1; - CompanyID company = (CompanyID) GB(p2, 0, 8); - ExpensesType expenses_type = Extract(p2); - if (!Company::IsValidID(company)) return CMD_ERROR; if (expenses_type >= EXPENSES_END) return CMD_ERROR; if (_current_company != OWNER_DEITY) return CMD_ERROR; diff --git a/src/misc_cmd.h b/src/misc_cmd.h index 6827db3ac2..77250b551c 100644 --- a/src/misc_cmd.h +++ b/src/misc_cmd.h @@ -11,12 +11,21 @@ #define MISC_CMD_H #include "command_type.h" +#include "economy_type.h" -CommandProc CmdMoneyCheat; -CommandProc CmdChangeBankBalance; -CommandProc CmdIncreaseLoan; -CommandProc CmdDecreaseLoan; -CommandProc CmdPause; +enum PauseMode : byte; + +enum class LoanCommand : byte { + Interval, + Max, + Amount, +}; + +CommandCost CmdMoneyCheat(DoCommandFlag flags, Money amount); +CommandCost CmdChangeBankBalance(DoCommandFlag flags, TileIndex tile, Money delta, CompanyID company, ExpensesType expenses_type); +CommandCost CmdIncreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount); +CommandCost CmdDecreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount); +CommandCost CmdPause(DoCommandFlag flags, PauseMode mode, bool pause); DEF_CMD_TRAIT(CMD_MONEY_CHEAT, CmdMoneyCheat, CMD_OFFLINE, CMDT_CHEAT) DEF_CMD_TRAIT(CMD_CHANGE_BANK_BALANCE, CmdChangeBankBalance, CMD_DEITY, CMDT_MONEY_MANAGEMENT) diff --git a/src/network/network.cpp b/src/network/network.cpp index 3bd287f85a..19cb6ab3a4 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -395,7 +395,7 @@ static void CheckPauseHelper(bool pause, PauseMode pm) { if (pause == ((_pause_mode & pm) != PM_UNPAUSED)) return; - Command::Post(0, pm, pause ? 1 : 0, {}); + Command::Post(pm, pause); } /** @@ -1128,7 +1128,7 @@ void NetworkGameLoop() cp = new CommandPacket(); cp->company = COMPANY_SPECTATOR; cp->cmd = CMD_PAUSE; - cp->data = EndianBufferWriter<>::FromValue(CommandTraits::Args{ 0, PM_PAUSED_NORMAL, 1, "" }); + cp->data = EndianBufferWriter<>::FromValue(CommandTraits::Args{ PM_PAUSED_NORMAL, true }); _ddc_fastforward = false; } else if (strncmp(p, "sync: ", 6) == 0) { int ret = sscanf(p + 6, "%x; %x; %x; %x", &next_date, &next_date_fract, &sync_state[0], &sync_state[1]); diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 197d398bf6..36ab3840a4 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -2081,7 +2081,7 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci) /* ci is nullptr when replaying, or for AIs. In neither case there is a client. */ ci->client_playas = c->index; NetworkUpdateClientInfo(ci->client_id); - Command::SendNet(STR_NULL, nullptr, c->index, 0, 0, 0, ci->client_name); + Command::SendNet(STR_NULL, nullptr, c->index, ci->client_name); } /* Announce new company on network. */ diff --git a/src/news_cmd.h b/src/news_cmd.h index 4a75037b3b..6ebb1b84d9 100644 --- a/src/news_cmd.h +++ b/src/news_cmd.h @@ -11,8 +11,10 @@ #define NEWS_CMD_H #include "command_type.h" +#include "company_type.h" +#include "news_type.h" -CommandProc CmdCustomNewsItem; +CommandCost CmdCustomNewsItem(DoCommandFlag flags, NewsType type, NewsReferenceType reftype1, CompanyID company, uint32 reference, const std::string &text); DEF_CMD_TRAIT(CMD_CUSTOM_NEWS_ITEM, CmdCustomNewsItem, CMD_STR_CTRL | CMD_DEITY, CMDT_OTHER_MANAGEMENT) diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 69ab19b3b4..ee0e17fac0 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -837,23 +837,17 @@ void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceTy /** * Create a new custom news item. * @param flags type of operation - * @param tile unused - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 7) - NewsType of the message. - * - p1 = (bit 8 - 15) - NewsReferenceType of first reference. - * - p1 = (bit 16 - 23) - Company this news message is for. - * @param p2 First reference of the news message. + * @aram type NewsType of the message. + * @param reftype1 NewsReferenceType of first reference. + * @param company Company this news message is for. + * @param reference First reference of the news message. * @param text The text of the news message. * @return the cost of this operation or an error */ -CommandCost CmdCustomNewsItem(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCustomNewsItem(DoCommandFlag flags, NewsType type, NewsReferenceType reftype1, CompanyID company, uint32 reference, const std::string &text) { if (_current_company != OWNER_DEITY) return CMD_ERROR; - NewsType type = (NewsType)GB(p1, 0, 8); - NewsReferenceType reftype1 = (NewsReferenceType)GB(p1, 8, 8); - CompanyID company = (CompanyID)GB(p1, 16, 8); - if (company != INVALID_OWNER && !Company::IsValidID(company)) return CMD_ERROR; if (type >= NT_END) return CMD_ERROR; if (text.empty()) return CMD_ERROR; @@ -861,27 +855,27 @@ CommandCost CmdCustomNewsItem(DoCommandFlag flags, TileIndex tile, uint32 p1, ui switch (reftype1) { case NR_NONE: break; case NR_TILE: - if (!IsValidTile(p2)) return CMD_ERROR; + if (!IsValidTile(reference)) return CMD_ERROR; break; case NR_VEHICLE: - if (!Vehicle::IsValidID(p2)) return CMD_ERROR; + if (!Vehicle::IsValidID(reference)) return CMD_ERROR; break; case NR_STATION: - if (!Station::IsValidID(p2)) return CMD_ERROR; + if (!Station::IsValidID(reference)) return CMD_ERROR; break; case NR_INDUSTRY: - if (!Industry::IsValidID(p2)) return CMD_ERROR; + if (!Industry::IsValidID(reference)) return CMD_ERROR; break; case NR_TOWN: - if (!Town::IsValidID(p2)) return CMD_ERROR; + if (!Town::IsValidID(reference)) return CMD_ERROR; break; case NR_ENGINE: - if (!Engine::IsValidID(p2)) return CMD_ERROR; + if (!Engine::IsValidID(reference)) return CMD_ERROR; break; default: return CMD_ERROR; @@ -892,7 +886,7 @@ CommandCost CmdCustomNewsItem(DoCommandFlag flags, TileIndex tile, uint32 p1, ui if (flags & DC_EXEC) { NewsStringData *news = new NewsStringData(text); SetDParamStr(0, news->string); - AddNewsItem(STR_NEWS_CUSTOM_ITEM, type, NF_NORMAL, reftype1, p2, NR_NONE, UINT32_MAX, news); + AddNewsItem(STR_NEWS_CUSTOM_ITEM, type, NF_NORMAL, reftype1, reference, NR_NONE, UINT32_MAX, news); } return CommandCost(); diff --git a/src/news_type.h b/src/news_type.h index 188305b52f..7d9f6b7720 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -18,7 +18,7 @@ /** * Type of news. */ -enum NewsType { +enum NewsType : byte { NT_ARRIVAL_COMPANY, ///< First vehicle arrived for company NT_ARRIVAL_OTHER, ///< First vehicle arrived for competitor NT_ACCIDENT, ///< An accident or disaster has occurred @@ -47,7 +47,7 @@ enum NewsType { * You have to make sure, #ChangeVehicleNews catches the DParams of your message. * This is NOT ensured by the references. */ -enum NewsReferenceType { +enum NewsReferenceType : byte { NR_NONE, ///< Empty reference NR_TILE, ///< Reference tile. Scroll to tile when clicking on the news. NR_VEHICLE, ///< Reference vehicle. Scroll to vehicle when clicking on the news. Delete news when vehicle is deleted. diff --git a/src/openttd.cpp b/src/openttd.cpp index c5c849e71c..230529a786 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -852,7 +852,7 @@ static void MakeNewGameDone() /* In a dedicated server, the server does not play */ if (!VideoDriver::GetInstance()->HasGUI()) { OnStartGame(true); - if (_settings_client.gui.pause_on_newgame) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); + if (_settings_client.gui.pause_on_newgame) Command::Post(PM_PAUSED_NORMAL, true); return; } @@ -881,7 +881,7 @@ static void MakeNewGameDone() NetworkChangeCompanyPassword(_local_company, _settings_client.network.default_company_pass); } - if (_settings_client.gui.pause_on_newgame) Command::Post(0, PM_PAUSED_NORMAL, 1, {}); + if (_settings_client.gui.pause_on_newgame) Command::Post(PM_PAUSED_NORMAL, true); CheckEngines(); CheckIndustries(); @@ -1046,7 +1046,7 @@ void SwitchToMode(SwitchMode new_mode) } OnStartGame(_network_dedicated); /* Decrease pause counter (was increased from opening load dialog) */ - Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); + Command::Post(PM_PAUSED_SAVELOAD, false); } break; } @@ -1068,7 +1068,7 @@ void SwitchToMode(SwitchMode new_mode) SetLocalCompany(OWNER_NONE); _settings_newgame.game_creation.starting_year = _cur_year; /* Cancel the saveload pausing */ - Command::Post(0, PM_PAUSED_SAVELOAD, 0, {}); + Command::Post(PM_PAUSED_SAVELOAD, false); } else { SetDParamStr(0, GetSaveLoadErrorString()); ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR); diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp index 1cc69bc93f..6a06852da5 100644 --- a/src/script/api/script_company.cpp +++ b/src/script/api/script_company.cpp @@ -52,7 +52,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_COMPANY_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::Command::Do(0, 0, 0, text); + return ScriptObject::Command::Do(text); } /* static */ char *ScriptCompany::GetName(ScriptCompany::CompanyID company) @@ -73,7 +73,7 @@ EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_PRESIDENT_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); - return ScriptObject::Command::Do(0, 0, 0, text); + return ScriptObject::Command::Do(text); } /* static */ char *ScriptCompany::GetPresidentName(ScriptCompany::CompanyID company) @@ -101,7 +101,7 @@ GenderEthnicity ge = (GenderEthnicity)((gender == GENDER_FEMALE ? (1 << ::GENDER_FEMALE) : 0) | (::InteractiveRandom() & (1 << ETHNICITY_BLACK))); RandomCompanyManagerFaceBits(cmf, ge, false); - return ScriptObject::Command::Do(0, 0, cmf, {}); + return ScriptObject::Command::Do(cmf); } /* static */ ScriptCompany::Gender ScriptCompany::GetPresidentGender(CompanyID company) @@ -211,9 +211,9 @@ Money amount = abs(loan - GetLoanAmount()); if (loan > GetLoanAmount()) { - return ScriptObject::Command::Do(0, amount >> 32, (amount & 0xFFFFFFFC) | 2, {}); + return ScriptObject::Command::Do(LoanCommand::Amount, amount); } else { - return ScriptObject::Command::Do(0, amount >> 32, (amount & 0xFFFFFFFC) | 2, {}); + return ScriptObject::Command::Do(LoanCommand::Amount, amount); } } @@ -244,7 +244,7 @@ EnforcePrecondition(false, company != COMPANY_INVALID); /* Network commands only allow 0 to indicate invalid tiles, not INVALID_TILE */ - return ScriptObject::Command::Do(tile == INVALID_TILE ? (TileIndex)0U : tile, (uint32)(delta), company | expenses_type << 8, {}); + return ScriptObject::Command::Do(tile == INVALID_TILE ? (TileIndex)0U : tile, delta, (::CompanyID)company, (::ExpensesType)expenses_type); } /* static */ bool ScriptCompany::BuildCompanyHQ(TileIndex tile) @@ -266,7 +266,7 @@ /* static */ bool ScriptCompany::SetAutoRenewStatus(bool autorenew) { - return ScriptObject::Command::Do(0, 0, autorenew ? 1 : 0, "company.engine_renew"); + return ScriptObject::Command::Do("company.engine_renew", autorenew ? 1 : 0); } /* static */ bool ScriptCompany::GetAutoRenewStatus(CompanyID company) @@ -279,7 +279,7 @@ /* static */ bool ScriptCompany::SetAutoRenewMonths(int16 months) { - return ScriptObject::Command::Do(0, 0, months, "company.engine_renew_months"); + return ScriptObject::Command::Do("company.engine_renew_months", months); } /* static */ int16 ScriptCompany::GetAutoRenewMonths(CompanyID company) @@ -294,7 +294,7 @@ { EnforcePrecondition(false, money >= 0); EnforcePrecondition(false, (int64)money <= UINT32_MAX); - return ScriptObject::Command::Do(0, 0, money, "company.engine_renew_money"); + return ScriptObject::Command::Do("company.engine_renew_money", money); } /* static */ Money ScriptCompany::GetAutoRenewMoney(CompanyID company) @@ -307,12 +307,12 @@ /* static */ bool ScriptCompany::SetPrimaryLiveryColour(LiveryScheme scheme, Colours colour) { - return ScriptObject::Command::Do(0, scheme, colour, {}); + return ScriptObject::Command::Do((::LiveryScheme)scheme, true, (::Colours)colour); } /* static */ bool ScriptCompany::SetSecondaryLiveryColour(LiveryScheme scheme, Colours colour) { - return ScriptObject::Command::Do(0, scheme | 1 << 8, colour, {}); + return ScriptObject::Command::Do((::LiveryScheme)scheme, false, (::Colours)colour); } /* static */ ScriptCompany::Colours ScriptCompany::GetPrimaryLiveryColour(ScriptCompany::LiveryScheme scheme) diff --git a/src/script/api/script_controller.cpp b/src/script/api/script_controller.cpp index 74a3ad3ea8..232ce5a3b6 100644 --- a/src/script/api/script_controller.cpp +++ b/src/script/api/script_controller.cpp @@ -60,7 +60,7 @@ ShowAIDebugWindow(ScriptObject::GetRootCompany()); if ((_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED) { - ScriptObject::Command::Do(0, PM_PAUSED_NORMAL, 1, {}); + ScriptObject::Command::Do(PM_PAUSED_NORMAL, true); } } diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index e876febc28..e9349a035f 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -117,7 +117,7 @@ bool ScriptEventEnginePreview::AcceptPreview() bool ScriptEventCompanyAskMerger::AcceptMerger() { - return ScriptObject::Command::Do(0, this->owner, 0, {}); + return ScriptObject::Command::Do((::CompanyID)this->owner); } ScriptEventAdminPort::ScriptEventAdminPort(const std::string &json) : diff --git a/src/script/api/script_game.cpp b/src/script/api/script_game.cpp index 9b40a1cd3b..3df6aef154 100644 --- a/src/script/api/script_game.cpp +++ b/src/script/api/script_game.cpp @@ -18,12 +18,12 @@ /* static */ bool ScriptGame::Pause() { - return ScriptObject::Command::Do(0, PM_PAUSED_GAME_SCRIPT, 1, {}); + return ScriptObject::Command::Do(PM_PAUSED_GAME_SCRIPT, true); } /* static */ bool ScriptGame::Unpause() { - return ScriptObject::Command::Do(0, PM_PAUSED_GAME_SCRIPT, 0, {}); + return ScriptObject::Command::Do(PM_PAUSED_GAME_SCRIPT, false); } /* static */ bool ScriptGame::IsPaused() diff --git a/src/script/api/script_gamesettings.cpp b/src/script/api/script_gamesettings.cpp index 611b78b8b6..2791aba006 100644 --- a/src/script/api/script_gamesettings.cpp +++ b/src/script/api/script_gamesettings.cpp @@ -38,7 +38,7 @@ if ((sd->flags & SF_NO_NETWORK_SYNC) != 0) return false; - return ScriptObject::Command::Do(0, 0, value, sd->GetName()); + return ScriptObject::Command::Do(sd->GetName(), value); } /* static */ bool ScriptGameSettings::IsDisabledVehicleType(ScriptVehicle::VehicleType vehicle_type) diff --git a/src/script/api/script_group.cpp b/src/script/api/script_group.cpp index 5047dc5c0e..dbf4c0280e 100644 --- a/src/script/api/script_group.cpp +++ b/src/script/api/script_group.cpp @@ -130,7 +130,7 @@ { if (HasWagonRemoval() == enable_removal) return true; - return ScriptObject::Command::Do(0, 0, enable_removal ? 1 : 0, "company.renew_keep_length"); + return ScriptObject::Command::Do("company.renew_keep_length", enable_removal ? 1 : 0); } /* static */ bool ScriptGroup::HasWagonRemoval() diff --git a/src/script/api/script_news.cpp b/src/script/api/script_news.cpp index 7f46f5aa6c..119cbc735c 100644 --- a/src/script/api/script_news.cpp +++ b/src/script/api/script_news.cpp @@ -39,5 +39,5 @@ if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; if (ref_type == NR_NONE) reference = 0; - return ScriptObject::Command::Do(0, type | (ref_type << 8) | (c << 16), reference, encoded); + return ScriptObject::Command::Do((::NewsType)type, (::NewsReferenceType)ref_type, (::CompanyID)c, reference, encoded); } diff --git a/src/script/api/script_subsidy.cpp b/src/script/api/script_subsidy.cpp index 32962d1581..5e1180d1bb 100644 --- a/src/script/api/script_subsidy.cpp +++ b/src/script/api/script_subsidy.cpp @@ -39,7 +39,7 @@ EnforcePrecondition(false, (from_type == SPT_INDUSTRY && ScriptIndustry::IsValidIndustry(from_id)) || (from_type == SPT_TOWN && ScriptTown::IsValidTown(from_id))); EnforcePrecondition(false, (to_type == SPT_INDUSTRY && ScriptIndustry::IsValidIndustry(to_id)) || (to_type == SPT_TOWN && ScriptTown::IsValidTown(to_id))); - return ScriptObject::Command::Do(0, from_type | (from_id << 8) | (cargo_type << 24), to_type | (to_id << 8), {}); + return ScriptObject::Command::Do(cargo_type, (::SourceType)from_type, from_id, (::SourceType)to_type, to_id); } /* static */ ScriptCompany::CompanyID ScriptSubsidy::GetAwardedTo(SubsidyID subsidy_id) diff --git a/src/settings.cpp b/src/settings.cpp index 3c0f92f39b..25eeb964a5 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1487,18 +1487,16 @@ const SettingDesc *GetSettingFromName(const std::string_view name) /** * Network-safe changing of settings (server-only). * @param flags operation to perform - * @param tile unused - * @param p1 unused - * @param p2 the new value for the setting + * @param name the name of the setting to change + * @param value the new value for the setting * The new value is properly clamped to its minimum/maximum when setting - * @param text the name of the setting to change * @return the cost of this operation or an error * @see _settings */ -CommandCost CmdChangeSetting(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeSetting(DoCommandFlag flags, const std::string &name, int32 value) { - if (text.empty()) return CMD_ERROR; - const SettingDesc *sd = GetSettingFromName(text); + if (name.empty()) return CMD_ERROR; + const SettingDesc *sd = GetSettingFromName(name); if (sd == nullptr) return CMD_ERROR; if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) return CMD_ERROR; @@ -1507,7 +1505,7 @@ CommandCost CmdChangeSetting(DoCommandFlag flags, TileIndex tile, uint32 p1, uin if (!sd->IsEditable(true)) return CMD_ERROR; if (flags & DC_EXEC) { - sd->AsIntSetting()->ChangeValue(&GetGameSettings(), p2); + sd->AsIntSetting()->ChangeValue(&GetGameSettings(), value); } return CommandCost(); @@ -1516,23 +1514,21 @@ CommandCost CmdChangeSetting(DoCommandFlag flags, TileIndex tile, uint32 p1, uin /** * Change one of the per-company settings. * @param flags operation to perform - * @param tile unused - * @param p1 unused - * @param p2 the new value for the setting + * @param name the name of the company setting to change + * @param value the new value for the setting * The new value is properly clamped to its minimum/maximum when setting - * @param text the name of the company setting to change * @return the cost of this operation or an error */ -CommandCost CmdChangeCompanySetting(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdChangeCompanySetting(DoCommandFlag flags, const std::string &name, int32 value) { - if (text.empty()) return CMD_ERROR; - const SettingDesc *sd = GetCompanySettingFromName(text.c_str()); + if (name.empty()) return CMD_ERROR; + const SettingDesc *sd = GetCompanySettingFromName(name); if (sd == nullptr) return CMD_ERROR; if (!sd->IsIntSetting()) return CMD_ERROR; if (flags & DC_EXEC) { - sd->AsIntSetting()->ChangeValue(&Company::Get(_current_company)->settings, p2); + sd->AsIntSetting()->ChangeValue(&Company::Get(_current_company)->settings, value); } return CommandCost(); @@ -1550,7 +1546,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame) const IntSettingDesc *setting = sd->AsIntSetting(); if ((setting->flags & SF_PER_COMPANY) != 0) { if (Company::IsValidID(_local_company) && _game_mode != GM_MENU) { - return Command::Post(0, 0, value, setting->GetName()); + return Command::Post(setting->GetName(), value); } setting->ChangeValue(&_settings_client.company, value); @@ -1576,7 +1572,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame) /* send non-company-based settings over the network */ if (!_networking || (_networking && _network_server)) { - return Command::Post(0, 0, value, setting->GetName()); + return Command::Post(setting->GetName(), value); } return false; } @@ -1604,7 +1600,7 @@ void SyncCompanySettings() const SettingDesc *sd = GetSettingDesc(desc); uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object); uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object); - if (old_value != new_value) Command::SendNet(STR_NULL, nullptr, _local_company, 0, 0, new_value, sd->GetName()); + if (old_value != new_value) Command::SendNet(STR_NULL, nullptr, _local_company, sd->GetName(), new_value); } } diff --git a/src/settings_cmd.h b/src/settings_cmd.h index 15b9c31a48..d41f229e1b 100644 --- a/src/settings_cmd.h +++ b/src/settings_cmd.h @@ -12,8 +12,8 @@ #include "command_type.h" -CommandProc CmdChangeSetting; -CommandProc CmdChangeCompanySetting; +CommandCost CmdChangeSetting(DoCommandFlag flags, const std::string &name, int32 value); +CommandCost CmdChangeCompanySetting(DoCommandFlag flags, const std::string &name, int32 value); DEF_CMD_TRAIT(CMD_CHANGE_SETTING, CmdChangeSetting, CMD_SERVER, CMDT_SERVER_SETTING) DEF_CMD_TRAIT(CMD_CHANGE_COMPANY_SETTING, CmdChangeCompanySetting, 0, CMDT_COMPANY_SETTING) diff --git a/src/subsidy.cpp b/src/subsidy.cpp index 992c7a6726..0c32dbcf12 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -232,27 +232,17 @@ void CreateSubsidy(CargoID cid, SourceType src_type, SourceID src, SourceType ds /** * Create a new subsidy. * @param flags type of operation - * @param tile unused. - * @param p1 various bitstuffed elements - * - p1 = (bit 0 - 7) - SourceType of source. - * - p1 = (bit 8 - 23) - SourceID of source. - * - p1 = (bit 24 - 31) - CargoID of subsidy. - * @param p2 various bitstuffed elements - * - p2 = (bit 0 - 7) - SourceType of destination. - * - p2 = (bit 8 - 23) - SourceID of destination. - * @param text unused. + * @param cid CargoID of subsidy. + * @param src_type SourceType of source. + * @param src SourceID of source. + * @param dst_type SourceType of destination. + * @param dst SourceID of destination. * @return the cost of this operation or an error */ -CommandCost CmdCreateSubsidy(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +CommandCost CmdCreateSubsidy(DoCommandFlag flags, CargoID cid, SourceType src_type, SourceID src, SourceType dst_type, SourceID dst) { if (!Subsidy::CanAllocateItem()) return CMD_ERROR; - CargoID cid = GB(p1, 24, 8); - SourceType src_type = (SourceType)GB(p1, 0, 8); - SourceID src = GB(p1, 8, 16); - SourceType dst_type = (SourceType)GB(p2, 0, 8); - SourceID dst = GB(p2, 8, 16); - if (_current_company != OWNER_DEITY) return CMD_ERROR; if (cid >= NUM_CARGO || !::CargoSpec::Get(cid)->IsValid()) return CMD_ERROR; diff --git a/src/subsidy_cmd.h b/src/subsidy_cmd.h index f68c9b3034..d018688dad 100644 --- a/src/subsidy_cmd.h +++ b/src/subsidy_cmd.h @@ -11,8 +11,9 @@ #define SUBSIDY_CMD_H #include "command_type.h" +#include "cargo_type.h" -CommandProc CmdCreateSubsidy; +CommandCost CmdCreateSubsidy(DoCommandFlag flags, CargoID cid, SourceType src_type, SourceID src, SourceType dst_type, SourceID dst); DEF_CMD_TRAIT(CMD_CREATE_SUBSIDY, CmdCreateSubsidy, CMD_DEITY, CMDT_OTHER_MANAGEMENT) diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index b2b25afa6c..13c52f2b4e 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -266,7 +266,7 @@ static CallBackFunction ToolbarPauseClick(Window *w) { if (_networking && !_network_server) return CBF_NONE; // only server can pause the game - if (Command::Post(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, {})) { + if (Command::Post(PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED)) { if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP); } return CBF_NONE; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 8bfc332f65..6bb8d0986a 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -88,7 +88,7 @@ void CheckTrainsLengths() if (!_networking && first) { first = false; - Command::Post(0, PM_PAUSED_ERROR, 1, {}); + Command::Post(PM_PAUSED_ERROR, true); } /* Break so we warn only once for each train. */ break; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index d5d39b6e8d..3bbca46f0e 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -311,7 +311,7 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF SetDParamStr(0, grfconfig->GetName()); SetDParam(1, engine); ShowErrorMessage(part1, part2, WL_CRITICAL); - if (!_networking) Command::Do(DC_EXEC, 0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1, {}); + if (!_networking) Command::Do(DC_EXEC, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, true); } /* debug output */ From d85348b1d1b9aa7099255eda7c1058f9749d1003 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 28 Nov 2021 17:37:04 +0100 Subject: [PATCH 134/710] Codechange: Template the command callback function type to allow unpacked arguments. --- src/command_func.h | 58 ++++++++---- src/network/network_client.cpp | 2 +- src/network/network_command.cpp | 156 ++++++++++++++++++++++---------- src/network/network_gui.cpp | 2 +- src/network/network_server.cpp | 2 +- src/order_backup.cpp | 2 +- src/settings.cpp | 2 +- 7 files changed, 153 insertions(+), 71 deletions(-) diff --git a/src/command_func.h b/src/command_func.h index 2a1c3dc37b..1793812a22 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -78,6 +78,20 @@ private: static int _counter; }; +#if defined(__GNUC__) && !defined(__clang__) +/* + * We cast specialized function pointers to a generic one, but don't use the + * converted value to call the function, which is safe, except that GCC + * helpfully thinks it is not. + * + * "Any pointer to function can be converted to a pointer to a different function type. + * Calling the function through a pointer to a different function type is undefined, + * but converting such pointer back to pointer to the original function type yields + * the pointer to the original function." */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +# define SILENCE_GCC_FUNCTION_POINTER_CAST +#endif template struct CommandHelper; @@ -148,18 +162,19 @@ public: * @param err_message Message prefix to show on error * @param args Parameters for the command */ - static inline bool Post(StringID err_message, Targs... args) { return Post(err_message, nullptr, std::forward(args)...); } + static inline bool Post(StringID err_message, Targs... args) { return Post(err_message, nullptr, std::forward(args)...); } /** * Shortcut for the long Post when not using an error message. * @param callback A callback function to call after the command is finished * @param args Parameters for the command */ - static inline bool Post(CommandCallback *callback, Targs... args) { return Post((StringID)0, callback, std::forward(args)...); } + template + static inline bool Post(Tcallback *callback, Targs... args) { return Post((StringID)0, callback, std::forward(args)...); } /** * Shortcut for the long Post when not using a callback or an error message. * @param args Parameters for the command */ - static inline bool Post(Targs... args) { return Post((StringID)0, nullptr, std::forward(args)...); } + static inline bool Post(Targs... args) { return Post((StringID)0, nullptr, std::forward(args)...); } /** * Top-level network safe command execution for the current company. @@ -171,7 +186,8 @@ public: * @param args Parameters for the command * @return \c true if the command succeeded, else \c false. */ - static bool Post(StringID err_message, CommandCallback *callback, Targs... args) + template + static bool Post(StringID err_message, Tcallback *callback, Targs... args) { return InternalPost(err_message, callback, true, false, std::forward_as_tuple(args...)); } @@ -185,7 +201,8 @@ public: * @param args Parameters for the command * @return \c true if the command succeeded, else \c false. */ - static bool PostFromNet(StringID err_message, CommandCallback *callback, bool my_cmd, TileIndex location, std::tuple args) + template + static bool PostFromNet(StringID err_message, Tcallback *callback, bool my_cmd, TileIndex location, std::tuple args) { return InternalPost(err_message, callback, my_cmd, true, location, std::move(args)); } @@ -194,11 +211,10 @@ public: * Prepare a command to be send over the network * @param cmd The command to execute (a CMD_* value) * @param err_message Message prefix to show on error - * @param callback A callback function to call after the command is finished * @param company The company that wants to send the command * @param args Parameters for the command */ - static void SendNet(StringID err_message, CommandCallback *callback, CompanyID company, Targs... args) + static void SendNet(StringID err_message, CompanyID company, Targs... args) { auto args_tuple = std::forward_as_tuple(args...); @@ -207,7 +223,7 @@ public: tile = std::get<0>(args_tuple); } - ::NetworkSendCommand(Tcmd, err_message, callback, _current_company, tile, EndianBufferWriter::FromValue(args_tuple)); + ::NetworkSendCommand(Tcmd, err_message, nullptr, _current_company, tile, EndianBufferWriter::FromValue(args_tuple)); } /** @@ -220,9 +236,10 @@ public: * @param args Parameters for the command * @return the command cost of this function. */ - static CommandCost Unsafe(StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, TileIndex location, std::tuple args) + template + static CommandCost Unsafe(StringID err_message, Tcallback *callback, bool my_cmd, bool estimate_only, TileIndex location, std::tuple args) { - return Execute(err_message, callback, my_cmd, estimate_only, false, location, std::move(args)); + return Execute(err_message, reinterpret_cast(callback), my_cmd, estimate_only, false, location, std::move(args)); } protected: @@ -242,7 +259,8 @@ protected: ((SetClientIdHelper(std::get(values))), ...); } - static bool InternalPost(StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, std::tuple args) + template + static bool InternalPost(StringID err_message, Tcallback *callback, bool my_cmd, bool network_command, std::tuple args) { /* Where to show the message? */ TileIndex tile{}; @@ -253,7 +271,8 @@ protected: return InternalPost(err_message, callback, my_cmd, network_command, tile, std::move(args)); } - static bool InternalPost(StringID err_message, CommandCallback *callback, bool my_cmd, bool network_command, TileIndex tile, std::tuple args) + template + static bool InternalPost(StringID err_message, Tcallback *callback, bool my_cmd, bool network_command, TileIndex tile, std::tuple args) { auto [err, estimate_only, only_sending] = InternalPostBefore(Tcmd, GetCommandFlags(), tile, err_message, network_command); if (err) return false; @@ -261,7 +280,7 @@ protected: /* Only set client IDs when the command does not come from the network. */ if (!network_command && GetCommandFlags() & CMD_CLIENT_ID) SetClientIds(args, std::index_sequence_for{}); - CommandCost res = Execute(err_message, callback, my_cmd, estimate_only, network_command, tile, args); + CommandCost res = Execute(err_message, reinterpret_cast(callback), my_cmd, estimate_only, network_command, tile, args); InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd); if (!estimate_only && !only_sending && callback != nullptr) { @@ -360,20 +379,21 @@ struct CommandHelper : Com * @param location Tile location for user feedback. * @param args Parameters for the command */ - static inline bool Post(StringID err_message, TileIndex location, Targs... args) { return Post(err_message, nullptr, location, std::forward(args)...); } + static inline bool Post(StringID err_message, TileIndex location, Targs... args) { return Post(err_message, nullptr, location, std::forward(args)...); } /** * Shortcut for Post when not using a callback. * @param callback A callback function to call after the command is finished * @param location Tile location for user feedback. * @param args Parameters for the command */ - static inline bool Post(CommandCallback *callback, TileIndex location, Targs... args) { return Post((StringID)0, callback, location, std::forward(args)...); } + template + static inline bool Post(Tcallback *callback, TileIndex location, Targs... args) { return Post((StringID)0, callback, location, std::forward(args)...); } /** * Shortcut for Post when not using a callback or an error message. * @param location Tile location for user feedback. * @param args Parameters for the command* */ - static inline bool Post(TileIndex location, Targs... args) { return Post((StringID)0, nullptr, location, std::forward(args)...); } + static inline bool Post(TileIndex location, Targs... args) { return Post((StringID)0, nullptr, location, std::forward(args)...); } /** * Post variant that takes a TileIndex (for error window location and text effects) for @@ -384,12 +404,16 @@ struct CommandHelper : Com * @param args Parameters for the command * @return \c true if the command succeeded, else \c false. */ - static inline bool Post(StringID err_message, CommandCallback *callback, TileIndex location, Targs... args) + template + static inline bool Post(StringID err_message, Tcallback *callback, TileIndex location, Targs... args) { return CommandHelper::InternalPost(err_message, callback, true, false, location, std::forward_as_tuple(args...)); } }; +#ifdef SILENCE_GCC_FUNCTION_POINTER_CAST +# pragma GCC diagnostic pop +#endif template using Command = CommandHelper::ProcType, std::is_same_v::Args>>>; diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 1868f5e603..fea018a1c9 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -840,7 +840,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(Packet * the server will give us a client-id and let us in */ _network_join_status = NETWORK_JOIN_STATUS_REGISTERING; ShowJoinStatusWindow(); - Command::SendNet(STR_NULL, nullptr, _local_company, CCA_NEW, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); + Command::SendNet(STR_NULL, _local_company, CCA_NEW, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); } } else { /* take control over an existing company */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 58de73b198..28300310bd 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -53,55 +53,95 @@ #include "../safeguards.h" -/** Table with all the callbacks we'll use for conversion*/ -static CommandCallback * const _callback_table[] = { - /* 0x00 */ nullptr, - /* 0x01 */ CcBuildPrimaryVehicle, - /* 0x02 */ CcBuildAirport, - /* 0x03 */ CcBuildBridge, - /* 0x04 */ CcPlaySound_CONSTRUCTION_WATER, - /* 0x05 */ CcBuildDocks, - /* 0x06 */ CcFoundTown, - /* 0x07 */ CcBuildRoadTunnel, - /* 0x08 */ CcBuildRailTunnel, - /* 0x09 */ CcBuildWagon, - /* 0x0A */ CcRoadDepot, - /* 0x0B */ CcRailDepot, - /* 0x0C */ CcPlaceSign, - /* 0x0D */ CcPlaySound_EXPLOSION, - /* 0x0E */ CcPlaySound_CONSTRUCTION_OTHER, - /* 0x0F */ CcPlaySound_CONSTRUCTION_RAIL, - /* 0x10 */ CcStation, - /* 0x11 */ CcTerraform, - /* 0x12 */ CcAI, - /* 0x13 */ CcCloneVehicle, - /* 0x14 */ nullptr, - /* 0x15 */ CcCreateGroup, - /* 0x16 */ CcFoundRandomTown, - /* 0x17 */ CcRoadStop, - /* 0x18 */ CcBuildIndustry, - /* 0x19 */ CcStartStopVehicle, - /* 0x1A */ CcGame, - /* 0x1B */ CcAddVehicleNewGroup, -}; +/** Typed list of all possible callbacks. */ +static constexpr auto _callback_tuple = std::make_tuple( + (CommandCallback *)nullptr, // Make sure this is actually a pointer-to-function. + &CcBuildPrimaryVehicle, + &CcBuildAirport, + &CcBuildBridge, + &CcPlaySound_CONSTRUCTION_WATER, + &CcBuildDocks, + &CcFoundTown, + &CcBuildRoadTunnel, + &CcBuildRailTunnel, + &CcBuildWagon, + &CcRoadDepot, + &CcRailDepot, + &CcPlaceSign, + &CcPlaySound_EXPLOSION, + &CcPlaySound_CONSTRUCTION_OTHER, + &CcPlaySound_CONSTRUCTION_RAIL, + &CcStation, + &CcTerraform, + &CcAI, + &CcCloneVehicle, + &CcCreateGroup, + &CcFoundRandomTown, + &CcRoadStop, + &CcBuildIndustry, + &CcStartStopVehicle, + &CcGame, + &CcAddVehicleNewGroup +); + +#ifdef SILENCE_GCC_FUNCTION_POINTER_CAST +/* + * We cast specialized function pointers to a generic one, but don't use the + * converted value to call the function, which is safe, except that GCC + * helpfully thinks it is not. + * + * "Any pointer to function can be converted to a pointer to a different function type. + * Calling the function through a pointer to a different function type is undefined, + * but converting such pointer back to pointer to the original function type yields + * the pointer to the original function." */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +#endif + +/* Helpers to generate the callback table from the callback list. */ + +inline constexpr size_t _callback_tuple_size = std::tuple_size_v; + +template +inline auto MakeCallbackTable(std::index_sequence) noexcept +{ + return std::array{{ reinterpret_cast(reinterpret_cast(std::get(_callback_tuple)))... }}; // MingW64 fails linking when casting a pointer to its own type. To work around, cast it to some other type first. +} + +/** Type-erased table of callbacks. */ +static auto _callback_table = MakeCallbackTable(std::make_index_sequence<_callback_tuple_size>{}); + /* Helpers to generate the command dispatch table from the command traits. */ template static CommandDataBuffer SanitizeCmdStrings(const CommandDataBuffer &data); -template static void UnpackNetworkCommand(const CommandPacket *cp); +template static void UnpackNetworkCommand(const CommandPacket *cp); template static void NetworkReplaceCommandClientId(CommandPacket &cp, ClientID client_id); +using UnpackNetworkCommandProc = void (*)(const CommandPacket *); +using UnpackDispatchT = std::array; struct CommandDispatch { CommandDataBuffer(*Sanitize)(const CommandDataBuffer &); void (*ReplaceClientId)(CommandPacket &, ClientID); - void (*Unpack)(const CommandPacket *); + UnpackDispatchT Unpack; }; -template -inline constexpr auto MakeDispatchTable(std::integer_sequence) noexcept +template +constexpr UnpackDispatchT MakeUnpackNetworkCommand(std::index_sequence) noexcept { - return std::array{{ { &SanitizeCmdStrings(i)>, &NetworkReplaceCommandClientId(i)>, &UnpackNetworkCommand(i)> }... }}; + return UnpackDispatchT{{ {&UnpackNetworkCommand}... }}; } -static constexpr auto _cmd_dispatch = MakeDispatchTable(std::make_integer_sequence, CMD_END>{}); + +template +inline constexpr auto MakeDispatchTable(std::integer_sequence, std::index_sequence) noexcept +{ + return std::array{{ { &SanitizeCmdStrings(i)>, &NetworkReplaceCommandClientId(i)>, MakeUnpackNetworkCommand(i)>(std::make_index_sequence<_callback_tuple_size>{}) }... }}; +} +/** Command dispatch table. */ +static constexpr auto _cmd_dispatch = MakeDispatchTable(std::make_integer_sequence, CMD_END>{}, std::make_index_sequence<_callback_tuple_size>{}); + +#ifdef SILENCE_GCC_FUNCTION_POINTER_CAST +# pragma GCC diagnostic pop +#endif /** @@ -179,6 +219,20 @@ static CommandQueue _local_wait_queue; static CommandQueue _local_execution_queue; +/** + * Find the callback index of a callback pointer. + * @param callback Address of callback to search for. + * @return Callback index or std::numeric_limits::max() if the function wasn't found in the callback list. + */ +static size_t FindCallbackIndex(CommandCallback *callback) +{ + if (auto it = std::find(std::cbegin(_callback_table), std::cend(_callback_table), callback); it != std::cend(_callback_table)) { + return static_cast(std::distance(std::cbegin(_callback_table), it)); + } + + return std::numeric_limits::max(); +} + /** * Prepare a DoCommand to be send over the network * @param cmd The command to execute (a CMD_* value) @@ -259,7 +313,9 @@ void NetworkExecuteLocalCommandQueue() /* We can execute this command */ _current_company = cp->company; - _cmd_dispatch[cp->cmd].Unpack(cp); + size_t cb_index = FindCallbackIndex(cp->callback); + assert(cb_index < _callback_tuple_size); + _cmd_dispatch[cp->cmd].Unpack[cb_index](cp); queue.Pop(); delete cp; @@ -354,7 +410,7 @@ const char *NetworkGameSocketHandler::ReceiveCommand(Packet *p, CommandPacket *c cp->data = _cmd_dispatch[cp->cmd].Sanitize(p->Recv_buffer()); byte callback = p->Recv_uint8(); - if (callback >= lengthof(_callback_table)) return "invalid callback"; + if (callback >= _callback_table.size()) return "invalid callback"; cp->callback = _callback_table[callback]; return nullptr; @@ -373,16 +429,12 @@ void NetworkGameSocketHandler::SendCommand(Packet *p, const CommandPacket *cp) p->Send_uint32(cp->tile); p->Send_buffer(cp->data); - byte callback = 0; - while (callback < lengthof(_callback_table) && _callback_table[callback] != cp->callback) { - callback++; - } - - if (callback == lengthof(_callback_table)) { + size_t callback = FindCallbackIndex(cp->callback); + if (callback > UINT8_MAX) { Debug(net, 0, "Unknown callback for command; no callback sent (command: {})", cp->cmd); callback = 0; // _callback_table[0] == nullptr } - p->Send_uint8 (callback); + p->Send_uint8 ((uint8)callback); } /** Helper to process a single ClientID argument. */ @@ -455,9 +507,15 @@ CommandDataBuffer SanitizeCmdStrings(const CommandDataBuffer &data) return EndianBufferWriter::FromValue(args); } -template -void UnpackNetworkCommand(const CommandPacket *cp) +/** + * Unpack a generic command packet into its actual typed components. + * @tparam Tcmd Command type to be unpacked. + * @tparam Tcb Index into the callback list. + * @param cp Command packet to unpack. + */ +template +void UnpackNetworkCommand(const CommandPacket* cp) { auto args = EndianBufferReader::ToValue::Args>(cp->data); - Command::PostFromNet(cp->err_msg, cp->callback, cp->my_cmd, cp->tile, args); + Command::PostFromNet(cp->err_msg, std::get(_callback_tuple), cp->my_cmd, cp->tile, args); } diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 0c7e361dd4..007dddb6d0 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1538,7 +1538,7 @@ private: if (_network_server) { Command::Post(CCA_NEW, INVALID_COMPANY, CRR_NONE, _network_own_client_id); } else { - Command::SendNet(STR_NULL, nullptr, _local_company, CCA_NEW, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); + Command::SendNet(STR_NULL, _local_company, CCA_NEW, INVALID_COMPANY, CRR_NONE, INVALID_CLIENT_ID); } } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 36ab3840a4..d3cbdf9e3a 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -2081,7 +2081,7 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci) /* ci is nullptr when replaying, or for AIs. In neither case there is a client. */ ci->client_playas = c->index; NetworkUpdateClientInfo(ci->client_id); - Command::SendNet(STR_NULL, nullptr, c->index, ci->client_name); + Command::SendNet(STR_NULL, c->index, ci->client_name); } /* Announce new company on network. */ diff --git a/src/order_backup.cpp b/src/order_backup.cpp index 46a55991da..5e634d6958 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -198,7 +198,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, ClientID us /* We need to circumvent the "prevention" from this command being executed * while the game is paused, so use the internal method. Nor do we want * this command to get its cost estimated when shift is pressed. */ - Command::Unsafe(STR_NULL, nullptr, true, false, ob->tile, CommandTraits::Args{ ob->tile, static_cast(user) }); + Command::Unsafe(STR_NULL, nullptr, true, false, ob->tile, CommandTraits::Args{ ob->tile, static_cast(user) }); } else { /* The command came from the game logic, i.e. the clearing of a tile. * In that case we have no need to actually sync this, just do it. */ diff --git a/src/settings.cpp b/src/settings.cpp index 25eeb964a5..f619760284 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1600,7 +1600,7 @@ void SyncCompanySettings() const SettingDesc *sd = GetSettingDesc(desc); uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object); uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object); - if (old_value != new_value) Command::SendNet(STR_NULL, nullptr, _local_company, sd->GetName(), new_value); + if (old_value != new_value) Command::SendNet(STR_NULL, _local_company, sd->GetName(), new_value); } } From 850385465543a9bd589084ec2ac6b0693c481fea Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 28 Nov 2021 22:43:38 +0100 Subject: [PATCH 135/710] Codechange: Pass unpacked command arguments to command callbacks (except Script). --- src/ai/ai_instance.cpp | 2 +- src/ai/ai_instance.hpp | 2 +- src/airport_gui.cpp | 2 +- src/bridge_gui.cpp | 7 +++---- src/command_func.h | 11 ++++++++++- src/command_type.h | 16 +++++++++++++++- src/depot_gui.cpp | 4 ++-- src/dock_gui.cpp | 4 ++-- src/game/game_instance.cpp | 2 +- src/game/game_instance.hpp | 2 +- src/group_cmd.h | 4 ++-- src/group_gui.cpp | 15 +++++---------- src/industry_cmd.h | 2 +- src/industry_gui.cpp | 5 ++--- src/main_gui.cpp | 2 +- src/network/network_command.cpp | 16 +++++++++++++++- src/rail_cmd.h | 2 +- src/rail_gui.cpp | 10 ++++------ src/road_cmd.h | 4 ++-- src/road_gui.cpp | 19 +++++++++---------- src/script/api/script_object.cpp | 2 +- src/script/api/script_object.hpp | 2 +- src/script/script_cmd.h | 4 ++-- src/script/script_instance.hpp | 2 +- src/signs_cmd.cpp | 7 ++----- src/terraform_gui.cpp | 2 +- src/town_gui.cpp | 4 ++-- src/train_gui.cpp | 2 +- src/tunnelbridge_cmd.h | 2 +- src/vehicle_cmd.h | 2 +- src/vehicle_gui.cpp | 11 ++++------- 31 files changed, 96 insertions(+), 75 deletions(-) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 576a81637f..e137745f19 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -113,7 +113,7 @@ void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const Command } } -CommandCallback *AIInstance::GetDoCommandCallback() +CommandCallbackData *AIInstance::GetDoCommandCallback() { return &CcAI; } diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp index f8d2100b1c..2cdabd9913 100644 --- a/src/ai/ai_instance.hpp +++ b/src/ai/ai_instance.hpp @@ -29,7 +29,7 @@ public: private: void RegisterAPI() override; void Died() override; - CommandCallback *GetDoCommandCallback() override; + CommandCallbackData *GetDoCommandCallback() override; void LoadDummyScript() override; }; diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 5efbb98a30..6700cd3bd0 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -43,7 +43,7 @@ static void ShowBuildAirportPicker(Window *parent); SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout); -void CcBuildAirport(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcBuildAirport(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 77261932b3..99628e75c4 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -53,15 +53,14 @@ typedef GUIList GUIBridgeList; ///< List of bridges, used in #B * @param result Whether the build succeeded * @param cmd unused * @param end_tile End tile of the bridge. - * @param data Additional bitstuffed command data. + * @param tile_start start tile + * @param transport_type transport type. */ -void CcBuildBridge(Commands cmd, const CommandCost &result, TileIndex end_tile, const CommandDataBuffer &data) +void CcBuildBridge(Commands cmd, const CommandCost &result, TileIndex end_tile, TileIndex tile_start, TransportType transport_type, BridgeType, byte) { if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile); - auto [tile, tile_start, transport_type, bridge_type, road_rail_type] = EndianBufferReader::ToValue::Args>(data); - if (transport_type == TRANSPORT_ROAD) { DiagDirection end_direction = ReverseDiagDir(GetTunnelBridgeDirection(end_tile)); ConnectRoadToStructure(end_tile, end_direction); diff --git a/src/command_func.h b/src/command_func.h index 1793812a22..9219fd2b5f 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -284,7 +284,16 @@ protected: InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd); if (!estimate_only && !only_sending && callback != nullptr) { - callback(Tcmd, res, tile, EndianBufferWriter::FromValue(args)); + if constexpr (std::is_same_v) { + /* Callback that doesn't need any command arguments. */ + callback(Tcmd, res, tile); + } else if constexpr (std::is_same_v) { + /* Generic callback that takes packed arguments as a buffer. */ + callback(Tcmd, res, tile, EndianBufferWriter::FromValue(args)); + } else { + /* Callback with arguments. We assume that the tile is only interesting if it actually is in the command arguments. */ + std::apply(callback, std::tuple_cat(std::make_tuple(Tcmd, res), args)); + } } return res.Succeeded(); diff --git a/src/command_type.h b/src/command_type.h index 0424782a23..f607969ccd 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -428,6 +428,20 @@ template struct CommandTraits; /** Storage buffer for serialized command data. */ typedef std::vector CommandDataBuffer; +/** + * Define a callback function for the client, after the command is finished. + * + * Functions of this type are called after the command is finished. The parameters + * are from the #CommandProc callback type. The boolean parameter indicates if the + * command succeeded or failed. + * + * @param cmd The command that was executed + * @param result The result of the executed command + * @param tile The tile of the command action + * @see CommandProc + */ +typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile); + /** * Define a callback function for the client, after the command is finished. * @@ -441,6 +455,6 @@ typedef std::vector CommandDataBuffer; * @param data Additional data of the command * @see CommandProc */ -typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data); +typedef void CommandCallbackData(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data); #endif /* COMMAND_TYPE_H */ diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 7fd2e03471..c636065824 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -114,11 +114,11 @@ extern void DepotSortList(VehicleList *list); /** * This is the Callback method after the cloning attempt of a vehicle - * @param result the result of the cloning command * @param cmd unused + * @param result the result of the cloning command * @param tile unused */ -void CcCloneVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcCloneVehicle(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index d8cd7c5d46..2ec10fe8ce 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -43,7 +43,7 @@ static void ShowBuildDocksDepotPicker(Window *parent); static Axis _ship_depot_direction; -void CcBuildDocks(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcBuildDocks(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; @@ -51,7 +51,7 @@ void CcBuildDocks(Commands cmd, const CommandCost &result, TileIndex tile, const if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcPlaySound_CONSTRUCTION_WATER(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &) +void CcPlaySound_CONSTRUCTION_WATER(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_CONSTRUCTION_WATER, tile); } diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index 8433567c7c..fa44ee97c1 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -93,7 +93,7 @@ void CcGame(Commands cmd, const CommandCost &result, TileIndex tile, const Comma } } -CommandCallback *GameInstance::GetDoCommandCallback() +CommandCallbackData *GameInstance::GetDoCommandCallback() { return &CcGame; } diff --git a/src/game/game_instance.hpp b/src/game/game_instance.hpp index 7b3b12b379..84cb20ac5a 100644 --- a/src/game/game_instance.hpp +++ b/src/game/game_instance.hpp @@ -29,7 +29,7 @@ public: private: void RegisterAPI() override; void Died() override; - CommandCallback *GetDoCommandCallback() override; + CommandCallbackData *GetDoCommandCallback() override; void LoadDummyScript() override {} }; diff --git a/src/group_cmd.h b/src/group_cmd.h index 70610de756..d3c25fda19 100644 --- a/src/group_cmd.h +++ b/src/group_cmd.h @@ -41,7 +41,7 @@ DEF_CMD_TRAIT(CMD_REMOVE_ALL_VEHICLES_GROUP, CmdRemoveAllVehiclesGroup, 0, CMDT_ DEF_CMD_TRAIT(CMD_SET_GROUP_FLAG, CmdSetGroupFlag, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_SET_GROUP_LIVERY, CmdSetGroupLivery, 0, CMDT_ROUTE_MANAGEMENT) -CommandCallback CcCreateGroup; -CommandCallback CcAddVehicleNewGroup; +void CcCreateGroup(Commands cmd, const CommandCost &result, VehicleType vt, GroupID parent_group); +void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, GroupID, VehicleID veh_id, bool); #endif /* GROUP_CMD_H */ diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 3175909f0f..f614551f7c 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1153,17 +1153,15 @@ static void CcCreateGroup(VehicleType veh_type) * Opens a 'Rename group' window for newly created group. * @param cmd Unused. * @param result Did command succeed? - * @param tile Unused. - * @param data Command data. + * @param vt Vehicle type. + * @param parent_group Parent group of the enw group. * @see CmdCreateGroup */ -void CcCreateGroup(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcCreateGroup(Commands cmd, const CommandCost &result, VehicleType vt, GroupID parent_group) { if (result.Failed()) return; - auto [vt, parent_group] = EndianBufferReader::ToValue::Args>(data); assert(vt <= VEH_AIRCRAFT); - CcCreateGroup(vt); } @@ -1171,16 +1169,13 @@ void CcCreateGroup(Commands cmd, const CommandCost &result, TileIndex tile, cons * Open rename window after adding a vehicle to a new group via drag and drop. * @param cmd Unused. * @param result Did command succeed? - * @param tile Unused. - * @param data Command data. + * @param veh_id vehicle to add to a group */ -void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcAddVehicleNewGroup(Commands cmd, const CommandCost &result, GroupID, VehicleID veh_id, bool) { if (result.Failed()) return; - auto [group_id, veh_id, shared] = EndianBufferReader::ToValue::Args>(data); assert(Vehicle::IsValidID(veh_id)); - CcCreateGroup(Vehicle::Get(veh_id)->type); } diff --git a/src/industry_cmd.h b/src/industry_cmd.h index b4d965f649..21d9200a30 100644 --- a/src/industry_cmd.h +++ b/src/industry_cmd.h @@ -23,6 +23,6 @@ CommandCost CmdIndustryCtrl(DoCommandFlag flags, IndustryID ind_id, IndustryActi DEF_CMD_TRAIT(CMD_BUILD_INDUSTRY, CmdBuildIndustry, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_INDUSTRY_CTRL, CmdIndustryCtrl, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) -CommandCallback CcBuildIndustry; +void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32, bool, uint32); #endif /* INDUSTRY_CMD_H */ diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 8bd4dc5741..cb0e89dbda 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -222,13 +222,12 @@ void SortIndustryTypes() * @param cmd Unused. * @param result Result of the command. * @param tile Tile where the industry is placed. - * @param data Additional data of the #CMD_BUILD_INDUSTRY command. + * @param indtype Industry type. */ -void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32, bool, uint32) { if (result.Succeeded()) return; - auto [tile_, indtype, first_layout, fund, seed] = EndianBufferReader::ToValue::Args>(data); if (indtype < NUM_INDUSTRYTYPES) { const IndustrySpec *indsp = GetIndustrySpec(indtype); if (indsp->enabled) { diff --git a/src/main_gui.cpp b/src/main_gui.cpp index c25186164a..b2c4bfee48 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -77,7 +77,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl } -void CcPlaySound_EXPLOSION(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcPlaySound_EXPLOSION(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 28300310bd..7b3721457c 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -507,6 +507,13 @@ CommandDataBuffer SanitizeCmdStrings(const CommandDataBuffer &data) return EndianBufferWriter::FromValue(args); } + +template struct CallbackArgsHelper; +template +struct CallbackArgsHelper { + using Args = std::tuple...>; +}; + /** * Unpack a generic command packet into its actual typed components. * @tparam Tcmd Command type to be unpacked. @@ -517,5 +524,12 @@ template void UnpackNetworkCommand(const CommandPacket* cp) { auto args = EndianBufferReader::ToValue::Args>(cp->data); - Command::PostFromNet(cp->err_msg, std::get(_callback_tuple), cp->my_cmd, cp->tile, args); + + /* Check if the callback matches with the command arguments. If not, drop the callback. */ + using Tcallback = std::tuple_element_t; + if constexpr (std::is_same_v || std::is_same_v || std::is_same_v::Args, typename CallbackArgsHelper::Args>) { + Command::PostFromNet(cp->err_msg, std::get(_callback_tuple), cp->my_cmd, cp->tile, args); + } else { + Command::PostFromNet(cp->err_msg, (CommandCallback *)nullptr, cp->my_cmd, cp->tile, args); + } } diff --git a/src/rail_cmd.h b/src/rail_cmd.h index 2299435c20..2a1b696906 100644 --- a/src/rail_cmd.h +++ b/src/rail_cmd.h @@ -38,8 +38,8 @@ DEF_CMD_TRAIT(CMD_BUILD_SIGNAL_TRACK, CmdBuildSignalTrack, CMD_AUTO, DEF_CMD_TRAIT(CMD_REMOVE_SIGNAL_TRACK, CmdRemoveSignalTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) CommandCallback CcPlaySound_CONSTRUCTION_RAIL; -CommandCallback CcRailDepot; CommandCallback CcStation; CommandCallback CcBuildRailTunnel; +void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, RailType rt, DiagDirection dir); #endif /* RAIL_CMD_H */ diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index bac59d7474..bab6b4c555 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -89,7 +89,7 @@ static bool IsStationAvailable(const StationSpec *statspec) return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); } -void CcPlaySound_CONSTRUCTION_RAIL(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &) +void CcPlaySound_CONSTRUCTION_RAIL(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); } @@ -135,12 +135,10 @@ static const DiagDirection _place_depot_extra_dir[12] = { DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE, }; -void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, RailType rt, DiagDirection dir) { if (result.Failed()) return; - auto [tile_, rt, dir] = EndianBufferReader::ToValue::Args>(data); - if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); @@ -176,7 +174,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } } -void CcStation(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcStation(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; @@ -275,7 +273,7 @@ static void PlaceRail_Bridge(TileIndex tile, Window *w) } /** Command callback for building a tunnel */ -void CcBuildRailTunnel(Commands cmd, const CommandCost &result,TileIndex tile, const CommandDataBuffer &) +void CcBuildRailTunnel(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_CONSTRUCTION_RAIL, tile); diff --git a/src/road_cmd.h b/src/road_cmd.h index 3c142bdfed..35903dd7a3 100644 --- a/src/road_cmd.h +++ b/src/road_cmd.h @@ -31,7 +31,7 @@ DEF_CMD_TRAIT(CMD_CONVERT_ROAD, CmdConvertRoad, 0, CommandCallback CcPlaySound_CONSTRUCTION_OTHER; CommandCallback CcBuildRoadTunnel; -CommandCallback CcRoadDepot; -CommandCallback CcRoadStop; +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, StationID, bool); #endif /* ROAD_CMD_H */ diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 1aa0b59ac4..275f039ba8 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -57,7 +57,7 @@ static RoadType _cur_roadtype; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; -void CcPlaySound_CONSTRUCTION_OTHER(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcPlaySound_CONSTRUCTION_OTHER(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); } @@ -84,7 +84,7 @@ static void PlaceRoad_Bridge(TileIndex tile, Window *w) * @param result Whether the build succeeded. * @param start_tile Starting tile of the tunnel. */ -void CcBuildRoadTunnel(Commands cmd, const CommandCost &result, TileIndex start_tile, const CommandDataBuffer &) +void CcBuildRoadTunnel(Commands cmd, const CommandCost &result, TileIndex start_tile) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, start_tile); @@ -117,12 +117,10 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) } } -void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, RoadType rt, DiagDirection dir) { if (result.Failed()) return; - auto [tile_, rt, dir] = EndianBufferReader::ToValue::Args>(data); - if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); ConnectRoadToStructure(tile, dir); @@ -130,18 +128,19 @@ void CcRoadDepot(Commands cmd, const CommandCost &result, TileIndex tile, const /** * Command callback for building road stops. - * @param result Result of the build road stop command. * @param cmd Unused. + * @param result Result of the build road stop command. * @param tile Start tile. - * @param data Command data. + * @param width Width of the road stop. + * @param length Length of the road stop. + * @param is_drive_through False for normal stops, true for drive-through. + * @param dir Entrance direction (#DiagDirection) for normal stops. Converted to the axis for drive-through stops. * @see CmdBuildRoadStop */ -void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcRoadStop(Commands cmd, const CommandCost &result, TileIndex tile, uint8 width, uint8 length, RoadStopType, bool is_drive_through, DiagDirection dir, RoadType, StationID, bool) { if (result.Failed()) return; - auto [tile_, width, length, stop_type, is_drive_through, dir, rt, station_to_join, adjacent] = EndianBufferReader::ToValue::Args>(data); - if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); TileArea roadstop_area(tile, width, length); diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index de4fab481b..ff109dbdfc 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -296,7 +296,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->callback_value[index]; } -/* static */ CommandCallback *ScriptObject::GetDoCommandCallback() +/* static */ CommandCallbackData *ScriptObject::GetDoCommandCallback() { return ScriptObject::GetActiveInstance()->GetDoCommandCallback(); } diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index 8d9be14c46..11d9542c89 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -326,7 +326,7 @@ private: /* Helper functions for DoCommand. */ static std::tuple DoCommandPrep(); static bool DoCommandProcessResult(const CommandCost &res, Script_SuspendCallbackProc *callback, bool estimate_only); - static CommandCallback *GetDoCommandCallback(); + static CommandCallbackData *GetDoCommandCallback(); }; namespace ScriptObjectInternal { diff --git a/src/script/script_cmd.h b/src/script/script_cmd.h index bf6aa50c72..c1b3a9b23c 100644 --- a/src/script/script_cmd.h +++ b/src/script/script_cmd.h @@ -12,7 +12,7 @@ #include "../command_type.h" -CommandCallback CcAI; -CommandCallback CcGame; +CommandCallbackData CcAI; +CommandCallbackData CcGame; #endif /* SCRIPT_CMD_H */ diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index c30fd14996..290568fddf 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -235,7 +235,7 @@ protected: /** * Get the callback handling DoCommands in case of networking. */ - virtual CommandCallback *GetDoCommandCallback() = 0; + virtual CommandCallbackData *GetDoCommandCallback() = 0; /** * Load the dummy script. diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 8d20137b4a..f50e375837 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -105,14 +105,11 @@ CommandCost CmdRenameSign(DoCommandFlag flags, SignID sign_id, const std::string /** * Callback function that is called after a sign is placed - * @param result of the operation * @param cmd unused + * @param result of the operation * @param tile unused - * @param p1 unused - * @param p2 unused - * @param text unused */ -void CcPlaceSign(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcPlaceSign(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 2e3fec0956..ecdc8a6dd4 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -44,7 +44,7 @@ #include "safeguards.h" -void CcTerraform(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcTerraform(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 90aa588552..0c5f86ab7c 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -1009,7 +1009,7 @@ void ShowTownDirectory() new TownDirectoryWindow(&_town_directory_desc); } -void CcFoundTown(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcFoundTown(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; @@ -1017,7 +1017,7 @@ void CcFoundTown(Commands cmd, const CommandCost &result, TileIndex tile, const if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcFoundRandomTown(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcFoundRandomTown(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(_new_town_id)->xy); } diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 268b5b40b8..d6c7320e65 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -26,7 +26,7 @@ * @param result The result of the command. * @param tile The tile the command was executed on. */ -void CcBuildWagon(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &) +void CcBuildWagon(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; diff --git a/src/tunnelbridge_cmd.h b/src/tunnelbridge_cmd.h index ae924cf69d..d49131263d 100644 --- a/src/tunnelbridge_cmd.h +++ b/src/tunnelbridge_cmd.h @@ -20,6 +20,6 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT DEF_CMD_TRAIT(CMD_BUILD_BRIDGE, CmdBuildBridge, CMD_DEITY | CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION) DEF_CMD_TRAIT(CMD_BUILD_TUNNEL, CmdBuildTunnel, CMD_DEITY | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION) -CommandCallback CcBuildBridge; +void CcBuildBridge(Commands cmd, const CommandCost &result, TileIndex end_tile, TileIndex tile_start, TransportType transport_type, BridgeType, byte); #endif /* TUNNELBRIDGE_CMD_H */ diff --git a/src/vehicle_cmd.h b/src/vehicle_cmd.h index b2ad082286..38852347c8 100644 --- a/src/vehicle_cmd.h +++ b/src/vehicle_cmd.h @@ -40,7 +40,7 @@ DEF_CMD_TRAIT(CMD_DEPOT_SELL_ALL_VEHICLES, CmdDepotSellAllVehicles, 0, DEF_CMD_TRAIT(CMD_DEPOT_MASS_AUTOREPLACE, CmdDepotMassAutoReplace, 0, CMDT_VEHICLE_CONSTRUCTION) CommandCallback CcBuildPrimaryVehicle; -CommandCallback CcStartStopVehicle; +void CcStartStopVehicle(Commands cmd, const CommandCost &result, VehicleID veh_id, bool); template inline EndianBufferWriter &operator <<(EndianBufferWriter &buffer, const VehicleListIdentifier &vli) diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 289a821e56..4965cac0a9 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2617,16 +2617,14 @@ static const StringID _vehicle_msg_translation_table[][4] = { /** * This is the Callback method after attempting to start/stop a vehicle - * @param result the result of the start/stop command * @param cmd unused - * @param tile unused - * @param data Command data + * @param result the result of the start/stop command + * @param veh_id Vehicle ID. */ -void CcStartStopVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcStartStopVehicle(Commands cmd, const CommandCost &result, VehicleID veh_id, bool) { if (result.Failed()) return; - VehicleID veh_id = std::get<0>(EndianBufferReader::ToValue::Args>(data)); const Vehicle *v = Vehicle::GetIfValid(veh_id); if (v == nullptr || !v->IsPrimaryVehicle() || v->owner != _local_company) return; @@ -3124,9 +3122,8 @@ void StopGlobalFollowVehicle(const Vehicle *v) * @param result indicates completion (or not) of the operation * @param cmd unused * @param tile unused - * @param data unused */ -void CcBuildPrimaryVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcBuildPrimaryVehicle(Commands cmd, const CommandCost &result, TileIndex tile) { if (result.Failed()) return; From 3e85e833a707e6b781d00eae09c9465bacbf1d69 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Tue, 30 Nov 2021 00:52:23 +0100 Subject: [PATCH 136/710] Codechange: Add support for additional command result values. --- src/ai/ai_instance.cpp | 6 +- src/command_func.h | 97 +++++++++++++++++++++++--------- src/command_type.h | 13 ++++- src/game/game_instance.cpp | 6 +- src/network/network_command.cpp | 2 +- src/script/api/script_object.cpp | 10 ++++ src/script/api/script_object.hpp | 36 ++++++++++-- src/script/script_instance.cpp | 3 +- src/script/script_instance.hpp | 3 +- src/script/script_storage.hpp | 1 + 10 files changed, 136 insertions(+), 41 deletions(-) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index e137745f19..0e8355d733 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -18,6 +18,7 @@ #include "ai.hpp" #include "../script/script_storage.hpp" +#include "../script/script_cmd.h" #include "ai_info.hpp" #include "ai_instance.hpp" @@ -96,8 +97,9 @@ ScriptInfo *AIInstance::FindLibrary(const char *library, int version) * @param result The result of the command. * @param tile The tile on which the command was executed. * @param data Command data as given to Command<>::Post. + * @param result_data Additional returned data from the command. */ -void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) +void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data, CommandDataBuffer result_data) { /* * The company might not exist anymore. Check for this. @@ -108,7 +110,7 @@ void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const Command const Company *c = Company::GetIfValid(_current_company); if (c == nullptr || c->ai_instance == nullptr) return; - if (c->ai_instance->DoCommandCallback(result, tile, data, cmd)) { + if (c->ai_instance->DoCommandCallback(result, tile, data, std::move(result_data), cmd)) { c->ai_instance->Continue(); } } diff --git a/src/command_func.h b/src/command_func.h index 9219fd2b5f..117fed9177 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -111,10 +111,30 @@ protected: * Templated wrapper that exposes the command parameter arguments * for the various Command::Do/Post calls. * @tparam Tcmd The command-id to execute. + * @tparam Tret Return type of the command. * @tparam Targs The command parameter types. */ -template -struct CommandHelper : protected CommandHelperBase { +template +struct CommandHelper : protected CommandHelperBase { +private: + /** Extract the \c CommandCost from a command proc result. */ + static inline CommandCost &ExtractCommandCost(Tret &ret) + { + if constexpr (std::is_same_v) { + return ret; + } else { + return std::get<0>(ret); + } + } + + /** Make a command proc result from a \c CommandCost. */ + static inline Tret MakeResult(const CommandCost &cost) + { + Tret ret{}; + ExtractCommandCost(ret) = cost; + return ret; + } + public: /** * This function executes a given command with the parameters from the #CommandProc parameter list. @@ -129,12 +149,12 @@ public: * @see CommandProc * @return the cost */ - static CommandCost Do(DoCommandFlag flags, Targs... args) + static Tret Do(DoCommandFlag flags, Targs... args) { if constexpr (std::is_same_v>>) { /* Do not even think about executing out-of-bounds tile-commands. */ TileIndex tile = std::get<0>(std::make_tuple(args...)); - if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return CMD_ERROR; + if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return MakeResult(CMD_ERROR); } RecursiveCommandCounter counter{}; @@ -142,17 +162,17 @@ public: /* Only execute the test call if it's toplevel, or we're not execing. */ if (counter.IsTopLevel() || !(flags & DC_EXEC)) { InternalDoBefore(counter.IsTopLevel(), true); - CommandCost res = CommandTraits::proc(flags & ~DC_EXEC, args...); - InternalDoAfter(res, flags, counter.IsTopLevel(), true); // Can modify res. + Tret res = CommandTraits::proc(flags & ~DC_EXEC, args...); + InternalDoAfter(ExtractCommandCost(res), flags, counter.IsTopLevel(), true); // Can modify res. - if (res.Failed() || !(flags & DC_EXEC)) return res; + if (ExtractCommandCost(res).Failed() || !(flags & DC_EXEC)) return res; } /* Execute the command here. All cost-relevant functions set the expenses type * themselves to the cost object at some point. */ InternalDoBefore(counter.IsTopLevel(), false); - CommandCost res = CommandTraits::proc(flags, args...); - InternalDoAfter(res, flags, counter.IsTopLevel(), false); + Tret res = CommandTraits::proc(flags, args...); + InternalDoAfter(ExtractCommandCost(res), flags, counter.IsTopLevel(), false); return res; } @@ -237,7 +257,7 @@ public: * @return the command cost of this function. */ template - static CommandCost Unsafe(StringID err_message, Tcallback *callback, bool my_cmd, bool estimate_only, TileIndex location, std::tuple args) + static Tret Unsafe(StringID err_message, Tcallback *callback, bool my_cmd, bool estimate_only, TileIndex location, std::tuple args) { return Execute(err_message, reinterpret_cast(callback), my_cmd, estimate_only, false, location, std::move(args)); } @@ -259,6 +279,13 @@ protected: ((SetClientIdHelper(std::get(values))), ...); } + /** Remove the first element of a tuple. */ + template