diff --git a/.github/windowdesc-ini-key.py b/.github/windowdesc-ini-key.py index 16fa3053d8..36b20f9948 100644 --- a/.github/windowdesc-ini-key.py +++ b/.github/windowdesc-ini-key.py @@ -22,7 +22,7 @@ def scan_source_files(path, ini_keys=None): with open(new_path) as fp: output = fp.read() - for (name, ini_key, widgets) in re.findall(r"^static WindowDesc ([a-zA-Z0-9_]*).*?, (?:\"(.*?)\")?.*?,(?:\s+(.*?),){6}", output, re.S|re.M): + for (name, ini_key, widgets) in re.findall(r"^static WindowDesc ([a-zA-Z0-9_]*).*?, (?:\"(.*?)\")?.*?,(?:\s+.*?,){6}\s+[^\s]+\((.*?)\)", output, re.S|re.M): if ini_key: if ini_key in ini_keys: errors.append(f"{new_path}: {name} ini_key is a duplicate") diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 6623ca17bf..4f7a1dde8d 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -90,7 +90,8 @@ jobs: # Ensure we use the latest version of npm; the one we get with current # emscripten doesn't allow running "npx wrangler" as root. - npm install -g npm + # Current emscripten can't install npm>=10.0.0 because node is too old. + npm install -g npm@9 - name: Publish preview uses: cloudflare/pages-action@v1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e33a351d0..57f5a5f874 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,23 @@ if(EMSCRIPTEN) target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_BINARY_DIR}/lang/english.lng@/lang/english.lng") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/bin/ai@/ai") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/bin/game@/game") + # Documentation files for the in-game text file viewer + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/README.md@/README.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CREDITS.md@/CREDITS.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md@/CONTRIBUTING.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/COPYING.md@/COPYING.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.txt@/known-bugs.txt") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.txt@/changelog.txt") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/admin_network.md@/docs/admin_network.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md@/docs/debugging_desyncs.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/desync.md@/docs/desync.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/directory_structure.md@/docs/directory_structure.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/eints.md@/docs/eints.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/linkgraph.md@/docs/linkgraph.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md@/docs/logging_and_performance_metrics.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/multiplayer.md@/docs/multiplayer.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/savegame_format.md@/docs/savegame_format.md") + target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/symbol_server.md@/docs/symbol_server.md") # We use IDBFS for persistent storage. target_link_libraries(WASM::WASM INTERFACE "-lidbfs.js") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c76179dee..0f773ff320 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,6 +182,16 @@ There is no single source for OpenTTD development docs. It's a complex project w A good entry point is [Development](https://wiki.openttd.org/en/Development/) on the OpenTTD wiki; this provides links to wiki documentation and other sources. The GitHub repo also includes some non-comprehensive documentation in [/docs](./docs). +These include: +- When to [change other languages and when not to](./docs/eints.md). +- The [savegame format](./docs/savegame_format.md). +- The [release process](./docs/releasing_openttd.md). +- Some [notes on the link graph algorithm](./docs/linkgraph.md). +- The [network game coordinator](./docs/game_coordinator.md). +- How to use [the admin port for network games](./docs/admin_network.md), also useful for multiplayer server hosts. +- The [performance metrics and logging features](./docs/logging_and_performance_metrics.md), also useful for add-on developers. +- How [symbol server and analysis works](./docs/symbol_server.md). +- And several miscellaneous files detailing internal data structures and graphics measurements and palettes. You may also want the guide to [compiling OpenTTD](./COMPILING.md). diff --git a/COPYING.md b/COPYING.md index 2c2818d14c..27885642ba 100644 --- a/COPYING.md +++ b/COPYING.md @@ -1,5 +1,5 @@ This is the license which applies to OpenTTD with the exception of some -3rd party modules. See [./README.md](./README.md) for details +3rd party modules. See [our readme](./README.md) for details GNU General Public License ========================== diff --git a/README.md b/README.md index ad43bcce4e..38faff3a20 100644 --- a/README.md +++ b/README.md @@ -399,9 +399,10 @@ The *feature-sx* branches use the savegame framework in the *save_ext* branch. - 1.6) [OpenTTD directories](#16-openttd-directories) - 1.7) [Compiling OpenTTD](#17-compiling-openttd) - 2.0) [Contact and community](#20-contact-and-community) - - 2.1) [Contributing to OpenTTD](#21-contributing-to-openttd) - - 2.2) [Reporting bugs](#22-reporting-bugs) - - 2.3) [Translating](#23-translating) + - 2.1) [Multiplayer games](#21-multiplayer-games) + - 2.2) [Contributing to OpenTTD](#22-contributing-to-openttd) + - 2.3) [Reporting bugs](#23-reporting-bugs) + - 2.4) [Translating](#24-translating) - 3.0) [Licensing](#30-licensing) - 4.0) [Credits](#40-credits) @@ -465,9 +466,9 @@ For some platforms, you will need to refer to [the installation guide](https://w The free data files, split into OpenGFX for graphics, OpenSFX for sounds and OpenMSX for music can be found at: -- https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX -- https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX -- https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX +- [OpenGFX](https://www.openttd.org/downloads/opengfx-releases/latest) +- [OpenSFX](https://www.openttd.org/downloads/opensfx-releases/latest) +- [OpenMSX](https://www.openttd.org/downloads/openmsx-releases/latest) Please follow the readme of these packages about the installation procedure. The Windows installer can optionally download and install these packages. @@ -532,12 +533,19 @@ If you want to compile OpenTTD from source, instructions can be found in [COMPIL - the OpenTTD wiki has a [page listing OpenTTD communities](https://wiki.openttd.org/en/Community/Community) including some in languages other than English -### 2.1) Contributing to OpenTTD +### 2.1) Multiplayer games + +You can play OpenTTD with others, either cooperatively or competitively. + +See the [multiplayer documentation](./docs/multiplayer.md) for more details. + + +### 2.2) Contributing to OpenTTD We welcome contributors to OpenTTD. More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md) -### 2.2) Reporting bugs +### 2.3) Reporting bugs Good bug reports are very helpful. We have a [guide to reporting bugs](./CONTRIBUTING.md#bug-reports) to help with this. @@ -545,7 +553,7 @@ Desyncs in multiplayer are complex to debug and report (some software developmen Instructions can be found in [debugging and reporting desyncs](./docs/debugging_desyncs.md). -### 2.3) Translating +### 2.4) Translating OpenTTD is translated into many languages. Translations are added and updated via the [online translation tool](https://translator.openttd.org). diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake index 5728b0c062..9228b8edee 100644 --- a/cmake/InstallAndPackage.cmake +++ b/cmake/InstallAndPackage.cmake @@ -37,13 +37,32 @@ install(DIRECTORY install(FILES ${CMAKE_SOURCE_DIR}/COPYING.md ${CMAKE_SOURCE_DIR}/README.md + ${CMAKE_SOURCE_DIR}/CREDITS.md + ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md ${CMAKE_SOURCE_DIR}/changelog.txt - ${CMAKE_SOURCE_DIR}/docs/multiplayer.md ${CMAKE_SOURCE_DIR}/known-bugs.txt ${CMAKE_SOURCE_DIR}/jgrpp-changelog.md DESTINATION ${DOCS_DESTINATION_DIR} COMPONENT docs) +install(FILES + ${CMAKE_SOURCE_DIR}/docs/admin_network.md + ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md + ${CMAKE_SOURCE_DIR}/docs/desync.md + ${CMAKE_SOURCE_DIR}/docs/directory_structure.md + ${CMAKE_SOURCE_DIR}/docs/eints.md + ${CMAKE_SOURCE_DIR}/docs/game_coordinator.md + ${CMAKE_SOURCE_DIR}/docs/linkgraph.md + ${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md + ${CMAKE_SOURCE_DIR}/docs/multiplayer.md + ${CMAKE_SOURCE_DIR}/docs/savegame_format.md + ${CMAKE_SOURCE_DIR}/docs/symbol_server.md + ${CMAKE_SOURCE_DIR}/docs/obg_format.txt + ${CMAKE_SOURCE_DIR}/docs/obm_format.txt + ${CMAKE_SOURCE_DIR}/docs/obs_format.txt + DESTINATION ${DOCS_DESTINATION_DIR}/docs + COMPONENT docs) + # A Linux manual only makes sense when using FHS. Otherwise it is a very odd # file with little context to what it is. if(OPTION_INSTALL_FHS) diff --git a/cmake/SourceList.cmake b/cmake/SourceList.cmake index e48fc61c1e..41a9c3b51a 100644 --- a/cmake/SourceList.cmake +++ b/cmake/SourceList.cmake @@ -1,12 +1,4 @@ -# Add a file to be compiled. -# -# add_files([file1 ...] CONDITION condition [condition ...]) -# -# CONDITION is a complete statement that can be evaluated with if(). -# If it evaluates true, the source files will be added; otherwise not. -# For example: ADD_IF SDL_FOUND AND Allegro_FOUND -# -function(add_files) +function(_add_files_tgt tgt) cmake_parse_arguments(PARAM "" "" "CONDITION" ${ARGN}) set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}") @@ -17,10 +9,32 @@ function(add_files) endif() foreach(FILE IN LISTS PARAM_FILES) - target_sources(openttd PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) + # Some IDEs are not happy with duplicated filenames, so we detect that before adding the file. + #get_target_property(${tgt}_FILES ${tgt} SOURCES) + #if(${tgt}_FILES MATCHES "/${FILE}(;|$)") + # string(REGEX REPLACE "(^|.+;)([^;]+/${FILE})(;.+|$)" "\\2" RES "${${tgt}_FILES}") + # # Ignore header files duplicates in 3rdparty. + # if(NOT (${FILE} MATCHES "\.h" AND (${RES} MATCHES "3rdparty" OR ${CMAKE_CURRENT_SOURCE_DIR} MATCHES "3rdparty"))) + # message(FATAL_ERROR "${tgt}: ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} filename is a duplicate of ${RES}") + # endif() + #endif() + + target_sources(${tgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) endforeach() endfunction() +# Add a file to be compiled. +# +# add_files([file1 ...] CONDITION condition [condition ...]) +# +# CONDITION is a complete statement that can be evaluated with if(). +# If it evaluates true, the source files will be added; otherwise not. +# For example: ADD_IF SDL_FOUND AND Allegro_FOUND +# +function(add_files) + _add_files_tgt(openttd ${ARGV}) +endfunction() + # Add a test file to be compiled. # # add_test_files([file1 ...] CONDITION condition [condition ...]) @@ -30,18 +44,7 @@ endfunction() # For example: ADD_IF SDL_FOUND AND Allegro_FOUND # function(add_test_files) - cmake_parse_arguments(PARAM "" "" "CONDITION" ${ARGN}) - set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}") - - if(PARAM_CONDITION) - if(NOT (${PARAM_CONDITION})) - return() - endif() - endif() - - foreach(FILE IN LISTS PARAM_FILES) - target_sources(openttd_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) - endforeach() + _add_files_tgt(openttd_test ${ARGV}) endfunction() # This function works around an 'issue' with CMake, where diff --git a/docs/debugging_desyncs.md b/docs/debugging_desyncs.md index f5ea06e082..0b6aacde8e 100644 --- a/docs/debugging_desyncs.md +++ b/docs/debugging_desyncs.md @@ -53,4 +53,7 @@ Do NOT remove the dmp_cmds savegames of a desync you have reported until the desync has been fixed; if you, by accident, send us the wrong savegames we will not be able to reproduce the desync and thus will be unable to fix it. +## More information +You can find more theory on the causes and debugging of desyncs in the +[desync documentation](./desync.md). diff --git a/docs/multiplayer.md b/docs/multiplayer.md index 6ef14c4e77..15aaa68e15 100644 --- a/docs/multiplayer.md +++ b/docs/multiplayer.md @@ -193,6 +193,9 @@ If it is, and your server still isn't showing up, start OpenTTD with `-d net=4` as extra argument. This will show debug message related to the network, including communication to/from the Game Coordinator. +See the [Game Coordinator documentation](./game_coordinator.md) for more +technical information about the Game Coordinator service. + ### My server warns a lot about getaddrinfo taking N seconds This could be a transient issue with your (local) DNS server, but if the diff --git a/docs/savegame_format.md b/docs/savegame_format.md new file mode 100644 index 0000000000..fafbc64471 --- /dev/null +++ b/docs/savegame_format.md @@ -0,0 +1,214 @@ +# OpenTTD's Savegame Format + +Last updated: 2021-06-15 + +## Outer container + +Savegames for OpenTTD start with an outer container, to contain the compressed data for the rest of the savegame. + +`[0..3]` - The first four bytes indicate what compression is used. +In ASCII, these values are possible: + +- `OTTD` - Compressed with LZO (deprecated, only really old savegames would use this). +- `OTTN` - No compression. +- `OTTZ` - Compressed with zlib. +- `OTTX` - Compressed with LZMA. + +`[4..5]` - The next two bytes indicate which savegame version used. + +`[6..7]` - The next two bytes can be ignored, and were only used in really old savegames. + +`[8..N]` - Next follows a binary blob which is compressed with the indicated compression algorithm. + +The rest of this document talks about this decompressed blob of data. + +## Data types + +The savegame is written in Big Endian, so when we talk about a 16-bit unsigned integer (`uint16`), we mean it is stored in Big Endian. + +The following types are valid: + +- `1` - `int8` / `SLE_FILE_I8` -8-bit signed integer +- `2` - `uint8` / `SLE_FILE_U8` - 8-bit unsigned integer +- `3` - `int16` / `SLE_FILE_I16` - 16-bit signed integer +- `4` - `uint16` / `SLE_FILE_U16` - 16-bit unsigned integer +- `5` - `int32` / `SLE_FILE_I32` - 32-bit signed integer +- `6` - `uint32` / `SLE_FILE_U32` - 32-bit unsigned integer +- `7` - `int64` / `SLE_FILE_I64` - 64-bit signed integer +- `8` - `uint64` / `SLE_FILE_U64` - 64-bit unsigned integer +- `9` - `StringID` / `SLE_FILE_STRINGID` - a StringID inside the OpenTTD's string table +- `10` - `str` / `SLE_FILE_STRING` - a string (prefixed with a length-field) +- `11` - `struct` / `SLE_FILE_STRUCT` - a struct + +### Gamma value + +There is also a field-type called `gamma`. +This is most often used for length-fields, and uses as few bytes as possible to store an integer. +For values <= 127, it uses a single byte. +For values > 127, it uses two bytes and sets the highest bit to high. +For values > 32767, it uses three bytes and sets the two highest bits to high. +And this continues till the value fits. +In a more visual approach: +``` + 0xxxxxxx + 10xxxxxx xxxxxxxx + 110xxxxx xxxxxxxx xxxxxxxx + 1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx + 11110--- xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx +``` + +## Chunks + +Savegames for OpenTTD store their data in chunks. +Each chunk contains data for a certain part of the game, for example "Companies", "Vehicles", etc. + +`[0..3]` - Each chunk starts with four bytes to indicate the tag. +If the tag is `\x00\x00\x00\x00` it means the end of the savegame is reached. +An example of a valid tag is `PLYR` when looking at it via ASCII, which contains the information of all the companies. + +`[4..4]` - Next follows a byte where the lower 4 bits contain the type. +The possible valid types are: + +- `0` - `CH_RIFF` - This chunk is a binary blob. +- `1` - `CH_ARRAY` - This chunk is a list of items. +- `2` - `CH_SPARSE_ARRAY` - This chunk is a list of items. +- `3` - `CH_TABLE` - This chunk is self-describing list of items. +- `4` - `CH_SPARSE_TABLE` - This chunk is self-describing list of items. + +Now per type the format is (slightly) different. + +### CH_RIFF + +(since savegame version 295, this chunk type is only used for MAP-chunks, containing bit-information about each tile on the map) + +A `CH_RIFF` starts with an `uint24` which together with the upper-bits of the type defines the length of the chunk. +In pseudo-code: + +``` +type = read uint8 +if type == 0 + length = read uint24 + length |= ((type >> 4) << 24) +``` + +The next `length` bytes are part of the chunk. +What those bytes mean depends on the tag of the chunk; further details per chunk can be found in the source-code. + +### CH_ARRAY / CH_SPARSE_ARRAY + +(this chunk type is deprecated since savegame version 295 and is no longer in use) + +`[0..G1]` - A `CH_ARRAY` / `CH_SPARSE_ARRAY` starts with a `gamma`, indicating the size of the next item plus one. +If this size value is zero, it indicates the end of the list. +This indicates the full length of the next item minus one. +In psuedo-code: + +``` +loop + size = read gamma - 1 + if size == -1 + break loop + read bytes +``` + +`[]` - For `CH_ARRAY` there is an implicit index. +The loop starts at zero, and every iteration adds one to the index. +For entries in the game that were not allocated, the `size` will be zero. + +`[G1+1..G2]` - For `CH_SPARSE_ARRAY` there is an explicit index. +The `gamma` following the size indicates the index. + +The content of the item is a binary blob, and similar to `CH_RIFF`, it depends on the tag of the chunk what it means. +Please check the source-code for further details. + +### CH_TABLE / CH_SPARSE_TABLE + +(this chunk type only exists since savegame version 295) + +Both `CH_TABLE` and `CH_SPARSE_TABLE` are very similar to `CH_ARRAY` / `CH_SPARSE_ARRAY` respectively. +The only change is that the chunk starts with a header. +This header describes the chunk in details; with the header you know the meaning of each byte in the binary blob that follows. + +`[0..G]` - The header starts with a `gamma` to indicate the size of all the headers in this chunk plus one. +If this size value is zero, it means there is no header, which should never be the case. + +Next follows a list of `(type, key)` pairs: + +- `[0..0]` - Type of the field. +- `[1..G]` - `gamma` to indicate length of key. +- `[G+1..N]` - Key (in UTF-8) of the field. + +If at any point `type` is zero, the list stops (and no `key` follows). + +The `type`'s lower 4 bits indicate the data-type (see chapter above). +The `type`'s 5th bit (so `0x10`) indicates if the field is a list, and if this field in every record starts with a `gamma` to indicate how many times the `type` is repeated. + +If the `type` indicates either a `struct` or `str`, the `0x10` flag is also always set. + +As the savegame format allows (list of) structs in structs, if any `struct` type is found, this header will be followed by a header of that struct. +This nesting of structs is stored depth-first, so given this table: + +``` +type | key +----------------- +uint8 | counter +struct | substruct1 +struct | substruct2 +``` + +With `substruct1` being like: + +``` +type | key +----------------- +uint8 | counter +struct | substruct3 +``` + +The headers will be, in order: `table`, `substruct1`, `substruct3`, `substruct2`, each ending with a `type` is zero field. + +After reading all the fields of all the headers, there is a list of records. +To read this, see `CH_ARRAY` / `CH_SPARSE_ARRAY` for details. + +As each `type` has a well defined length, you can read the records even without knowing anything about the chunk-tag yourself. + +Do remember, that if the `type` had the `0x10` flag active, the field in the record first has a `gamma` to indicate how many times that `type` is repeated. + +#### Guidelines for network-compatible patch-packs + +For network-compatible patch-packs (client-side patches that can play together with unpatched clients) we advise to prefix the field-name with `__` when introducing new fields to an existing chunk. + +Example: you have an extra setting called `auto_destroy_rivers` you want to store in the savegame for your patched client called `mypp`. +We advise you to call this setting `__mypp_auto_destroy_rivers` in the settings chunk. + +Doing it this way ensures that a savegame created by these patch-packs can still safely be loaded by unpatched clients. +They will simply ignore the field and continue loading the savegame as usual. +The prefix is strongly advised to avoid conflicts with future-settings in an unpatched client or conflicts with other patch-packs. + +## Scripts custom data format + +Script chunks (`AIPL` and `GSDT`) use `CH_TABLE` chunk type. + +At the end of each record there's an `uint8` to indicate if there's custom data (1) or not (0). + +There are 6 data types for scripts, called `script-data-type`. +When saving, each `script-data-type` starts with the type marker saved as `uint8` followed by the actual data. +- `0` - `SQSL_INT`: + - an `int64` with the actual value (`int32` before savegame version 296). +- `1` - `SQSL_STRING`: + - an `uint8` with the string length. + - a list of `int8` for the string itself. +- `2` - `SQSL_ARRAY`: + - each element saved as `script-data-type`. + - an `SQSL_ARRAY_TABLE_END` (0xFF) marker (`uint8`). +- `3` - `SQSL_TABLE`: + - for each element: + - key saved as `script-data-type`. + - value saved as `script-data-type`. + - an `SQSL_ARRAY_TABLE_END` (0xFF) marker (`uint8`). +- `4` - `SQSL_BOOL`: + - an `uint8` with 0 (false) or 1 (true). +- `5` - `SQSL_NULL`: + - (no data follows) + +The first data type is always a `SQSL_TABLE`. diff --git a/docs/symbol_server.md b/docs/symbol_server.md new file mode 100644 index 0000000000..c1c522a1b6 --- /dev/null +++ b/docs/symbol_server.md @@ -0,0 +1,34 @@ +# OpenTTD's Symbol Server + +For all official releases, OpenTTD collects the Breakpad Symbols (SYM-files) and Microsoft's Symbols (PDB-files), and publishes them on our own Symbol Server (https://symbols.openttd.org). + +These symbol files are needed to analyze `crash.dmp` files as attached to issues by users. +A `crash.dmp` is created on Windows, Linux, and MacOS when a crash happens. +This combined with the `crash.log` should give a pretty good indication what was going on at the moment the game crashed. + +## Analyzing a crash.dmp + +### MSVC + +In MSVC you can add the above URL as Symbol Server (and please enable MSVC's for all other libraries), allowing you to analyze `crash.dmp`. + +Now simply open up the `crash.dmp`, and start debugging. + +### All other platforms + +The best tool to use is `minidump-stackwalk` as published in the Rust's cargo index: + +```bash +cargo install minidump-stackwalk +``` + +For how to install Rust, please see [here](https://doc.rust-lang.org/cargo/getting-started/installation.html). + +Now run the tool like: + +```bash +minidump-stackwalk --symbols-url https://symbols.openttd.org +``` + +For convenience, the above Symbol Server also check with Mozilla's Symbol Server in case any other library but OpenTTD is requested. +This means files like `libc`, `kernel32.dll`, etc are all available on the above mentioned Symbol Server. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a1ea87b31e..9a5066f6e4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -210,6 +210,8 @@ add_files( guitimer_func.h heightmap.cpp heightmap.h + help_gui.cpp + help_gui.h highscore.cpp highscore.h highscore_gui.cpp diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 524914c3d0..b6750ac19c 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -76,7 +76,7 @@ static WindowDesc _ai_config_desc( WDP_CENTER, "settings_script_config", 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, - _nested_ai_config_widgets, lengthof(_nested_ai_config_widgets) + std::begin(_nested_ai_config_widgets), std::end(_nested_ai_config_widgets) ); /** diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 9ebff62fc7..63e39729a9 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -205,7 +205,7 @@ static WindowDesc _air_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets), + std::begin(_nested_air_toolbar_widgets), std::end(_nested_air_toolbar_widgets), &BuildAirToolbarWindow::hotkeys ); @@ -610,7 +610,7 @@ static WindowDesc _build_airport_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_airport_widgets, lengthof(_nested_build_airport_widgets) + std::begin(_nested_build_airport_widgets), std::end(_nested_build_airport_widgets) ); static void ShowBuildAirportPicker(Window *parent) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index dfdf6e35bb..43ce628bbe 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -358,7 +358,7 @@ public: switch (this->window_number) { case VEH_TRAIN: for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); /* Skip rail type if it has no label */ if (rti->label == 0) continue; d = maxdim(d, GetStringBoundingBox(rti->strings.replace_text)); @@ -810,7 +810,7 @@ static WindowDesc _replace_rail_vehicle_desc( WDP_AUTO, "replace_vehicle_train", 500, 140, WC_REPLACE_VEHICLE, WC_NONE, WDF_CONSTRUCTION, - _nested_replace_rail_vehicle_widgets, lengthof(_nested_replace_rail_vehicle_widgets) + std::begin(_nested_replace_rail_vehicle_widgets), std::end(_nested_replace_rail_vehicle_widgets) ); static const NWidgetPart _nested_replace_road_vehicle_widgets[] = { @@ -868,7 +868,7 @@ static WindowDesc _replace_road_vehicle_desc( WDP_AUTO, "replace_vehicle_road", 500, 140, WC_REPLACE_VEHICLE, WC_NONE, WDF_CONSTRUCTION, - _nested_replace_road_vehicle_widgets, lengthof(_nested_replace_road_vehicle_widgets) + std::begin(_nested_replace_road_vehicle_widgets), std::end(_nested_replace_road_vehicle_widgets) ); static const NWidgetPart _nested_replace_vehicle_widgets[] = { @@ -922,7 +922,7 @@ static WindowDesc _replace_vehicle_desc( WDP_AUTO, "replace_vehicle", 456, 118, WC_REPLACE_VEHICLE, WC_NONE, WDF_CONSTRUCTION, - _nested_replace_vehicle_widgets, lengthof(_nested_replace_vehicle_widgets) + std::begin(_nested_replace_vehicle_widgets), std::end(_nested_replace_vehicle_widgets) ); /** diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 2ebf6eab68..60c42e5f8a 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -42,7 +42,7 @@ static WindowDesc _background_desc( WDP_MANUAL, nullptr, 0, 0, WC_BOOTSTRAP, WC_NONE, WDF_NO_CLOSE, - _background_widgets, lengthof(_background_widgets) + std::begin(_background_widgets), std::end(_background_widgets) ); /** The background for the game. */ @@ -80,7 +80,7 @@ static WindowDesc _bootstrap_errmsg_desc( WDP_CENTER, nullptr, 0, 0, WC_BOOTSTRAP, WC_NONE, WDF_MODAL | WDF_NO_CLOSE, - _nested_bootstrap_errmsg_widgets, lengthof(_nested_bootstrap_errmsg_widgets) + std::begin(_nested_bootstrap_errmsg_widgets), std::end(_nested_bootstrap_errmsg_widgets) ); /** The window for a failed bootstrap. */ @@ -137,7 +137,7 @@ static WindowDesc _bootstrap_download_status_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL | WDF_NO_CLOSE, - _nested_bootstrap_download_status_window_widgets, lengthof(_nested_bootstrap_download_status_window_widgets) + std::begin(_nested_bootstrap_download_status_window_widgets), std::end(_nested_bootstrap_download_status_window_widgets) ); @@ -191,7 +191,7 @@ static WindowDesc _bootstrap_query_desc( WDP_CENTER, nullptr, 0, 0, WC_CONFIRM_POPUP_QUERY, WC_NONE, WDF_NO_CLOSE, - _bootstrap_query_widgets, lengthof(_bootstrap_query_widgets) + std::begin(_bootstrap_query_widgets), std::end(_bootstrap_query_widgets) ); /** The window for the query. It can't use the generic query window as that uses sprites that don't exist yet. */ diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index a8a3688b9b..79ccb9ca0c 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -360,7 +360,7 @@ static WindowDesc _build_bridge_desc( WDP_AUTO, "build_bridge", 200, 114, WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_bridge_widgets, lengthof(_nested_build_bridge_widgets) + std::begin(_nested_build_bridge_widgets), std::end(_nested_build_bridge_widgets) ); /** diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 8b6f602ac8..53fd08c1c1 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1986,7 +1986,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase { switch (widget) { case WID_BV_CAPTION: if (this->vehicle_type == VEH_TRAIN && !this->listview_mode && !this->virtual_train_mode) { - const RailtypeInfo *rti = GetRailTypeInfo(this->filter.railtype); + const RailTypeInfo *rti = GetRailTypeInfo(this->filter.railtype); SetDParam(0, rti->strings.build_caption); } else if (this->vehicle_type == VEH_ROAD && !this->listview_mode) { const RoadTypeInfo *rti = GetRoadTypeInfo(this->filter.roadtype); @@ -2905,7 +2905,7 @@ struct BuildVehicleWindowTrainAdvanced final : BuildVehicleWindowBase { switch (widget) { case WID_BV_CAPTION: { if (!this->listview_mode && !this->virtual_train_mode) { - const RailtypeInfo *rti = GetRailTypeInfo(this->railtype); + const RailTypeInfo *rti = GetRailTypeInfo(this->railtype); SetDParam(0, rti->strings.build_caption); } else { SetDParam(0, (this->listview_mode ? STR_VEHICLE_LIST_AVAILABLE_TRAINS : STR_BUY_VEHICLE_TRAIN_ALL_CAPTION) + this->vehicle_type); @@ -3245,7 +3245,7 @@ static WindowDesc _build_vehicle_desc( WDP_AUTO, "build_vehicle", 240, 268, WC_BUILD_VEHICLE, WC_NONE, WDF_CONSTRUCTION, - _nested_build_vehicle_widgets, lengthof(_nested_build_vehicle_widgets), + std::begin(_nested_build_vehicle_widgets), std::end(_nested_build_vehicle_widgets), &BuildVehicleWindow::hotkeys ); @@ -3253,7 +3253,7 @@ static WindowDesc _build_template_vehicle_desc( WDP_AUTO, nullptr, 240, 268, WC_BUILD_VIRTUAL_TRAIN, WC_CREATE_TEMPLATE, WDF_CONSTRUCTION, - _nested_build_vehicle_widgets, lengthof(_nested_build_vehicle_widgets), + std::begin(_nested_build_vehicle_widgets), std::end(_nested_build_vehicle_widgets), &BuildVehicleWindow::hotkeys, &_build_vehicle_desc ); @@ -3261,7 +3261,7 @@ static WindowDesc _build_vehicle_desc_train_advanced( WDP_AUTO, "build_vehicle_dual", 480, 268, WC_BUILD_VEHICLE, WC_NONE, WDF_CONSTRUCTION, - _nested_build_vehicle_widgets_train_advanced, lengthof(_nested_build_vehicle_widgets_train_advanced), + std::begin(_nested_build_vehicle_widgets_train_advanced), std::end(_nested_build_vehicle_widgets_train_advanced), &BuildVehicleWindow::hotkeys ); @@ -3269,7 +3269,7 @@ static WindowDesc _build_template_vehicle_desc_advanced( WDP_AUTO, nullptr, 480, 268, WC_BUILD_VIRTUAL_TRAIN, WC_CREATE_TEMPLATE, WDF_CONSTRUCTION, - _nested_build_vehicle_widgets_train_advanced, lengthof(_nested_build_vehicle_widgets_train_advanced), + std::begin(_nested_build_vehicle_widgets_train_advanced), std::end(_nested_build_vehicle_widgets_train_advanced), &BuildVehicleWindow::hotkeys, &_build_vehicle_desc_train_advanced ); diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 55603424ed..b952277e44 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -522,7 +522,7 @@ static WindowDesc _cheats_desc( WDP_AUTO, "cheats", 0, 0, WC_CHEATS, WC_NONE, 0, - _nested_cheat_widgets, lengthof(_nested_cheat_widgets) + std::begin(_nested_cheat_widgets), std::end(_nested_cheat_widgets) ); /** Open cheat window. */ diff --git a/src/company_base.h b/src/company_base.h index 440c9ec64d..9b16870f6a 100644 --- a/src/company_base.h +++ b/src/company_base.h @@ -107,7 +107,7 @@ struct CompanyProperties { */ bool is_ai; - Money yearly_expenses[3][EXPENSES_END]; ///< Expenses of the company for the last three years, in every #ExpensesType category. + std::array yearly_expenses{}; ///< Expenses of the company for the last three years. CompanyEconomyEntry cur_economy; ///< Economic data of the company of this quarter. CompanyEconomyEntry old_economy[MAX_HISTORY_QUARTERS]; ///< Economic data of the company of the last #MAX_HISTORY_QUARTERS quarters. byte num_valid_stat_ent; ///< Number of valid statistical entries in #old_economy. diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 817a1b7ebe..3d7dfd1023 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -597,7 +597,7 @@ Company *DoStartupNewCompany(DoStartupNewCompanyFlag flags, CompanyID company) std::fill(c->share_owners.begin(), c->share_owners.end(), INVALID_OWNER); - c->avail_railtypes = GetCompanyRailtypes(c->index); + c->avail_railtypes = GetCompanyRailTypes(c->index); c->avail_roadtypes = GetCompanyRoadTypes(c->index); c->inaugurated_year = _cur_year; @@ -825,8 +825,9 @@ void CompaniesYearlyLoop() { /* Copy statistics */ for (Company *c : Company::Iterate()) { - memmove(&c->yearly_expenses[1], &c->yearly_expenses[0], sizeof(c->yearly_expenses) - sizeof(c->yearly_expenses[0])); - memset(&c->yearly_expenses[0], 0, sizeof(c->yearly_expenses[0])); + /* Move expenses to previous years. */ + std::rotate(std::rbegin(c->yearly_expenses), std::rbegin(c->yearly_expenses) + 1, std::rend(c->yearly_expenses)); + c->yearly_expenses[0] = {}; SetWindowDirty(WC_FINANCES, c->index); } diff --git a/src/company_gui.cpp b/src/company_gui.cpp index a9d6595f4f..39d4f5c7be 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -228,7 +228,7 @@ static void DrawPrice(Money amount, int left, int right, int top, TextColour col * Draw a category of expenses/revenues in the year column. * @return The income sum of the category. */ -static Money DrawYearCategory (const Rect &r, int start_y, ExpensesList list, const Money(&tbl)[EXPENSES_END]) +static Money DrawYearCategory(const Rect &r, int start_y, ExpensesList list, const Expenses &tbl) { int y = start_y; ExpensesType et; @@ -259,7 +259,7 @@ static Money DrawYearCategory (const Rect &r, int start_y, ExpensesList list, co * @param tbl Reference to table of amounts for \a year. * @note The environment must provide padding at the left and right of \a r. */ -static void DrawYearColumn(const Rect &r, int year, const Money (&tbl)[EXPENSES_END]) +static void DrawYearColumn(const Rect &r, int year, const Expenses &tbl) { int y = r.top; Money sum; @@ -588,7 +588,7 @@ static WindowDesc _company_finances_desc( WDP_AUTO, "company_finances", 0, 0, WC_FINANCES, WC_NONE, 0, - _nested_company_finances_widgets, lengthof(_nested_company_finances_widgets) + std::begin(_nested_company_finances_widgets), std::end(_nested_company_finances_widgets) ); /** @@ -1184,7 +1184,7 @@ static WindowDesc _select_company_livery_desc( WDP_AUTO, nullptr, 0, 0, WC_COMPANY_COLOUR, WC_NONE, 0, - _nested_select_company_livery_widgets, lengthof(_nested_select_company_livery_widgets) + std::begin(_nested_select_company_livery_widgets), std::end(_nested_select_company_livery_widgets) ); void ShowCompanyLiveryWindow(CompanyID company, GroupID group) @@ -1801,7 +1801,7 @@ static WindowDesc _select_company_manager_face_desc( WDP_AUTO, nullptr, 0, 0, WC_COMPANY_MANAGER_FACE, WC_NONE, WDF_CONSTRUCTION, - _nested_select_company_manager_face_widgets, lengthof(_nested_select_company_manager_face_widgets) + std::begin(_nested_select_company_manager_face_widgets), std::end(_nested_select_company_manager_face_widgets) ); /** @@ -2205,7 +2205,7 @@ static WindowDesc _company_infrastructure_desc( WDP_AUTO, "company_infrastructure", 0, 0, WC_COMPANY_INFRASTRUCTURE, WC_NONE, 0, - _nested_company_infrastructure_widgets, lengthof(_nested_company_infrastructure_widgets) + std::begin(_nested_company_infrastructure_widgets), std::end(_nested_company_infrastructure_widgets) ); /** @@ -2853,7 +2853,7 @@ static WindowDesc _company_desc( WDP_AUTO, "company", 0, 0, WC_COMPANY, WC_NONE, 0, - _nested_company_widgets, lengthof(_nested_company_widgets) + std::begin(_nested_company_widgets), std::end(_nested_company_widgets) ); /** @@ -3006,7 +3006,7 @@ static WindowDesc _buy_company_desc( WDP_AUTO, nullptr, 0, 0, WC_BUY_COMPANY, WC_NONE, WDF_CONSTRUCTION, - _nested_buy_company_widgets, lengthof(_nested_buy_company_widgets) + std::begin(_nested_buy_company_widgets), std::end(_nested_buy_company_widgets) ); /** diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index c21c5094ba..2f735af7ce 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -13,7 +13,7 @@ #include "engine_func.h" #include "landscape.h" #include "sl/saveload.h" -#include "network/core/game_info.h" +#include "network/core/network_game_info.h" #include "network/network.h" #include "network/network_func.h" #include "network/network_base.h" @@ -2830,7 +2830,7 @@ DEF_CONSOLE_CMD(ConDumpRailTypes) btree::btree_map grfs; for (RailType rt = RAILTYPE_BEGIN; rt < RAILTYPE_END; rt++) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); if (rti->label == 0) continue; uint32 grfid = 0; const GRFFile *grf = rti->grffile[RTSG_GROUND]; @@ -3625,7 +3625,7 @@ DEF_CONSOLE_CMD(ConRailTypeMapColourCtl) uint8 map_colour = atoi(argv[2]); if (rt >= RAILTYPE_END) return true; - extern RailtypeInfo _railtypes[RAILTYPE_END]; + extern RailTypeInfo _railtypes[RAILTYPE_END]; _railtypes[rt].map_colour = map_colour; MarkAllViewportMapLandscapesDirty(); diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 46370e688d..89d3fc3a3b 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -108,7 +108,7 @@ static WindowDesc _console_window_desc( WDP_MANUAL, nullptr, 0, 0, WC_CONSOLE, WC_NONE, 0, - _nested_console_window_widgets, lengthof(_nested_console_window_widgets) + std::begin(_nested_console_window_widgets), std::end(_nested_console_window_widgets) ); struct IConsoleWindow : Window @@ -290,22 +290,9 @@ struct IConsoleWindow : Window } } - const char *GetFocusedText() const override + Textbuf *GetFocusedTextbuf() const override { - return _iconsole_cmdline.buf; - } - - const char *GetCaret() const override - { - return _iconsole_cmdline.buf + _iconsole_cmdline.caretpos; - } - - const char *GetMarkedText(size_t *length) const override - { - if (_iconsole_cmdline.markend == 0) return nullptr; - - *length = _iconsole_cmdline.markend - _iconsole_cmdline.markpos; - return _iconsole_cmdline.buf + _iconsole_cmdline.markpos; + return &_iconsole_cmdline; } Point GetCaretPosition() const override diff --git a/src/date_gui.cpp b/src/date_gui.cpp index b1abda28cf..5416da2769 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -343,14 +343,14 @@ static WindowDesc _set_date_desc( WDP_CENTER, nullptr, 0, 0, WC_SET_DATE, WC_NONE, 0, - _nested_set_date_widgets, lengthof(_nested_set_date_widgets) + std::begin(_nested_set_date_widgets), std::end(_nested_set_date_widgets) ); static WindowDesc _set_minutes_desc( WDP_CENTER, nullptr, 0, 0, WC_SET_DATE, WC_NONE, 0, - _nested_set_minutes_widgets, lengthof(_nested_set_minutes_widgets) + std::begin(_nested_set_minutes_widgets), std::end(_nested_set_minutes_widgets) ); /** diff --git a/src/departures_gui.cpp b/src/departures_gui.cpp index a7edef3101..0f2e90c7c9 100644 --- a/src/departures_gui.cpp +++ b/src/departures_gui.cpp @@ -70,7 +70,7 @@ static WindowDesc _departures_desc( WDP_AUTO, nullptr, 260, 246, WC_DEPARTURES_BOARD, WC_NONE, 0, - _nested_departures_list, lengthof(_nested_departures_list) + std::begin(_nested_departures_list), std::end(_nested_departures_list) ); static uint cached_date_width = 0; ///< The cached maximum width required to display a date. diff --git a/src/depot_base.h b/src/depot_base.h index 48b9154166..f1f0be5bc1 100644 --- a/src/depot_base.h +++ b/src/depot_base.h @@ -18,12 +18,12 @@ typedef Pool DepotPool; extern DepotPool _depot_pool; struct Depot : DepotPool::PoolItem<&_depot_pool> { + /* DepotID index member of DepotPool is 2 bytes. */ + uint16 town_cn; ///< The N-1th depot for this town (consecutive number) + TileIndex xy; Town *town; TinyString name; - - TileIndex xy; - uint16 town_cn; ///< The N-1th depot for this town (consecutive number) - Date build_date; ///< Date of construction + Date build_date; ///< Date of construction Depot(TileIndex xy = INVALID_TILE) : xy(xy) {} ~Depot(); diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 24c822fc72..c9c3eab5ac 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -88,28 +88,28 @@ static WindowDesc _train_depot_desc( WDP_AUTO, "depot_train", 362, 123, WC_VEHICLE_DEPOT, WC_NONE, 0, - _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) + std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); static WindowDesc _road_depot_desc( WDP_AUTO, "depot_roadveh", 316, 97, WC_VEHICLE_DEPOT, WC_NONE, 0, - _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) + std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); static WindowDesc _ship_depot_desc( WDP_AUTO, "depot_ship", 306, 99, WC_VEHICLE_DEPOT, WC_NONE, 0, - _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) + std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); static WindowDesc _aircraft_depot_desc( WDP_AUTO, "depot_aircraft", 332, 99, WC_VEHICLE_DEPOT, WC_NONE, 0, - _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) + std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); extern void DepotSortList(VehicleList *list); diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 35ee366d7a..4ef54b8e55 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -352,7 +352,7 @@ static WindowDesc _build_docks_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets), + std::begin(_nested_build_docks_toolbar_widgets), std::end(_nested_build_docks_toolbar_widgets), &BuildDocksToolbarWindow::hotkeys ); @@ -396,7 +396,7 @@ static WindowDesc _build_docks_scen_toolbar_desc( WDP_AUTO, "toolbar_water_scen", 0, 0, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_docks_scen_toolbar_widgets, lengthof(_nested_build_docks_scen_toolbar_widgets) + std::begin(_nested_build_docks_scen_toolbar_widgets), std::end(_nested_build_docks_scen_toolbar_widgets) ); /** @@ -499,7 +499,7 @@ static WindowDesc _build_dock_station_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_dock_station_widgets, lengthof(_nested_build_dock_station_widgets) + std::begin(_nested_build_dock_station_widgets), std::end(_nested_build_dock_station_widgets) ); static void ShowBuildDockStationPicker(Window *parent) @@ -600,7 +600,7 @@ static WindowDesc _build_docks_depot_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_docks_depot_widgets, lengthof(_nested_build_docks_depot_widgets) + std::begin(_nested_build_docks_depot_widgets), std::end(_nested_build_docks_depot_widgets) ); diff --git a/src/economy.cpp b/src/economy.cpp index 2664e1a0c9..43418fb351 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1415,8 +1415,8 @@ static void TriggerIndustryProduction(Industry *i) * @param front The front of the train */ CargoPayment::CargoPayment(Vehicle *front) : - front(front), - current_station(front->last_station_visited) + current_station(front->last_station_visited), + front(front) { } diff --git a/src/economy_base.h b/src/economy_base.h index cee669cf9a..c1555d5675 100644 --- a/src/economy_base.h +++ b/src/economy_base.h @@ -22,16 +22,16 @@ extern CargoPaymentPool _cargo_payment_pool; * Helper class to perform the cargo payment. */ struct CargoPayment : CargoPaymentPool::PoolItem<&_cargo_payment_pool> { + /* CargoPaymentID index member of CargoPaymentPool is 4 bytes. */ + StationID current_station; ///< NOSAVE: The current station + CargoID ct; ///< NOSAVE: The currently handled cargo type + Company *owner; ///< NOSAVE: The owner of the vehicle + Vehicle *front; ///< The front vehicle to do the payment of Money route_profit; ///< The amount of money to add/remove from the bank account Money visual_profit; ///< The visual profit to show Money visual_transfer; ///< The transfer credits to be shown - /* Unsaved variables */ - Company *owner; ///< The owner of the vehicle - StationID current_station; ///< The current station - CargoID ct; ///< The currently handled cargo type - /** Constructor for pool saveload */ CargoPayment() {} CargoPayment(Vehicle *front); diff --git a/src/economy_type.h b/src/economy_type.h index 3a994d6451..7601601d5d 100644 --- a/src/economy_type.h +++ b/src/economy_type.h @@ -177,6 +177,11 @@ enum ExpensesType : byte { /** Define basic enum properties for ExpensesType */ template <> struct EnumPropsT : MakeEnumPropsT {}; +/** + * Data type for storage of Money for each #ExpensesType category. + */ +using Expenses = std::array; + /** * Categories of a price bases. */ diff --git a/src/elrail.cpp b/src/elrail.cpp index de661fdb4f..bb4cfe520a 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -207,7 +207,7 @@ static TrackBits MaskWireBits(TileIndex t, TrackBits tracks) */ static inline SpriteID GetWireBase(TileIndex tile, RailType rt, TileContext context = TCX_NORMAL) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); SpriteID wires = GetCustomRailSprite(rti, tile, RTSG_WIRES, context); return wires == 0 ? SPR_WIRE_BASE : wires; } @@ -217,7 +217,7 @@ static inline SpriteID GetWireBase(TileIndex tile, RailType rt, TileContext cont */ static inline SpriteID GetPylonBase(TileIndex tile, RailType rt, TileContext context = TCX_NORMAL) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); SpriteID pylons = GetCustomRailSprite(rti, tile, RTSG_PYLONS, context); return pylons == 0 ? SPR_PYLON_BASE : pylons; } @@ -733,7 +733,7 @@ void SettingsDisableElrail(int32 new_value) } } - for (Company *c : Company::Iterate()) c->avail_railtypes = GetCompanyRailtypes(c->index); + for (Company *c : Company::Iterate()) c->avail_railtypes = GetCompanyRailTypes(c->index); /* This resets the _last_built_railtype, which will be invalid for electric * rails. It may have unintended consequences if that function is ever diff --git a/src/engine.cpp b/src/engine.cpp index ecacc9a5c3..64023ccd54 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -828,7 +828,7 @@ void StartupEngines() /* Update the bitmasks for the vehicle lists */ for (Company *c : Company::Iterate()) { - c->avail_railtypes = GetCompanyRailtypes(c->index); + c->avail_railtypes = GetCompanyRailTypes(c->index); c->avail_roadtypes = GetCompanyRoadTypes(c->index); } @@ -852,7 +852,7 @@ static void EnableEngineForCompany(EngineID eid, CompanyID company) SetBit(e->company_avail, company); if (e->type == VEH_TRAIN) { - c->avail_railtypes = GetCompanyRailtypes(c->index); + c->avail_railtypes = GetCompanyRailTypes(c->index); } else if (e->type == VEH_ROAD) { c->avail_roadtypes = GetCompanyRoadTypes(c->index); } @@ -880,7 +880,7 @@ static void DisableEngineForCompany(EngineID eid, CompanyID company) ClrBit(e->company_avail, company); if (e->type == VEH_TRAIN) { - c->avail_railtypes = GetCompanyRailtypes(c->index); + c->avail_railtypes = GetCompanyRailTypes(c->index); } else if (e->type == VEH_ROAD) { c->avail_roadtypes = GetCompanyRoadTypes(c->index); } diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index b2cc4291cb..3c1ae60af9 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -146,7 +146,7 @@ static WindowDesc _engine_preview_desc( WDP_CENTER, nullptr, 0, 0, WC_ENGINE_PREVIEW, WC_NONE, WDF_CONSTRUCTION, - _nested_engine_preview_widgets, lengthof(_nested_engine_preview_widgets) + std::begin(_nested_engine_preview_widgets), std::end(_nested_engine_preview_widgets) ); diff --git a/src/error_gui.cpp b/src/error_gui.cpp index 4381a097f1..d5893a4fd0 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -45,7 +45,7 @@ static WindowDesc _errmsg_desc( WDP_MANUAL, nullptr, 0, 0, WC_ERRMSG, WC_NONE, 0, - _nested_errmsg_widgets, lengthof(_nested_errmsg_widgets) + std::begin(_nested_errmsg_widgets), std::end(_nested_errmsg_widgets) ); static const NWidgetPart _nested_errmsg_face_widgets[] = { @@ -65,7 +65,7 @@ static WindowDesc _errmsg_face_desc( WDP_MANUAL, nullptr, 0, 0, WC_ERRMSG, WC_NONE, 0, - _nested_errmsg_face_widgets, lengthof(_nested_errmsg_face_widgets) + std::begin(_nested_errmsg_face_widgets), std::end(_nested_errmsg_face_widgets) ); /** diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index b9198d2898..835382bfed 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -934,7 +934,7 @@ static WindowDesc _load_dialog_desc( WDP_CENTER, "load_game", 500, 294, WC_SAVELOAD, WC_NONE, 0, - _nested_load_dialog_widgets, lengthof(_nested_load_dialog_widgets) + std::begin(_nested_load_dialog_widgets), std::end(_nested_load_dialog_widgets) ); /** Load heightmap */ @@ -942,7 +942,7 @@ static WindowDesc _load_heightmap_dialog_desc( WDP_CENTER, "load_heightmap", 257, 320, WC_SAVELOAD, WC_NONE, 0, - _nested_load_heightmap_dialog_widgets, lengthof(_nested_load_heightmap_dialog_widgets) + std::begin(_nested_load_heightmap_dialog_widgets), std::end(_nested_load_heightmap_dialog_widgets) ); /** Save game/scenario */ @@ -950,7 +950,7 @@ static WindowDesc _save_dialog_desc( WDP_CENTER, "save_game", 500, 294, WC_SAVELOAD, WC_NONE, 0, - _nested_save_dialog_widgets, lengthof(_nested_save_dialog_widgets) + std::begin(_nested_save_dialog_widgets), std::end(_nested_save_dialog_widgets) ); /** diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 02245c9c64..9e39aeb76c 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -728,7 +728,7 @@ static WindowDesc _framerate_display_desc( WDP_AUTO, "framerate_display", 0, 0, WC_FRAMERATE_DISPLAY, WC_NONE, 0, - _framerate_window_widgets, lengthof(_framerate_window_widgets) + std::begin(_framerate_window_widgets), std::end(_framerate_window_widgets) ); @@ -1014,7 +1014,7 @@ static WindowDesc _frametime_graph_window_desc( WDP_AUTO, "frametime_graph", 140, 90, WC_FRAMETIME_GRAPH, WC_NONE, 0, - _frametime_graph_window_widgets, lengthof(_frametime_graph_window_widgets) + std::begin(_frametime_graph_window_widgets), std::end(_frametime_graph_window_widgets) ); diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index e60658487c..2fda48e833 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -71,7 +71,7 @@ static WindowDesc _gs_config_desc( WDP_CENTER, "settings_gs_config", 500, 350, WC_GAME_OPTIONS, WC_NONE, 0, - _nested_gs_config_widgets, lengthof(_nested_gs_config_widgets) + std::begin(_nested_gs_config_widgets), std::end(_nested_gs_config_widgets) ); bool UserIsAllowedToChangeGameScript() diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index caf0f2bdd0..0b8541ba68 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -1157,14 +1157,14 @@ static WindowDesc _generate_landscape_desc( WDP_CENTER, nullptr, 0, 0, WC_GENERATE_LANDSCAPE, WC_NONE, 0, - _nested_generate_landscape_widgets, lengthof(_nested_generate_landscape_widgets) + std::begin(_nested_generate_landscape_widgets), std::end(_nested_generate_landscape_widgets) ); static WindowDesc _heightmap_load_desc( WDP_CENTER, nullptr, 0, 0, WC_GENERATE_LANDSCAPE, WC_NONE, 0, - _nested_heightmap_load_widgets, lengthof(_nested_heightmap_load_widgets) + std::begin(_nested_heightmap_load_widgets), std::end(_nested_heightmap_load_widgets) ); static void _ShowGenerateLandscape(GenerateLandscapeWindowMode mode) @@ -1473,7 +1473,7 @@ static WindowDesc _create_scenario_desc( WDP_CENTER, nullptr, 0, 0, WC_GENERATE_LANDSCAPE, WC_NONE, 0, - _nested_create_scenario_widgets, lengthof(_nested_create_scenario_widgets) + std::begin(_nested_create_scenario_widgets), std::end(_nested_create_scenario_widgets) ); /** Show the window to create a scenario. */ @@ -1499,7 +1499,7 @@ static WindowDesc _generate_progress_desc( WDP_CENTER, nullptr, 0, 0, WC_MODAL_PROGRESS, WC_NONE, 0, - _nested_generate_progress_widgets, lengthof(_nested_generate_progress_widgets) + std::begin(_nested_generate_progress_widgets), std::end(_nested_generate_progress_widgets) ); struct GenWorldStatus { diff --git a/src/gfx.cpp b/src/gfx.cpp index f4abd29f67..2dedc78d0b 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -949,7 +949,7 @@ ptrdiff_t GetCharAtPosition(std::string_view str, int x, FontSize start_fontsize if (x < 0) return -1; Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize); - return layout.GetCharAtPosition(x); + return layout.GetCharAtPosition(x, 0); } /** diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 729daa402e..e018d17941 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -274,11 +274,14 @@ Point Layouter::GetCharPosition(std::string_view::const_iterator ch) const /** * Get the character that is at a pixel position in the first line of the layouted text. * @param x Position in the string. + * @param line_index Which line of the layout to search * @return String offset of the position (bytes) or -1 if no character is at the position. */ -ptrdiff_t Layouter::GetCharAtPosition(int x) const +ptrdiff_t Layouter::GetCharAtPosition(int x, size_t line_index) const { - const auto &line = this->front(); + if (line_index >= this->size()) return -1; + + const auto &line = this->at(line_index); for (int run_index = 0; run_index < line->CountRuns(); run_index++) { const ParagraphLayouter::VisualRun &run = line->GetVisualRun(run_index); diff --git a/src/gfx_layout.h b/src/gfx_layout.h index 0f6a0ea655..c4c8c7367c 100644 --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -181,7 +181,7 @@ public: Layouter(std::string_view str, int maxw = INT32_MAX, TextColour colour = TC_FROMSTRING, FontSize fontsize = FS_NORMAL); Dimension GetBounds(); Point GetCharPosition(std::string_view::const_iterator ch) const; - ptrdiff_t GetCharAtPosition(int x) const; + ptrdiff_t GetCharAtPosition(int x, size_t line_index) const; static void ResetFontCache(FontSize size); static void ResetLineCache(); diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index 6b5842fa1e..91879fcb8b 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -306,7 +306,7 @@ static WindowDesc _goals_list_desc( WDP_AUTO, "list_goals", 500, 127, WC_GOALS_LIST, WC_NONE, 0, - _nested_goals_list_widgets, lengthof(_nested_goals_list_widgets) + std::begin(_nested_goals_list_widgets), std::end(_nested_goals_list_widgets) ); /** @@ -521,25 +521,25 @@ static WindowDesc _goal_question_list_desc[] = { WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, - _nested_goal_question_widgets_question, lengthof(_nested_goal_question_widgets_question), + std::begin(_nested_goal_question_widgets_question), std::end(_nested_goal_question_widgets_question), }, { WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, - _nested_goal_question_widgets_info, lengthof(_nested_goal_question_widgets_info), + std::begin(_nested_goal_question_widgets_info), std::end(_nested_goal_question_widgets_info), }, { WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, - _nested_goal_question_widgets_warning, lengthof(_nested_goal_question_widgets_warning), + std::begin(_nested_goal_question_widgets_warning), std::end(_nested_goal_question_widgets_warning), }, { WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, - _nested_goal_question_widgets_error, lengthof(_nested_goal_question_widgets_error), + std::begin(_nested_goal_question_widgets_error), std::end(_nested_goal_question_widgets_error), }, }; diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 35ad60813e..e6511c1fc3 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -148,7 +148,7 @@ static WindowDesc _graph_legend_desc( WDP_AUTO, "graph_legend", 0, 0, WC_GRAPH_LEGEND, WC_NONE, 0, - _nested_graph_legend_widgets, lengthof(_nested_graph_legend_widgets) + std::begin(_nested_graph_legend_widgets), std::end(_nested_graph_legend_widgets) ); static void ShowGraphLegend() @@ -679,7 +679,7 @@ static WindowDesc _operating_profit_desc( WDP_AUTO, "graph_operating_profit", 0, 0, WC_OPERATING_PROFIT, WC_NONE, 0, - _nested_operating_profit_widgets, lengthof(_nested_operating_profit_widgets) + std::begin(_nested_operating_profit_widgets), std::end(_nested_operating_profit_widgets) ); @@ -730,7 +730,7 @@ static WindowDesc _income_graph_desc( WDP_AUTO, "graph_income", 0, 0, WC_INCOME_GRAPH, WC_NONE, 0, - _nested_income_graph_widgets, lengthof(_nested_income_graph_widgets) + std::begin(_nested_income_graph_widgets), std::end(_nested_income_graph_widgets) ); void ShowIncomeGraph() @@ -1037,7 +1037,7 @@ static WindowDesc _delivered_cargo_graph_desc( WDP_AUTO, "graph_delivered_cargo", 0, 0, WC_DELIVERED_CARGO, WC_NONE, 0, - _nested_delivered_cargo_graph_widgets, lengthof(_nested_delivered_cargo_graph_widgets) + std::begin(_nested_delivered_cargo_graph_widgets), std::end(_nested_delivered_cargo_graph_widgets) ); void ShowDeliveredCargoGraph() @@ -1093,7 +1093,7 @@ static WindowDesc _performance_history_desc( WDP_AUTO, "graph_performance", 0, 0, WC_PERFORMANCE_HISTORY, WC_NONE, 0, - _nested_performance_history_widgets, lengthof(_nested_performance_history_widgets) + std::begin(_nested_performance_history_widgets), std::end(_nested_performance_history_widgets) ); void ShowPerformanceHistoryGraph() @@ -1142,7 +1142,7 @@ static WindowDesc _company_value_graph_desc( WDP_AUTO, "graph_company_value", 0, 0, WC_COMPANY_VALUE, WC_NONE, 0, - _nested_company_value_graph_widgets, lengthof(_nested_company_value_graph_widgets) + std::begin(_nested_company_value_graph_widgets), std::end(_nested_company_value_graph_widgets) ); void ShowCompanyValueGraph() @@ -1488,7 +1488,7 @@ static WindowDesc _cargo_payment_rates_desc( WDP_AUTO, "graph_cargo_payment_rates", 0, 0, WC_PAYMENT_RATES, WC_NONE, 0, - _nested_cargo_payment_rates_widgets, lengthof(_nested_cargo_payment_rates_widgets) + std::begin(_nested_cargo_payment_rates_widgets), std::end(_nested_cargo_payment_rates_widgets) ); @@ -1784,7 +1784,7 @@ static WindowDesc _performance_rating_detail_desc( WDP_AUTO, "league_details", 0, 0, WC_PERFORMANCE_DETAIL, WC_NONE, 0, - _nested_performance_rating_detail_widgets, lengthof(_nested_performance_rating_detail_widgets) + std::begin(_nested_performance_rating_detail_widgets), std::end(_nested_performance_rating_detail_widgets) ); void ShowPerformanceRatingDetail() @@ -2058,7 +2058,7 @@ static WindowDesc _station_cargo_desc( WDP_AUTO, "graph_station_cargo", 0, 0, WC_STATION_CARGO, WC_NONE, 0, - _nested_station_cargo_widgets, lengthof(_nested_station_cargo_widgets) + std::begin(_nested_station_cargo_widgets), std::end(_nested_station_cargo_widgets) ); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 20a4c45e12..7d7f553645 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1252,14 +1252,14 @@ static WindowDesc _other_group_desc( WDP_AUTO, "list_groups", 460, 246, WC_INVALID, WC_NONE, 0, - _nested_group_widgets, lengthof(_nested_group_widgets) + std::begin(_nested_group_widgets), std::end(_nested_group_widgets) ); static WindowDesc _train_group_desc( WDP_AUTO, "list_groups_train", 525, 246, WC_TRAINS_LIST, WC_NONE, 0, - _nested_group_widgets, lengthof(_nested_group_widgets) + std::begin(_nested_group_widgets), std::end(_nested_group_widgets) ); /** diff --git a/src/help_gui.cpp b/src/help_gui.cpp new file mode 100644 index 0000000000..d575725cdb --- /dev/null +++ b/src/help_gui.cpp @@ -0,0 +1,218 @@ +/* + * 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 help_gui.cpp GUI to access manuals and related. */ + +#include "stdafx.h" +#include "gui.h" +#include "window_gui.h" +#include "textfile_gui.h" +#include "fileio_func.h" +#include "table/control_codes.h" +#include "string_func.h" +#include "openttd.h" + +#include "help_gui.h" +#include "widgets/help_widget.h" +#include "widgets/misc_widget.h" + +#include "safeguards.h" + +static const std::string README_FILENAME = "README.md"; +static const std::string CHANGELOG_FILENAME = "changelog.txt"; +static const std::string KNOWN_BUGS_FILENAME = "known-bugs.txt"; +static const std::string LICENSE_FILENAME = "COPYING.md"; + +static const std::string WEBSITE_LINK = "https://www.openttd.org/"; +static const std::string WIKI_LINK = "https://wiki.openttd.org/"; +static const std::string BUGTRACKER_LINK = "https://bugs.openttd.org/"; +static const std::string COMMUNITY_LINK = "https://community.openttd.org/"; + +/** Only show the first 20 changelog versions in the textfile viewer. */ +static constexpr size_t CHANGELOG_VERSIONS_LIMIT = 20; + +/** + * Find the path to the game manual file. + * + * @param filename The filename to find. + * @return std::string The path to the filename if found. + */ +static std::optional FindGameManualFilePath(std::string_view filename) +{ + static const Searchpath searchpaths[] = { + SP_APPLICATION_BUNDLE_DIR, SP_INSTALLATION_DIR, SP_SHARED_DIR, SP_BINARY_DIR, SP_WORKING_DIR + }; + + for (Searchpath sp : searchpaths) { + auto file_path = FioGetDirectory(sp, BASE_DIR) + filename.data(); + if (FioCheckFileExists(file_path, NO_DIRECTORY)) return file_path; + } + + return {}; +} + +/** Window class displaying the game manual textfile viewer. */ +struct GameManualTextfileWindow : public TextfileWindow { + GameManualTextfileWindow(std::string_view filename) : TextfileWindow(TFT_GAME_MANUAL) + { + /* Mark the content of these files as trusted. */ + this->trusted = true; + + auto filepath = FindGameManualFilePath(filename); + /* The user could, in theory, have moved the file. So just show an empty window if that is the case. */ + if (!filepath.has_value()) { + return; + } + + this->filepath = filepath.value(); + this->LoadTextfile(this->filepath, NO_DIRECTORY); + this->OnClick({ 0, 0 }, WID_TF_WRAPTEXT, 1); + } + + void SetStringParameters(int widget) const override + { + if (widget == WID_TF_CAPTION) { + SetDParamStr(0, this->filename); + } + } + + void AfterLoadText() override + { + if (this->filename == CHANGELOG_FILENAME) { + this->link_anchors.clear(); + this->AfterLoadChangelog(); + this->GetWidget(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(this->jumplist.empty() ? SZSP_HORIZONTAL : 0); + } else { + this->TextfileWindow::AfterLoadText(); + } + } + + /** + * For changelog files, add a jumplist entry for each version. + * + * This is hardcoded and assumes "---" are used to separate versions. + */ + void AfterLoadChangelog() + { + /* Look for lines beginning with ---, they indicate that the previous line was a release name. */ + for (size_t line_index = 0; line_index < this->lines.size(); ++line_index) { + const Line &line = this->lines[line_index]; + if (line.text.find("---", 0) != 0) continue; + + if (this->jumplist.size() >= CHANGELOG_VERSIONS_LIMIT) { + this->lines.resize(line_index - 2); + break; + } + + /* Mark the version header with a colour, and add it to the jumplist. */ + this->lines[line_index - 1].colour = TC_GOLD; + this->lines[line_index].colour = TC_GOLD; + this->jumplist.push_back(line_index - 1); + } + } +}; + +/** Window class displaying the help window. */ +struct HelpWindow : public Window { + + HelpWindow(WindowDesc *desc, WindowNumber number) : Window(desc) + { + this->InitNested(number); + + this->EnableTextfileButton(README_FILENAME, WID_HW_README); + this->EnableTextfileButton(CHANGELOG_FILENAME, WID_HW_CHANGELOG); + this->EnableTextfileButton(KNOWN_BUGS_FILENAME, WID_HW_KNOWN_BUGS); + this->EnableTextfileButton(LICENSE_FILENAME, WID_HW_LICENSE); + } + + void OnClick(Point pt, int widget, int click_count) override + { + switch (widget) { + case WID_HW_README: + new GameManualTextfileWindow(README_FILENAME); + break; + case WID_HW_CHANGELOG: + new GameManualTextfileWindow(CHANGELOG_FILENAME); + break; + case WID_HW_KNOWN_BUGS: + new GameManualTextfileWindow(KNOWN_BUGS_FILENAME); + break; + case WID_HW_LICENSE: + new GameManualTextfileWindow(LICENSE_FILENAME); + break; + case WID_HW_WEBSITE: + OpenBrowser(WEBSITE_LINK.c_str()); + break; + case WID_HW_WIKI: + OpenBrowser(WIKI_LINK.c_str()); + break; + case WID_HW_BUGTRACKER: + OpenBrowser(BUGTRACKER_LINK.c_str()); + break; + case WID_HW_COMMUNITY: + OpenBrowser(COMMUNITY_LINK.c_str()); + break; + } + } + +private: + void EnableTextfileButton(std::string_view filename, int button_widget) + { + this->GetWidget(button_widget)->SetDisabled(!FindGameManualFilePath(filename).has_value()); + } +}; + +static const NWidgetPart _nested_helpwin_widgets[] = { + NWidget(NWID_HORIZONTAL), + NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), + NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_HELP_WINDOW_CAPTION, STR_NULL), + EndContainer(), + + NWidget(WWT_PANEL, COLOUR_DARK_GREEN), + NWidget(NWID_SPACER), SetMinimalSize(0, 8), + + NWidget(NWID_HORIZONTAL), + NWidget(NWID_SPACER), SetMinimalSize(10, 0), + + NWidget(NWID_VERTICAL), SetPIP(0, 2, 0), + NWidget(WWT_FRAME, COLOUR_DARK_GREEN), SetDataTip(STR_HELP_WINDOW_WEBSITES, STR_NULL), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_WEBSITE), SetDataTip(STR_HELP_WINDOW_MAIN_WEBSITE, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_WIKI), SetDataTip(STR_HELP_WINDOW_MANUAL_WIKI, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_BUGTRACKER), SetDataTip(STR_HELP_WINDOW_BUGTRACKER, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_COMMUNITY), SetDataTip(STR_HELP_WINDOW_COMMUNITY, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + EndContainer(), + EndContainer(), + + NWidget(NWID_SPACER), SetMinimalSize(10, 0), + + NWidget(NWID_VERTICAL), SetPIP(0, 2, 0), + NWidget(WWT_FRAME, COLOUR_DARK_GREEN), SetDataTip(STR_HELP_WINDOW_DOCUMENTS, STR_NULL), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_README), SetDataTip(STR_HELP_WINDOW_README, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_CHANGELOG), SetDataTip(STR_HELP_WINDOW_CHANGELOG, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_KNOWN_BUGS),SetDataTip(STR_HELP_WINDOW_KNOWN_BUGS, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_HW_LICENSE), SetDataTip(STR_HELP_WINDOW_LICENSE, STR_NULL), SetMinimalSize(128, 12), SetFill(1, 0), + EndContainer(), + EndContainer(), + + NWidget(NWID_SPACER), SetMinimalSize(10, 0), + EndContainer(), + + NWidget(NWID_SPACER), SetMinimalSize(0, 8), + EndContainer(), +}; + +static WindowDesc _helpwin_desc( + WDP_CENTER, nullptr, 0, 0, + WC_HELPWIN, WC_NONE, + 0, + std::begin(_nested_helpwin_widgets), std::end(_nested_helpwin_widgets) +); + +void ShowHelpWindow() +{ + AllocateWindowDescFront(&_helpwin_desc, 0); +} diff --git a/src/help_gui.h b/src/help_gui.h new file mode 100644 index 0000000000..8027da6384 --- /dev/null +++ b/src/help_gui.h @@ -0,0 +1,15 @@ +/* + * 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 help_gui.h GUI to access manuals and related. */ + +#ifndef HELP_GUI_H +#define HELP_GUI_H + +void ShowHelpWindow(); + +#endif /* HELP_GUI_H */ diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 24084ceaef..820b4618bd 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -215,14 +215,14 @@ static WindowDesc _highscore_desc( WDP_MANUAL, nullptr, 0, 0, WC_HIGHSCORE, WC_NONE, 0, - _nested_highscore_widgets, lengthof(_nested_highscore_widgets) + std::begin(_nested_highscore_widgets), std::end(_nested_highscore_widgets) ); static WindowDesc _endgame_desc( WDP_MANUAL, nullptr, 0, 0, WC_ENDSCREEN, WC_NONE, 0, - _nested_highscore_widgets, lengthof(_nested_highscore_widgets) + std::begin(_nested_highscore_widgets), std::end(_nested_highscore_widgets) ); /** diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index b33889235d..474e740fa9 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -297,7 +297,7 @@ static WindowDesc _build_industry_desc( WDP_AUTO, "build_industry", 170, 212, WC_BUILD_INDUSTRY, WC_NONE, WDF_CONSTRUCTION, - _nested_build_industry_widgets, lengthof(_nested_build_industry_widgets) + std::begin(_nested_build_industry_widgets), std::end(_nested_build_industry_widgets) ); /** Build (fund or prospect) a new industry, */ @@ -1209,7 +1209,7 @@ static WindowDesc _industry_view_desc( WDP_AUTO, "view_industry", 260, 120, WC_INDUSTRY_VIEW, WC_NONE, 0, - _nested_industry_view_widgets, lengthof(_nested_industry_view_widgets) + std::begin(_nested_industry_view_widgets), std::end(_nested_industry_view_widgets) ); void ShowIndustryViewWindow(int industry) @@ -1873,7 +1873,7 @@ static WindowDesc _industry_directory_desc( WDP_AUTO, "list_industries", 428, 190, WC_INDUSTRY_DIRECTORY, WC_NONE, 0, - _nested_industry_directory_widgets, lengthof(_nested_industry_directory_widgets) + std::begin(_nested_industry_directory_widgets), std::end(_nested_industry_directory_widgets) ); void ShowIndustryDirectory() @@ -1916,7 +1916,7 @@ static WindowDesc _industry_cargoes_desc( WDP_AUTO, "industry_cargoes", 300, 210, WC_INDUSTRY_CARGOES, WC_NONE, 0, - _nested_industry_cargoes_widgets, lengthof(_nested_industry_cargoes_widgets) + std::begin(_nested_industry_cargoes_widgets), std::end(_nested_industry_cargoes_widgets) ); /** Available types of field. */ diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 742ee464b2..46b368da90 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -13,6 +13,7 @@ #include "window_gui.h" #include "window_func.h" #include "textbuf_gui.h" +#include "help_gui.h" #include "network/network.h" #include "genworld.h" #include "network/network_gui.h" @@ -361,6 +362,7 @@ struct SelectGameWindow : public Window { case WID_SGI_OPTIONS: ShowGameOptions(); break; case WID_SGI_HIGHSCORE: ShowHighscoreTable(); break; + case WID_SGI_HELP: ShowHelpWindow(); break; case WID_SGI_SETTINGS_OPTIONS:ShowGameSettings(); break; case WID_SGI_GRF_SETTINGS: ShowNewGRFSettings(true, true, false, &_grfconfig_newgame); break; case WID_SGI_CONTENT_DOWNLOAD: @@ -471,10 +473,12 @@ static const NWidgetPart _nested_select_game_widgets[] = { NWidget(NWID_SPACER), SetMinimalSize(0, 6), - /* 'Highscore Table' button */ - NWidget(NWID_HORIZONTAL), - NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, WID_SGI_HIGHSCORE), SetMinimalSize(316, 12), - SetDataTip(STR_INTRO_HIGHSCORE, STR_INTRO_TOOLTIP_HIGHSCORE), SetPadding(0, 10, 0, 10), SetFill(1, 0), + /* 'Help and Manuals' and 'Highscore Table' buttons */ + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), + NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, WID_SGI_HELP), SetMinimalSize(158, 12), + SetDataTip(STR_INTRO_HELP, STR_INTRO_TOOLTIP_HELP), SetPadding(0, 0, 0, 10), SetFill(1, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, WID_SGI_HIGHSCORE), SetMinimalSize(158, 12), + SetDataTip(STR_INTRO_HIGHSCORE, STR_INTRO_TOOLTIP_HIGHSCORE), SetPadding(0, 10, 0, 0), SetFill(1, 0), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 6), @@ -496,7 +500,7 @@ static WindowDesc _select_game_desc( WDP_CENTER, nullptr, 0, 0, WC_SELECT_GAME, WC_NONE, WDF_NO_CLOSE, - _nested_select_game_widgets, lengthof(_nested_select_game_widgets) + std::begin(_nested_select_game_widgets), std::end(_nested_select_game_widgets) ); void ShowSelectGameWindow() diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 9e8347e53c..e8d65b9783 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -483,7 +483,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Boodskapgeskied STR_NEWS_MENU_DELETE_ALL_MESSAGES :Vee alle boodskappe uit # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Terreininligting STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Skakel terminaal @@ -1309,6 +1309,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Geen STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Verminderd STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normaal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Laat deur-ry padhalte op dorp besite paaie toe: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Laat Bouery van deur-ry pad stasies op dorp beheerde paaie STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Laat deur-ry padhalte toe op paaie wat deur ander deelnemers besit word: {STRING} @@ -1972,6 +1973,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Verlaat STR_ABANDON_GAME_QUERY :{YELLOW}Is jy seker jy wil die speletjie verlaat? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Is jy seker jy wil die scenario verlaat? +# Help window + # Cheat window STR_CHEATS :{WHITE}Kullery STR_CHEATS_TOOLTIP :{BLACK}Keuseblokkies wys aan as jy die kulkode voorheen gebruik het @@ -4284,7 +4287,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Omvou di STR_TEXTFILE_VIEW_README :{BLACK}Besigtig readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Veranderinge-log STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisensie -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme van {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} veranderinge-log van {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} lisensie van {STRING} diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 6bf4abe1cb..7211ab1ece 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -483,7 +483,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :الرسائل STR_NEWS_MENU_DELETE_ALL_MESSAGES :احذف كل الرسائل # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :معلومات مربع في الخريطة STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :توقل كونسول @@ -1252,6 +1252,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :بدون STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :منخفض STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :طبيعي + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :السماح للعربات بالعبور خلال المواقف المملوكة داخل المدن: {STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :السماح بمرور العربات خلال المحطات المملوكة للمنافسين: {STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :السماح ببناء مواقف السيارات على الطرق المملوكة لشركات أخرى @@ -1778,6 +1779,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}إغلا STR_ABANDON_GAME_QUERY :{YELLOW}أمتأكد من رغبتك فى إغلاق اللعبه؟ STR_ABANDON_SCENARIO_QUERY :{YELLOW}هل تريد الخروج من انشاء الخريطة +# Help window + # Cheat window STR_CHEATS :{WHITE}اسرار STR_CHEATS_TOOLTIP :{BLACK}علامة صح اذا استخدمت هذا السرمن قبل @@ -4004,7 +4007,7 @@ STR_TEXTFILE_WRAP_TEXT :{WHITE}التف STR_TEXTFILE_VIEW_README :{BLACK}اعرض ملف التعليمات ريدمي STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}اعرض سجل التغييرات STR_TEXTFILE_VIEW_LICENCE :{BLACK}الرخصة -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING}اقراني {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} سجل التغيير ل{STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING}رخصة {STRING} diff --git a/src/lang/basque.txt b/src/lang/basque.txt index a1d2cfd6fc..9160311cc1 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -470,7 +470,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Azken mezua/alb STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Mezuen historia # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Lur arearen informazioa STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Konsola aktibatu @@ -1267,6 +1267,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ezer ez STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Mugatua STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Arrunta + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Herrien errepideetan zehar-pasatzeko geltokiak baimendu: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Herrien menpe dauden errepideetan zehar-pasatzeko geltokiak baimendu STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Arerioen errepideetan zehar-pasatzeko geltokiak baimendu: {STRING} @@ -1861,6 +1862,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Jokoa Ut STR_ABANDON_GAME_QUERY :{YELLOW}Ziur zaude joko hau utzi nahi duzula? STR_ABANDON_SCENARIO_QUERY :{YELLOW}¿Seguru al zaude eszenario hau utzi nahi duzula? +# Help window + # Cheat window STR_CHEATS :{WHITE}Trukoak STR_CHEATS_TOOLTIP :{BLACK}Kontrol laukiek erakutsiko dute trukoak erabili badituzu @@ -4034,7 +4037,7 @@ STR_TEXTFILE_WRAP_TEXT :{WHITE}Testua t STR_TEXTFILE_VIEW_README :{BLACK}Ikusi "irakur nazazu" STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Aldaketak STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lizentzia -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING} ren "irakur nazazu" artxiboa STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} {STRING}-aren aldaketak STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} {STRING} rako lizentzia diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 6ba80ca5f0..18b270981f 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -792,7 +792,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Гісторы STR_NEWS_MENU_DELETE_ALL_MESSAGES :Выдаліць усе паведамленьні # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Зьвесткі аб зямлі STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Кансоль @@ -1622,6 +1622,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :адсутні STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :зьніжаная STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :звычайная + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Дазволіць будаўніцтва прыпынкаў Ro-Ro на дарогах гарадзкой уласнасьці: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Дазволіць пабудову на дарогах, якія належаць гораду, прыпынкаў, празь якія можна проста праехаць (не заязжаючы "унутар"). STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Дазволіць будаўніцтва прыпынкаў Ro-Ro на дарогах канкурэнтаў: {STRING} @@ -2293,6 +2294,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}У га STR_ABANDON_GAME_QUERY :{YELLOW}Вы сапраўды жадаеце пакінуць гульню? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Вы ўпэўнены, што хочаце пакінуць гэты сцэнар? +# Help window + # Cheat window STR_CHEATS :{WHITE}Махлярства (чыты) STR_CHEATS_TOOLTIP :{BLACK}Птушкі паказваюць, ці выкарыстоўвалі Вы гэты чыт раней @@ -4640,7 +4643,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Пера STR_TEXTFILE_VIEW_README :{BLACK}Прагледзець iнструкцыю STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Журнал зьменаў STR_TEXTFILE_VIEW_LICENCE :{BLACK}Ліцэнзія -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} iнструкцыя {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} сьпiс зьменаў {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} ліцэнзія {STRING} diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 7c9df473b4..a4f2c7ca11 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -522,8 +522,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Histórico de M STR_NEWS_MENU_DELETE_ALL_MESSAGES :Apagar todas as mensagens # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informação da área do terreno +STR_ABOUT_MENU_HELP :Ajuda & manuais STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Alternar console STR_ABOUT_MENU_AI_DEBUG :Depurar IA/Script do jogo @@ -1427,6 +1428,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nenhum STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduzido STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Permitir passagens de nível com estradas ou linhas de outras companhias: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Permitir a construção de passagens de nível nas estradas ou linhas de outras companhias + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permitir estações de passagem nas estradas pertencentes às localidades: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permitir a construção de estações de passagem com paradas nas ruas pertencentes a localidades. STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir estações drive-through nas ruas de outros competidores: {STRING} @@ -2122,6 +2126,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multi-jo STR_INTRO_GAME_OPTIONS :{BLACK}Opções do Jogo STR_INTRO_HIGHSCORE :{BLACK}Pontuações +STR_INTRO_HELP :{BLACK}Ajuda & Manuais STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Configurações STR_INTRO_NEWGRF_SETTINGS :{BLACK}Configurar NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Checar conteúdo on-line @@ -2143,6 +2148,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Selecion STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Exibir opções de jogo STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Exibe as pontuações +STR_INTRO_TOOLTIP_HELP :{BLACK}Obter acesso à documentação e recursos online STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Config. de exibição STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Exibir configs. dos NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Checar por conteúdo novo e atualizado para baixar @@ -2164,6 +2170,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandona STR_ABANDON_GAME_QUERY :{YELLOW}Você tem certeza que quer abandonar este jogo? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Você tem certeza que quer abandonar este cenário? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Ajuda & Manuais +STR_HELP_WINDOW_WEBSITES :{BLACK}Sites na Web +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documentos +STR_HELP_WINDOW_README :{BLACK}Leia-me +STR_HELP_WINDOW_CHANGELOG :{BLACK}Log de mudanças +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Erros conhecidos +STR_HELP_WINDOW_LICENSE :{BLACK}Licença +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manual / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Relatar um erro +STR_HELP_WINDOW_COMMUNITY :{BLACK}Comunidade + # Cheat window STR_CHEATS :{WHITE}Trapaças STR_CHEATS_TOOLTIP :{BLACK}As caixas de verificação indicam se você usou esta trapaça antes @@ -4697,16 +4716,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Tabela de Conteúdo +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Acesso rápido a uma seção do arquivo mostrado nesta lista +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Retornar no histórico de navegação +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Retornar adiante no histórico de navegação STR_TEXTFILE_WRAP_TEXT :{WHITE}Quebra de linha STR_TEXTFILE_WRAP_TEXT_TOOLTIP :[BLACK}Quebra linhas automaticamente para que o texto caiba na janela STR_TEXTFILE_VIEW_README :{BLACK}Ver o leia-me STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Log de mudanças STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licença -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} Leia-me de {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} log de mudanças de {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licença de {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Visualização do resultado da pesquisa +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD documento '{STRING}' # Vehicle loading indicators diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index fd075afa52..3f2ac7744d 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -475,7 +475,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :История STR_NEWS_MENU_DELETE_ALL_MESSAGES :Изтрий всички съобщения # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Информация за терена STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Показване/скриване на конзола @@ -1290,6 +1290,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Никакви STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Намалени STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Нормални + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Преминаване през спирки на градски пътища: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Позволява строежа на ЖП линии пресичащи път притежаван от даден град STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Преминаване през спирки на пътища, собственост на конкуренти: {STRING} @@ -1903,6 +1904,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Прек STR_ABANDON_GAME_QUERY :{YELLOW}Искате ли да прекъснете играта? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Искате ли да прекъснете сценария? +# Help window + # Cheat window STR_CHEATS :{WHITE}Кодове STR_CHEATS_TOOLTIP :{BLACK}Кутийките показват дали този код е бил използван @@ -4113,7 +4116,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Реор STR_TEXTFILE_VIEW_README :{BLACK}Отвори readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Дневник на промените STR_TEXTFILE_VIEW_LICENCE :{BLACK}Лиценз -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme of {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} Дневник на промените на {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} лиценз на {STRING} diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 733dbd40df..19ea63aa6f 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -522,7 +522,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historial de mi STR_NEWS_MENU_DELETE_ALL_MESSAGES :Esborra tots els missatges # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informació de la casella STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Commuta la consola @@ -1427,6 +1427,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Cap* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduït STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permet situar parades en carreteres que són propietat de les poblacions: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permet la construcció de passos a nivell als carrers propietat de les poblacions STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permet circular a través de les parades en carreteres propietat de competidors: {STRING} @@ -2164,6 +2165,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandona STR_ABANDON_GAME_QUERY :{YELLOW}Esteu segur que voleu abandonar la partida? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Esteu segur que voleu sortir de l'escenari? +# Help window + # Cheat window STR_CHEATS :{WHITE}Trampes STR_CHEATS_TOOLTIP :{BLACK}Les caselles de selecció indiquen si heu fet servir aquesta trampa. @@ -4702,7 +4705,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Ajusta e STR_TEXTFILE_VIEW_README :{BLACK}Veure llegeix-me STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Registre de canvis STR_TEXTFILE_VIEW_LICENCE :{BLACK}Llicència -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Llegeix-me del {STRING} de {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Registre de canvis del {STRING} de {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Llicència del {STRING} de {STRING} diff --git a/src/lang/chuvash.txt b/src/lang/chuvash.txt index a6ab0e1511..329662ba1c 100644 --- a/src/lang/chuvash.txt +++ b/src/lang/chuvash.txt @@ -281,7 +281,7 @@ STR_TOOLBAR_SOUND_MUSIC :Сасӑ/Юрӑ ###length 3 # About menu -###length 10 +###length 11 STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_SCREENSHOT :Экран сӑнӗ STR_ABOUT_MENU_ABOUT_OPENTTD :'OpenTTD' çинчен @@ -648,6 +648,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :ҫук + STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Аэропорт кивел мар: {STRING} @@ -881,6 +882,8 @@ STR_QUIT_NO :{BLACK}Ҫук # Abandon game STR_ABANDON_GAME_CAPTION :{WHITE}Вӑййи ан килӗш +# Help window + # Cheat window STR_CHEAT_CHANGE_DATE :{LTBLUE}Тӳрлет кун: {ORANGE}{DATE_SHORT} @@ -1606,7 +1609,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window -###length 4 +###length 5 # Vehicle loading indicators diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 79b31977ab..32c881136a 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -581,7 +581,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Povijest poruka STR_NEWS_MENU_DELETE_ALL_MESSAGES :Obriši sve poruke # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Podaci o zemljištu STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Otvori konzolu @@ -1413,6 +1413,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ništa* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Smanjeno STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normalno + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Dopusti prolazne postaje na cestama u vlasništvu gradova: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Dopusti izgradnju prolaznih postaja na cestama u vlasništvu grada STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Dopusti prolazne postaje na cestama koje su u vlasništvu konkurencije: {STRING} @@ -2094,6 +2095,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Napusti STR_ABANDON_GAME_QUERY :{YELLOW}Doista želiš napustiti ovu igru? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Doista želiš napustiti ovaj scenarij? +# Help window + # Cheat window STR_CHEATS :{WHITE}Varanje STR_CHEATS_TOOLTIP :{BLACK}Kvačice ukazuju na to jesi li koristio ovo varanje prije @@ -4470,7 +4473,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Posloži STR_TEXTFILE_VIEW_README :{BLACK}Pogledaj "pročitaj me" datoteku STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Zapis izmjena STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenca -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} "pročitaj me" datoteka od {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} zapis izmjena od {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licenca od {STRING} diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 81e9f02e7d..4531d06e13 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -578,7 +578,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historie zpráv STR_NEWS_MENU_DELETE_ALL_MESSAGES :Smazat všechny zprávy # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informace o zemi STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Zobrazit nebo skrýt konzoli @@ -1477,6 +1477,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Žádná* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Redukovaný STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Obvyklý + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Stavba průjezdných zastávek na obecních silnicích: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Povoluje stavbu průjezdných stanic na městem vlastněných silnicích STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Stavba průjezdných zastávek na silnicích vlastněných konkurencí: {STRING} @@ -2204,6 +2205,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Konec hr STR_ABANDON_GAME_QUERY :{YELLOW}Opravdu chceš ukončit tuto hru? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Určite chceš opustit toto mapu? +# Help window + # Cheat window STR_CHEATS :{WHITE}Cheaty STR_CHEATS_TOOLTIP :{BLACK}Zaškrtávací políčka ukazují, jestli jsi tento cheat už použil @@ -4737,7 +4740,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Zalomit STR_TEXTFILE_VIEW_README :{BLACK}Zobrazit readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Novinky ve verzi STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licence -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} změny ve verzi {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licence {STRING} diff --git a/src/lang/danish.txt b/src/lang/danish.txt index f2c1c66c5a..82bb7aaa9a 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -521,7 +521,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Tidligere beske STR_NEWS_MENU_DELETE_ALL_MESSAGES :Slet alle beskeder # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Landområde information STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Tænd/Sluk konsol @@ -1426,6 +1426,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ingen* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :reduceret STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Tillad vejkryds - jernbaneoverskæringer med veje eller skinner ejet af konkurrenter: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Tillad konstruktion af overkørsler på veje eller skinner ejet af konkurrenter + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Tillad gennemkørsels-stop på veje ejet af en by: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Tillad konstruktion af gennemkørsels-stop på by-ejede veje STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Tillad gennemkørsels-stoppesteder på veje ejet af konkurrenter: {STRING} @@ -2163,6 +2166,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Forlad s STR_ABANDON_GAME_QUERY :{YELLOW}Er du sikker på du vil forlade dette spil ? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Er du sikker på, at du vil afslutte dette scenarie ? +# Help window + # Cheat window STR_CHEATS :{WHITE}Snydefunktioner STR_CHEATS_TOOLTIP :{BLACK}Checkbokse viser, om du har brugt denne snydefunktion før @@ -4701,7 +4706,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Ombryd t STR_TEXTFILE_VIEW_README :{BLACK}Se readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Ændringslog STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licens -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme for {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} ændringslog for {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licens for {STRING} diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index e23d49287b..1b431a37de 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -521,8 +521,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Berichtengeschi STR_NEWS_MENU_DELETE_ALL_MESSAGES :Alle berichten verwijderen # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Landinformatie +STR_ABOUT_MENU_HELP :Help en handleidingen STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Console in-uitschakelen STR_ABOUT_MENU_AI_DEBUG :Probleemoplossing AI/spelscript @@ -1426,6 +1427,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Geen* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Verminderd STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normaal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Gelijkvloerse kruisingen met wegen of spoorwegen van tegenstanders toestaan: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Bouwen van gelijkvloerse kruisingen met wegen of spoorwegen van tegenstanders toestaan + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Doorrijhaltes op stedelijke wegen toestaan: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Bouwen van doorrijhaltes op stedelijke wegen toestaan STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Haltes op wegen van tegenstanders toestaan: {STRING} @@ -2121,6 +2125,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Netwerks STR_INTRO_GAME_OPTIONS :{BLACK}Spelopties STR_INTRO_HIGHSCORE :{BLACK}Scoretabel +STR_INTRO_HELP :{BLACK}Help en handleiding STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Instellingen STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF-instellingen STR_INTRO_ONLINE_CONTENT :{BLACK}Online inhoud zoeken @@ -2142,6 +2147,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Speelgoe STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Spelopties weergeven STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Scoretabel weergeven +STR_INTRO_TOOLTIP_HELP :{BLACK}Toegang tot documentatie en online-hulpbronnen STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Scherminstellingen STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF-instellingen weergeven STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Zoeken naar nieuwe en aangepaste inhoud om te downloaden @@ -2163,6 +2169,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Spel slu STR_ABANDON_GAME_QUERY :{YELLOW}Weet je zeker dat je dit spel wilt sluiten? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Weet je zeker dat je dit scenario wilt sluiten? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Help en handleidingen +STR_HELP_WINDOW_WEBSITES :{BLACK}Websites +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documenten +STR_HELP_WINDOW_README :{BLACK}Leesmij +STR_HELP_WINDOW_CHANGELOG :{BLACK}Overzicht van wijzigingen +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Bekende fouten +STR_HELP_WINDOW_LICENSE :{BLACK}Licentie +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Handleiding/wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Een fout rapporteren +STR_HELP_WINDOW_COMMUNITY :{BLACK}Gemeenschap + # Cheat window STR_CHEATS :{WHITE}Valsspelen STR_CHEATS_TOOLTIP :{BLACK}Keuzevakjes geven aan of je deze manier van valsspelen eerder hebt gebruikt @@ -4696,16 +4715,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Inhoud +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Met deze lijst kun je snel naar een gedeelte in het weergegeven bestand springen +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Terug in de bladergeschiedenis +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Vooruit in de bladergeschiedenis STR_TEXTFILE_WRAP_TEXT :{WHITE}Tekst afbreken STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Tekst aanpassen aan venster zodat je niet hoeft te bladeren STR_TEXTFILE_VIEW_README :{BLACK}Leesmij-bestand bekijken STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Wijzigingen STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licentie -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} leesmij van {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} wijzigingen van {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licentie van {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Voorbeeld van resultaten van onderzoek +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD-document '{STRING}' # Vehicle loading indicators diff --git a/src/lang/english.txt b/src/lang/english.txt index caec9c7aa6..a646f503ee 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -521,8 +521,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Message history STR_NEWS_MENU_DELETE_ALL_MESSAGES :Delete all messages # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Land area information +STR_ABOUT_MENU_HELP :Help & manuals STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Toggle console STR_ABOUT_MENU_AI_DEBUG :AI/Game script debug @@ -1426,6 +1427,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :None* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduced STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Allow level crossings with roads or rails owned by competitors: {STRING2} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Allow construction of level crossings on roads or rails owned by competitors + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Allow drive-through road stops on roads owned by towns: {STRING2} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Allow construction of drive-through road stops on roads owned by towns STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Allow drive-through road stops on roads owned by competitors: {STRING2} @@ -2121,6 +2125,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multipla STR_INTRO_GAME_OPTIONS :{BLACK}Game Options STR_INTRO_HIGHSCORE :{BLACK}Highscore Table +STR_INTRO_HELP :{BLACK}Help & Manuals STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Settings STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content @@ -2142,6 +2147,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Select ' STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Display game options STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Display highscore table +STR_INTRO_TOOLTIP_HELP :{BLACK}Get access to documentation and online resources STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Display settings STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download @@ -2163,6 +2169,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandon STR_ABANDON_GAME_QUERY :{YELLOW}Are you sure you want to abandon this game? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Are you sure you want to abandon this scenario? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Help & Manuals +STR_HELP_WINDOW_WEBSITES :{BLACK}Websites +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documents +STR_HELP_WINDOW_README :{BLACK}Readme +STR_HELP_WINDOW_CHANGELOG :{BLACK}Changelog +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Known Bugs +STR_HELP_WINDOW_LICENSE :{BLACK}License +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manual / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Report a Bug +STR_HELP_WINDOW_COMMUNITY :{BLACK}Community + # Cheat window STR_CHEATS :{WHITE}Cheats STR_CHEATS_TOOLTIP :{BLACK}Checkboxes indicate if you have used this cheat before @@ -4696,16 +4715,22 @@ STR_AI_SETTINGS_SETTING :{RAW_STRING}: { # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Table of Contents +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Quickly jump to a section in the displayed file via this list +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{RAW_STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Go back in navigation history +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Return forward in navigation history STR_TEXTFILE_WRAP_TEXT :{WHITE}Wrap text STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Wrap the text of the window so it all fits without having to scroll STR_TEXTFILE_VIEW_README :{BLACK}View readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Changelog STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licence -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme of {RAW_STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} changelog of {RAW_STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licence of {RAW_STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Preview of survey result +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD document '{RAW_STRING}' # Vehicle loading indicators diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 0b8328cef6..c51d9ff405 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -521,8 +521,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Message history STR_NEWS_MENU_DELETE_ALL_MESSAGES :Delete all messages # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Land area information +STR_ABOUT_MENU_HELP :Help & manuals STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Toggle console STR_ABOUT_MENU_AI_DEBUG :AI/Game script debug @@ -1426,6 +1427,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :None STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduced STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Allow level crossings with roads or rails owned by competitors: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Allow construction of level crossings on roads or rails owned by competitors + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Allow drive-through road stops on roads owned by towns: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Allow construction of drive-through road stops on roads owned by towns STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Allow drive-through road stops on roads owned by competitors: {STRING} @@ -2121,6 +2125,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multipla STR_INTRO_GAME_OPTIONS :{BLACK}Game Options STR_INTRO_HIGHSCORE :{BLACK}Highscore Table +STR_INTRO_HELP :{BLACK}Help & Manuals STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Settings STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content @@ -2142,6 +2147,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Select ' STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Display game options STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Display highscore table +STR_INTRO_TOOLTIP_HELP :{BLACK}Get access to documentation and online resources STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Display settings STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download @@ -2163,6 +2169,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandon STR_ABANDON_GAME_QUERY :{YELLOW}Are you sure you want to abandon this game? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Are you sure you want to abandon this scenario? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Help & Manuals +STR_HELP_WINDOW_WEBSITES :{BLACK}Websites +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documents +STR_HELP_WINDOW_README :{BLACK}Readme +STR_HELP_WINDOW_CHANGELOG :{BLACK}Changelog +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Known Bugs +STR_HELP_WINDOW_LICENSE :{BLACK}License +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manual / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Report a Bug +STR_HELP_WINDOW_COMMUNITY :{BLACK}Community + # Cheat window STR_CHEATS :{WHITE}Cheats STR_CHEATS_TOOLTIP :{BLACK}Checkboxes indicate if you have used this cheat before @@ -4696,16 +4715,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Table of Contents +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Quickly jump to a section in the displayed file via this list +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Go back in navigation history +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Return forward in navigation history STR_TEXTFILE_WRAP_TEXT :{WHITE}Wrap text STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Wrap the text of the window so it all fits without having to scroll STR_TEXTFILE_VIEW_README :{BLACK}View readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Changelog STR_TEXTFILE_VIEW_LICENCE :{BLACK}License -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme of {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} changelog of {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} license of {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Preview of survey result +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD document '{STRING}' # Vehicle loading indicators diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index ca1a68438f..fc67ddba7d 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -521,8 +521,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Message history STR_NEWS_MENU_DELETE_ALL_MESSAGES :Delete all messages # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Land area information +STR_ABOUT_MENU_HELP :Help & manuals STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Toggle console STR_ABOUT_MENU_AI_DEBUG :AI/Game script debug @@ -1426,6 +1427,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :None* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduced STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Allow grade crossings with roads or rails owned by competitors: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Allow construction of grade crossings on roads or rails owned by competitors + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Allow drive-through road stops on roads owned by towns: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Allow construction of drive-through road stops on roads owned by towns STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Allow drive-through road stops on roads owned by competitors: {STRING} @@ -2121,6 +2125,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multipla STR_INTRO_GAME_OPTIONS :{BLACK}Game Options STR_INTRO_HIGHSCORE :{BLACK}Highscore Table +STR_INTRO_HELP :{BLACK}Help & Manuals STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Settings STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content @@ -2142,6 +2147,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Select ' STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Display game options STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Display highscore table +STR_INTRO_TOOLTIP_HELP :{BLACK}Get access to documentation and online resources STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Display settings STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download @@ -2163,6 +2169,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandon STR_ABANDON_GAME_QUERY :{YELLOW}Are you sure you want to abandon this game? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Are you sure you want to abandon this scenario? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Help & Manuals +STR_HELP_WINDOW_WEBSITES :{BLACK}Websites +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documents +STR_HELP_WINDOW_README :{BLACK}Readme +STR_HELP_WINDOW_CHANGELOG :{BLACK}Changelog +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Known Bugs +STR_HELP_WINDOW_LICENSE :{BLACK}License +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manual / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Report a Bug +STR_HELP_WINDOW_COMMUNITY :{BLACK}Community + # Cheat window STR_CHEATS :{WHITE}Cheats STR_CHEATS_TOOLTIP :{BLACK}Checkboxes indicate if you have used this cheat before @@ -2650,6 +2669,7 @@ STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Toggle t STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Toggle transparency for bridges. Ctrl+Click to lock STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Toggle transparency for structures like lighthouses and antennas. Ctrl+Click to lock STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Toggle transparency for catenary. Ctrl+Click to lock +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Toggle transparency for loading and cost/income text. Ctrl+Click to lock STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Set objects invisible instead of transparent # Linkgraph legend window @@ -4695,16 +4715,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Table of Contents +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Quickly jump to a section in the displayed file via this list +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Go back in navigation history +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Return forward in navigation history STR_TEXTFILE_WRAP_TEXT :{WHITE}Wrap text STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Wrap the text of the window so it all fits without having to scroll STR_TEXTFILE_VIEW_README :{BLACK}View readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Changelog STR_TEXTFILE_VIEW_LICENCE :{BLACK}License -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme of {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} changelog of {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} license of {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Preview of survey result +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD document '{STRING}' # Vehicle loading indicators @@ -4963,7 +4989,7 @@ STR_ERROR_NO_SUITABLE_RAILROAD_TRACK :{WHITE}No suita STR_ERROR_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Must remove railroad track first STR_ERROR_CROSSING_ON_ONEWAY_ROAD :{WHITE}Road is one way or blocked STR_ERROR_CROSSING_DISALLOWED_RAIL :{WHITE}Grade crossings not allowed for this rail type -STR_ERROR_CROSSING_DISALLOWED_ROAD :{WHITE}Level crossings not allowed for this road type +STR_ERROR_CROSSING_DISALLOWED_ROAD :{WHITE}Grade crossings not allowed for this road type STR_ERROR_CAN_T_BUILD_SIGNALS_HERE :{WHITE}Can't build signals here... STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK :{WHITE}Can't build railroad track here... STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK :{WHITE}Can't remove railroad track from here... diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 29d6dc06b9..aa1022099d 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -584,7 +584,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Mesaĝa Histori STR_NEWS_MENU_DELETE_ALL_MESSAGES :Forigu ĉiujn mesaĝojn # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Landkvadrataj informoj STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Baskuligi Konzolon @@ -1470,6 +1470,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :neniu STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :reduktita STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normala + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permesu trairajn bushaltejojn sur urboposedataj stratoj: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permesu konstrui trairajn strathaltejojn sur stratoj posedataj de urboj STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permesu trairajn strathaltejojn sur stratoj posedataj de konkurantoj: {STRING} @@ -2168,6 +2169,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Foriri d STR_ABANDON_GAME_QUERY :{YELLOW}Ĉu vi certas ke vi volas foriri? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Ĉu vi certas ke vi volas forlasi ĉi tiun scenaron? +# Help window + # Cheat window STR_CHEATS :{WHITE}Filudaĵoj STR_CHEATS_TOOLTIP :{BLACK}La kvadratetoj indikas ĉu vi jam uzis la filudaĵon antaŭe. @@ -4626,7 +4629,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Faldu te STR_TEXTFILE_VIEW_README :{BLACK}Vidi legumin STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Ŝanĝarĥivo STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenco -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} legumin de {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING}-a ŝanĝarĥivo de {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING}-a licenco de {STRING} diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index bd31b8ea35..aa34843ced 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -560,7 +560,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Teadete ajalugu STR_NEWS_MENU_DELETE_ALL_MESSAGES :Kustuta kõik teated # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Maa-ala andmed STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Lülita konsool sisse/välja @@ -1436,6 +1436,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ei STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Vähem STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Keskmiselt + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Läbisõidupeatused asulate kuuluvatel teedel: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Lubab asulatele kuuluvatele teedele ehitada läbisõidupeatuseid STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Läbisõidupeatused konkurentide teedel: {STRING} @@ -2161,6 +2162,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Mängu l STR_ABANDON_GAME_QUERY :{YELLOW}Kas lõpetada mäng? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Kas sa oled kindel, et sa tahad stsenaariumi tegemise lõpetada? +# Help window + # Cheat window STR_CHEATS :{WHITE}Petmine STR_CHEATS_TOOLTIP :{BLACK}Märgistatud kastid näitavad et, kas sa oled varem seda pettust kasutanud @@ -4679,7 +4682,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Murrab t STR_TEXTFILE_VIEW_README :{BLACK}Vaata abi STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Muudatuste logi STR_TEXTFILE_VIEW_LICENCE :{BLACK}Litsents -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING} abi. STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} muudatuste logi {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} litsents {STRING} diff --git a/src/lang/extra/czech.txt b/src/lang/extra/czech.txt index 103f25b2c1..a30c92cc9c 100644 --- a/src/lang/extra/czech.txt +++ b/src/lang/extra/czech.txt @@ -33,10 +33,6 @@ STR_ORDER_STOP_LOCATION_THROUGH :[postupná nakl STR_CONFIG_SETTING_TOWN_GROWTH_EXTREME_SLOW :extrémně pomalá STR_CONFIG_SETTING_TOWN_GROWTH_VERY_SLOW :velmi pomalá -STR_ABOUT_MENU_SHOW_PICKER_TOOL :Nástroj výběru - -STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Okno modifikačních kláves - STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_MINUTES_CUSTOM :Každých {COMMA} minut skutečného času STR_UNIT_NAME_VELOCITY_IMPERIAL :mph @@ -2091,3 +2087,6 @@ STR_CONFIG_SETTING_STATION_RATING_TOOLTIP_MODE_DETAILED :podrobná STR_VIEWPORT_TOWN_COLOUR :{1:COLOUR}{0:TOWN} STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {COLOUR}({COMMA}) + +STR_ABOUT_MENU_SHOW_PICKER_TOOL :Nástroj výběru +STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Okno modifikačních kláves diff --git a/src/lang/extra/english.txt b/src/lang/extra/english.txt index 4833229395..e902b8c22a 100644 --- a/src/lang/extra/english.txt +++ b/src/lang/extra/english.txt @@ -68,12 +68,6 @@ STR_ORDER_STOP_LOCATION_THROUGH :[through load] STR_CONFIG_SETTING_TOWN_GROWTH_EXTREME_SLOW :Extremely slow STR_CONFIG_SETTING_TOWN_GROWTH_VERY_SLOW :Very slow -##after STR_ABOUT_MENU_LAND_BLOCK_INFO -STR_ABOUT_MENU_SHOW_PICKER_TOOL :Picker tool - -##after STR_ABOUT_MENU_SHOW_FRAMERATE -STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Modifier key window - ##before STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_MINUTES_CUSTOM :Every {COMMA}{NBSP}minute{P 0 "" s} @@ -2189,3 +2183,6 @@ STR_VIEWPORT_TOWN_COLOUR :{1:COLOUR}{0:TO STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {COLOUR}({COMMA}) STR_VIEWPORT_TOWN_COLOUR_CITY :{1:COLOUR}{0:TOWN} (City) STR_VIEWPORT_TOWN_COLOUR_CITY_POP :{WHITE}{TOWN} {COLOUR}(City, {COMMA}) + +STR_ABOUT_MENU_SHOW_PICKER_TOOL :Picker tool +STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Modifier key window diff --git a/src/lang/extra/galician.txt b/src/lang/extra/galician.txt index ecf7f4399c..494358d031 100644 --- a/src/lang/extra/galician.txt +++ b/src/lang/extra/galician.txt @@ -33,10 +33,6 @@ STR_ORDER_STOP_LOCATION_THROUGH :[a través da c STR_CONFIG_SETTING_TOWN_GROWTH_EXTREME_SLOW :Extremadamente lento STR_CONFIG_SETTING_TOWN_GROWTH_VERY_SLOW :Moi lento -STR_ABOUT_MENU_SHOW_PICKER_TOOL :Ferramenta de selección - -STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Fiestra da tecla modificadora - STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_MINUTES_CUSTOM :Cada {COMMA} minutos reais STR_COMMA_SEPARATOR :,{SP} @@ -2140,3 +2136,6 @@ STR_VIEWPORT_TOWN_COLOUR :{1:COLOUR}{0:TO STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {COLOUR}({COMMA}) STR_VIEWPORT_TOWN_COLOUR_CITY :{1:COLOUR}{0:TOWN} (Cidade) STR_VIEWPORT_TOWN_COLOUR_CITY_POP :{WHITE}{TOWN} {COLOUR}(Cidade, {COMMA}) + +STR_ABOUT_MENU_SHOW_PICKER_TOOL :Ferramenta de selección +STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Fiestra da tecla modificadora diff --git a/src/lang/extra/german.txt b/src/lang/extra/german.txt index 67516defd1..63851010e6 100644 --- a/src/lang/extra/german.txt +++ b/src/lang/extra/german.txt @@ -31,8 +31,6 @@ STR_ORDER_STOP_LOCATION_THROUGH :[durchgehendes STR_CONFIG_SETTING_TOWN_GROWTH_EXTREME_SLOW :Extrem langsam STR_CONFIG_SETTING_TOWN_GROWTH_VERY_SLOW :Sehr langsam -STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Hilfstasten-Fenster - STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_MINUTES_CUSTOM :Alle {COMMA} Echtzeitminuten STR_UNIT_NAME_VELOCITY_IMPERIAL :mph @@ -1776,3 +1774,5 @@ STR_CONFIG_SETTING_STATION_RATING_TOOLTIP_MODE_DETAILED :Detailliert STR_VIEWPORT_TOWN_COLOUR :{1:COLOUR}{0:TOWN} STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {COLOUR}({COMMA}) + +STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :Hilfstasten-Fenster diff --git a/src/lang/extra/korean.txt b/src/lang/extra/korean.txt index f51659f519..7c11228a89 100644 --- a/src/lang/extra/korean.txt +++ b/src/lang/extra/korean.txt @@ -33,10 +33,6 @@ STR_ORDER_STOP_LOCATION_THROUGH :[차례로 나 STR_CONFIG_SETTING_TOWN_GROWTH_EXTREME_SLOW :매우 느림 STR_CONFIG_SETTING_TOWN_GROWTH_VERY_SLOW :더 느림 -STR_ABOUT_MENU_SHOW_PICKER_TOOL :선택 도구 - -STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :보조 키 창 - STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_MINUTES_CUSTOM :현실에서 매 {COMMA}분마다 STR_COMMA_SEPARATOR :,{SP} @@ -2136,3 +2132,6 @@ STR_VIEWPORT_TOWN_COLOUR :{1:COLOUR}{0:TO STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {COLOUR}({COMMA}) STR_VIEWPORT_TOWN_COLOUR_CITY :{1:COLOUR}{0:TOWN} (대도시) STR_VIEWPORT_TOWN_COLOUR_CITY_POP :{WHITE}{TOWN} {COLOUR}(대도시, {COMMA}) + +STR_ABOUT_MENU_SHOW_PICKER_TOOL :선택 도구 +STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :보조 키 창 diff --git a/src/lang/extra/simplified_chinese.txt b/src/lang/extra/simplified_chinese.txt index 0e35f1ea19..7b998d862e 100644 --- a/src/lang/extra/simplified_chinese.txt +++ b/src/lang/extra/simplified_chinese.txt @@ -33,10 +33,6 @@ STR_ORDER_STOP_LOCATION_THROUGH :[通过式装 STR_CONFIG_SETTING_TOWN_GROWTH_EXTREME_SLOW :极慢 STR_CONFIG_SETTING_TOWN_GROWTH_VERY_SLOW :很慢 -STR_ABOUT_MENU_SHOW_PICKER_TOOL :选择器 - -STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :修饰键 - STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_MINUTES_CUSTOM :每{COMMA}现实分钟 STR_COMMA_SEPARATOR :,{SP} @@ -2133,3 +2129,6 @@ STR_VIEWPORT_TOWN_COLOUR :{1:COLOUR}{0:TO STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {COLOUR} ({COMMA}) STR_VIEWPORT_TOWN_COLOUR_CITY :{1:COLOUR}{0:TOWN} (都市) STR_VIEWPORT_TOWN_COLOUR_CITY_POP :{WHITE}{TOWN} {COLOUR}(都市,{COMMA}) + +STR_ABOUT_MENU_SHOW_PICKER_TOOL :选择器 +STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS :修饰键 diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index 996ae6b458..2bf38a6f3a 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -452,7 +452,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Seinastu boð/t STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Boð søga # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Landa økis kunning STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Console opið ella lukka @@ -1246,6 +1246,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Einki STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Færri STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Vanligt + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Loyv gjøgnumkoyrings steðgum á vegum ið bygdir eiga: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Loyv bygging av gjøgnumkoyrings steðgum á vegum ið bygdir eiga STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Loyv gjøgnumkoyrings steðgum á vegum ið kappingarneytar eiga: {STRING} @@ -1773,6 +1774,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Far frá STR_ABANDON_GAME_QUERY :{YELLOW}Er tú vís/vísur í at tú vil fara frá hesum spæli? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Er tú vís/vísur í at tú vil fara frá hesum tilburði? +# Help window + # Cheat window STR_CHEATS :{WHITE}Snýt STR_CHEATS_TOOLTIP :{BLACK}Flugubeins kassanir vísa um tú hevur nýtt hetta snýti áður @@ -3689,7 +3692,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN STR_TEXTFILE_VIEW_README :{BLACK}Sjá readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Broytingarskrá STR_TEXTFILE_VIEW_LICENCE :{BLACK}Loyvi -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme fyri {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} broytingarskrá fyri {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} loyvi fyri {STRING} diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 28550f6220..aad0be1065 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -521,8 +521,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Viestihistoria STR_NEWS_MENU_DELETE_ALL_MESSAGES :Poista kaikki viestit # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Maa-alueen tiedot +STR_ABOUT_MENU_HELP :Ohjeet ja oppaat STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Konsoli STR_ABOUT_MENU_AI_DEBUG :Tekoälyn/peliskriptin virheenjäljitys @@ -1426,6 +1427,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ei yhtään¹ STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Vähennetty STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Tavallinen +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Salli kilpailijoiden teiden tai raiteiden kanssa risteävät tasoristeykset: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Sallii tasoristeysten rakentamisen kilpailijoiden omistamille teille ja raiteille + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Salli läpiajettavat pysäkit kuntien omistamilla teillä: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Sallii läpiajettavien pysäkkien rakentamisen kuntien omistamille teille STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Salli läpiajettavat pysäkit kilpailijoiden omistamilla teillä: {STRING} @@ -2121,6 +2125,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Moninpel STR_INTRO_GAME_OPTIONS :{BLACK}Pelin valinnat STR_INTRO_HIGHSCORE :{BLACK}Pistetaulukko +STR_INTRO_HELP :{BLACK}Ohjeet ja oppaat STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Asetukset STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF-asetukset STR_INTRO_ONLINE_CONTENT :{BLACK}Tarkista online-sisältö @@ -2142,6 +2147,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Valitse STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Näytä pelin valinnat STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Näytä pistetaulukko +STR_INTRO_TOOLTIP_HELP :{BLACK}Tutustu dokumentaatioon ja online-resursseihin STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Näytä asetukset STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Näytä NewGRF-asetukset STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Tarkista uutta ja päivitettyä sisältöä ladattavaksi @@ -2163,6 +2169,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Pelin lo STR_ABANDON_GAME_QUERY :{YELLOW}Lopetetaanko peli? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Haluatko varmasti hylätä tämän skenaarion? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Ohjeet ja oppaat +STR_HELP_WINDOW_WEBSITES :{BLACK}Verkkosivustot +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Asiakirjat +STR_HELP_WINDOW_README :{BLACK}Lueminut-tiedosto +STR_HELP_WINDOW_CHANGELOG :{BLACK}Muutosloki +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Tiedossa olevat virheet +STR_HELP_WINDOW_LICENSE :{BLACK}Lisenssi +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Käyttöopas/wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Ilmoita virheestä +STR_HELP_WINDOW_COMMUNITY :{BLACK}Yhteisö + # Cheat window STR_CHEATS :{WHITE}Huijaukset STR_CHEATS_TOOLTIP :{BLACK}Valintaruudut osoittavat, oletko käyttänyt huijausta aiemmin @@ -4696,16 +4715,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Sisällysluettelo +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Tämän luettelon avulla voit nopeasti siirtyä näytettävän tiedoston johonkin osioon +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Siirry taaksepäin selaushistoriassa +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Siirry eteenpäin selaushistoriassa STR_TEXTFILE_WRAP_TEXT :{WHITE}Tekstin rivitys STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Rivitä teksti ikkunaan niin, että se näkyy kokonaan rullaamatta STR_TEXTFILE_VIEW_README :{BLACK}Näytä readme-tiedosto STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Muutosloki STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisenssi -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING}:n {STRING} readme-tiedosto STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING}:n {STRING} muutosloki STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING}:n {STRING} lisenssi STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Tutkimustuloksen esikatselu +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD-asiakirja ”{STRING}” # Vehicle loading indicators diff --git a/src/lang/french.txt b/src/lang/french.txt index bf905ef2f1..2f8a48c07e 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -522,8 +522,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historique des STR_NEWS_MENU_DELETE_ALL_MESSAGES :Effacer tous les messages # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Outil d'inspection du paysage +STR_ABOUT_MENU_HELP :Aide et manuels STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Afficher/Cacher la console STR_ABOUT_MENU_AI_DEBUG :Débogage de scripts @@ -1427,6 +1428,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Aucun* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Réduit STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Autoriser les passages à niveau sur les routes ou rails possédés par les concurrents{NBSP}: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Autoriser la construction de passages à niveau sur les routes ou rails possédés par les concurrents + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Autoriser les arrêts de bus sur les routes appartenant aux municipalités{NBSP}: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Autoriser la construction des arrêts de bus sur les routes appartenant aux municipalités STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Autoriser les arrêts de bus sur les routes des concurrents{NBSP}: {STRING} @@ -2122,6 +2126,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Jouer en STR_INTRO_GAME_OPTIONS :{BLACK}Options globales STR_INTRO_HIGHSCORE :{BLACK}Meilleurs scores +STR_INTRO_HELP :{BLACK}Aide et manuels STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Paramètres de jeu STR_INTRO_NEWGRF_SETTINGS :{BLACK}Paramètres NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Contenu additionnel en ligne @@ -2143,6 +2148,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Sélecti STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Afficher les options du jeu STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Afficher le tableau des meilleurs scores +STR_INTRO_TOOLTIP_HELP :{BLACK}Accéder à la documentation et aux ressources en ligne STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Afficher les paramètres STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Afficher la configuration des NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Vérifier les contenus nouveaux ou mis à jour téléchargeables @@ -2164,6 +2170,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandonn STR_ABANDON_GAME_QUERY :{YELLOW}Êtes-vous sûr de vouloir abandonner cette partie{NBSP}? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Êtes-vous sûr de vouloir abandonner ce scénario{NBSP}? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Aide et manuels +STR_HELP_WINDOW_WEBSITES :{BLACK}Sites web +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documents +STR_HELP_WINDOW_README :{BLACK}Lisez-moi +STR_HELP_WINDOW_CHANGELOG :{BLACK}Journal des modifications +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Bugs connus +STR_HELP_WINDOW_LICENSE :{BLACK}Licence +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manuel / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Rapporter un bug +STR_HELP_WINDOW_COMMUNITY :{BLACK}Communauté + # Cheat window STR_CHEATS :{WHITE}Triches STR_CHEATS_TOOLTIP :{BLACK}Les cases à cocher montrent si vous avez déjà utilisé cette triche auparavant @@ -4697,16 +4716,22 @@ STR_AI_SETTINGS_SETTING :{STRING}{NBSP}: # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Table des matières +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Sauter rapidement à une section dans le fichier affiché via cette liste +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Reculer dans l'historique de navigation +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Avancer dans l'historique de navigation STR_TEXTFILE_WRAP_TEXT :{WHITE}Retour à la ligne automatique STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Insérer des retours à la ligne dans le texte de la fenêtre afin qu'il s'affiche entièrement sans faire défiler STR_TEXTFILE_VIEW_README :{BLACK}Voir le Lisez-moi STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Journal des modifications STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licence -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Lisez-moi du module {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Journal des modifications pour le module {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Licence du module {STRING} {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Prévisualisation des données d'analyse +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}Document OpenTTD '{STRING}' # Vehicle loading indicators diff --git a/src/lang/frisian.txt b/src/lang/frisian.txt index 26489ea1c9..43fe6879c6 100644 --- a/src/lang/frisian.txt +++ b/src/lang/frisian.txt @@ -475,7 +475,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Lêtste (nijs)b STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Berjochtenskiednis # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Gebietsynformaasje STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Skeakel console oan/ût @@ -1308,6 +1308,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Gjin STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Minder STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Gewoan + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Stean it bouwen fan haltes op troch de stêd behearde diken ta: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Stean it bouwen fan haltes op troch de stêd behearde diken ta STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Stean it bouwen fan haltes op troch in tsjinstanner behearde diken ta {STRING} @@ -1908,6 +1909,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Ferlit S STR_ABANDON_GAME_QUERY :{YELLOW}Wolsto echt dit lânskip slúte? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Wolsto echt dit lânskip slúte? +# Help window + # Cheat window STR_CHEATS :{WHITE}Falsk spielje STR_CHEATS_TOOLTIP :{BLACK}Kontrôle finster om te sjen of dast al falsk spiele hast @@ -3884,7 +3887,7 @@ STR_TEXTFILE_WRAP_TEXT :{WHITE}Omwikkel STR_TEXTFILE_VIEW_README :{BLACK}Besjoch readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Feroarings STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisinsje -###length 4 +###length 5 STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} feroarings fan {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} lisinsje fan {STRING} diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index fe7dd8ddd8..3a6088e5b2 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -662,7 +662,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Am brath/aithri STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Eachdraidh nam brath # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Fiosrachadh raon tìre STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Toglaich a' chonsoil @@ -1491,6 +1491,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Cha tachair seo STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Ainneamh STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Àbhaisteach + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Ceadaich stèiseanan ri taobh an rathaid air rathaidean a bhuineas ri baile: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Ceadaich gun tèid stèiseanan ri taobh an rathaid a thogail air rathaidean a bhuineas ri baile STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Ceadaich stèiseanan ri taobh an rathaid air rathaidean a bhuineas ri co-fharpaisiche: {STRING} @@ -2144,6 +2145,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Fàg an STR_ABANDON_GAME_QUERY :{YELLOW}A bheil thu cinnteach gu bheil thu airson an geama seo fhàgail? STR_ABANDON_SCENARIO_QUERY :{YELLOW}A bheil thu cinnteach gu bheil thu airson an cnàmh-sgeul seo fhàgail? +# Help window + # Cheat window STR_CHEATS :{WHITE}Cealgaireachd STR_CHEATS_TOOLTIP :{BLACK}Is ciall dha bhogsaichean-cromaige gun deach a' chealgaireachd seo a chleachdadh roimhe @@ -4427,7 +4430,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Paisg te STR_TEXTFILE_VIEW_README :{BLACK}Seall “Leugh mi” STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Loga nan atharraichean STR_TEXTFILE_VIEW_LICENCE :{BLACK}Ceadachas -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}“Leugh mi” {STRING} aig {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Loga atharraichean {STRING} aig {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Ceadachas {STRING} aig {STRING} diff --git a/src/lang/galician.txt b/src/lang/galician.txt index bf259dd793..0f1b0b9527 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -505,7 +505,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historial de me STR_NEWS_MENU_DELETE_ALL_MESSAGES :Borrar tódalas mensaxes # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Información de área de terreo STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :(Des)Activar consola @@ -1408,6 +1408,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ningún* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reducido STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permiti-la construción de estacións pasantes nas rúas de titularidade municipal: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permite a construcción de estacións pasantes sobre as rúas propiedade da cidade STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir estacións pasantes sobre estradas propiedade dos competidores: {STRING} @@ -2139,6 +2140,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Saír da STR_ABANDON_GAME_QUERY :{YELLOW}Estás seguro de que queres saír desta partida? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Estás seguro de que queres saír deste escenario? +# Help window + # Cheat window STR_CHEATS :{WHITE}Trampulladas STR_CHEATS_TOOLTIP :{BLACK}As caixas de confirmación indican se usaches esta trampa antes @@ -4670,7 +4673,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Axusta o STR_TEXTFILE_VIEW_README :{BLACK}Ver "readme" STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Rexistro de cambios STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenza -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE} "readme" de {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Rexistro de cambios de {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE} licenza de {STRING}{STRING} diff --git a/src/lang/german.txt b/src/lang/german.txt index 1b17160338..2fd4fccd53 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -522,7 +522,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Vergangene Nach STR_NEWS_MENU_DELETE_ALL_MESSAGES :Alle Nachrichten löschen # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Gebietsinformationen STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Konsole öffnen/schließen @@ -1427,6 +1427,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Keine STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Verringert STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Bus- und Lkw-Haltestellen auf Straßen im Stadteigentum erlauben: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Erlaubt die Errichtung von Bus- und Lkw-Haltestellen auf Straßen im Stadteigentum STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Bus- und Lkw-Haltestellen auf Straßen von Mitbewerbern erlauben: {STRING} @@ -2164,6 +2165,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Spiel be STR_ABANDON_GAME_QUERY :{YELLOW}Das Spiel wirklich beenden? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Soll das Szenario wirklich verlassen werden? +# Help window + # Cheat window STR_CHEATS :{WHITE}Cheats STR_CHEATS_TOOLTIP :{BLACK}Die Kontrollkästchen zeigen an, ob dieser Cheat schonmal verwendet worden ist @@ -4701,7 +4704,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Text des STR_TEXTFILE_VIEW_README :{BLACK}Liesmich anzeigen STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Änderungen STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lizenz -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING}-Liesmich von {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING}-Änderungen von {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING}-Lizenz von {STRING} diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 9d2593360e..4ea24dfd03 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -563,7 +563,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Ιστορικ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Διαγραφή όλων των μηνυμάτων # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Πληροφορίες περιοχής εδάφους STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Εναλλαγή κονσόλας @@ -1484,6 +1484,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Κανένα* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Μειωμένη STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Κανονική + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Επιτρέπονται οι στάσεις σε δρόμους που είναι ιδιοκτησία των πόλεων : {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Επιτρέπεται η κατασκευή στάσεων πάνω σε δρόμους που είναι ιδιοκτησία των πόλεων STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Επιτρέπονται οι στάσεις σε δρόμους που ανήκουν σε ανταγωνιστές: {STRING} @@ -2209,6 +2210,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Εγκα STR_ABANDON_GAME_QUERY :{YELLOW}Είστε σίγουροι ότι θέλετε να εγκαταλείψετε το παιχνίδι; STR_ABANDON_SCENARIO_QUERY :{YELLOW}Είστε σίγουροι ότι θέλετε να εγκαταλείψετε το σενάριο; +# Help window + # Cheat window STR_CHEATS :{WHITE}Απατεωνιές STR_CHEATS_TOOLTIP :{BLACK}Τα κουτάκια δείχνουν αν έχετε ξαναχρησιμοποιήσει αυτή την απατεωνιά @@ -4724,7 +4727,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Αναδ STR_TEXTFILE_VIEW_README :{BLACK}Εμφάνιση readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Ιστορικό αλλαγών STR_TEXTFILE_VIEW_LICENCE :{BLACK}Άδεια -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme του {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{G=m}{WHITE}{STRING} ιστορικό αλλαγών του {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} άδεια του {STRING} diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 1d2559b2c8..d6a1a633c3 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -491,7 +491,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :הודעה אח STR_NEWS_MENU_MESSAGE_HISTORY_MENU :היסטורית הודעות # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :מידע על שטח קרקע STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :פתח/סגור קונסולה @@ -1324,6 +1324,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :ללא STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :מופחת STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :רגיל + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :{STRING} :אפשר מעבר דרך תחנות על כבישים בבעלות עירונית STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :אפשר בנייה של תחנות "על הדרך" בכבישים בבעלות עיירות STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :אפשר נסיעה דרך תמרורי-עצירה על דרכים בבעלות מתחרים: {STRING} @@ -1995,6 +1996,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}עזיב STR_ABANDON_GAME_QUERY :{YELLOW}?האם אתה בטוח שברצונך לעזוב את המשחק STR_ABANDON_SCENARIO_QUERY :{YELLOW}האם אתה בטוח שברצונך לצאת משלב זה? +# Help window + # Cheat window STR_CHEATS :{WHITE}(cheats) טריקים STR_CHEATS_TOOLTIP :{BLACK}תיבות הסימון מציינות האם השתמשת בטריק הנתון בעבר @@ -4329,7 +4332,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}אפשר STR_TEXTFILE_VIEW_README :{BLACK}צפה ב-"קרא אותי" STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}רשימת שינויים STR_TEXTFILE_VIEW_LICENCE :{BLACK}רשיון -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} "קרא אותי" של {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} רשימת שינויים של {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} רשיון של {STRING} diff --git a/src/lang/hindi.txt b/src/lang/hindi.txt index ff6ff00782..6c2169836c 100644 --- a/src/lang/hindi.txt +++ b/src/lang/hindi.txt @@ -170,7 +170,7 @@ STR_RAIL_MENU_ELRAIL_CONSTRUCTION :विद्य ###length 3 # About menu -###length 10 +###length 11 STR_ABOUT_MENU_SEPARATOR : # Place in highscore window @@ -417,6 +417,7 @@ STR_CONFIG_SETTING_BRIBE_HELPTEXT :कंपनि + STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :सक्षम होने पर वाहनों के निर्देशों की आवधिक जाँच की जाती है, और कुछ सुस्पष्ट मामलों का पता चलते ही एक संदेश द्वारा बताया जाता है। ###length 3 STR_CONFIG_SETTING_ORDER_REVIEW_OFF :नहीं @@ -636,6 +637,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}खे STR_ABANDON_GAME_QUERY :{YELLOW}क्या आप वास्तव में खेल छोड़ना चाहते हैं? STR_ABANDON_SCENARIO_QUERY :{YELLOW}क्या आप वास्तव में यह परिदृश्य छोड़ना चाहते हैं? +# Help window + # Cheat window # Livery window @@ -1271,7 +1274,7 @@ STR_AI_DEBUG_NAME_AND_VERSION :{BLACK}{STRING} # Textfile window -###length 4 +###length 5 # Vehicle loading indicators diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 5c682de726..9cc9d42167 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -567,7 +567,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Előző üzenet STR_NEWS_MENU_DELETE_ALL_MESSAGES :Az összes üzenet törlése # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Terület-információ STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Átváltás konzolra @@ -1464,6 +1464,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :nincs* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :csökkentett STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normál + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Áthaladó megállóhelyek engedélyezése települési tulajdonú utakon: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Áthaladó megállóhelyek építésének engedélyezése települési tulajdonú utakon STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Áthaladó megállóhelyek engedélyezése ellenfél tulajdonában lévő utakon: {STRING} @@ -2193,6 +2194,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Kilépé STR_ABANDON_GAME_QUERY :{YELLOW}Biztosan kilépsz ebből a játékból? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Biztosan abba akarod hagyni a pálya szerkesztését? +# Help window + # Cheat window STR_CHEATS :{WHITE}Csalások STR_CHEATS_TOOLTIP :{BLACK}A kijelölőnégyzetek jelzik a csalások eddigi használatát @@ -4718,7 +4721,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Szöveg STR_TEXTFILE_VIEW_README :{BLACK}Readme megtekintése STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Változások listája STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenc -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING} readme-je STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}A(z) {STRING} {STRING} változásainak listája STR_TEXTFILE_LICENCE_CAPTION :{WHITE}A(z) {STRING} {STRING} licence diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 99ccc532a9..30c05c4a88 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -452,7 +452,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Síðustu skila STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Saga skilaboða # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Landssvæðisupplýsingar STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Kveikja á stýriskjá @@ -1245,6 +1245,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Engin STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :fækkuð STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :miðlungs + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Leyfa stoppistöðvar sem keyrt er í gegnum, á vegum í eigu bæja: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Leyfa byggingu stoppistöðvar sem keyrt er í gegnum, á vegum í eigu bæja STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Leyfa stoppistöðvar sem keyrt er í gegnum, á vegum í eigu samkeppnisaðila: {STRING} @@ -1811,6 +1812,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Hætta l STR_ABANDON_GAME_QUERY :{YELLOW}Ertu viss um að þú viljir hætta í þessum leik ? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Ertu viss um að þú viljir hætta í þessu korti ? +# Help window + # Cheat window STR_CHEATS :{WHITE}Svindl STR_CHEATS_TOOLTIP :{BLACK}Valreitur segir til um ef þú hefur notað þetta svindl áður @@ -3922,7 +3925,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN STR_TEXTFILE_VIEW_README :{BLACK}Skoða lesskrá STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Breytiskrá STR_TEXTFILE_VIEW_LICENCE :{BLACK}Leyfi -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} lesskrá (readme) fyrir {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} breytiskrá (changelog) fyrir {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} leyfi fyrir {STRING} diff --git a/src/lang/ido.txt b/src/lang/ido.txt index 298e58717f..a1b482dcba 100644 --- a/src/lang/ido.txt +++ b/src/lang/ido.txt @@ -346,7 +346,7 @@ STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH :Livrita kargajo ###length 3 # About menu -###length 10 +###length 11 # Place in highscore window ###length 15 @@ -624,6 +624,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normala + ###length 3 @@ -826,6 +827,8 @@ STR_QUIT_NO :{BLACK}Ne # Abandon game +# Help window + # Cheat window # Livery window @@ -1467,7 +1470,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window -###length 4 +###length 5 # Vehicle loading indicators diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index ce85731162..f17b3e3a3c 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -504,7 +504,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Berita Lampau STR_NEWS_MENU_DELETE_ALL_MESSAGES :Hapus semua pesan # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informasi area daratan STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Hidup/matikan Layar Konsol @@ -1404,6 +1404,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nihil STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Dikurangi STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Ijinkan terminal drive-thru pada jalan milik kota: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Membolehkan konstruksi halte di jalan kota STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Ijinkan terminal drive-thru pada jalan milik pesaing: {STRING} @@ -2132,6 +2133,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Tinggalk STR_ABANDON_GAME_QUERY :{YELLOW}Apakah anda yakin untuk meninggalkan permainan? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Apakah anda yakin untuk mengabaikan skenario ini ? +# Help window + # Cheat window STR_CHEATS :{WHITE}Kode Curang STR_CHEATS_TOOLTIP :{BLACK}Daftar cek ini mengindikasikan bahwa anda telah menggunakan kode curang ini sebelumnya @@ -4661,7 +4664,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Mengebat STR_TEXTFILE_VIEW_README :{BLACK}Lihat readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Catatan Perubahan STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisensi -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}keterangan {STRING} dari {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Catatan perubahan {STRING} dari {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Lisensi {STRING} dari {STRING} diff --git a/src/lang/irish.txt b/src/lang/irish.txt index df23eb316d..2f72d31361 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -492,7 +492,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Stair na dteach STR_NEWS_MENU_DELETE_ALL_MESSAGES :Scrios gach teachtaireacht # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Faisnéis faoin limistéar talún STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Scoránaigh consól @@ -1354,6 +1354,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ceann ar bith STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Laghdaithe STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Gnáth + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Ceadaigh stadanna bóthair 'tiomáin tríd' ar bhóithre ar le bailte iad: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Ceadaigh stopann bóthair 'tiomáin tríd' a thógáil ar bhóithre ar le bailte iad STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Ceadaigh stopanna bóthair 'tiomáin tríd' ar bhóithre ar le hiomaitheoirí iad: {STRING} @@ -2060,6 +2061,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Fág an STR_ABANDON_GAME_QUERY :{YELLOW}An bhfuil tú cinnte gur mhaith leat an cluiche seo a fhágáil? STR_ABANDON_SCENARIO_QUERY :{YELLOW}An bhfuil tú cinnte gur mhaith leat an scéal seo a fhágáil? +# Help window + # Cheat window STR_CHEATS :{WHITE}Caimiléireacht STR_CHEATS_TOOLTIP :{BLACK}Tugann ticbhoscaí le fios más rud é gur úsáid tú an chaimiléireacht seo roimhe seo @@ -4529,7 +4532,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Timthria STR_TEXTFILE_VIEW_README :{BLACK}Amharc ar léigh mé STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Loga na n-athruithe STR_TEXTFILE_VIEW_LICENCE :{BLACK}Ceadúnas -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} léigh mé de {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} loga athruithe de {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} ceadúnas de {STRING} diff --git a/src/lang/italian.txt b/src/lang/italian.txt index a22164fd36..3673445fee 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -523,7 +523,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Cronologia mess STR_NEWS_MENU_DELETE_ALL_MESSAGES :Elimina tutti i messaggi # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informazioni sull'area di terreno STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Apri/chiudi console @@ -1461,6 +1461,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nessuno* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Ridotto STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normale + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Consenti fermate passanti sulle strade di proprietà delle città: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permettere la costruzione di fermate stradali passanti sulle strade di proprietà delle città. STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Consenti fermate passanti sulle strade di proprietà degli avversari: {STRING} @@ -2198,6 +2199,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abbandon STR_ABANDON_GAME_QUERY :{YELLOW}Si è sicuri di voler abbandonare la partita in corso? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Si è sicuri di voler abbandonare questo scenario? +# Help window + # Cheat window STR_CHEATS :{WHITE}Trucchi STR_CHEATS_TOOLTIP :{BLACK}Le caselle indicano se un trucco è già stato usato una volta @@ -4741,7 +4744,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Manda au STR_TEXTFILE_VIEW_README :{BLACK}Visualizza file leggimi STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Changelog STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenza -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}File leggimi del {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Changelog del {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Licenza del {STRING} {STRING} diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index 227fae7bed..426b38f3a5 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -504,7 +504,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :メッセージ STR_NEWS_MENU_DELETE_ALL_MESSAGES :メッセージをすべて削除 # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :地域情報 STR_ABOUT_MENU_SEPARATOR :――――――――――――――――― STR_ABOUT_MENU_TOGGLE_CONSOLE :コンソールの表示切替 @@ -1399,6 +1399,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :なし STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :軽減 STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :普通 + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :街有道路での路側型バス停/荷役所建設: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :路側型バス停/荷役所を街が所有する道路上に建設できるようにします STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :他社の道路上での路側型バス停/荷役所設置: {STRING} @@ -2130,6 +2131,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}ゲー STR_ABANDON_GAME_QUERY :{YELLOW}このゲームを終了してもよろしいですか? STR_ABANDON_SCENARIO_QUERY :{YELLOW}このシナリオを終了してもよろしいですか? +# Help window + # Cheat window STR_CHEATS :{WHITE}チート STR_CHEATS_TOOLTIP :{BLACK}以前にこのチートを使用したことがあることを示します @@ -4650,7 +4653,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}ウィ STR_TEXTFILE_VIEW_README :{BLACK}Readmeを見る STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}変更履歴を見る STR_TEXTFILE_VIEW_LICENCE :{BLACK}ライセンス -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING}のReadme STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} {STRING}の変更履歴 STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} {STRING}のライセンス diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 4181f2a55e..4adecfdc4f 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -522,8 +522,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :과거 메시 STR_NEWS_MENU_DELETE_ALL_MESSAGES :모든 뉴스 메시지 삭제 # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :지형 정보 +STR_ABOUT_MENU_HELP :도움말 & 매뉴얼 STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :콘솔 켜기/끄기 STR_ABOUT_MENU_AI_DEBUG :인공지능/게임 스크립트 디버그 @@ -1427,10 +1428,13 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :없음* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :적음 STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :보통 +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :경쟁사 소유의 도로나 선로에 건널목 건설 허용: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :다른 회사 소유의 도로나 선로에 건널목을 건설하는 것을 허용합니다 + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :도시 소유의 도로 위에 버스 정류장 건설 허용: {STRING} -STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :도시 소유의 도로 위에 버스 정류장 건설을 허용합니다. +STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :도시 소유의 도로 위에 버스 정류장 건설을 허용합니다 STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :경쟁자 소유의 도로 위에 버스 정류장 건설 허용: {STRING} -STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :다른 회사 소유의 도로 위에 버스 정류장을 건설하는 것을 허용합니다. +STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :다른 회사 소유의 도로 위에 버스 정류장을 건설하는 것을 허용합니다 STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}이미 차량이 존재하면 이 설정을 변경하실 수 없습니다. STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :기반시설 유지비: {STRING} @@ -2122,6 +2126,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}멀티 STR_INTRO_GAME_OPTIONS :{BLACK}게임 설정 STR_INTRO_HIGHSCORE :{BLACK}고득점 순위표 +STR_INTRO_HELP :{BLACK}도움말 & 매뉴얼 STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}설정 STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF 설정 STR_INTRO_ONLINE_CONTENT :{BLACK}온라인 콘텐츠 다운로드 @@ -2143,6 +2148,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}장난 STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}게임 기본 설정 창을 보여줍니다 STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}고득점 순위표를 보여줍니다 +STR_INTRO_TOOLTIP_HELP :{BLACK}각종 문서와 온라인 링크를 확인합니다 STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}설정 창을 엽니다 STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF 설정 창을 엽니다 STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}새로 나왔거나 업데이트된 콘텐츠를 체크하여 다운로드합니다 @@ -2164,6 +2170,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}게임 STR_ABANDON_GAME_QUERY :{YELLOW}정말 이 게임을 종료하고 메인으로 이동하시겠습니까? STR_ABANDON_SCENARIO_QUERY :{YELLOW}정말 이 시나리오를 종료하시겠습니까? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}도움말 & 매뉴얼 +STR_HELP_WINDOW_WEBSITES :{BLACK}웹사이트 +STR_HELP_WINDOW_DOCUMENTS :{BLACK}문서 +STR_HELP_WINDOW_README :{BLACK}Readme +STR_HELP_WINDOW_CHANGELOG :{BLACK}변경기록 +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}알려진 버그 +STR_HELP_WINDOW_LICENSE :{BLACK}라이선스 +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}매뉴얼 / 위키 +STR_HELP_WINDOW_BUGTRACKER :{BLACK}버그 신고 +STR_HELP_WINDOW_COMMUNITY :{BLACK}커뮤니티 + # Cheat window STR_CHEATS :{WHITE}치트 STR_CHEATS_TOOLTIP :{BLACK}체크박스의 체크 표시는 이전에 이 치트를 사용했는지 여부를 나타냅니다 @@ -2651,6 +2670,7 @@ STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}정거 STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}다리를 보여줄 지 선택합니다. 고정하려면 CTRL+클릭하세요 STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}등대나 안테나 같은 구조물을 보여줄 지 선택합니다. 고정하려면 CTRL+클릭하세요 STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}전차선을 보여줄 지 선택합니다. 고정하려면 CTRL+클릭하세요 +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}적재/하차 및 수입/지출 텍스트를 보여줄 지 선택합니다. 고정하려면 CTRL+클릭하세요 STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}반투명 대신 아예 안 보이게 할 항목을 선택하세요 # Linkgraph legend window @@ -4696,16 +4716,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}목차 +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}이 목록을 이용하여 표시된 파일의 특정 단락으로 빠르게 이동합니다 +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}탐색 기록 뒤로 가기 +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}탐색 기록 앞으로 가기 STR_TEXTFILE_WRAP_TEXT :{WHITE}자동 줄 바꿈 STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}본문 내용에 자동 줄 바꿈을 설정하여 스크롤하지 않고도 본문의 모든 내용을 볼 수 있게 합니다. STR_TEXTFILE_VIEW_README :{BLACK}Readme 보기 STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}변경기록 STR_TEXTFILE_VIEW_LICENCE :{BLACK}저작권 -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING}의 Readme STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} {STRING}의 변경기록 STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} {STRING}의 저작권 STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}설문조사 결과 미리보기 +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD '{STRING}' 문서 # Vehicle loading indicators diff --git a/src/lang/latin.txt b/src/lang/latin.txt index 2098840297..4ae0933d43 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -665,7 +665,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historia nuntio STR_NEWS_MENU_DELETE_ALL_MESSAGES :Delere omnia nuntia # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Terrae regionis indicia STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Monstrare celareve consolam @@ -1484,6 +1484,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Numquam* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Raro STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Mediocriter + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Sinere stationes viarias pervias esse in viis oppidorum: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Sinere struere stationes viarias pervias in viis quas oppida possident STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Sinere stationes viarias pervias esse in viis competitorum: {STRING} @@ -2146,6 +2147,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Relinque STR_ABANDON_GAME_QUERY :{YELLOW}Esne certus te velle ludum relinquere? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Esne certus te velle scaenarium relinquere? +# Help window + # Cheat window STR_CHEATS :{WHITE}Tricae STR_CHEATS_TOOLTIP :{BLACK}Quadrum signi plenum indicat trica iam a te usa est @@ -4420,7 +4423,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Volvere STR_TEXTFILE_VIEW_README :{BLACK}Inspicere LegeMe STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Index Mutationum STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licentia -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} - {STRING} LegeMe STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} - {STRING} Index Mutationum STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} - {STRING} Licentia diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index c6147b4e24..3a639d05b1 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -505,7 +505,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Ziņojumu vēst STR_NEWS_MENU_DELETE_ALL_MESSAGES :Dzēst visus ziņojumus # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Zemes platības informācija STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Atvērt/aizvērt konsoli @@ -1382,6 +1382,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nav* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :samazināts STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :parasts + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Atļaut caurbraucamas pieturvietas uz pilsētai piederošiem ceļiem: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Ļauj būvēt caurbraucamas pieturvietas uz pilsētai piederošiem ceļiem STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Atļaut caurbraucamas pieturvietas uz sāncenšu ceļiem: {STRING} @@ -2109,6 +2110,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Pamest s STR_ABANDON_GAME_QUERY :{YELLOW}Vai tiešām vēlaties pamest šo spēli? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Vai tiešām vēlaties pamest šo scenāriju? +# Help window + # Cheat window STR_CHEATS :{WHITE}Blēdības STR_CHEATS_TOOLTIP :{BLACK}Atzīmētās rūtiņas norāda uz to, vai esat jau izmantojis šo blēdību @@ -4628,7 +4631,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Aplauzt STR_TEXTFILE_VIEW_README :{BLACK}Skatīt failu Lasi_mani STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Izmaiņu žurnāls STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licence -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} kopas {STRING} fails Lasi_mani STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} kopas {STRING} izmaiņu žurnāls STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} kopas {STRING} licence diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index e22539d671..d0e1e4fc51 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -694,7 +694,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Žinučių isto STR_NEWS_MENU_DELETE_ALL_MESSAGES :Pašalinti visas žinutes # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Žemės ploto informacija STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Perjungti konsolę @@ -1571,6 +1571,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Jokių STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Retesni STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normalus + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Leisti pravažiuojamąsias stoteles miesto keliuose: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Leidžia statyti pravažiuojamojo tipo stoteles miestams priklausiančiuose keliuose STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Leisti pravažiuojamąsias stoteles priešininko keliuose: {STRING} @@ -2303,6 +2304,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Palikti STR_ABANDON_GAME_QUERY :{YELLOW}Ar tikrai norite išeiti iš žaidimo? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Ar tikrai norite išeiti iš šio scenarijaus? +# Help window + # Cheat window STR_CHEATS :{WHITE}Sukčiavimai STR_CHEATS_TOOLTIP :{BLACK}Laukeliai rodo ar jus naudojote šį triuką prieš tai @@ -4823,7 +4826,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Skaidyti STR_TEXTFILE_VIEW_README :{BLACK}Peržiūrėti SKAITYKMANE STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Pasikeitimai STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licencija -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} aprašymas {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} pasikeitimai {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licencija {STRING} diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 0386f7498f..ddb4a6b377 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -503,7 +503,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Meldungshistori STR_NEWS_MENU_DELETE_ALL_MESSAGES :All Message läschen # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Landinformatiounen STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Konsole un/aus @@ -1380,6 +1380,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Keng* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduzéiert STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Erlaabt d'Iwwerfueren vu Stopschëlder op Stroossen vun der Stad: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Erlaabt d'Bauen vu säitlechen Busarrêten op Stroossen déi der Stad gehéieren STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Erlaabt d'Iwwerfueren vu Stopschëlder op Stroossen vun der Konkurrenz: {STRING} @@ -2105,6 +2106,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Spill of STR_ABANDON_GAME_QUERY :{YELLOW}Bass du sécher, dass du des Partie ofbrieche wëlls? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Bass du sécher, dass du dëse Szenario ofbrieche wëlls? +# Help window + # Cheat window STR_CHEATS :{WHITE}Cheater STR_CHEATS_TOOLTIP :{BLACK}Checkboxen weisen un dass du den Cheat schon eng Kéier benotzt hues @@ -4621,7 +4624,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Ännert STR_TEXTFILE_VIEW_README :{BLACK}Readme liesen STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Changelog STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lizenz -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme vun {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} Changelog vun {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} Lizenz vun {STRING} diff --git a/src/lang/macedonian.txt b/src/lang/macedonian.txt index 878123f739..7d840209de 100644 --- a/src/lang/macedonian.txt +++ b/src/lang/macedonian.txt @@ -448,7 +448,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Последн STR_NEWS_MENU_MESSAGE_HISTORY_MENU :порака историјата # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Земјиште во областа STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Вклучи конзола @@ -924,6 +924,7 @@ STR_CONFIG_SETTING_SMOKE_AMOUNT :Износ на ###length 3 + STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Инфраструктура за одржување: {STRING} @@ -1180,6 +1181,8 @@ STR_QUIT_NO :{BLACK}Не STR_ABANDON_GAME_CAPTION :{WHITE}Напушти ја Играта STR_ABANDON_GAME_QUERY :{YELLOW}Дали сте сигурни дека сакате да ја напуштите играта? +# Help window + # Cheat window # Livery window @@ -1974,7 +1977,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window -###length 4 +###length 5 # Vehicle loading indicators diff --git a/src/lang/malay.txt b/src/lang/malay.txt index a7df785386..2344b3c263 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -456,7 +456,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Pesanan/laporan STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Pesanan sebelumnya # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Maklumat kawasan tanah STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Papar atau padamkan konsol @@ -1243,6 +1243,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Tiada STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Dikurangkan STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Benarkan hentian pandu-lalu di jalanraya bandar: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Benarkan pembinaan untuk jalan pemanduan berhenti di jalan milik bandaran STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Benarkan hentian pandu-lalu di jalanraya yang dimiliki oleh pesaing: {STRING} @@ -1705,6 +1706,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Tinggalk STR_ABANDON_GAME_QUERY :{YELLOW}Pastikah anda mahu keluar dari permainan ini? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Pastikah anda untuk keluar dari senario ini? +# Help window + # Cheat window STR_CHEATS :{WHITE}Penipuan (Cheats) STR_CHEATS_TOOLTIP :{BLACK}Kotak bertanda menunjukkan anda pernah menggunakan penipuan (cheats) ini @@ -3832,7 +3835,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN STR_TEXTFILE_VIEW_README :{BLACK}Lihat readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}LogUbah STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lesen -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme untuk {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} LogUbah untuk {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} lesen untuk {STRING} diff --git a/src/lang/maltese.txt b/src/lang/maltese.txt index f7e98114d0..673b8acdbb 100644 --- a/src/lang/maltese.txt +++ b/src/lang/maltese.txt @@ -315,7 +315,7 @@ STR_FILE_MENU_SEPARATOR : ###length 3 # About menu -###length 10 +###length 11 # Place in highscore window ###length 15 @@ -552,6 +552,7 @@ STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Iddeċiedi kemm + STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Avza jekk jintilef il-vehikolu: {STRING} ###length 3 @@ -751,6 +752,8 @@ STR_INTRO_CAPTION :{WHITE}OpenTTD # Abandon game +# Help window + # Cheat window STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Ibdel is-sena @@ -1339,7 +1342,7 @@ STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Исчи STR_TEXTFILE_VIEW_README :{BLACK}Прикажи ги чита-ми STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Промени се најавите STR_TEXTFILE_VIEW_LICENCE :{BLACK}Лиценца -###length 4 +###length 5 STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} лиценца за {STRING} diff --git a/src/lang/marathi.txt b/src/lang/marathi.txt index 47be4d8a24..98aea1175d 100644 --- a/src/lang/marathi.txt +++ b/src/lang/marathi.txt @@ -442,7 +442,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :शेवटच STR_NEWS_MENU_MESSAGE_HISTORY_MENU :निरोपांचा इतिहास # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :जागाची माहिती STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_SCREENSHOT :द्श्य @@ -862,6 +862,7 @@ STR_CONFIG_SETTING_SMOKE_AMOUNT :वाहना + STR_CONFIG_SETTING_WARN_LOST_VEHICLE : वाहन हरवल्यास सूचित करा: {STRING} ###length 3 @@ -1060,6 +1061,8 @@ STR_INTRO_CAPTION :{WHITE}ओप # Abandon game +# Help window + # Cheat window STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}चालू वर्ष बदला @@ -1761,7 +1764,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window -###length 4 +###length 5 # Vehicle loading indicators diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 9755ceadff..b0f7150849 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -496,7 +496,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Tidligere meldi STR_NEWS_MENU_DELETE_ALL_MESSAGES :Slett alle meldinger # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informasjon om landområde STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Vis/skjul konsoll @@ -1361,6 +1361,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ingen* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Redusert STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normalt + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Tillat stoppesteder med gjennomkjøring på by-eide veier: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Tillat bygging av stoppesteder med gjennomkjøring på by-eide veier STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Tillat stoppesteder med gjennomkjøring på motstander-eide veier: {STRING} @@ -2076,6 +2077,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Avslutt STR_ABANDON_GAME_QUERY :{YELLOW}Er du sikker på at du vil avslutte dette spillet? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Er du sikker på at du vil forlate dette scenariet? +# Help window + # Cheat window STR_CHEATS :{WHITE}Juksekoder STR_CHEATS_TOOLTIP :{BLACK}Avkrysningsbokser indikerer om du har brukt denne juksekoden tidligere @@ -4551,7 +4554,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Bryt tek STR_TEXTFILE_VIEW_README :{BLACK}Se på hjelpefilen STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Endringslogg STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisens -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} hjelpefil til {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} endringslogg til {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} lisens til {STRING} diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 578b9d1b10..cfbbb11e18 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -476,7 +476,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Siste melding/n STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Tidlegare meldingar # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informasjon om landområde STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Syne/gøym konsoll @@ -1276,6 +1276,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ingen STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Redusert STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normalt + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Tillet stoppestadar med gjennomkøyring på by-eigde vegar: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Tillat bygging av stoppestadar med gjennomkøyring på vegar eigd av byen STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Tillet stoppestadar med gjennomkøyring på konkurent-eigde vegar: {STRING} @@ -1864,6 +1865,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Avslutt STR_ABANDON_GAME_QUERY :{YELLOW}Er du sikker på at du vil forlata spelet? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Er du sikker på at du vil avslutte scenariet? +# Help window + # Cheat window STR_CHEATS :{WHITE}Juks STR_CHEATS_TOOLTIP :{BLACK}Avkrysningsbokser fortel at du har nytta denne juksekoden tidlegare @@ -4056,7 +4059,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Bryt tek STR_TEXTFILE_VIEW_README :{BLACK}Vis lesmeg STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Endringslogg STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisens -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} lesmeg for {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} endringslogg for {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} lisens for {STRING} diff --git a/src/lang/persian.txt b/src/lang/persian.txt index feaf8a2d2e..70a36a9bcd 100644 --- a/src/lang/persian.txt +++ b/src/lang/persian.txt @@ -465,7 +465,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :گزارش آخ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :تاریخچه پیام ها # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :اطلاعات زمین ها STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :باز و بسته کردن کنسول @@ -1214,6 +1214,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :هیچکدام STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :کاهش STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :عادی + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :اجازه رانندگی در خیابان‌های شهر{STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :اجازه استفاده از جاده یک بازیکن توسط دیگر رقیبان: {STRING} STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}تغییر دادن این تنظیم هنگامی که خودرو وجود دارد ممکن نیست @@ -1674,6 +1675,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}رها STR_ABANDON_GAME_QUERY :{YELLOW}آیا مطمئن هستی که میخواهی این بازی را از بین ببری؟ STR_ABANDON_SCENARIO_QUERY :{YELLOW}آیا مطمئنید که می خواهید این سناریو را رها کنید؟ +# Help window + # Cheat window STR_CHEATS :{WHITE}تقلبها STR_CHEATS_TOOLTIP :{BLACK}جعبه انتخاب ها نشان می دهند که قبلا از چه تقلبی استفاده کردید @@ -3483,7 +3486,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}متن STR_TEXTFILE_VIEW_README :{BLACK}مشاهده راهنما STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}گزارش تغییر STR_TEXTFILE_VIEW_LICENCE :{BLACK}گواهی -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}راهنمای {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} گزارش تغییرات {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} گواهی {STRING} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index be0867cfdb..8e3b26fe87 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -538,12 +538,12 @@ STR_ABBREV_ALL :+ # 'Mode' of transport for cargoes STR_PASSENGERS :{COMMA}{NBSP}pasażer{P "" ów ów} STR_BAGS :{COMMA}{NBSP}wor{P ek ki ków} -STR_BAGS.d :{COMMA} worków -STR_BAGS.c :{COMMA} workom -STR_BAGS.b :{COMMA} worki -STR_BAGS.n :{COMMA} workami -STR_BAGS.m :{COMMA} workach -STR_BAGS.w :{COMMA} worki +STR_BAGS.d :{COMMA}{NBSP}worków +STR_BAGS.c :{COMMA}{NBSP}workom +STR_BAGS.b :{COMMA}{NBSP}worki +STR_BAGS.n :{COMMA}{NBSP}workami +STR_BAGS.m :{COMMA}{NBSP}workach +STR_BAGS.w :{COMMA}{NBSP}worki STR_TONS :{COMMA}{NBSP}ton{P a y ""} STR_LITERS :{COMMA}{NBSP}litr{P "" y ów} STR_ITEMS :{COMMA}{NBSP}sztuk{P a i ""} @@ -900,7 +900,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Poprzednie wiad STR_NEWS_MENU_DELETE_ALL_MESSAGES :Usuń wszystkie wiadomości # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informacje o terenie STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Przełącz konsolę @@ -1806,6 +1806,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Brak* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Zredukowana STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normalna +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Pozwól na skrzyżowania dróg z torami kolejowymi należącymi do konkurentów: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Pozwala budować przejazdy kolejowe przez drogi lub tory należące do konkurentów + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Pozwól na budowę przystanków przelotowych na drogach miejskich: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Pozwalaj budować przystanki przelotowe na drogach będących własnością miast STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Pozwól na budowę przystanków przelotowych na drogach innych firm: {STRING} @@ -2543,6 +2546,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Wyjście STR_ABANDON_GAME_QUERY :{YELLOW}Czy na pewno chcesz porzucić tę rozgrywkę? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Czy na pewno chcesz porzucić ten scenariusz? +# Help window + # Cheat window STR_CHEATS :{WHITE}Oszustwa STR_CHEATS_TOOLTIP :{BLACK}Pole wyboru wskazuje, czy użyłeś już wcześniej tego oszustwa @@ -5087,7 +5092,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Zawiń t STR_TEXTFILE_VIEW_README :{BLACK}Odczytaj plik „readme” STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Lista zmian STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licencja -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING} - plik „readme” STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} {STRING} - lista zmian STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} {STRING} - licencja @@ -5178,7 +5183,7 @@ STR_ERROR_BUILDING_MUST_BE_DEMOLISHED :{WHITE}Należy STR_ERROR_CAN_T_CLEAR_THIS_AREA :{WHITE}Nie można wyczyścić terenu... STR_ERROR_SITE_UNSUITABLE :{WHITE}... niewłaściwa parcela STR_ERROR_ALREADY_BUILT :{WHITE}... już zbudowano -STR_ERROR_OWNED_BY :{WHITE}... w posiadaniu {STRING} +STR_ERROR_OWNED_BY :{WHITE}... własność {STRING.d} STR_ERROR_AREA_IS_OWNED_BY_ANOTHER :{WHITE}... teren jest własnością innej firmy STR_ERROR_TERRAFORM_LIMIT_REACHED :{WHITE}... osiągnięto limit kształtowania terenu STR_ERROR_CLEARING_LIMIT_REACHED :{WHITE}... osiągnięto limit czyszczenia pól @@ -6030,6 +6035,12 @@ STR_FORMAT_DEPOT_NAME_AIRCRAFT :Hangar {STATION STR_UNKNOWN_STATION :Nieznana stacja STR_DEFAULT_SIGN_NAME :Napis STR_COMPANY_SOMEONE :ktoś +STR_COMPANY_SOMEONE.d :kogoś +STR_COMPANY_SOMEONE.c :komuś +STR_COMPANY_SOMEONE.b :kogoś +STR_COMPANY_SOMEONE.n :kimś +STR_COMPANY_SOMEONE.m :kimś +STR_COMPANY_SOMEONE.w :ktoś STR_SAVEGAME_NAME_DEFAULT :{COMPANY}, {STRING} STR_SAVEGAME_NAME_SPECTATOR :Obserwator, {1:STRING} diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 854ca90d92..ad2bd47b92 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -522,8 +522,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Histórico de m STR_NEWS_MENU_DELETE_ALL_MESSAGES :Apagar todas as mensagens # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informações do terreno +STR_ABOUT_MENU_HELP :Ajuda & manuais STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Mostrar/Ocultar consola STR_ABOUT_MENU_AI_DEBUG :Depuração da IA/Scripts de jogo @@ -1427,6 +1428,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Nenhum* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduzido STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Permitir passagens de nível com estradas ou carris de outras empresas: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Permite a construção de passagens de nível nas estradas ou carris pertencentes a outras empresas + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite estações de passagem nas estradas pertencentes às localidades: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permite a construção de estações de passagem nas ruas pertencentes a localidades. STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir estações de passagem nas estradas detidas pelos competidores: {STRING} @@ -2122,6 +2126,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multi-jo STR_INTRO_GAME_OPTIONS :{BLACK}Opções de jogo STR_INTRO_HIGHSCORE :{BLACK}Tabela de classificações +STR_INTRO_HELP :{BLACK}Ajuda & Manuais STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Definições STR_INTRO_NEWGRF_SETTINGS :{BLACK}Definições de NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Verificar conteúdo online @@ -2143,6 +2148,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Selecion STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Mostrar opções de jogo STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Mostrar tabela de classificações +STR_INTRO_TOOLTIP_HELP :{BLACK}Obter acesso a documentação e recursos online STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Mostrar definições STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Mostrar definições de NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Verificar conteúdo novo e actualizado para descarga @@ -2164,6 +2170,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandona STR_ABANDON_GAME_QUERY :{YELLOW}Tem a certeza que deseja abandonar este jogo? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Tem a certeza que deseja abandonar este cenário? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Ajuda & Manuais +STR_HELP_WINDOW_WEBSITES :{BLACK}Páginas de Internet +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documentos +STR_HELP_WINDOW_README :{BLACK}Leia-me +STR_HELP_WINDOW_CHANGELOG :{BLACK}Registo de alterações +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Erros Conhecidos +STR_HELP_WINDOW_LICENSE :{BLACK}Licença +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manual / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Reportar um erro +STR_HELP_WINDOW_COMMUNITY :{BLACK}Comunidade + # Cheat window STR_CHEATS :{WHITE}Truques STR_CHEATS_TOOLTIP :{BLACK}As caixas de verificação indicam se já usou este truque antes @@ -2575,7 +2594,7 @@ STR_CONTENT_SELECT_UPDATES_CAPTION :{BLACK}Sel. act STR_CONTENT_SELECT_UPDATES_CAPTION_TOOLTIP :{BLACK}Marcar todo o conteúdo que seja actualização ao conteúdo existente a ser descarregado STR_CONTENT_UNSELECT_ALL_CAPTION :{BLACK}Desseleccionar tudo STR_CONTENT_UNSELECT_ALL_CAPTION_TOOLTIP :{BLACK}Marcar todo o conteúdo que não deva ser descarregado -STR_CONTENT_SEARCH_EXTERNAL :{BLACK}Pesquisar sites externos +STR_CONTENT_SEARCH_EXTERNAL :{BLACK}Pesquisar "sites" externos STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK}Escolher conteudo não disponivel no serviço de conteúdo do OpenTTD em sites não associados ao OpenTTD STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER_CAPTION :{WHITE}Está a sair do OpenTTD! STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER :{WHITE}Os termos e condições para o download de conteúdo de sites externos variam.{}Terá que se referir aos sites externos para instruções em como instalar o conteúdo no OpenTTD.{}Pretende continuar? @@ -4697,16 +4716,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Índice de Conteúdo +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Saltar rapidamente para uma secção do ficheiro exibido através desta lista +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Recuar no histórico de navegação +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Avançar no histórico de navegação STR_TEXTFILE_WRAP_TEXT :{WHITE}Envolver o texto STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Envolve o texto da janela de forma que não é necessário deslizar listagem STR_TEXTFILE_VIEW_README :{BLACK}Ver leia-me STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Lista de alterações STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licença -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Leiame {STRING} de {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Lista de alterações {STRING} de {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Licença {STRING} de {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Pré-visualização do resultado da sondagem +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD documento '{STRING}' # Vehicle loading indicators diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 0a06468da4..ee59ce7387 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -521,8 +521,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Lista ultimelor STR_NEWS_MENU_DELETE_ALL_MESSAGES :Șterge toate mesajele # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informaţii despre teren +STR_ABOUT_MENU_HELP :Ajutor și manuale STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Consolă pornit/oprit STR_ABOUT_MENU_AI_DEBUG :Depanare Inteligenţă Artificială / Script Joc @@ -1425,6 +1426,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :niciunul STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :redus STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Permite treceri la nivel cu drumuri sau șine deținute de concurenți: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Permite construirea de treceri la nivel pe drumuri sau șine deținute de concurenți + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permite construirea stațiilor pe drumurile deținute de orașe: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permite construirea de stații pe drumurile aflate în proprietatea orașelor STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permite construirea staţiilor pe drumurile competitorilor: {STRING} @@ -1895,8 +1899,8 @@ STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite ca ora 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} -STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Dacă această opțiune este dezactivată, pot exista două aeroporturi în fiecare oraș. Când opțiunea este activată, numărul de aeroporturi este limitat de nivelul de zgomot acceptat de oraș, care depinde de populație, mărimea aeroportului și distanța față de oraș +STR_CONFIG_SETTING_NOISE_LEVEL :Limitează amplasarea aeroportului în funcție de nivelul de zgomot: {STRING} +STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Permiteți orașelor să blocheze construcția aeroportului pe baza nivelului de acceptare a zgomotului, care se bazează pe populația orașului și pe dimensiunea și distanța aeroportului. Dacă această setare este dezactivată, orașele permit doar două aeroporturi, cu excepția cazului în care atitudinea autorităților locale este setată la „Permisiv”. STR_CONFIG_SETTING_TOWN_FOUNDING :Crearea oraşelor în joc: {STRING} STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Dacă este activată, jucătorii pot fonda noi orașe în joc @@ -2120,6 +2124,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multipla STR_INTRO_GAME_OPTIONS :{BLACK}Opțiuni STR_INTRO_HIGHSCORE :{BLACK}Tabela cu scoruri maxime +STR_INTRO_HELP :{BLACK}Ajutor și manuale STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Setări STR_INTRO_NEWGRF_SETTINGS :{BLACK}Setări NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Resurse online @@ -2141,6 +2146,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Alege pe STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Afişează opţiunile jocului STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Afișează tabela cu scoruri maxime +STR_INTRO_TOOLTIP_HELP :{BLACK}Obțineți acces la documentație și resurse online STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Setări afişare 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 @@ -2162,6 +2168,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Ieșire STR_ABANDON_GAME_QUERY :{YELLOW}Sigur vrei să renunți la acest joc? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Sigur vrei să renunți la acest scenariu? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Ajutor și manuale +STR_HELP_WINDOW_WEBSITES :{BLACK}Site-uri web +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Documente +STR_HELP_WINDOW_README :{BLACK}Citiți-mă +STR_HELP_WINDOW_CHANGELOG :{BLACK}Jurnalul modificărilor +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Erori cunoscute +STR_HELP_WINDOW_LICENSE :{BLACK}Licență +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Manual / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Raportați o eroare +STR_HELP_WINDOW_COMMUNITY :{BLACK}Comunitate + # Cheat window STR_CHEATS :{WHITE}Cheat-uri STR_CHEATS_TOOLTIP :{BLACK}Bifa vă indică dacă aţi folosit anterior acest cheat @@ -2649,6 +2668,7 @@ STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Comută STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Comută transparenţa pentru poduri. Ctrl+Click pentru blocare STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Comută transparenţa pentru structuri de tip faruri şi antene. Ctrl+Click pentru blocare STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Comută transparenţa pentru catenar. Ctrl+Click pentru blocare +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Comută transparența textului pentru încărcare și cost/venit. Ctrl+Clic pentru a bloca STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Setează obiectele ca invizibile în loc de transparente # Linkgraph legend window @@ -4694,16 +4714,20 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Cuprins +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Săriți rapid la o secțiune din fișierul afișat prin această listă +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} STR_TEXTFILE_WRAP_TEXT :{WHITE}Încadrează textul STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Încadrează textul ferestrei ca să fie vizibil integral, fără derulare STR_TEXTFILE_VIEW_README :{BLACK}Vezi fișierul readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Listă modificări STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenţă -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING}, fișier readme al {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING}, lista de modificări a {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING}, licența fișierului {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Previzualizare a rezultatului sondajului +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}Deschide document OpenTTD '{STRING}' # Vehicle loading indicators diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 7a15b4c237..9c081b4c27 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -647,8 +647,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :История STR_NEWS_MENU_DELETE_ALL_MESSAGES :Удалить все сообщения # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Информация об участке земли +STR_ABOUT_MENU_HELP :Помощь и документация STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Консоль STR_ABOUT_MENU_AI_DEBUG :Отладка ИИ / скриптов @@ -1577,9 +1578,12 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :отсутст STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :сниженная STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :обычная +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Ж/Д переезды на дорогах и путях конкурентов: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Разрешить строить железнодорожные пути сквозь автомобильные и железные дороги конкурентов + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Позволять строить остановки на муниципальных дорогах: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Разрешить компаниям строить сквозные остановки на дорогах, построенных за счёт городского бюджета -STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Разрешить проезд через остановки соперников по их дорогам: {STRING} +STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Разрешить строить остановки на дорогах конкурентов: {STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Разрешить компаниям строить сквозные остановки на дорогах, принадлежащих другим транспортным компаниям STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Изменение этого параметра невозможно, если в игре есть транспортные средства. @@ -2272,6 +2276,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Сете STR_INTRO_GAME_OPTIONS :{BLACK}Основные настройки STR_INTRO_HIGHSCORE :{BLACK}Таблица рекордов +STR_INTRO_HELP :{BLACK}Помощь и документация STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Расширенные настройки STR_INTRO_NEWGRF_SETTINGS :{BLACK}Настройки NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Проверить онлайн-контент @@ -2293,6 +2298,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Выбр STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Изменить основные настройки игры STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Показать таблицу рекордов +STR_INTRO_TOOLTIP_HELP :{BLACK}Ссылки на документацию и интернет-ресурсы STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Изменить расширенные настройки игры STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Показать настройки NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Найти новый и обновлённый контент для загрузки @@ -2314,6 +2320,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}В гл STR_ABANDON_GAME_QUERY :{YELLOW}Вы действительно хотите выйти из игры? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Вы уверены, что хотите выйти из этого сценария? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Помощь и документация +STR_HELP_WINDOW_WEBSITES :{BLACK}Веб-сайты +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Документы +STR_HELP_WINDOW_README :{BLACK}Readme +STR_HELP_WINDOW_CHANGELOG :{BLACK}История изменений +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Известные ошибки +STR_HELP_WINDOW_LICENSE :{BLACK}Лицензия +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Инструкция / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Сообщить об ошибке +STR_HELP_WINDOW_COMMUNITY :{BLACK}Сообщество + # Cheat window STR_CHEATS :{WHITE}Читы STR_CHEATS_TOOLTIP :{BLACK}Галочки показывают, использовали ли Вы этот чит раньше @@ -4883,16 +4902,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}Содержание +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Список для быстрого перехода к определённой секции отображаемого файла +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Назад +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Вперёд STR_TEXTFILE_WRAP_TEXT :{WHITE}Переносить текст STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Переносить текст так, чтобы он помещался в окне без необходимости прокрутки STR_TEXTFILE_VIEW_README :{BLACK}Посмотреть инструкцию STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Список изменений STR_TEXTFILE_VIEW_LICENCE :{BLACK}Лицензия -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Инструкция к {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Список изменений к {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Лицензия к {STRING} {STRING} STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Собранные данные +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}Документ OpenTTD «{STRING}» # Vehicle loading indicators diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index db010ee6d2..13c5a0548c 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -691,7 +691,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Istorija Obave STR_NEWS_MENU_DELETE_ALL_MESSAGES :Obriši sve poruke # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Podaci o zemljištu STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Uključi/isključi konzolu @@ -1573,6 +1573,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :nikakav STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :umanjen STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normalan + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Dozvoljene ulične stanice na kolovozima u vlasništvu naselja: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Dozvoljava izgradnju protočnih drumskih stanica na putevima čiji je vlasnik naselje STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Dozvoljene ulične stanice na kolovozima u vlasništvu drugih preduzeća: {STRING} @@ -2298,6 +2299,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Napušta STR_ABANDON_GAME_QUERY :{YELLOW}Da li zaista želiš da napustiš ovu igru? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Da li zaista želiš da napustiš ovaj scenario? +# Help window + # Cheat window STR_CHEATS :{WHITE}Varanja STR_CHEATS_TOOLTIP :{BLACK}Štiklirano polje označava da ste i ranije koristili ovu opciju @@ -4822,7 +4825,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK} Prelomi STR_TEXTFILE_VIEW_README :{BLACK}Prikaži uputstvo STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Izmene STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenca -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} uputstvo za {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} izmene od {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licenca od {STRING} diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 3ab1d4a9df..01ce55bb28 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -503,7 +503,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :消息历史 STR_NEWS_MENU_DELETE_ALL_MESSAGES :删除全部消息 # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :查询地块信息 STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :切换到控制台模式 @@ -1380,6 +1380,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :不出现* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :较少出现 STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :正常 + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :允许在城镇所属的道路上建通过式车站: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :“打开”时允许在城市所属的道路上建设通过式车站 STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :允许在竞争对手所属的道路上建通过式车站: {STRING} @@ -2105,6 +2106,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}放弃 STR_ABANDON_GAME_QUERY :{YELLOW}你确定要放弃当前的游戏吗? STR_ABANDON_SCENARIO_QUERY :{YELLOW}你确定要退出当前场景吗? +# Help window + # Cheat window STR_CHEATS :{WHITE}作弊 STR_CHEATS_TOOLTIP :{BLACK}标志您是否用过此作弊选项的单选框 @@ -4621,7 +4624,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}強迫 STR_TEXTFILE_VIEW_README :{BLACK}查看说明 STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}更新日志 STR_TEXTFILE_VIEW_LICENCE :{BLACK}版权信息 -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING} 的说明 STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} {STRING} 的更新日志 STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} {STRING} 的版权信息 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 30a0de0918..1c5b8c2220 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -584,7 +584,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Archív správ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Vymazať všetky správy # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informácie o pozemku STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Zobraziť / skryť konzolu @@ -1485,6 +1485,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Žiadne STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Obmedzené STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normálny + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Povoliť prejazdné zastávky na mestských cestách: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Povoliť budovanie "prejazdných" nakládok a zastávok na cestách vlastnených mestom STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Výstavba zastávok na cestách vlastnených konkurenciou: {STRING} @@ -2212,6 +2213,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Opustiť STR_ABANDON_GAME_QUERY :{YELLOW}Ste si istý, že chcete opustiť túto hru? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Ste si istý, že chcete opustiť tento scenár? +# Help window + # Cheat window STR_CHEATS :{WHITE}Cheaty STR_CHEATS_TOOLTIP :{BLACK}Zaškrtávacie pole indikuje opakované použite cheatu @@ -4739,7 +4742,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Zalamova STR_TEXTFILE_VIEW_README :{BLACK}Zobraziť readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Log zmien STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licencia -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} "čítajma" {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} log zmien {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licencia {STRING} diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index d9100f8f66..789c065153 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -628,7 +628,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Zadnje sporoči STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Zgodovina sporočil # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Informacije o terenu STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Vklopi/Izklopi konzolo @@ -1443,6 +1443,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Brez STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Zmanjšano STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normalno + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Dovoli prehodne postaje na cestah v lasti mest: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Dovoli gradnjo pretočnih postaj na cesti, ki je v lasti mesta. STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Dovoli prevoženja postaj na tekmečevih cestah: {STRING} @@ -2095,6 +2096,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Zapusti STR_ABANDON_GAME_QUERY :{YELLOW}Zagotovo želiš zapustiti igro? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Zagotovo želiš zapustiti ta scenarij? +# Help window + # Cheat window STR_CHEATS :{WHITE}Goljufije STR_CHEATS_TOOLTIP :{BLACK}Kljukice kažejo, če so bile goljufije že kdaj uporabljene @@ -4309,7 +4312,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Prilagod STR_TEXTFILE_VIEW_README :{BLACK}Prikaži preberi-me datoteko STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Zamenjaj dnevnik STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenca -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} preberi-me od {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} zamenjaj dnevnik od {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licenca od {STRING} diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 5cde0e9f2c..98dbed8d9e 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -504,7 +504,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historial de me STR_NEWS_MENU_DELETE_ALL_MESSAGES :Borrar todos los mensajes # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Información del terreno STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Activar consola @@ -1381,6 +1381,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ninguno* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reducida STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permitir construir paradas sobre carreteras de los municipios: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permite construir estaciones de paso en carreteras que sean propiedad de los municipios STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir pasar a través de las paradas de carretera de los competidores: {STRING} @@ -2106,6 +2107,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Abandona STR_ABANDON_GAME_QUERY :{YELLOW}¿Estás seguro de que quieres abandonar esta partida? STR_ABANDON_SCENARIO_QUERY :{YELLOW}¿Estás seguro de que quieres salir de este escenario? +# Help window + # Cheat window STR_CHEATS :{WHITE}Trucos STR_CHEATS_TOOLTIP :{BLACK}Las casillas indican si ha usado este truco antes @@ -4618,7 +4621,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Limitar STR_TEXTFILE_VIEW_README :{BLACK}Ver léeme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Registro de cambios STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licencia -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Léeme del {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Registro de cambios del {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Licencia del {STRING} {STRING} diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index e06a453645..2c13ac1867 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -504,7 +504,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Historial de me STR_NEWS_MENU_DELETE_ALL_MESSAGES :Eliminar todos los mensajes # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Información sobre área de terreno STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Activar consola @@ -1381,6 +1381,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ninguno* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reducida STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permitir construcción de paradas de paso en localidades: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Se podrán construir paradas de paso en las carreteras que sean propiedad de las localidades STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir construcción de paradas de paso en carreteras de la competencia: {STRING} @@ -2106,6 +2107,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Salir de STR_ABANDON_GAME_QUERY :{YELLOW}¿Estás seguro de que deseas salir de esta partida? STR_ABANDON_SCENARIO_QUERY :{YELLOW}¿Estás seguro de que deseas salir de este mapa? +# Help window + # Cheat window STR_CHEATS :{WHITE}Trucos STR_CHEATS_TOOLTIP :{BLACK}Las casillas marcadas indican que ya se usó este truco @@ -4619,7 +4622,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Unir el STR_TEXTFILE_VIEW_README :{BLACK}Ver archivo Léeme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Registro de cambios STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licencia -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Archivo Léeme del {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Registro de cambios del {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Licencia del {STRING} {STRING} diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index a8516f2e3a..f33b6153a1 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -521,7 +521,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Meddelandehisto STR_NEWS_MENU_DELETE_ALL_MESSAGES :Ta bort alla meddelanden # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Information om mark STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Visa/dölj konsolen @@ -1426,6 +1426,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Inga* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reducerad STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Tillåt korsningar med vägar och räls ägda av andra företag: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Tillåt konstruktion av korsningar på vägar och järnvägar som ägs av motståndare + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Tillåt genomfartshållplatser på vägar som ägs av städer: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Tillåt konstruktion av genomfartshållplatser på vägar som ägs av städer STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Tillåt dina fordon att köra genom motståndarens hållplatser: {STRING} @@ -2163,6 +2166,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Avsluta STR_ABANDON_GAME_QUERY :{YELLOW}Är du säker på att du vill avsluta spelet? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Är du säker på att du vill avsluta detta scenario? +# Help window + # Cheat window STR_CHEATS :{WHITE}Fusk STR_CHEATS_TOOLTIP :{BLACK}Checkboxar indikerar om du använt det här fusket förut @@ -2650,6 +2655,7 @@ STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Växla g STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Växla genomskinlighet för broar. Ctrl+klick för att låsa STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Växla genomskinlighet för byggnader såsom fyrar och antenner. Ctrl+klick för att låsa STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Växla genomskinlighet för kontaktledning. Ctrl+klick för att låsa +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK} Växla genomskinlighet för pålastnings, kostnads och inkomsttext. Ctrl+klick för att låsa STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Gör object osynliga istället för genomskinliga # Linkgraph legend window @@ -4700,7 +4706,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Bryt rad STR_TEXTFILE_VIEW_README :{BLACK}Visa manual STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Ändringshistorik STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licens -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE} {STRING}-manual för {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Ändringshistorik för {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Licens för {STRING}{STRING} diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index ded256d64f..51ea7cdc67 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -485,7 +485,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :செய்த STR_NEWS_MENU_DELETE_ALL_MESSAGES :எல்லா செய்திகளையும் நீக்கு # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :நிலா பகுதி விவரம் STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :முனையத்தை மாற்று @@ -1291,6 +1291,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :ஒன்று STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :குறைக்கப்பட்ட STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :இயல்பான + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :வழிசெல்லக்கூடிய சாலை நிறுத்தங்களை நகராட்சியின் சாலைகளில் அமைக்க அனுமதி: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :நகரத்திற்குச் சொந்தமான சாலைகளில் டிரைவ்-த்ரோ சாலை நிறுத்தங்களை உருவாக்க அனுமதிக்கவும் STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}வாகனங்கள் இருக்கும் பொது இந்த அமைப்பினை மாற்ற இயலாது @@ -1883,6 +1884,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}ஆட STR_ABANDON_GAME_QUERY :{YELLOW}நீங்கள் இந்த ஆட்டத்தினை விட்டு வெளியேறுவதில் உறுதியா? STR_ABANDON_SCENARIO_QUERY :{YELLOW}நீங்கள் இந்த சித்திரக்காட்சியினை விட்டு வெளியேறுவதில் உறுதியா? +# Help window + # Cheat window STR_CHEATS :{WHITE}ஏமாற்றுகள் STR_CHEATS_NOTE :{BLACK}குறிப்பு: இந்த அமைப்புகளின் எந்தவொரு பயன்பாடும் பதிவு செய்யப்படும் @@ -4140,7 +4143,7 @@ STR_TEXTFILE_WRAP_TEXT :{WHITE}உர STR_TEXTFILE_VIEW_README :{BLACK}படிக்க வேண்டியதை பார்வையிடு STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}மாற்றங்கள் பதிவேடு STR_TEXTFILE_VIEW_LICENCE :{BLACK}அனுமதி -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} {STRING} இன் படிப்பு அறி STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} {STRING} இன் மாற்றங்கள் பதிவேடு STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} {STRING} இன் அனுமதி diff --git a/src/lang/thai.txt b/src/lang/thai.txt index d865b51cbb..e7330d49a0 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -479,7 +479,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :ข้อคว STR_NEWS_MENU_MESSAGE_HISTORY_MENU :ดูข้อความย้อนหลัง # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :ข้อมูลพื้นที่ STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :เปิด/ปิด คอนโซล @@ -1303,6 +1303,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :ไม่มี STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :ลดลง STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :ปกติ + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :อนุญาตให้มีที่หยุดรถแบบขับผ่านบนถนนที่เมืองเป็นเจ้าของ: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :สามารถสร้างป้ายหยุดรถบนถนนของเมืองได้ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :อนุญาตให้มีที่หยุดรถแบบขับผ่านบนถนนของบริษัทอื่นๆ: {STRING} @@ -1962,6 +1963,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}ออ STR_ABANDON_GAME_QUERY :{YELLOW}เกมยังดำเนินอยู่แน่ใจหรือไม่ว่าจะกลับไปสู่เมนูหลัก? STR_ABANDON_SCENARIO_QUERY :{YELLOW}คุณแน่ใจหรือที่จะยกเลิกแผนที่นี้? +# Help window + # Cheat window STR_CHEATS :{WHITE}สูตรโกงเกม STR_CHEATS_TOOLTIP :{BLACK}กล่องตัวเลือกจะแสดงว่าคุณโกงมาก่อนหรือไม่ @@ -4272,7 +4275,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}จั STR_TEXTFILE_VIEW_README :{BLACK}แสดง readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}ข้อมูลการอัพเดต STR_TEXTFILE_VIEW_LICENCE :{BLACK}การอนุญาต -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} readme ของ {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} changelog ของ {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} การอนุญาตของ {STRING} diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index e051a6c260..0222803ef6 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -503,7 +503,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :訊息記錄 STR_NEWS_MENU_DELETE_ALL_MESSAGES :刪除所有訊息 # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :土地資訊 STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :切換主控台 @@ -1380,6 +1380,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :無 STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :減少 STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :正常 + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :可在市鎮所屬道路上建設路邊車站:{STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :容許在市鎮擁有的道路上建造直通型車站。 STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :可在競爭對手所有的道路上建設路邊車站:{STRING} @@ -2105,6 +2106,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}放棄 STR_ABANDON_GAME_QUERY :{YELLOW}你要放棄這個遊戲嗎? STR_ABANDON_SCENARIO_QUERY :{YELLOW}你確定要離開這個場景嗎? +# Help window + # Cheat window STR_CHEATS :{WHITE}作弊 STR_CHEATS_TOOLTIP :{BLACK}方塊被勾選代表您用過這個密技 @@ -4623,7 +4626,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}強迫 STR_TEXTFILE_VIEW_README :{BLACK}檢視Readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}修訂紀錄 STR_TEXTFILE_VIEW_LICENCE :{BLACK}授權條款 -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING}{STRING}的 Readme STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING}{STRING}的修訂紀錄 STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING}{STRING}的授權條款 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 0ac18bb857..8ffee75036 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -522,8 +522,9 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Mesaj geçmişi STR_NEWS_MENU_DELETE_ALL_MESSAGES :Tüm mesajları sil # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Arazi bilgisi +STR_ABOUT_MENU_HELP :Yardım & Kılavuzlar STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Konsolu aç/kapa STR_ABOUT_MENU_AI_DEBUG :YZ/Oyun betik hata ayıklama @@ -1427,6 +1428,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Hiç STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Azaltılmış STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Rakiplere ait karayolları veya demiryolları ile hemzemin geçitlere izin ver: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Rakiplerin sahip olduğu yol veya raylarda hemzemin geçitlerin inşasına izin verilmesi + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Kasabaların sahip olduğu yollarda arabalı yol duraklarına izin ver: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Kasabaların sahip olduğu yollarda arabalı yol duraklarının inşasına izin ver STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Rakiplerin yolu üzerinde durak yapmaya izin ver: {STRING} @@ -2122,6 +2126,7 @@ STR_INTRO_MULTIPLAYER :{BLACK}Çok Oyu STR_INTRO_GAME_OPTIONS :{BLACK}Seçenekler STR_INTRO_HIGHSCORE :{BLACK}Puan Tablosu +STR_INTRO_HELP :{BLACK}Yardım ve Kılavuzlar STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Ayarlar STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Ayarları STR_INTRO_ONLINE_CONTENT :{BLACK}Çevrimiçi İçeriği Kontrol Et @@ -2143,6 +2148,7 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}'Oyuncak STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Seçenekleri göster STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Puan tablosunu göster +STR_INTRO_TOOLTIP_HELP :{BLACK}Belgelere ve çevrimiçi kaynaklara erişin STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Görüntü ayarları STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF ayarlarını göster STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}İndirilecek yeni ve güncellenmiş içeriği kontrol et @@ -2164,6 +2170,19 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Oyunu Te STR_ABANDON_GAME_QUERY :{YELLOW}Bu oyunu terk etmek istediğinize emin misiniz? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Bu senaryoyu terk etmek istediğinize emin misiniz? +# Help window +STR_HELP_WINDOW_CAPTION :{WHITE}Yardım & Kılavuzlar +STR_HELP_WINDOW_WEBSITES :{BLACK}Websiteler +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Belgeler +STR_HELP_WINDOW_README :{BLACK}Beni oku +STR_HELP_WINDOW_CHANGELOG :{BLACK}Değişiklik günlüğü +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Bilinen Hatalar +STR_HELP_WINDOW_LICENSE :{BLACK}Lisans +STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD +STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Kılavuz / Wiki +STR_HELP_WINDOW_BUGTRACKER :{BLACK}Hata Bildir +STR_HELP_WINDOW_COMMUNITY :{BLACK}Toplum + # Cheat window STR_CHEATS :{WHITE}Hileler STR_CHEATS_TOOLTIP :{BLACK}Onay kutuları bu hilenin daha önce kullanılıp kullanmadığını bildirir. @@ -4697,16 +4716,22 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST :{WHITE}İçerik Tabelası +STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Bu liste aracılığıyla görüntülenen dosyadaki bir bölüme hızlı bir şekilde atlayın +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} +STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Gezinme geçmişine geri dönme +STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Gezinme geçmişinde ileri dönme STR_TEXTFILE_WRAP_TEXT :{WHITE}Metni kaydır STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Metni, okumak için gezinmeyi önlemek üzere kaydır STR_TEXTFILE_VIEW_README :{BLACK}Benioku dosyasını göster STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Değişiklik kayıtları STR_TEXTFILE_VIEW_LICENCE :{BLACK}Lisans -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} adlı {STRING}'nin benioku dosyası STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} adlı {STRING}'nin değişiklik kaydı STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} adlı {STRING}'nin lisansı STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Anket sonucunun önizlemesi +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD belgesi '{STRING}' # Vehicle loading indicators diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 43eb39c60d..f7aad014e1 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -629,7 +629,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Історія STR_NEWS_MENU_DELETE_ALL_MESSAGES :Видалити всі повідомлення # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Інформація про ділянку STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Вкл./відкл. консоль @@ -1528,6 +1528,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Немає STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Низька STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Нормальна + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Дозволити встановлення зупинок на дорогах міста: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Дозволяє встановлення зупинок на дорогах, якими володіє місто. STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Дозволити встановлення зупинок на дорогах конкурентів: {STRING} @@ -2255,6 +2256,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Поки STR_ABANDON_GAME_QUERY :{YELLOW}Ви дійсно хочете покинути гру? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Ви дійсно бажаєте вийти з цього сценарію? +# Help window + # Cheat window STR_CHEATS :{WHITE}Гратиму нечесно STR_CHEATS_TOOLTIP :{BLACK}Галка показує, що Ви стали грати нечесно @@ -4783,7 +4786,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Розм STR_TEXTFILE_VIEW_README :{BLACK}Інструкція STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Зміни STR_TEXTFILE_VIEW_LICENCE :{BLACK}Ліцензія -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Документація до {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Зміни в {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Ліцензія до {STRING} {STRING} diff --git a/src/lang/urdu.txt b/src/lang/urdu.txt index edf2f30855..491b42184f 100644 --- a/src/lang/urdu.txt +++ b/src/lang/urdu.txt @@ -456,7 +456,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :پچھلا پی STR_NEWS_MENU_MESSAGE_HISTORY_MENU :تاریخِ پیغامات # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :زمینی رقبہ کی معلومات STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :حائطھ تدویم @@ -1158,6 +1158,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :کوئی نہی STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :کم STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :نارمل + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :شہر کی ملکیت سڑکوں پر ڈرائیو تھرو اڈے بنانے کی اجازت: {STRING} STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :مد مقابلوں کی ملکیت سڑکوں پر ڈرائیو تھرو اڈے بنانے کی اجازت: {STRING} STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}جب گاڑیاں موجود ہوں تو یہ سیٹنگ بدلنا ممکن نہیں @@ -1565,6 +1566,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}کھیل STR_ABANDON_GAME_QUERY :{YELLOW}کیا آپ کو یقین ہے کہ آپ اس کھیل کو چھوڑنا چاہ رہے ہیں؟ STR_ABANDON_SCENARIO_QUERY :{YELLOW}کیا آپ کو یقین ہے کہ آپ اس scenario کو چھوڑنا چاہ رہے ہیں؟ +# Help window + # Cheat window STR_CHEATS :{WHITE}دھوکے STR_CHEATS_TOOLTIP :{BLACK}چیک باکسز سے ظاہر ہوتا ہے کہ آپ نے یہ دھوکا پہلے بھی کیا یے @@ -2735,7 +2738,7 @@ STR_AI_CONFIG_GAMESCRIPT :{SILVER}کھی STR_TEXTFILE_VIEW_README :{BLACK}مجھے پڑھیے فائل دیکھیں STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}تبدیلیوں کا ریکارڈ STR_TEXTFILE_VIEW_LICENCE :{BLACK}لائسنس -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} میں سے {STRING} مجھے پڑھیے STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} میں سے {STRING} تبدیلی کا ریکارڈ STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} میں سے {STRING} لائسنس diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index df19d6e25f..0d54733222 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -521,7 +521,7 @@ STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Thông báo cũ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Xoá tất cả thông điệp # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Thông tin vùng đất STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Bật/tắt bảng lệnh @@ -783,7 +783,7 @@ STR_SMALLMAP_LEGENDA_AIRCRAFT :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES :{TINY_FONT}{BLACK}Tuyến vận tải STR_SMALLMAP_LEGENDA_FOREST :{TINY_FONT}{BLACK}Rừng STR_SMALLMAP_LEGENDA_RAILROAD_STATION :{TINY_FONT}{BLACK}Ga tàu hỏa -STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Truck Loading Bay +STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Trạm bốc dỡ hàng xe tải STR_SMALLMAP_LEGENDA_BUS_STATION :{TINY_FONT}{BLACK}Bến xe buýt STR_SMALLMAP_LEGENDA_AIRPORT_HELIPORT :{TINY_FONT}{BLACK}Sân bay/Bãi đỗ trực thăng STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLACK}Cảng biển @@ -1426,6 +1426,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :không* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :giảm bớt STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :bình thường +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Cho phép đường cắt ngang trên đường trường hoặc đường ray sở hữu bởi công ty khác: {STRING} +STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Cho phép xây dựng đường cắt ngang trên đường trường hoặc đường ray sở hữu bởi công ty khác + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Cho phép xây điểm dừng xe buýt trên đường sở hữu bởi thị trấn: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Cho phép xây dựng điểm dừng xe buýt trên đường thuộc sở hữu của địa phương STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Cho phép xây điểm dừng xe buýt trên đường của đối thủ: {STRING} @@ -1896,8 +1899,8 @@ STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Cho phép đô STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Đô thị cho phép xây giao nhau đồng mức: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Bật tùy chọn này cho phép đô thị xây giao nhau đồng mức -STR_CONFIG_SETTING_NOISE_LEVEL :Cho phép chính quyền địa phương kiểm soát độ ồn của sân bay: {STRING} -STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Nếu tắt tùy chọn này, mỗi đô thị chỉ xây được 2 sân bay. Nếu bật tùy chọn này, số lượng sân bay được giới hạn bởi độ ồn cho phép của đô thị, dựa vào dân số, quy mô sân bay và khoảng cách +STR_CONFIG_SETTING_NOISE_LEVEL :Giới hạn vị trí xây sân bay dựa vào độ ồn: {STRING} +STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Cho phép đô thị từ chối việc xây dựng sân bay dựa vào độ ồn cho phép của họ, được tính trên lượng dân số của đô thị và khoảng cách, kích thước của sân bay. Nếu thiết lập này được tắt, đô thị chỉ cho phép hai sân bay trừ khi thái độ của địa phương đang ở trạng thái "Dễ dãi" STR_CONFIG_SETTING_TOWN_FOUNDING :Thành lập đô thị trong ván chơi: {STRING} STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Bật tùy chọn này cho phép người chơi tạo lập đô thị mới trong màn chơi @@ -2163,6 +2166,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Bỏ Mà STR_ABANDON_GAME_QUERY :{YELLOW}Bạn có chắc chắn muốn bỏ màn chơi này không? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Bạn có chắc bạn muốn bỏ màn chơi kịch bản này? +# Help window + # Cheat window STR_CHEATS :{WHITE}Cheats STR_CHEATS_TOOLTIP :{BLACK}Ô đánh dấu cho biết nếu bạn đã từng dùng mã ăn gian đó @@ -2644,12 +2649,13 @@ STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Thoát O STR_TRANSPARENCY_CAPTION :{WHITE}Tuỳ Hiệu Ứng Trong Suốt STR_TRANSPARENT_SIGNS_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho đèn tín hiệu. Ctrl+Click để khoá. STR_TRANSPARENT_TREES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho cây cối. Ctrl+Click để khoá. -STR_TRANSPARENT_HOUSES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho nhà cửa. Ctrl+Click để khoá. -STR_TRANSPARENT_INDUSTRIES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho nhà máy. Ctrl+Click để khoá. -STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho các công trình nhà ga, xưởng và điểm mốc. Ctrl+Click để khoá. -STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho cầu. Ctrl+Click để khoá. +STR_TRANSPARENT_HOUSES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho nhà cửa. Ctrl+Click để khoá +STR_TRANSPARENT_INDUSTRIES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho nhà máy. Ctrl+Click để khoá +STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho các công trình nhà ga, xưởng và điểm mốc. Ctrl+Click để khoá +STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho cầu. Ctrl+Click để khoá STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho đèn biển, ăn-ten... Ctrl+Click để khoá. -STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho các mắt xích. Ctrl+Click để khoá. +STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho các mắt xích. Ctrl+Click để khoá +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Bật hiệu ứng trong suốt cho thông báo tải và chi phí/thu nhập. Ctrl+Click để khoá STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Đặt các đối ẩn đi thay vì trong suốt # Linkgraph legend window @@ -4700,7 +4706,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Ép ch STR_TEXTFILE_VIEW_README :{BLACK}Xem readme STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Lịch sử thay đổi STR_TEXTFILE_VIEW_LICENCE :{BLACK}Giấy phép -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Readme của {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Lịch sử thay đổi của {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Giấy phép của {STRING} {STRING} diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index 95035f7fbf..bde76db59b 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -482,7 +482,7 @@ STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Neges/Adroddiad STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Hanes negeseuon # About menu -###length 10 +###length 11 STR_ABOUT_MENU_LAND_BLOCK_INFO :Gwybodaeth ardal tir STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Toglu Consol @@ -1329,6 +1329,7 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Dim STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Llai STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Arferol + STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Caniatáu arosfannau gyrru-trwodd ar ffyrdd sy'n eiddo i drefi: {STRING} STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Caniatáu adeiladu arosfannau gyrru-trwodd ar ffyrdd sy'n eiddo i drefi STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Caniatáu arosfannau gyrru-trwodd ar ffyrdd sy'n eiddo i gystadleuwyr: {STRING} @@ -1998,6 +1999,8 @@ STR_ABANDON_GAME_CAPTION :{WHITE}Rhoi'r g STR_ABANDON_GAME_QUERY :{YELLOW}Ydych chi'n siwr eich bod chi eisiau rhoi'r gorau i'r gêm? STR_ABANDON_SCENARIO_QUERY :{YELLOW}Ydych chi'n siwr eich bod chi eisiau gadael y senario hwn? +# Help window + # Cheat window STR_CHEATS :{WHITE}Twyllo STR_CHEATS_TOOLTIP :{BLACK}Mae'r blychau marcio'n dangos os ydych chi wedi twyllo neu beidio, gan nodi sut @@ -4302,7 +4305,7 @@ STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Amlapio STR_TEXTFILE_VIEW_README :{BLACK}Gweld dogfenyddiaeth STR_TEXTFILE_VIEW_CHANGELOG :{BLACK}Log Newidiadau STR_TEXTFILE_VIEW_LICENCE :{BLACK}Trwydded -###length 4 +###length 5 STR_TEXTFILE_README_CAPTION :{WHITE}Dogfenyddiaeth {STRING} {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Log newidiadau {STRING} {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Trwydded {STRING} {STRING} diff --git a/src/league_gui.cpp b/src/league_gui.cpp index 7a0b2c9b3b..f97a041604 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -200,7 +200,7 @@ static WindowDesc _performance_league_desc( WDP_AUTO, "performance_league", 0, 0, WC_COMPANY_LEAGUE, WC_NONE, 0, - _nested_performance_league_widgets, lengthof(_nested_performance_league_widgets) + std::begin(_nested_performance_league_widgets), std::end(_nested_performance_league_widgets) ); void ShowPerformanceLeagueTable() @@ -432,7 +432,7 @@ static WindowDesc _script_league_desc( WDP_AUTO, "script_league", 0, 0, WC_COMPANY_LEAGUE, WC_NONE, 0, - _nested_script_league_widgets, lengthof(_nested_script_league_widgets) + std::begin(_nested_script_league_widgets), std::end(_nested_script_league_widgets) ); void ShowScriptLeagueTable(LeagueTableID table) diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index ac918a6345..b6081591a1 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -722,7 +722,7 @@ static WindowDesc _linkgraph_legend_desc( WDP_AUTO, "toolbar_linkgraph", 0, 0, WC_LINKGRAPH_LEGEND, WC_NONE, 0, - _nested_linkgraph_legend_widgets, lengthof(_nested_linkgraph_legend_widgets) + std::begin(_nested_linkgraph_legend_widgets), std::end(_nested_linkgraph_legend_widgets) ); /** diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 36992fd7af..e76b207fb8 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -609,7 +609,7 @@ static WindowDesc _main_window_desc( WDP_MANUAL, nullptr, 0, 0, WC_MAIN_WINDOW, WC_NONE, WDF_NO_CLOSE, - _nested_main_window_widgets, lengthof(_nested_main_window_widgets), + std::begin(_nested_main_window_widgets), std::end(_nested_main_window_widgets), &MainWindow::hotkeys ); diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index e626d5c720..fc7b9c76dc 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -63,7 +63,7 @@ static WindowDesc _land_info_desc( WDP_AUTO, nullptr, 0, 0, WC_LAND_INFO, WC_NONE, 0, - _nested_land_info_widgets, lengthof(_nested_land_info_widgets) + std::begin(_nested_land_info_widgets), std::end(_nested_land_info_widgets) ); class LandInfoWindow : public Window { @@ -433,7 +433,7 @@ static WindowDesc _about_desc( WDP_CENTER, nullptr, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, - _nested_about_widgets, lengthof(_nested_about_widgets) + std::begin(_nested_about_widgets), std::end(_nested_about_widgets) ); static const char * const _credits[] = { @@ -704,7 +704,7 @@ static WindowDesc _tool_tips_desc( WDP_MANUAL, nullptr, 0, 0, // Coordinates and sizes are not used, WC_TOOLTIPS, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, - _nested_tooltips_widgets, lengthof(_nested_tooltips_widgets) + std::begin(_nested_tooltips_widgets), std::end(_nested_tooltips_widgets) ); /** Window for displaying a tooltip. */ @@ -1161,7 +1161,7 @@ static WindowDesc _query_string_desc( WDP_CENTER, nullptr, 0, 0, WC_QUERY_STRING, WC_NONE, 0, - _nested_query_string_widgets, lengthof(_nested_query_string_widgets) + std::begin(_nested_query_string_widgets), std::end(_nested_query_string_widgets) ); /** @@ -1338,7 +1338,7 @@ static WindowDesc _query_desc( WDP_CENTER, nullptr, 0, 0, WC_CONFIRM_POPUP_QUERY, WC_NONE, WDF_MODAL, - _nested_query_widgets, lengthof(_nested_query_widgets) + std::begin(_nested_query_widgets), std::end(_nested_query_widgets) ); static void RemoveExistingQueryWindow(Window *parent, QueryCallbackProc *callback) @@ -1471,7 +1471,7 @@ static WindowDesc _modifier_key_toggle_desc( WDP_AUTO, "modifier_key_toggle", 0, 0, WC_MODIFIER_KEY_TOGGLE, WC_NONE, WDF_NO_FOCUS, - _modifier_key_toggle_widgets, lengthof(_modifier_key_toggle_widgets) + std::begin(_modifier_key_toggle_widgets), std::end(_modifier_key_toggle_widgets) ); void ShowModifierKeyToggleWindow() diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 673927e416..2ec98be793 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -653,7 +653,7 @@ static WindowDesc _music_track_selection_desc( WDP_AUTO, nullptr, 0, 0, WC_MUSIC_TRACK_SELECTION, WC_NONE, 0, - _nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets) + std::begin(_nested_music_track_selection_widgets), std::end(_nested_music_track_selection_widgets) ); static void ShowMusicTrackSelection() @@ -913,7 +913,7 @@ static WindowDesc _music_window_desc( WDP_AUTO, "music", 0, 0, WC_MUSIC_WINDOW, WC_NONE, 0, - _nested_music_window_widgets, lengthof(_nested_music_window_widgets) + std::begin(_nested_music_window_widgets), std::end(_nested_music_window_widgets) ); void ShowMusicWindow() diff --git a/src/network/core/CMakeLists.txt b/src/network/core/CMakeLists.txt index 9e7a2ed506..b547b6fa95 100644 --- a/src/network/core/CMakeLists.txt +++ b/src/network/core/CMakeLists.txt @@ -5,8 +5,8 @@ add_files( config.h core.cpp core.h - game_info.cpp - game_info.h + network_game_info.cpp + network_game_info.h host.cpp host.h http.h diff --git a/src/network/core/config.h b/src/network/core/config.h index 1a6d482bf2..d8c76b28f3 100644 --- a/src/network/core/config.h +++ b/src/network/core/config.h @@ -62,7 +62,7 @@ static const uint NETWORK_LONG_REVISION_LENGTH = 64; ///< The m static const uint NETWORK_PASSWORD_LENGTH = 33; ///< The maximum length of the password, in bytes including '\0' (must be >= NETWORK_SERVER_ID_LENGTH) static const uint NETWORK_CLIENT_NAME_LENGTH = 25; ///< The maximum length of a client's name, in bytes including '\0' static const uint NETWORK_RCONCOMMAND_LENGTH = 500; ///< The maximum length of a rconsole command, in bytes including '\0' -static const uint NETWORK_GAMESCRIPT_JSON_LENGTH = COMPAT_MTU - 3; ///< The maximum length of a gamescript json string, in bytes including '\0'. Must not be longer than COMPAT_MTU including header (3 bytes) +static const uint NETWORK_GAMESCRIPT_JSON_LENGTH = 9000; ///< The maximum length of a receiving gamescript json string, in bytes including '\0'. static const uint NETWORK_CHAT_LENGTH = 900; ///< The maximum length of a chat message, in bytes including '\0' static const uint NETWORK_CONTENT_FILENAME_LENGTH = 48; ///< The maximum length of a content's filename, in bytes including '\0'. static const uint NETWORK_CONTENT_NAME_LENGTH = 64; ///< The maximum length of a content's name, in bytes including '\0'. diff --git a/src/network/core/game_info.cpp b/src/network/core/network_game_info.cpp similarity index 99% rename from src/network/core/game_info.cpp rename to src/network/core/network_game_info.cpp index 18acbb52d0..972c3a6660 100644 --- a/src/network/core/game_info.cpp +++ b/src/network/core/network_game_info.cpp @@ -10,7 +10,7 @@ */ #include "../../stdafx.h" -#include "game_info.h" +#include "network_game_info.h" #include "../../core/bitmath_func.hpp" #include "../../company_base.h" #include "../../date_func.h" diff --git a/src/network/core/game_info.h b/src/network/core/network_game_info.h similarity index 100% rename from src/network/core/game_info.h rename to src/network/core/network_game_info.h diff --git a/src/network/core/tcp_coordinator.h b/src/network/core/tcp_coordinator.h index 9f2731b7c8..a9d9a430cf 100644 --- a/src/network/core/tcp_coordinator.h +++ b/src/network/core/tcp_coordinator.h @@ -15,7 +15,7 @@ #include "os_abstraction.h" #include "tcp.h" #include "packet.h" -#include "game_info.h" +#include "network_game_info.h" /** * Enum with all types of TCP Game Coordinator packets. The order MUST not be changed. diff --git a/src/network/core/tcp_turn.h b/src/network/core/tcp_turn.h index 0823731993..36afa8bcb1 100644 --- a/src/network/core/tcp_turn.h +++ b/src/network/core/tcp_turn.h @@ -15,7 +15,7 @@ #include "os_abstraction.h" #include "tcp.h" #include "packet.h" -#include "game_info.h" +#include "network_game_info.h" /** Enum with all types of TCP TURN packets. The order MUST not be changed. **/ enum PacketTurnType { diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index e4aa04e23b..5fcf121365 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -10,7 +10,7 @@ #include "../stdafx.h" #include "../strings_func.h" #include "../date_func.h" -#include "core/game_info.h" +#include "core/network_game_info.h" #include "network_admin.h" #include "network_base.h" #include "network_server.h" @@ -22,6 +22,8 @@ #include "../rev.h" #include "../game/game.hpp" +#include + #include "../safeguards.h" @@ -382,10 +384,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyEconomy() { for (const Company *company : Company::Iterate()) { /* Get the income. */ - Money income = 0; - for (uint i = 0; i < lengthof(company->yearly_expenses[0]); i++) { - income -= company->yearly_expenses[0][i]; - } + Money income = -std::reduce(std::begin(company->yearly_expenses[0]), std::end(company->yearly_expenses[0])); Packet *p = new Packet(ADMIN_PACKET_SERVER_COMPANY_ECONOMY); @@ -556,11 +555,6 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendConsole(const std::string */ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendGameScript(const std::string_view json) { - /* At the moment we cannot transmit anything larger than MTU. So we limit - * the maximum amount of json data that can be sent. Account also for - * the trailing \0 of the string */ - if (json.size() + 1 >= NETWORK_GAMESCRIPT_JSON_LENGTH) return NETWORK_RECV_STATUS_OKAY; - Packet *p = new Packet(ADMIN_PACKET_SERVER_GAMESCRIPT); p->Send_string(json); diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 21fb2e23cd..11aba02958 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -522,7 +522,7 @@ static WindowDesc _chat_window_desc( WDP_MANUAL, nullptr, 0, 0, WC_SEND_NETWORK_MSG, WC_NONE, WDF_NETWORK, - _nested_chat_window_widgets, lengthof(_nested_chat_window_widgets) + std::begin(_nested_chat_window_widgets), std::end(_nested_chat_window_widgets) ); diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 652872e8a8..30f9d72ff6 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -97,7 +97,7 @@ static WindowDesc _network_content_download_status_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, - _nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets) + std::begin(_nested_network_content_download_status_window_widgets), std::end(_nested_network_content_download_status_window_widgets) ); BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow(WindowDesc *desc) : @@ -1117,7 +1117,7 @@ static WindowDesc _network_content_list_desc( WDP_CENTER, "list_content", 630, 460, WC_NETWORK_WINDOW, WC_NONE, 0, - _nested_network_content_list_widgets, lengthof(_nested_network_content_list_widgets) + std::begin(_nested_network_content_list_widgets), std::end(_nested_network_content_list_widgets) ); /** diff --git a/src/network/network_gamelist.h b/src/network/network_gamelist.h index 1c4a68e5c7..cabedd8ff7 100644 --- a/src/network/network_gamelist.h +++ b/src/network/network_gamelist.h @@ -11,7 +11,7 @@ #define NETWORK_GAMELIST_H #include "core/address.h" -#include "core/game_info.h" +#include "core/network_game_info.h" #include "network_type.h" /** The status a server can be in. */ diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 875b4d02cd..af7152984d 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1030,7 +1030,7 @@ static WindowDesc _network_game_window_desc( WDP_CENTER, "list_servers", 1000, 730, WC_NETWORK_WINDOW, WC_NONE, WDF_NETWORK, - _nested_network_game_widgets, lengthof(_nested_network_game_widgets) + std::begin(_nested_network_game_widgets), std::end(_nested_network_game_widgets) ); void ShowNetworkGameWindow() @@ -1303,7 +1303,7 @@ static WindowDesc _network_start_server_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_WINDOW, WC_NONE, WDF_NETWORK, - _nested_network_start_server_window_widgets, lengthof(_nested_network_start_server_window_widgets) + std::begin(_nested_network_start_server_window_widgets), std::end(_nested_network_start_server_window_widgets) ); static void ShowNetworkStartServerWindow() @@ -1382,7 +1382,7 @@ static WindowDesc _client_list_desc( WDP_AUTO, "list_clients", 220, 300, WC_CLIENT_LIST, WC_NONE, WDF_NETWORK, - _nested_client_list_widgets, lengthof(_nested_client_list_widgets) + std::begin(_nested_client_list_widgets), std::end(_nested_client_list_widgets) ); /** @@ -2297,7 +2297,7 @@ static WindowDesc _network_join_status_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL | WDF_NETWORK, - _nested_network_join_status_window_widgets, lengthof(_nested_network_join_status_window_widgets) + std::begin(_nested_network_join_status_window_widgets), std::end(_nested_network_join_status_window_widgets) ); void ShowJoinStatusWindow() @@ -2419,7 +2419,7 @@ static WindowDesc _network_company_password_window_desc( WDP_AUTO, nullptr, 0, 0, WC_COMPANY_PASSWORD_WINDOW, WC_NONE, WDF_NETWORK, - _nested_network_company_password_window_widgets, lengthof(_nested_network_company_password_window_widgets) + std::begin(_nested_network_company_password_window_widgets), std::end(_nested_network_company_password_window_widgets) ); void ShowNetworkCompanyPasswordWindow(Window *parent) @@ -2522,7 +2522,7 @@ static WindowDesc _network_ask_relay_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_ASK_RELAY, WC_NONE, WDF_MODAL | WDF_NETWORK, - _nested_network_ask_relay_widgets, lengthof(_nested_network_ask_relay_widgets) + std::begin(_nested_network_ask_relay_widgets), std::end(_nested_network_ask_relay_widgets) ); /** @@ -2620,7 +2620,7 @@ static WindowDesc _network_ask_survey_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_ASK_SURVEY, WC_NONE, WDF_MODAL, - _nested_network_ask_survey_widgets, lengthof(_nested_network_ask_survey_widgets) + std::begin(_nested_network_ask_survey_widgets), std::end(_nested_network_ask_survey_widgets) ); /** diff --git a/src/network/network_query.cpp b/src/network/network_query.cpp index 3c9e92b1c1..b081d5d448 100644 --- a/src/network/network_query.cpp +++ b/src/network/network_query.cpp @@ -8,7 +8,7 @@ /** @file network_query.cpp Query part of the network protocol. */ #include "../stdafx.h" -#include "core/game_info.h" +#include "core/network_game_info.h" #include "network_query.h" #include "network_gamelist.h" #include "../error.h" diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index de8d78ef2a..7e8cec6f43 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -10,7 +10,7 @@ #include "../stdafx.h" #include "../strings_func.h" #include "../date_func.h" -#include "core/game_info.h" +#include "core/network_game_info.h" #include "network_admin.h" #include "network_server.h" #include "network_udp.h" diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 59d304dea6..3393f90339 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -16,7 +16,7 @@ #include "../date_func.h" #include "../map_func.h" #include "../debug.h" -#include "core/game_info.h" +#include "core/network_game_info.h" #include "network_gamelist.h" #include "network_internal.h" #include "network_udp.h" diff --git a/src/newgrf.cpp b/src/newgrf.cpp index b6cdad337d..562c5141fb 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4446,7 +4446,7 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, const { ChangeInfoResult ret = CIR_SUCCESS; - extern RailtypeInfo _railtypes[RAILTYPE_END]; + extern RailTypeInfo _railtypes[RAILTYPE_END]; if (id + numinfo > RAILTYPE_END) { grfmsg(1, "RailTypeChangeInfo: Rail type %u is invalid, max %u, ignoring", id + numinfo, RAILTYPE_END); @@ -4457,7 +4457,7 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, const RailType rt = _cur.grffile->railtype_map[id + i]; if (rt == INVALID_RAILTYPE) return CIR_INVALID_ID; - RailtypeInfo *rti = &_railtypes[rt]; + RailTypeInfo *rti = &_railtypes[rt]; switch (prop) { case 0x08: // Label of rail type @@ -4606,7 +4606,7 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, cons { ChangeInfoResult ret = CIR_SUCCESS; - extern RailtypeInfo _railtypes[RAILTYPE_END]; + extern RailTypeInfo _railtypes[RAILTYPE_END]; if (id + numinfo > RAILTYPE_END) { grfmsg(1, "RailTypeReserveInfo: Rail type %u is invalid, max %u, ignoring", id + numinfo, RAILTYPE_END); @@ -6753,10 +6753,10 @@ static void RailTypeMapSpriteGroup(ByteReader *buf, uint8 idcount) if (ctype >= RTSG_END) continue; - extern RailtypeInfo _railtypes[RAILTYPE_END]; + extern RailTypeInfo _railtypes[RAILTYPE_END]; for (uint i = 0; i < idcount; i++) { if (railtypes[i] != INVALID_RAILTYPE) { - RailtypeInfo *rti = &_railtypes[railtypes[i]]; + RailTypeInfo *rti = &_railtypes[railtypes[i]]; rti->grffile[ctype] = _cur.grffile; rti->group[ctype] = GetGroupByID(groupid); @@ -8504,7 +8504,7 @@ static void ParamSet(ByteReader *buf) break; case 0x8F: { // Rail track type cost factors - extern RailtypeInfo _railtypes[RAILTYPE_END]; + extern RailTypeInfo _railtypes[RAILTYPE_END]; _railtypes[RAILTYPE_RAIL].cost_multiplier = GB(res, 0, 8); if (_settings_game.vehicle.disable_elrails) { _railtypes[RAILTYPE_ELECTRIC].cost_multiplier = GB(res, 0, 8); diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 3fe570a957..2be0f628dd 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -1109,14 +1109,14 @@ static WindowDesc _newgrf_inspect_chain_desc( WDP_AUTO, "newgrf_inspect_chain", 400, 300, WC_NEWGRF_INSPECT, WC_NONE, 0, - _nested_newgrf_inspect_chain_widgets, lengthof(_nested_newgrf_inspect_chain_widgets) + std::begin(_nested_newgrf_inspect_chain_widgets), std::end(_nested_newgrf_inspect_chain_widgets) ); static WindowDesc _newgrf_inspect_desc( WDP_AUTO, "newgrf_inspect", 400, 300, WC_NEWGRF_INSPECT, WC_NONE, 0, - _nested_newgrf_inspect_widgets, lengthof(_nested_newgrf_inspect_widgets) + std::begin(_nested_newgrf_inspect_widgets), std::end(_nested_newgrf_inspect_widgets) ); /** @@ -1576,7 +1576,7 @@ static WindowDesc _sprite_aligner_desc( WDP_AUTO, "sprite_aligner", 400, 300, WC_SPRITE_ALIGNER, WC_NONE, 0, - _nested_sprite_aligner_widgets, lengthof(_nested_sprite_aligner_widgets) + std::begin(_nested_sprite_aligner_widgets), std::end(_nested_sprite_aligner_widgets) ); /** diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 001af9f225..eef69c1141 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -724,7 +724,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, return 0x1FF | ((GetRailTypeInfo(Train::From(v)->railtype)->flags & RTFB_CATENARY) ? 0x200 : 0); } RailType rt = GetTileRailTypeByTrackBit(v->tile, Train::From(v)->track); - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); return ((rti->flags & RTFB_CATENARY) ? 0x200 : 0) | (HasPowerOnRail(Train::From(v)->railtype, rt) ? 0x100 : 0) | GetReverseRailTypeTranslation(rt, object->ro.grffile); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 00f88f65cb..498552b5c0 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -554,7 +554,7 @@ static WindowDesc _newgrf_parameters_desc( WDP_CENTER, "settings_newgrf_config", 500, 208, WC_GRF_PARAMETERS, WC_NONE, 0, - _nested_newgrf_parameter_widgets, lengthof(_nested_newgrf_parameter_widgets) + std::begin(_nested_newgrf_parameter_widgets), std::end(_nested_newgrf_parameter_widgets) ); static void OpenGRFParameterWindow(GRFConfig *c, bool editable) @@ -1959,13 +1959,13 @@ static const NWidgetPart _nested_newgrf_infopanel_widgets[] = { /** Construct nested container widget for managing the lists and the info panel of the NewGRF GUI. */ NWidgetBase* NewGRFDisplay(int *biggest_index) { - NWidgetBase *avs = MakeNWidgets(_nested_newgrf_availables_widgets, lengthof(_nested_newgrf_availables_widgets), biggest_index, nullptr); + NWidgetBase *avs = MakeNWidgets(std::begin(_nested_newgrf_availables_widgets), std::end(_nested_newgrf_availables_widgets), biggest_index, nullptr); int biggest2; - NWidgetBase *acs = MakeNWidgets(_nested_newgrf_actives_widgets, lengthof(_nested_newgrf_actives_widgets), &biggest2, nullptr); + NWidgetBase *acs = MakeNWidgets(std::begin(_nested_newgrf_actives_widgets), std::end(_nested_newgrf_actives_widgets), &biggest2, nullptr); *biggest_index = std::max(*biggest_index, biggest2); - NWidgetBase *inf = MakeNWidgets(_nested_newgrf_infopanel_widgets, lengthof(_nested_newgrf_infopanel_widgets), &biggest2, nullptr); + NWidgetBase *inf = MakeNWidgets(std::begin(_nested_newgrf_infopanel_widgets), std::end(_nested_newgrf_infopanel_widgets), &biggest2, nullptr); *biggest_index = std::max(*biggest_index, biggest2); return new NWidgetNewGRFDisplay(avs, acs, inf); @@ -1993,7 +1993,7 @@ static WindowDesc _newgrf_desc( WDP_CENTER, "settings_newgrf", 300, 263, WC_GAME_OPTIONS, WC_NONE, 0, - _nested_newgrf_widgets, lengthof(_nested_newgrf_widgets) + std::begin(_nested_newgrf_widgets), std::end(_nested_newgrf_widgets) ); /** @@ -2084,7 +2084,7 @@ static WindowDesc _save_preset_desc( WDP_CENTER, "save_preset", 140, 110, WC_SAVE_PRESET, WC_GAME_OPTIONS, WDF_MODAL, - _nested_save_preset_widgets, lengthof(_nested_save_preset_widgets) + std::begin(_nested_save_preset_widgets), std::end(_nested_save_preset_widgets) ); /** Class for the save preset window. */ @@ -2225,7 +2225,7 @@ static WindowDesc _scan_progress_desc( WDP_CENTER, nullptr, 0, 0, WC_MODAL_PROGRESS, WC_NONE, 0, - _nested_scan_progress_widgets, lengthof(_nested_scan_progress_widgets) + std::begin(_nested_scan_progress_widgets), std::end(_nested_scan_progress_widgets) ); /** Window for showing the progress of NewGRF scanning. */ diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp index eaa175a177..1ea3307db0 100644 --- a/src/newgrf_railtype.cpp +++ b/src/newgrf_railtype.cpp @@ -96,7 +96,7 @@ uint32 RailTypeResolverObject::GetDebugID() const * @param z Signal pixel z. * @param prog Routing restriction program. */ -RailTypeResolverObject::RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1, uint32 param2, +RailTypeResolverObject::RailTypeResolverObject(const RailTypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1, uint32 param2, CustomSignalSpriteContext signal_context, const TraceRestrictProgram *prog, uint z) : ResolverObject(rti != nullptr ? rti->grffile[rtsg] : nullptr, CBID_NO_CALLBACK, param1, param2), railtype_scope(*this, rti, tile, context, signal_context, prog, z) { @@ -112,7 +112,7 @@ RailTypeResolverObject::RailTypeResolverObject(const RailtypeInfo *rti, TileInde * @param[out] num_results If not nullptr, return the number of sprites in the spriteset. * @return The sprite to draw. */ -SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context, uint *num_results) +SpriteID GetCustomRailSprite(const RailTypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context, uint *num_results) { assert(rtsg < RTSG_END); @@ -141,7 +141,7 @@ inline uint8 RemapAspect(uint8 aspect, uint8 extra_aspects, uint8 style) return aspect + 1; } -static PalSpriteID GetRailTypeCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, uint8 aspect, +static PalSpriteID GetRailTypeCustomSignalSprite(const RailTypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, uint8 aspect, CustomSignalSpriteContext context, const TraceRestrictProgram *prog, uint z) { if (rti->group[RTSG_SIGNALS] == nullptr) return { 0, PAL_NONE }; @@ -170,7 +170,7 @@ static PalSpriteID GetRailTypeCustomSignalSprite(const RailtypeInfo *rti, TileIn * @param gui Is the sprite being used on the map or in the GUI? * @return The sprite to draw. */ -CustomSignalSpriteResult GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, uint8 aspect, +CustomSignalSpriteResult GetCustomSignalSprite(const RailTypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, uint8 aspect, CustomSignalSpriteContext context, uint8 style, const TraceRestrictProgram *prog, uint z) { if (_settings_client.gui.show_all_signal_default && style == 0) return { { 0, PAL_NONE }, false }; @@ -248,7 +248,7 @@ uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile) void DumpRailTypeSpriteGroup(RailType rt, DumpSpriteGroupPrinter print) { char buffer[64]; - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); static const char *sprite_group_names[] = { "RTSG_CURSORS", diff --git a/src/newgrf_railtype.h b/src/newgrf_railtype.h index 7545b5b190..101258c02c 100644 --- a/src/newgrf_railtype.h +++ b/src/newgrf_railtype.h @@ -21,7 +21,7 @@ struct RailTypeScopeResolver : public ScopeResolver { TileIndex tile; ///< Tracktile. For track on a bridge this is the southern bridgehead. TileContext context; ///< Are we resolving sprites for the upper halftile, or on a bridge? CustomSignalSpriteContext signal_context; - const RailtypeInfo *rti; + const RailTypeInfo *rti; const TraceRestrictProgram *prog; uint z; @@ -32,7 +32,7 @@ struct RailTypeScopeResolver : public ScopeResolver { * @param context Are we resolving sprites for the upper halftile, or on a bridge? * @param signal_context Signal context. */ - RailTypeScopeResolver(ResolverObject &ro, const RailtypeInfo *rti, TileIndex tile, TileContext context, CustomSignalSpriteContext signal_context, const TraceRestrictProgram *prog, uint z) + RailTypeScopeResolver(ResolverObject &ro, const RailTypeInfo *rti, TileIndex tile, TileContext context, CustomSignalSpriteContext signal_context, const TraceRestrictProgram *prog, uint z) : ScopeResolver(ro), tile(tile), context(context), signal_context(signal_context), rti(rti), prog(prog), z(z) { } @@ -45,7 +45,7 @@ struct RailTypeScopeResolver : public ScopeResolver { struct RailTypeResolverObject : public ResolverObject { RailTypeScopeResolver railtype_scope; ///< Resolver for the railtype scope. - RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1 = 0, uint32 param2 = 0, + RailTypeResolverObject(const RailTypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1 = 0, uint32 param2 = 0, CustomSignalSpriteContext signal_context = CSSC_GUI, const TraceRestrictProgram *prog = nullptr, uint z = 0); ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, VarSpriteGroupScopeOffset relative = 0) override @@ -65,8 +65,8 @@ struct CustomSignalSpriteResult { bool restricted_valid; }; -SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = nullptr); -CustomSignalSpriteResult GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, uint8 aspect, +SpriteID GetCustomRailSprite(const RailTypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = nullptr); +CustomSignalSpriteResult GetCustomSignalSprite(const RailTypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, uint8 aspect, CustomSignalSpriteContext context, uint8 style, const TraceRestrictProgram *prog = nullptr, uint z = 0); RailType GetRailTypeTranslation(uint8 railtype, const GRFFile *grffile); diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index fb1bfa2538..8700f3bd36 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -797,7 +797,7 @@ void DeallocateSpecFromStation(BaseStation *st, byte specindex) bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station) { const DrawTileSprites *sprites = nullptr; - const RailtypeInfo *rti = GetRailTypeInfo(railtype); + const RailTypeInfo *rti = GetRailTypeInfo(railtype); PaletteID palette = COMPANY_SPRITE_COLOUR(_local_company); uint tile = 2; diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h index 0c2f0e33a0..b8d5d60d8a 100644 --- a/src/newgrf_storage.h +++ b/src/newgrf_storage.h @@ -13,6 +13,7 @@ #include "core/alloc_func.hpp" #include "core/pool_type.hpp" #include "tile_type.h" +#include /** * Mode switches to the behaviour of persistent storage array. @@ -65,26 +66,10 @@ private: */ template struct PersistentStorageArray : BasePersistentStorageArray { - TYPE storage[SIZE]; ///< Memory to for the storage array - TYPE *prev_storage; ///< Memory to store "old" states so we can revert them on the performance of test cases for commands etc. + using StorageType = std::array; - /** Simply construct the array */ - PersistentStorageArray() : prev_storage(nullptr) - { - memset(this->storage, 0, sizeof(this->storage)); - } - - /** And free all data related to it */ - ~PersistentStorageArray() - { - free(this->prev_storage); - } - - /** Resets all values to zero. */ - void ResetToZero() - { - memset(this->storage, 0, sizeof(this->storage)); - } + StorageType storage{}; ///< Memory for the storage array + std::unique_ptr prev_storage{}; ///< Temporary memory to store previous state so it can be reverted, e.g. for command tests. /** * Stores some value at a given position. @@ -104,10 +89,9 @@ struct PersistentStorageArray : BasePersistentStorageArray { /* We do not have made a backup; lets do so */ if (AreChangesPersistent()) { - assert(this->prev_storage == nullptr); - } else if (this->prev_storage == nullptr) { - this->prev_storage = MallocT(SIZE); - memcpy(this->prev_storage, this->storage, sizeof(this->storage)); + assert(!this->prev_storage); + } else if (!this->prev_storage) { + this->prev_storage = std::make_unique(this->storage); /* We only need to register ourselves when we made the backup * as that is the only time something will have changed */ @@ -132,10 +116,9 @@ struct PersistentStorageArray : BasePersistentStorageArray { void ClearChanges() { - if (this->prev_storage != nullptr) { - memcpy(this->storage, this->prev_storage, sizeof(this->storage)); - free(this->prev_storage); - this->prev_storage = nullptr; + if (this->prev_storage) { + this->storage = *this->prev_storage; + this->prev_storage.reset(); } } }; @@ -149,17 +132,12 @@ struct PersistentStorageArray : BasePersistentStorageArray { */ template struct TemporaryStorageArray { - TYPE storage[SIZE]; ///< Memory to for the storage array - uint16 init[SIZE]; ///< Storage has been assigned, if this equals 'init_key'. - uint16 init_key; ///< Magic key to 'init'. + using StorageType = std::array; + using StorageInitType = std::array; - /** Simply construct the array */ - TemporaryStorageArray() - { - memset(this->storage, 0, sizeof(this->storage)); // not exactly needed, but makes code analysers happy - memset(this->init, 0, sizeof(this->init)); - this->init_key = 1; - } + StorageType storage{}; ///< Memory for the storage array + StorageInitType init{}; ///< Storage has been assigned, if this equals 'init_key'. + uint16_t init_key{1}; ///< Magic key to 'init'. /** * Stores some value at a given position. @@ -199,7 +177,7 @@ struct TemporaryStorageArray { this->init_key++; if (this->init_key == 0) { /* When init_key wraps around, we need to reset everything */ - memset(this->init, 0, sizeof(this->init)); + this->init = {}; this->init_key = 1; } } diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 7d0ad0eda5..19d327e378 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -98,7 +98,7 @@ static WindowDesc _normal_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, - _nested_normal_news_widgets, lengthof(_nested_normal_news_widgets) + std::begin(_nested_normal_news_widgets), std::end(_nested_normal_news_widgets) ); /* New vehicles news items. */ @@ -125,7 +125,7 @@ static WindowDesc _vehicle_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, - _nested_vehicle_news_widgets, lengthof(_nested_vehicle_news_widgets) + std::begin(_nested_vehicle_news_widgets), std::end(_nested_vehicle_news_widgets) ); /* Company news items. */ @@ -153,7 +153,7 @@ static WindowDesc _company_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, - _nested_company_news_widgets, lengthof(_nested_company_news_widgets) + std::begin(_nested_company_news_widgets), std::end(_nested_company_news_widgets) ); /* Thin news items. */ @@ -176,7 +176,7 @@ static WindowDesc _thin_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, - _nested_thin_news_widgets, lengthof(_nested_thin_news_widgets) + std::begin(_nested_thin_news_widgets), std::end(_nested_thin_news_widgets) ); /* Small news items. */ @@ -202,7 +202,7 @@ static WindowDesc _small_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, - _nested_small_news_widgets, lengthof(_nested_small_news_widgets) + std::begin(_nested_small_news_widgets), std::end(_nested_small_news_widgets) ); /** @@ -1239,7 +1239,7 @@ static WindowDesc _message_history_desc( WDP_AUTO, "list_news", 400, 140, WC_MESSAGE_HISTORY, WC_NONE, 0, - _nested_message_history, lengthof(_nested_message_history) + std::begin(_nested_message_history), std::end(_nested_message_history) ); /** Display window with news messages history */ diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 30527b4e5a..d70bac0e29 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -764,7 +764,7 @@ static WindowDesc _build_object_desc( WDP_AUTO, "build_object", 0, 0, WC_BUILD_OBJECT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_object_widgets, lengthof(_nested_build_object_widgets), + std::begin(_nested_build_object_widgets), std::end(_nested_build_object_widgets), &BuildObjectWindow::hotkeys ); diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 883732299f..c229070619 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -411,7 +411,7 @@ static WindowDesc _cargo_type_load_orders_widgets ( WDP_AUTO, "view_cargo_type_load_order", 195, 186, WC_VEHICLE_CARGO_TYPE_LOAD_ORDERS, WC_VEHICLE_ORDERS, WDF_CONSTRUCTION, - _nested_cargo_type_orders_widgets, lengthof(_nested_cargo_type_orders_widgets) + std::begin(_nested_cargo_type_orders_widgets), std::end(_nested_cargo_type_orders_widgets) ); /** Window description for the 'unload' variant of CargoTypeOrdersWindow. */ @@ -419,7 +419,7 @@ static WindowDesc _cargo_type_unload_orders_widgets ( WDP_AUTO, "view_cargo_type_unload_order", 195, 186, WC_VEHICLE_CARGO_TYPE_UNLOAD_ORDERS, WC_VEHICLE_ORDERS, WDF_CONSTRUCTION, - _nested_cargo_type_orders_widgets, lengthof(_nested_cargo_type_orders_widgets) + std::begin(_nested_cargo_type_orders_widgets), std::end(_nested_cargo_type_orders_widgets) ); /** @@ -3750,7 +3750,7 @@ static WindowDesc _orders_train_desc( WDP_AUTO, "view_vehicle_orders_train", 384, 100, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, - _nested_orders_train_widgets, lengthof(_nested_orders_train_widgets), + std::begin(_nested_orders_train_widgets), std::end(_nested_orders_train_widgets), &OrdersWindow::hotkeys ); @@ -3902,7 +3902,7 @@ static WindowDesc _orders_desc( WDP_AUTO, "view_vehicle_orders", 384, 100, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, - _nested_orders_widgets, lengthof(_nested_orders_widgets), + std::begin(_nested_orders_widgets), std::end(_nested_orders_widgets), &OrdersWindow::hotkeys ); @@ -3939,7 +3939,7 @@ static WindowDesc _other_orders_desc( WDP_AUTO, "view_vehicle_orders_competitor", 384, 86, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, - _nested_other_orders_widgets, lengthof(_nested_other_orders_widgets), + std::begin(_nested_other_orders_widgets), std::end(_nested_other_orders_widgets), &OrdersWindow::hotkeys ); diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp index beae6c52ff..d7a7eceb80 100644 --- a/src/os/unix/crashlog_unix.cpp +++ b/src/os/unix/crashlog_unix.cpp @@ -50,12 +50,16 @@ #endif #endif /* __GLIBC__ */ -#if defined(__NetBSD__) +#include + +#if defined(__EMSCRIPTEN__) +# include +/* We avoid abort(), as it is a SIGBART, and use _exit() instead. But emscripten doesn't know _exit(). */ +# define _exit emscripten_force_exit +#else #include #endif -#include - #include "../../safeguards.h" /** The signals we want our crash handler to handle. */ diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 614fcb6f08..f0c2fbac09 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -338,7 +338,7 @@ static WindowDesc _osk_desc( WDP_CENTER, nullptr, 0, 0, WC_OSK, WC_NONE, 0, - _nested_osk_widgets, lengthof(_nested_osk_widgets) + std::begin(_nested_osk_widgets), std::end(_nested_osk_widgets) ); /** diff --git a/src/pbs.cpp b/src/pbs.cpp index 0c86717e62..bb83ffb189 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -334,7 +334,7 @@ static void CheckCurveLookAhead(const Train *v, TrainReservationLookAhead *looka if (max_speed != absolute_max_speed) { /* Apply the engine's rail type curve speed advantage, if it slowed by curves */ - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); max_speed += (max_speed / 2) * rti->curve_speed; if (v->tcache.cached_tflags & TCF_TILT) { diff --git a/src/plans_gui.cpp b/src/plans_gui.cpp index e9c8b2c2c8..fc3c078365 100644 --- a/src/plans_gui.cpp +++ b/src/plans_gui.cpp @@ -69,7 +69,7 @@ static WindowDesc _plans_desc( WDP_AUTO, "plans", 350, 100, WC_PLANS, WC_NONE, WDF_CONSTRUCTION, - _nested_plans_widgets, lengthof(_nested_plans_widgets) + std::begin(_nested_plans_widgets), std::end(_nested_plans_widgets) ); struct PlansWindow : Window { diff --git a/src/programmable_signals_gui.cpp b/src/programmable_signals_gui.cpp index 866f641569..c92e3a27a7 100644 --- a/src/programmable_signals_gui.cpp +++ b/src/programmable_signals_gui.cpp @@ -969,7 +969,7 @@ static WindowDesc _program_desc( WDP_AUTO, "signal_program", 384, 100, WC_SIGNAL_PROGRAM, WC_BUILD_SIGNAL, WDF_CONSTRUCTION, - _nested_program_widgets, lengthof(_nested_program_widgets) + std::begin(_nested_program_widgets), std::end(_nested_program_widgets) ); void ShowSignalProgramWindow(SignalReference ref) diff --git a/src/querystring_gui.h b/src/querystring_gui.h index 4deee010a7..7bf1b36afc 100644 --- a/src/querystring_gui.h +++ b/src/querystring_gui.h @@ -49,37 +49,6 @@ public: Point GetCaretPosition(const Window *w, int wid) const; Rect GetBoundingRect(const Window *w, int wid, const char *from, const char *to) const; ptrdiff_t GetCharAtPosition(const Window *w, int wid, const Point &pt) const; - - /** - * Get the current text. - * @return Current text. - */ - const char *GetText() const - { - return this->text.buf; - } - - /** - * Get the position of the caret in the text buffer. - * @return Pointer to the caret in the text buffer. - */ - const char *GetCaret() const - { - return this->text.buf + this->text.caretpos; - } - - /** - * Get the currently marked text. - * @param[out] length Length of the marked text. - * @return Beginning of the marked area or nullptr if no text is marked. - */ - const char *GetMarkedText(size_t *length) const - { - if (this->text.markend == 0) return nullptr; - - *length = this->text.markend - this->text.markpos; - return this->text.buf + this->text.markpos; - } }; void ShowOnScreenKeyboard(Window *parent, int button); diff --git a/src/rail.cpp b/src/rail.cpp index b8074a1855..bd88dffaec 100644 --- a/src/rail.cpp +++ b/src/rail.cpp @@ -279,7 +279,7 @@ RailType GetTileSecondaryRailTypeIfValid(TileIndex t) * @param railtype requested RailType * @return true if company has requested RailType available */ -bool HasRailtypeAvail(const CompanyID company, const RailType railtype) +bool HasRailTypeAvail(const CompanyID company, const RailType railtype) { return !HasBit(_railtypes_hidden_mask, railtype) && HasBit(Company::Get(company)->avail_railtypes, railtype); } @@ -289,7 +289,7 @@ bool HasRailtypeAvail(const CompanyID company, const RailType railtype) * @param company the company in question * @return true if company has any RailTypes available */ -bool HasAnyRailtypesAvail(const CompanyID company) +bool HasAnyRailTypesAvail(const CompanyID company) { return (Company::Get(company)->avail_railtypes & ~_railtypes_hidden_mask) != 0; } @@ -299,9 +299,9 @@ bool HasAnyRailtypesAvail(const CompanyID company) * @param rail the railtype to check. * @return true if the current company may build the rail. */ -bool ValParamRailtype(const RailType rail) +bool ValParamRailType(const RailType rail) { - return rail < RAILTYPE_END && HasRailtypeAvail(_current_company, rail); + return rail < RAILTYPE_END && HasRailTypeAvail(_current_company, rail); } /** @@ -320,7 +320,7 @@ RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date) } for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); /* Unused rail type. */ if (rti->label == 0) continue; @@ -348,7 +348,7 @@ RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date) * @param introduces If true, include rail types introduced by other rail types * @return the rail types. */ -RailTypes GetCompanyRailtypes(CompanyID company, bool introduces) +RailTypes GetCompanyRailTypes(CompanyID company, bool introduces) { RailTypes rts = RAILTYPES_NONE; @@ -417,14 +417,14 @@ RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels) { /* Loop through each rail type until the label is found */ for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) { - const RailtypeInfo *rti = GetRailTypeInfo(r); + const RailTypeInfo *rti = GetRailTypeInfo(r); if (rti->label == label) return r; } if (allow_alternate_labels) { /* Test if any rail type defines the label as an alternate. */ for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) { - const RailtypeInfo *rti = GetRailTypeInfo(r); + const RailTypeInfo *rti = GetRailTypeInfo(r); if (std::find(rti->alternate_labels.begin(), rti->alternate_labels.end(), label) != rti->alternate_labels.end()) return r; } } diff --git a/src/rail.h b/src/rail.h index e916e3c505..baebe35dcc 100644 --- a/src/rail.h +++ b/src/rail.h @@ -132,7 +132,7 @@ typedef std::vector RailTypeLabelList; /** * This struct contains all the info that is needed to draw and construct tracks. */ -class RailtypeInfo { +class RailTypeInfo { public: /** * Struct containing the main sprites. @note not all sprites are listed, but only @@ -323,11 +323,11 @@ public: /** * Returns a pointer to the Railtype information for a given railtype * @param railtype the rail type which the information is requested for - * @return The pointer to the RailtypeInfo + * @return The pointer to the RailTypeInfo */ -static inline const RailtypeInfo *GetRailTypeInfo(RailType railtype) +static inline const RailTypeInfo *GetRailTypeInfo(RailType railtype) { - extern RailtypeInfo _railtypes[RAILTYPE_END]; + extern RailTypeInfo _railtypes[RAILTYPE_END]; dbg_assert_msg(railtype < RAILTYPE_END, "%u", railtype); return &_railtypes[railtype]; } @@ -379,8 +379,8 @@ static inline bool Rail90DegTurnDisallowed(RailType rt1, RailType rt2, bool def { if (rt1 == INVALID_RAILTYPE || rt2 == INVALID_RAILTYPE) return def; - const RailtypeInfo *rti1 = GetRailTypeInfo(rt1); - const RailtypeInfo *rti2 = GetRailTypeInfo(rt2); + const RailTypeInfo *rti1 = GetRailTypeInfo(rt1); + const RailTypeInfo *rti2 = GetRailTypeInfo(rt2); bool rt1_90deg = HasBit(rti1->flags, RTF_DISALLOW_90DEG) || (!HasBit(rti1->flags, RTF_ALLOW_90DEG) && def); bool rt2_90deg = HasBit(rti2->flags, RTF_DISALLOW_90DEG) || (!HasBit(rti2->flags, RTF_ALLOW_90DEG) && def); @@ -489,13 +489,13 @@ int TicksToLeaveDepot(const Train *v); Foundation GetRailFoundation(Slope tileh, TrackBits bits); -bool HasRailtypeAvail(const CompanyID company, const RailType railtype); -bool HasAnyRailtypesAvail(const CompanyID company); -bool ValParamRailtype(const RailType rail); +bool HasRailTypeAvail(const CompanyID company, const RailType railtype); +bool HasAnyRailTypesAvail(const CompanyID company); +bool ValParamRailType(const RailType rail); RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date); -RailTypes GetCompanyRailtypes(CompanyID company, bool introduces = true); +RailTypes GetCompanyRailTypes(CompanyID company, bool introduces = true); RailTypes GetRailTypes(bool introduces); RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels = true); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 96f1a8e9a7..fe2339deda 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -52,7 +52,7 @@ /** Helper type for lists/vectors of trains */ typedef std::vector TrainList; -RailtypeInfo _railtypes[RAILTYPE_END]; +RailTypeInfo _railtypes[RAILTYPE_END]; std::vector _sorted_railtypes; TileIndex _rail_track_endtile; ///< The end of a rail track; as hidden return from the rail build/remove command for GUI purposes. RailTypes _railtypes_hidden_mask; @@ -64,23 +64,13 @@ void ResetRailTypes() { static_assert(lengthof(_original_railtypes) <= lengthof(_railtypes)); - uint i = 0; - for (; i < lengthof(_original_railtypes); i++) _railtypes[i] = _original_railtypes[i]; - - static const RailtypeInfo empty_railtype = { - {0,0,0,0,0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0,0,0,{}}, - {0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0}, - 0, RAILTYPES_NONE, RAILTYPES_NONE, RAILTYPES_NONE, 0, 0, 0, RTFB_NONE, 0, 0, 0, 0, 0, 0, 0, - RailTypeLabelList(), 0, 0, RAILTYPES_NONE, RAILTYPES_NONE, 0, - {}, {} }; - for (; i < lengthof(_railtypes); i++) _railtypes[i] = empty_railtype; + auto insert = std::copy(std::begin(_original_railtypes), std::end(_original_railtypes), std::begin(_railtypes)); + std::fill(insert, std::end(_railtypes), RailTypeInfo{}); _railtypes_hidden_mask = RAILTYPES_NONE; } -void ResolveRailTypeGUISignalSprites(RailtypeInfo *rti, uint8 style, PalSpriteID signals[SIGTYPE_END][2][2]) +void ResolveRailTypeGUISignalSprites(RailTypeInfo *rti, uint8 style, PalSpriteID signals[SIGTYPE_END][2][2]) { /* Array of default GUI signal sprite numbers. */ const SpriteID _signal_lookup[2][SIGTYPE_END] = { @@ -131,7 +121,7 @@ void ResolveRailTypeGUISignalSprites(RailtypeInfo *rti, uint8 style, PalSpriteID } } -void ResolveRailTypeGUISprites(RailtypeInfo *rti) +void ResolveRailTypeGUISprites(RailTypeInfo *rti) { SpriteID cursors_base = GetCustomRailSprite(rti, INVALID_TILE, RTSG_CURSORS); if (cursors_base != 0) { @@ -273,7 +263,7 @@ void InitRailTypes() RailType AllocateRailType(RailTypeLabel label) { for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) { - RailtypeInfo *rti = &_railtypes[rt]; + RailTypeInfo *rti = &_railtypes[rt]; if (rti->label == 0) { /* Set up new rail type */ @@ -680,7 +670,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u _rail_track_endtile = INVALID_TILE; - if (!ValParamRailtype(railtype) || !ValParamTrackOrientation(track)) return CMD_ERROR; + if (!ValParamRailType(railtype) || !ValParamTrackOrientation(track)) return CMD_ERROR; Slope tileh = GetTileSlope(tile); TrackBits trackbit = TrackToTrackBits(track); @@ -815,6 +805,11 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u /* Level crossings may only be built on these slopes */ if (!HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); + if (!_settings_game.construction.crossing_with_competitor && _current_company != OWNER_DEITY) { + CommandCost ret = CheckTileOwnership(tile); + if (ret.Failed()) return ret; + } + CommandCost ret = EnsureNoVehicleOnGround(tile); if (ret.Failed()) return ret; @@ -1291,7 +1286,7 @@ static CommandCost CmdRailTrackHelper(TileIndex tile, DoCommandFlag flags, uint3 _rail_track_endtile = INVALID_TILE; - if ((!remove && !ValParamRailtype(railtype)) || !ValParamTrackOrientation(track)) return CMD_ERROR; + if ((!remove && !ValParamRailType(railtype)) || !ValParamTrackOrientation(track)) return CMD_ERROR; if (p1 >= MapSize()) return CMD_ERROR; TileIndex end_tile = p1; Trackdir trackdir = TrackToTrackdir(track); @@ -1394,7 +1389,7 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u { /* 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)) return CMD_ERROR; Slope tileh = GetTileSlope(tile); @@ -2455,7 +2450,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 TileIndex area_end = tile; bool diagonal = HasBit(p2, 6); - if (!ValParamRailtype(totype)) return CMD_ERROR; + if (!ValParamRailType(totype)) return CMD_ERROR; if (area_start >= MapSize()) return CMD_ERROR; TrainList affected_trains; @@ -2727,7 +2722,7 @@ CommandCost CmdConvertRailTrack(TileIndex tile, DoCommandFlag flags, uint32 p1, const RailType totype = Extract(p2); const TileIndex end_tile = p1; - if (!ValParamRailtype(totype)) return CMD_ERROR; + if (!ValParamRailType(totype)) return CMD_ERROR; if (end_tile >= MapSize()) return CMD_ERROR; const Track start_track = Extract(p2); @@ -3197,7 +3192,7 @@ void DrawRestrictedSignal(SignalType type, SpriteID sprite, int x, int y, int z, } } -void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track track, SignalState condition, SignalOffsets image, uint pos, SignalType type, +void DrawSingleSignal(TileIndex tile, const RailTypeInfo *rti, Track track, SignalState condition, SignalOffsets image, uint pos, SignalType type, SignalVariant variant, const TraceRestrictProgram *prog, CustomSignalSpriteContext context) { bool show_restricted = (prog != nullptr); @@ -3318,7 +3313,7 @@ void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track track, Sign } } -static void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track track, SignalState condition, SignalOffsets image, uint pos) +static void DrawSingleSignal(TileIndex tile, const RailTypeInfo *rti, Track track, SignalState condition, SignalOffsets image, uint pos) { SignalType type = GetSignalType(tile, track); SignalVariant variant = GetSignalVariant(tile, track); @@ -3493,7 +3488,7 @@ static void DrawTrackFence_SW(const TileInfo *ti, SpriteID base_image, uint num_ * @param ti Tile drawing information. * @param rti Rail type information. */ -void DrawTrackDetails(const TileInfo *ti, const RailtypeInfo *rti, const RailGroundType rgt) +void DrawTrackDetails(const TileInfo *ti, const RailTypeInfo *rti, const RailGroundType rgt) { /* Base sprite for track fences. * Note: Halftile slopes only have fences on the upper part. */ @@ -3569,7 +3564,7 @@ static RailGroundType GetRailOrBridgeGroundType(TileInfo *ti) { } } -static void DrawTrackBitsOverlay(TileInfo *ti, TrackBits track, const RailtypeInfo *rti, RailGroundType rgt, bool is_bridge, Corner halftile_corner, Corner draw_half_tile) +static void DrawTrackBitsOverlay(TileInfo *ti, TrackBits track, const RailTypeInfo *rti, RailGroundType rgt, bool is_bridge, Corner halftile_corner, Corner draw_half_tile) { if (halftile_corner != CORNER_INVALID) track &= ~CornerToTrackBits(halftile_corner); @@ -3732,7 +3727,7 @@ static void DrawTrackBitsOverlay(TileInfo *ti, TrackBits track, const RailtypeIn */ void DrawTrackBits(TileInfo *ti, TrackBits track, RailType rt, RailGroundType rgt, bool is_bridge, Corner halftile_corner, Corner draw_half_tile) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); if (rti->UsesOverlay()) { DrawTrackBitsOverlay(ti, track, rti, rgt, is_bridge, halftile_corner, draw_half_tile); @@ -3935,7 +3930,7 @@ void DrawTrackBits(TileInfo *ti, TrackBits track) } } -static void DrawSignals(TileIndex tile, TrackBits rails, const RailtypeInfo *rti) +static void DrawSignals(TileIndex tile, TrackBits rails, const RailTypeInfo *rti) { #define MAYBE_DRAW_SIGNAL(x, y, z, t) if (IsSignalPresent(tile, x)) DrawSingleSignal(tile, rti, t, GetSingleSignalState(tile, x), y, z) @@ -3969,7 +3964,7 @@ static void DrawSignals(TileIndex tile, TrackBits rails, const RailtypeInfo *rti static void DrawTile_Track(TileInfo *ti, DrawTileProcParams params) { - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); _drawtile_track_palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile)); @@ -3988,13 +3983,13 @@ static void DrawTile_Track(TileInfo *ti, DrawTileProcParams params) if (HasSignals(ti->tile)) { if (rails == TRACK_BIT_VERT) { - const RailtypeInfo *rti2 = GetRailTypeInfo(secondary_railtype); + const RailTypeInfo *rti2 = GetRailTypeInfo(secondary_railtype); if (IsSignalPresent(ti->tile, 2)) DrawSingleSignal(ti->tile, rti, TRACK_LEFT, GetSingleSignalState(ti->tile, 2), SIGNAL_TO_NORTH, 0); if (IsSignalPresent(ti->tile, 3)) DrawSingleSignal(ti->tile, rti, TRACK_LEFT, GetSingleSignalState(ti->tile, 3), SIGNAL_TO_SOUTH, 1); if (IsSignalPresent(ti->tile, 0)) DrawSingleSignal(ti->tile, rti2, TRACK_RIGHT, GetSingleSignalState(ti->tile, 0), SIGNAL_TO_NORTH, 2); if (IsSignalPresent(ti->tile, 1)) DrawSingleSignal(ti->tile, rti2, TRACK_RIGHT, GetSingleSignalState(ti->tile, 1), SIGNAL_TO_SOUTH, 3); } else if (rails == TRACK_BIT_HORZ) { - const RailtypeInfo *rti2 = GetRailTypeInfo(secondary_railtype); + const RailTypeInfo *rti2 = GetRailTypeInfo(secondary_railtype); if (IsSignalPresent(ti->tile, 3)) DrawSingleSignal(ti->tile, rti, TRACK_UPPER, GetSingleSignalState(ti->tile, 3), SIGNAL_TO_WEST, 4); if (IsSignalPresent(ti->tile, 2)) DrawSingleSignal(ti->tile, rti, TRACK_UPPER, GetSingleSignalState(ti->tile, 2), SIGNAL_TO_EAST, 5); if (IsSignalPresent(ti->tile, 1)) DrawSingleSignal(ti->tile, rti2, TRACK_LOWER, GetSingleSignalState(ti->tile, 1), SIGNAL_TO_WEST, 6); @@ -4111,7 +4106,7 @@ static void DrawTile_Track(TileInfo *ti, DrawTileProcParams params) void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype) { const DrawTileSprites *dts = &_depot_gfx_table[dir]; - const RailtypeInfo *rti = GetRailTypeInfo(railtype); + const RailTypeInfo *rti = GetRailTypeInfo(railtype); SpriteID image = rti->UsesOverlay() ? SPR_FLAT_GRASS_TILE : dts->ground.sprite; uint32 offset = rti->GetRailtypeSpriteOffset(); @@ -4382,12 +4377,12 @@ static bool ClickTile_Track(TileIndex tile) static void GetTileDesc_Track(TileIndex tile, TileDesc *td) { RailType rt = GetRailType(tile); - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); td->rail_speed = rti->max_speed; td->railtype = rti->strings.name; RailType secondary_rt = GetTileSecondaryRailTypeIfValid(tile); if (secondary_rt != rt && secondary_rt != INVALID_RAILTYPE) { - const RailtypeInfo *secondary_rti = GetRailTypeInfo(secondary_rt); + const RailTypeInfo *secondary_rti = GetRailTypeInfo(secondary_rt); td->rail_speed2 = secondary_rti->max_speed; td->railtype2 = secondary_rti->strings.name; } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 9a74276e20..0897f7170f 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -531,7 +531,7 @@ struct BuildRailToolbarWindow : Window { void SetupRailToolbar(RailType railtype) { this->railtype = railtype; - const RailtypeInfo *rti = GetRailTypeInfo(railtype); + const RailTypeInfo *rti = GetRailTypeInfo(railtype); assert(railtype < RAILTYPE_END); this->GetWidget(WID_RAT_BUILD_NS)->widget_data = rti->gui_sprites.build_ns_rail; @@ -589,7 +589,7 @@ struct BuildRailToolbarWindow : Window { void SetStringParameters(int widget) const override { if (widget == WID_RAT_CAPTION) { - const RailtypeInfo *rti = GetRailTypeInfo(this->railtype); + const RailTypeInfo *rti = GetRailTypeInfo(this->railtype); if (rti->max_speed > 0) { SetDParam(0, STR_TOOLBAR_RAILTYPE_VELOCITY); SetDParam(1, rti->strings.toolbar_caption); @@ -1047,7 +1047,7 @@ static WindowDesc _build_rail_desc( WDP_ALIGN_TOOLBAR, "toolbar_rail", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_rail_widgets, lengthof(_nested_build_rail_widgets), + std::begin(_nested_build_rail_widgets), std::end(_nested_build_rail_widgets), &BuildRailToolbarWindow::hotkeys ); @@ -1063,7 +1063,7 @@ static WindowDesc _build_rail_desc( Window *ShowBuildRailToolbar(RailType railtype) { if (!Company::IsValidID(_local_company)) return nullptr; - if (!ValParamRailtype(railtype)) return nullptr; + if (!ValParamRailType(railtype)) return nullptr; CloseWindowByClass(WC_BUILD_TOOLBAR); _cur_railtype = railtype; @@ -1848,7 +1848,7 @@ static WindowDesc _station_builder_desc( WDP_AUTO, "build_station_rail", 350, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_station_builder_widgets, lengthof(_nested_station_builder_widgets), + std::begin(_nested_station_builder_widgets), std::end(_nested_station_builder_widgets), &BuildRailStationWindow::hotkeys ); @@ -2341,7 +2341,7 @@ static WindowDesc _signal_builder_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_signal_builder_widgets, lengthof(_nested_signal_builder_widgets), + std::begin(_nested_signal_builder_widgets), std::end(_nested_signal_builder_widgets), &BuildSignalWindow::hotkeys ); @@ -2433,7 +2433,7 @@ static WindowDesc _build_depot_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_depot_widgets, lengthof(_nested_build_depot_widgets) + std::begin(_nested_build_depot_widgets), std::end(_nested_build_depot_widgets) ); static void ShowBuildTrainDepotPicker(Window *parent) @@ -2671,7 +2671,7 @@ static WindowDesc _build_waypoint_desc( WDP_AUTO, "build_waypoint", 0, 0, WC_BUILD_WAYPOINT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_waypoint_widgets, lengthof(_nested_build_waypoint_widgets) + std::begin(_nested_build_waypoint_widgets), std::end(_nested_build_waypoint_widgets) ); static void ShowBuildWaypointPicker(Window *parent) @@ -2731,14 +2731,14 @@ static void SetDefaultRailGui() case 0: { /* Use first available type */ std::vector::const_iterator it = std::find_if(_sorted_railtypes.begin(), _sorted_railtypes.end(), - [](RailType r){ return HasRailtypeAvail(_local_company, r); }); + [](RailType r){ return HasRailTypeAvail(_local_company, r); }); rt = it != _sorted_railtypes.end() ? *it : RAILTYPE_BEGIN; break; } case 1: { /* Use last available type */ std::vector::const_reverse_iterator it = std::find_if(_sorted_railtypes.rbegin(), _sorted_railtypes.rend(), - [](RailType r){ return HasRailtypeAvail(_local_company, r); }); + [](RailType r){ return HasRailTypeAvail(_local_company, r); }); rt = it != _sorted_railtypes.rend() ? *it : RAILTYPE_BEGIN; break; } @@ -2805,7 +2805,7 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option) /* Find the used railtypes. */ if (for_replacement) { - avail_railtypes = GetCompanyRailtypes(c->index, false); + avail_railtypes = GetCompanyRailTypes(c->index, false); used_railtypes = GetRailTypes(false); } else { avail_railtypes = c->avail_railtypes; @@ -2823,7 +2823,7 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option) if (!for_replacement) { for (const auto &rt : _sorted_railtypes) { if (!HasBit(used_railtypes, rt)) continue; - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); d = maxdim(d, GetSpriteSize(rti->gui_sprites.build_x_rail)); } } @@ -2832,7 +2832,7 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option) /* If it's not used ever, don't show it to the user. */ if (!HasBit(used_railtypes, rt)) continue; - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); SetDParam(0, rti->strings.menu_text); SetDParam(1, rti->max_speed); diff --git a/src/random_access_file.cpp b/src/random_access_file.cpp index 93a8fd5c37..d660cee177 100644 --- a/src/random_access_file.cpp +++ b/src/random_access_file.cpp @@ -145,9 +145,10 @@ void RandomAccessFile::ReadBlock(void *ptr, size_t size) * Skip \a n bytes ahead in the file. * @param n Number of bytes to skip reading. */ -void RandomAccessFile::SkipBytes(int n) +void RandomAccessFile::SkipBytes(size_t n) { - int remaining = this->buffer_end - this->buffer; + assert(this->buffer_end >= this->buffer); + size_t remaining = this->buffer_end - this->buffer; if (n <= remaining) { this->buffer += n; } else { diff --git a/src/random_access_file_type.h b/src/random_access_file_type.h index 57e903fd7f..1c3e6e78e5 100644 --- a/src/random_access_file_type.h +++ b/src/random_access_file_type.h @@ -87,7 +87,7 @@ public: } void ReadBlock(void *ptr, size_t size); - void SkipBytes(int n); + void SkipBytes(size_t n); }; #endif /* RANDOM_ACCESS_FILE_TYPE_H */ diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index d58eff5204..9ce9bded57 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -69,17 +69,8 @@ void ResetRoadTypes() { static_assert(lengthof(_original_roadtypes) <= lengthof(_roadtypes)); - uint i = 0; - for (; i < lengthof(_original_roadtypes); i++) _roadtypes[i] = _original_roadtypes[i]; - - static const RoadTypeInfo empty_roadtype = { - { 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, 0, {}, {} }, - ROADTYPES_NONE, ROTFB_NONE, RXTFB_NONE, RTCM_NORMAL, 0, 0, 0, 0, - RoadTypeLabelList(), 0, 0, ROADTYPES_NONE, ROADTYPES_NONE, 0, - {}, {} }; - for (; i < lengthof(_roadtypes); i++) _roadtypes[i] = empty_roadtype; + auto insert = std::copy(std::begin(_original_roadtypes), std::end(_original_roadtypes), std::begin(_roadtypes)); + std::fill(insert, std::end(_roadtypes), RoadTypeInfo{}); _roadtypes_hidden_mask = ROADTYPES_NONE; _roadtypes_type = ROADTYPES_TRAM; @@ -1112,6 +1103,11 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); } + if (!_settings_game.construction.crossing_with_competitor && company != OWNER_TOWN && company != OWNER_DEITY) { + CommandCost ret = CheckTileOwnership(tile); + if (ret.Failed()) return ret; + } + if (GetRailTileType(tile) != RAIL_TILE_NORMAL) goto do_clear; if (RoadNoLevelCrossing(rt)) { @@ -2265,7 +2261,7 @@ static void DrawTile_Road(TileInfo *ti, DrawTileProcParams params) Axis axis = GetCrossingRailAxis(ti->tile); - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); RoadType road_rt = GetRoadTypeRoad(ti->tile); RoadType tram_rt = GetRoadTypeTram(ti->tile); @@ -2804,7 +2800,7 @@ static void GetTileDesc_Road(TileIndex tile, TileDesc *td) td->str = STR_LAI_ROAD_DESCRIPTION_ROAD_RAIL_LEVEL_CROSSING; rail_owner = GetTileOwner(tile); - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(tile)); td->railtype = rti->strings.name; td->rail_speed = rti->max_speed; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 714b988f6f..f95be68365 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -979,7 +979,7 @@ static WindowDesc _build_road_desc( WDP_ALIGN_TOOLBAR, "toolbar_road", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_road_widgets, lengthof(_nested_build_road_widgets), + std::begin(_nested_build_road_widgets), std::end(_nested_build_road_widgets), &BuildRoadToolbarWindow::road_hotkeys ); @@ -1022,7 +1022,7 @@ static WindowDesc _build_tramway_desc( WDP_ALIGN_TOOLBAR, "toolbar_tramway", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_tramway_widgets, lengthof(_nested_build_tramway_widgets), + std::begin(_nested_build_tramway_widgets), std::end(_nested_build_tramway_widgets), &BuildRoadToolbarWindow::tram_hotkeys ); @@ -1077,7 +1077,7 @@ static WindowDesc _build_road_scen_desc( WDP_AUTO, "toolbar_road_scen", 0, 0, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_road_scen_widgets, lengthof(_nested_build_road_scen_widgets), + std::begin(_nested_build_road_scen_widgets), std::end(_nested_build_road_scen_widgets), &BuildRoadToolbarWindow::road_hotkeys ); @@ -1112,7 +1112,7 @@ static WindowDesc _build_tramway_scen_desc( WDP_AUTO, "toolbar_tram_scen", 0, 0, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_build_tramway_scen_widgets, lengthof(_nested_build_tramway_scen_widgets), + std::begin(_nested_build_tramway_scen_widgets), std::end(_nested_build_tramway_scen_widgets), &BuildRoadToolbarWindow::tram_hotkeys ); @@ -1217,7 +1217,7 @@ static WindowDesc _build_road_depot_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_road_depot_widgets, lengthof(_nested_build_road_depot_widgets) + std::begin(_nested_build_road_depot_widgets), std::end(_nested_build_road_depot_widgets) ); static void ShowRoadDepotPicker(Window *parent) @@ -1866,7 +1866,7 @@ static WindowDesc _road_station_picker_desc( WDP_AUTO, "build_station_road", 0, 0, WC_BUS_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_road_station_picker_widgets, lengthof(_nested_road_station_picker_widgets) + std::begin(_nested_road_station_picker_widgets), std::end(_nested_road_station_picker_widgets) ); /** Widget definition of the build tram station window */ @@ -1952,7 +1952,7 @@ static WindowDesc _tram_station_picker_desc( WDP_AUTO, "build_station_tram", 0, 0, WC_BUS_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_tram_station_picker_widgets, lengthof(_nested_tram_station_picker_widgets) + std::begin(_nested_tram_station_picker_widgets), std::end(_nested_tram_station_picker_widgets) ); static void ShowRVStationPicker(Window *parent, RoadStopType rs) @@ -2188,7 +2188,7 @@ static WindowDesc _build_waypoint_desc( WDP_AUTO, "build_road_waypoint", 0, 0, WC_BUILD_WAYPOINT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_build_waypoint_widgets, lengthof(_nested_build_waypoint_widgets) + std::begin(_nested_build_waypoint_widgets), std::end(_nested_build_waypoint_widgets) ); static void ShowBuildWaypointPicker(Window *parent) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index dd4cbfa75e..4a90a2e424 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1776,7 +1776,7 @@ bool AfterLoadGame() } for (Company *c : Company::Iterate()) { - c->avail_railtypes = GetCompanyRailtypes(c->index); + c->avail_railtypes = GetCompanyRailTypes(c->index); c->avail_roadtypes = GetCompanyRoadTypes(c->index); } diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp index c626a4eeb9..eb12753630 100644 --- a/src/saveload/industry_sl.cpp +++ b/src/saveload/industry_sl.cpp @@ -227,7 +227,7 @@ struct INDYChunkHandler : ChunkHandler { /* Store the old persistent storage. The GRFID will be added later. */ assert(PersistentStorage::CanAllocateItem()); i->psa = new PersistentStorage(0, 0, 0); - memcpy(i->psa->storage, _old_ind_persistent_storage.storage, sizeof(_old_ind_persistent_storage.storage)); + std::copy(std::begin(_old_ind_persistent_storage.storage), std::end(_old_ind_persistent_storage.storage), std::begin(i->psa->storage)); } Industry::IncIndustryTypeCount(i->type); } diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 1a0c975a12..299deb1806 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -274,7 +274,7 @@ public: /* Store the old persistent storage. The GRFID will be added later. */ assert(PersistentStorage::CanAllocateItem()); st->airport.psa = new PersistentStorage(0, 0, 0); - memcpy(st->airport.psa->storage, _old_st_persistent_storage.storage, sizeof(_old_st_persistent_storage.storage)); + std::copy(std::begin(_old_st_persistent_storage.storage), std::end(_old_st_persistent_storage.storage), std::begin(st->airport.psa->storage)); } size_t num_cargo = this->GetNumCargo(); diff --git a/src/schdispatch_gui.cpp b/src/schdispatch_gui.cpp index da1fb960b0..e4a2fe3519 100644 --- a/src/schdispatch_gui.cpp +++ b/src/schdispatch_gui.cpp @@ -1061,7 +1061,7 @@ static WindowDesc _schdispatch_desc( WDP_AUTO, "scheduled_dispatch_slots", 400, 130, WC_SCHDISPATCH_SLOTS, WC_VEHICLE_TIMETABLE, WDF_CONSTRUCTION, - _nested_schdispatch_widgets, lengthof(_nested_schdispatch_widgets) + std::begin(_nested_schdispatch_widgets), std::end(_nested_schdispatch_widgets) ); /** @@ -1268,7 +1268,7 @@ static WindowDesc _scheduled_dispatch_add_desc( WDP_CENTER, nullptr, 0, 0, WC_SET_DATE, WC_NONE, 0, - _nested_scheduled_dispatch_add_widgets, lengthof(_nested_scheduled_dispatch_add_widgets) + std::begin(_nested_scheduled_dispatch_add_widgets), std::end(_nested_scheduled_dispatch_add_widgets) ); void ShowScheduledDispatchAddSlotsWindow(SchdispatchWindow *parent, int window_number) diff --git a/src/screenshot_gui.cpp b/src/screenshot_gui.cpp index ba61928c79..8e4d395e82 100644 --- a/src/screenshot_gui.cpp +++ b/src/screenshot_gui.cpp @@ -70,7 +70,7 @@ static WindowDesc _screenshot_window_desc( WDP_AUTO, "take_a_screenshot", 200, 100, WC_SCREENSHOT, WC_NONE, 0, - _nested_screenshot, lengthof(_nested_screenshot) + std::begin(_nested_screenshot), std::end(_nested_screenshot) ); void ShowScreenshotWindow() diff --git a/src/script/api/script_admin.cpp b/src/script/api/script_admin.cpp index 6c52df374c..804c8a8d68 100644 --- a/src/script/api/script_admin.cpp +++ b/src/script/api/script_admin.cpp @@ -14,12 +14,24 @@ #include "../script_instance.hpp" #include "../../string_func.h" #include "../../core/format.hpp" +#include "../../3rdparty/nlohmann/json.hpp" #include "../../safeguards.h" -/* static */ bool ScriptAdmin::MakeJSON(HSQUIRRELVM vm, SQInteger index, int max_depth, std::string &data) +/** + * Convert a Squirrel structure into a JSON object. + * + * This function is not "static", so it can be tested in unittests. + * + * @param json The resulting JSON object. + * @param vm The VM to operate on. + * @param index The index we are currently working for. + * @param depth The current depth in the squirrel struct. + * @return True iff the conversion was successful. + */ +bool ScriptAdminMakeJSON(nlohmann::json &json, HSQUIRRELVM vm, SQInteger index, int depth = 0) { - if (max_depth == 0) { + if (depth == SQUIRREL_MAX_DEPTH) { ScriptLog::Error("Send parameters can only be nested to 25 deep. No data sent."); // SQUIRREL_MAX_DEPTH = 25 return false; } @@ -29,7 +41,7 @@ SQInteger res; sq_getinteger(vm, index, &res); - data = fmt::format("{}", res); + json = res; return true; } @@ -37,63 +49,52 @@ const SQChar *buf; sq_getstring(vm, index, &buf); - size_t len = strlen(buf) + 1; - if (len >= 255) { - ScriptLog::Error("Maximum string length is 254 chars. No data sent."); - return false; - } - - data = fmt::format("\"{}\"", buf); + json = std::string(buf); return true; } case OT_ARRAY: { - data = "[ "; + json = nlohmann::json::array(); - bool first = true; sq_pushnull(vm); while (SQ_SUCCEEDED(sq_next(vm, index - 1))) { - if (!first) data += ", "; - if (first) first = false; - - std::string tmp; + nlohmann::json tmp; - bool res = MakeJSON(vm, -1, max_depth - 1, tmp); + bool res = ScriptAdminMakeJSON(tmp, vm, -1, depth + 1); sq_pop(vm, 2); if (!res) { sq_pop(vm, 1); return false; } - data += tmp; + + json.push_back(tmp); } sq_pop(vm, 1); - data += " ]"; return true; } case OT_TABLE: { - data = "{ "; + json = nlohmann::json::object(); - bool first = true; sq_pushnull(vm); while (SQ_SUCCEEDED(sq_next(vm, index - 1))) { - if (!first) data += ", "; - if (first) first = false; - - std::string key; - std::string value; - - /* Store the key + value */ - bool res = MakeJSON(vm, -2, max_depth - 1, key) && MakeJSON(vm, -1, max_depth - 1, value); + /* Squirrel ensure the key is a string. */ + assert(sq_gettype(vm, -2) == OT_STRING); + const SQChar *buf; + sq_getstring(vm, -2, &buf); + std::string key = std::string(buf); + + nlohmann::json value; + bool res = ScriptAdminMakeJSON(value, vm, -1, depth + 1); sq_pop(vm, 2); if (!res) { sq_pop(vm, 1); return false; } - data += key + ": " + value; + + json[key] = value; } sq_pop(vm, 1); - data += " }"; return true; } @@ -101,17 +102,12 @@ SQBool res; sq_getbool(vm, index, &res); - if (res) { - data = "true"; - return true; - } - - data = "false"; + json = res ? true : false; return true; } case OT_NULL: { - data = "null"; + json = nullptr; return true; } @@ -129,19 +125,13 @@ return sq_throwerror(vm, "ScriptAdmin::Send requires a table as first parameter. No data sent."); } - std::string json; - if (!ScriptAdmin::MakeJSON(vm, -1, SQUIRREL_MAX_DEPTH, json)) { - sq_pushinteger(vm, 0); - return 1; - } - - if (json.length() > NETWORK_GAMESCRIPT_JSON_LENGTH) { - ScriptLog::Error("You are trying to send a table that is too large to the AdminPort. No data sent."); + nlohmann::json json; + if (!ScriptAdminMakeJSON(json, vm, -1)) { sq_pushinteger(vm, 0); return 1; } - NetworkAdminGameScript(json); + NetworkAdminGameScript(json.dump()); sq_pushinteger(vm, 1); return 1; diff --git a/src/script/api/script_admin.hpp b/src/script/api/script_admin.hpp index 8e07985d03..02ea21e419 100644 --- a/src/script/api/script_admin.hpp +++ b/src/script/api/script_admin.hpp @@ -36,16 +36,6 @@ public: */ static bool Send(void *table); #endif /* DOXYGEN_API */ - -protected: - /** - * Convert a Squirrel structure into a JSON string. - * @param vm The VM to operate on. - * @param index The index we are currently working for. - * @param max_depth The maximal depth to follow the squirrel struct. - * @param data The resulting json string. - */ - static bool MakeJSON(HSQUIRRELVM vm, SQInteger index, int max_depth, std::string &data); }; #endif /* SCRIPT_ADMIN_HPP */ diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index 4549e8627b..db7300aee1 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -126,193 +126,89 @@ ScriptEventAdminPort::ScriptEventAdminPort(const std::string &json) : json(json) { } - -#define SKIP_EMPTY(p) while (*(p) == ' ' || *(p) == '\n' || *(p) == '\r') (p)++; -#define RETURN_ERROR(stack) { ScriptLog::Error("Received invalid JSON data from AdminPort."); if (stack != 0) sq_pop(vm, stack); return nullptr; } - -SQInteger ScriptEventAdminPort::GetObject(HSQUIRRELVM vm) -{ - const char *p = this->json.c_str(); - - if (this->ReadTable(vm, p) == nullptr) { - sq_pushnull(vm); - return 1; - } - - return 1; -} - -const char *ScriptEventAdminPort::ReadString(HSQUIRRELVM vm, const char *p) -{ - const char *value = p; - - bool escape = false; - for (;;) { - if (*p == '\\') { - escape = true; - p++; - continue; - } - if (*p == '"' && escape) { - escape = false; - p++; - continue; - } - escape = false; - - if (*p == '"') break; - if (*p == '\0') RETURN_ERROR(0); - - p++; - } - - size_t len = p - value; - sq_pushstring(vm, value, len); - p++; // Step past the end-of-string marker (") - - return p; -} - -const char *ScriptEventAdminPort::ReadTable(HSQUIRRELVM vm, const char *p) +/** + * Convert a JSON part fo Squirrel. + * @param vm The VM used. + * @param json The JSON part to convert to Squirrel. + */ +static bool ScriptEventAdminPortReadValue(HSQUIRRELVM vm, nlohmann::json &json) { - sq_newtable(vm); - - SKIP_EMPTY(p); - if (*p++ != '{') RETURN_ERROR(1); - - for (;;) { - SKIP_EMPTY(p); - if (*p++ != '"') RETURN_ERROR(1); - - p = ReadString(vm, p); - if (p == nullptr) { - sq_pop(vm, 1); - return nullptr; - } - - SKIP_EMPTY(p); - if (*p++ != ':') RETURN_ERROR(2); - - p = this->ReadValue(vm, p); - if (p == nullptr) { - sq_pop(vm, 2); - return nullptr; - } + switch (json.type()) { + case nlohmann::json::value_t::null: + sq_pushnull(vm); + break; - sq_rawset(vm, -3); - /* The key (-2) and value (-1) are popped from the stack by squirrel. */ + case nlohmann::json::value_t::boolean: + sq_pushbool(vm, json.get() ? 1 : 0); + break; - SKIP_EMPTY(p); - if (*p == ',') { - p++; - continue; + case nlohmann::json::value_t::string: { + auto value = json.get(); + sq_pushstring(vm, value.data(), value.size()); + break; } - break; - } - - SKIP_EMPTY(p); - if (*p++ != '}') RETURN_ERROR(1); - - return p; -} -const char *ScriptEventAdminPort::ReadValue(HSQUIRRELVM vm, const char *p) -{ - SKIP_EMPTY(p); - - if (strncmp(p, "false", 5) == 0) { - sq_pushbool(vm, 0); - return p + 5; - } - if (strncmp(p, "true", 4) == 0) { - sq_pushbool(vm, 1); - return p + 4; - } - if (strncmp(p, "null", 4) == 0) { - sq_pushnull(vm); - return p + 4; - } + case nlohmann::json::value_t::number_integer: + case nlohmann::json::value_t::number_unsigned: + sq_pushinteger(vm, json.get()); + break; - switch (*p) { - case '"': { - /* String */ - p = ReadString(vm, ++p); - if (p == nullptr) return nullptr; + case nlohmann::json::value_t::object: + sq_newtable(vm); - break; - } + for (auto &[key, value] : json.items()) { + sq_pushstring(vm, key.data(), key.size()); - case '{': { - /* Table */ - p = this->ReadTable(vm, p); - if (p == nullptr) return nullptr; + if (!ScriptEventAdminPortReadValue(vm, value)) { + return false; + } + sq_rawset(vm, -3); + } break; - } - case '[': { - /* Array */ + case nlohmann::json::value_t::array: sq_newarray(vm, 0); - /* Empty array? */ - const char *p2 = p + 1; - SKIP_EMPTY(p2); - if (*p2 == ']') { - p = p2 + 1; - break; - } - - while (*p++ != ']') { - p = this->ReadValue(vm, p); - if (p == nullptr) { - sq_pop(vm, 1); - return nullptr; + for (auto &value : json) { + if (!ScriptEventAdminPortReadValue(vm, value)) { + return false; } - sq_arrayappend(vm, -2); - SKIP_EMPTY(p); - if (*p == ',') continue; - if (*p == ']') break; - RETURN_ERROR(1); + sq_arrayappend(vm, -2); } - - p++; - break; - } - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': case '0': - case '-': { - /* Integer */ + /* These types are not supported by Squirrel. */ + case nlohmann::json::value_t::number_float: + default: + return false; + } - const char *value = p++; - for (;;) { - switch (*p++) { - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': case '0': - continue; + return true; +} - default: - break; - } +SQInteger ScriptEventAdminPort::GetObject(HSQUIRRELVM vm) +{ + auto json = nlohmann::json::parse(this->json, nullptr, false); - p--; - break; - } + if (!json.is_object()) { + ScriptLog::Error("The root element in the JSON data from AdminPort has to be an object."); + + sq_pushnull(vm); + return 1; + } - int res = atoi(value); - sq_pushinteger(vm, (SQInteger)res); + auto top = sq_gettop(vm); + if (!ScriptEventAdminPortReadValue(vm, json)) { + /* Rewind the stack, removing anything that might be left on top. */ + sq_settop(vm, top); - break; - } + ScriptLog::Error("Received invalid JSON data from AdminPort."); - default: - RETURN_ERROR(0); + sq_pushnull(vm); + return 1; } - return p; + return 1; } - -#undef SKIP_EMPTY -#undef RETURN_ERROR diff --git a/src/script/api/script_event_types.hpp b/src/script/api/script_event_types.hpp index c43fff0781..bbb940b7d7 100644 --- a/src/script/api/script_event_types.hpp +++ b/src/script/api/script_event_types.hpp @@ -911,27 +911,6 @@ public: private: std::string json; ///< The JSON string. - - /** - * Read a table from a JSON string. - * @param vm The VM used. - * @param p The (part of the) JSON string reading. - */ - const char *ReadTable(HSQUIRRELVM vm, const char *p); - - /** - * Read a value from a JSON string. - * @param vm The VM used. - * @param p The (part of the) JSON string reading. - */ - const char *ReadValue(HSQUIRRELVM vm, const char *p); - - /** - * Read a string from a JSON string. - * @param vm The VM used. - * @param p The (part of the) JSON string reading. - */ - const char *ReadString(HSQUIRRELVM vm, const char *p); }; /** diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp index bc4295a701..9ac1be9b77 100644 --- a/src/script/api/script_rail.cpp +++ b/src/script/api/script_rail.cpp @@ -69,7 +69,7 @@ EnforceDeityOrCompanyModeValid(false); if ((::RailType)rail_type >= RAILTYPE_END) return false; - return ScriptCompanyMode::IsDeity() || ::HasRailtypeAvail(ScriptObject::GetCompany(), (::RailType)rail_type); + return ScriptCompanyMode::IsDeity() || ::HasRailTypeAvail(ScriptObject::GetCompany(), (::RailType)rail_type); } /* static */ ScriptRail::RailType ScriptRail::GetCurrentRailType() diff --git a/src/script/api/script_railtypelist.cpp b/src/script/api/script_railtypelist.cpp index cfc0b3b550..7bf55dca4b 100644 --- a/src/script/api/script_railtypelist.cpp +++ b/src/script/api/script_railtypelist.cpp @@ -18,6 +18,6 @@ ScriptRailTypeList::ScriptRailTypeList() { EnforceDeityOrCompanyModeValid_Void(); for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) { - if (ScriptCompanyMode::IsDeity() || ::HasRailtypeAvail(ScriptObject::GetCompany(), rt)) this->AddItem(rt); + if (ScriptCompanyMode::IsDeity() || ::HasRailTypeAvail(ScriptObject::GetCompany(), rt)) this->AddItem(rt); } } diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index 3d0c9e1797..a685d3b0a1 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -272,7 +272,7 @@ static WindowDesc _script_list_desc( WDP_CENTER, "settings_script_list", 200, 234, WC_SCRIPT_LIST, WC_NONE, 0, - _nested_script_list_widgets, lengthof(_nested_script_list_widgets) + std::begin(_nested_script_list_widgets), std::end(_nested_script_list_widgets) ); /** @@ -625,7 +625,7 @@ static WindowDesc _script_settings_desc( WDP_CENTER, "settings_script", 500, 208, WC_SCRIPT_SETTINGS, WC_NONE, 0, - _nested_script_settings_widgets, lengthof(_nested_script_settings_widgets) + std::begin(_nested_script_settings_widgets), std::end(_nested_script_settings_widgets) ); /** @@ -1224,7 +1224,7 @@ static WindowDesc _script_debug_desc( WDP_AUTO, "script_debug", 600, 450, WC_SCRIPT_DEBUG, WC_NONE, 0, - _nested_script_debug_widgets, lengthof(_nested_script_debug_widgets), + std::begin(_nested_script_debug_widgets), std::end(_nested_script_debug_widgets), &ScriptDebugWindow::hotkeys ); diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 297373e242..0749b5d55a 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -994,7 +994,7 @@ static WindowDesc _game_options_desc( WDP_CENTER, nullptr, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, - _nested_game_options_widgets, lengthof(_nested_game_options_widgets) + std::begin(_nested_game_options_widgets), std::end(_nested_game_options_widgets) ); /** Open the game options window. */ @@ -2302,6 +2302,7 @@ static SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("station.distant_join_stations")); limitations->Add(new SettingEntry("construction.road_stop_on_town_road")); limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road")); + limitations->Add(new SettingEntry("construction.crossing_with_competitor")); limitations->Add(new SettingEntry("construction.convert_town_road_no_houses")); limitations->Add(new SettingEntry("vehicle.disable_elrails")); limitations->Add(new SettingEntry("construction.maximum_signal_evaluations")); @@ -3199,7 +3200,7 @@ static WindowDesc _settings_selection_desc( WDP_CENTER, "settings", 510, 450, WC_GAME_OPTIONS, WC_NONE, 0, - _nested_settings_selection_widgets, lengthof(_nested_settings_selection_widgets) + std::begin(_nested_settings_selection_widgets), std::end(_nested_settings_selection_widgets) ); /** Open advanced settings window. */ @@ -3498,7 +3499,7 @@ static WindowDesc _cust_currency_desc( WDP_CENTER, nullptr, 0, 0, WC_CUSTOM_CURRENCY, WC_NONE, 0, - _nested_cust_currency_widgets, lengthof(_nested_cust_currency_widgets) + std::begin(_nested_cust_currency_widgets), std::end(_nested_cust_currency_widgets) ); /** Open custom currency window. */ diff --git a/src/settings_type.h b/src/settings_type.h index f760d0b7a0..c62f791577 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -481,6 +481,7 @@ struct ConstructionSettings { bool extra_dynamite; ///< extra dynamite bool road_stop_on_town_road; ///< allow building of drive-through road stops on town owned roads bool road_stop_on_competitor_road; ///< allow building of drive-through road stops on roads owned by competitors + bool crossing_with_competitor; ///< allow building of level crossings with competitor roads or rails uint8 raw_industry_construction; ///< type of (raw) industry construction (none, "normal", prospecting) uint8 industry_platform; ///< the amount of flat land around an industry bool freeform_edges; ///< allow terraforming the tiles at the map edges diff --git a/src/signal.cpp b/src/signal.cpp index 11920677de..d53fc3d4a7 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -1783,7 +1783,7 @@ static bool DetermineExtraAspectsVariable() if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) { for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) { - const RailtypeInfo *rti = GetRailTypeInfo(r); + const RailTypeInfo *rti = GetRailTypeInfo(r); new_extra_aspects = std::max(new_extra_aspects, rti->signal_extra_aspects); } for (const GRFFile *grf : _new_signals_grfs) { diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 4160a80da1..cec477595c 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -390,7 +390,7 @@ static WindowDesc _sign_list_desc( WDP_AUTO, "list_signs", 358, 138, WC_SIGN_LIST, WC_NONE, 0, - _nested_sign_list_widgets, lengthof(_nested_sign_list_widgets), + std::begin(_nested_sign_list_widgets), std::end(_nested_sign_list_widgets), &SignListWindow::hotkeys ); @@ -556,7 +556,7 @@ static WindowDesc _query_sign_edit_desc( WDP_CENTER, nullptr, 0, 0, WC_QUERY_STRING, WC_NONE, WDF_CONSTRUCTION, - _nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets) + std::begin(_nested_query_sign_edit_widgets), std::end(_nested_query_sign_edit_widgets) ); /** diff --git a/src/sl/industry_sl.cpp b/src/sl/industry_sl.cpp index c75674069e..7b5109e646 100644 --- a/src/sl/industry_sl.cpp +++ b/src/sl/industry_sl.cpp @@ -111,7 +111,7 @@ static void Load_INDY() /* Store the old persistent storage. The GRFID will be added later. */ assert(PersistentStorage::CanAllocateItem()); i->psa = new PersistentStorage(0, 0, 0); - memcpy(i->psa->storage, _old_ind_persistent_storage.storage, sizeof(_old_ind_persistent_storage.storage)); + std::copy(std::begin(_old_ind_persistent_storage.storage), std::end(_old_ind_persistent_storage.storage), std::begin(i->psa->storage)); } Industry::IncIndustryTypeCount(i->type); } diff --git a/src/sl/labelmaps_sl.cpp b/src/sl/labelmaps_sl.cpp index 9d8c084b94..cc6f8344cd 100644 --- a/src/sl/labelmaps_sl.cpp +++ b/src/sl/labelmaps_sl.cpp @@ -27,7 +27,7 @@ static bool NeedRailTypeConversion() { for (uint i = 0; i < _railtype_list.size(); i++) { if ((RailType)i < RAILTYPE_END) { - const RailtypeInfo *rti = GetRailTypeInfo((RailType)i); + const RailTypeInfo *rti = GetRailTypeInfo((RailType)i); if (rti->label != _railtype_list[i]) return true; } else { if (_railtype_list[i] != 0) return true; diff --git a/src/sl/station_sl.cpp b/src/sl/station_sl.cpp index 51a439bf95..3e9e83016b 100644 --- a/src/sl/station_sl.cpp +++ b/src/sl/station_sl.cpp @@ -656,7 +656,7 @@ static void Load_STNN() /* Store the old persistent storage. The GRFID will be added later. */ assert(PersistentStorage::CanAllocateItem()); st->airport.psa = new PersistentStorage(0, 0, 0); - memcpy(st->airport.psa->storage, _old_st_persistent_storage.storage, sizeof(_old_st_persistent_storage.storage)); + std::copy(std::begin(_old_st_persistent_storage.storage), std::end(_old_st_persistent_storage.storage), std::begin(st->airport.psa->storage)); } for (CargoID i = 0; i < num_cargo; i++) { diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 6e31ef978d..98204bebde 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1870,8 +1870,8 @@ static NWidgetBase *SmallMapDisplay(int *biggest_index) { NWidgetContainer *map_display = new NWidgetSmallmapDisplay; - MakeNWidgets(_nested_smallmap_display, lengthof(_nested_smallmap_display), biggest_index, map_display); - MakeNWidgets(_nested_smallmap_bar, lengthof(_nested_smallmap_bar), biggest_index, map_display); + MakeNWidgets(std::begin(_nested_smallmap_display), std::end(_nested_smallmap_display), biggest_index, map_display); + MakeNWidgets(std::begin(_nested_smallmap_bar), std::end(_nested_smallmap_bar), biggest_index, map_display); return map_display; } @@ -1907,7 +1907,7 @@ static WindowDesc _smallmap_desc( WDP_AUTO, "smallmap", 484, 314, WC_SMALLMAP, WC_NONE, 0, - _nested_smallmap_widgets, lengthof(_nested_smallmap_widgets) + std::begin(_nested_smallmap_widgets), std::end(_nested_smallmap_widgets) ); /** diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 03faf4ac6a..a3c8c8d571 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1492,7 +1492,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 CommandCost ret = CheckIfAuthorityAllowsNewStation(tile_org, flags); if (ret.Failed()) return ret; - if (!ValParamRailtype(rt)) return CMD_ERROR; + if (!ValParamRailType(rt)) 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; @@ -3333,7 +3333,7 @@ static void DrawTile_Station(TileInfo *ti, DrawTileProcParams params) DrawTileSprites tmp_rail_layout; const DrawTileSprites *t = nullptr; int32 total_offset; - const RailtypeInfo *rti = nullptr; + const RailTypeInfo *rti = nullptr; uint32 relocation = 0; uint32 ground_relocation = 0; BaseStation *st = nullptr; @@ -3644,7 +3644,7 @@ void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, Ro int32 total_offset = 0; PaletteID pal = COMPANY_SPRITE_COLOUR(_local_company); const DrawTileSprites *t = GetStationTileLayout(st, image); - const RailtypeInfo *railtype_info = nullptr; + const RailTypeInfo *railtype_info = nullptr; if (railtype != INVALID_RAILTYPE) { railtype_info = GetRailTypeInfo(railtype); @@ -3752,7 +3752,7 @@ void FillTileDescRailStation(TileIndex tile, TileDesc *td) } } - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(tile)); td->rail_speed = rti->max_speed; td->railtype = rti->strings.name; } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index f0e0d5dc73..bae20c7b06 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -869,7 +869,7 @@ static WindowDesc _company_stations_desc( WDP_AUTO, "list_stations", 358, 162, WC_STATION_LIST, WC_NONE, 0, - _nested_company_stations_widgets, lengthof(_nested_company_stations_widgets) + std::begin(_nested_company_stations_widgets), std::end(_nested_company_stations_widgets) ); /** @@ -2389,7 +2389,7 @@ static WindowDesc _station_view_desc( WDP_AUTO, "view_station", 249, 117, WC_STATION_VIEW, WC_NONE, 0, - _nested_station_view_widgets, lengthof(_nested_station_view_widgets) + std::begin(_nested_station_view_widgets), std::end(_nested_station_view_widgets) ); /** @@ -2666,7 +2666,7 @@ static WindowDesc _select_station_desc( WDP_AUTO, "build_station_join", 200, 180, WC_SELECT_STATION, WC_NONE, WDF_CONSTRUCTION, - _nested_select_station_widgets, lengthof(_nested_select_station_widgets) + std::begin(_nested_select_station_widgets), std::end(_nested_select_station_widgets) ); @@ -2750,7 +2750,7 @@ static WindowDesc _station_rating_tooltip_desc( WDP_MANUAL, nullptr, 0, 0, WC_STATION_RATING_TOOLTIP, WC_NONE, 0, - _nested_station_rating_tooltip_widgets, lengthof(_nested_station_rating_tooltip_widgets) + std::begin(_nested_station_rating_tooltip_widgets), std::end(_nested_station_rating_tooltip_widgets) ); bool GetNewGrfRating(const Station *st, const CargoSpec *cs, const GoodsEntry *ge, int *new_grf_rating); diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 55f16e8aa3..5f616208e1 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -243,7 +243,7 @@ static WindowDesc _main_status_desc( WDP_MANUAL, nullptr, 0, 0, WC_STATUS_BAR, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, - _nested_main_status_widgets, lengthof(_nested_main_status_widgets) + std::begin(_nested_main_status_widgets), std::end(_nested_main_status_widgets) ); /** diff --git a/src/stdafx.h b/src/stdafx.h index 1651636388..6bb69359df 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -464,6 +464,10 @@ const char *assert_tile_info(uint32 tile); # define dbg_assert_tile(expression, tile) #endif +/* Define JSON_ASSERT, which is used by nlohmann-json. Otherwise the header-file + * will re-include assert.h, and reset the assert macro. */ +#define JSON_ASSERT(x) assert(x) + #if defined(MAX_PATH) /* It's already defined, no need to override */ #elif defined(PATH_MAX) && PATH_MAX > 0 diff --git a/src/story_gui.cpp b/src/story_gui.cpp index b91b4c7650..0340252944 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -975,7 +975,7 @@ static WindowDesc _story_book_desc( WDP_CENTER, "view_story", 400, 300, WC_STORY_BOOK, WC_NONE, 0, - _nested_story_book_widgets, lengthof(_nested_story_book_widgets) + std::begin(_nested_story_book_widgets), std::end(_nested_story_book_widgets) ); static CursorID TranslateStoryPageButtonCursor(StoryPageButtonCursor cursor) diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index d5533a208d..f57b6a1890 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -235,7 +235,7 @@ static WindowDesc _subsidies_list_desc( WDP_AUTO, "list_subsidies", 500, 127, WC_SUBSIDIES_LIST, WC_NONE, 0, - _nested_subsidies_list_widgets, lengthof(_nested_subsidies_list_widgets) + std::begin(_nested_subsidies_list_widgets), std::end(_nested_subsidies_list_widgets) ); diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index ae177d2942..6f5edb8b54 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -85,7 +85,7 @@ static void DumpRailTypeList(NIExtraInfoOutput &output, const char *prefix, Rail char buffer[256]; for (RailType rt = RAILTYPE_BEGIN; rt < RAILTYPE_END; rt++) { if (!HasBit(rail_types, rt)) continue; - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); if (rti->label == 0) continue; seprintf(buffer, lastof(buffer), "%s%02u %s%s", @@ -595,7 +595,7 @@ class NIHVehicle : public NIHelper { } if (e->type == VEH_TRAIN) { - const RailtypeInfo *rti = GetRailTypeInfo(e->u.rail.railtype); + const RailTypeInfo *rti = GetRailTypeInfo(e->u.rail.railtype); seprintf(buffer, lastof(buffer), " Railtype: %u (%s), Compatible: 0x" OTTD_PRINTFHEX64 ", Powered: 0x" OTTD_PRINTFHEX64 ", All compatible: 0x" OTTD_PRINTFHEX64, e->u.rail.railtype, dumper().RailTypeLabel(e->u.rail.railtype), rti->compatible_railtypes, rti->powered_railtypes, rti->all_compatible_railtypes); output.print(buffer); @@ -1617,7 +1617,7 @@ class NIHRailType : public NIHelper { RailType secondary = GetTileSecondaryRailTypeIfValid(index); auto writeRailType = [&](RailType type) { - const RailtypeInfo *info = GetRailTypeInfo(type); + const RailTypeInfo *info = GetRailTypeInfo(type); seprintf(buffer, lastof(buffer), " Type: %u (%s)", type, dumper().RailTypeLabel(type)); output.print(buffer); seprintf(buffer, lastof(buffer), " Flags: %c%c%c%c%c%c", diff --git a/src/table/railtypes.h b/src/table/railtypes.h index e558926cd6..db78ccb925 100644 --- a/src/table/railtypes.h +++ b/src/table/railtypes.h @@ -16,7 +16,7 @@ /** * Global Railtype definition */ -static const RailtypeInfo _original_railtypes[] = { +static const RailTypeInfo _original_railtypes[] = { /** Railway */ { // Main Sprites { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y, diff --git a/src/table/settings/world_settings.ini b/src/table/settings/world_settings.ini index e55900dd3e..69e850ef60 100644 --- a/src/table/settings/world_settings.ini +++ b/src/table/settings/world_settings.ini @@ -756,6 +756,13 @@ str = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD strhelp = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT cat = SC_BASIC +[SDT_BOOL] +var = construction.crossing_with_competitor +def = true +str = STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR +strhelp = STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT +cat = SC_BASIC + [SDT_BOOL] var = construction.road_custom_bridge_heads flags = SF_PATCH diff --git a/src/tbtr_template_gui_create.cpp b/src/tbtr_template_gui_create.cpp index c51386e0de..b751189078 100644 --- a/src/tbtr_template_gui_create.cpp +++ b/src/tbtr_template_gui_create.cpp @@ -102,7 +102,7 @@ static WindowDesc _template_create_window_desc( WC_CREATE_TEMPLATE, // window class WC_TEMPLATEGUI_MAIN, // parent window class WDF_CONSTRUCTION, // window flags - _widgets, lengthof(_widgets) // widgets + num widgets + std::begin(_widgets), std::end(_widgets) ); void ShowTemplateTrainBuildVehicleWindow(Train **virtual_train); diff --git a/src/tbtr_template_gui_main.cpp b/src/tbtr_template_gui_main.cpp index eccece5b8f..74b13a8fc4 100644 --- a/src/tbtr_template_gui_main.cpp +++ b/src/tbtr_template_gui_main.cpp @@ -184,7 +184,7 @@ static WindowDesc _replace_rail_vehicle_desc( WC_TEMPLATEGUI_MAIN, WC_NONE, // parent window class WDF_CONSTRUCTION, - _widgets, lengthof(_widgets) + std::begin(_widgets), std::end(_widgets) ); enum { @@ -292,7 +292,7 @@ public: case TRW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: { Dimension d = GetStringBoundingBox(STR_REPLACE_ALL_RAILTYPE); for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) { - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); // Skip rail type if it has no label if (rti->label == 0) continue; d = maxdim(d, GetStringBoundingBox(rti->strings.replace_text)); diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 2bc996cf96..3fc8d26cbc 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -423,7 +423,7 @@ static WindowDesc _terraform_desc( WDP_MANUAL, "toolbar_landscape", 0, 0, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, - _nested_terraform_widgets, lengthof(_nested_terraform_widgets), + std::begin(_nested_terraform_widgets), std::end(_nested_terraform_widgets), &TerraformToolbarWindow::hotkeys ); @@ -856,7 +856,7 @@ static WindowDesc _scen_edit_land_gen_desc( WDP_AUTO, "toolbar_landscape_scen", 0, 0, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, - _nested_scen_edit_land_gen_widgets, lengthof(_nested_scen_edit_land_gen_widgets), + std::begin(_nested_scen_edit_land_gen_widgets), std::end(_nested_scen_edit_land_gen_widgets), &ScenarioEditorLandscapeGenerationWindow::hotkeys ); diff --git a/src/textbuf.cpp b/src/textbuf.cpp index 23fb0f4ed2..4c2e28166f 100644 --- a/src/textbuf.cpp +++ b/src/textbuf.cpp @@ -285,6 +285,15 @@ void Textbuf::DiscardMarkedText(bool update) this->markpos = this->markend = this->markxoffs = this->marklength = 0; } +/** + * Get the current text. + * @return Current text. + */ +const char *Textbuf::GetText() const +{ + return this->buf; +} + /** Update the character iter after the text has changed. */ void Textbuf::UpdateStringIter() { diff --git a/src/textbuf_type.h b/src/textbuf_type.h index 61bd903022..2dc78c871e 100644 --- a/src/textbuf_type.h +++ b/src/textbuf_type.h @@ -67,6 +67,8 @@ struct Textbuf { void DiscardMarkedText(bool update = true); + const char *GetText() const; + private: std::unique_ptr char_iter; diff --git a/src/texteff.hpp b/src/texteff.hpp index 1849af70e7..93e1f9fbc9 100644 --- a/src/texteff.hpp +++ b/src/texteff.hpp @@ -19,14 +19,14 @@ struct ViewportDrawerDynamic; /** * Text effect modes. */ -enum TextEffectMode { +enum TextEffectMode : uint8_t { TE_RISING, ///< Make the text effect slowly go upwards TE_STATIC, ///< Keep the text effect static - - INVALID_TE_ID = 0xFFFF, }; -typedef size_t TextEffectID; +using TextEffectID = uint16_t; + +static const TextEffectID INVALID_TE_ID = UINT16_MAX; void MoveAllTextEffects(uint delta_ms); TextEffectID AddTextEffect(StringID msg, int x, int y, uint8 duration, TextEffectMode mode); diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index fe68f22c80..a89d70fa1f 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -15,10 +15,16 @@ #include "gfx_func.h" #include "string_func.h" #include "textfile_gui.h" +#include "widgets/dropdown_type.h" +#include "gfx_layout.h" +#include "debug.h" +#include "debug_fmt.h" +#include "openttd.h" #include "widgets/misc_widget.h" #include "table/strings.h" +#include "table/control_codes.h" #if defined(WITH_ZLIB) #include @@ -28,16 +34,33 @@ #include #endif +#include + #include "safeguards.h" /** Widgets for the textfile window. */ static const NWidgetPart _nested_textfile_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), + NWidget(WWT_PUSHARROWBTN, COLOUR_MAUVE, WID_TF_NAVBACK), SetFill(0, 1), SetMinimalSize(15, 1), SetDataTip(AWV_DECREASE, STR_TEXTFILE_NAVBACK_TOOLTIP), + NWidget(WWT_PUSHARROWBTN, COLOUR_MAUVE, WID_TF_NAVFORWARD), SetFill(0, 1), SetMinimalSize(15, 1), SetDataTip(AWV_INCREASE, STR_TEXTFILE_NAVFORWARD_TOOLTIP), NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_TF_CAPTION), SetDataTip(STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_TEXTBTN, COLOUR_MAUVE, WID_TF_WRAPTEXT), SetDataTip(STR_TEXTFILE_WRAP_TEXT, STR_TEXTFILE_WRAP_TEXT_TOOLTIP), NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE), EndContainer(), + NWidget(NWID_SELECTION, INVALID_COLOUR, WID_TF_SEL_JUMPLIST), + NWidget(WWT_PANEL, COLOUR_MAUVE), + NWidget(NWID_HORIZONTAL), SetPIP(WidgetDimensions::unscaled.frametext.left, 0, WidgetDimensions::unscaled.frametext.right), + /* As this widget can be toggled, it needs to be a multiplier of FS_MONO. So add a spacer that ensures this. */ + NWidget(NWID_SPACER), SetMinimalSize(1, 0), SetMinimalTextLines(2, 0, FS_MONO), + NWidget(NWID_VERTICAL), + NWidget(NWID_SPACER), SetFill(1, 1), SetResize(1, 0), + NWidget(WWT_DROPDOWN, COLOUR_MAUVE, WID_TF_JUMPLIST), SetDataTip(STR_TEXTFILE_JUMPLIST, STR_TEXTFILE_JUMPLIST_TOOLTIP), SetFill(1, 0), SetResize(1, 0), + NWidget(NWID_SPACER), SetFill(1, 1), SetResize(1, 0), + EndContainer(), + EndContainer(), + EndContainer(), + EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_MAUVE, WID_TF_BACKGROUND), SetMinimalSize(200, 125), SetResize(1, 12), SetScrollbar(WID_TF_VSCROLLBAR), EndContainer(), @@ -56,7 +79,7 @@ static WindowDesc _textfile_desc( WDP_CENTER, "textfile", 630, 460, WC_TEXTFILE, WC_NONE, 0, - _nested_textfile_widgets, lengthof(_nested_textfile_widgets) + std::begin(_nested_textfile_widgets), std::end(_nested_textfile_widgets) ); TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc), file_type(file_type) @@ -66,7 +89,10 @@ TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc) this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR); this->FinishInitNested(file_type); this->GetWidget(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); + this->GetWidget(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(SZSP_HORIZONTAL); + this->DisableWidget(WID_TF_NAVBACK); + this->DisableWidget(WID_TF_NAVFORWARD); this->hscroll->SetStepSize(10); // Speed up horizontal scrollbar } @@ -130,6 +156,367 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) this->SetWidgetDisabledState(WID_TF_HSCROLLBAR, IsWidgetLowered(WID_TF_WRAPTEXT)); } + +/** Regular expression that searches for Markdown links. */ +static const std::regex _markdown_link_regex{"\\[(.+?)\\]\\((.+?)\\)", std::regex_constants::ECMAScript | std::regex_constants::optimize}; + +/** Types of link we support in markdown files. */ +enum class LinkType { + Internal, ///< Internal link, or "anchor" in HTML language. + Web, ///< Link to an external website. + File, ///< Link to a local file. + Unknown, ///< Unknown link. +}; + +/** + * Classify the type of hyperlink the destination describes. + * + * @param destination The hyperlink destination. + * @param trusted Whether we trust the content of this file. + * @return LinkType The classification of the link. + */ +static LinkType ClassifyHyperlink(const std::string &destination, bool trusted) +{ + if (destination.empty()) return LinkType::Unknown; + if (StrStartsWith(destination, "#")) return LinkType::Internal; + + /* Only allow external / internal links for sources we trust. */ + if (!trusted) return LinkType::Unknown; + + if (StrStartsWith(destination, "http://")) return LinkType::Web; + if (StrStartsWith(destination, "https://")) return LinkType::Web; + if (StrStartsWith(destination, "./")) return LinkType::File; + return LinkType::Unknown; +} + +/** + * Create a valid slug for the anchor. + * + * @param line The line to create the slug for. + * @return std::string The slug. + */ +static std::string MakeAnchorSlug(const std::string &line) +{ + std::string r = "#"; + uint state = 0; + for (char c : line) { + if (state == 0) { + /* State 0: Skip leading hashmarks and spaces. */ + if (c == '#') continue; + if (c == ' ') continue; + state = 1; + } + if (state == 2) { + /* State 2: Wait for a non-space/dash character. + * When found, output a dash and that character. */ + if (c == ' ' || c == '-') continue; + r += '-'; + state = 1; + } + if (state == 1) { + /* State 1: Normal text. + * Lowercase alphanumerics, + * spaces and dashes become dashes, + * everything else is removed. */ + if (isalnum(c)) { + r += tolower(c); + } else if (c == ' ' || c == '-') { + state = 2; + } + } + } + + return r; +} + +/** + * Find any hyperlinks in a given line. + * + * @param line The line to search for hyperlinks. + * @param line_index The index of the line. + */ +void TextfileWindow::FindHyperlinksInMarkdown(Line &line, size_t line_index) +{ + std::string::const_iterator last_match_end = line.text.cbegin(); + std::string fixed_line; + char ccbuf[5]; + + std::sregex_iterator matcher{ line.text.cbegin(), line.text.cend(), _markdown_link_regex}; + while (matcher != std::sregex_iterator()) { + std::smatch match = *matcher; + + Hyperlink link; + link.line = line_index; + link.destination = match[2].str(); + this->links.push_back(link); + + LinkType link_type = ClassifyHyperlink(link.destination, this->trusted); + StringControlCode link_colour; + switch (link_type) { + case LinkType::Internal: + link_colour = SCC_GREEN; + break; + case LinkType::Web: + link_colour = SCC_LTBLUE; + break; + case LinkType::File: + link_colour = SCC_LTBROWN; + break; + default: + /* Don't make other link types fancy as they aren't handled (yet). */ + link_colour = SCC_CONTROL_END; + break; + } + + if (link_colour != SCC_CONTROL_END) { + /* Format the link to look like a link. */ + fixed_line += std::string(last_match_end, match[0].first); + this->links.back().begin = fixed_line.length(); + fixed_line += std::string(ccbuf, Utf8Encode(ccbuf, SCC_PUSH_COLOUR)); + fixed_line += std::string(ccbuf, Utf8Encode(ccbuf, link_colour)); + fixed_line += match[1].str(); + this->links.back().end = fixed_line.length(); + fixed_line += std::string(ccbuf, Utf8Encode(ccbuf, SCC_POP_COLOUR)); + last_match_end = match[0].second; + } + + /* Find next link. */ + ++matcher; + } + if (last_match_end == line.text.cbegin()) return; // nothing found + + /* Add remaining text on line. */ + fixed_line += std::string(last_match_end, line.text.cend()); + + /* Overwrite original line text with "fixed" line text. */ + line.text = fixed_line; +} + +/** + * Check if the user clicked on a hyperlink, and handle it if so. + * + * @param pt The loation the user clicked. + */ +void TextfileWindow::CheckHyperlinkClick(Point pt) +{ + if (this->links.empty()) return; + + /* Which line was clicked. */ + const int clicked_row = this->GetRowFromWidget(pt.y, WID_TF_BACKGROUND, WidgetDimensions::scaled.frametext.top, FONT_HEIGHT_MONO) + this->GetScrollbar(WID_TF_VSCROLLBAR)->GetPosition(); + size_t line_index; + size_t subline; + if (IsWidgetLowered(WID_TF_WRAPTEXT)) { + auto it = std::find_if(std::begin(this->lines), std::end(this->lines), [clicked_row](const Line &l) { return l.top <= clicked_row && l.bottom > clicked_row; }); + if (it == this->lines.cend()) return; + line_index = it - this->lines.cbegin(); + subline = clicked_row - it->top; + Debug(misc, 4, "TextfileWindow check hyperlink: clicked_row={}, line_index={}, line.top={}, subline={}", clicked_row, line_index, it->top, subline); + } else { + line_index = clicked_row / FONT_HEIGHT_MONO; + subline = 0; + } + + /* Find hyperlinks in this line. */ + std::vector found_links; + for (const auto &link : this->links) { + if (link.line == line_index) found_links.push_back(link); + } + if (found_links.empty()) return; + + /* Build line layout to figure out character position that was clicked. */ + uint window_width = IsWidgetLowered(WID_TF_WRAPTEXT) ? this->GetWidget(WID_TF_BACKGROUND)->current_x - WidgetDimensions::scaled.frametext.Horizontal() : INT_MAX; + Layouter layout(this->lines[line_index].text, window_width, this->lines[line_index].colour, FS_MONO); + assert(subline < layout.size()); + ptrdiff_t char_index = layout.GetCharAtPosition(pt.x - WidgetDimensions::scaled.frametext.left, subline); + if (char_index < 0) return; + Debug(misc, 4, "TextfileWindow check hyperlink click: line={}, subline={}, char_index={}", line_index, subline, (int)char_index); + + /* Found character index in line, check if any links are at that position. */ + for (const auto &link : found_links) { + Debug(misc, 4, "Checking link from char {} to {}", link.begin, link.end); + if ((size_t)char_index >= link.begin && (size_t)char_index < link.end) { + Debug(misc, 4, "Activating link with destination: {}", link.destination); + this->OnHyperlinkClick(link); + return; + } + } +} + +/** + * Append the new location to the history, so the user can go back. + * + * @param filepath The location the user is navigating to. + */ +void TextfileWindow::AppendHistory(const std::string &filepath) +{ + this->history.erase(this->history.begin() + this->history_pos + 1, this->history.end()); + this->UpdateHistoryScrollpos(); + this->history.push_back(HistoryEntry{ filepath, 0 }); + this->EnableWidget(WID_TF_NAVBACK); + this->DisableWidget(WID_TF_NAVFORWARD); + this->history_pos = this->history.size() - 1; +} + +/** + * Update the scroll position to the current, so we can restore there if we go back. + */ +void TextfileWindow::UpdateHistoryScrollpos() +{ + this->history[this->history_pos].scrollpos = this->GetScrollbar(WID_TF_VSCROLLBAR)->GetPosition(); +} + +/** + * Navigate through the history, either forward or backward. + * + * @param delta The direction to navigate. + */ +void TextfileWindow::NavigateHistory(int delta) +{ + if (delta == 0) return; + if (delta < 0 && static_cast(this->history_pos) < -delta) return; + if (delta > 0 && this->history_pos + delta >= this->history.size()) return; + + this->UpdateHistoryScrollpos(); + this->history_pos += delta; + + if (this->history[this->history_pos].filepath != this->filepath) { + this->filepath = this->history[this->history_pos].filepath; + this->filename = this->filepath.substr(this->filepath.find_last_of(PATHSEP) + 1); + this->LoadTextfile(this->filepath, NO_DIRECTORY); + } + + this->SetWidgetDisabledState(WID_TF_NAVFORWARD, this->history_pos + 1 >= this->history.size()); + this->SetWidgetDisabledState(WID_TF_NAVBACK, this->history_pos == 0); + this->GetScrollbar(WID_TF_VSCROLLBAR)->SetPosition(this->history[this->history_pos].scrollpos); + this->GetScrollbar(WID_TF_HSCROLLBAR)->SetPosition(0); + this->SetDirty(); +} + +/* virtual */ void TextfileWindow::OnHyperlinkClick(const Hyperlink &link) +{ + switch (ClassifyHyperlink(link.destination, this->trusted)) { + case LinkType::Internal: + { + auto it = std::find_if(this->link_anchors.cbegin(), this->link_anchors.cend(), [&](const Hyperlink &other) { return link.destination == other.destination; }); + if (it != this->link_anchors.cend()) { + this->AppendHistory(this->filepath); + this->ScrollToLine(it->line); + this->UpdateHistoryScrollpos(); + } + break; + } + + case LinkType::Web: + OpenBrowser(link.destination.c_str()); + break; + + case LinkType::File: + this->NavigateToFile(link.destination, 0); + break; + + default: + /* Do nothing */ + break; + } +} + +/** + * Navigate to the requested file. + * + * @param newfile The file to navigate to. + * @param line The line to scroll to. + */ +void TextfileWindow::NavigateToFile(std::string newfile, size_t line) +{ + /* Double-check that the file link begins with ./ as a relative path. */ + if (!StrStartsWith(newfile, "./")) return; + + /* Get the path portion of the current file path. */ + std::string newpath = this->filepath; + size_t pos = newpath.find_last_of(PATHSEPCHAR); + if (pos == std::string::npos) { + newpath.clear(); + } else { + newpath.erase(pos + 1); + } + + /* Check and remove for anchor in link. Do this before we find the filename, as people might have a / after the hash. */ + size_t anchor_pos = newfile.find_first_of('#'); + std::string anchor; + if (anchor_pos != std::string::npos) { + anchor = newfile.substr(anchor_pos); + newfile.erase(anchor_pos); + } + + /* Now the anchor is gone, check if this is a markdown or textfile. */ + if (!StrEndsWithIgnoreCase(newfile, ".md") && !StrEndsWithIgnoreCase(newfile, ".txt")) return; + + /* Convert link destination to acceptable local filename (replace forward slashes with correct path separator). */ + newfile = newfile.substr(2); + if (PATHSEPCHAR != '/') { + for (char &c : newfile) { + if (c == '/') c = PATHSEPCHAR; + } + } + + /* Paste the two together and check file exists. */ + newpath = newpath + newfile; + if (!FioCheckFileExists(newpath, NO_DIRECTORY)) return; + + /* Update history. */ + this->AppendHistory(newpath); + + /* Load the new file. */ + this->filepath = newpath; + this->filename = newpath.substr(newpath.find_last_of(PATHSEP) + 1); + + this->LoadTextfile(this->filepath, NO_DIRECTORY); + + this->GetScrollbar(WID_TF_HSCROLLBAR)->SetPosition(0); + this->GetScrollbar(WID_TF_VSCROLLBAR)->SetPosition(0); + + if (anchor.empty() || line != 0) { + this->ScrollToLine(line); + } else { + auto anchor_dest = std::find_if(this->link_anchors.cbegin(), this->link_anchors.cend(), [&](const Hyperlink &other) { return anchor == other.destination; }); + if (anchor_dest != this->link_anchors.cend()) { + this->ScrollToLine(anchor_dest->line); + this->UpdateHistoryScrollpos(); + } else { + this->ScrollToLine(0); + } + } +} + +/* virtual */ void TextfileWindow::AfterLoadText() +{ + this->link_anchors.clear(); + + if (StrEndsWithIgnoreCase(this->filename, ".md")) this->AfterLoadMarkdown(); + + this->GetWidget(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(this->jumplist.empty() ? SZSP_HORIZONTAL : 0); +} + +/** + * Post-processing of markdown files. + */ +void TextfileWindow::AfterLoadMarkdown() +{ + for (size_t line_index = 0; line_index < this->lines.size(); ++line_index) { + Line &line = this->lines[line_index]; + + /* Find and mark all hyperlinks in the line. */ + this->FindHyperlinksInMarkdown(line, line_index); + + /* All lines beginning with # are headings. */ + if (!line.text.empty() && line.text[0] == '#') { + this->jumplist.push_back(line_index); + this->lines[line_index].colour = TC_GOLD; + this->link_anchors.emplace_back(Hyperlink{ line_index, 0, 0, MakeAnchorSlug(line.text) }); + } + } +} + /* virtual */ void TextfileWindow::OnClick(Point pt, int widget, int click_count) { switch (widget) { @@ -137,6 +524,29 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) this->ToggleWidgetLoweredState(WID_TF_WRAPTEXT); this->InvalidateData(); break; + + case WID_TF_JUMPLIST: { + DropDownList list; + for (size_t line : this->jumplist) { + SetDParamStr(0, this->lines[line].text); + DropDownListStringItem *item = new DropDownListStringItem(STR_TEXTFILE_JUMPLIST_ITEM, (int)line, false); + list.emplace_back(item); + } + ShowDropDownList(this, std::move(list), -1, widget); + break; + } + + case WID_TF_NAVBACK: + this->NavigateHistory(-1); + break; + + case WID_TF_NAVFORWARD: + this->NavigateHistory(+1); + break; + + case WID_TF_BACKGROUND: + this->CheckHyperlinkClick(pt); + break; } } @@ -162,9 +572,9 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) int y_offset = (line.top - pos) * line_height; if (IsWidgetLowered(WID_TF_WRAPTEXT)) { - DrawStringMultiLine(0, fr.right, y_offset, fr.bottom, line.text, TC_BLACK, SA_TOP | SA_LEFT, false, FS_MONO); + DrawStringMultiLine(0, fr.right, y_offset, fr.bottom, line.text, line.colour, SA_TOP | SA_LEFT, false, FS_MONO); } else { - DrawString(-this->hscroll->GetPosition(), fr.right, y_offset, line.text, TC_BLACK, SA_TOP | SA_LEFT, false, FS_MONO); + DrawString(-this->hscroll->GetPosition(), fr.right, y_offset, line.text, line.colour, SA_TOP | SA_LEFT, false, FS_MONO); } } } @@ -184,6 +594,26 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) this->SetupScrollbars(true); } +void TextfileWindow::OnDropdownSelect(int widget, int index) +{ + if (widget != WID_TF_JUMPLIST) return; + + this->ScrollToLine(index); +} + +void TextfileWindow::ScrollToLine(size_t line) +{ + Scrollbar *sb = this->GetScrollbar(WID_TF_VSCROLLBAR); + int newpos; + if (this->IsWidgetLowered(WID_TF_WRAPTEXT)) { + newpos = this->lines[line].top; + } else { + newpos = static_cast(line); + } + sb->SetPosition(std::min(newpos, sb->GetCount() - sb->GetCapacity())); + this->SetDirty(); +} + /* virtual */ void TextfileWindow::Reset() { this->search_iterator = 0; @@ -330,14 +760,20 @@ static void Xunzip(byte **bufp, size_t *sizep) */ /* virtual */ void TextfileWindow::LoadTextfile(const char *textfile, Subdirectory dir) { - if (textfile == nullptr) return; - this->lines.clear(); + this->jumplist.clear(); + + this->GetWidget(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(SZSP_HORIZONTAL); + this->ReInit(); + + if (textfile == nullptr) return; /* Get text from file */ size_t filesize; FILE *handle = FioFOpenFile(textfile, "rb", dir, &filesize); if (handle == nullptr) return; + /* Early return on empty files. */ + if (filesize == 0) return; char *buf = MallocT(filesize); size_t read = fread(buf, 1, filesize, handle); @@ -370,7 +806,13 @@ static void Xunzip(byte **bufp, size_t *sizep) /* Check for the byte-order-mark, and skip it if needed. */ if (StrStartsWith(sv_buf, u8"\ufeff")) sv_buf.remove_prefix(3); - /* Replace any invalid characters with a question-mark. This copies the buf in the process. */ + /* Update the filename. */ + this->filepath = textfile; + this->filename = this->filepath.substr(this->filepath.find_last_of(PATHSEP) + 1); + /* If it's the first file being loaded, add to history. */ + if (this->history.empty()) this->history.push_back(HistoryEntry{ this->filepath, 0 }); + + /* Process the loaded text into lines, and do any further parsing needed. */ this->LoadText(sv_buf); free(buf); } @@ -384,11 +826,11 @@ static void Xunzip(byte **bufp, size_t *sizep) */ void TextfileWindow::LoadText(std::string_view buf) { - this->text = StrMakeValid(buf, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE | SVS_REPLACE_TAB_CR_NL_WITH_SPACE); + std::string text = StrMakeValid(buf, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE | SVS_REPLACE_TAB_CR_NL_WITH_SPACE); this->lines.clear(); /* Split the string on newlines. */ - std::string_view p(this->text); + std::string_view p(text); int row = 0; auto next = p.find_first_of('\n'); while (next != std::string_view::npos) { @@ -407,6 +849,8 @@ void TextfileWindow::LoadText(std::string_view buf) } this->max_length = max_length; + this->AfterLoadText(); + CheckForMissingGlyphs(true, this); } @@ -426,6 +870,9 @@ const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filenam }; static_assert(lengthof(prefixes) == TFT_CONTENT_END); + /* Only the generic text file types allowed for this function */ + if (type >= TFT_CONTENT_END) return nullptr; + const char *prefix = prefixes[type]; if (filename == nullptr) return nullptr; @@ -438,11 +885,14 @@ const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filenam static const char * const exts[] = { "txt", + "md", #if defined(WITH_ZLIB) "txt.gz", + "md.gz", #endif #if defined(WITH_LIBLZMA) "txt.xz", + "md.xz", #endif }; diff --git a/src/textfile_gui.h b/src/textfile_gui.h index b2e71084cd..cecbeb4eae 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -29,9 +29,6 @@ struct TextfileWindow : public Window, MissingGlyphSearcher { TextfileType file_type; ///< Type of textfile to view. Scrollbar *vscroll; ///< Vertical scrollbar. Scrollbar *hscroll; ///< Horizontal scrollbar. - uint search_iterator; ///< Iterator for the font check search. - - uint max_length; ///< Maximum length of unwrapped text line. TextfileWindow(TextfileType file_type); @@ -40,33 +37,86 @@ struct TextfileWindow : public Window, MissingGlyphSearcher { void DrawWidget(const Rect &r, int widget) const override; void OnResize() override; void OnInvalidateData(int data = 0, bool gui_scope = true) override; + void OnDropdownSelect(int widget, int index) override; void Reset() override; FontSize DefaultSize() override; std::optional NextString() override; bool Monospace() override; void SetFontNames(FontCacheSettings *settings, const char *font_name, const void *os_data) override; + void ScrollToLine(size_t line); virtual void LoadTextfile(const char *textfile, Subdirectory dir); -protected: - void LoadText(std::string_view buf); + inline void LoadTextfile(const std::string &textfile, Subdirectory dir) + { + this->LoadTextfile(textfile.c_str(), dir); + } -private: +protected: struct Line { - int top; ///< Top scroll position. - int bottom; ///< Bottom scroll position. - std::string_view text; ///< Pointer to text buffer. + int top{0}; ///< Top scroll position in visual lines. + int bottom{0}; ///< Bottom scroll position in visual lines. + std::string text{}; ///< Contents of the line. + TextColour colour{TC_WHITE}; ///< Colour to render text line in. Line(int top, std::string_view text) : top(top), bottom(top + 1), text(text) {} + Line() {} + }; + + struct Hyperlink { + size_t line; ///< Which line the link is on. + size_t begin; ///< Character position on line the link begins. + size_t end; ///< Character position on line the link end. + std::string destination; ///< Destination for the link. + }; + + struct HistoryEntry { + std::string filepath; ///< File the history entry is in. + int scrollpos; ///< Scrolling position the file was at at navigation time. }; - std::string text; ///< Lines of text from the NewGRF's textfile. - std::vector lines; ///< #text, split into lines in a table with lines. + std::string filename{}; ///< Filename of the textfile. + std::string filepath{}; ///< Full path to the filename. + + std::vector lines; ///< #text, split into lines in a table with lines. + std::vector jumplist; ///< Table of contents list, line numbers. + std::vector links; ///< Clickable links in lines. + std::vector link_anchors; ///< Anchor names of headings that can be linked to. + std::vector history; ///< Browsing history in this window. + size_t history_pos{0}; ///< Position in browsing history (for forward movement). + bool trusted{false}; ///< Whether the content is trusted (read: not from content like NewGRFs, etc). + + void LoadText(std::string_view buf); + void FindHyperlinksInMarkdown(Line &line, size_t line_index); + + /** + * Handle the clicking on a hyperlink. + * + * @param link The link that is clicked on. + */ + virtual void OnHyperlinkClick(const Hyperlink &link); + + /** + * Post-processing after the text is loaded. + */ + virtual void AfterLoadText(); + + void NavigateToFile(std::string newfile, size_t line); + void AppendHistory(const std::string &filepath); + void UpdateHistoryScrollpos(); + void NavigateHistory(int delta); + +private: + uint search_iterator{0}; ///< Iterator for the font check search. + uint max_length{0}; ///< Maximum length of unwrapped text line. uint ReflowContent(); uint GetContentHeight(); void SetupScrollbars(bool force_reflow); + void CheckHyperlinkClick(Point pt); + + void AfterLoadMarkdown(); }; #endif /* TEXTFILE_GUI_H */ diff --git a/src/textfile_type.h b/src/textfile_type.h index f45c016440..a1c0c6569b 100644 --- a/src/textfile_type.h +++ b/src/textfile_type.h @@ -21,6 +21,9 @@ enum TextfileType { TFT_CONTENT_END, // This marker is used to generate the above three buttons in sequence by various of places in the code. TFT_SURVEY_RESULT = TFT_CONTENT_END, ///< Survey result (preview) + TFT_GAME_MANUAL, ///< Game manual/documentation file + + TFT_END, }; DECLARE_POSTFIX_INCREMENT(TextfileType) diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 10aa4cc7a1..6069bdd96a 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -1240,7 +1240,7 @@ static WindowDesc _timetable_desc( WDP_AUTO, "view_vehicle_timetable", 400, 130, WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, - _nested_timetable_widgets, lengthof(_nested_timetable_widgets) + std::begin(_nested_timetable_widgets), std::end(_nested_timetable_widgets) ); /** diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 9634fdc17c..53a93146d5 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -60,6 +60,7 @@ #include "newgrf_roadstop.h" #include "newgrf_station.h" #include "zoom_func.h" +#include "help_gui.h" #include "widgets/toolbar_widget.h" @@ -1122,7 +1123,9 @@ static CallBackFunction MenuClickNewspaper(int index) enum HelpMenuEntries { HME_LANDINFO = 0, HME_PICKER, - HME_CONSOLE = 3, + HME_SEPARATOR, + HME_HELP, + HME_CONSOLE, HME_SCRIPT_DEBUG, HME_SCREENSHOT, HME_FRAMERATE, @@ -1132,9 +1135,6 @@ enum HelpMenuEntries { HME_SPRITE_ALIGNER, HME_BOUNDING_BOXES, HME_DIRTY_BLOCKS, - - HME_LAST, - HME_LAST_NON_DEV = HME_SPRITE_ALIGNER, }; static void ShowBuildRailToolbarFromTile(TileIndex tile) @@ -1237,11 +1237,26 @@ static CallBackFunction PlacePickerTool() static CallBackFunction ToolbarHelpClick(Window *w) { - uint mask = 0; - if (_local_company == COMPANY_SPECTATOR) SetBit(mask, HME_PICKER); - int count = _settings_client.gui.newgrf_developer_tools ? HME_LAST : HME_LAST_NON_DEV; int widget = (_game_mode == GM_EDITOR) ? (int)WID_TE_HELP : (int)WID_TN_HELP; - PopupMainToolbMenu(w, widget, STR_ABOUT_MENU_LAND_BLOCK_INFO, count, mask); + + DropDownList list; + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_LAND_BLOCK_INFO, HME_LANDINFO, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_SHOW_PICKER_TOOL, HME_PICKER, _local_company == COMPANY_SPECTATOR)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_SEPARATOR, HME_SEPARATOR, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_HELP, HME_HELP, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_TOGGLE_CONSOLE, HME_CONSOLE, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_AI_DEBUG, HME_SCRIPT_DEBUG, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_SCREENSHOT, HME_SCREENSHOT, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_SHOW_FRAMERATE, HME_FRAMERATE, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_SHOW_TOGGLE_MODIFIER_KEYS, HME_MODIFIER_KEYS, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_ABOUT_OPENTTD, HME_ABOUT, false)); + if (_settings_client.gui.newgrf_developer_tools) { + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_SPRITE_ALIGNER, HME_SPRITE_ALIGNER, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES, HME_BOUNDING_BOXES, false)); + list.emplace_back(new DropDownListStringItem(STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS, HME_DIRTY_BLOCKS, false)); + } + PopupMainToolbMenu(w, widget, std::move(list), 0); + return CBF_NONE; } @@ -1305,6 +1320,7 @@ static CallBackFunction MenuClickHelp(int index) switch (index) { case HME_LANDINFO: return PlaceLandBlockInfo(); case HME_PICKER: return PlacePickerTool(); + case HME_HELP: ShowHelpWindow(); break; case HME_CONSOLE: IConsoleSwitch(); break; case HME_SCRIPT_DEBUG: ShowScriptDebugWindow(); break; case HME_SCREENSHOT: ShowScreenshotWindow(); break; @@ -2459,7 +2475,7 @@ static WindowDesc _toolb_normal_desc( WDP_MANUAL, nullptr, 0, 0, WC_MAIN_TOOLBAR, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, - _nested_toolbar_normal_widgets, lengthof(_nested_toolbar_normal_widgets), + std::begin(_nested_toolbar_normal_widgets), std::end(_nested_toolbar_normal_widgets), &MainToolbarWindow::hotkeys ); @@ -2813,7 +2829,7 @@ static const NWidgetPart _nested_toolb_scen_inner_widgets[] = { static NWidgetBase *MakeScenarioToolbar(int *biggest_index) { - return MakeNWidgets(_nested_toolb_scen_inner_widgets, lengthof(_nested_toolb_scen_inner_widgets), biggest_index, new NWidgetScenarioToolbarContainer()); + return MakeNWidgets(std::begin(_nested_toolb_scen_inner_widgets), std::end(_nested_toolb_scen_inner_widgets), biggest_index, new NWidgetScenarioToolbarContainer()); } static const NWidgetPart _nested_toolb_scen_widgets[] = { @@ -2824,7 +2840,7 @@ static WindowDesc _toolb_scen_desc( WDP_MANUAL, nullptr, 0, 0, WC_MAIN_TOOLBAR, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, - _nested_toolb_scen_widgets, lengthof(_nested_toolb_scen_widgets), + std::begin(_nested_toolb_scen_widgets), std::end(_nested_toolb_scen_widgets), &ScenarioEditorToolbarWindow::hotkeys ); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 0cb3ed600a..5082d726bd 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -503,7 +503,7 @@ static WindowDesc _town_authority_desc( WDP_AUTO, "view_town_authority", 317, 222, WC_TOWN_AUTHORITY, WC_NONE, 0, - _nested_town_authority_widgets, lengthof(_nested_town_authority_widgets) + std::begin(_nested_town_authority_widgets), std::end(_nested_town_authority_widgets) ); static void ShowTownAuthorityWindow(uint town) @@ -810,7 +810,7 @@ static WindowDesc _town_game_view_desc( WDP_AUTO, "view_town", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, 0, - _nested_town_game_view_widgets, lengthof(_nested_town_game_view_widgets) + std::begin(_nested_town_game_view_widgets), std::end(_nested_town_game_view_widgets) ); static const NWidgetPart _nested_town_editor_view_widgets[] = { @@ -842,7 +842,7 @@ static WindowDesc _town_editor_view_desc( WDP_AUTO, "view_town_scen", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, 0, - _nested_town_editor_view_widgets, lengthof(_nested_town_editor_view_widgets) + std::begin(_nested_town_editor_view_widgets), std::end(_nested_town_editor_view_widgets) ); void ShowTownViewWindow(TownID town) @@ -1221,7 +1221,7 @@ static WindowDesc _town_directory_desc( WDP_AUTO, "list_towns", 208, 202, WC_TOWN_DIRECTORY, WC_NONE, 0, - _nested_town_directory_widgets, lengthof(_nested_town_directory_widgets) + std::begin(_nested_town_directory_widgets), std::end(_nested_town_directory_widgets) ); void ShowTownDirectory() @@ -1472,7 +1472,7 @@ static WindowDesc _found_town_desc( WDP_AUTO, "build_town", 160, 162, WC_FOUND_TOWN, WC_NONE, WDF_CONSTRUCTION, - _nested_found_town_widgets, lengthof(_nested_found_town_widgets) + std::begin(_nested_found_town_widgets), std::end(_nested_found_town_widgets) ); void ShowFoundTownWindow() @@ -2044,7 +2044,7 @@ static WindowDesc _house_picker_desc( WDP_AUTO, "build_house", 0, 0, WC_BUILD_HOUSE, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, - _nested_house_picker_widgets, lengthof(_nested_house_picker_widgets) + std::begin(_nested_house_picker_widgets), std::end(_nested_house_picker_widgets) ); /** @@ -2145,7 +2145,7 @@ static WindowDesc _select_town_desc( WDP_AUTO, "select_town", 100, 0, WC_SELECT_TOWN, WC_NONE, WDF_CONSTRUCTION, - _nested_select_town_widgets, lengthof(_nested_select_town_widgets) + std::begin(_nested_select_town_widgets), std::end(_nested_select_town_widgets) ); static void ShowSelectTownWindow(const TownList &towns, const CommandContainer &cmd) diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index ef3b658c7d..f3de5cadf5 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -3619,7 +3619,7 @@ static WindowDesc _program_desc( WDP_AUTO, "trace_restrict_gui", 384, 100, WC_TRACE_RESTRICT, WC_BUILD_SIGNAL, WDF_CONSTRUCTION, - _nested_program_widgets, lengthof(_nested_program_widgets) + std::begin(_nested_program_widgets), std::end(_nested_program_widgets) ); /** @@ -4289,7 +4289,7 @@ static WindowDesc _slot_window_desc( WDP_AUTO, "list_groups_train", 525, 246, WC_TRACE_RESTRICT_SLOTS, WC_NONE, 0, - _nested_slot_widgets, lengthof(_nested_slot_widgets) + std::begin(_nested_slot_widgets), std::end(_nested_slot_widgets) ); /** @@ -4657,7 +4657,7 @@ static WindowDesc _counter_window_desc( WDP_AUTO, "list_tr_counters", 525, 246, WC_TRACE_RESTRICT_COUNTERS, WC_NONE, 0, - _nested_counter_widgets, lengthof(_nested_counter_widgets) + std::begin(_nested_counter_widgets), std::end(_nested_counter_widgets) ); /** diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 86a0b182c1..270d88df96 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -666,7 +666,7 @@ int Train::GetCurveSpeedLimit() const if (max_speed != absolute_max_speed) { /* Apply the current railtype's curve speed advantage */ - const RailtypeInfo *rti = GetRailTypeInfo(GetRailTypeByTrackBit(this->tile, this->track)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailTypeByTrackBit(this->tile, this->track)); max_speed += (max_speed / 2) * rti->curve_speed; if (this->tcache.cached_tflags & TCF_TILT) { diff --git a/src/train_gui.cpp b/src/train_gui.cpp index c17624072a..bd64c62dc8 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -325,9 +325,9 @@ static void TrainDetailsCapacityTab(const CargoSummaryItem *item, int left, int * @param v Vehicle to process * @param summary Space for the result */ -static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *summary) +static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary &summary) { - summary->clear(); + summary.clear(); do { if (!v->GetEngine()->CanCarryCargo()) continue; @@ -336,10 +336,9 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *su new_item.subtype = GetCargoSubtypeText(v); if (new_item.cargo == INVALID_CARGO && new_item.subtype == STR_EMPTY) continue; - auto item = std::find(summary->begin(), summary->end(), new_item); - if (item == summary->end()) { - summary->emplace_back(); - item = summary->end() - 1; + auto item = std::find(std::begin(summary), std::end(summary), new_item); + if (item == std::end(summary)) { + item = summary.emplace(std::end(summary)); item->cargo = new_item.cargo; item->subtype = new_item.subtype; item->capacity = 0; @@ -394,7 +393,7 @@ int GetTrainDetailsWndVScroll(VehicleID veh_id, TrainDetailsWindowTabs det_tab) } } else { for (const Train *v = Train::Get(veh_id); v != nullptr; v = v->GetNextVehicle()) { - GetCargoSummaryOfArticulatedVehicle(v, &_cargo_summary); + GetCargoSummaryOfArticulatedVehicle(v, _cargo_summary); num += std::max(1u, (unsigned)_cargo_summary.size()); uint length = GetLengthOfArticulatedVehicle(v); @@ -428,7 +427,7 @@ void DrawTrainDetails(const Train *v, const Rect &r, int vscroll_pos, uint16 vsc int x = rtl ? r.right : r.left; byte line_number = 0; for (; v != nullptr && vscroll_pos > -vscroll_cap; v = v->GetNextVehicle()) { - GetCargoSummaryOfArticulatedVehicle(v, &_cargo_summary); + GetCargoSummaryOfArticulatedVehicle(v, _cargo_summary); /* Draw sprites */ uint dx = 0; diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index 695c56f827..1a38364448 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -178,7 +178,7 @@ static WindowDesc _transparency_desc( WDP_MANUAL, "toolbar_transparency", 0, 0, WC_TRANSPARENCY_TOOLBAR, WC_NONE, 0, - _nested_transparency_widgets, lengthof(_nested_transparency_widgets) + std::begin(_nested_transparency_widgets), std::end(_nested_transparency_widgets) ); /** diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 1616a47f34..dbd3571bb7 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -315,7 +315,7 @@ static WindowDesc _build_trees_desc( WDP_AUTO, "build_tree", 0, 0, WC_BUILD_TREES, WC_NONE, WDF_CONSTRUCTION, - _nested_build_trees_widgets, lengthof(_nested_build_trees_widgets) + std::begin(_nested_build_trees_widgets), std::end(_nested_build_trees_widgets) ); void ShowBuildTreesToolbar() diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index ca4e9f5e0b..a14def1f77 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -390,7 +390,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u case TRANSPORT_RAIL: railtype = Extract(p2); - if (!ValParamRailtype(railtype)) return CMD_ERROR; + if (!ValParamRailType(railtype)) return CMD_ERROR; break; case TRANSPORT_WATER: @@ -961,7 +961,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, switch (transport_type) { case TRANSPORT_RAIL: railtype = Extract(p1); - if (!ValParamRailtype(railtype)) return CMD_ERROR; + if (!ValParamRailType(railtype)) return CMD_ERROR; break; case TRANSPORT_ROAD: @@ -1754,7 +1754,7 @@ static void DrawTunnelBridgeRampSingleSignal(const TileInfo *ti, bool is_green, if (ti->tileh != SLOPE_FLAT && IsBridge(ti->tile)) z += 8; // sloped bridge head SignalVariant variant = IsTunnelBridgeSemaphore(ti->tile) ? SIG_SEMAPHORE : SIG_ELECTRIC; - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); uint8 aspect = 0; if (is_green) { @@ -1890,7 +1890,7 @@ static void DrawBridgeSignalOnMiddlePart(const TileInfo *ti, TileIndex bridge_st } } - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(bridge_start_tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(bridge_start_tile)); PalSpriteID sprite = GetCustomSignalSprite(rti, bridge_start_tile, SIGTYPE_NORMAL, variant, aspect, CSSC_BRIDGE_MIDDLE, style).sprite; if (sprite.sprite != 0) { @@ -2072,7 +2072,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti, DrawTileProcParams params) SpriteID image; SpriteID railtype_overlay = 0; if (transport_type == TRANSPORT_RAIL) { - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); image = rti->base_sprites.tunnel; if (rti->UsesOverlay()) { /* Check if the railtype has custom tunnel portals. */ @@ -2141,7 +2141,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti, DrawTileProcParams params) AddSortableSpriteToDraw(catenary_sprite_base + tunnelbridge_direction, PAL_NONE, ti->x, ti->y, BB_data[10], BB_data[11], TILE_HEIGHT, ti->z, IsTransparencySet(TO_CATENARY), BB_data[8], BB_data[9], BB_Z_SEPARATOR); } } else { - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); if (rti->UsesOverlay()) { SpriteID surface = GetCustomRailSprite(rti, ti->tile, RTSG_TUNNEL); if (surface != 0) DrawGroundSprite(surface + tunnelbridge_direction, PAL_NONE); @@ -2191,10 +2191,10 @@ static void DrawTile_TunnelBridge(TileInfo *ti, DrawTileProcParams params) return; } if (transport_type == TRANSPORT_RAIL && IsRailCustomBridgeHead(ti->tile)) { - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); DrawTrackBits(ti, GetCustomBridgeHeadTrackBits(ti->tile)); if (HasBit(_display_opt, DO_FULL_DETAIL)) { - extern void DrawTrackDetails(const TileInfo *ti, const RailtypeInfo *rti, const RailGroundType rgt); + extern void DrawTrackDetails(const TileInfo *ti, const RailTypeInfo *rti, const RailGroundType rgt); DrawTrackDetails(ti, rti, GetTunnelBridgeGroundType(ti->tile)); } if (HasRailCatenaryDrawn(GetRailType(ti->tile), GetTileSecondaryRailTypeIfValid(ti->tile))) { @@ -2202,7 +2202,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti, DrawTileProcParams params) } if (IsTunnelBridgeWithSignalSimulation(ti->tile)) { - extern void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track track, SignalState condition, + extern void DrawSingleSignal(TileIndex tile, const RailTypeInfo *rti, Track track, SignalState condition, SignalOffsets image, uint pos, SignalType type, SignalVariant variant, const TraceRestrictProgram *prog, CustomSignalSpriteContext context); DiagDirection dir = GetTunnelBridgeDirection(ti->tile); @@ -2306,7 +2306,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti, DrawTileProcParams params) EndSpriteCombine(); } else if (transport_type == TRANSPORT_RAIL) { - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile)); if (rti->UsesOverlay()) { SpriteID surface = GetCustomRailSprite(rti, ti->tile, RTSG_BRIDGE); if (surface != 0) { @@ -2510,7 +2510,7 @@ void DrawBridgeMiddle(const TileInfo *ti) /* DrawBridgeRoadBits() calls EndSpriteCombine() and StartSpriteCombine() */ DrawBridgeRoadBits(rampsouth, x, y, bridge_z, axis ^ 1, false); } else if (transport_type == TRANSPORT_RAIL) { - const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(rampsouth)); + const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(rampsouth)); if (rti->UsesOverlay() && !IsInvisibilitySet(TO_BRIDGES)) { SpriteID surface = GetCustomRailSprite(rti, rampsouth, RTSG_BRIDGE, TCX_ON_BRIDGE); if (surface != 0) { @@ -2677,12 +2677,12 @@ static void GetTileDesc_TunnelBridge(TileIndex tile, TileDesc *td) if (tt == TRANSPORT_RAIL) { RailType rt = GetRailType(tile); - const RailtypeInfo *rti = GetRailTypeInfo(rt); + const RailTypeInfo *rti = GetRailTypeInfo(rt); td->rail_speed = rti->max_speed; td->railtype = rti->strings.name; RailType secondary_rt = GetTileSecondaryRailTypeIfValid(tile); if (secondary_rt != rt && secondary_rt != INVALID_RAILTYPE) { - const RailtypeInfo *secondary_rti = GetRailTypeInfo(secondary_rt); + const RailTypeInfo *secondary_rti = GetRailTypeInfo(secondary_rt); td->rail_speed2 = secondary_rti->max_speed; td->railtype2 = secondary_rti->strings.name; } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 084b88bff8..b459293aca 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2929,7 +2929,7 @@ bool CanBuildVehicleInfrastructure(VehicleType type, byte subtype) UnitID max; switch (type) { case VEH_TRAIN: - if (!HasAnyRailtypesAvail(_local_company)) return false; + if (!HasAnyRailTypesAvail(_local_company)) return false; max = _settings_game.vehicle.max_trains; break; case VEH_ROAD: diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 84c1598645..14724ea3c4 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1445,7 +1445,7 @@ static WindowDesc _vehicle_refit_desc( WDP_AUTO, "view_vehicle_refit", 240, 174, WC_VEHICLE_REFIT, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, - _nested_vehicle_refit_widgets, lengthof(_nested_vehicle_refit_widgets) + std::begin(_nested_vehicle_refit_widgets), std::end(_nested_vehicle_refit_widgets) ); /** @@ -2683,14 +2683,14 @@ static WindowDesc _vehicle_list_other_desc( WDP_AUTO, "list_vehicles", 260, 246, WC_INVALID, WC_NONE, 0, - _nested_vehicle_list, lengthof(_nested_vehicle_list) + std::begin(_nested_vehicle_list), std::end(_nested_vehicle_list) ); static WindowDesc _vehicle_list_train_desc( WDP_AUTO, "list_vehicles_train", 325, 246, WC_TRAINS_LIST, WC_NONE, 0, - _nested_vehicle_list, lengthof(_nested_vehicle_list) + std::begin(_nested_vehicle_list), std::end(_nested_vehicle_list) ); static void ShowVehicleListWindowLocal(CompanyID company, VehicleListType vlt, VehicleType vehicle_type, uint32 unique_number) @@ -3416,7 +3416,7 @@ static WindowDesc _train_vehicle_details_desc( WDP_AUTO, "view_vehicle_details_train", 405, 178, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, 0, - _nested_train_vehicle_details_widgets, lengthof(_nested_train_vehicle_details_widgets) + std::begin(_nested_train_vehicle_details_widgets), std::end(_nested_train_vehicle_details_widgets) ); /** Vehicle details window descriptor for other vehicles than a train. */ @@ -3424,7 +3424,7 @@ static WindowDesc _nontrain_vehicle_details_desc( WDP_AUTO, "view_vehicle_details", 405, 113, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, 0, - _nested_nontrain_vehicle_details_widgets, lengthof(_nested_nontrain_vehicle_details_widgets) + std::begin(_nested_nontrain_vehicle_details_widgets), std::end(_nested_nontrain_vehicle_details_widgets) ); /** Shows the vehicle details window of the given vehicle. */ @@ -4244,7 +4244,7 @@ static WindowDesc _vehicle_view_desc( WDP_AUTO, "view_vehicle", 250, 116, WC_VEHICLE_VIEW, WC_NONE, 0, - _nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets), + std::begin(_nested_vehicle_view_widgets), std::end(_nested_vehicle_view_widgets), &VehicleViewWindow::hotkeys ); @@ -4256,7 +4256,7 @@ static WindowDesc _train_view_desc( WDP_AUTO, "view_vehicle_train", 250, 134, WC_VEHICLE_VIEW, WC_NONE, 0, - _nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets), + std::begin(_nested_vehicle_view_widgets), std::end(_nested_vehicle_view_widgets), &VehicleViewWindow::hotkeys ); diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm index 2f15f79642..6bf503d000 100644 --- a/src/video/cocoa/cocoa_wnd.mm +++ b/src/video/cocoa/cocoa_wnd.mm @@ -32,6 +32,7 @@ #include "../../window_func.h" #include "../../window_gui.h" #include "../../spritecache.h" +#include "../../textbuf_type.h" #include "../../toolbar_gui.h" #include @@ -935,7 +936,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel const char *replace_range = NULL; if (replacementRange.location != NSNotFound) { /* Calculate the part to be replaced. */ - insert_point = Utf8AdvanceByUtf16Units(_focused_window->GetFocusedText(), replacementRange.location); + insert_point = Utf8AdvanceByUtf16Units(_focused_window->GetFocusedTextbuf()->GetText(), replacementRange.location); replace_range = Utf8AdvanceByUtf16Units(insert_point, replacementRange.length); } @@ -963,7 +964,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel if (replacementRange.location != NSNotFound) { /* Calculate the part to be replaced. */ NSRange marked = [ self markedRange ]; - insert_point = Utf8AdvanceByUtf16Units(_focused_window->GetFocusedText(), replacementRange.location + (marked.location != NSNotFound ? marked.location : 0u)); + insert_point = Utf8AdvanceByUtf16Units(_focused_window->GetFocusedTextbuf()->GetText(), replacementRange.location + (marked.location != NSNotFound ? marked.location : 0u)); replace_range = Utf8AdvanceByUtf16Units(insert_point, replacementRange.length); } @@ -991,7 +992,9 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel { if (!EditBoxInGlobalFocus()) return NSMakeRange(NSNotFound, 0); - NSUInteger start = CountUtf16Units(_focused_window->GetFocusedText(), _focused_window->GetCaret()); + const Textbuf *text_buf = _focused_window->GetFocusedTextbuf(); + const char *text = text_buf->GetText(); + NSUInteger start = CountUtf16Units(text, text + text_buf->caretpos); return NSMakeRange(start, 0); } @@ -1000,11 +1003,12 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel { if (!EditBoxInGlobalFocus()) return NSMakeRange(NSNotFound, 0); - size_t mark_len; - const char *mark = _focused_window->GetMarkedText(&mark_len); - if (mark != nullptr) { - NSUInteger start = CountUtf16Units(_focused_window->GetFocusedText(), mark); - NSUInteger len = CountUtf16Units(mark, mark + mark_len); + const Textbuf *text_buf = _focused_window->GetFocusedTextbuf(); + if (text_buf->markend != 0) { + const char *text = text_buf->GetText(); + const char *mark = text + text_buf->markpos; + NSUInteger start = CountUtf16Units(text, mark); + NSUInteger len = CountUtf16Units(mark, text + text_buf->markend); return NSMakeRange(start, len); } @@ -1017,8 +1021,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel { if (!EditBoxInGlobalFocus()) return NO; - size_t len; - return _focused_window->GetMarkedText(&len) != nullptr; + return _focused_window->GetFocusedTextbuf()->markend != 0; } /** Get a string corresponding to the given range. */ @@ -1026,7 +1029,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel { if (!EditBoxInGlobalFocus()) return nil; - NSString *s = [ NSString stringWithUTF8String:_focused_window->GetFocusedText() ]; + NSString *s = [ NSString stringWithUTF8String:_focused_window->GetFocusedTextbuf()->GetText() ]; NSRange valid_range = NSIntersectionRange(NSMakeRange(0, [ s length ]), theRange); if (actualRange != nullptr) *actualRange = valid_range; @@ -1046,7 +1049,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel { if (!EditBoxInGlobalFocus()) return [ [ [ NSAttributedString alloc ] initWithString:@"" ] autorelease ]; - return [ [ [ NSAttributedString alloc ] initWithString:[ NSString stringWithUTF8String:_focused_window->GetFocusedText() ] ] autorelease ]; + return [ [ [ NSAttributedString alloc ] initWithString:[ NSString stringWithUTF8String:_focused_window->GetFocusedTextbuf()->GetText() ] ] autorelease ]; } /** Get the character that is rendered at the given point. */ @@ -1061,7 +1064,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel auto index = _focused_window->GetTextCharacterAtPosition(pt); if (index == -1) return NSNotFound; - auto text = _focused_window->GetFocusedText(); + auto text = _focused_window->GetFocusedTextbuf()->GetText(); return CountUtf16Units(text, text + index); } @@ -1070,9 +1073,10 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel { if (!EditBoxInGlobalFocus()) return NSMakeRect(0, 0, 0, 0); + const char *focused_text = _focused_window->GetFocusedTextbuf()->GetText(); /* Convert range to UTF-8 string pointers. */ - const char *start = Utf8AdvanceByUtf16Units(_focused_window->GetFocusedText(), aRange.location); - const char *end = aRange.length != 0 ? Utf8AdvanceByUtf16Units(_focused_window->GetFocusedText(), aRange.location + aRange.length) : start; + const char *start = Utf8AdvanceByUtf16Units(focused_text, aRange.location); + const char *end = aRange.length != 0 ? Utf8AdvanceByUtf16Units(focused_text, aRange.location + aRange.length) : start; /* Get the bounding rect for the text range.*/ Rect r = _focused_window->GetTextBoundingRect(start, end); diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp index ac5b0012e5..130c2f1dbb 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -184,7 +184,7 @@ static WindowDesc _extra_viewport_desc( WDP_AUTO, "extra_viewport", 300, 268, WC_EXTRA_VIEWPORT, WC_NONE, 0, - _nested_extra_viewport_widgets, lengthof(_nested_extra_viewport_widgets) + std::begin(_nested_extra_viewport_widgets), std::end(_nested_extra_viewport_widgets) ); /** diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 76c6fe0caf..a11ffc9eff 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -249,7 +249,7 @@ static WindowDesc _waypoint_view_desc( WDP_AUTO, "view_waypoint", 260, 118, WC_WAYPOINT_VIEW, WC_NONE, 0, - _nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets) + std::begin(_nested_waypoint_view_widgets), std::end(_nested_waypoint_view_widgets) ); /** diff --git a/src/widget.cpp b/src/widget.cpp index 5d1f525b67..5fa4428da6 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -3086,71 +3086,69 @@ bool NWidgetLeaf::ButtonHit(const Point &pt) * settings that follow it, until encountering a #EndContainer, another * #NWidget, or the end of the parts array. * - * @param parts Array with parts of the nested widget. - * @param count Length of the \a parts array. + * @param nwid_begin Pointer to beginning of nested widget parts. + * @param nwid_end Pointer to ending of nested widget parts. * @param dest Address of pointer to use for returning the composed widget. * @param fill_dest Fill the composed widget with child widgets. * @param biggest_index Pointer to biggest nested widget index in the tree encountered so far. - * @return Number of widget part elements used to compose the widget. + * @return Pointer to remaining nested widget parts. * @pre \c biggest_index != nullptr. */ -static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, bool *fill_dest, int *biggest_index) +static const NWidgetPart *MakeNWidget(const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, NWidgetBase **dest, bool *fill_dest, int *biggest_index) { - int num_used = 0; - *dest = nullptr; *fill_dest = false; - while (count > num_used) { - switch (parts->type) { + while (nwid_begin < nwid_end) { + switch (nwid_begin->type) { case NWID_SPACER: - if (*dest != nullptr) return num_used; + if (*dest != nullptr) return nwid_begin; *dest = new NWidgetSpacer(0, 0); break; case NWID_HORIZONTAL: - if (*dest != nullptr) return num_used; - *dest = new NWidgetHorizontal(parts->u.cont_flags); + if (*dest != nullptr) return nwid_begin; + *dest = new NWidgetHorizontal(nwid_begin->u.cont_flags); *fill_dest = true; break; case NWID_HORIZONTAL_LTR: - if (*dest != nullptr) return num_used; - *dest = new NWidgetHorizontalLTR(parts->u.cont_flags); + if (*dest != nullptr) return nwid_begin; + *dest = new NWidgetHorizontalLTR(nwid_begin->u.cont_flags); *fill_dest = true; break; case WWT_PANEL: case WWT_INSET: case WWT_FRAME: - if (*dest != nullptr) return num_used; - *dest = new NWidgetBackground(parts->type, parts->u.widget.colour, parts->u.widget.index); - *biggest_index = std::max(*biggest_index, (int)parts->u.widget.index); + if (*dest != nullptr) return nwid_begin; + *dest = new NWidgetBackground(nwid_begin->type, nwid_begin->u.widget.colour, nwid_begin->u.widget.index); + *biggest_index = std::max(*biggest_index, (int)nwid_begin->u.widget.index); *fill_dest = true; break; case NWID_VERTICAL: - if (*dest != nullptr) return num_used; - *dest = new NWidgetVertical(parts->u.cont_flags); + if (*dest != nullptr) return nwid_begin; + *dest = new NWidgetVertical(nwid_begin->u.cont_flags); *fill_dest = true; break; case NWID_MATRIX: { - if (*dest != nullptr) return num_used; + if (*dest != nullptr) return nwid_begin; NWidgetMatrix *nwm = new NWidgetMatrix(); *dest = nwm; *fill_dest = true; - nwm->SetIndex(parts->u.widget.index); - nwm->SetColour(parts->u.widget.colour); - *biggest_index = std::max(*biggest_index, (int)parts->u.widget.index); + nwm->SetIndex(nwid_begin->u.widget.index); + nwm->SetColour(nwid_begin->u.widget.colour); + *biggest_index = std::max(*biggest_index, (int)nwid_begin->u.widget.index); break; } case WPT_FUNCTION: { - if (*dest != nullptr) return num_used; + if (*dest != nullptr) return nwid_begin; /* Ensure proper functioning even when the called code simply writes its largest index. */ int biggest = -1; - *dest = parts->u.func_ptr(&biggest); + *dest = nwid_begin->u.func_ptr(&biggest); *biggest_index = std::max(*biggest_index, biggest); *fill_dest = false; break; @@ -3159,8 +3157,8 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, case WPT_RESIZE: { NWidgetResizeBase *nwrb = dynamic_cast(*dest); if (nwrb != nullptr) { - assert(parts->u.xy.x >= 0 && parts->u.xy.y >= 0); - nwrb->SetResize(parts->u.xy.x, parts->u.xy.y); + assert(nwid_begin->u.xy.x >= 0 && nwid_begin->u.xy.y >= 0); + nwrb->SetResize(nwid_begin->u.xy.x, nwid_begin->u.xy.y); } break; } @@ -3168,8 +3166,8 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, case WPT_MINSIZE: { NWidgetResizeBase *nwrb = dynamic_cast(*dest); if (nwrb != nullptr) { - assert(parts->u.xy.x >= 0 && parts->u.xy.y >= 0); - nwrb->SetMinimalSize(parts->u.xy.x, parts->u.xy.y); + assert(nwid_begin->u.xy.x >= 0 && nwid_begin->u.xy.y >= 0); + nwrb->SetMinimalSize(nwid_begin->u.xy.x, nwid_begin->u.xy.y); } break; } @@ -3177,8 +3175,8 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, case WPT_MINTEXTLINES: { NWidgetResizeBase *nwrb = dynamic_cast(*dest); if (nwrb != nullptr) { - assert(parts->u.text_lines.size >= FS_BEGIN && parts->u.text_lines.size < FS_END); - nwrb->SetMinimalTextLines(parts->u.text_lines.lines, parts->u.text_lines.spacing, parts->u.text_lines.size); + assert(nwid_begin->u.text_lines.size >= FS_BEGIN && nwid_begin->u.text_lines.size < FS_END); + nwrb->SetMinimalTextLines(nwid_begin->u.text_lines.lines, nwid_begin->u.text_lines.spacing, nwid_begin->u.text_lines.size); } break; } @@ -3186,7 +3184,7 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, case WPT_TEXTSTYLE: { NWidgetCore *nwc = dynamic_cast(*dest); if (nwc != nullptr) { - nwc->SetTextStyle(parts->u.text_style.colour, parts->u.text_style.size); + nwc->SetTextStyle(nwid_begin->u.text_style.colour, nwid_begin->u.text_style.size); } break; } @@ -3194,97 +3192,96 @@ static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, case WPT_ALIGNMENT: { NWidgetCore *nwc = dynamic_cast(*dest); if (nwc != nullptr) { - nwc->SetAlignment(parts->u.align.align); + nwc->SetAlignment(nwid_begin->u.align.align); } break; } case WPT_FILL: { NWidgetResizeBase *nwrb = dynamic_cast(*dest); - if (nwrb != nullptr) nwrb->SetFill(parts->u.xy.x, parts->u.xy.y); + if (nwrb != nullptr) nwrb->SetFill(nwid_begin->u.xy.x, nwid_begin->u.xy.y); break; } case WPT_DATATIP: { NWidgetCore *nwc = dynamic_cast(*dest); if (nwc != nullptr) { - nwc->widget_data = parts->u.data_tip.data; - nwc->tool_tip = parts->u.data_tip.tooltip; + nwc->widget_data = nwid_begin->u.data_tip.data; + nwc->tool_tip = nwid_begin->u.data_tip.tooltip; } break; } case WPT_PADDING: - if (*dest != nullptr) (*dest)->SetPadding(parts->u.padding); + if (*dest != nullptr) (*dest)->SetPadding(nwid_begin->u.padding); break; case WPT_PIPSPACE: { NWidgetPIPContainer *nwc = dynamic_cast(*dest); - if (nwc != nullptr) nwc->SetPIP(parts->u.pip.pre, parts->u.pip.inter, parts->u.pip.post); + if (nwc != nullptr) nwc->SetPIP(nwid_begin->u.pip.pre, nwid_begin->u.pip.inter, nwid_begin->u.pip.post); NWidgetBackground *nwb = dynamic_cast(*dest); - if (nwb != nullptr) nwb->SetPIP(parts->u.pip.pre, parts->u.pip.inter, parts->u.pip.post); + if (nwb != nullptr) nwb->SetPIP(nwid_begin->u.pip.pre, nwid_begin->u.pip.inter, nwid_begin->u.pip.post); break; } case WPT_SCROLLBAR: { NWidgetCore *nwc = dynamic_cast(*dest); if (nwc != nullptr) { - nwc->scrollbar_index = parts->u.widget.index; + nwc->scrollbar_index = nwid_begin->u.widget.index; } break; } case WPT_ENDCONTAINER: - return num_used; + return nwid_begin; case NWID_VIEWPORT: - if (*dest != nullptr) return num_used; - *dest = new NWidgetViewport(parts->u.widget.index); - *biggest_index = std::max(*biggest_index, (int)parts->u.widget.index); + if (*dest != nullptr) return nwid_begin; + *dest = new NWidgetViewport(nwid_begin->u.widget.index); + *biggest_index = std::max(*biggest_index, (int)nwid_begin->u.widget.index); break; case NWID_HSCROLLBAR: case NWID_VSCROLLBAR: - if (*dest != nullptr) return num_used; - *dest = new NWidgetScrollbar(parts->type, parts->u.widget.colour, parts->u.widget.index); - *biggest_index = std::max(*biggest_index, (int)parts->u.widget.index); + if (*dest != nullptr) return nwid_begin; + *dest = new NWidgetScrollbar(nwid_begin->type, nwid_begin->u.widget.colour, nwid_begin->u.widget.index); + *biggest_index = std::max(*biggest_index, (int)nwid_begin->u.widget.index); break; case NWID_SELECTION: { - if (*dest != nullptr) return num_used; + if (*dest != nullptr) return nwid_begin; NWidgetStacked *nws = new NWidgetStacked(); *dest = nws; *fill_dest = true; - nws->SetIndex(parts->u.widget.index); - *biggest_index = std::max(*biggest_index, (int)parts->u.widget.index); + nws->SetIndex(nwid_begin->u.widget.index); + *biggest_index = std::max(*biggest_index, (int)nwid_begin->u.widget.index); break; } default: - if (*dest != nullptr) return num_used; - assert((parts->type & WWT_MASK) < WWT_LAST || (parts->type & WWT_MASK) == NWID_BUTTON_DROPDOWN); - *dest = new NWidgetLeaf(parts->type, parts->u.widget.colour, parts->u.widget.index, 0x0, STR_NULL); - *biggest_index = std::max(*biggest_index, (int)parts->u.widget.index); + if (*dest != nullptr) return nwid_begin; + assert((nwid_begin->type & WWT_MASK) < WWT_LAST || (nwid_begin->type & WWT_MASK) == NWID_BUTTON_DROPDOWN); + *dest = new NWidgetLeaf(nwid_begin->type, nwid_begin->u.widget.colour, nwid_begin->u.widget.index, 0x0, STR_NULL); + *biggest_index = std::max(*biggest_index, (int)nwid_begin->u.widget.index); break; } - num_used++; - parts++; + nwid_begin++; } - return num_used; + return nwid_begin; } /** * Build a nested widget tree by recursively filling containers with nested widgets read from their parts. - * @param parts Array with parts of the nested widgets. - * @param count Length of the \a parts array. + * @param nwid_begin Pointer to beginning of nested widget parts. + * @param nwid_end Pointer to ending of nested widget parts. * @param parent Pointer or container to use for storing the child widgets (*parent == nullptr or *parent == container or background widget). * @param biggest_index Pointer to biggest nested widget index in the tree. - * @return Number of widget part elements used to fill the container. + * @return Pointer to remaining nested widget parts. * @post \c *biggest_index contains the largest widget index of the tree and \c -1 if no index is used. */ -static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **parent, int *biggest_index) +static const NWidgetPart *MakeWidgetTree(const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, NWidgetBase **parent, int *biggest_index) { /* If *parent == nullptr, only the first widget is read and returned. Otherwise, *parent must point to either * a #NWidgetContainer or a #NWidgetBackground object, and parts are added as much as possible. */ @@ -3292,13 +3289,10 @@ static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **par NWidgetBackground *nwid_parent = dynamic_cast(*parent); assert(*parent == nullptr || (nwid_cont != nullptr && nwid_parent == nullptr) || (nwid_cont == nullptr && nwid_parent != nullptr)); - int total_used = 0; for (;;) { NWidgetBase *sub_widget = nullptr; bool fill_sub = false; - int num_used = MakeNWidget(parts, count - total_used, &sub_widget, &fill_sub, biggest_index); - parts += num_used; - total_used += num_used; + nwid_begin = MakeNWidget(nwid_begin, nwid_end, &sub_widget, &fill_sub, biggest_index); /* Break out of loop when end reached */ if (sub_widget == nullptr) break; @@ -3308,9 +3302,7 @@ static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **par if (fill_sub && (tp == NWID_HORIZONTAL || tp == NWID_HORIZONTAL_LTR || tp == NWID_VERTICAL || tp == NWID_MATRIX || tp == WWT_PANEL || tp == WWT_FRAME || tp == WWT_INSET || tp == NWID_SELECTION)) { NWidgetBase *sub_ptr = sub_widget; - int num_used = MakeWidgetTree(parts, count - total_used, &sub_ptr, biggest_index); - parts += num_used; - total_used += num_used; + nwid_begin = MakeWidgetTree(nwid_begin, nwid_end, &sub_ptr, biggest_index); } /* Add sub_widget to parent container if available, otherwise return the widget to the caller. */ @@ -3318,21 +3310,21 @@ static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **par if (nwid_parent != nullptr) nwid_parent->Add(sub_widget); if (nwid_cont == nullptr && nwid_parent == nullptr) { *parent = sub_widget; - return total_used; + return nwid_begin; } } - if (count == total_used) return total_used; // Reached the end of the array of parts? + if (nwid_begin == nwid_end) return nwid_begin; // Reached the end of the array of parts? - assert(total_used < count); - assert(parts->type == WPT_ENDCONTAINER); - return total_used + 1; // *parts is also 'used' + assert(nwid_begin < nwid_end); + assert(nwid_begin->type == WPT_ENDCONTAINER); + return nwid_begin + 1; // *nwid_begin is also 'used' } /** * Construct a nested widget tree from an array of parts. - * @param parts Array with parts of the widgets. - * @param count Length of the \a parts array. + * @param nwid_begin Pointer to beginning of nested widget parts. + * @param nwid_end Pointer to ending of nested widget parts. * @param biggest_index Pointer to biggest nested widget index collected in the tree. * @param container Container to add the nested widgets to. In case it is nullptr a vertical container is used. * @return Root of the nested widget tree, a vertical container containing the entire GUI. @@ -3340,12 +3332,12 @@ static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **par * @pre \c biggest_index != nullptr * @post \c *biggest_index contains the largest widget index of the tree and \c -1 if no index is used. */ -NWidgetContainer *MakeNWidgets(const NWidgetPart *parts, int count, int *biggest_index, NWidgetContainer *container) +NWidgetContainer *MakeNWidgets(const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, int *biggest_index, NWidgetContainer *container) { *biggest_index = -1; if (container == nullptr) container = new NWidgetVertical(); NWidgetBase *cont_ptr = container; - MakeWidgetTree(parts, count, &cont_ptr, biggest_index); + MakeWidgetTree(nwid_begin, nwid_end, &cont_ptr, biggest_index); return container; } @@ -3353,8 +3345,8 @@ NWidgetContainer *MakeNWidgets(const NWidgetPart *parts, int count, int *biggest * Make a nested widget tree for a window from a parts array. Besides loading, it inserts a shading selection widget * between the title bar and the window body if the first widget in the parts array looks like a title bar (it is a horizontal * container with a caption widget) and has a shade box widget. - * @param parts Array with parts of the widgets. - * @param count Length of the \a parts array. + * @param nwid_begin Pointer to beginning of nested widget parts. + * @param nwid_end Pointer to ending of nested widget parts. * @param biggest_index Pointer to biggest nested widget index collected in the tree. * @param[out] shade_select Pointer to the inserted shade selection widget (\c nullptr if not unserted). * @return Root of the nested widget tree, a vertical container containing the entire GUI. @@ -3362,20 +3354,18 @@ NWidgetContainer *MakeNWidgets(const NWidgetPart *parts, int count, int *biggest * @pre \c biggest_index != nullptr * @post \c *biggest_index contains the largest widget index of the tree and \c -1 if no index is used. */ -NWidgetContainer *MakeWindowNWidgetTree(const NWidgetPart *parts, int count, int *biggest_index, NWidgetStacked **shade_select) +NWidgetContainer *MakeWindowNWidgetTree(const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, int *biggest_index, NWidgetStacked **shade_select) { *biggest_index = -1; /* Read the first widget recursively from the array. */ NWidgetBase *nwid = nullptr; - int num_used = MakeWidgetTree(parts, count, &nwid, biggest_index); + nwid_begin = MakeWidgetTree(nwid_begin, nwid_end, &nwid, biggest_index); assert(nwid != nullptr); - parts += num_used; - count -= num_used; NWidgetContainer *root = new NWidgetVertical; root->Add(nwid); - if (count == 0) { // There is no body at all. + if (nwid_begin == nwid_end) { // There is no body at all. *shade_select = nullptr; return root; } @@ -3396,7 +3386,7 @@ NWidgetContainer *MakeWindowNWidgetTree(const NWidgetPart *parts, int count, int /* Load the remaining parts into 'body'. */ int biggest2 = -1; - MakeNWidgets(parts, count, &biggest2, body); + MakeNWidgets(nwid_begin, nwid_end, &biggest2, body); *biggest_index = std::max(*biggest_index, biggest2); return root; diff --git a/src/widget_type.h b/src/widget_type.h index 788803507d..8bccad627c 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -1343,8 +1343,8 @@ static inline NWidgetPart NWidgetFunction(NWidgetFunctionType *func_ptr) return part; } -NWidgetContainer *MakeNWidgets(const NWidgetPart *parts, int count, int *biggest_index, NWidgetContainer *container); -NWidgetContainer *MakeWindowNWidgetTree(const NWidgetPart *parts, int count, int *biggest_index, NWidgetStacked **shade_select); +NWidgetContainer *MakeNWidgets(const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, int *biggest_index, NWidgetContainer *container); +NWidgetContainer *MakeWindowNWidgetTree(const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, int *biggest_index, NWidgetStacked **shade_select); NWidgetBase *MakeCompanyButtonRows(int *biggest_index, int widget_first, int widget_last, Colours button_colour, int max_length, StringID button_tooltip); diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index d2ecfccd93..e471b07c3a 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -25,6 +25,7 @@ add_files( goal_widget.h graph_widget.h group_widget.h + help_widget.h highscore_widget.h industry_widget.h intro_widget.h diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index ae40ba004c..9801983e27 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -103,7 +103,7 @@ static WindowDesc _dropdown_desc( WDP_MANUAL, nullptr, 0, 0, WC_DROPDOWN_MENU, WC_NONE, WDF_NO_FOCUS, - _nested_dropdown_menu_widgets, lengthof(_nested_dropdown_menu_widgets) + std::begin(_nested_dropdown_menu_widgets), std::end(_nested_dropdown_menu_widgets) ); /** Drop-down menu window */ diff --git a/src/widgets/help_widget.h b/src/widgets/help_widget.h new file mode 100644 index 0000000000..5b898fc01c --- /dev/null +++ b/src/widgets/help_widget.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 help_widget.h Types related to the help window widgets. */ + +#ifndef WIDGETS_HELP_WIDGET_H +#define WIDGETS_HELP_WIDGET_H + +/** Widgets of the #HelpWindow class. */ +enum HelpWindowWidgets { + WID_HW_README, + WID_HW_CHANGELOG, + WID_HW_KNOWN_BUGS, + WID_HW_LICENSE, + WID_HW_WEBSITE, + WID_HW_WIKI, + WID_HW_BUGTRACKER, + WID_HW_COMMUNITY, +}; + +#endif /* WIDGETS_HELP_WIDGET_H */ diff --git a/src/widgets/intro_widget.h b/src/widgets/intro_widget.h index dc152a488b..6e5e70eea9 100644 --- a/src/widgets/intro_widget.h +++ b/src/widgets/intro_widget.h @@ -28,6 +28,7 @@ enum SelectGameIntroWidgets { WID_SGI_TRANSLATION, ///< Translation errors. WID_SGI_OPTIONS, ///< Options button. WID_SGI_HIGHSCORE, ///< Highscore button. + WID_SGI_HELP, ///< Help and manuals button. WID_SGI_SETTINGS_OPTIONS, ///< Settings button. WID_SGI_GRF_SETTINGS, ///< NewGRF button. WID_SGI_CONTENT_DOWNLOAD, ///< Content Download button. diff --git a/src/widgets/misc_widget.h b/src/widgets/misc_widget.h index e49e6309ad..95e717e197 100644 --- a/src/widgets/misc_widget.h +++ b/src/widgets/misc_widget.h @@ -50,11 +50,15 @@ enum QueryWidgets { /** Widgets of the #TextfileWindow class. */ enum TextfileWidgets { - WID_TF_CAPTION, ///< The caption of the window. - WID_TF_WRAPTEXT, ///< Whether or not to wrap the text. - WID_TF_BACKGROUND, ///< Panel to draw the textfile on. - WID_TF_VSCROLLBAR, ///< Vertical scrollbar to scroll through the textfile up-and-down. - WID_TF_HSCROLLBAR, ///< Horizontal scrollbar to scroll through the textfile left-to-right. + WID_TF_CAPTION, ///< The caption of the window. + WID_TF_NAVBACK, ///< Navigate back button. + WID_TF_NAVFORWARD, ///< Navigate forward button. + WID_TF_WRAPTEXT, ///< Whether or not to wrap the text. + WID_TF_JUMPLIST, ///< List to jump around the file. + WID_TF_SEL_JUMPLIST, ///< Selection to display the jump list or not. + WID_TF_BACKGROUND, ///< Panel to draw the textfile on. + WID_TF_VSCROLLBAR, ///< Vertical scrollbar to scroll through the textfile up-and-down. + WID_TF_HSCROLLBAR, ///< Horizontal scrollbar to scroll through the textfile left-to-right. }; /** Widgets of the #TextfileWindow class. */ diff --git a/src/window.cpp b/src/window.cpp index 390269a316..6752a4f49c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -102,14 +102,14 @@ std::string _windows_file; /** Window description constructor. */ WindowDesc::WindowDesc(WindowPosition def_pos, const char *ini_key, int16 def_width_trad, int16 def_height_trad, WindowClass window_class, WindowClass parent_class, uint32 flags, - const NWidgetPart *nwid_parts, int16 nwid_length, HotkeyList *hotkeys, WindowDesc *ini_parent) : + const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, HotkeyList *hotkeys, WindowDesc *ini_parent) : default_pos(def_pos), cls(window_class), parent_cls(parent_class), ini_key(ini_key), flags(flags), - nwid_parts(nwid_parts), - nwid_length(nwid_length), + nwid_begin(nwid_begin), + nwid_end(nwid_end), hotkeys(hotkeys), ini_parent(ini_parent), prefs({ false, 0, 0 }), @@ -369,40 +369,13 @@ void Window::UpdateQueryStringSize() } /** - * Get the current input text if an edit box has the focus. - * @return The currently focused input text or nullptr if no input focused. + * Get the current input text buffer. + * @return The currently focused input text buffer or nullptr if no input focused. */ -/* virtual */ const char *Window::GetFocusedText() const +/* virtual */ const Textbuf *Window::GetFocusedTextbuf() const { if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) { - return this->GetQueryString(this->nested_focus->index)->GetText(); - } - - return nullptr; -} - -/** - * Get the string at the caret if an edit box has the focus. - * @return The text at the caret or nullptr if no edit box is focused. - */ -/* virtual */ const char *Window::GetCaret() const -{ - if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) { - return this->GetQueryString(this->nested_focus->index)->GetCaret(); - } - - return nullptr; -} - -/** - * Get the range of the currently marked input text. - * @param[out] length Length of the marked text. - * @return Pointer to the start of the marked text or nullptr if no text is marked. - */ -/* virtual */ const char *Window::GetMarkedText(size_t *length) const -{ - if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) { - return this->GetQueryString(this->nested_focus->index)->GetMarkedText(length); + return &this->GetQueryString(this->nested_focus->index)->text; } return nullptr; @@ -1917,7 +1890,7 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int void Window::CreateNestedTree(bool fill_nested) { int biggest_index = -1; - this->nested_root = MakeWindowNWidgetTree(this->window_desc->nwid_parts, this->window_desc->nwid_length, &biggest_index, &this->shade_select); + this->nested_root = MakeWindowNWidgetTree(this->window_desc->nwid_begin, this->window_desc->nwid_end, &biggest_index, &this->shade_select); this->nested_array_size = (uint)(biggest_index + 1); if (fill_nested) { diff --git a/src/window_gui.h b/src/window_gui.h index 4d9f4932a2..379860a86c 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -120,7 +120,7 @@ struct WindowDesc { WindowDesc(WindowPosition default_pos, const char *ini_key, int16 def_width_trad, int16 def_height_trad, WindowClass window_class, WindowClass parent_class, uint32 flags, - const NWidgetPart *nwid_parts, int16 nwid_length, HotkeyList *hotkeys = nullptr, WindowDesc *ini_parent = nullptr); + const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, HotkeyList *hotkeys = nullptr, WindowDesc *ini_parent = nullptr); ~WindowDesc(); @@ -129,8 +129,8 @@ struct WindowDesc { WindowClass parent_cls; ///< Class of the parent window. @see WindowClass const char *ini_key; ///< Key to store window defaults in openttd.cfg. \c nullptr if nothing shall be stored. uint32 flags; ///< Flags. @see WindowDefaultFlag - const NWidgetPart *nwid_parts; ///< Nested widget parts describing the window. - int16 nwid_length; ///< Length of the #nwid_parts array. + const NWidgetPart *nwid_begin; ///< Beginning of nested widget parts describing the window. + const NWidgetPart *nwid_end; ///< Ending of nested widget parts describing the window. HotkeyList *hotkeys; ///< Hotkeys for the window. WindowDesc *ini_parent; ///< Other window desc to use for WindowDescPreferences. @@ -314,9 +314,7 @@ public: QueryString *GetQueryString(uint widnum); void UpdateQueryStringSize(); - virtual const char *GetFocusedText() const; - virtual const char *GetCaret() const; - virtual const char *GetMarkedText(size_t *length) const; + virtual const struct Textbuf *GetFocusedTextbuf() const; virtual Point GetCaretPosition() const; virtual Rect GetTextBoundingRect(const char *from, const char *to) const; virtual ptrdiff_t GetTextCharacterAtPosition(const Point &pt) const; diff --git a/src/window_type.h b/src/window_type.h index 6968c0ae1d..9a6716721a 100644 --- a/src/window_type.h +++ b/src/window_type.h @@ -739,6 +739,12 @@ enum WindowClass { */ WC_SCREENSHOT, + /** + * Help and manuals window; %Window numbers: + * - 0 = #HelpWindowWidgets + */ + WC_HELPWIN, + /** * Trace restrict programme window; %Window numbers: * - #TileIndex << 3 | #Track = #TraceRestrictWindow diff --git a/src/zoning_gui.cpp b/src/zoning_gui.cpp index a319704728..997842ffe2 100644 --- a/src/zoning_gui.cpp +++ b/src/zoning_gui.cpp @@ -176,7 +176,7 @@ static WindowDesc _zoning_desc ( WDP_CENTER, "zoning_gui", 0, 0, WC_ZONING_TOOLBAR, WC_NONE, 0, - _nested_zoning_widgets, lengthof(_nested_zoning_widgets) + std::begin(_nested_zoning_widgets), std::end(_nested_zoning_widgets) ); void ShowZoningToolbar()