1
0
Fork 0
Commit Graph

23359 Commits (5dc02a686f63d74dfd1463d526c0f47f1d5ce8e8)

Author SHA1 Message Date
Peter Nelson 8360fab18a Codechange: Remove CCountedPtr.
This was originally generic and used by YAPF, but now it is used only by script objects.

CCountedPtr provided much more (untested) functionality than used.

ScriptObjectRef already exists for script objects and does the same thing, so use this instead.
2024-10-16 21:52:00 +01:00
Koen Bussemaker d8029b1d84 Fix: CHashTableT's Clear function doesn't set number of items back to zero 2024-10-16 22:36:26 +02:00
Peter Nelson d5b57a56f4
Codechange: Use std::unique_ptr for link graph schedule handlers. (#12988)
This removes manual memory management.
2024-10-15 02:11:06 +01:00
Rubidium 4a6ac52d8c Cleanup: remove some unused #defines 2024-10-14 21:37:00 +02:00
translators c2d58bb88f Update: Translations from eints
vietnamese: 43 changes by KhoiCanDev
italian: 4 changes by Boh132Boh
2024-10-14 04:46:49 +00:00
translators 79c8eac2ee Update: Translations from eints
vietnamese: 106 changes by KhoiCanDev
polish: 1 change by translators
2024-10-13 04:46:13 +00:00
translators c813b2b42d Update: Translations from eints
swedish: 19 changes by joeax910
french: 6 changes by ottdfevr
2024-10-10 04:45:29 +00:00
Peter Nelson 446db2c826
Codechange: Remove redundant NewsStringData data. (#12983)
Since SetDParamStr() always owns a copy of the string, there is no need to make another copy of it to keep it around while the news item exists.

This also fixes a leak in `CmdIndustrySetProduction` as the allocated data wasn't passed to AddIndustryNewsItem.
2024-10-08 19:48:55 +01:00
Jonathan G Rennison d53b681cf7 Codefix f481c9fc: Incorrect references to previous items in DumpTarget 2024-10-08 20:23:08 +02:00
Peter Nelson 14b986609b
Add: AppendStringInPlace() to append translated string ID into an existing string. (#12969)
This allows avoiding a string copy when building strings.
2024-10-07 19:05:38 +01:00
Peter Nelson 3cd1200668
Fix #12976: Incorrect widget rect scrolling for RTL languages. (#12978)
Industry directory, AS/GS and Textfile window did not consider RTL when applying horizontal scrolling.
2024-10-05 08:02:59 +01:00
translators 114c28e69c Update: Translations from eints
korean: 1 change by telk5093
latvian: 6 changes by lexuslatvia
2024-10-05 04:45:35 +00:00
translators 26c2255897 Update: Translations from eints
norwegian (bokmal): 15 changes by eriksorngard
french: 1 change by FiglidiGP
2024-10-03 04:47:03 +00:00
Jonathan G Rennison 22b4a77e37
Codefix: Debug fmt strings in ItemizeBidi (ICU layout) (#12965) 2024-10-01 14:28:40 +01:00
Peter Nelson ccced859f5
Codechange: Mark some water region functions static. (#12964)
These functions are not used elsewhere. This may affect how compilers generate code.
2024-10-01 14:28:16 +01:00
Jonathan G Rennison 386dbb7c80
Codefix: First format argument of IConsolePrint not passed by reference (#12966) 2024-10-01 14:12:19 +01:00
translators 7a0e50002b Update: Translations from eints
galician: 5 changes by pvillaverde
2024-09-30 04:47:06 +00:00
translators 3ed2afa68e Update: Translations from eints
catalan: 5 changes by J0anJosep
2024-09-29 04:45:28 +00:00
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
Peter Nelson d0d5c5c400 Codechange: Pass BmpInfo and BmpData as references.
Avoids needing to check for nullptr.
2024-08-12 13:33:58 +01:00
Peter Nelson f829b1d74a Codechange: Replace BmpData palette and bitmap with vectors.
BmpInfo width and height members are now size_t to avoid multiplication warnings.

This avoids manual memory management and allows BmpData to clean up after itself.
2024-08-12 13:33:58 +01:00
translators 0633b94e8f Update: Translations from eints
bulgarian: 76 changes by Alexandar83
2024-08-12 04:43:14 +00:00
translators 574ec4ede4 Update: Translations from eints
chinese (simplified): 33 changes by WenSimEHRP
bulgarian: 195 changes by Alexandar83
2024-08-11 04:43:19 +00:00
translators 0c4dcd562c Update: Translations from eints
vietnamese: 28 changes by KhoiCanDev
bulgarian: 63 changes by Alexandar83
romanian: 10 changes by The-Bober
ukrainian: 147 changes by Quantom2
2024-08-10 04:45:34 +00:00
translators c69e236f9c Update: Translations from eints
bulgarian: 10 changes by Alexandar83
2024-08-09 04:43:18 +00:00
Jonathan G Rennison daa4981922 Fix 77f27e08: Crash due to incorrect use of AirportSpec::GetIndex 2024-08-08 23:05:33 +02:00
translators cfeab64aaf Update: Translations from eints
bulgarian: 131 changes by Alexandar83
romanian: 43 changes by The-Bober
2024-08-08 04:44:03 +00:00
Jonathan G Rennison e1b9a3e2e7 Fix: Excessively fast ships on aqueducts fail to move at correct speed 2024-08-07 20:59:44 +02:00
translators 19cf605765 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
bulgarian: 329 changes by Alexandar83
romanian: 24 changes by The-Bober
2024-08-07 04:43:44 +00:00
translators 0c7faa4730 Update: Translations from eints
vietnamese: 7 changes by KhoiCanDev
bulgarian: 58 changes by Alexandar83
2024-08-06 04:43:59 +00:00
translators 4c06769ff2 Update: Translations from eints
bulgarian: 127 changes by Alexandar83
2024-08-05 04:42:47 +00:00
translators 6430b5a0ac Update: Translations from eints
chinese (simplified): 31 changes by WenSimEHRP
hungarian: 24 changes by PstasDev
bulgarian: 15 changes by Alexandar83
2024-08-04 04:43:59 +00:00
Peter Nelson a03ddb3ccb Add: [NewGRF] Station property 1E, extended station tile flags.
Properties 11, 14 and 15 to set pylons/nowires/blocked intrinsically only support 8 station tiles.

Add new property to define all three flags for each station tile layout.
2024-08-03 14:57:34 +01:00
Peter Nelson 6e553410d3 Feature: [NewGRF] Allow fixed layout up to 256 tiles per NewGRF rail station.
Allow using up to 256 tile layouts in property 0E or callback 24, which defines the layout to be saved into the map.

This was originally limited to 8, because station graphics above 8 referred to other station types but that was changed in 2007.

1) More efficient than using callback 14, as that needs to be checked every time a station tile is rendered.
2) The layout does not get changed when the station is changed (this may or may not be desirable!)

Using more than 256 layouts still requires callback 14.
2024-08-03 14:57:34 +01:00
Peter Nelson d08636c841 Codechange: Store station layout tiles as std::span.
Using std::span provides both the start and end of the list, which allows validating that the requested layout is in range.
2024-08-03 14:57:34 +01:00
Peter Nelson 70a2ed062d Codechange: Rename CBID_STATION_SPRITE_LAYOUT and CBID_STATION_TILE_LAYOUT.
These callbacks both select rail station tile layouts, the difference is one happens when drawing, the other happens when building. Change the names to make this clearer.
2024-08-03 14:57:34 +01:00
translators ba46128bdd Update: Translations from eints
chinese (traditional): 45 changes by KogentaSan
hungarian: 3 changes by PstasDev
bulgarian: 193 changes by Alexandar83
2024-08-03 04:42:16 +00:00
translators 57afa6002a Update: Translations from eints
chinese (traditional): 15 changes by KogentaSan, 1 change by Bowen951209
bulgarian: 87 changes by Alexandar83
2024-08-02 04:43:42 +00:00
translators 8ba4f8c872 Update: Translations from eints
chinese (traditional): 49 changes by KogentaSan
chinese (simplified): 45 changes by WenSimEHRP
bulgarian: 50 changes by Alexandar83
2024-08-01 04:42:33 +00:00
translators ae2f76e066 Update: Translations from eints
bulgarian: 78 changes by Alexandar83
2024-07-31 04:40:41 +00:00
translators 89fc7e9af6 Update: Translations from eints
chinese (traditional): 8 changes by KogentaSan
bulgarian: 76 changes by Alexandar83
2024-07-30 06:36:33 +00:00
Peter Nelson 3176de3f1d
Codefix: cargo_(dis)allowed for default refit masks are cargo classes, not CargoTypes. (#12884)
Use an alias for CargoClasses to avoid ambiguity.
2024-07-29 20:58:53 +01:00
Patric Stout bec37ee704
Fix: remove the invalid UTF-8 character (U+200B) from the traditional chinese translation (#12882)
Eints should be fixed to not allow this character in the first place,
but this unblocks building the source again.
2024-07-29 09:23:05 +02:00
translators 39688a4ccf Update: Translations from eints
welsh: 55 changes by Ansbaradigeidfran
2024-07-29 04:42:38 +00:00
translators 22e525dafe Update: Translations from eints
chinese (traditional): 140 changes by KogentaSan
2024-07-27 04:42:11 +00:00
Michael Lutz ddf6f33a8a
Change: Path signals now show green on junction-less tracks by default (#12857) 2024-07-26 23:51:49 +02:00
translators 9965cd9151 Update: Translations from eints
chinese (traditional): 46 changes by KogentaSan
2024-07-26 04:44:30 +00:00
translators 44b748a766 Update: Translations from eints
hungarian: 33 changes by peti2000
2024-07-25 04:44:39 +00:00
translators 1a6655bd1b Update: Translations from eints
chinese (traditional): 28 changes by KogentaSan
2024-07-24 04:42:02 +00:00
translators f4e5f1b34d Update: Translations from eints
chinese (traditional): 35 changes by KogentaSan
2024-07-23 04:42:05 +00:00
David Seifert db36e61807
Codefix: Compilation with GCC 15 due to missing CRTP usage (#12876) 2024-07-22 20:42:23 +02:00
translators b2faa14ab5 Update: Translations from eints
chinese (traditional): 57 changes by KogentaSan
galician: 1 change by pvillaverde
latvian: 17 changes by osprinkis
lithuanian: 8 changes by Br0l15
2024-07-22 04:43:29 +00:00
Ivan Pravdin da00a62d59
Fix #12856, e17c82e: Updating network settings does not invalidate data (#12858) 2024-07-21 16:59:48 -04:00
Peter Nelson 4ee45db51b
Change: [UI] Use scaled sprite sizes and correct matrix padding for content list. (#12875) 2024-07-21 14:01:29 +01:00
Peter Nelson 8b644f6ee6
Codechange: Use GetVisibleRangeIterators to draw script settings. (#12871) 2024-07-21 13:40:54 +01:00
Peter Nelson ba2b14b075 Change: [UI] Use proper matrix padding for server list test.
Text was only positioned correctly at 1x scale due to old pixel-based positioning method.
2024-07-21 10:07:50 +01:00
Peter Nelson d85f4b3ebf Change: [UI] Use interface scaled sizes for server list.
Avoid hardcoded values and use WidgetDimensions to set icon positions.

This fits better with non-power-of-2 interface scale.
2024-07-21 10:07:50 +01:00
Peter Nelson 4b6e3f86c2
Cleanup: Remove write-only flag_offset member from server list. (#12872)
A remnant of language flags, removed from the server list long ago.
2024-07-21 08:18:09 +01:00
translators 31e2f5a8a0 Update: Translations from eints
swedish: 3 changes by sereneavatar
chinese (traditional): 22 changes by KogentaSan
2024-07-21 04:42:17 +00:00
Peter Nelson 333e8e590e
Codefix: Don't assume 9 is the widest digit (#12870)
Use `SetDParamMaxDigit()` instead of `SetDParam()` with a large number.
2024-07-19 19:00:21 +01:00
translators 97479eb953 Update: Translations from eints
chinese (traditional): 97 changes by KogentaSan
2024-07-19 04:43:26 +00:00
translators 8ed854be58 Update: Translations from eints
chinese (traditional): 28 changes by KogentaSan
2024-07-18 04:43:42 +00:00
Peter Nelson cd739c2c33
Codechange: Replace dropdown's magic 2 with appropriate WidgetDimension. (#12869) 2024-07-17 22:20:38 +01:00
Peter Nelson 7fb3d1a197 Codechange: Use range-for to iterate airport specs to find first available. 2024-07-17 20:57:33 +01:00
Peter Nelson 2199543fbc Codechange: Use GetVisibleRangeIterators when drawing airport specs. 2024-07-17 20:57:33 +01:00
Peter Nelson b9c44b29be
Codechange: Pass AirportSpec instead of index to airport resolver object. (#12866)
This avoids retrieving AirportSpec again when it is already available.
2024-07-17 18:16:22 +01:00
Peter Nelson e69c065d6e
Codechange: Use find_if to find waypoint StationSpec when converting old savegames. (#12865)
This simplifies an indexed loop.
2024-07-17 11:40:17 +01:00
Joan Josep 891e53c72e
Codechange: move large switch case to separate function (#12863) 2024-07-16 19:41:04 +00:00
Loïc Guilloux d67963e616
Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
translators eeed824329 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
chinese (simplified): 1 change by WenSimEHRP
german: 13 changes by Wuzzy2
2024-07-16 04:43:38 +00:00
translators 1fe11b7b57 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
2024-07-15 04:43:37 +00:00
Jonathan G Rennison 65c666cb57
Codechange: Remove unused size field from struct SaveLoad (#12859) 2024-07-14 14:30:35 -04:00
translators 6006e832f2 Update: Translations from eints
finnish: 6 changes by hpiirai
2024-07-12 04:42:38 +00:00
translators 58e4643196 Update: Translations from eints
vietnamese: 4 changes by KhoiCanDev
2024-07-11 04:43:17 +00:00
Peter Nelson e2a796dbcd Codefix: Potential unterminated string returned from convert_to_fs.
Converting from UTF-8 to UTF-16 could have resulted in a buffer overflow if the buffer size was exactly the length of the converted string.

Pass string_view/span to convert_from/to_fs instead, and ensure the buffer is terminated. This replaces passing a pointer to the buffer and the buffer size as separate parameters, allowing the compiler to pass both in one parameter.

Removes use of `lengthof()`.
2024-07-10 20:57:02 +01:00
Peter Nelson b37954722b Codefix: Don't copy path string to itself.
When determining base paths on Windows the path is converted to UCS-16, and then copied into the same buffer.
2024-07-10 20:57:02 +01:00
Peter Nelson e22eb89b92 Codechange: Call BSWAP32() in the default_grf_overrides initializer.
This causes the BSWAP32 calls to happen only on first initialisation (BSWAP32 is not constexpr), instead of every time GRFs are reloaded.
2024-07-10 20:56:35 +01:00
Peter Nelson b090c8e9bd Codechange: Replace default overrides arrays with std::pair and use range-for.
This avoids indexed array access and use of lengthof.
2024-07-10 20:56:35 +01:00
Peter Nelson 70d63f87b8 Codechange: Re-order ResultSpriteGroup to reduce its size. 2024-07-10 13:22:22 +01:00
Peter Nelson db0ae42d45 Codechange: Set base type of spritegroup related enums.
This has a small impact on SpriteGroup object sizes.
2024-07-10 13:22:22 +01:00
Peter Nelson 55acc1b36d Codechange: Don't format strings passed to GrfMsg unless the message will be used.
This makes GrfMsg() behave more like Debug().
2024-07-10 12:53:23 +01:00
Peter Nelson ba0acb87eb Fix #12832: Sanitise strings from NewGRF before logging them in Debug output.
NewGRF strings may not be UTF-8 encoded, which causes issues on Windows.
2024-07-10 12:53:23 +01:00
Peter Nelson 93eb27d8df
Codechange: Use reference for always_accepted output parameter of AddAcceptedCargo. (#12854)
This parameter should always present (see tile_cmd.h:186), so use a reference to ensure it is.
2024-07-10 12:30:14 +01:00
Peter Nelson 60c3913a99
Codechange: Use range-for and std::size with _plural_forms. (#12852)
This removes indexed array access and use of `lengthof()` macro.
2024-07-10 09:41:28 +00:00
Peter Nelson b4bcb330c7
Codechange: Replace GetSavegameFormat's compression output pointer with std::pair return. (#12850)
This avoids using an unchecked pointer as an out-parameter.
2024-07-09 18:57:47 +01:00
Peter Nelson 100dd7b6d1
Codechange: Use find_if to get default writeable saveload format. (#12849)
* Codechange: Use find_if to get default writeable savegame format.

This removes the last of lastof, and so the lastof macro is removed.
2024-07-09 17:07:40 +01:00
Peter Nelson 56b0eac2e9
Codechange: Use std::span/std::string_view for strecpy. (#12848)
This avoids needing to manually pass the last character of the destination buffer, and allows use of standard library functions.
2024-07-09 00:05:42 +01:00
Peter Nelson aee04e7bc6
Codechange: Pass span to StrValid instead of first and last - 1. (#12846)
`std::span` is used instead of `std::string_view` as this is only used for fixed-length buffers.

This removes some callers of `lastof()`
2024-07-08 08:36:57 +01:00
translators 23bcd592a4 Update: Translations from eints
chinese (simplified): 27 changes by WenSimEHRP
italian: 9 changes by ciampix
esperanto: 7 changes by ciampix
2024-07-08 04:43:44 +00:00
Peter Nelson 6120165433
Fix #12839: Truncated help text dialog on Windows. (#12844)
Replace fixed-length buffer message conversion with std::string.
2024-07-07 18:05:53 +01:00
translators f59ab67672 Update: Translations from eints
english (us): 2 changes by 2TallTyler
dutch: 1 change by Afoklala
french: 2 changes by ottdfevr
2024-07-06 04:42:37 +00:00
translators 5395d5731e Update: Translations from eints
latvian: 3 changes by lexuslatvia
2024-07-05 04:43:57 +00:00
Peter Nelson 4976a0140e
Codefix: [UI] Incorrect initialisation order for rail/road toolbars. (#12843)
The toolbar state was set after the widget tree is created, during which toolbar state is needed.
2024-07-04 22:04:41 +01:00
Edmond Chui 2dc0a33eb7 Fix #12840, ff3be45: "Show industry names" blank panel not initialized properly 2024-07-04 22:51:06 +02:00
translators 794af62286 Update: Translations from eints
english (au): 1 change by krysclarke
swedish: 7 changes by joeax910
chinese (simplified): 2 changes by WenSimEHRP
korean: 1 change by telk5093
french: 2 changes by ottdfevr
2024-07-04 04:43:03 +00:00
translators cd4233bedc Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 2 changes by WenSimEHRP
greek: 1 change by gh658804
russian: 2 changes by Ln-Wolf
finnish: 1 change by hpiirai
catalan: 2 changes by J0anJosep
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2024-07-03 04:42:36 +00:00
Loïc Guilloux 8ef3a3d463
Codefix: "maybe uninitialized" warnings for linux generic release build (#12838) 2024-07-02 11:04:07 +02:00
translators b27527ec0c Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
catalan: 2 changes by J0anJosep
2024-07-02 04:42:53 +00:00
dP f98b90ac2e
Codechange: Use constants for tree growth stages and tile update frequency (#12833) 2024-07-01 15:39:25 -04:00
J0anJosep 1e0004bcd6 Codechange: Slightly simplify code in clear_cmd.cpp. 2024-07-01 17:54:56 +02:00
Rubidium 4e026e448c Feature: encrypt admin connection when using secure join 2024-07-01 17:16:55 +02:00
Rubidium da6900f606 Change: disable the insecure admin login by default 2024-07-01 17:16:55 +02:00
Rubidium 3094b0ce1d Feature: admin support for password authentication without sending password
Using either password authenticated key exchange (PAKE) or authorized keys
2024-07-01 17:16:55 +02:00
Rubidium b03ae8ad75 Codechange: add Authenticate status to the AdminStatus enum 2024-07-01 17:16:55 +02:00
Joan Josep e7982e8082
Fix: typo in picker mode tooltip. (#12834) 2024-07-01 13:24:05 +00:00
Michal Charemza c4b1596c97
Add: [Console] schedule command to execute a script file next in-game month (#12761) 2024-07-01 11:33:42 +02:00
Koen Bussemaker a0845bba2c Codechange: Reduced size of water region by not storing tile area 2024-07-01 11:10:20 +02:00
translators 8c7cf3bc75 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
french: 5 changes by ottdfevr, 1 change by ben20471
2024-07-01 04:42:17 +00:00
steve-goldman f5f488e778
Change: improve when to stops following vehicle (#12808)
- Changing zoom no longer stops following vehicle
- Key scrolling while following a vehicle stops following
- Autoscrolling while following a vehicle stops following
- Main viewport can begin following a vehicle at any zoom
2024-07-01 01:13:47 +02:00
Jeremy Gao 9e14f989f9
Fix: Wrong punctuation in Simplified Chinese (#12717) 2024-06-30 22:54:02 +00:00
translators b5f2004c26 Update: Translations from eints
norwegian (bokmal): 5 changes by eriksorngard
lithuanian: 3 changes by khamper
french: 3 changes by ben20471
2024-06-30 04:41:28 +00:00
Rubidium 14200212b7 Codechange: use std::optional<std::string> over char * for text query results 2024-06-29 16:33:16 +02:00
translators 3819ab25bf Update: Translations from eints
norwegian (bokmal): 5 changes by eriksorngard
galician: 12 changes by pvillaverde
korean: 31 changes by telk5093
dutch: 14 changes by Afoklala
portuguese: 19 changes by azulcosta
2024-06-29 04:42:54 +00:00
Jonathan G Rennison dc258ecbe0 Fix #12825: Crash when opening road toolbar in scenario editor
Due to attempt to access missing road waypoint button
2024-06-28 21:30:38 +02:00
translators 95f2bec9a9 Update: Translations from eints
greek: 14 changes by gh658804
polish: 36 changes by pAter-exe
2024-06-28 04:42:00 +00:00
Peter Nelson a288644e20
Fix #12815, 7e914a0568: Fallback detection failed with sprite font. (#12816)
How missing glyphs were detected was changed, but the sprite font still substituted `?`, which to missing glyph looked like all characters are present.
2024-06-27 07:34:01 +01:00
translators da4b3bebee Update: Translations from eints
english (au): 2 changes by krysclarke
english (us): 2 changes by 2TallTyler
chinese (simplified): 2 changes by WenSimEHRP
russian: 2 changes by Ln-Wolf
finnish: 25 changes by hpiirai
portuguese (brazilian): 2 changes by pasantoro
2024-06-27 04:44:27 +00:00
glx22 b52f778f20 Codefix: [Win32] Use correct range for version in rc file 2024-06-26 23:02:27 +02:00
Tyler Trahan 5ed2fcfb53 Change: Don't use house construction states in Scenario Editor 2024-06-26 16:27:02 -04:00
Tyler Trahan 06bd47af4f Revert d8771b3: Construction stage wrong for all houses 2024-06-26 16:27:02 -04:00
Patric Stout 21813fbe8b
Fix #12818: during Hostile Takeover, profit was calculated wrongly (#12819) 2024-06-26 14:19:53 +00:00
Peter Nelson 209b0320d5
Fix #12735: Default fonts should use default font size as-is. (#12814)
Minimum readable font size should only apply to fallback and configured fonts.
2024-06-26 12:45:39 +01:00
translators 88e53dbdc8 Update: Translations from eints
english (au): 10 changes by krysclarke
swedish: 13 changes by joeax910
english (us): 10 changes by 2TallTyler
chinese (simplified): 14 changes by WenSimEHRP
russian: 6 changes by Ln-Wolf
catalan: 14 changes by J0anJosep
latvian: 15 changes by lexuslatvia
portuguese (brazilian): 12 changes by pasantoro
2024-06-26 04:44:08 +00:00
Joan Josep a873a952aa
Codefix: Reorder comments of HasPowerOnRoad/Rail and IsCompatibleRail. (#12813) 2024-06-25 17:22:53 -04:00
rubidium42 d3c7b1015c Codefix cff48c0f6: unused variable remained after refactor 2024-06-25 22:26:37 +02:00
Steve Goldman 705207e2ce Add: Town window zoom with mouse wheel 2024-06-25 20:48:20 +02:00
Steve Goldman a23ff227e7 Add: Industry window zoom with mouse wheel 2024-06-25 20:48:07 +02:00
Edmond Chui ff3be45c23 Add: Toggle for showing industry names in small map 2024-06-25 20:43:28 +02:00
translators a1e94ccddb Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 2 changes by eriksorngard
english (us): 2 changes by 2TallTyler
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
french: 2 changes by ottdfevr
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2024-06-25 04:41:42 +00:00
Tyler Trahan 9936b3728a
Change: Don't explain what "toggle" means in tooltips (#12805) 2024-06-24 16:28:58 -04:00
Jonathan G Rennison a43dacd988 Add: NewGRF custom road waypoint support 2024-06-24 22:12:08 +02:00
Jonathan G Rennison c35a5e5cb1 Change: Add variable ground types for road waypoints 2024-06-24 22:12:08 +02:00
Jonathan G Rennison eebd5e47db Add: Road waypoint default graphics 2024-06-24 22:12:08 +02:00
Jonathan G Rennison 9c84e5df3f Add: Road waypoint functionality 2024-06-24 22:12:08 +02:00
Jonathan G Rennison c6387c7784 Codechange: Use filter template struct for nearby station type filtering 2024-06-24 22:12:08 +02:00
Jonathan G Rennison 05b65703d3 Codechange: Increase size of StationType field in map array
Move can station have wires bit to make room
2024-06-24 22:12:08 +02:00
Steve Goldman 72276e2d3c Add: Vehicle window zoom with mouse wheel 2024-06-24 21:56:26 +02:00
Steve Goldman c3a051a213 Codechange: Referencing enum for 'scroll_mode' setting in gui_settings.ini 2024-06-24 21:56:26 +02:00
Steve Goldman c53ed9fad6 Codechange: Creating enum for 'scrollwheel_scrolling' setting 2024-06-24 21:56:26 +02:00
translators e8be933ee6 Update: Translations from eints 2024-06-24 04:42:12 +00:00
Peter Nelson e802c1a97f
Add: Show count of towns and industries in their directory window captions. (#12800)
These windows now show "(<visible> of <total>)" in the caption.
2024-06-23 17:55:37 +01:00
Peter Nelson 7116f143d5
Codefix: Hole in vehicle list window if dimensions are not as expected. (#12803)
The layouts for these windows assume that push buttons and dropdowns are the same height.
2024-06-23 08:14:06 +01:00
translators 97e9442d5e Update: Translations from eints
norwegian (bokmal): 32 changes by eriksorngard
galician: 2 changes by pvillaverde
2024-06-23 04:42:04 +00:00
Peter Nelson 91fd082e93
Fix: Apply widget's internal padding to scrollbar capacity/position. (#12801)
For non-WWT_MATRIX widgets, scrollbars need to take account of the internal padding used for the widget.

This is not normally noticeable as framerect padding is only 2 extra pixels
2024-06-22 15:42:13 +00:00
Björn Wärmedal e0bcb54a4b
Change: Allow bribing local authority when other company has exclusive rights (#12763) 2024-06-22 07:51:03 -04:00
translators 49d47b3b74 Update: Translations from eints
greek: 2 changes by gh658804
dutch: 2 changes by Afoklala
lithuanian: 4 changes by khamper
french: 9 changes by Lishouuu
2024-06-22 04:40:41 +00:00
translators 64781df29f Update: Translations from eints
english (us): 2 changes by 2TallTyler
2024-06-21 04:43:18 +00:00
translators e3e215b249 Update: Translations from eints
german: 3 changes by Wuzzy2
portuguese (brazilian): 4 changes by pasantoro
2024-06-20 04:41:06 +00:00
translators 2dab9ac7a5 Update: Translations from eints
swedish: 4 changes by joeax910
catalan: 2 changes by J0anJosep
2024-06-19 04:42:11 +00:00
Peter Nelson b56775f576
Codechange: Avoid making copies of intermediate layout runs. (#12796)
The vector of runs is not used after it is passed to the ParagraphLayout class, so pass with std::move to avoid an unnecessary copy.
2024-06-17 22:58:52 +01:00
Peter Nelson 731c56d116
Codefix: Add missing `const` inside script functions. (#12794)
Scripts do not modify items directly, marking them const enforces this.
2024-06-17 07:19:56 +01:00
translators 7db70f9c3f Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 6 changes by eriksorngard
korean: 3 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 3 changes by hpiirai
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 5 changes by pAter-exe
2024-06-17 04:43:34 +00:00
Tyler Trahan e3156546fa
Codefix: Don't claim to allocate new waypoint when just checking (#12792) 2024-06-16 16:07:57 -04:00
Peter Nelson 2f54904bab
Codefix: Incorrect indentation of NWidgetParts in load/save windows. (#12791)
Fix to use the "standard" layout of 1 tab for nesting widgets and 2 tabs for attributes that wrap on to the next line.
2024-06-16 18:54:19 +01:00
ladysadie 2bc3cc5b67
Codechange: Compiler check for _fios_colours/DetailedFileType (#12781) 2024-06-16 08:54:41 +02:00
translators 0e7916a51b Update: Translations from eints
greek: 2 changes by gh658804
lithuanian: 1 change by khamper
2024-06-16 04:41:19 +00:00
Rubidium b18d8d6574 Fix: ensure revision mismatch also considers random debugging status 2024-06-15 23:14:45 +02:00
merni-ns 0409577277
Add: Setting to disable warning for old vehicles (#12714) 2024-06-15 17:14:29 -04:00
Tyler Trahan d8771b3f68
Change: Don't use house construction states in Scenario Editor (#12730) 2024-06-15 17:11:00 -04:00
Tyler Trahan 4cbaac6dac
Fix #10239: Use elevated snow height for roads on flat foundations (#12776) 2024-06-15 17:10:39 -04:00
Loïc Guilloux d7137651f2
Fix #12787: boostrap doesn't have main vindow (#12788) 2024-06-15 20:39:15 +00:00
Peter Nelson b991a399ef
Codechange: Split MakeNWidget to improve readability. (#12785)
Split MakeNWidget() into two stages, widget-creation and attribute-applying, to reduce function size and make it clearer.
2024-06-15 20:10:52 +01:00
Peter Nelson 22d70f9334
Codechange: Pass NewGRF ByteReader by reference. (#12786)
ByteReader must be present and not null, so don't use a pointer.
2024-06-15 10:55:26 +01:00
Peter Nelson b68172c225
Codechange: Use std::endian instead of TTD_ENDIAN where trivial. (#12778) 2024-06-15 10:24:17 +01:00
Peter Nelson f9f07e9001
Fix #12775: Text truncated incorrectly on Windows. (#12782)
Caused by a -1 in the wrong place, which moved glyphs left one pixel.
2024-06-14 16:32:31 +01:00
Peter Nelson 7b7e00123e Codechange: Shuffle RoadStop members to reduce size.
Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
2024-06-14 13:32:08 +01:00
Peter Nelson 77f62e0c90 Codechange: Shuffle OrderList members to reduce size.
Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
2024-06-14 13:32:08 +01:00
translators 219995c643 Update: Translations from eints
polish: 1 change by pAter-exe
2024-06-13 04:42:16 +00:00
Peter Nelson 55314513ce
Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
translators 81b5a7c7c6 Update: Translations from eints
german: 62 changes by Wuzzy2
2024-06-12 04:42:02 +00:00
Peter Nelson 4cf6d1dd79
Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
translators 18bce69623 Update: Translations from eints
galician: 3 changes by pvillaverde
danish: 1 change by bscargo
polish: 5 changes by pAter-exe
2024-06-10 04:43:42 +00:00
Steve Goldman 7db756e602 Change: Do not automatically connect double depots with track 2024-06-09 14:50:59 +02:00
Jonathan G Rennison fa82dd6096 Fix #12030: Water infrastructure totals when using DC_FORCE_CLEAR_TILE
To remove objects on water
2024-06-09 14:49:09 +02:00
Peter Nelson b4b2fad8e0
Fix #12648: Ensure all uses of std::filesystem::path use native encoding. (#12650)
std::filesystem::path does not expect UTF-8 strings, so they must be converted to native format first (and back to utf-8 after.)
2024-06-09 10:23:47 +01:00
Peter Nelson fce9361bf2 Change: Position caret on left or right of glyph depending on language direction. 2024-06-09 09:57:20 +01:00
Peter Nelson 5cd81a980e Codechange: Store both left and right glyph positions in a run.
This also allows the end of a run to be known without using an extra position entry.
2024-06-09 09:57:20 +01:00
Peter Nelson 80ddcb9d7d Codechange: Move GetCharPosInString/GetCharAtPosition to gfx_layout.
These functions are related more to layouting than graphics.
2024-06-09 09:57:20 +01:00
Peter Nelson bbbf2b5282 Codechange: Return read-only span instead of vector from layout run functions. 2024-06-09 09:57:20 +01:00
translators 6bf214af6e Update: Translations from eints
vietnamese: 3 changes by KhoiCanDev
polish: 13 changes by pAter-exe
2024-06-09 04:41:27 +00:00
Peter Nelson 79c1492a73
Codechange: Use unique_ptr in MemoryDumper. (#12766)
This replaces C-style manual memory management.
2024-06-08 21:59:56 +01:00
Jonathan G Rennison af7ad964dd
Codechange: Avoid unnecessary allocation of temporaries in layout line cache (#12737) 2024-06-08 21:21:02 +01:00
translators d7eb29d292 Update: Translations from eints
dutch: 2 changes by Afoklala
2024-06-08 04:42:12 +00:00
Peter Nelson df1b6a933b
Fix #12764: Crash when opening Detailed performance rating window with no companies. (#12765) 2024-06-07 21:57:18 +01:00
translators 79b573704b Update: Translations from eints
french: 1 change by ottdfevr
portuguese: 2 changes by azulcosta
polish: 33 changes by pAter-exe
2024-06-07 04:43:07 +00:00
Peter Nelson 66044472d7 Codechange: Use std::unordered_map for NewGRF language_map.
NewGRFs only use a small subset of the available language IDs. Using an unordered_map allows only the reference languages to have space allocated.

This avoids manual new/delete of array.
2024-06-06 19:53:10 +01:00
Peter Nelson fee73f3253 Codechange: Split types out of newgrf_text.h 2024-06-06 19:53:10 +01:00
translators fa24a3ec6b Update: Translations from eints
korean: 1 change by telk5093
2024-06-06 04:41:41 +00:00
translators 1f636d94d4 Update: Translations from eints
finnish: 2 changes by hpiirai
2024-06-05 04:43:21 +00:00
Peter Nelson 57186d4650
Fix: Editbox behaved improperly with RTL languages. (#12746)
Text in the editbox was always left-aligned and did not scroll with the caret position.
2024-06-04 23:05:51 +01:00
Peter Nelson 579ce8eae0
Codefix: Find GRF override entries properly. (#12743)
My naive code from 16 years ago tested for GRF overrides in a way that will create empty 0 entries for each source GRF tested.
2024-06-04 18:06:19 +01:00
translators 342a7cebd6 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 2 changes by WenSimEHRP
urdu: 6 changes by haidermazhar
russian: 2 changes by Ln-Wolf
catalan: 3 changes by J0anJosep
latvian: 2 changes by lexuslatvia
portuguese (brazilian): 2 changes by pasantoro
2024-06-04 04:41:49 +00:00
Peter Nelson 5fd23a2d70
Codechange: Pre-reserve vectors during NewGRF loading. (#12748)
Call reserve when we are given the number of elements up front. This reduces the number of reallocations and over-allocations done during loading.
2024-06-03 18:40:27 +01:00
translators 01c75fc578 Update: Translations from eints
urdu: 24 changes by haidermazhar
2024-06-03 04:42:34 +00:00
Peter Nelson 1ab280a27a
Change: Use UK OSK layout for English (UK) (#12720) 2024-06-02 15:28:51 +01:00
translators 0d10c5e93c Update: Translations from eints
greek: 1 change by gh658804
2024-06-02 04:41:25 +00:00
Peter Nelson 6d2424c0ef
Codechange: Update each town label dimensions once during map gen. (#12742)
This avoids re-layouting the label for each change in population as the town is grown.
2024-06-01 16:57:17 +01:00
Peter Nelson 96fc367bcf
Change: [NewGRF] Treat house max year 0xFFFF as MAX_YEAR. (#12740) 2024-06-01 12:54:49 +01:00
translators 3827229c74 Update: Translations from eints
english (us): 1 change by 2TallTyler
finnish: 1 change by hpiirai
dutch: 1 change by Afoklala
2024-06-01 04:41:17 +00:00
Peter Nelson 7e914a0568 Fix #12738, de16655f: Fallback font searcher failure since ? substitution removed.
Fallback font searcher looked for the substituted ? glyph, which was removed by #12736.

Instead of comparing against a sprite, test against the font returning a missing glyph.

This should also improve performance of fallback font searching, as previously glyphs were actually rendered while searching.
2024-05-31 21:47:47 +01:00
translators 5bca185923 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 1 change by WenSimEHRP
russian: 1 change by Ln-Wolf
slovak: 20 changes by Kukoluk
latvian: 1 change by lexuslatvia
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
2024-05-31 04:43:36 +00:00
Rubidium 31085230a6 Codechange: use std::vector for the available neighbours 2024-05-30 23:15:38 +02:00
Rubidium 2864f3b3eb Cleanup: remove C-style hash, binary heap and priority queue 2024-05-30 23:15:38 +02:00
Rubidium 0e75dfd49f Codechange: migrate aystar to use YAPF's nodelist infrastructure 2024-05-30 23:15:38 +02:00
Peter Nelson 48539992e8 Codechange: Use std::unordered_map for storing TrueTypeFontCache's GlyphEntry. 2024-05-30 20:16:28 +01:00
Peter Nelson 7b717fcccb Codechange: Replace AllocatorProc with SpriteAllocator class.
This allows for state to be passed to or maintained by the allocator.
2024-05-30 20:16:28 +01:00
Peter Nelson de16655f76
Change: [UI] Remove substitution of missing glyph with '?' glyph. (#12736)
When a glyph does not exist, we substitute it with the '?' glyph instead, but layouters are not aware of this substitution.
2024-05-30 18:33:58 +01:00
Peter Nelson 9c19cf06e4
Change: [UI] Use SetMinimalTextLines to set label height correctly. (#12734)
SetMinimalSize does not know about font size, so these labels were incorrectly sized if the font height is different from normal.
2024-05-30 12:31:21 +01:00
Peter Nelson 0f230244fe
Codechange: [UI] Remove redundant SetMinimalSize for WWT_EDITBOX widgets. (#12733) 2024-05-30 08:34:26 +01:00
Tyler Trahan deb77463b0
Fix #12492: Clarify helptext for "minutes per year" setting (#12726) 2024-05-29 14:58:36 -04:00
Jonathan G Rennison 85918fc23e Fix: Water infrastructure total when changing owner of object on water 2024-05-29 20:11:43 +02:00
Peter Nelson 2e7819927f
Fix: Invalidate game options window after changing base sounds set. (#12731) 2024-05-29 17:05:04 +01:00
translators 51e170a8d0 Update: Translations from eints
swedish: 12 changes by sereneavatar
2024-05-29 04:42:57 +00:00
Peter Nelson f220ed179d
Codechange: Use std::unordered_map for SpriteFontCache's glyph map. (#12724)
Replaces a C-style malloc'd array and malloc'd contents, and no manual memory clean up is necessary.
2024-05-28 19:34:03 +01:00
Peter Nelson 3d4b98845a
Codechange: Remove initial colour from layouter cache. (#12728)
Initial colour is now always TC_INVALID, which is substituted with the desired colour when drawing the layout line.

This allows strings which differ only by initial colour to use the same layout cache entry, increasing the efficacy of the cache.
2024-05-28 19:33:44 +01:00
translators 605dff4920 Update: Translations from eints
swedish: 9 changes by joeax910
english (us): 2 changes by 2TallTyler
luxembourgish: 4 changes by phreeze83
catalan: 2 changes by J0anJosep
latvian: 27 changes by lexuslatvia
2024-05-28 04:45:37 +00:00
Tyler Trahan 37f68a65ee
Fix #12283: Vehicle group dropdown shouldn't have default action (#12727) 2024-05-27 16:26:07 -04:00
Peter Nelson f6c5da4cad
Fix: Incorrect dump_info output with labels outside of ascii range. (#12723)
An unspecified cargo label is 0x00000000, which terminates C-strings.
2024-05-27 12:44:49 +01:00
Peter Nelson 4b81b62b72
Change: Don't reinitialise font caches when setting initial interface scale. (#12722) 2024-05-27 12:44:34 +01:00
translators 692943669d Update: Translations from eints
galician: 34 changes by pvillaverde
greek: 3 changes by gh658804
2024-05-27 04:41:33 +00:00
Peter Nelson 517dab35b1
Codechange: Use range-for to iterate base media files. (#12721) 2024-05-26 16:46:18 +01:00
Peter Nelson 3c42f701d7
Fix: Allow changing size of default OpenTTD font. (#12641)
* Fix: Allow changing size of default OpenTTD font.

Size configuration for default font was ignored as a different code path to load the font was followed.

Resolved by removing this additional path and conditionally selecting the default font.
2024-05-26 15:59:25 +01:00
Peter Nelson 2c70ccb137
Add: [NewGRF] Extended custom waypoint classes. (#12653)
This allows waypoints to be split into categories just like stations, instead of all being lumped together.

Station class labels with the first byte set to 0xFF will be treated in the same way as the 'WAYP' class.
2024-05-26 09:53:33 +01:00
translators d11823df36 Update: Translations from eints
korean: 2 changes by telk5093
2024-05-26 04:42:20 +00:00
Koen Bussemaker 6efc1fa250 Codechange: Removed unused yapf PfNodeCachFlush function 2024-05-25 21:49:12 +02:00
translators c325a2ebd4 Update: Translations from eints
estonian: 3 changes by siimsoni
dutch: 2 changes by Afoklala
french: 2 changes by ben20471
portuguese: 2 changes by azulcosta
2024-05-25 04:42:07 +00:00
Peter Nelson 676d64037d
Fix d6ccfdb: GetCharPosition failed for RTL text. (#12710)
Changes in d6ccfdb assumed that character indexes only incremented, which is not true for RTL text.
2024-05-24 15:33:30 +01:00
translators d9cadb49b0 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 7 changes by WenSimEHRP
korean: 4 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
portuguese (brazilian): 2 changes by pasantoro
2024-05-24 04:43:08 +00:00
Peter Nelson 5fefe0b61f
Fix: Reverse left/right keypress when editing RTL text. (#12711)
When editing RTL text, pressing left should increment instead of decrement the character position to move left, and vice versa.
2024-05-23 21:34:05 +01:00
Peter Nelson f87c6990b0
Fix: Memory leak in CoreTextFontCache. (#12662)
Temporary buffer for rendering glyphs was not freed after use. Instead let CGBitmapContextCreate() handle the buffer.

> data may be a pointer to pixels. If you pass NULL, the context will create its own buffer and free that buffer itself later. If you pass your own buffer, the context will not free it; it remains your buffer that you must free after you release the context, hopefully for the last time.
2024-05-23 21:07:11 +01:00
yeah-its-gloria 071796660d Fix: Implement support for secure state coding on macOS
Fixes a warning when running on macOS 14 and newer about not officially supporting secure state coding.
2024-05-23 19:32:29 +02:00
Jonathan G Rennison b2572c7ca8 Fix #12563: Race condition setting finish flag in WinHTTP 2024-05-23 19:31:45 +02:00
translators 9f13d3ff2b Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
greek: 11 changes by gh658804
2024-05-23 04:40:46 +00:00
Tyler Trahan 8f6e21617f
Fix #12591: Give descriptive error when station construction fails due to wrong layout (#12678) 2024-05-22 17:56:03 -04:00
Rubidium b2f1a06def Change: support listing/updating authorized keys of companies by the admin in the console 2024-05-22 22:20:10 +02:00
Rubidium fea9ffa808 Codechange: also allow removing clients from the company allow lists 2024-05-22 22:20:10 +02:00
Peter Nelson 8a6745b26f
Codechange: Use PIP instead of spacer widgets for OSK spacing. (#12709)
This (slightly) simplifies the OSK widget layout.
2024-05-22 19:06:52 +01:00
Peter Nelson 766350bfd2
Fix: Hide empty house 'classes' in house picker. (#12694)
Picker class list should not list classes with no items. The house picker could break this 'rule' with NewGRFs loaded.
2024-05-22 18:06:59 +01:00
Peter Nelson 7e12b5ff0f
Fix: Crash if interface scale or font size changes with chat box present. (#12705)
Caused by the chat box being undrawn with the new dimensions, leading to out-of-bounding memory access.
2024-05-22 18:06:34 +01:00
Jonathan G Rennison 42fc32243d
Fix #12681: Abstract filetype not set for network client join savegames (#12701) 2024-05-22 09:43:01 +01:00
Peter Nelson 19ca4089a1
Codechange: Use std::filesystem::exists instead of access. (#12702) 2024-05-22 09:23:01 +01:00
translators 5bc3723bcc Update: Translations from eints
czech: 11 changes by vladoschreiner
2024-05-22 04:42:40 +00:00
Peter Nelson 5442b0dd2d
Fix: Make progress bars obey language direction. (#12704)
With RTL languages, progress bars should start from the right.
2024-05-21 00:40:08 +01:00
Peter Nelson 28e814f62a
Codechange: Use L"" instead of _T("") (#12703) 2024-05-20 17:34:22 +00:00
translators fb4a370d3f Update: Translations from eints
vietnamese: 13 changes by KhoiCanDev
chinese (simplified): 1 change by WenSimEHRP
finnish: 11 changes by hpiirai
french: 29 changes by ottdfevr
polish: 1 change by aefoes
2024-05-20 04:43:22 +00:00
translators 46d7586ab1 Update: Translations from eints
estonian: 8 changes by siimsoni
chinese (simplified): 4 changes by ahyangyi
korean: 13 changes by telk5093
2024-05-19 04:43:16 +00:00
Loïc Guilloux 29ce013eda
Codechange: Pass avail(able) as reference instead of pointer since they are never nullptr (#12696) 2024-05-18 17:04:16 +02:00
Peter Nelson ba47d1ca2b
Fix: Allow resolving house parent scope (town) of unbuilt houses. (#12695)
Return unavailable variable result, instead of nullptr dereference.
2024-05-18 12:33:50 +01:00
Peter Nelson 3f5a354f37
Codechange: Use emplace with ICURun and UniscribeRun. (#12693) 2024-05-18 09:17:38 +01:00
Peter Nelson 856ec901ca
Fix #12685: nullptr dereference when checking for equal loaded/loading groups. (#12686)
Always treat empty groups as non-equal. Given that the case of both being empty is handled earlier, they cannot both be equal and empty.

Additionally if a loaded or loading set are all the same, only add one reference.
2024-05-18 09:17:06 +01:00
translators 7fd2487c46 Update: Translations from eints
swedish: 6 changes by joeax910
chinese (simplified): 2 changes by WenSimEHRP
dutch: 27 changes by Afoklala
2024-05-18 04:40:26 +00:00
Peter Nelson 8d26d032e1
Fix #12497: [NewGRF] Increase vehicle motion counter for all parts. (#12561)
NewGRFs relied on the incorrectly motion counter that was 'fixed' in #12229, so always update v->motion_counter for all vehicle parts.
2024-05-17 20:50:04 +01:00
Peter Nelson c85481564f
Codechange: Use reusable temporary buffer in Win32FontCache. (#12666)
This avoids allocating and deleting a temporary buffer for every glyph that is rendered into a sprite.
2024-05-17 08:50:59 +01:00
Peter Nelson 4940b6ff0b
Codefix: Compile warning with newer C++ compiler on MinGW. (#12689)
> template-id not allowed for constructor in C++20
2024-05-16 12:09:19 +01:00
translators 26113e3622 Update: Translations from eints
english (au): 11 changes by krysclarke
swedish: 7 changes by joeax910
english (us): 11 changes by 2TallTyler
chinese (simplified): 11 changes by WenSimEHRP
russian: 11 changes by Ln-Wolf
catalan: 11 changes by J0anJosep
portuguese: 13 changes by azulcosta
portuguese (brazilian): 11 changes by pasantoro
2024-05-16 04:41:07 +00:00
Peter Nelson ca52da6c95
Fix: Unable to choose a font containing hyphen. (#12684)
FcNameParse may require some characters be escaped. Instead, pass name as FC_FAMILY.
2024-05-16 00:38:23 +01:00
Peter Nelson d1b7619822
Change: Ignore min/max years for manual house placer. (#12687) 2024-05-15 23:17:58 +01:00
translators 56ea002283 Update: Translations from eints
catalan: 16 changes by J0anJosep
latvian: 2 changes by lexuslatvia
2024-05-15 04:41:37 +00:00
Peter Nelson 980dcaac6e
Cleanup: Remove GetFontTable from FontCache. (#12677)
This interface is no longer used, so does not need to be implemented.

Removes manual memory management with malloc/free.
2024-05-14 21:13:26 +01:00
Peter Nelson ed67aedabf Feature: Allow manually placing town buildings in scenario editor.
House picker is accessed from the Landscaping toolbar as there is no town toolbar.

Once placed these houses behave like any other and can be removed by players and towns.

Uses the unified picker system, so also supports used/saved favourites. As town building don't have class labels, town zones are use to imitate them.
2024-05-14 21:11:48 +01:00
Peter Nelson 874cfe000b Codechange: Set underlying type for HouseSpec enums. 2024-05-14 21:11:48 +01:00
Peter Nelson b731ab0632 Change: Allow sprite resolver to evaluate non-existent houses.
This could previous be done but only with a town and tile in mind, but for drawing in the UI, neither of those exist yet.
2024-05-14 21:11:48 +01:00
Peter Nelson d99c1337a2 Add: Command to build an individual house on a specific tile. 2024-05-14 21:11:48 +01:00
Peter Nelson f901722066 Codechange: Rename BuildTownHouse to TryBuildTownHouse. 2024-05-14 21:11:48 +01:00
Tyler Trahan bb77d16e40
Add: Shade button to waypoint picker (#12682) 2024-05-14 14:43:56 -04:00
Muxy 486af1a6fc Fix: [Admin] #12411 Send Network Welcome Packet to admin port after game creation completed
WelcomeAll moved into NetworkOnGameStart

Signed-off-by: Muxy <muxy@goulp.net>
2024-05-14 19:24:31 +02:00
Peter Nelson 460fab920c
Fix #12418, 338def1b06: Filename extension taken from wrong string. (#12680) 2024-05-14 18:18:30 +01:00
Rubidium 00c4b232b3 Fix #12550: files were not saved in the right location when binary and configuration are in the same folder 2024-05-14 17:01:28 +02:00
translators 3f06aa441b Update: Translations from eints
english (us): 17 changes by 2TallTyler
greek: 147 changes by KyriakosMich
2024-05-14 04:40:19 +00:00
Tyler Trahan 9f63b9f65d
Fix #12594: Give descriptive error when company takeover fails due to vehicle limit (#12676) 2024-05-13 10:10:03 -04:00
translators 870149406a Update: Translations from eints
chinese (simplified): 23 changes by WenSimEHRP
russian: 17 changes by Ln-Wolf
portuguese (brazilian): 8 changes by pasantoro
2024-05-13 04:41:24 +00:00
Peter Nelson 18e56df5e1
Fix #12674: Non-NewGRF Build Station widgets may not fill window properly. (#12675)
Allow labels in Build Station window to fill width as needed.
2024-05-13 00:18:07 +00:00
Peter Nelson f2f7573c3f
Fix #12668: Crash opening picker window with filter when no results available. (#12669)
When first opening the picker window, we attempt to find a valid class and type to select. If the picker window was closed with filters enabled, there may not be anything list that is usable.

Resolve this by using callbacks to find the first usable type when no types are listed.
2024-05-12 20:14:29 +01:00
Rubidium 77c188e6da Codechange: use std::vector instead of malloced array 2024-05-12 12:55:52 +02:00
Rubidium 6cea49c117 Codechange: replace uint with size_t in binary heap 2024-05-12 12:55:52 +02:00
Rubidium 8349203038 Cleanup: remove unused Aystar variables 2024-05-12 10:46:03 +02:00
Peter Nelson 77a7113ba6
Cleanup: Remove unused parameters from FreeTypeFontCache::SetFontSize. (#12663) 2024-05-12 08:39:40 +01:00
Rubidium f939e81bf0 Fix #12655, 4f6d75f: inconsistent state in client list and potential crash after client leaves 2024-05-12 07:23:40 +02:00
translators 95a89e43b2 Update: Translations from eints
english (au): 16 changes by krysclarke
chinese (simplified): 16 changes by XiaoJi-Game
korean: 19 changes by telk5093
russian: 1 change by Ln-Wolf
finnish: 16 changes by hpiirai
lithuanian: 1 change by khamper
portuguese: 17 changes by azulcosta
portuguese (brazilian): 16 changes by pasantoro
2024-05-12 04:41:31 +00:00
Peter Nelson 34da94ffc8
Fix: Use widget resize step instead of window resize step. (#12659)
Build Picker class list filter could be drawn incorrectly depending on how the window can be resized.
2024-05-11 20:51:44 +01:00
Peter Nelson d78f39a9df
Cleanup: Remove GetUnitsPerEM and units_per_em. (#12656)
GetUnitsPerEM is never called.
2024-05-11 14:50:34 +01:00
translators 721cd2b8ad Update: Translations from eints
ukrainian: 1 change by Quantom2
dutch: 5 changes by Afoklala
lithuanian: 1 change by khamper
2024-05-11 04:41:26 +00:00
Peter Nelson b30fe0d7da Feature: Ctrl-click to toggle favourites in build-pickers.
This allows ctrl-click on a type in a build-picker window to remember it
as a favourite. An new filter button to show only favourites makes it
simpler to use these types.

Favourite types are saved locally in favs.cfg, so are remembered between
games.
2024-05-11 02:12:41 +01:00
Peter Nelson fde3b35a24 Feature: New filter to show only used types in build-pickers.
This filters the build-picker type lists to only show types that have
already been placed in the current game, making it simpler to get to
build matching features.
2024-05-11 02:12:41 +01:00
Peter Nelson b76517816e Feature: Add "All" filter to build-picker show types from all classes.
Toggling the "All" filter causes the class selection to be ignored, so
that items from all classes can be displayed together. The class text
filter is still applied.

This makes it easier to search amongst types for a feature.
2024-05-11 02:12:41 +01:00
Peter Nelson cdc356e7bf Change: Unify station/waypoint/roadstop/object build-picker window code.
These windows now share a common code base for choosing and display class and types.

An additional text filter is added to search types by name instead of just classes.
2024-05-11 02:12:41 +01:00
Peter Nelson d2c8b476b5 Codechange: Add functions to test if a station/roadstop class is a waypoint.
This is now checked by class label instead of by index.
2024-05-11 02:12:41 +01:00
Peter Nelson 9f8c9724be Codechange: Add station/roadstop class labels for DFLT/WAYP.
This avoids repeating the same multichar literal value.
2024-05-11 02:12:41 +01:00
Peter Nelson d5671030b1 Codechange: Add NewGRFSpecsBase class to hold class/index information.
Standardises how the class index is stored in the spec, instead of relying ot the Spec structs having the same members.

This allows retrieving class_index and index without searching or using pointer arithmetic.

'cls_id' is renamed to 'class_index' to make it clearer that it is an index rather than the multichar label of the class.
2024-05-11 02:12:41 +01:00
Peter Nelson 733284cc16 Codechange: Return std::vector from GetMusicCatEntryData.
Return std::vector instead of pointer to array with manual memory management.
2024-05-11 02:10:41 +01:00
Peter Nelson 31c306c6cd Codechange: Return std::string from GetMusicCatEntryName.
Return std::string instead of pointer to C-string with manual memory management.
2024-05-11 02:10:41 +01:00
frosch dc22edc556 Doc: [Script] Extend API documentation on calendar- vs economy-time 2024-05-10 13:17:19 +01:00
frosch 04cc0c8125 Codechange: [Script] Document relation between ScriptErrorType and ErrorMessages enums 2024-05-10 13:17:19 +01:00
frosch 40e6230900 Codechange: Add main page to script API documentation 2024-05-10 13:17:19 +01:00
frosch dfa2622153 Codechange: Unify naming of squirrel built-in types in Script API docs 2024-05-10 13:17:19 +01:00
frosch e436e2ef40 Codefix: broken links and syntax issues in script API documentation 2024-05-10 13:17:19 +01:00
frosch 64e1f1d4d9 Codefix: Script API documentation about IDs was incomplete 2024-05-10 13:17:19 +01:00
frosch 4bf2dc3148 Codefix: Script API did not link simple types correctly 2024-05-10 13:17:19 +01:00
frosch c1375cecf8 Codefix: [Script] script_types was excluded from API documentation 2024-05-10 13:17:19 +01:00
frosch ffe76a0133 Update: Doxyfiles to doxygen 1.9.4 2024-05-10 13:17:19 +01:00
merni-ns c3ee5e58a3 Cleanup: Move remaining NPF files into pathfinder directory 2024-05-10 10:38:44 +02:00
merni-ns 798ec4184b Cleanup: Remove unused function InvalidateShipPathCache
This was only used in the callback when changing the ship pathfinder setting.
2024-05-10 10:38:44 +02:00
merni-ns 55a7c59d13 Remove: NPF and pathfinder change settings 2024-05-10 10:38:44 +02:00
translators a5c2543efc Update: Translations from eints
chinese (simplified): 7 changes by WenSimEHRP, 4 changes by ahyangyi
2024-05-10 04:40:29 +00:00
Rubidium cef9417c9f Fix: always allow setting company settings, company/president name/face
There is a nice feature that synchronises the client settings upon setting up the company. Before
this, those commands would not be executed when no-actions-while-paused is set. This means that,
silently and depending on the server configuration, your wished for configuration might not be
there.

Similarly there is the president's face that's being set while creating a new company and setting
of the president/company name upon creation, when no-actions-while-paused is set.

So, just allow these operations also while paused to get a uniform experience when joining. To
keep the UI somewhat consistent, apply this "freedom" also to the other bits set from the company
UI; specifically company name and company colour.
2024-05-09 21:51:26 +02:00
Rubidium a313676189 Doc: reason for using ::SendNet over ::Post in few cases 2024-05-09 21:51:26 +02:00
Rubidium ed888c617b Codechange: just use ::Post over ::SendNet for creating new companies 2024-05-09 21:51:26 +02:00
Koen Bussemaker 59ac27f385 Fix #12643: _is_water_region_valid is not cleared/reset in AllocateWaterRegions 2024-05-09 20:18:04 +02:00
Peter Nelson ec61951512
Cleanup: Remove Windows 9x font locale workaround. (#12644) 2024-05-09 07:03:02 +01:00
Peter Nelson 5b35fbd6f5
Change: Use button aspect ratio for buttons that show vehicle icons. (#12636) 2024-05-09 07:01:56 +01:00
translators 132e226b27 Update: Translations from eints
greek: 169 changes by KyriakosMich
lithuanian: 21 changes by khamper
polish: 1 change by pAter-exe
2024-05-09 04:42:47 +00:00
ladysadie 00cfd572ff
Cleanup: Remove unneeded CheckMissingGlyphs call (#12640) 2024-05-08 21:42:02 +02:00
translators cb3f99859c Update: Translations from eints
english (au): 1 change by krysclarke
estonian: 25 changes by siimsoni
korean: 3 changes by telk5093
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
catalan: 5 changes by J0anJosep
latvian: 30 changes by lexuslatvia
lithuanian: 140 changes by khamper
portuguese: 1 change by azulcosta
portuguese (brazilian): 3 changes by pasantoro
2024-05-08 04:40:34 +00:00
Peter Nelson b74a7e749b
Fix: Console command scrolling did not take account of padding and cursor width. (#12642) 2024-05-08 01:52:30 +01:00
Peter Nelson 731d46beb5
Change: Don't include midi file processing in dedicated server build. (#12632) 2024-05-08 00:57:52 +01:00
Peter Nelson 9008d793ab
Change: Use per-company group numbers. (#12297)
This is used by the default group name, replacing the use of group index.
2024-05-07 19:01:28 +00:00
Jonathan G Rennison 8710e9b8c8 Fix #12608: SDL keycode to vkey mapping 2024-05-07 18:33:29 +02:00
translators ab7e2a1883 Update: Translations from eints
english (au): 2 changes by krysclarke
english (us): 2 changes by 2TallTyler
greek: 4 changes by gh658804
russian: 2 changes by Ln-Wolf
finnish: 4 changes by hpiirai
danish: 2 changes by bscargo
lithuanian: 170 changes by khamper
french: 1 change by ben20471
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2024-05-07 04:41:01 +00:00
Rubidium 1a3cbaec56 Cleanup: remove warning about server administrators being able to read passwords 2024-05-07 00:03:15 +02:00
Rubidium 849d1fa1b3 Cleanup: remove UI for asking user for company password 2024-05-07 00:03:15 +02:00
Rubidium 457d51fc49 Cleanup: remove company password hashing and anything related to it 2024-05-07 00:03:15 +02:00
Rubidium a9318cf653 Cleanup: remove UI for changing the password 2024-05-07 00:03:15 +02:00
Rubidium 9dc1fdc385 Cleanup: remove client side password checks when moving to a different company 2024-05-07 00:03:15 +02:00
Rubidium 16639939e9 Cleanup: remove command line option for company password 2024-05-07 00:03:15 +02:00
Rubidium ca4bef1504 Cleanup: remove company password related network packets 2024-05-07 00:03:15 +02:00
Rubidium 71fc907584 Change: remove company passwords over client allow lists 2024-05-07 00:03:15 +02:00
Rubidium a002803d1c Remove: autoclean_unprotected settings; all companies will be protected 2024-05-07 00:03:15 +02:00
Rubidium 4f3db8eeaf Feature: authorize specific clients to join network company without password 2024-05-07 00:03:15 +02:00
Rubidium 66354ab9eb Codechange: introduce allow list infrastructure for companies 2024-05-07 00:03:15 +02:00
Rubidium 1250ce8fdc Codechange: support storing std::string vectors/deques in the savegame 2024-05-07 00:03:15 +02:00
translators 4e9a280ef8 Update: Translations from eints
swedish: 2 changes by sereneavatar
norwegian (bokmal): 2 changes by eriksorngard
welsh: 19 changes by Ansbaradigeidfran
english (us): 2 changes by 2TallTyler
czech: 1 change by JsSusenka
lithuanian: 97 changes by khamper
french: 2 changes by Lishouuu
portuguese (brazilian): 1 change by pasantoro
polish: 2 changes by pAter-exe
2024-05-06 04:41:07 +00:00
Rubidium b9c894b717 Fix: for GUI network servers, name the first company the same as any other company 2024-05-05 22:57:50 +02:00
Rubidium 455e202e03 Fix: server's client is shown incorrectly in some cases 2024-05-05 22:57:50 +02:00
Peter Nelson 4740eeaa43
Add: 'Get Content' buttons next to base set dropdowns in Game Options. (#12627)
This allows base set content to be downloaded more easily, filtered by type and next to where it is set up.
2024-05-05 16:15:35 +01:00
Koen Bussemaker d2f98440bb Codechange: Make assert in follow_track easier to understand and debug 2024-05-05 16:30:44 +02:00
Peter Nelson 84ebae0bf5
Codechange: Tweak layout of network client list. (#12624)
Use PIP spacing instead of spacers and more used of standard WidgetDimensions.
2024-05-05 14:57:17 +01:00
Peter Nelson cf94bd321d
Codechange: Remove redundant SetMinimalSize of preview buttons. (#12622)
These widgets are also sized in UpdateWidgetSize where the current bevel width is accounted for as well.
2024-05-05 12:38:00 +01:00
Peter Nelson 72b2840a97
Codechange: Use PIP spacing instead of spacers in tree picker window. (#12623) 2024-05-05 12:37:45 +01:00
translators 99f497cb08 Update: Translations from eints
english (au): 2 changes by krysclarke
korean: 2 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
danish: 2 changes by bscargo
lithuanian: 4 changes by dziugas1959
portuguese: 2 changes by azulcosta
portuguese (brazilian): 4 changes by pasantoro
2024-05-05 04:40:50 +00:00
Rubidium 9fe9e4d398 Codechange: use vector instead of manual memory management for decompressing text files 2024-05-04 17:43:02 +02:00
Peter Nelson d074ab909c
Codechange: Replace Array/FixedSizeArray with std::deque. (#12409)
Array/FixedSizeArray is actually a resizeable container that allocates space in chunks and allows resizing without invalidating pointers.

This is also a behaviour of std::deque, so use that instead.
2024-05-04 10:55:16 +01:00
Peter Nelson f629d3c921
Codechange: Use vectors instead of CallocT/free for cache checks. (#12619)
Vectors are reused for each vehicle chain to save on reallocations.
2024-05-04 09:42:20 +01:00
Peter Nelson 115ac2629b
Cleanup: Remove TileMatrix that hasn't been used for 4+ years. (#12621)
This 'nice' structure was left around from #8258 just in case it might be used again.

Spoiler alert: it hasn't.

This removes manual memory management. And otherwise unused and untested code.
2024-05-04 09:41:58 +01:00
translators 60cf37e0d1 Update: Translations from eints 2024-05-04 04:41:06 +00:00
Peter Nelson 9a7c30a109 Codechange: Let ClickSliderWidget handle rounding to nearest mark. 2024-05-03 11:48:36 +01:00
Peter Nelson 9d2efd4c96 Codechange: Use callback function to set labels of slider widget marks.
Slider widgets can only use a predefined list of values and strings to draw labels. This makes it difficult to vary the display by context.

Instead of providing a predefined list as a std::map, use a callback function instead. This function can decide what text to display, and can call SetDParam to dynamically set up strings.
2024-05-03 11:48:36 +01:00
Rubidium 8b6661d486 Codefix 90029be: build failure for SDL 1.2 2024-05-03 10:45:34 +02:00
translators e0048d798f Update: Translations from eints
hungarian: 5 changes by egri-nagy
2024-05-03 04:41:54 +00:00
Peter Nelson 90029beb49
Codechange: Ensure SDLK mappings stay in the expected order. (#12608)
Add a constexpr constructor that ensures at compile-time that the source SDLK range matches the target range.
2024-05-02 23:19:08 +01:00
Koen Bussemaker ef99aa81a3 Codechange: Store validity of water regions in separate vector 2024-05-02 15:03:48 +02:00
Peter Nelson cf96d49ced
Codechange: Use vector for airport tile layouts. (#12607)
Simplify AirportSpec data by storing layout information together in a vector, instead of separate arrays.

This removes manual memory management and separate count members.

The default layouts will be copied instead of always referring to the originals.
2024-05-02 11:37:54 +00:00
translators 65c9df49d9 Update: Translations from eints
chinese (simplified): 8 changes by XiaoJi-Game
catalan: 3 changes by J0anJosep
2024-05-02 04:41:51 +00:00
Fen 2559bdfa6f
Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable (#12596)
* Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable

* Cleanup: List sdl2 numpad mappings individually
2024-05-01 23:10:01 +02:00
Jonathan G Rennison 9647fe1d05 Change: [Linkgraph] Improve distance scaling algorithm in demand scaler
Improve scaling at values other than 0% and 100%
Fix erratic scaling and increase effect size at large setting values
2024-05-01 22:40:17 +02:00
Peter Nelson f146680121
Codechange: Use vector for industry random sounds. (#12606)
Use a vector to store the list of random sounds played for an industry.

The removes manual memory allocation, flags to control memory management, a separate count member, and a try/catch block.
2024-05-01 19:55:00 +00:00
Peter Nelson 7147fe9e7a
Codechange: Use range-for when loading NewGRF deterministic sprite groups. (#12605) 2024-05-01 18:59:46 +00:00
Peter Nelson 532ce1a907
Codechange: Use Recv/Send_bytes for md5sum. (#12602)
Use existing functions to handle serialisation of arrays instead of indexed for-loop.
2024-05-01 18:55:54 +01:00
Peter Nelson 1424a184d8
Codechange: Use vector/span when loading wagon overrides. (#12604)
Replaces manual memory allocation and passing pointer with size.
2024-05-01 18:23:27 +01:00
translators 96d82b4363 Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
greek: 52 changes by KyriakosMich
german: 3 changes by Wuzzy2
basque: 36 changes by Porrumentzio
danish: 3 changes by bscargo
2024-05-01 04:41:08 +00:00
translators 4df44fea38 Update: Translations from eints
swedish: 3 changes by joeax910
galician: 63 changes by pvillaverde
2024-04-30 04:40:35 +00:00
Peter Nelson cc6e4768a9
Fix: Out-of-order window set up due to deferred window resize. (#12592)
Deferred window resize was being applied to the initial window resize event, resulting in some window state (e.g. scroll bar capacity) not being initialised when expected.
2024-04-29 17:05:35 +01:00
translators b852a3f408 Update: Translations from eints
english (us): 3 changes by 2TallTyler
korean: 3 changes by telk5093
hungarian: 2 changes by meskobalazs
2024-04-29 04:40:19 +00:00
rubidium42 fd4cf699e5
Codefix 37a03b5: the return value of maxdim should always be assigned (#12590) 2024-04-28 17:42:58 +00:00
Rubidium 98d37338df Codechange: use ranged for loop instead of one with lengthof 2024-04-28 19:42:44 +02:00
Rubidium 24b6ec80a9 Codechange: use ranged for loop and vector to determine the disaster to deploy 2024-04-28 19:42:44 +02:00
Rubidium 87dbd4a833 Codechange: use ranged for loop to determine widest title 2024-04-28 19:42:44 +02:00
Rubidium d183d8e587 Codechange: remove INVALID_STRING_ID now drop down uses spans 2024-04-28 18:47:31 +02:00
Rubidium 37a03b513f Codechange: refactor string list dimension finding into a separate function 2024-04-28 18:47:31 +02:00
Rubidium 546a996d95 Codechange: pass options to ShowDropDownMenu using a span 2024-04-28 18:47:31 +02:00
Rubidium ad50c4f298 Codechange: inline sorter name definitions and use proper static accessor instead of (implying) this-> 2024-04-28 18:47:31 +02:00
Peter Nelson ef55cc7979
Codechange: Remove support for links in tar files. (#12571)
This was a feature to support the original 32bpp sprite system and is no longer relevant.
2024-04-28 15:18:24 +01:00
Loïc Guilloux 99b74c1064
Fix #12584: Improved error handling during tar scan (#12586) 2024-04-28 16:08:32 +02:00
Rubidium 826deaee57 Codechange: refactor CalcHeightdiff to remove some magic numbers 2024-04-28 16:05:21 +02:00
Rubidium 97a34bf06e Codechange: use C++ containers for the colour schemes 2024-04-28 16:04:54 +02:00
translators ee9895a970 Update: Translations from eints
norwegian (bokmal): 3 changes by eriksorngard
french: 3 changes by ottdfevr
portuguese: 3 changes by azulcosta
2024-04-28 04:41:11 +00:00
Peter Nelson 440a633fcc Codechange: Remove shrink_to_fit for more lists.
A comment about "will actually do nothing" is out of date as that is not the case with std::vector.

These lists are always short lived (either within a command handler or in a window) so don't shrink_to_fit.
2024-04-27 19:25:34 +01:00
Peter Nelson 33aedc43a5 Codechange: Shrink GUIList vectors less often, reserve before use.
After sorting and filter lists for GUI, we often shirnk them to reduce size. However this has very little benefit:

1) The memory has already been allocated, so it doesn't prevent that memory being required.
2) It causes a new allocation and copy when the vector is shrunk, actually using more memory.
3) The list is in window state, so the lifetime is only while the window is open.
4) When a filter is clearer, the original size will be needed again, which will cause another allocation.

In fact it is beneficial to reserve to the known maximum in most cases, so do that instead.
2024-04-27 19:25:34 +01:00
translators 8308998388 Update: Translations from eints
english (au): 3 changes by krysclarke
russian: 3 changes by Ln-Wolf
finnish: 6 changes by hpiirai
dutch: 6 changes by Afoklala
portuguese (brazilian): 4 changes by pasantoro
polish: 3 changes by pAter-exe
2024-04-27 04:40:44 +00:00
Peter Nelson bf8de188ec
Codechange: Use member initialization of GRFFilePropsBase. (#12581)
Don't blame compilers for our sloppy initialisation.

Removes memset, and lengthof.
2024-04-26 22:58:54 +01:00
Peter Nelson 72c55128d2
Codechange: Remove write-only spec_id from RoadStopSpec. (#12582)
Comment is incorrect about its value too.
2024-04-26 21:56:30 +01:00
Peter Nelson a6d401debf
Fix: Properly test for presence of waypoint in NewGRF resolver. (#12579)
Test whether the BaseStation itself a Station or Waypoint, instead of by the station class ID assigned to it.
2024-04-26 17:47:53 +01:00
translators a60a81f34e Update: Translations from eints
swedish: 7 changes by joeax910
vietnamese: 15 changes by anmatngu
greek: 31 changes by gh658804, 2 changes by KyriakosMich
hungarian: 2 changes by egri-nagy
portuguese (brazilian): 2 changes by pasantoro
2024-04-26 04:41:25 +00:00
Rubidium 0fdabca605 Codechange: use std::span instead of custom span in TGP 2024-04-26 06:15:29 +02:00
Peter Nelson f44d8fa2e4
Codechange: Remove CDECL from filter functions. (#12578)
These functions are not passed to qsort()...
2024-04-25 22:13:23 +01:00
Peter Nelson 0075a95278
Codefix: Make three _filter_funcs definitions distinct. (#12573)
Rename the GUIList function lists defined as the same symbol.
2024-04-25 21:01:15 +01:00
Peter Nelson 5bc9854be2
Codechange: Make sort list function lists safer. (#12574)
GUIList has a pointer only to the start of each sort/filter func list, which has the potential for UB as it is unable to validate that the selected sort or filter type is in range.

Use a std::span instead and check if the selected type is in range before using it.
2024-04-25 21:00:49 +01:00
Jonathan G Rennison 9b747a173d Fix #12509: Maintain timer sort invariants when changing period 2024-04-25 20:08:24 +02:00
Jonathan G Rennison 11ec156b64 Codechange: Add a priority field to TimerGameTick::TPeriod
Use this as the primary sort key for TimerGameTick::TPeriod,
to avoid container sort order changes on timer period saveload.
See: #12509
2024-04-25 20:08:24 +02:00
André Cheng 57f5d27427 Doc: Fix documentation of GetDefaultValueCallback 2024-04-25 20:07:54 +02:00
André Cheng ceb0053dd9 Codechange: Correct return type of GetDefaultValueCallback 2024-04-25 20:07:54 +02:00
André Cheng 339b0ea0ff Change: Show correct default value and unit for vehicle service interval setting 2024-04-25 20:07:54 +02:00
André Cheng fd80a1ec66 Fix #11345: Use correct default button value for vehicle service interval setting 2024-04-25 20:07:54 +02:00
André Cheng a4071b78d7 Codechange: Add callback to IntSettingDesc to support more default values 2024-04-25 20:07:54 +02:00
translators e8d25d68b9 Update: Translations from eints
russian: 2 changes by George-VB
2024-04-25 04:42:18 +00:00
Peter Nelson e8249e9075
Codechange: Pass buffers for TarFile's ExtractString as span. (#12567)
ExtractString does not need to find a string terminator as StrMakeValid already does this, so simply pass the full bounds of the buffer.

Removes lengthof, array indices, and needs only the buffer as a parameter.
2024-04-24 21:34:21 +01:00
Peter Nelson 5159aa81d4
Codechange: Use iterators when enabling industries. (#12569)
Removes lengthof and array indices.
2024-04-24 21:33:49 +01:00
Peter Nelson 26bb87ebf1
Codechange: Replace SaveLoad var length arrays with switch block and sizeof. (#12570)
SlCalcConvMemLen(), SlCalcConfFileLen() and CalcOldVarLen() follow a pattern of looking up part of a value in an array.

These function returns the size of bytes of a variable type, but is not very clear. Replace with a switch block instead.

Removes lengthof, array indices, and magic numbers.
2024-04-24 21:33:29 +01:00
Peter Nelson 1dc94d0670
Codechange: Construct string_view with first+last. (#12568)
Avoids needing to calculate size when we already have last.
2024-04-24 21:29:33 +01:00
Peter Nelson 6a3f50aa72
Codechange: Replace separate EffectVehicle arrays. (#12565)
Combine 3 separate arrays into a single struct. This keeps related data together, and avoids needing to check that each array is same length.

Use of constexpr construct ensures data in the array is not default-initialised.

Removes lengthof.
2024-04-24 21:29:12 +01:00
Peter Nelson e20f48799e
Codechange: Make StringToContentType() clearer. (#12566)
Decouples string to ContentType mapping from position within enum.

Slightly less efficient, but removes lengthof, array indices, and casting.
2024-04-24 21:26:31 +01:00
Peter Nelson 5e689ce25e
Codechange: Store cursor sprites in vector. (#12564)
Combine two separate fixed length arrays to allow simpler iteration.

No need to check that arrays are all the same length.
No need to separately store the number of sprites to draw.
Removes the upper limit of the number of sprites that can be drawn.

Removes lengthof and array indices.
2024-04-24 21:26:07 +01:00
translators 9121770582 Update: Translations from eints
korean: 3 changes by telk5093
catalan: 3 changes by J0anJosep
french: 7 changes by ottdfevr
polish: 7 changes by pAter-exe
2024-04-24 04:40:54 +00:00
Peter Nelson ac6a945e26
Revert 2408a68910: Remove work around for an MSVC bug from 17 years ago. (#12557) 2024-04-23 17:05:08 +01:00
Koen Bussemaker bef11941c6 Change: Allow rail and road depot overbuilding in current orientation in order to connect to rail or road 2024-04-23 13:11:31 +02:00
translators 95de90dd4e Update: Translations from eints
norwegian (bokmal): 7 changes by eriksorngard
danish: 7 changes by bscargo
portuguese (brazilian): 4 changes by pasantoro
2024-04-23 04:40:32 +00:00
Peter Nelson 3814adaba8
Codechange: Simplify GetScrolledItemFromWidget() (#12556)
Return `auto`, which allows working with const containers, and use std::next instead of std::advance.
2024-04-22 19:00:14 +00:00
translators c82a2575d7 Update: Translations from eints
english (au): 3 changes by krysclarke
english (us): 3 changes by 2TallTyler
greek: 3 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 5 changes by hpiirai
turkish: 7 changes by BeratSJ
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
2024-04-22 04:40:33 +00:00
Rubidium ded4d63db2 Codechange: simplify access to the current screenshot format 2024-04-21 21:07:05 +02:00
Peter Nelson d465257dd0
Fix 952d111: Houses and industry tiles could accept incorrect cargo. (#12547)
Default cargo label was not cleared (set to CT_INVALID) when using older 3-slot acceptance properties for house and industry tiles.

Missed in #12053 and #12062.
2024-04-21 19:46:05 +01:00
Peter Nelson 3b01d31280
Fix 8746be8: Reinstate current order test when removing road stop. (#12552)
#12144 replaced pool iteration with FindVehiclesWithOrder, however the test for current_order being OT_GOTO_STATION was erroneously removed.
2024-04-21 19:41:25 +01:00
translators c073165e34 Update: Translations from eints
greek: 5 changes by gh658804
finnish: 2 changes by hpiirai
catalan: 4 changes by J0anJosep
2024-04-21 04:42:00 +00:00
Rubidium aa895535e6 Fix 5008706: improved scenario editor tooltips in map generation stages are out of place 2024-04-20 21:56:27 +02:00
Peter Nelson 959ced71bb
Codechange: Add constants for original input/output cargo counts. (#12548)
This replaces some magic 3s and 2s.
2024-04-20 20:50:48 +01:00
Peter Nelson b4e00fa738
Codechange: Replace C-casts in pool functions. (#12541) 2024-04-20 16:50:13 +01:00
Loïc Guilloux c5ef47ee09
Codechange: [Script] Use std::unique_ptr for Company::ai_instance (#12544) 2024-04-20 16:58:46 +02:00
Rubidium 1dfd0c19f4 Fix: allow only 255 league tables, as 255 is the invalid id sentinel 2024-04-20 16:53:04 +02:00
Rubidium c377c4740d Codechange: replace cpp_lengthof with safe alternatives 2024-04-20 13:36:19 +02:00
Peter Nelson a1a01e21cf
Change: Use std::make_unique instead of passing new() (#12539) 2024-04-20 11:20:49 +01:00
Rubidium fc7f184dbd Codechange: move knowledge about 'packed' orders to the saveload code 2024-04-20 11:58:07 +02:00
Rubidium 1691b41b54 Codechange: use C++ containers for parsing the settings int lists 2024-04-20 11:57:45 +02:00
Rubidium 434c49a1f8 Codechange: remove now unused endof macro 2024-04-20 11:30:46 +02:00
Rubidium 8fe5fdf122 Codechange: use std::none_of to express clearer what the code does 2024-04-20 11:30:46 +02:00
Rubidium 8986fb0385 Codechange: replace C-style array-pointer methods with the appropriate C++ methods 2024-04-20 11:30:46 +02:00
Peter Nelson 2114888485
Change: De-template BaseSetTextfileWindow. (#12536)
The BaseSet type is not needed after the window is constructed, only the filename and name are required, which can be passed as parameters from `ShowBaseSetTextfileWindow()` instead.

This avoids compiling three instances of `BaseSetTextfileWindow`.
2024-04-20 10:30:29 +01:00
Rubidium e441033d68 Codechange: use std::array instead of C-style array for produced/accepts cargo 2024-04-20 11:29:55 +02:00
Peter Nelson 40fa45a76a Codechange: Emplace std::pair into vectors.
This creates the pair in the vector, instead of creating it then copying it in.
2024-04-20 10:25:20 +01:00
Peter Nelson ed2db80990 Codechange: Use map.emplace() instead of map.insert(std::pair).
This avoids a copy of the pair into the map.
2024-04-20 10:25:20 +01:00
Peter Nelson 57d7359b1a
Codechange: Remove old group liveries savegame conversion. (#12537)
Conversion to set default group livery is in the wrong place (not in `AfterLoadGame()`), however it is not necessary any more as `AfterLoadGame()` always calls the function `UpdateCompanyLiveries()` which will do the same thing.
2024-04-20 10:25:04 +01:00
Peter Nelson 699c7e4c9d
Fix 3de8853e29: Industries accept/produce no cargo for pre-SLV_78 saves. (#12508)
Industry accepted/produced was trimmed too early for original and pre-SLV_78 saves, as cargo type was not stored per slot so all slots look invalid to the trim function.
2024-04-20 10:24:35 +01:00
Peter Nelson 1c31e4b68c
Change: Disallow using Action A to load sprites above the baseset unless reserved. (#12435)
Using Action A above the baseset is error prone as the sprites are not fixed and can be moved around.

Any NewGRF doing so is likely to break in the future, so force it to break instead.
2024-04-20 10:23:36 +01:00
Peter Nelson e028c15555
Codechange: Use std::accumulate to get infrastructure total rail/road pieces. (#12442) 2024-04-20 10:22:19 +01:00
translators 08140fdca3 Update: Translations from eints
dutch: 4 changes by Afoklala
2024-04-20 04:41:21 +00:00
Peter Nelson 6cbb8d02cf Change: Use aspect ratio for shared order list button. 2024-04-19 22:11:16 +01:00
Peter Nelson 5df5e3f45c Change: Use aspect ratio for file home button. 2024-04-19 22:11:16 +01:00
Peter Nelson 2a833a8968 Change: Use aspect ratio for rail station platforms/tracks buttons. 2024-04-19 22:11:16 +01:00
Peter Nelson 7e049aa2b1 Change: Use aspect ratio for common left/right buttons. 2024-04-19 22:11:16 +01:00
Peter Nelson 16eb17418b Change: Use aspect ratios for some common widgets. 2024-04-19 22:11:16 +01:00
Peter Nelson 61c6ebaacc Change: Automatically set aspect ratio of common window decorations. 2024-04-19 22:11:16 +01:00
Peter Nelson d43ff8dc49 Change: Ability to set aspect ratio of a widget.
This allows setting the shape of a widget without dealing with absolute pixel sizes.
2024-04-19 22:11:16 +01:00
Peter Nelson f267b37a33
Codechange: Use std::initializer_list/array in framerate window. (#12441) 2024-04-19 22:07:56 +01:00
Peter Nelson a28ab8cac2
Codechange: Replace C-style casts to size_t with static_cast. (#12455)
* Codechange: Replace C-style casts to size_t with static_cast.

This touches only simple value-type casts.

* Codechange: Replace static_cast<size_t>(-1) with SIZE_MAX

Co-authored-by: Rubidium <rubidium@openttd.org>
2024-04-19 20:34:36 +01:00
Peter Nelson 6ee31a2a22
Codechange: Use string_view in IniItem/IniGroup/IniFile. (#12535)
This avoids making extra copies of strings.
2024-04-19 13:54:22 +01:00
Peter Nelson 3b80a8255f
Fix #12433: Width of unit number display was too narrow. (#12534)
Digit width was counted, but ignored the thousands separator.
2024-04-19 08:19:31 +01:00
translators 7848e80f71 Update: Translations from eints
english (us): 4 changes by 2TallTyler
korean: 11 changes by telk5093
2024-04-19 04:40:34 +00:00
dP 0d1fc47edb
Cleanup: Remove redundant break statement (#12527) 2024-04-18 20:54:20 -04:00
Peter Nelson 774f811217
Codechange: Use std::optional for town parent scope resolver. (#12530)
When resolving NewGRF, the parent town_scope is lazily initialised as it does not always need to be used.

Replace the manually managed pointer with std::optional to simplify. Using std::optional avoids extra memory allocation.
2024-04-18 22:14:16 +01:00
Peter Nelson 3b75d8bbf8 Fix: Use modern comparisons instead of memcmp in cache check.
This uses C++20 default operator<=> to provide comparisons of some objects.

This works properly with caches that containers.
2024-04-18 22:13:55 +01:00
Peter Nelson 21d11ee361 Codechange: Move cache check function to own file. 2024-04-18 22:13:55 +01:00
Peter Nelson db56499c01 Codechange: Use std::array for company infrastructure arrays. 2024-04-18 22:13:55 +01:00
Peter Nelson fe7bd3a266 Codechange: Use std::array for cached town zone radius. 2024-04-18 22:13:55 +01:00
Peter Nelson d57bf84196
Codechange: Remove some unnecessary c_str() when passing std::strings. (#12532)
Functions have been updated from `char *` to `std::string` since without removing `c_str()`.
2024-04-18 22:13:13 +01:00
Peter Nelson 45886e50b2
Codechange: Unify where rail station tile flags are set. (#12531)
This avoids repeating the logic in three places.
2024-04-18 18:54:10 +01:00
Peter Nelson 4170c9923a
Fix: Inconsistent space between console history and current line. (#12528) 2024-04-18 17:45:41 +01:00
Tyler Trahan 78b83190cc
Fix: Mark vehicle status bars dirty when a vehicle leaves unbunching depot (#12516) 2024-04-18 12:45:00 -04:00
Patric Stout 715f8c0218
Codefix: cast to "CommandCallback *" in a way cast-function-type-mismatch doesn't mind (#12529) 2024-04-18 16:41:36 +00:00
translators c355e98c58 Update: Translations from eints
english (au): 4 changes by krysclarke
russian: 4 changes by Ln-Wolf
finnish: 7 changes by hpiirai
portuguese: 4 changes by azulcosta
portuguese (brazilian): 5 changes by pasantoro
polish: 4 changes by pAter-exe
2024-04-18 04:40:27 +00:00
Peter Nelson 63ce81570c Remove: Custom opendir implementation for Windows no longer needed.
std::filesystem::directory_iterator is now used instead.
2024-04-18 01:41:14 +01:00
Peter Nelson 42523379d9 Codechange: Use directory_iterator in ScanPath.
Replaces use of custom ttd_opendir.
2024-04-18 01:41:14 +01:00
Peter Nelson d7c547d0db Codechange: Use directory_iterator to list directories in file list windows.
This replaces use of custom ttd_opendir. Files are listed separately using ScanPath as that handles downloaded content.
2024-04-18 01:41:14 +01:00
Peter Nelson 5a523cf212 Codechange: Simplify FioCreateDirectory.
`std::filesystem` provides `create_directories()` as a cross-platform way to create a directory tree.
2024-04-18 01:41:14 +01:00
Peter Nelson 6458980413
Change: Draw group hierarchy tree lines. (#12522) 2024-04-17 21:55:19 +01:00
Jonathan G Rennison 83d99ec11d
Fix #12506: Update station/industry nearby lists in BuildOilRig (#12511) 2024-04-17 22:38:11 +02:00
Patric Stout f7bd080015
Codechange: improve desync documentation (#12521) 2024-04-17 20:36:08 +00:00
Patric Stout 07b162ffc4
Codechange: skip all commands of the past during desync replay (#12520) 2024-04-17 20:05:45 +00:00
Patric Stout a0636d8200
Codechange: use infinite-fast-forward when rerunning command-log (#12519) 2024-04-17 20:01:58 +00:00
Patric Stout a09749f6a6
Codefix: don't send desync=0 log messages to commands.log (#12517)
They are only used during replay, and you want to see those in
the console; not in the log.
2024-04-17 19:51:36 +00:00
Patric Stout 1005c86c62
Codechange: record cache warnings with a "warning" prefix (#12518) 2024-04-17 19:49:55 +00:00
Tyler Trahan a02da5476e
Fix: Don't show train waiting for unbunching as waiting for free path (#12515) 2024-04-17 15:04:16 -04:00
Tyler Trahan 5878d09ef2
Fix: Smooth outliers in unbunching round trip calculations (#12513) 2024-04-17 15:03:53 -04:00
Tyler Trahan 824687d1f0
Codefix: Don't mix signed and unsigned ints in unbunching calculations (#12514) 2024-04-17 14:42:49 -04:00
Jonathan G Rennison 0b9029b69c Fix: Station/industry nearby list checks in CheckCaches 2024-04-17 20:33:49 +02:00
Peter Nelson ef8eb66a2b
Fix c38df2d58: Use VehicleID instead of pointer in map of vehicles to replace. (#12512)
This affects the sort order, VehicleID is deterministic, Vehicle * is not.
2024-04-17 18:54:50 +01:00
Paco Esteban b477a8458c Codechange: Use arc4random_buf on random_func.cpp for OpenBSD 2024-04-17 19:29:26 +02:00
translators 018326321c Update: Translations from eints
english (us): 5 changes by 2TallTyler
latvian: 1 change by lexuslatvia
2024-04-17 04:40:56 +00:00
Koen Bussemaker 257d312a58 Fix #12228, Fix #12231: CheckShipReverse only restricts path when it has to 2024-04-16 20:21:18 +02:00
Rubidium b2218e75d4 Codefix: missing space between close parenthesis and open curly brace 2024-04-16 19:28:09 +02:00
Peter Nelson 48eb9b8bc9
Add: Check that towns can build roads before generating map. (#12503) 2024-04-16 15:25:07 +00:00
translators 8e2ccddd77 Update: Translations from eints
portuguese (brazilian): 2 changes by pasantoro
2024-04-16 04:40:57 +00:00
Peter Nelson 3ad143c43a
Codechange: Use `x = y` instead of `x{y}` for value-type member initialisation. (#12501)
This is easier to read and less likely to look like an array definition.
2024-04-15 23:07:36 +01:00
ladysadie 727392e0b3
Codechange: Remove per font AA settings. (#12413)
OpenTTD will use the global AA font setting for all fonts from now on.
2024-04-15 21:44:33 +02:00
Peter Nelson a1b03ee69e
Codechange: Replace platform-specific calls with std::filesystem::last_write_time. (#12487) 2024-04-15 18:10:19 +00:00
dP f5a50a874f
Codechange: Update doxygen comment to reflect removed parameter (#12499) 2024-04-15 12:40:50 +02:00
translators cd108fd9e4 Update: Translations from eints
greek: 10 changes by gh658804
2024-04-15 04:44:34 +00:00
Peter Nelson 839f486074
Codechange: Use directory_iterator to find language files. (#12495)
This avoids using custom ttd_opendir, along with C-style string comparisons against file names.
2024-04-14 23:57:26 +01:00
Peter Nelson 4eaeccdaeb
Codechange: Introduce FioRemove() to remove files. (#12491)
New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location.
2024-04-14 23:43:50 +01:00
translators 29e932e087 Update: Translations from eints
ukrainian: 13 changes by imlystyi
lithuanian: 19 changes by dziugas1959
french: 7 changes by ottdfevr
portuguese (brazilian): 14 changes by pasantoro
2024-04-14 05:02:47 +00:00
translators 090c3b3abf Update: Translations from eints
danish: 5 changes by bscargo
dutch: 5 changes by Afoklala
portuguese (brazilian): 7 changes by pasantoro
2024-04-13 04:40:27 +00:00
Peter Nelson e83e2df023
Fix: Build industry window did not take width of count into account. (#12476) 2024-04-12 23:07:31 +01:00
Peter Nelson 12125bad82
Fix 3de8853e: Industry cargo types callback no longer functioned due to container change. (#12489)
Use defined INDUSTRY_NUM_INPUTS/INDUSTRY_NUM_OUTPUTS values instead of container size, which is now empty at this point.
2024-04-12 23:07:07 +01:00
Peter Nelson c1520cf682
Fix 25aeb1c: Driver parameter documentation was not updated. (#12486) 2024-04-12 17:01:40 +00:00
Peter Nelson ca73f03334
Codechange: Use std::filesystem::remove/rename in settingsgen. (#12483) 2024-04-12 14:32:35 +01:00
Peter Nelson 44b8210037
Codechange: settingsgen's CopyFile actually appends. (#12485) 2024-04-12 13:01:16 +01:00
Peter Nelson 003906becb
Codechange: std::filesystem::rename does not need remove first. (#12484) 2024-04-12 12:51:42 +01:00
translators bb9b8b90c7 Update: Translations from eints
swedish: 6 changes by sereneavatar
portuguese (brazilian): 11 changes by pasantoro
2024-04-12 04:41:30 +00:00
Peter Nelson 9915c1f032
Fix #12477: Use std::filesystem::rename instead of Windows Shell API call. (#12478) 2024-04-11 21:35:40 +01:00
Rubidium eda10abc8c Codechange: pass command line arguments as std::span to openttd_main 2024-04-11 21:57:53 +02:00
Peter Nelson 3316b27496
Fix: Signature validation did not close its file. (#12479) 2024-04-11 13:37:29 +00:00
Rubidium afd7878de0 Codechange: internally use a span of arguments for GetOptData 2024-04-11 12:00:36 +02:00
Rubidium 5592b4409b Codechange: use ranged for loop and separate function instead of goto 2024-04-11 12:00:36 +02:00
Rubidium e8a56db21d Codechange: use designated initializers for OptionData and pass as span 2024-04-11 12:00:36 +02:00
Rubidium 4f2412a272 Codechange: range based for loops instead of C-style for loops 2024-04-11 07:05:04 +02:00
Rubidium 2587a21400 Codechange: use zero-initialization instead of C-style loop 2024-04-11 07:05:04 +02:00
Rubidium ff27b9e76a Codechange: use std::any_of instead of custom loop 2024-04-11 07:05:04 +02:00
translators 6cade18053 Update: Translations from eints
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2024-04-11 04:41:57 +00:00
rubidium42 442daf58da Codechange: replace lengthof with std::size in Windows specific code 2024-04-10 23:17:13 +02:00
Peter Nelson 6bc4a62c27 Codechange: Pass std::string_view from blitters instead of char *. 2024-04-10 22:02:04 +01:00
Peter Nelson 332cbca36e Codechange: Pass std::string_view from drivers instead of char *. 2024-04-10 22:02:04 +01:00
Peter Nelson a42aa1a086
Codechange: Remove cargo_suffix C-array from GetIndustryString. (#12472)
The information is pushed onto a vector, so string ownership can be moved there instead of using a pointer into to the CargoSuffix array.
2024-04-10 21:32:21 +01:00
Peter Nelson 144bcbbaf1
Fix: Use clear() to clear std::string. (#12471) 2024-04-10 17:27:30 +00:00
Rubidium 21b640b5ff Codechange: simplify president name generation 2024-04-10 18:57:53 +02:00
translators f0f97c698b Update: Translations from eints
norwegian (bokmal): 11 changes by eriksorngard
russian: 5 changes by Ln-Wolf
spanish: 5 changes by MontyMontana
portuguese (brazilian): 7 changes by pasantoro
2024-04-10 04:40:30 +00:00
Peter Nelson 1773c5b810
Change: Increase object/station/roadstop class limit. (#12094)
The class limit is arbitrary and not stored in game state.

This change prevents all entities in classes after the 255th class from being dumped into the first class.
2024-04-09 23:16:20 +01:00
Rubidium df8eeb1b10 Codechange: use C++ algorithms to determine the SaveLoadFormat 2024-04-09 23:36:39 +02:00
Peter Nelson 77f27e0804 Change: Expose NewGRF classes and specs as spans and simplify iteration.
This replaces some index-based loops with range loops.
2024-04-09 21:46:59 +01:00
Peter Nelson 052f421327 Change: Use vector/iterators/algorithms instead of C-array/loops for NewGRF classes. 2024-04-09 21:46:59 +01:00
Peter Nelson 34758d0921 Change: Allow string mapping by function instead of pointer.
This allows mapping of strings to objects that may be moved between loading stages.
2024-04-09 21:46:59 +01:00
Peter Nelson 90ca3515da
Fix #12459, f6a88e4: Crashes when deleting news messages. (#12460)
The updated logic in f6a88e4 for deleting news messages did things in the wrong order.
2024-04-09 21:46:29 +01:00
Peter Nelson 2976a46d06
Fix 54be756: Terminating NUL byte was not skipped in ReadString(). (#12462) 2024-04-09 15:15:09 +01:00
Rubidium 883d3e7a9f Codechange: use std::span instead of pointer + length 2024-04-09 10:11:50 +02:00
Peter Nelson 54be756aae
Codechange: Pass NewGRF strings as std::string_view instead of char *. (#12461) 2024-04-09 08:40:27 +01:00
Peter Nelson dc7c2bb30d
Fix: Draw continuation lines for engine variant hierarchy tree. (#12434) 2024-04-09 08:35:12 +01:00
Peter Nelson de4e00c93f
Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
2024-04-09 08:34:45 +01:00
translators b5ad28022d Update: Translations from eints
english (au): 5 changes by krysclarke
chinese (simplified): 1 change by WenSimEHRP
catalan: 7 changes by J0anJosep
portuguese (brazilian): 27 changes by pasantoro
2024-04-09 04:40:33 +00:00
Peter Nelson 1b127628cb
Codechange: Use dynamic_cast with FindWindowById. (#12458)
Missed from 74e09ab.
2024-04-08 22:32:57 +01:00
Peter Nelson 7e28605830 Fix: Use reinterpret_cast instead of C-style cast to align pointers. 2024-04-08 18:21:42 +01:00
Peter Nelson 4daf95b878 Fix: Use static_cast instead of C-cast to avoid hidden errors. 2024-04-08 18:21:42 +01:00
Peter Nelson cdfffb551c Fix: sym->sym accidentally changed to sym prevented keys working with SDL. 2024-04-08 18:21:42 +01:00
Peter Nelson 74e09abf76
Codechange: Use dynamic_cast instead of C-cast after FindWindowById. (#12448)
dynamic_cast was used in most places, but not all.
2024-04-08 13:26:19 +01:00
Rubidium 4e6d4fcf32 Codechange: replace for loops with endof with range-based for loops 2024-04-08 07:00:55 +02:00
translators 095bdf32fe Update: Translations from eints
greek: 5 changes by gh658804
finnish: 7 changes by hpiirai
ukrainian: 56 changes by Quantom2, 14 changes by imlystyi
latvian: 14 changes by lexuslatvia
portuguese: 14 changes by azulcosta
portuguese (brazilian): 10 changes by pasantoro
polish: 5 changes by pAter-exe
2024-04-08 04:41:24 +00:00
Rubidium 62f5c595f3 Codechange: use range-based for loops and let count be correct count 2024-04-07 23:08:33 +02:00
rubidium42 4718971ccc Codechange: use std::size instead of lengthof for town names 2024-04-07 23:08:07 +02:00
Peter Nelson 995fca58a2
Codechange: Use begin/end instead of endof for some industry arrays. (#12447) 2024-04-07 22:01:46 +01:00
Rubidium d7fa614a9d Codechange: use range-based for loop for debug levels and fix global variable naming 2024-04-07 22:17:57 +02:00
Rubidium 1fcf1a136d Codechange: use single function returning std::span over two functions that return size and begin 2024-04-07 22:02:16 +02:00
translators 0f6bf90731 Update: Translations from eints 2024-04-07 04:41:19 +00:00
Peter Nelson eb094a953c
Codefix: Social Plugins widget parts were not constexpr. (#12443)
Widget lists were made constexpr except these.
2024-04-06 22:32:26 +00:00
Peter Nelson 34ba969c74
Change: Display more useful information in sprite aligner than sprite ID. (#12439)
Sprite IDs are not useful information given they change don't refer to anything outside the loaded game.

Instead, include the filename and nfo line at minimum, and include action A or action 5 sprite replacement information if applicable.
2024-04-06 21:16:02 +01:00
Peter Nelson fbdf26800b
Codechange: Use std::initializer_list and range-for for credits window. (#12431)
Replaces C-style array, indexed looping, and char * strings.
2024-04-06 19:30:23 +01:00
Peter Nelson a4c2f0778a
Codechange: Use range-for to iterate keycode-to-name lookups. (#12429)
Replaces C-style looping.
2024-04-06 19:30:01 +01:00
Peter Nelson b905209421
Fix: Viewport signs assume small font is smaller than normal font. (#12422)
If the small font is set to a larger size than the normal font for some reason, viewport signs would be drawn incorrect as the area marked dirty only considered the normal size font.
2024-04-06 19:29:41 +01:00
Peter Nelson 830c9e2de8 Codechange: Simplify iteration of framerate performance elements. 2024-04-06 19:28:51 +01:00
Rubidium 97bea563d7 Codechange: let lengthof fail when anything that isn't a C-style array is passed 2024-04-06 07:21:31 +02:00
Rubidium c544a2be0a Fix: do not use lengthof() for non C-style arrays 2024-04-06 07:21:31 +02:00
translators eaafc57de6 Update: Translations from eints
swedish: 6 changes by joeax910
norwegian (bokmal): 2 changes by eriksorngard
chinese (simplified): 2 changes by WenSimEHRP
dutch: 2 changes by Afoklala
2024-04-06 04:41:24 +00:00
Peter Nelson 8e881471c1 Codechange: Pass replacement blitter name as string_view instead char *. 2024-04-05 23:23:33 +01:00
Peter Nelson 6771dbe62b Codechange: Use range-for to find replacement blitter. 2024-04-05 23:23:33 +01:00
Peter Nelson a866166673
Codechange: Use initializer_list and range-for for OpenTTD title. (#12430)
Replaces C-style array and looping.
2024-04-05 21:52:50 +01:00
Peter Nelson 2cc700d606
Codechange: Replace colour_dropdown array with StringID arithmetic. (#12426)
This assumes that the string colours are in order, but that is already assumed elsewhere.

Removes old C-style array access.
2024-04-05 21:51:36 +01:00
Peter Nelson 83da886093
Fix: Aircraft crash counter was too low to reach ground. (#12425)
Aircraft can float above the ground when crashed as the counter limit to reach the ground is too low.

Instead reset the counter until the aircraft reaches the ground, then continue the timer.
2024-04-05 19:16:22 +01:00
Peter Nelson e8c78df39e
Fix #12233: Mini order list overlaps vehicle group name. (#12423)
Move mini order list down one line to make room.
2024-04-05 08:18:12 +01:00