1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00
Commit Graph

31074 Commits

Author SHA1 Message Date
46176a81e3 Add #12975: Cargo class bits 13 and 14 now define potable and non-potable. (#12979) 2024-12-01 13:48:18 +00:00
910dd65710 Change: Improve news window layouts.
* Use appropriate container widget nesting with padding, instead of single-sided padding.
* Use layer widget to allow main news message to overlay close box and date widgets, to more closely match the old fixed-pixel layout.
2024-12-01 09:44:11 +00:00
60f1618cc7 Add: Widget layer container widget type, NWID_LAYER.
This widget allows child widgets to be overlaid on top of each other.

Very similar to NWID_SELECTION except all layers are always visible.
2024-12-01 09:44:11 +00:00
translators
1885bd7166 Update: Translations from eints
portuguese: 5 changes by azulcosta
2024-12-01 04:47:46 +00:00
30bda88e97 Codefix: NWidgetStacked::AdjustPaddingForZoom duplicates inherited method. (#13135) 2024-11-30 23:15:17 +00:00
568bb1f5da Change: [UI] Improve visual padding of vehicle news items. (#13134) 2024-11-30 15:29:36 +00:00
61cbdef92d Codechange: Make AyStarStatus an enum class. (#13129)
This enforces type-safety.
2024-11-30 14:23:32 +00:00
translators
8d394c697c Update: Translations from eints
dutch: 2 changes by Afoklala
polish: 2 changes by pAter-exe
2024-11-30 04:46:18 +00:00
b6aece5b88 Fix 51bd344f10: Incorrect translation table used for older NewGRFs. (#13131)
Incorrect logic was used to select the default translation table for older GRFs.
2024-11-29 07:46:08 +00:00
fe0afef36f Codechange: Use unique_ptr instead of raw pointer for string layouts. (#13128) 2024-11-27 23:38:57 +00:00
SamuXarick
cf7710fb61 Codechange 8e9603b: Replace int32_t with AyStarStatus (#13127) 2024-11-27 23:26:07 +00:00
9bc64b553b Codechange: Cache callback spritegroups. (#13111)
Each callback result requires a pool memory allocation, each of which is 24 bytes.

Build a cache of results so that if the same result is used later it refers to the same group.
2024-11-27 23:25:35 +00:00
Jonathan G Rennison
f5a6a31e4a Codefix: Avoid divide by 0 in div/mod type varaction2 adjusts (#13123) 2024-11-27 23:24:46 +00:00
23e252ad40 Codechange: Replace FontMap's std::map with std::vector. (#13126) 2024-11-27 12:36:56 +00:00
8b8cd9ae2d Codechange: Use vector for town PSA storage. 2024-11-27 12:35:27 +00:00
177e2ebf80 Codechange: Support saveload of reference vectors.
This uses the same data format as reference lists, but for vectors, so allows data structures to be changed without affecting savegame format.
2024-11-27 12:35:27 +00:00
translators
e7c63de55d Update: Translations from eints
korean: 2 changes by telk5093
ukrainian: 7 changes by CodyMaster3
2024-11-27 04:49:29 +00:00
SamuXarick
8e9603bd33 Codechange: Rename and return AyStarStatus instead of int (#13125)
- Rename enum AystarStatus to AyStarStatus.
- Return AyStarStatus instead of int for AyStar::Main and AyStar::Loop functions.
2024-11-27 00:10:06 +01:00
translators
7c3b0e5c9c Update: Translations from eints
polish: 1 change by pAter-exe
2024-11-26 04:49:08 +00:00
a3437df7b7 Fix #13121: Crash when clicking on scrollbar if contents don't need scrolling. (#13122) 2024-11-25 08:20:20 +00:00
translators
5b02f51e17 Update: Translations from eints
galician: 7 changes by pvillaverde
vietnamese: 3 changes by KhoiCanDev
polish: 12 changes by pAter-exe
2024-11-25 04:48:28 +00:00
0446123194 Change: Show company finances column if it has any values in it. (#13112)
This solves finances not being show if the company inauguration date is in the future.

Current period is now always shown in the same position instead of moving for the first 2 years.
2024-11-24 11:59:30 +00:00
0c04966dc3 Fix #13022: Ensure minimum size of scrollbar slider. (#13119)
When there are many more items than fit in a list, the scrollbar slider scales to fit but there is no minimum size. It becomes too small to click on and use.

Ensure scrollbar slider is at least the same size as the buttons either end.
2024-11-24 11:50:04 +00:00
0b0b4f50c4 Fix: Crash when exiting game with highscore window open. (#13118) 2024-11-24 10:36:21 +00:00
fa1849b855 Codechange: Use std::range::find_if where possible. 2024-11-24 10:36:03 +00:00
059a4b22f7 Codechange: Use projection-based std::range::find where possible.
This simplifies matching by class members and avoids wordy lambdas.
2024-11-24 10:36:03 +00:00
876d53282e Codechange: Use std::ranges::count(_if). 2024-11-24 10:36:03 +00:00
3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
1f18894408 Change: Determine industry directory width only on visible rows. (#13097)
When rebuilding the industry directory list, the width of every item in the list is obtained to get the maximum width required for the horizontal scrollbar. This can take considerable time if there are a lot of industries.

Instead, calculate only for the visible rows, and grow as needed.
2024-11-24 06:51:58 +00:00
translators
9399a92a4f Update: Translations from eints
english (au): 2 changes by krysclarke
swedish: 4 changes by joeax910
chinese (traditional): 2 changes by KogentaSan
chinese (simplified): 3 changes by WenSimEHRP
greek: 4 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 4 changes by hpiirai
portuguese (brazilian): 3 changes by pasantoro
polish: 46 changes by pAter-exe
2024-11-24 04:46:32 +00:00
Loïc Guilloux
681b1928b4 Fix #13110: [Script] convert table keys to string when generating JSON (#13113) 2024-11-23 13:46:33 +01:00
b890dab2b4 Change: Treat recolour sprites as regular sprites in the SpriteCache. (#13107)
Recolour sprites are loaded when seen, instead of being loaded when needed. This could result in the sprite cache being filled up with recolour sprites, and also mean that replacing recolour sprites didn't release the previously allocated memory.

Instead, allow recolour sprites to be loaded as needed and freed when unneeded, like regular sprites.
2024-11-23 12:14:46 +00:00
00ae20fa02 Codechange: Tidy up GRFParameterInfo. (#13114)
Use member-initialisation, reorder members to reduce space, and prefer references.

SetValue/GetValue are moved to GRFConfig as they set the config's parameter values.
2024-11-23 12:13:52 +00:00
Jonathan G Rennison
b84a164590 Codechange: Avoid unnecessary re-reads/seeks in RandomAccessFile::ReadBlock 2024-11-23 21:48:22 +10:00
653e5e8b63 Codechange: Use std::visit for formatting script strings. 2024-11-23 10:55:41 +00:00
43da3e7693 Codechange: Use std::visit for ScriptDataVariant. 2024-11-23 10:55:41 +00:00
d875ac8947 Add: const operator->() for ScirptObjectRef. 2024-11-23 10:55:41 +00:00
translators
26ae50baf9 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
korean: 5 changes by telk5093
greek: 1 change by gh658804
dutch: 1 change by KevinHeijsteeg2
2024-11-23 04:47:22 +00:00
a4b4095232 Codechange: Shuffle Engine members around to reduce size. (#13115)
Reduces overall size of Engine from 752 to 720 bytes.
2024-11-22 23:58:13 +00:00
16038879e4 Codechange: Speed up industry generation using industry-type checks. (#13094)
Store a list of industries per industry type. This allows industry generation checks which only consider a specific industry type to check a reduced set of industries, leading to a potential performance increase.

This also removes the need to track industry type counts as well.
2024-11-22 23:17:24 +00:00
a951896364 Add: Add cargo transported to industry production graph. 2024-11-22 20:47:51 +00:00
22035a4f2a Add: Ability to show and filter different datasets on the same graph. 2024-11-22 20:47:51 +00:00
598fdf04a4 Codechange: Use vector instead of fixed array for graph data. 2024-11-22 20:47:51 +00:00
felixprigge
67a0fccfad Fix: [Timetable] Use days as precision in day mode for accurate timetable syncing (#12683)
Co-authored-by: flowprint <61750128+flowprint@users.noreply.github.com>
2024-11-21 22:27:07 +00:00
6d3adc6169 Codechange: Remove ZeroedMemoryAllocator from ScriptText. (#13108)
ScriptText is much simplified from its original design. Use member initialisation instead.
2024-11-20 22:16:14 +00:00
13da98dab8 Fix: Error message not set when unable load an old save. (#13106) 2024-11-20 18:24:07 +00:00
translators
1b6a6f1cd2 Update: Translations from eints
chinese (simplified): 4 changes by WenSimEHRP
danish: 19 changes by bscargo
2024-11-20 04:46:40 +00:00
b730f8783e Fix d450d4743: Division by zero when larger_towns is set to 0. (#13104)
Universe ended.
2024-11-20 00:09:02 +00:00
9b6b6d50c3 Fix: Network clients incorrectly truncated all strings to NETWORK_COMPANY_NAME_LENGTH. (#13102)
This should no longer be necessary since we used std::strings.
2024-11-19 23:44:54 +00:00
SamuXarick
85e9f5745a Codefix: Replace magic number in Kdtree (#13098) 2024-11-19 20:34:25 +00:00