From ab234cf90cd0b31354fddb9ee1f562a3eb630cdc Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 17 Jul 2008 13:47:04 +0000 Subject: [PATCH] (svn r13715) -Fix [FS#2129]: C-like strings had to be rebound each time they were printed, otherwise the text could change due to the few number of slots that could be used to bind. -Codechange: remove all BindCString and related functions and replace it by RAW_STRING which prints the C-string raw pointer that is on the 'print stack'. --- src/genworld_gui.cpp | 2 +- src/lang/afrikaans.txt | 1 - src/lang/brazilian_portuguese.txt | 1 - src/lang/bulgarian.txt | 1 - src/lang/catalan.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.txt | 70 +++++++++++++++---------------- src/lang/english_US.txt | 1 - src/lang/esperanto.txt | 1 - src/lang/estonian.txt | 1 - src/lang/finnish.txt | 1 - src/lang/french.txt | 1 - src/lang/galician.txt | 1 - src/lang/german.txt | 1 - src/lang/hungarian.txt | 1 - src/lang/icelandic.txt | 1 - src/lang/italian.txt | 1 - src/lang/japanese.txt | 1 - src/lang/korean.txt | 1 - src/lang/lithuanian.txt | 1 - src/lang/norwegian_bokmal.txt | 1 - src/lang/norwegian_nynorsk.txt | 1 - src/lang/piglatin.txt | 1 - src/lang/polish.txt | 1 - src/lang/portuguese.txt | 1 - src/lang/romanian.txt | 1 - src/lang/russian.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/swedish.txt | 1 - src/lang/traditional_chinese.txt | 1 - src/lang/turkish.txt | 1 - src/lang/ukrainian.txt | 1 - src/misc_gui.cpp | 20 +++++---- src/network/network_gui.cpp | 14 ++++--- src/newgrf_gui.cpp | 40 +++++++++++------- src/openttd.cpp | 15 ++++--- src/roadveh_gui.cpp | 2 +- src/settings_gui.cpp | 9 ++-- src/station_gui.cpp | 10 +++-- src/strgen/strgen.cpp | 4 +- src/strings.cpp | 53 +++++------------------ src/strings_func.h | 10 ----- src/strings_type.h | 4 -- src/table/control_codes.h | 1 + src/vehicle_gui.cpp | 11 ++--- 51 files changed, 125 insertions(+), 176 deletions(-) diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index bb15a93273..d9a90c0e0e 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -332,7 +332,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow { DrawString( 12, 91, STR_HEIGHTMAP_NAME, TC_BLACK); SetDParamStr(0, this->name); - DrawStringTruncated(114, 91, STR_ORANGE, TC_BLACK, 326 - 114 - GetStringBoundingBox(buffer).width - 5); + DrawStringTruncated(114, 91, STR_JUST_RAW_STRING, TC_ORANGE, 326 - 114 - GetStringBoundingBox(buffer).width - 5); } } diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 267c584531..2b36767290 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -1350,7 +1350,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Kliente STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Kliente oplyn / Kliente maks{}Maatskappye oplyn / Maatskappye maks STR_NETWORK_GAME_INFO :{SILVER}SPEL INFORMASIE -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Kliente: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Taal: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Blokkiestel: {WHITE}{STRING} diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 4b8dbaa932..454b51772b 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -1385,7 +1385,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clientes STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clientes ligados / max. clientes{}Empresas ligados / max, empresas STR_NETWORK_GAME_INFO :{SILVER}INFORMAÇÃO DO JOGO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clientes: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Idioma: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Tileset: {WHITE}{STRING} diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index 7d29598f20..b8f5af075f 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -1410,7 +1410,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Играчи STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Онлайн играчи / макс. брой играчи{}Онлайн компании / макс. компании STR_NETWORK_GAME_INFO :{SILVER}ИНФО ЗА ИГРАТА -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Играчи: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Език: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Терен: {WHITE}{STRING} diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index cec140b32a..3940c09c4a 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1384,7 +1384,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clients STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clients en línia / clients màxim STR_NETWORK_GAME_INFO :{SILVER}INFORMACIÓ DEL JOC -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clients: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Idioma: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Grup de cel·les: {WHITE}{STRING} diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 7549461fb2..1b9126294f 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -1372,7 +1372,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klijenti STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klijenata online / klijenata maks{}Tvrtki online / tvrki maks. STR_NETWORK_GAME_INFO :{SILVER}INFO O IGRI -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klijenti: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Jezik: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Set pločica: {WHITE}{STRING} diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 28b5ac64bf..74adb700e0 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1442,7 +1442,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Hráčů STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Hráčů online / maximálně STR_NETWORK_GAME_INFO :{SILVER}INFO O HŘE -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klientů: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Jazyk: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Prostředí: {WHITE}{STRING} diff --git a/src/lang/danish.txt b/src/lang/danish.txt index a9e1a486ed..cd5b5cbba0 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1377,7 +1377,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klienter STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klienter online / maks. klienter{}Selskaber online / maks. selskaber STR_NETWORK_GAME_INFO :{SILVER}SPIL INFO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klienter: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Sprog: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Klima: {WHITE}{STRING} diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 87ac5d263c..ff00079427 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1384,7 +1384,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Spelers STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Spelers online / spelers maximaal STR_NETWORK_GAME_INFO :{SILVER}SPEL INFORMATIE -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Spelers: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Taal: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Klimaat: {WHITE}{STRING} diff --git a/src/lang/english.txt b/src/lang/english.txt index b33e313bc2..52ebc20322 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -862,13 +862,14 @@ STR_0313_FUND_NEW_INDUSTRY :Fund new indust STR_0314_FUND_NEW_INDUSTRY :{WHITE}Fund new industry STR_JUST_STRING :{STRING} +STR_JUST_RAW_STRING :{RAW_STRING} STR_JUST_INT :{NUM} STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS :{WHITE}...can only be built in towns STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST :{WHITE}...can only be built in rainforest areas STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT :{WHITE}...can only be built in desert areas STR_0319_PAUSED :{YELLOW}* * PAUSED * * -STR_031B_SCREENSHOT_SUCCESSFULLY :{WHITE}Screenshot successfully saved as '{STRING}' +STR_031B_SCREENSHOT_SUCCESSFULLY :{WHITE}Screenshot successfully saved as '{RAW_STRING}' STR_031C_SCREENSHOT_FAILED :{WHITE}Screenshot failed! STR_0329_PURCHASE_LAND_FOR_FUTURE :{BLACK}Purchase land for future use @@ -1296,7 +1297,7 @@ STR_LANDINFO_RIVER :River STR_BUOY_IS_IN_USE :{WHITE}...buoy is in use! -STR_LANDINFO_COORDS :{BLACK}Coordinates: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING}) +STR_LANDINFO_COORDS :{BLACK}Coordinates: {LTBLUE}{NUM}x{NUM}x{NUM} ({RAW_STRING}) STR_CANT_REMOVE_PART_OF_STATION :{WHITE}Can't remove part of station... STR_CANT_CONVERT_RAIL :{WHITE}Can't convert railtype here... @@ -1384,13 +1385,12 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clients STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clients online / clients max{}Companies online / companies max STR_NETWORK_GAME_INFO :{SILVER}GAME INFO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clients: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Language: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Tileset: {WHITE}{STRING} STR_NETWORK_MAP_SIZE :{SILVER}Map size: {WHITE}{COMMA}x{COMMA} -STR_NETWORK_SERVER_VERSION :{SILVER}Server version: {WHITE}{STRING} -STR_NETWORK_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{STRING} : {NUM} +STR_NETWORK_SERVER_VERSION :{SILVER}Server version: {WHITE}{RAW_STRING} +STR_NETWORK_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{RAW_STRING} : {NUM} STR_NETWORK_START_DATE :{SILVER}Start date: {WHITE}{DATE_SHORT} STR_NETWORK_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT} STR_NETWORK_PASSWORD :{SILVER}Password protected! @@ -1474,7 +1474,7 @@ STR_NETWORK_LANG_LATVIAN :Latvian STR_NETWORK_GAME_LOBBY :{WHITE}Multiplayer game lobby -STR_NETWORK_PREPARE_TO_JOIN :{BLACK}Preparing to join: {ORANGE}{STRING} +STR_NETWORK_PREPARE_TO_JOIN :{BLACK}Preparing to join: {ORANGE}{RAW_STRING} STR_NETWORK_COMPANY_LIST_TIP :{BLACK}A list of all companies currently in this game. You can either join one or start a new one if there is a free company slot STR_NETWORK_NEW_COMPANY :{BLACK}New company STR_NETWORK_NEW_COMPANY_TIP :{BLACK}Create a new company @@ -1487,7 +1487,7 @@ STR_NETWORK_REFRESH_TIP :{BLACK}Refresh STR_NETWORK_COMPANY_INFO :{SILVER}COMPANY INFO -STR_NETWORK_COMPANY_NAME :{SILVER}Company name: {WHITE}{STRING} +STR_NETWORK_COMPANY_NAME :{SILVER}Company name: {WHITE}{RAW_STRING} STR_NETWORK_INAUGURATION_YEAR :{SILVER}Inauguration: {WHITE}{NUM} STR_NETWORK_VALUE :{SILVER}Company value: {WHITE}{CURRENCY} STR_NETWORK_CURRENT_BALANCE :{SILVER}Current balance: {WHITE}{CURRENCY} @@ -1496,7 +1496,7 @@ STR_NETWORK_PERFORMANCE :{SILVER}Perform STR_NETWORK_VEHICLES :{SILVER}Vehicles: {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP} STR_NETWORK_STATIONS :{SILVER}Stations: {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP} -STR_NETWORK_PLAYERS :{SILVER}Players: {WHITE}{STRING} +STR_NETWORK_PLAYERS :{SILVER}Players: {WHITE}{RAW_STRING} STR_NETWORK_CONNECTING :{WHITE}Connecting... @@ -1559,15 +1559,15 @@ STR_NETWORK_ERR_CLIENT_SERVER_FULL :server full ############ End of leave-in-this-order STR_NETWORK_CLIENT_JOINED :has joined the game STR_NETWORK_GIVE_MONEY :gave your company some money ({CURRENCY}) -STR_NETWORK_GAVE_MONEY_AWAY :you gave {STRING} some money ({CURRENCY}) +STR_NETWORK_GAVE_MONEY_AWAY :you gave {RAW_STRING} some money ({CURRENCY}) STR_NETWORK_CHAT_COMPANY_CAPTION :[Team] : -STR_NETWORK_CHAT_COMPANY :[Team] {STRING}: {GRAY}{STRING} -STR_NETWORK_CHAT_TO_COMPANY :[Team] To {STRING}: {GRAY}{STRING} +STR_NETWORK_CHAT_COMPANY :[Team] {RAW_STRING}: {GRAY}{RAW_STRING} +STR_NETWORK_CHAT_TO_COMPANY :[Team] To {RAW_STRING}: {GRAY}{RAW_STRING} STR_NETWORK_CHAT_CLIENT_CAPTION :[Private] : -STR_NETWORK_CHAT_CLIENT :[Private] {STRING}: {GRAY}{STRING} -STR_NETWORK_CHAT_TO_CLIENT :[Private] To {STRING}: {GRAY}{STRING} +STR_NETWORK_CHAT_CLIENT :[Private] {RAW_STRING}: {GRAY}{RAW_STRING} +STR_NETWORK_CHAT_TO_CLIENT :[Private] To {RAW_STRING}: {GRAY}{RAW_STRING} STR_NETWORK_CHAT_ALL_CAPTION :[All] : -STR_NETWORK_CHAT_ALL :[All] {STRING}: {GRAY}{STRING} +STR_NETWORK_CHAT_ALL :[All] {RAW_STRING}: {GRAY}{RAW_STRING} STR_NETWORK_CHAT_OSKTITLE :{BLACK}Enter text for network chat STR_NETWORK_NAME_CHANGE :has changed his/her name to STR_NETWORK_SERVER_SHUTDOWN :{WHITE} The server closed the session @@ -1958,11 +1958,11 @@ STR_4003_DELETE :{BLACK}Delete STR_4004 :{COMPANY}, {DATE_LONG} STR_4005_BYTES_FREE :{BLACK}{COMMA} megabyte{P "" s} free STR_4006_UNABLE_TO_READ_DRIVE :{BLACK}Unable to read drive -STR_4007_GAME_SAVE_FAILED :{WHITE}Game Save Failed{}{STRING} +STR_4007_GAME_SAVE_FAILED :{WHITE}Game Save Failed{}{RAW_STRING} STR_4008_UNABLE_TO_DELETE_FILE :{WHITE}Unable to delete file -STR_4009_GAME_LOAD_FAILED :{WHITE}Game Load Failed{}{STRING} -STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR :Internal error: {STRING} -STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME :Broken savegame - {STRING} +STR_4009_GAME_LOAD_FAILED :{WHITE}Game Load Failed{}{RAW_STRING} +STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR :Internal error: {RAW_STRING} +STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME :Broken savegame - {RAW_STRING} STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :Savegame is made with newer version STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE :File not readable STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE :File not writeable @@ -3150,25 +3150,25 @@ STR_NEWGRF_APPLY_CHANGES :{BLACK}Apply ch STR_NEWGRF_SET_PARAMETERS :{BLACK}Set parameters STR_NEWGRF_TIP :{BLACK}A list of all the Newgrf sets that you have installed. Click a set to change the settings STR_NEWGRF_NO_FILES_INSTALLED :{BLACK}There are currently no newgrf files installed! Please refer to the manual for instructions on installing new graphics -STR_NEWGRF_FILENAME :{BLACK}Filename: {SILVER}{STRING} -STR_NEWGRF_GRF_ID :{BLACK}GRF ID: {SILVER}{STRING} -STR_NEWGRF_MD5SUM :{BLACK}MD5sum: {SILVER}{STRING} +STR_NEWGRF_FILENAME :{BLACK}Filename: {SILVER}{RAW_STRING} +STR_NEWGRF_GRF_ID :{BLACK}GRF ID: {SILVER}{RAW_STRING} +STR_NEWGRF_MD5SUM :{BLACK}MD5sum: {SILVER}{RAW_STRING} STR_NEWGRF_CONFIRMATION_TEXT :{YELLOW}You are about to make changes to a running game; this can crash OpenTTD.{}Are you absolutely sure about this? -STR_NEWGRF_ERROR_MSG_INFO :{SILVER}{STRING} -STR_NEWGRF_ERROR_MSG_WARNING :{RED}Warning: {SILVER}{STRING} -STR_NEWGRF_ERROR_MSG_ERROR :{RED}Error: {SILVER}{STRING} -STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatal: {SILVER}{STRING} -STR_NEWGRF_ERROR_VERSION_NUMBER :{STRING} will not work with the TTDPatch version reported by OpenTTD. -STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{STRING} is for the {STRING} version of TTD. -STR_NEWGRF_ERROR_UNSET_SWITCH :{STRING} is designed to be used with {STRING} -STR_NEWGRF_ERROR_INVALID_PARAMETER :Invalid parameter for {STRING}: parameter {STRING} ({NUM}) -STR_NEWGRF_ERROR_LOAD_BEFORE :{STRING} must be loaded before {STRING}. -STR_NEWGRF_ERROR_LOAD_AFTER :{STRING} must be loaded after {STRING}. -STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{STRING} requires OpenTTD version {STRING} or better. +STR_NEWGRF_ERROR_MSG_INFO :{SILVER}{RAW_STRING} +STR_NEWGRF_ERROR_MSG_WARNING :{RED}Warning: {SILVER}{RAW_STRING} +STR_NEWGRF_ERROR_MSG_ERROR :{RED}Error: {SILVER}{RAW_STRING} +STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatal: {SILVER}{RAW_STRING} +STR_NEWGRF_ERROR_VERSION_NUMBER :{RAW_STRING} will not work with the TTDPatch version reported by OpenTTD. +STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{RAW_STRING} is for the {RAW_STRING} version of TTD. +STR_NEWGRF_ERROR_UNSET_SWITCH :{RAW_STRING} is designed to be used with {RAW_STRING} +STR_NEWGRF_ERROR_INVALID_PARAMETER :Invalid parameter for {RAW_STRING}: parameter {RAW_STRING} ({NUM}) +STR_NEWGRF_ERROR_LOAD_BEFORE :{RAW_STRING} must be loaded before {RAW_STRING}. +STR_NEWGRF_ERROR_LOAD_AFTER :{RAW_STRING} must be loaded after {RAW_STRING}. +STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{RAW_STRING} requires OpenTTD version {RAW_STRING} or better. STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE :the GRF file it was designed to translate STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED :Too many NewGRFs are loaded. -STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :Loading {STRING} as static NewGRF with {STRING} could cause desyncs. +STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :Loading {RAW_STRING} as static NewGRF with {RAW_STRING} could cause desyncs. STR_NEWGRF_ADD :{BLACK}Add STR_NEWGRF_ADD_TIP :{BLACK}Add a NewGRF file to the list @@ -3179,7 +3179,7 @@ STR_NEWGRF_MOVEUP_TIP :{BLACK}Move the STR_NEWGRF_MOVEDOWN :{BLACK}Move Down STR_NEWGRF_MOVEDOWN_TIP :{BLACK}Move the selected NewGRF file down the list STR_NEWGRF_FILE_TIP :{BLACK}A list of the NewGRF files that are installed. Click a file to change its parameters -STR_NEWGRF_PARAMETER :{BLACK}Parameters: {SILVER}{STRING} +STR_NEWGRF_PARAMETER :{BLACK}Parameters: {SILVER}{STRING1} STR_NEWGRF_PARAMETER_QUERY :{BLACK}Enter NewGRF parameters STR_NEWGRF_NO_INFO :{BLACK}No information available @@ -3412,7 +3412,7 @@ STR_MEASURE_LENGTH_HEIGHTDIFF :{BLACK}Length: STR_MEASURE_AREA_HEIGHTDIFF :{BLACK}Area: {NUM} x {NUM}{}Height difference: {NUM} m ############ Date formatting -STR_DATE_TINY :{STRING}-{STRING}-{NUM} +STR_DATE_TINY :{RAW_STRING}-{RAW_STRING}-{NUM} STR_DATE_SHORT :{STRING} {NUM} STR_DATE_LONG :{STRING} {STRING} {NUM} diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index c66d9cd3ad..e3bdb5fe4f 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1354,7 +1354,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clients STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clients online / clients max STR_NETWORK_GAME_INFO :{SILVER}GAME INFO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clients: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Language: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Tileset: {WHITE}{STRING} diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 59aafd851b..283b9d3b31 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -1315,7 +1315,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klientoj STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klientoj surrete / maksimume{}Kompanioj surrete / maksimume STR_NETWORK_GAME_INFO :{SILVER}LUDINFORMOJ -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klientoj: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Lingvo: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Tegolaro: {WHITE}{STRING} diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index 9f29596880..5dd989c556 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1465,7 +1465,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Kliendid STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Kliente sees / enim kliente{}Ettevõtteid sees / enim ettevõtteid STR_NETWORK_GAME_INFO :{SILVER}MÄNGU ANDMED -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Kliendid: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Keel: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Ruudustik: {WHITE}{STRING} diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index f6b9d3beb1..77c62586ad 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1349,7 +1349,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Pelaajia STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Pelaajia pelissä/enintään. STR_NETWORK_GAME_INFO :{SILVER}PELITIEDOT -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Pelaajat: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Kieli: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Ruudusto: {WHITE}{STRING} diff --git a/src/lang/french.txt b/src/lang/french.txt index 50669ef520..d7ec9a6f17 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1385,7 +1385,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clients STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clients en ligne / clients max STR_NETWORK_GAME_INFO :{SILVER}INFOS SUR LE SERVEUR -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clients: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Langue: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Terrain: {WHITE}{STRING} diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 23d7052c8c..31e7d21540 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -1250,7 +1250,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clientes STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clientes conectador / clients máximos STR_NETWORK_GAME_INFO :{SILVER}INFORMACIÓN DA PARTIDA -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clientes: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Idioma: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Set de Terreo: {WHITE}{STRING} diff --git a/src/lang/german.txt b/src/lang/german.txt index 04d9294748..322141d78c 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -1372,7 +1372,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Teilnehmer STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Teilnehmer anwesend / max. STR_NETWORK_GAME_INFO :{SILVER}SPIEL-INFO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Teilnehmer: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Sprache: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Landschaft: {WHITE}{STRING} diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 93dc808b02..e133c9fb8e 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1438,7 +1438,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Kliens STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Kliens online / kliens max STR_NETWORK_GAME_INFO :{SILVER}JÁTÉK INFÓ -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Játékos: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Nyelv: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Tájtípus: {WHITE}{STRING} diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index d07a59e792..837573a4a0 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1382,7 +1382,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Notendur STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Tengdir notendur / hámarksfjöldi notenda STR_NETWORK_GAME_INFO :{SILVER}UPPLÝSINGAR UM LEIK -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Notendur: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Tungumál: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Landslag: {WHITE}{STRING} diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 1213a1fda0..964c98743a 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1386,7 +1386,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Client STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Client online / client max{}Compagnie online / compagnie max STR_NETWORK_GAME_INFO :{SILVER}INFORMAZIONI PARTITA -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Client: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Lingua: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Paesaggio: {WHITE}{STRING} diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index d69868dbd5..18401f1d94 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -1370,7 +1370,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}クライアント STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}オンラインのクライアント人数/最高クライアント人数{}オンラインの会社数/最高会社数 STR_NETWORK_GAME_INFO :{SILVER}ゲーム情報 -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}クライアント:{WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}国語:  {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}タイルセット:{WHITE}{STRING} diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 1a309304c8..52b882aaee 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1384,7 +1384,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}클라이언트 STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}클라이언트 온라인 / 최대 접속자수{}회사 온라인 / 최대 회사수 STR_NETWORK_GAME_INFO :{SILVER}게임 정보 -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}클라이언트: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}언어: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}기후: {WHITE}{STRING} diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index b5f40b1db5..43f0f38070 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1324,7 +1324,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Zaidejai STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Zaidzia / maksimaliai zaideju STR_NETWORK_GAME_INFO :{SILVER}Zaidimo informacija -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Zaidejai: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Kalba: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Pavadinimas: {WHITE}{STRING} diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 8ff1fabf2c..a7ee785c1c 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -1356,7 +1356,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klienter STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klienter på nett / maks. antall klienter{}Firmaer på nett / maks. antall firmaer STR_NETWORK_GAME_INFO :{SILVER}SPILLOVERSIKT -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klienter: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Språk: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Brikkesett: {WHITE}{STRING} diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 2fb67d7d27..b81719c411 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -1355,7 +1355,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klientar STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klientar på nett / maks. antal klientar{}Firma på nett / maks. antal firma STR_NETWORK_GAME_INFO :{SILVER}SPELOVERSIKT -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klientar: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Språk: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Brikkesett: {WHITE}{STRING} diff --git a/src/lang/piglatin.txt b/src/lang/piglatin.txt index a8b71a5866..e5f94c2ea3 100644 --- a/src/lang/piglatin.txt +++ b/src/lang/piglatin.txt @@ -1345,7 +1345,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Ientsclay STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Ientsclay onlineway / ientsclay axmay{}Ompaniescay onlineway / ompaniescay axmay STR_NETWORK_GAME_INFO :{SILVER}EGAMay INFOWAY -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Ientsclay: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Anguagelay: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Ilesettay: {WHITE}{STRING} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 13dccd5eec..fc013d69bb 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1441,7 +1441,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klientów STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klientów podłączonych / maks.{}Firm podłączonych / maks. STR_NETWORK_GAME_INFO :{SILVER}INFO O GRZE -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klienci: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Język: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Krajobraz: {WHITE}{STRING} diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 65f0473d9e..beb92d5f51 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1371,7 +1371,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clientes STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clientes ligados / max. clientes STR_NETWORK_GAME_INFO :{SILVER}INFORMAÇÃO DE JOGO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clientes: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Idioma: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Conjunto de blocos: {WHITE}{STRING} diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index fb936e3a3c..23da765757 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -1380,7 +1380,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clienţi STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clienţi online / Nr. max. clienţi{}Companii online / Nr. max. companii STR_NETWORK_GAME_INFO :{SILVER}INFO JOC -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clienţi: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Limba: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Tileset: {WHITE}{STRING} diff --git a/src/lang/russian.txt b/src/lang/russian.txt index a6b488b8aa..65f0826c30 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1386,7 +1386,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Клиенты STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Клиентов сейчас/макс. {}Компаний сейчас/макс. STR_NETWORK_GAME_INFO :{SILVER}ИНФОРМАЦИЯ ОБ ИГРЕ -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Клиенты: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Язык: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Климат: {WHITE}{STRING} diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 7e5569b8f7..8746a442f2 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -1305,7 +1305,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}客户端 STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}在线客户端 / 最多 - 在线公司 / 最多 STR_NETWORK_GAME_INFO :{SILVER}游戏信息 -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}客 户 端: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}语  言: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}场景类型: {WHITE}{STRING} diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 80904b20fb..d435f76bfa 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1438,7 +1438,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klienti STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klienti online / klienti max STR_NETWORK_GAME_INFO :{SILVER}INFO O HRE -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klienti: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Jazyk: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Prostredie: {WHITE}{STRING} diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 828ee6fa5b..d26acc7bb9 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1426,7 +1426,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Gosti STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Gosti na zvezi / največ gostov{}Podjetja na zvezi / največ podjetij STR_NETWORK_GAME_INFO :{SILVER}IGRA - INFO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Gosti: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Jezik: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Nabor ploščic: {WHITE}{STRING} diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 29949fa26f..e3836f4882 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -1385,7 +1385,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Clientes STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Clientes online / máx clientes{}Compañías online / máximo compañías STR_NETWORK_GAME_INFO :{SILVER}INFO JUEGO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Clientes: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Idioma: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Escenario: {WHITE}{STRING} diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index b50d2e0c2e..33863c5559 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1384,7 +1384,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Klienter STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Klienter online / Klienter max STR_NETWORK_GAME_INFO :{SILVER}SPELINFO -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Klienter: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Språk: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Klimat: {WHITE}{STRING} diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 67e4b013e9..c6fc439830 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -1382,7 +1382,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}客戶端 STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}線上客戶端 / 客戶端上限{}線上公司 / 公司上限 STR_NETWORK_GAME_INFO :{SILVER}遊戲資訊 -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}客戶端:{WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}語言:{WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}網格組:{WHITE}{STRING} diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index b9891e2516..8aa15fe2a6 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -1371,7 +1371,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Oyuncular STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Bağlı oyuncular / en fazla oyuncu STR_NETWORK_GAME_INFO :{SILVER}OYUN BİLGİSİ -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}İstemciler: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Dil: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Set: {WHITE}{STRING} diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index b030705633..44dcee6ee8 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1509,7 +1509,6 @@ STR_NETWORK_GENERAL_ONLINE :{BLACK}{COMMA}/ STR_NETWORK_CLIENTS_CAPTION :{BLACK}Клієнти STR_NETWORK_CLIENTS_CAPTION_TIP :{BLACK}Клієнти в мережі/макс.клієнтів{}Компанії в мережі/макс.компаній STR_NETWORK_GAME_INFO :{SILVER}Інформація про гру -STR_ORANGE :{ORANGE}{STRING} STR_NETWORK_CLIENTS :{SILVER}Клієнт: {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA} STR_NETWORK_LANGUAGE :{SILVER}Мова: {WHITE}{STRING} STR_NETWORK_TILESET :{SILVER}Шаблон: {WHITE}{STRING} diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 9665ccf8a4..1c8cbad98e 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -96,7 +96,10 @@ public: y += 6; - if (!StrEmpty(this->landinfo_data[LAND_INFO_MULTICENTER_LINE])) DrawStringMultiCenter(140, y, BindCString(this->landinfo_data[LAND_INFO_MULTICENTER_LINE]), this->width - 4); + if (!StrEmpty(this->landinfo_data[LAND_INFO_MULTICENTER_LINE])) { + SetDParamStr(0, this->landinfo_data[LAND_INFO_MULTICENTER_LINE]); + DrawStringMultiCenter(140, y, STR_JUST_RAW_STRING, this->width - 4); + } } LandInfoWindow(TileIndex tile) : Window(&_land_info_desc) { @@ -157,11 +160,12 @@ public: line_nr++; /* Location */ - snprintf(_userstring, lengthof(_userstring), "0x%.4X", tile); + char tmp[16]; + snprintf(tmp, lengthof(tmp), "0x%.4X", tile); SetDParam(0, TileX(tile)); SetDParam(1, TileY(tile)); SetDParam(2, TileHeight(tile)); - SetDParam(3, STR_SPEC_USERSTRING); + SetDParamStr(3, tmp); GetString(this->landinfo_data[line_nr], STR_LANDINFO_COORDS, lastof(this->landinfo_data[line_nr])); line_nr++; @@ -652,10 +656,11 @@ static int DrawStationCoverageText(const AcceptedCargo cargo, { bool first = true; - char *b = InlineString(_userstring, supplies ? STR_SUPPLIES : STR_000D_ACCEPTS); + char string[512]; + char *b = InlineString(string, supplies ? STR_SUPPLIES : STR_000D_ACCEPTS); for (CargoID i = 0; i < NUM_CARGO; i++) { - if (b >= lastof(_userstring) - (1 + 2 * 4)) break; // ',' or ' ' and two calls to Utf8Encode() + if (b >= lastof(string) - (1 + 2 * 4)) break; // ',' or ' ' and two calls to Utf8Encode() switch (sct) { case SCT_PASSENGERS_ONLY: if (!IsCargoInClass(i, CC_PASSENGERS)) continue; break; case SCT_NON_PASSENGERS_ONLY: if (IsCargoInClass(i, CC_PASSENGERS)) continue; break; @@ -680,9 +685,10 @@ static int DrawStationCoverageText(const AcceptedCargo cargo, *b = '\0'; /* Make sure we detect any buffer overflow */ - assert(b < endof(_userstring)); + assert(b < endof(string)); - return DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144); + SetDParamStr(0, string); + return DrawStringMultiLine(str_x, str_y, STR_JUST_RAW_STRING, 144); } /** diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 379d491955..418be8beb7 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -216,7 +216,7 @@ protected: if (highlight) GfxFillRect(this->widget[NGWW_NAME].left + 1, y - 2, this->widget[NGWW_INFO].right - 1, y + 9, 10); SetDParamStr(0, cur_item->info.server_name); - DrawStringTruncated(this->widget[NGWW_NAME].left + 5, y, STR_02BD, TC_BLACK, this->widget[NGWW_NAME].right - this->widget[NGWW_NAME].left - 5); + DrawStringTruncated(this->widget[NGWW_NAME].left + 5, y, STR_JUST_RAW_STRING, TC_BLACK, this->widget[NGWW_NAME].right - this->widget[NGWW_NAME].left - 5); SetDParam(0, cur_item->info.clients_on); SetDParam(1, cur_item->info.clients_max); @@ -325,7 +325,7 @@ public: DrawStringCentered(this->widget[NGWW_DETAILS].left + 115, 58, STR_NETWORK_GAME_INFO, TC_FROMSTRING); } else if (!sel->online) { SetDParamStr(0, sel->info.server_name); - DrawStringCentered(this->widget[NGWW_DETAILS].left + 115, 68, STR_ORANGE, TC_FROMSTRING); // game name + DrawStringCentered(this->widget[NGWW_DETAILS].left + 115, 68, STR_JUST_RAW_STRING, TC_ORANGE); // game name DrawStringCentered(this->widget[NGWW_DETAILS].left + 115, 132, STR_NETWORK_SERVER_OFFLINE, TC_FROMSTRING); // server offline } else { // show game info @@ -336,10 +336,10 @@ public: SetDParamStr(0, sel->info.server_name); - DrawStringCenteredTruncated(this->widget[NGWW_DETAILS].left, this->widget[NGWW_DETAILS].right, 62, STR_ORANGE, TC_BLACK); // game name + DrawStringCenteredTruncated(this->widget[NGWW_DETAILS].left, this->widget[NGWW_DETAILS].right, 62, STR_JUST_RAW_STRING, TC_ORANGE); // game name SetDParamStr(0, sel->info.map_name); - DrawStringCenteredTruncated(this->widget[NGWW_DETAILS].left, this->widget[NGWW_DETAILS].right, 74, STR_02BD, TC_BLACK); // map name + DrawStringCenteredTruncated(this->widget[NGWW_DETAILS].left, this->widget[NGWW_DETAILS].right, 74, STR_JUST_RAW_STRING, TC_BLACK); // map name SetDParam(0, sel->info.clients_on); SetDParam(1, sel->info.clients_max); @@ -447,8 +447,9 @@ public: break; case NGWW_ADD: // Add a server + SetDParamStr(0, _settings_client.network.connect_to_ip); ShowQueryString( - BindCString(_settings_client.network.connect_to_ip), + STR_JUST_RAW_STRING, STR_NETWORK_ENTER_IP, 31 | 0x1000, // maximum number of characters OR 250, // characters up to this width pixels, whichever is satisfied first @@ -734,7 +735,8 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow { case NSSW_SETPWD: // Set password button this->widget_id = NSSW_SETPWD; - ShowQueryString(BindCString(_settings_client.network.server_password), STR_NETWORK_SET_PASSWORD, 20, 250, this, CS_ALPHANUMERAL); + SetDParamStr(0, _settings_client.network.server_password); + ShowQueryString(STR_JUST_RAW_STRING, STR_NETWORK_SET_PASSWORD, 20, 250, this, CS_ALPHANUMERAL); break; case NSSW_SELMAP: { // Select map diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 4b4765fe24..74affa4ddf 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -50,19 +50,24 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bott char buff[256]; if (c->error != NULL) { - SetDParamStr(0, c->filename); - SetDParamStr(1, c->error->data); - for (uint i = 0; i < c->error->num_params; i++) { - uint32 param = 0; - byte param_number = c->error->param_number[i]; - - if (param_number < c->num_params) param = c->param[param_number]; - - SetDParam(2 + i, param); - } - char message[512]; - GetString(message, c->error->custom_message != NULL ? BindCString(c->error->custom_message) : c->error->message, lastof(message)); + if (c->error->custom_message == NULL) { + SetDParamStr(0, c->filename); + SetDParamStr(1, c->error->data); + for (uint i = 0; i < c->error->num_params; i++) { + uint32 param = 0; + byte param_number = c->error->param_number[i]; + + if (param_number < c->num_params) param = c->param[param_number]; + + SetDParam(2 + i, param); + } + + GetString(message, c->error->message, lastof(message)); + } else { + SetDParamStr(0, c->error->custom_message); + GetString(message, STR_JUST_RAW_STRING, lastof(message)); + } SetDParamStr(0, message); y += DrawStringMultiLine(x, y, c->error->severity, w, bottom - y); @@ -88,7 +93,8 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bott if (show_params) { if (c->num_params > 0) { GRFBuildParamList(buff, c, lastof(buff)); - SetDParamStr(0, buff); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, buff); } else { SetDParam(0, STR_01A9_NONE); } @@ -102,7 +108,8 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bott /* Draw GRF info if it exists */ if (c->info != NULL && !StrEmpty(c->info)) { - SetDParamStr(0, c->info); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, c->info); y += DrawStringMultiLine(x, y, STR_02BD, w, bottom - y); } else { y += DrawStringMultiLine(x, y, STR_NEWGRF_NO_INFO, w, bottom - y); @@ -487,9 +494,10 @@ struct NewGRFWindow : public Window { case SNGRFS_SET_PARAMETERS: { // Edit parameters if (this->sel == NULL) break; - char buff[512]; + static char buff[512]; GRFBuildParamList(buff, this->sel, lastof(buff)); - ShowQueryString(BindCString(buff), STR_NEWGRF_PARAMETER_QUERY, 63, 250, this, CS_ALPHANUMERAL); + SetDParamStr(0, buff); + ShowQueryString(STR_JUST_RAW_STRING, STR_NEWGRF_PARAMETER_QUERY, 63, 250, this, CS_ALPHANUMERAL); break; } } diff --git a/src/openttd.cpp b/src/openttd.cpp index 817aace136..8c71b390e6 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -758,7 +758,8 @@ static void StartScenario() /* invalid type */ if (_file_to_saveload.mode == SL_INVALID) { DEBUG(sl, 0, "Savegame is obsolete or invalid format: '%s'", _file_to_saveload.name); - SetDParamStr(0, GetSaveLoadErrorString()); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, GetSaveLoadErrorString()); ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); _game_mode = GM_MENU; return; @@ -774,7 +775,8 @@ static void StartScenario() /* Load game */ if (SaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, SCENARIO_DIR) != SL_OK) { LoadIntroGame(); - SetDParamStr(0, GetSaveLoadErrorString()); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, GetSaveLoadErrorString()); ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); } @@ -886,7 +888,8 @@ void SwitchMode(int new_mode) if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL, NO_DIRECTORY)) { LoadIntroGame(); - SetDParamStr(0, GetSaveLoadErrorString()); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, GetSaveLoadErrorString()); ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); } else { if (_saveload_mode == SLD_LOAD_SCENARIO) { @@ -927,7 +930,8 @@ void SwitchMode(int new_mode) SetLocalPlayer(OWNER_NONE); _settings_newgame.game_creation.starting_year = _cur_year; } else { - SetDParamStr(0, GetSaveLoadErrorString()); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, GetSaveLoadErrorString()); ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); } break; @@ -941,7 +945,8 @@ void SwitchMode(int new_mode) /* Make network saved games on pause compatible to singleplayer */ if (_networking && _pause_game == 1) _pause_game = 2; if (SaveOrLoad(_file_to_saveload.name, SL_SAVE, NO_DIRECTORY) != SL_OK) { - SetDParamStr(0, GetSaveLoadErrorString()); + SetDParam(0, STR_JUST_RAW_STRING); + SetDParamStr(1, GetSaveLoadErrorString()); ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); } else { DeleteWindowById(WC_SAVELOAD, 0); diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index 23f5989e50..9c2c26b8be 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -59,7 +59,7 @@ void DrawRoadVehDetails(const Vehicle *v, int x, int y) } SetDParamStr(0, capacity); - DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_STRING, TC_BLUE, 380 - x); + DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_RAW_STRING, TC_BLUE, 380 - x); for (const Vehicle *u = v; u != NULL; u = u->Next()) { if (u->cargo_cap == 0) continue; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 8489af7127..b6ddb42103 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1115,7 +1115,8 @@ struct CustomCurrencyWindow : Window { if (IsInsideMM(x, 10, 30)) { // clicked button this->click = 1 << (line * 2 + 1); } - str = BindCString(this->separator); + SetDParamStr(0, this->separator); + str = STR_JUST_RAW_STRING; len = 1; break; @@ -1123,7 +1124,8 @@ struct CustomCurrencyWindow : Window { if (IsInsideMM(x, 10, 30)) { // clicked button this->click = 1 << (line * 2 + 1); } - str = BindCString(_custom_currency.prefix); + SetDParamStr(0, _custom_currency.prefix); + str = STR_JUST_RAW_STRING; len = 12; break; @@ -1131,7 +1133,8 @@ struct CustomCurrencyWindow : Window { if (IsInsideMM(x, 10, 30)) { // clicked button this->click = 1 << (line * 2 + 1); } - str = BindCString(_custom_currency.suffix); + SetDParamStr(0, _custom_currency.suffix); + str = STR_JUST_RAW_STRING; len = 12; break; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 881ec021c3..878a6308d8 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -810,13 +810,14 @@ struct StationViewWindow : public Window { } if (this->widget[SVW_ACCEPTS].data == STR_3032_RATINGS) { // small window with list of accepted cargo - char *b = _userstring; + char string[512]; + char *b = string; bool first = true; b = InlineString(b, STR_000C_ACCEPTS); for (CargoID i = 0; i < NUM_CARGO; i++) { - if (b >= lastof(_userstring) - (1 + 2 * 4)) break; // ',' or ' ' and two calls to Utf8Encode() + if (b >= lastof(string) - (1 + 2 * 4)) break; // ',' or ' ' and two calls to Utf8Encode() if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::ACCEPTANCE)) { if (first) { first = false; @@ -835,9 +836,10 @@ struct StationViewWindow : public Window { *b = '\0'; /* Make sure we detect any buffer overflow */ - assert(b < endof(_userstring)); + assert(b < endof(string)); - DrawStringMultiLine(2, this->widget[SVW_ACCEPTLIST].top + 1, STR_SPEC_USERSTRING, this->widget[SVW_ACCEPTLIST].right - this->widget[SVW_ACCEPTLIST].left); + SetDParamStr(0, string); + DrawStringMultiLine(2, this->widget[SVW_ACCEPTLIST].top + 1, STR_JUST_RAW_STRING, this->widget[SVW_ACCEPTLIST].right - this->widget[SVW_ACCEPTLIST].left); } else { // extended window with list of cargo ratings y = this->widget[SVW_RATINGLIST].top + 1; diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 3057a88f04..1a874cfa82 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -490,6 +490,7 @@ static const CmdStruct _cmd_structs[] = { {"SKIP", EmitSingleChar, SCC_SKIP, 1, 0}, {"STRING", EmitSingleChar, SCC_STRING, 1, C_CASE}, + {"RAW_STRING", EmitSingleChar, SCC_RAW_STRING_POINTER, 1, 0}, // Numbers {"COMMA", EmitSingleChar, SCC_COMMA, 1, 0}, // Number with comma @@ -717,7 +718,8 @@ static const CmdStruct *TranslateCmdForCompare(const CmdStruct *a) strcmp(a->cmd, "STRING2") == 0 || strcmp(a->cmd, "STRING3") == 0 || strcmp(a->cmd, "STRING4") == 0 || - strcmp(a->cmd, "STRING5") == 0) { + strcmp(a->cmd, "STRING5") == 0 || + strcmp(a->cmd, "RAW_STRING") == 0){ return FindCmd("STRING", 6); } diff --git a/src/strings.cpp b/src/strings.cpp index 26eb31fc8e..aed3a2d5ab 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -45,7 +45,6 @@ #include "table/control_codes.h" DynamicLanguages _dynlang; -char _userstring[128]; uint64 _decode_parameters[20]; static char *StationGetSpecialString(char *buff, int x, const char* last); @@ -96,17 +95,6 @@ static inline const int64 *GetArgvPtr(const int64 **argv, int n) } -#define NUM_BOUND_STRINGS 8 - -/* Array to hold the bound strings. */ -static const char *_bound_strings[NUM_BOUND_STRINGS]; - -/* This index is used to implement a "round-robin" allocating of - * slots for BindCString. NUM_BOUND_STRINGS slots are reserved. - * Which means that after NUM_BOUND_STRINGS calls to BindCString, - * the indices will be reused. */ -static int _bind_index; - const char *GetStringPtr(StringID string) { switch (GB(string, 11, 5)) { @@ -167,13 +155,7 @@ static char *GetStringWithArgs(char *buffr, uint string, const int64 *argv, cons return FormatString(buffr, GetGRFStringPtr(index + 0x1000), argv, 0, last); case 31: - /* dynamic strings. These are NOT to be passed through the formatter, - * but passed through verbatim. */ - if (index < (STR_SPEC_USERSTRING & 0x7FF)) { - return strecpy(buffr, _bound_strings[index], last); - } - - return FormatString(buffr, _userstring, NULL, 0, last); + NOT_REACHED(); } if (index >= _langtab_num[tab]) { @@ -200,32 +182,13 @@ char *InlineString(char *buf, StringID string) } -/** - * This function takes a C-string and allocates a temporary string ID. - * The StringID of the bound string is valid until BindCString is called - * another NUM_BOUND_STRINGS times. So be careful when using it. - * @param str temp string to add - * @return the id of that temp string - * @note formatting a DATE_TINY calls BindCString twice, thus reduces the - * amount of 'user' bound strings by 2. - * @todo rewrite the BindCString system to make the limit flexible and - * non-round-robin. For example by using smart pointers that free - * the allocated StringID when they go out-of-scope/are freed. - */ -StringID BindCString(const char *str) -{ - int idx = (++_bind_index) & (NUM_BOUND_STRINGS - 1); - _bound_strings[idx] = str; - return idx + STR_SPEC_DYNSTRING; -} - /** This function is used to "bind" a C string to a OpenTTD dparam slot. * @param n slot of the string * @param str string to bind */ void SetDParamStr(uint n, const char *str) { - SetDParam(n, BindCString(str)); + SetDParam(n, (uint64)str); } void InjectDParam(int amount) @@ -334,7 +297,7 @@ static char *FormatTinyDate(char *buff, Date date, const char* last) snprintf(day, lengthof(day), "%02i", ymd.day); snprintf(month, lengthof(month), "%02i", ymd.month + 1); - int64 args[3] = { BindCString(day), BindCString(month), ymd.year }; + int64 args[3] = { (int64)day, (int64)month, ymd.year }; return FormatString(buff, GetStringPtr(STR_DATE_TINY), args, 0, last); } @@ -592,6 +555,12 @@ static char* FormatString(char* buff, const char* str, const int64* argv, uint c buff = GetStringWithArgs(buff, Utf8Consume(&str), argv, last); break; + case SCC_RAW_STRING_POINTER: { // {RAW_STRING} + const char *str = (const char*)GetInt64(&argv); + buff = FormatString(buff, str, argv, casei, last); + break; + } + case SCC_DATE_LONG: // {DATE_LONG} buff = FormatYmdString(buff, GetInt32(&argv), last); break; @@ -1519,8 +1488,8 @@ void CheckForMissingGlyphsInLoadedLanguagePack() */ static char *err_str = strdup("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this."); Utf8Encode(err_str, SCC_YELLOW); - StringID err_msg = BindCString(err_str); - ShowErrorMessage(INVALID_STRING_ID, err_msg, 0, 0); + SetDParamStr(0, err_str); + ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0); return; } } diff --git a/src/strings_func.h b/src/strings_func.h index 56529edd73..f83af7874f 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -11,8 +11,6 @@ char *InlineString(char *buf, StringID string); char *GetString(char *buffr, StringID string, const char *last); const char *GetStringPtr(StringID string); -extern char _userstring[128]; - void InjectDParam(int amount); static inline void SetDParamX(uint64 *s, uint n, uint64 v) @@ -28,16 +26,8 @@ static inline void SetDParam(uint n, uint64 v) _decode_parameters[n] = v; } -/* Used to bind a C string name to a dparam number. - * NOTE: This has a short lifetime. You can't - * use this string much later or it will be gone. */ void SetDParamStr(uint n, const char *str); -/** This function takes a C-string and allocates a temporary string ID. - * The duration of the bound string is valid only until the next call to GetString, - * so be careful. */ -StringID BindCString(const char *str); - static inline uint64 GetDParamX(const uint64 *s, uint n) { return s[n]; diff --git a/src/strings_type.h b/src/strings_type.h index 3767288214..d9482f23d3 100644 --- a/src/strings_type.h +++ b/src/strings_type.h @@ -79,10 +79,6 @@ enum SpecialStrings { // reserve 32 strings for screenshot formats SPECSTR_SCREENSHOT_START = SPECSTR_RESOLUTION_END + 1, SPECSTR_SCREENSHOT_END = SPECSTR_SCREENSHOT_START + 0x1F, - - // Used to implement SetDParamStr - STR_SPEC_DYNSTRING = 0xF800, - STR_SPEC_USERSTRING = 0xF808, }; #endif /* STRINGS_TYPE_H */ diff --git a/src/table/control_codes.h b/src/table/control_codes.h index d889ba1933..b351299600 100644 --- a/src/table/control_codes.h +++ b/src/table/control_codes.h @@ -66,6 +66,7 @@ enum StringControlCode { SCC_NUM, SCC_STRING_ID, + SCC_RAW_STRING_POINTER, SCC_PLURAL_LIST, SCC_GENDER_LIST, SCC_GENDER_INDEX, diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 404e82460b..888f1d0e59 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -453,7 +453,8 @@ uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine) uint32 cmask = EngInfo(engine)->refit_mask; /* List of cargo types available in this climate */ uint32 lmask = _cargo_mask; - char *b = _userstring; + char string[512]; + char *b = string; /* Draw nothing if the engine is not refittable */ if (CountBits(cmask) <= 1) return 0; @@ -477,9 +478,9 @@ uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine) for (CargoID cid = 0; cid < NUM_CARGO; cid++) { if (!HasBit(cmask, cid)) continue; - if (b >= lastof(_userstring) - (2 + 2 * 4)) break; // ", " and two calls to Utf8Encode() + if (b >= lastof(string) - (2 + 2 * 4)) break; // ", " and two calls to Utf8Encode() - if (!first) b = strecpy(b, ", ", lastof(_userstring)); + if (!first) b = strecpy(b, ", ", lastof(string)); first = false; b = InlineString(b, GetCargo(cid)->name); @@ -490,9 +491,9 @@ uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine) *b = '\0'; /* Make sure we detect any buffer overflow */ - assert(b < endof(_userstring)); + assert(b < endof(string)); - return DrawStringMultiLine(x, y, STR_SPEC_USERSTRING, w); + return DrawStringMultiLine(x, y, STR_JUST_RAW_STRING, w); }