Commit Graph

24806 Commits

Author SHA1 Message Date
Peter Nelson 06b830dc07 Codechange: Prefer string equality instead of comparison. (#14727) 2025-10-24 21:30:03 +02:00
SamuXarick e4b0e84a7c Doc 80666a0: Fix typo in game script changelog (#14714) 2025-10-24 21:19:47 +02:00
Peter Nelson d6eff806f0 Codechange: Use single vector for next station order.
Pass vector to insert into to avoid handling multiple vectors.

This may change the order of returned stations.
2025-10-23 21:02:27 +01:00
Peter Nelson fd32d1447e Codechange: Remove StationIDStack and SmallStack.
Use a std::vector or std::span instead.
2025-10-23 21:02:27 +01:00
Peter Nelson 5c89dff677 Codechange: Iterate road/tram masks instead of checking each type. (#14716) 2025-10-23 20:59:58 +01:00
SamuXarick 2396353c16 Codechange: Optimize FlowRiver (#13264) 2025-10-22 14:42:17 +02:00
Peter Nelson 75ca1e3cda Fix a46a3a97f3: Incorrect parameter order for CmdSetCompanyManagerFace.
Style and bits were mixed up. Switch everything to style first, as the most significant parameter.
2025-10-19 17:32:48 +01:00
Peter Nelson bf3a07c5d2 Codechange: Silence uninitialized variable warning from GCC. (#14715)
`is_custom_layout` is not used uninitialized but GCC does not know that and produces a warning.
2025-10-19 11:45:13 +01:00
translators c627c64cc5 Update: Translations from eints
swedish: 1 change by robert-i
norwegian (bokmal): 4 changes by eriksorngard
chinese (simplified): 4 changes by WenSimEHRP
catalan: 1 change by J0anJosep
danish: 4 changes by bscargo
latvian: 8 changes by lexuslatvia
dutch: 4 changes by Afoklala
french: 5 changes by ottdfevr
2025-10-16 04:38:47 +00:00
Peter Nelson a949197264 Fix ef71ce0a9d: Crash when user enters a blank line in the console. (#14711)
Crash caused by reading outside the bounds of string_view (though not the underlying buffer)
2025-10-15 22:16:00 +00:00
Peter Nelson 8e055156e3 Codefix: Make sure safeguards.h is the last included non-table header. (#14687) 2025-10-11 10:22:50 +01:00
Rito12 f935e34d90 Codefix: Remove double SetDirty() calls. 2025-10-11 12:15:00 +08:00
Peter Nelson a617d009cc Codechange: Dereference with x-> instead of (*x). (#14700) 2025-10-05 15:47:33 +01:00
Peter Nelson c9fbc41636 Codechange: Script list iterator tidying. (#14698)
* Use `iter->` instead of `(*iter).`
* Use prefix instead of postfix operators
* Use `auto` instead of explicit iterator type.
* Use `std::next()` instead of assignment then increment.
* Use range-for where possible.
2025-10-05 07:57:09 +01:00
Peter Nelson 6fdacb0759 Codechange: Use find/find_if to search for rail/road types by label.
Replaces manual loops.
2025-10-04 18:16:45 +01:00
Peter Nelson 4d40966303 Codechange: Use FlatSet to store and test alternate rail/road types. 2025-10-04 18:16:45 +01:00
Peter Nelson 97674ac2a2 Fix f6c5da4cad: dump_info should not reverse non-ASCII label. (#14697)
Cargo/rail/road types labels are already in appropriate endian-ness.
2025-10-03 22:28:28 +01:00
translators 632ab6a4e5 Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
english (us): 1 change by 2TallTyler
korean: 1 change by telk5093
polish: 1 change by pAter-exe
2025-10-01 04:38:32 +00:00
Peter Nelson 5d5d27841b Fix: Bootstrap ignored default OpenTTD truetype fonts. (#14684)
Bootstrapping assumed that glyphs must be missing if there is no baseset, ignoring whether there actually are glyphs missing.
2025-09-30 22:16:50 +01:00
translators 9eacb889f8 Update: Translations from eints
english (au): 1 change by krysclarke
greek: 1 change by gh658804
hungarian: 4 changes by vargaviktor
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by jcteotonio
portuguese (brazilian): 1 change by pasantoro
2025-09-30 04:38:08 +00:00
Peter Nelson 42084ca516 Change: Make groups window group list aware of interface scaling. 2025-09-29 22:11:02 +01:00
Peter Nelson 3087194d80 Codechange: Use Rects for group window drawing.
Simplifies handling of LTR/RTL coordinates.
2025-09-29 22:11:02 +01:00
Peter Nelson 8a8ebabb9d Change: Provide road and rail overlay sprites for bridge decks. (#14557)
This allows bridges designed primarily with NewGRF railtypes and roadtypes to be at least somewhat compatible with built-in rail and road.
2025-09-29 22:08:16 +01:00
Rubidium aa7eb089c6 Codechange: make all Providers fully const (Font/Screenshot/Sound) 2025-09-29 23:39:13 +03:00
Peter Nelson dcc3a67752 Fix 9cdf740097: Don't make copy of format providers when making a screenshot. (#14681)
While here, use projection instead of lambda to select provider.
2025-09-29 20:02:08 +00:00
Peter Nelson f8aa2e64e4 Add: Include build cost in rail/road dropdowns. (#14599) 2025-09-29 19:23:02 +01:00
translators 8eaf511f0c Update: Translations from eints
english (us): 3 changes by 2TallTyler
galician: 9 changes by pvillaverde
2025-09-29 04:39:03 +00:00
Su c8220494de Change: replace the "(City)" identifier in the town directory with the city icon (#14634) 2025-09-28 21:18:23 +02:00
Peter Nelson 29136350cf Codechange: Initialise rail/road types with range-for.
Replace double loop with single loop that performs both parts together.
2025-09-28 19:27:47 +01:00
Peter Nelson ca8fb69ffd Codechange: Use std algorithm when allocating rail/road type.
Use `std::ranges::find()` instead of a `for`-loop to allocate rail and road types.
2025-09-28 19:27:47 +01:00
Peter Nelson 126669e10d Codechange: Make GetRail/RoadTypeInfoIndex() a member method.
This follows a similar pattern used for cargoes, houses and objects.

Also fixes incorrect documentation of GetRoadTypeInfoIndex().
2025-09-28 19:27:47 +01:00
Peter Nelson 5ed8f1203b Codechange: Cleanup unnecessary includes of spritecache.h (#14678) 2025-09-28 17:09:57 +00:00
Peter Nelson ff674829f5 Codechange: Replace Rect CentreTo with CentreToHeight. (#14675)
So far all callers only need to centre vertically, so not having to provide the existing width simplifies calls.
2025-09-28 13:09:36 +00:00
Peter Nelson 81530e2574 Change: Support interface scaling in network client list buttons. 2025-09-28 11:00:07 +01:00
Peter Nelson cb1c2409e6 Codechange: Rework network client list buttons.
Instead of calculating and storing which buttons to display for each
line and then further calculating what each line should be when
displaying it, store everything on one pass.

This simplifies/deduplicates logic.
2025-09-28 11:00:07 +01:00
translators 37f737417c Update: Translations from eints
english (au): 3 changes by krysclarke
swedish: 3 changes by robert-i
korean: 3 changes by telk5093
greek: 3 changes by gh658804
russian: 3 changes by Ln-Wolf
finnish: 3 changes by hpiirai
catalan: 3 changes by J0anJosep
portuguese: 3 changes by jcteotonio
portuguese (brazilian): 3 changes by pasantoro
polish: 3 changes by pAter-exe
2025-09-28 04:37:53 +00:00
Peter Nelson 31eec7106b Codechange: Use Rect WithX/WithY in some places. 2025-09-28 00:31:23 +01:00
Peter Nelson 6d3f39609f Codechange: Add WithX/WithY methods to Rect.
This simplifies creating a new Rect with specific horizontal or vertical coordinates.
2025-09-28 00:31:23 +01:00
Peter Nelson 380f9e8b48 Change: Prefer normal/medium weight font in FontConfig fallback detection. (#14672)
This way it behaves similar to Windows.
2025-09-28 00:30:47 +01:00
Rubidium e58fdb8840 Codefix: shadowing of variables 2025-09-28 01:19:32 +03:00
Jonathan G Rennison f64e1cdae0 Fix: Industry accept/produce when not contiguous range from 0 (#14555) 2025-09-27 18:12:49 +01:00
Jonathan G Rennison 9307e1929e Fix #14604: Clearing tiles to build objects did not update town ratings (#14616) 2025-09-27 18:11:42 +01:00
Peter Nelson bfe5fb7339 Codechange: FlatSet's contains() should be const. (#14665)
This function does not modify contents, so should be marked const.
2025-09-27 18:10:39 +01:00
Peter Nelson 0aaeb6f7e7 Codechange: Rename TrackFollowers to follower. (#14664)
Replaces use of codestyle breaking `F` in places.
2025-09-27 18:10:22 +01:00
Peter Nelson 69ea970d6e Codefix 18e28077cc: Local variable icon shadowed member variable icon. (#14668)
Rename rects used in league table to avoid name shadowing. Now uses the same naming as in ScriptLeagueWindow.
2025-09-27 13:08:06 +01:00
Rubidium 5e7cb08411 Fix #14549: changing interface scale could underflow map zoom 2025-09-27 07:41:20 +03:00
translators 910eeef17f Update: Translations from eints 2025-09-27 04:38:00 +00:00
Peter Nelson 18e28077cc Fix: League Table layout broken with RTL languages. (#14667) 2025-09-27 01:50:33 +01:00
Peter Nelson 41837d093b Change: Record and show multiple errors for each NewGRF. (#14658) 2025-09-26 19:00:45 +01:00
Tyler Trahan 0b99a0b66a Feature: Draw infinite water when all borders are water (#13289) 2025-09-26 14:37:27 +00:00