1
0
Fork 0
Commit Graph

22791 Commits (dfb74e25f7ac41c80b3a2d9f4443b3a89d320900)

Author SHA1 Message Date
translators b4f96f54df Update: Translations from eints
danish: 14 changes by bscargo
dutch: 5 changes by Afoklala
2024-09-28 04:44:33 +00:00
translators b42c4fa7ca Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
english (us): 5 changes by 2TallTyler
korean: 6 changes by telk5093
italian: 16 changes by ciampix
2024-09-26 04:45:59 +00:00
translators 1251638508 Update: Translations from eints
chinese (simplified): 8 changes by WenSimEHRP
portuguese: 5 changes by azulcosta
polish: 13 changes by pAter-exe
2024-09-25 04:45:43 +00:00
translators 528f047242 Update: Translations from eints
english (au): 4 changes by krysclarke
chinese (traditional): 18 changes by KogentaSan
greek: 4 changes by gh658804
italian: 11 changes by Boh132Boh
russian: 4 changes by Ln-Wolf
finnish: 5 changes by hpiirai
portuguese (brazilian): 4 changes by pasantoro
polish: 78 changes by pAter-exe
2024-09-24 04:45:19 +00:00
Peter Nelson 51bd344f10
Change: Use default NewGRF cargo translation table. (#12646)
Instead of falling back to bitnum lookup or climate-dependent cargo types, install a default cargo translation table that performs either of these functions instead.

This allows better mapping of climate-dependent or bitnum cargo slots, falling back to INVALID_CARGO if they are not defined, and reduces special-casing.
2024-09-23 23:48:03 +01:00
Peter Nelson e60c5f30a3
Fix ddf1510a23: House animation random data flag ignored. (#12963)
In the refactor to unified tile animation code, the test for `CALLBACK_1A_RANDOM_BITS` incorrectly got changed to a `HasBit()` test preventing it from working.

Use `HasFlag()` instead.
2024-09-23 17:18:28 +00:00
Peter Nelson f149d84d4c
Fix: Crash when exiting game with end game window open. (#12962)
Caused by the end game window opening the highscore window on close, which `UnInitWindowSystem()` does not expect.
2024-09-23 17:58:44 +01:00
translators 856ee2aaca Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 1 change by WenSimEHRP
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
portuguese (brazilian): 1 change by pasantoro
2024-09-23 04:45:32 +00:00
Jonathan G Rennison c1db57840e
Fix: DepotWindow::GetVehicleFromDepotWndPt not refreshing vehicle list (#12907) 2024-09-22 18:13:43 +01:00
Peter Nelson eafee92476
Fix 3d4b98845a: TC_FORCED no longer working. (#12961)
Since initial colour is no longer passed to the text layout, TC_FORCED flag is not seen by the layouter, so it had no effect.

Instead, check for TC_FORCED when drawing and avoid using the string's colours if set.
2024-09-22 18:08:22 +01:00
Peter Nelson 0340e19e04
Codechange: Add to_underlying() to convert enum to underlying type. (#12958)
This simplifies and replaces static_cast and C-style casts doing the same.

`std::to_underlying()` exists in C++23 but not C++20.
2024-09-22 18:07:42 +01:00
Peter Nelson 376e882a14
Codechange: Add HasFlag() to test if a value is present in a bitset enum type. (#12959)
This simplifies tests for `(x & y) != y` with enum classes by reducing repetition, similar to HasBit(), and also makes the intent of the expression clearer.
2024-09-22 14:51:37 +01:00
Peter Nelson d450d4743e
Fix #12957: 1-in-X proportion of towns being cities is unnecessarily random. (#12960)
Using an actual random chance to generate cities means that there may be far less or far more than 'expected' towns being made as cities.

While this is the point of randomness, the wording of the setting is "Proporation of towns that will become cities: 1 in X" and does not mention randomness at all.
2024-09-22 14:42:01 +01:00
Peter Nelson e45e8a39c8
Add: Overlay cargo icon in vehicle/depot list when holding shift+ctrl. (#12938) 2024-09-22 10:33:44 +01:00
translators 9404a03663 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
polish: 8 changes by pAter-exe
2024-09-22 04:47:22 +00:00
Jonathan G Rennison a7d405b02d
Fix: ICUParagraphLayout line wrapping (#12956)
In the case where the overflow run is not the start run,
and the start run had a partial offset
2024-09-21 22:14:41 +01:00
Peter Nelson 16b4e737a3
Fix 3d8d0e0d26: Don't assume plural parameter is valid. (#12954)
A crash can occur if the parameter used for a plural isn't a numeric value.
2024-09-21 15:04:35 +01:00
Jeremy Gao 2eac527439
Fix: server menu tooltip shouldn't show language info (#12955) 2024-09-21 15:04:13 +01:00
Jonathan G Rennison 78c7dd1303
Fix #12945: Relative paths passed to -c were not made absolute (#12946) 2024-09-21 13:58:28 +01:00
translators 6175a6b78a Update: Translations from eints
dutch: 9 changes by Afoklala
2024-09-21 04:44:57 +00:00
translators 96000fc4ea Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 9 changes by 2TallTyler
galician: 13 changes by pvillaverde
korean: 9 changes by telk5093
greek: 1 change by gh658804
finnish: 1 change by hpiirai
lithuanian: 6 changes by isigitas
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by aefoes
2024-09-20 04:45:13 +00:00
Peter Nelson 6e940af08d Fix #12952: Incorrect string parameters passed for social plugin titles.
When no option is selected (i.e. during SetupSmallestSize), a different string parameter layout was used that did not match the visible layout.
2024-09-19 18:44:23 +01:00
Peter Nelson 719d063bd4 Fix d1463f415f: Wrong type of exception thrown by invalid string parameters.
`FormatString()` only catches `std::out_of_range`, but `GetNextParameter()` threw `std::runtime_error`.
2024-09-19 18:44:23 +01:00
Peter Nelson 3bfd9de68d
Fix: Highscore/Endgame window can disappear offscreen if game window is resized. (#12951) 2024-09-19 09:18:25 +01:00
translators df0233f4c2 Update: Translations from eints
chinese (simplified): 9 changes by WenSimEHRP
catalan: 9 changes by J0anJosep
latvian: 1 change by lexuslatvia
french: 13 changes by glx22
portuguese: 9 changes by azulcosta
2024-09-19 04:45:53 +00:00
Jonathan G Rennison 1e3855c9c3
Fix: Crash when pressing arrow keys in bootstrap mode (#12948) 2024-09-18 16:41:54 -04:00
Peter Nelson fe49dec527
Fix 33a7e9e512: Linker failure with release build. (#12949) 2024-09-18 20:18:49 +00:00
Peter Nelson 25a8abcd8e
Fix fcf8693c4f: Remove 100 byte limit for parsing string command parameters. (#12950)
This allows longer parameters to be used in plural and gender commands.

Each individual word list parameter is now limited to 253 bytes, allowing for a trailing NUL and leaving 0xFF reserved.
2024-09-18 20:55:36 +01:00
Heikki Piirainen 66c5a21d8f Fix: erroneous error message 2024-09-18 06:50:06 +02:00
Jonathan G Rennison 9f1bb055b7 Change: Exclude parent item from directory sort in FiosGetFileList 2024-09-18 06:49:30 +02:00
translators fcf8693c4f Update: Translations from eints
english (au): 9 changes by krysclarke
greek: 9 changes by gh658804
russian: 9 changes by Ln-Wolf
finnish: 9 changes by hpiirai
latvian: 8 changes by lexuslatvia
portuguese (brazilian): 9 changes by pasantoro
2024-09-18 04:45:22 +00:00
Peter Nelson a241ef8da0 Fix #12917: Write to negative array index for some string patterns.
Don't popped closed pair from the parenthesis stack a second time.
2024-09-17 11:06:17 +01:00
Peter Nelson 33a7e9e512 Add: Unit test for ICU ScriptRun.
This is based on srtest from the ICU codebase.
2024-09-17 11:06:17 +01:00
translators 9ab0a47812 Update: Translations from eints
norwegian (bokmal): 4 changes by eriksorngard
2024-09-17 04:41:16 +00:00
Peter Nelson 4be3361aa3
Fix ad020759: Update town data loader for FileHandle change. (#12942)
A non-conflicting merge conflict...
2024-09-16 17:52:24 +01:00
Peter Nelson 74910d3d14
Fix 908ee729: Inverted condition prevented actually writing data to files. (#12941) 2024-09-16 13:45:23 +00:00
Tyler Trahan ad020759c7
Feature: Import town data from JSON file (#10409) 2024-09-16 09:29:10 -04:00
Peter Nelson 908ee7292b
Codechange: Replace all FILE * with FileHandle RAII class. (#12718)
This removes the need to manually ensure all files are closed.
2024-09-16 08:45:26 +01:00
translators 3784a3d3d6 Update: Translations from eints
latvian: 5 changes by lexuslatvia
portuguese: 4 changes by azulcosta
2024-09-15 04:44:28 +00:00
Peter Nelson 9623c28f4d
Change: [NewGRF] Place all 8 bits of station tile layout in var 40/41. (#12890) 2024-09-14 21:37:40 +01:00
Jonathan G Rennison 2a5a0b0990 Codechange: No longer allow saving of incorrect string container table fields
See: 1250ce8f
2024-09-14 15:32:48 +01:00
Jonathan G Rennison c277ff121e Fix #12901: Savegame format of company allow lists 2024-09-14 15:32:48 +01:00
Peter Nelson d1463f415f Codechange: Treat reading incorrect parameter type as a string error.
Previously reading a string as a number would return 0 instead.
2024-09-14 15:31:05 +01:00
Peter Nelson 3d8d0e0d26 Codechange: Use std::variant to store string parameter data.
This avoids storing two separate values and makes the test for which type is held clearer.

This replaces use of unique_ptr for conditionally storing a string, and is also used in place of StringParameterBackup.
2024-09-14 15:31:05 +01:00
Peter Nelson b449839538 Codechange: Pass span instead of vector to HaveDParamChanged. 2024-09-14 15:31:05 +01:00
Peter Nelson 9eb28def57 Codechange: Return reference from GetNextParameterPointer.
GetNextParameterPointer can no longer return nullptr, and the callers do not check for nullptr, so return a reference instead.
2024-09-14 15:31:05 +01:00
translators 59b18560d4 Update: Translations from eints
english (us): 4 changes by 2TallTyler
dutch: 4 changes by Afoklala
2024-09-14 04:44:59 +00:00
translators 45a5868bb8 Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
korean: 4 changes by telk5093
italian: 9 changes by dominiccoletti
catalan: 4 changes by J0anJosep
2024-09-13 04:44:38 +00:00
Peter Nelson ad5da0c924
Codechange: Use `__VA_OPT__(,)` instead of `, ##` (#12921)
`__VA_OPT__` is a C++20 standard, `##` is, apparently, a GNU extension.

MSVC needs /Zc:preprocessor adding for whatever reason.
2024-09-12 07:06:15 +01:00
Peter Nelson 7f5a3eaf83
Codefix: Avoid type-casting function pointer with incorrect type. (#12929)
Make `AutolengthProc` take `int` instead of `void *`, avoiding pointer parameters.
2024-09-12 06:49:45 +01:00
Peter Nelson 9631c68ce6
Codefix: Implement explicit ByteReader::PeekDWord() instead of type-punning pointer. (#12928) 2024-09-12 06:49:20 +01:00
Peter Nelson 6deee5e5e2
Fix: Train curve detection did not take shortened parts into account. (#12910)
Only the number of parts between curves was counted, which with shortened parts would be higher than full length parts and fail to limit as expected.
2024-09-12 06:47:54 +01:00
translators bed2a060ce Update: Translations from eints
english (au): 4 changes by krysclarke
greek: 4 changes by gh658804
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
polish: 4 changes by pAter-exe
2024-09-12 04:46:09 +00:00
Peter Nelson 2d51659ed2
Fix d8c36536: \u200B is not allowed in translations. (#12935) 2024-09-10 14:25:36 +01:00
Jonathan G Rennison e477706bf5
Codechange: Add AssignBit function to assign the value of a single bit (#12934)
* Codechange: Add AssignBit function to assign the value of a single bit

* Codechange: Replace various uses of SB with AssignBit

* Codechange: Replace various uses of SB with a constant with SetBit
2024-09-10 08:36:58 -04:00
Tyler Trahan 27efa57b7b
Change: Standardize filter button strings (#12847) 2024-09-10 08:33:06 -04:00
Jonathan G Rennison d0b3e0c47e
Fix: Crash in GetGameStringPtr when there are no GS strings (#12933) 2024-09-10 13:20:38 +01:00
translators d8c36536be Update: Translations from eints
danish: 20 changes by bscargo
2024-09-10 04:44:28 +00:00
Jonathan G Rennison 81b684aa42 Codefix: StationUsesDefaultType always returned false for rail waypoints 2024-09-07 14:58:28 +01:00
Jonathan G Rennison cb2f4f319c Fix: Picker window 'used' filter for rail waypoints
The first two field of struct PickerItem were not populated.
These are required for set operations.
2024-09-07 14:58:28 +01:00
Peter Nelson 29ff3d7b90
Fix: DupSprite did not copy the control_flags field (#12906)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2024-09-07 14:57:44 +01:00
Jonathan G Rennison 5c243ee8f0
Fix: Road stop availability callback (#12931) 2024-09-07 14:57:04 +01:00
Jonathan G Rennison d5ff6b4156
Fix 8d62a8f0: Road stop variable 6B crashing for road stop preview in GUI (#12930) 2024-09-06 11:14:34 +01:00
translators 92cbf7ae43 Update: Translations from eints
french: 6 changes by glx22
2024-09-06 04:44:06 +00:00
translators c1f8569587 Update: Translations from eints
galician: 1 change by pvillaverde
vietnamese: 1 change by myquartz
french: 1 change by FiglidiGP
2024-09-05 04:44:59 +00:00
translators 1d907611d1 Update: Translations from eints
polish: 1 change by pAter-exe
2024-09-04 04:44:39 +00:00
translators 34c09b3596 Update: Translations from eints
bulgarian: 3 changes by Alexandar83
2024-09-03 04:44:13 +00:00
Rubidium f2a8e18792 Fix 208952f: incorrect truncation in string setting validation 2024-09-02 22:16:26 +02:00
translators b80f205967 Update: Translations from eints
italian: 4 changes by Boh132Boh
bulgarian: 505 changes by Alexandar83
2024-09-02 04:45:08 +00:00
translators ef7ad2606c Update: Translations from eints
bulgarian: 161 changes by Alexandar83
2024-09-01 04:45:11 +00:00
translators 2eb3e77207 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
bulgarian: 116 changes by Alexandar83
2024-08-31 04:44:42 +00:00
translators bb770b7b56 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
2024-08-29 04:44:23 +00:00
translators 9eaa00cd89 Update: Translations from eints
czech: 1 change by JsSusenka
2024-08-26 04:45:38 +00:00
Peter Nelson cb23651f43 Codechange: Replace BmpBuffer with RandomAccessFile. 2024-08-24 22:11:04 +01:00
Peter Nelson 719763dfcb Codechange: Store start and end position in RandomAccessFile.
This allows callers to do more bounds checking.
2024-08-24 22:11:04 +01:00
Peter Nelson b5264a72ae
Codechange: [NewGRF] Use reference to unique_ptr instead of .get() (#12919)
This allows assignment to reference when creating a new spec instead of setting and refetching.
2024-08-24 22:10:39 +01:00
Jonathan G Rennison 4070cf9968 Codefix: LinkGraphOverlay::dirty was never initialised 2024-08-24 21:06:33 +02:00
translators 3be96c6816 Update: Translations from eints
english (us): 1 change by 2TallTyler
2024-08-24 04:43:57 +00:00
translators d3252315d3 Update: Translations from eints
bulgarian: 28 changes by DeyanVNikolov
spanish: 1 change by SeveralCircles
2024-08-23 04:43:15 +00:00
Peter Nelson 2327b7030d
Codechange: Use std::string to load ini file comments. (#12909)
This removes realloc/free and some funky old manual memory management.
2024-08-21 22:09:51 +01:00
Peter Nelson 4224d08e72 Codechange: Replace malloc/free with vector for TGP heightmap processing. 2024-08-20 22:15:30 +01:00
Peter Nelson c4a638dfe1 Codechange: Replace malloc/free with vector for screenshot buffers. 2024-08-20 22:15:30 +01:00
Peter Nelson 059462814e Codechange: Replace malloc/free with vector when loading heightmap data. 2024-08-20 22:15:30 +01:00
Peter Nelson 9a037fe5ae Codechange: Replace malloc/free with vector when padding sprites. 2024-08-20 22:15:30 +01:00
Peter Nelson 0f0f3d74ca
Codefix: Delete PersistentStorage when a town is deleted. (#12903) 2024-08-19 08:18:01 +01:00
translators e4c04e86c0 Update: Translations from eints
catalan: 1 change by J0anJosep
french: 1 change by ottdfevr
portuguese: 1 change by azulcosta
2024-08-18 04:42:47 +00:00
translators 4e11a9c49e Update: Translations from eints
korean: 2 changes by telk5093
dutch: 1 change by Afoklala
2024-08-17 04:43:01 +00:00
translators 73cb7cd7df Update: Translations from eints
swedish: 1 change by joeax910
chinese (traditional): 1 change by KogentaSan
chinese (simplified): 1 change by WenSimEHRP
2024-08-16 04:42:51 +00:00
translators f14c152c72 Update: Translations from eints
english (au): 1 change by krysclarke
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
2024-08-15 04:43:54 +00:00
Peter Nelson ff972ec4ff
Codechange: Store custom station layouts in a map instead of nested vectors. (#12898)
The map key is the platforms and length combined. This simplifies allocation and searching for layouts.
2024-08-14 19:58:56 +01:00
Jonathan G Rennison 39465d7f5c
Codefix: Move saveload of road stop tile data (#12883)
So that road stop tile data is also saved/loaded for road waypoints
2024-08-13 19:49:53 +00:00
Peter Nelson 1ff35cb6f9 Codechange: Don't mark animated tiles dirty if frame is not changed.
If animation is continued but the animation frame has not changed then there is no need to mark the tile for refresh.

Loosely backport from JGRPP.
2024-08-13 20:04:44 +01:00
Peter Nelson 8754846901 Codechange: Allow adding to animated tile list without marking dirty.
This avoids redundant tile refreshes when the caller has already marked a tile dirty, or knows it does not need refreshing.

Loosely backported from JGRPP.
2024-08-13 20:04:44 +01:00
Peter Nelson 79369a886a Codechange: Don't mark tiles dirty when deleting from animated tile list.
The callers of DeleteAnimatedTile already know if the tile needs refreshing, so it is redundant for DeleteAnimatedTile to do so.

Loosely backported from JGRPP.
2024-08-13 20:04:44 +01:00
Jonathan G Rennison 88110e9b2e
Fix: Train unit ID allocation when moving engine to new train at train limit (#12887) 2024-08-13 14:53:10 -04:00
Ivan Pravdin 4cddb3a38d Fix 12860, 2bada59: Timetable does not show vehicles as early
Timetable does not show vehicles as early, only as on time.
Fix this by changing 'VehicleIsAboveLatenessThreshold()' to
accept number of ticks the vehicle is late. This allows to
use it with absolute value.

Codefix #12860: Update comments

Co-authored-by: Tyler Trahan <tyler@tylertrahan.com>
2024-08-13 20:16:57 +02:00
Kaiden Joy 7a698c7f1c Fix #12365: Company Window now displays proper inauguration year and period while in wallclock mode. 2024-08-13 20:13:51 +02:00
Jonathan G Rennison 55ca1c77be
Codefix: Remove dead code for WID_SIL_FILTER_ENTER_BTN in sign window (#12897) 2024-08-13 08:37:31 +01:00
translators bdd16ee97f Update: Translations from eints
bulgarian: 77 changes by Alexandar83
2024-08-13 04:43:19 +00:00
Peter Nelson 367e508984 Codefix: Resolve CodeQL warnings by converting to size_t. 2024-08-12 13:33:58 +01:00