Commit Graph

21964 Commits

Author SHA1 Message Date
Peter Nelson 466e6bb524
Fix #12037: Blurry OpenTTD font on Mac OS. (#12047) 2024-02-09 21:36:13 +01:00
Patric Stout 48e7dceb3c
Revert: Build signals to the next junction when dragging regardless of the Ctrl state (#12034)
This reverts commit b370ae1212.
2024-02-09 19:34:03 +01:00
Jonathan G Rennison bed3ef6f6b
Cleanup: Incorrect savegame number for SLV_DEPOT_UNBUNCHING constant (#12045) 2024-02-09 17:50:29 +00:00
Kuhnovic e38c3c59f3
Fix #11840: Ship pathfinder always returns a valid trackdir if one is available (#12031) 2024-02-09 12:31:38 -05:00
Loïc Guilloux b68d263d5f
Fix #12014: Remove water when area clearing ship depot (#12030) 2024-02-09 18:17:08 +01:00
Tyler Trahan 10bcf0172e
Fix #12022: Adjust economy date when changing timekeeping units in Scenario Editor (#12042) 2024-02-09 11:45:32 -05:00
Loïc Guilloux 165f92c00b
Fix #12041, 0c81579: Tarball extraction failing due to incorrect filename (#12044) 2024-02-09 17:25:56 +01:00
translators 9b323b4ef9 Update: Translations from eints
english (au): 7 changes by krysclarke
galician: 1 change by pvillaverde
chinese (simplified): 3 changes by WenSimEHRP
italian: 29 changes by Giredson
german: 53 changes by MagnumSociety
ukrainian: 37 changes by StepanIvasyn
dutch: 7 changes by rcpaul
spanish: 144 changes by MontyMontana
french: 4 changes by Lishouuu
portuguese: 48 changes by azulcosta
portuguese (brazilian): 156 changes by pasantoro
polish: 22 changes by azabost, 6 changes by pAter-exe
2024-02-08 18:34:34 +00:00
Tyler Trahan 16e6da020d
Cleanup: Remove unnecessary Trackdir casts (#12038) 2024-02-08 09:46:55 -05:00
Loïc Guilloux 82470f5c0d
Codechange 80ebcc7: OptionMenuEntries prefix is OME not ONE (#12036) 2024-02-08 00:22:01 +00:00
Patric Stout 11f5ac72a9
Fix #12029: don't show Sandbox Options in multiplayer (#12032) 2024-02-08 00:33:24 +01:00
Heikki Piirainen 42a88fc1d6
Fix: Finnish thousands separator (#12028)
In Finnish, the recommended digit group separator is a space rather than a dot.
2024-02-07 13:35:56 -05:00
translators d2a4f3123d Update: Translations from eints
galician: 25 changes by pvillaverde
czech: 182 changes by justidan4
hungarian: 31 changes by titanicbobo, 13 changes by Norodix
indonesian: 27 changes by tsaqibfs
german: 58 changes by UnsuspiciousGooball
russian: 18 changes by Ln-Wolf
finnish: 6 changes by hpiirai, 5 changes by lanurmi
ukrainian: 39 changes by StepanIvasyn
turkish: 3 changes by metsysma
danish: 55 changes by mamure, 6 changes by bscargo
dutch: 111 changes by Afoklala, 2 changes by robert5800
spanish: 196 changes by MontyMontana
portuguese: 4 changes by azulcosta
portuguese (brazilian): 148 changes by pasantoro
polish: 42 changes by pAter-exe, 16 changes by azabost
2024-02-07 18:34:54 +00:00
Peter Nelson 2c78146da5 Change: Limit cargo types in station cargo filter, with "More..." option to show all. 2024-02-07 17:13:37 +00:00
Peter Nelson e517e55620 Change: Include count of stations per cargo type in station cargo filter.
Cargo types with no stations are shaded to make the list clearer.
2024-02-07 17:13:37 +00:00
Peter Nelson 46da56b191 Change: Replace long list of cargo filter buttons with a multi-select dropdown list.
As before, hold ctrl while clicking on an item to toggle selections.
2024-02-07 17:13:37 +00:00
Peter Nelson 0ce30d05c8 Codechange: Add method to replace the content of a dropdown menu.
If necessary the dropdown list window will be resized and scrollbar enabled/disabled.
2024-02-07 17:13:37 +00:00
Peter Nelson ac44c001a4 Codechange: Expose `FindChildWindow()` as a method of `Window`. 2024-02-07 17:13:37 +00:00
Peter Nelson 4c44e1eae0 Codechange: Add parameter to persist dropdown menus.
If a dropdown menu is set to persist, it will not close when an item is selected. It will close as normal if the window loses focus.

Closing the list is the responsibility of the caller.
2024-02-07 17:13:37 +00:00
Peter Nelson b1c5e03df1
Fix: Don't issue autoreplace failed news message for command test mode. (#12026) 2024-02-07 12:07:00 +00:00
Peter Nelson 1f8533ebe0
Fix #12024: Autoreplace failed news message for trains must go to lead engine. (#12025) 2024-02-07 08:51:03 +00:00
Loïc Guilloux b0f3417025
Add: [Script] ScriptTileList_StationCoverage (#12015) 2024-02-06 20:22:18 +01:00
Loïc Guilloux 0858377e9e
Fix: [Script] Don't kill GS misusing GSText (#12009) 2024-02-06 19:58:30 +01:00
merni-ns 34b05465d5
Fix 5a88027: [Script] Avoid overflow in scripts when infinite money is enabled (#12016) 2024-02-06 19:54:38 +01:00
translators 02cdd5ba8b Update: Translations from eints
spanish (mexican): 7 changes by Skinazo
english (us): 4 changes by 2TallTyler
czech: 37 changes by justidan4
chinese (simplified): 1 change by WenSimEHRP
finnish: 50 changes by Finjet-cyber, 22 changes by hpiirai
spanish: 13 changes by MontyMontana
french: 4 changes by ottdfevr
portuguese (brazilian): 141 changes by pasantoro
polish: 68 changes by pAter-exe
2024-02-06 18:35:32 +00:00
Peter Nelson e9ea837311
Fix #12012: Crash when opening orders of another company. (#12013)
Orders window changes tooltip depending on vehicle type but did check if widget exists.
2024-02-06 12:53:23 +00:00
dP e2d36f626b
Fix: Focus hotkey in road/tram stop building window (#12008) 2024-02-05 18:14:21 -05:00
Peter Nelson ae30ad7802
Fix #12001: Use correct valid cargo check for old-style NewGRF town house 3rd cargo set up. (#12006) 2024-02-05 23:12:56 +00:00
Peter Nelson 5c630e10b7
Fix 2fd90960: Missing default vehicles and industry acceptance/production. (#12000)
* Fix 2fd90960: Missing default vehicles and industry acceptance/production.

Some default definitions are used across multiple climate types and relied on climate-independent cargo slot even though they specified a climate-dependent cargo type.

Add MixedCargoType that indirectly allows multiple labels to be specified for these.
2024-02-05 23:11:32 +00:00
Tyler Trahan b2b4cceb49
Fix #11997: Adjust economy date by 1920 when loading TTD/TTO savegames (#12007) 2024-02-05 18:09:29 -05:00
translators 05e23f8fc9 Update: Translations from eints
english (au): 4 changes by krysclarke
chinese (simplified): 21 changes by WenSimEHRP
korean: 4 changes by CoconutKR
finnish: 94 changes by hpiirai
catalan: 20 changes by J0anJosep
danish: 7 changes by bscargo
latvian: 4 changes by lexuslatvia
esperanto: 31 changes by JadedCtrl
portuguese (brazilian): 283 changes by pasantoro
polish: 75 changes by pAter-exe
2024-02-05 18:35:45 +00:00
Rubidium 3534214dfc Codechange: use reference instead of pointer for CommandPacket 2024-02-05 18:57:58 +01:00
Rubidium cb588d8d3f Codechange: use std::vector for the incoming command queue 2024-02-05 18:57:58 +01:00
Rubidium b3aa8a9c35 Codechange: use std::vector for the outgoing command "queues" 2024-02-05 18:57:58 +01:00
Peter Nelson 09a12f230f
Fix: Signals were incorrectly shifted by 1 pixel when selected. (#12005)
Most shifting when pressed was removed by 884b9e66.
2024-02-05 17:55:04 +00:00
Rubidium 63708609fb Codechange: define the size of the PacketType enumerations 2024-02-05 17:10:35 +01:00
Rubidium 6f77c2eaa2 Codechange: use size_t for the MTU limits and remove default parameter 2024-02-05 17:10:35 +01:00
Rubidium 72a44b0df6 Codechange: use references for handling received TCP packets 2024-02-05 16:30:49 +01:00
Rubidium 794f12dc24 Codechange: cascade through SendNeedGame/CompanyPassword functions, instead of duplicating logic for determining whether to call these functions 2024-02-05 16:30:49 +01:00
Rubidium 8add0bf8ec Codechange: use references for game info serialization 2024-02-05 16:30:49 +01:00
Rubidium 84623d2123 Codechange: use references for UDP packets 2024-02-05 16:30:49 +01:00
Rubidium 031a9d4e26 Codechange: use std::unique_ptr for the Packets created to send via TCP 2024-02-05 16:30:49 +01:00
Rubidium 36e1b32ccf Codechange: use std::deque of std::unique_ptr to queue packets 2024-02-05 16:30:49 +01:00
Rubidium c77a45ed86 Codechange: use std::unique_ptr for receiving network packets 2024-02-05 16:30:49 +01:00
Koen Bussemaker 35c89d57f8 Codechange: Added debug printing for Water Regions 2024-02-04 22:50:04 +01:00
Koen Bussemaker 4b94457bf1 Fix #11802: Made determining water region edge traversability more robust 2024-02-04 22:50:04 +01:00
translators 9cc17230e8 Update: Translations from eints
english (au): 11 changes by krysclarke
english (us): 11 changes by 2TallTyler
galician: 3 changes by pvillaverde
chinese (simplified): 17 changes by WenSimEHRP
korean: 14 changes by telk5093
german: 78 changes by SecretIdetity
russian: 11 changes by Ln-Wolf
catalan: 23 changes by J0anJosep
danish: 2 changes by bscargo
latvian: 229 changes by lexuslatvia
french: 29 changes by glx22
portuguese: 33 changes by azulcosta
portuguese (brazilian): 28 changes by pasantoro
2024-02-04 18:36:20 +00:00
Loïc Guilloux 64611a7d12
Fix #11975, 27a920c: Running AIs also occupy a slot (#11976) 2024-02-04 13:19:35 +01:00
dP ff618230fe
Codechange: Replace magic value with a variable (#11980) 2024-02-04 10:45:24 +00:00
Peter Nelson 2fd9096070
Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
2024-02-04 10:16:08 +00:00
Peter Nelson 83d63464db
Fix #11966: Scrollbar may be incorrect on first opening of text file window. (#11981)
The scrollbar is set up before the true monospace is loaded, so reinitialise the window after loading.
2024-02-04 10:15:20 +00:00
Loïc Guilloux 75015cdad2
Fix 6f6f099: Signals exist only on plain rail tiles (#11977) 2024-02-04 10:39:06 +01:00
Peter Nelson d9461e52af
Fix #11972: Incorrect minimum width allocated to graph. (#11974)
Width was based on actual number of data points instead of possible number of data points.
2024-02-04 08:51:19 +00:00
Jonathan G Rennison cb13ee90ef Fix: Second colour vehicle-type default liveries not being updated
When changing company default second colour
2024-02-04 07:14:39 +01:00
Tyler Trahan d5e936c9d4
Fix #11968: Always set string parameters to avoid undefined behavior (#11973) 2024-02-04 07:07:47 +01:00
Tyler Trahan d0c753465d Fix f6dd505: Remove unneeded error when switching between depot actions 2024-02-03 17:32:25 -05:00
Tyler Trahan 80a704ba11 Fix f6dd505: Split depot action tooltip by vehicle type 2024-02-03 17:32:25 -05:00
Rubidium 7a740eefa0 Codechange: use std::unique_ptr for managing SaveLoadParams 2024-02-03 21:38:33 +01:00
Rubidium 4b372b6050 Codechange: use std::shared_ptr to manage saveload filters instead of manually trying to avoid double frees 2024-02-03 21:38:33 +01:00
translators bc4ed9085d Update: Translations from eints
english (au): 3 changes by krysclarke
english (us): 3 changes by 2TallTyler
chinese (simplified): 3 changes by WenSimEHRP
korean: 4 changes by telk5093
russian: 19 changes by Ln-Wolf
latvian: 67 changes by lexuslatvia
portuguese: 3 changes by azulcosta
portuguese (brazilian): 3 changes by pasantoro
2024-02-03 18:34:44 +00:00
Patric Stout 0dfba564ab
Add: "restart current" console command to regenerate the map based on current settings (#11963) 2024-02-03 14:48:54 +00:00
Peter Nelson 17d02ed45f
Feature: NewGRF properties to set town production effect and multiplier. (#11947)
Town production effect is modelled on town acceptance (growth) effect, and so takes an original cargo slot for behaviour instead of a direct value.

NewGRF feature 0x0B, property 0x1E, takes 1 byte.

Valid values are:
- 0x00 to behave like passengers
- 0x02 to behave like mail
- 0xFF to behave like other cargo (i.e. not produced.)

If not set, town production effect is set based on the cargo label ('PASS' or 'MAIL').

Town production multiplier allows adjusting the amount of cargo produces when Town Production Effect is set, without needing to use callbacks.

NewGRF feature 0x0B (cargo), property 0x1F, accepts a 2 byte (word) value, similar to the cargo capacity multiplier property. The default value is 256 which means 100%, i.e. normal rate.
2024-02-03 13:58:31 +00:00
Tyler Trahan f6dd5053a3
Feature: Order flag to unbunch vehicles at depot (#11945) 2024-02-03 08:04:24 -05:00
Patric Stout a0c480c4e4
Change: "restart" now uses your newgame settings, where "reload" uses the current settings (#11962) 2024-02-03 10:19:47 +00:00
Charles Pigott 59f6c199bf
Fix #11528: Don't auto-build past tunnelbridge ends (#11606) 2024-02-03 11:18:10 +01:00
kiwitreekor 8d62a8f0f0
Add: Station variable 6B to get extended station id of nearby tiles (#10953) 2024-02-03 11:17:49 +01:00
Patric Stout 849fd5ae03
Change: [Script] replace easy/medium/hard values with default value (#11959) 2024-02-03 09:15:03 +00:00
Loïc Guilloux 27a920c4a8
Change: Allow to configure AI slots above max_no_competitors (#11961) 2024-02-03 09:42:16 +01:00
Patric Stout fe4494ec11
Change: only open story-book in center when a GS does it (#11916) 2024-02-03 08:09:55 +01:00
Patric Stout 59a046de9c
Fix: don't use non-owning string pointer in StringParameter (#11952)
The string pointer can become invalid before the reference is
dropped, causing out-of-bound access in windows like ErrorWindow,
or News that copy 10 or 20 parameters for their internals.

Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2024-02-02 23:01:54 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
frosch 8a4f0c4b02 Codechange: Simplify error throwing/catching in squirrel compiler. 2024-02-02 22:29:28 +01:00
Tyler Trahan f2db624e85
Change: Add dividers between signal groups (#11897) 2024-02-02 15:52:20 -05:00
Tyler Trahan 6f6f09910d
Fix #10118: Cycle through current signal group, not just path signals (#11798) 2024-02-02 15:51:57 -05:00
Peter Nelson 2e6c6b719f Change: Link houses production on industry chain graph by TPE_PASSENGERS or TPE_MAIL cargo. 2024-02-02 20:37:49 +00:00
Peter Nelson 03b2640ea1 Change: Passenger subsidies are generated for any TPE_PASSENGER cargo type. 2024-02-02 20:37:49 +00:00
Peter Nelson 6d93fa649c Change: Towns generate cargo based on town production effect.
This replaces the fixed handling of passengers and mail.
2024-02-02 20:37:49 +00:00
Peter Nelson 8d69d0549d Codechange: Add town production effect type and assign to cargo types. 2024-02-02 20:37:49 +00:00
Peter Nelson 60dcf3b5e2 Codechange: Rename TownEffect to TownAcceptanceEffect.
This makes it clearer that TownEffect only affects acceptance behaviour.
2024-02-02 20:37:49 +00:00
translators 782cbe95d6 Update: Translations from eints
chinese (simplified): 49 changes by WenSimEHRP
russian: 47 changes by Ln-Wolf
catalan: 71 changes by J0anJosep
dutch: 114 changes by Afoklala
portuguese: 46 changes by azulcosta
portuguese (brazilian): 29 changes by pasantoro
2024-02-02 18:35:20 +00:00
Loïc Guilloux 4e26e33805
Change: Improve ScriptSettings windows (#11958) 2024-02-02 18:08:05 +00:00
Loïc Guilloux 0e738dda88
Fix #11948: [Win32] Convert error messages to utf8 (#11951) 2024-02-02 16:30:23 +01:00
Loïc Guilloux 3545decf2d
Cleanup e28edf6945: [Script] Left over CONFIG_RANDOM reference in documentation (#11954) 2024-02-02 14:28:02 +00:00
Loïc Guilloux a2f31c4e61
Change: Improve AIConfig window (#11949) 2024-02-02 14:34:49 +01:00
Jonathan G Rennison c0b8e58404 Codechange: Simplify SetBitIterator
Use FindFirstBit and KillFirstBit, allowing simpler iterator equality
Add simple test
2024-02-01 23:05:57 +01:00
Patric Stout dce7d5d9b0
Fix #8253: allow rendering graphs with values over 2**31 / 10 (#11915) 2024-02-01 22:53:30 +01:00
Patric Stout 770ca3a624
Fix #8253: don't use INVALID_DATAPOINT for a valid value (#11913) 2024-02-01 22:47:11 +01:00
dP 9a2f247de9 Fix: Display rank correcly with more than 15 companies in a league table 2024-02-01 20:17:31 +01:00
translators e1fbaf6f7f Update: Translations from eints
english (au): 5 changes by krysclarke
english (us): 5 changes by 2TallTyler
chinese (simplified): 8 changes by WenSimEHRP
korean: 5 changes by telk5093
russian: 14 changes by Ln-Wolf
latvian: 4 changes by lexuslatvia
portuguese: 11 changes by azulcosta
portuguese (brazilian): 5 changes by pasantoro
2024-02-01 18:36:06 +00:00
Loïc Guilloux ab1407fc43
Fix: [Script] Apply random deviation only at script start (#11944) 2024-02-01 10:48:40 +01:00
Patric Stout e28edf6945
Remove: [Script] CONFIG_RANDOM from AddSetting flags (#11942)
It had a very weird interaction, and was only ever used by a single
AI.
2024-01-31 22:24:36 +00:00
merni-ns ccaa383e85
Fix #11938: Check infinite money setting in cases where it was missed (#11939) 2024-01-31 20:11:48 +01:00
Patric Stout 363e251a10
Change: make -dnet=9 give traces of the details of the network protocol (#11931) 2024-01-31 19:36:41 +01:00
translators bbae16574a Update: Translations from eints
english (au): 10 changes by krysclarke
english (us): 10 changes by 2TallTyler
vietnamese: 10 changes by KhoiCanDev
chinese (simplified): 62 changes by WenSimEHRP, 4 changes by XiaoJi-Game
korean: 11 changes by telk5093
russian: 5 changes by Ln-Wolf
finnish: 32 changes by hpiirai
portuguese (brazilian): 12 changes by pasantoro
2024-01-31 18:34:42 +00:00
Patric Stout 3e6ed6f44a
Fix #9697: don't extend the Online Players window too wide on opening (#11936) 2024-01-31 19:03:07 +01:00
frosch 4d2fc28834 Codechange: wrap 'if' in macros into 'do { ... } while (false)', so it does not break on following 'else'. 2024-01-30 23:43:42 +01:00
frosch e0bd1dd42e Codechange: replace a macro with a lambda. 2024-01-30 23:43:42 +01:00
Patric Stout 46b1114c67
Change: forcefully enable prefixing logs with date (#11930)
Additionally, add the log-level to the log message.
2024-01-30 22:02:16 +00:00
Tyler Trahan 41f2eed425
Feature: Settings to scale cargo production of towns and industries (#10606) 2024-01-30 15:11:46 -05:00
merni-ns 96651b5ada
Cleanup: Use standard comment format (#11929) 2024-01-30 18:43:42 +00:00
translators 3e5ba614ab Update: Translations from eints
chinese (simplified): 7 changes by WenSimEHRP
russian: 24 changes by Ln-Wolf
finnish: 61 changes by hpiirai
spanish: 1 change by MontyMontana
french: 134 changes by glx22
portuguese: 22 changes by azulcosta
portuguese (brazilian): 57 changes by pasantoro
2024-01-30 18:36:34 +00:00
glx22 a502453033 Fix 48b6b18: Increase MAX_VALUATE_OPS to match the previous limit 2024-01-30 19:15:54 +01:00
dP 897b59c158
Add: [GS] Allow to set max loan for each company separately (#11224) 2024-01-30 19:15:19 +01:00
dP b370ae1212
Change: Build signals to the next junction when dragging regardless of the Ctrl state (#9637) 2024-01-30 19:14:26 +01:00
merni-ns 5a88027a19
Feature: Infinite money mode (#11902) 2024-01-30 18:01:02 +00:00
Patric Stout 7acf78964f
Remove: "generation_seed" from config, as it was a write-only value (#11927) 2024-01-30 17:02:35 +00:00
Patric Stout a05b7acec8
Change: position error window closer to cursor on large screens (#11923) 2024-01-30 14:57:49 +01:00
Tyler Trahan 2b1f78d2ca
Fix: Use alternate timekeeping units in savegame title (#11912) 2024-01-29 22:11:00 +00:00
Peter Nelson 435d48e182
Fix: Sandbox window does not reduce height when interface scale is reduced. (#11924)
line_height was only ever made larger, and icon.height ignored.
2024-01-29 22:01:22 +00:00
Patric Stout 4024bb5554
Fix #11910: use economy timer for dmp_cmds files (#11925) 2024-01-29 21:58:22 +00:00
Patric Stout f1842f9144
Add: {CURRENCY_SHORT} only did k / m suffix. Add bn / tn and make translatable. (#11921)
64bit numbers are REALLY large, but our compact method was build
for 32bit numbers. Extend it to 64bit.
2024-01-29 20:20:35 +00:00
translators 1d4b10a8b8 Update: Translations from eints
english (au): 86 changes by krysclarke
english (us): 105 changes by 2TallTyler
chinese (simplified): 29 changes by WenSimEHRP
korean: 156 changes by telk5093
russian: 4 changes by Ln-Wolf
danish: 1 change by bscargo
spanish: 132 changes by lrlopez
portuguese: 52 changes by azulcosta
portuguese (brazilian): 181 changes by pasantoro
2024-01-29 18:34:38 +00:00
dP acaceb45ba
Codechange: Make command constant names consistent with command proc (#11920) 2024-01-29 13:41:36 +01:00
Peter Nelson bf013097a7
Fix #11918: Houses should build only next to road stops, not any station type. (#11919) 2024-01-29 01:27:34 +00:00
translators 809b599c21 Update: Translations from eints
english (au): 48 changes by krysclarke
english (us): 32 changes by 2TallTyler
vietnamese: 10 changes by KhoiCanDev
chinese (simplified): 46 changes by WenSimEHRP, 2 changes by XiaoJi-Game
korean: 58 changes by telk5093
russian: 57 changes by Ln-Wolf
finnish: 22 changes by hpiirai
catalan: 30 changes by J0anJosep
danish: 12 changes by bscargo
dutch: 45 changes by Afoklala
spanish: 214 changes by lrlopez
french: 8 changes by glx22
portuguese: 23 changes by azulcosta
portuguese (brazilian): 30 changes by pasantoro
polish: 4 changes by pAter-exe
2024-01-28 15:00:40 +00:00
Koen Bussemaker 5a55c4a934 Feature: [NewGRF] Allow higher max speeds for ships 2024-01-28 14:54:51 +01:00
Loïc Guilloux 461d69a8f6
Fix #11907: Allow genders for time related {UNITS_XXX} (#11908) 2024-01-28 14:45:08 +01:00
frosch 17dfc1a49a Codechange: Replace SF_GUI_NEGATIVE_IS_SPECIAL with a settings value callback. 2024-01-28 14:44:24 +01:00
frosch 28c83089f6 Codechange: Remove TKM string code. 2024-01-28 14:44:24 +01:00
frosch 9344b50435 Codechange: Remove TKM from settings texts. 2024-01-28 14:44:24 +01:00
frosch 9e9a8ca7f6 Codechange: Add callbacks to IntSettingDesc to support dynamic strings for title, help and values. 2024-01-28 14:44:24 +01:00
frosch 022b9e92d2 Codechange: Move settings string formatting into IntSettingDesc members. 2024-01-28 14:44:24 +01:00
frosch a9d1078434 Codechange: Remove TKM from town action tooltips. 2024-01-28 14:44:24 +01:00
frosch abfeeea849 Codechange: Compose engine preview text from multiple strings. 2024-01-28 14:44:24 +01:00
frosch 68c64d2511 Codechange: Remove TKM string codes by duplicating strings. 2024-01-28 14:44:24 +01:00
frosch bd3d687bf9 Codechange: Merge all BaseGraphWindow widget enums into one.
Previously it relied on some enum entries using the same integer value.
2024-01-28 14:44:24 +01:00
frosch 69f47caf3f Codechange: Remove TKM from vehicle list sorting dropdowns. 2024-01-28 14:44:24 +01:00
frosch 9741510396 Fix: Wallclock setting should not affect percent-based service interval increments. 2024-01-28 14:44:24 +01:00
Tyler Trahan 86981c0983
Fix: Extra refit button when train/RV is in a depot (#11904) 2024-01-28 08:01:09 -05:00
Patric Stout 05b253b33b
Fix ea8c1d85: improve smoothness of smooth-scrolling for 60+Hz screens (#11884) 2024-01-28 09:56:21 +00:00
SamuXarick 0c4e509b60
Fix #10439: [GS] Validate story page button colour, flags, cursor and vehicle type (#11892)
Adds GSStoryPage::IsValidStoryPageButtonColour, GSStoryPage::IsValidStoryPageButtonFlags and GSStoryPage::IsValidStoryPageButtonCursor to the API.

Add missing enforced preconditions to validate parameters passed to MakePushButtonReference, MakeTileButtonReference and MakeVehicleButtonReference.
2024-01-28 00:29:10 +01:00
SamuXarick 76f0f9e386
Fix #10438: [GS] Validate story page element type for ScriptStoryPage::NewElement (#11888)
Fixes a crash that happens if an invalid StoryPageElementType is passed to ScriptStoryPage::NewElement.

Adds an enforced precondition that tests the validity of StoryPageElementType.

Adds GSStoryPage::IsValidStoryPageElementType to the API.
2024-01-27 22:11:02 +01:00
Peter Nelson 6d276698b6
Fix: Memory leak in ICUParagraphLayout::NextLine() (#11895)
This function calls icu::BreakIterator::createLineInstance() but does not clean up after it.

Instead use a static instance that is cloned (for thread-safety) and deleted as necessary.
2024-01-27 20:13:42 +00:00
Jonathan G Rennison 1df7b21ee3
Fix #11889: ConstructWindow not called from SurveyResultTextfileWindow constructor (#11903) 2024-01-27 19:44:10 +00:00
Peter Nelson d3c673e20b
Fix #11894: Defer window OnResize event to avoid processing multiple times per input tick. (#11900) 2024-01-27 18:44:27 +00:00
Patric Stout 8c5ad1ade7
Fix fd9e72a7: actually use the parameter value instead of the current date (#11898) 2024-01-27 17:34:04 +00:00
Peter Nelson fef0bfcfd3
Fix: TextfileWindow called virtual methods before constructor completed. (#11889)
SetStringParameters() was called during widget tree init in the constructor.

Calls within a constructor cannot call the derived classes methods. This would result in invalid data being passed to the string system, which could then crash.
2024-01-27 14:45:37 +00:00
Kuhnovic 8a4a99b7e8
Fix #5713: FindClosestShipDepot only considers depots that are actually reachable (#11768) 2024-01-27 15:06:14 +01:00
Patric Stout 89520f5665
Add: show in multiplayer the amount of hours a game has been unpaused (#11886) 2024-01-27 12:35:09 +01:00
Patric Stout 2bbc95cac3
Fix: update server as offline when unexpected disconnect during refresh (#11891) 2024-01-27 11:23:25 +01:00
Richard Wheeler 8770ef6bd9
Change: Make street lights transparent with houses (#11828) 2024-01-27 09:25:13 +00:00
Rubidium 7916e97c62 Update: opengl; glext header to 20231129, wglext header to 20231018 2024-01-27 09:57:25 +01:00
Rubidium a23cd4aef7 Update: nlohmann/json to 3.11.3 2024-01-27 09:57:25 +01:00
Rubidium 79b684b8ac Update: fmt to 10.2.0 2024-01-27 09:57:25 +01:00
Patric Stout 80ebcc72fb
Change: rebrand Cheats as Sandbox Options (#11874) 2024-01-26 19:56:01 +01:00
Tyler Trahan 28716548d2
Feature: Setting to automatically restart server based on hours played (#11142) 2024-01-26 10:25:25 -05:00
Loïc Guilloux 09b66751cf
Fix b38d3c2208: missing water regions invalidation when building locks (#11879) 2024-01-25 22:18:26 +00:00
Patric Stout 36579dd18b
Change: set smooth-scrolling on by default (#11860) 2024-01-25 11:07:36 +01:00
Patric Stout ea8c1d8597 Change: make for smooth-scrolling based on actual time
This means if rendering takes a bit longer, scrolling goes a bit
quicker, making travel time always about the same time for the
same distance.
2024-01-25 10:29:48 +01:00
Jonathan G Rennison cbb24b5d71
Codechange: Split bit numbers from values in RailTypeFlags, RoadTypeFlags enums (#11877) 2024-01-24 22:24:34 +01:00
Tyler Trahan 21581b6ab3
Feature: Setting for minutes per calendar year (#11428) 2024-01-23 18:33:54 -05:00
translators be8ed26db6 Update: Translations from eints
norwegian (nynorsk): 5 changes by translators
slovenian: 5 changes by translators
faroese: 5 changes by translators
hebrew: 5 changes by translators
afrikaans: 5 changes by translators
urdu: 5 changes by translators
persian: 5 changes by translators
bulgarian: 5 changes by translators
belarusian: 5 changes by translators
basque: 5 changes by translators
russian: 23 changes by Ln-Wolf
finnish: 1 change by hpiirai
malay: 5 changes by translators
scottish gaelic: 5 changes by translators
croatian: 5 changes by translators
latin: 5 changes by translators
french: 49 changes by glx22, 8 changes by ottdfevr
portuguese (brazilian): 80 changes by pasantoro
icelandic: 5 changes by translators
2024-01-23 18:40:53 +00:00
Tyler Trahan fd9e72a7e7
Feature: Use real-time "wallclock" timekeeping units (#11341) 2024-01-23 11:36:09 -05:00
Tyler Trahan bbdbf9a589
Add: AI/GS Time Mode to choose between economy (default) and calendar time (#11603) 2024-01-23 10:42:10 -05:00
Patric Stout a1487ce620
Add: list_[scenario|heightmap] and load_[scenario|height] console commands (#11867) 2024-01-23 14:01:25 +01:00
Tyler Trahan 76499b96fb
Fix fa479c4: Typo in vehicle list tooltip (#11871) 2024-01-22 23:17:26 +00:00
Patric Stout 090616b4c9
Add: allow loading heightmaps from command-line (#11870)
If you want to load a file from tar, you have to give the file
inside the tar in order for it to work:

<tar-file>/<dir-in-tar>/<file>.png
2024-01-22 22:35:25 +00:00
Kuhnovic bf3fd6526b
Fix: use correct size parameter type in TileArea constructors (#11869) 2024-01-22 22:06:42 +00:00
Patric Stout 11d4f1b2bd
Fix d3b2a576: LOAD_HEIGHTMAP / LOAD_SCENARIO are Scenario Editor modes (#11868) 2024-01-22 21:28:00 +00:00
Patric Stout d3b2a576de
Feature: Plugin framework for Social Integration with Steam, Discord, GOG, etc (#11628) 2024-01-22 19:22:45 +00:00
Patric Stout 75f21065c9
Codechange: refactor DecodeHexText to a generic purpose ConvertHexToBytes (#11866)
DecodeHexText() does more than just decoding hex. ConvertHexToBytes()
now only does pure hex decoding. This required a bit of refactoring
for the code using DecodeHexText().
2024-01-22 19:42:47 +01:00
translators 786cc85e86 Update: Translations from eints
english (au): 155 changes by krysclarke
norwegian (bokmal): 9 changes by v0nNemizez
english (us): 155 changes by 2TallTyler
chinese (simplified): 9 changes by WenSimEHRP
russian: 41 changes by Ln-Wolf
finnish: 1 change by hpiirai
2024-01-22 18:40:42 +00:00
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
EmperorJake 419f48dfb3
Change: set amount of smoke/sparks to "realistic" by default (#11624) 2024-01-21 21:23:35 +00:00
Kuhnovic b38d3c2208
Change: simplified water region evaluation, removed savegame data (#11750) 2024-01-21 20:56:50 +00:00
Patric Stout 1985e7415b
Fix: smooth-scrolling large distances didn't got smoothly in one direction (#11861) 2024-01-21 20:52:44 +00:00
Peter Nelson c7d5cedc7b
Codechange: Replace C-style TICC/TOCC macros with C++ RAII implementation. (#11857)
Usage is more robust, and will always include timing when the TicToc object goes out of scope.
2024-01-21 18:38:40 +00:00
Peter Nelson 691c628b07
Codechange: Use named initialization for unscaled WidgetDimensions. (#11859)
Remove now-unused WD_* enums.
2024-01-21 18:10:49 +00:00
Patric Stout 0c81579363
Fix #6377: two tarballs with the same folder in them were considered as one (#11855) 2024-01-21 19:06:58 +01:00
SamuXarick 6588680ccc Revert #6923: start_date parameter is no longer in use
There was an issue with the start_date parameter for AIs. It did not let Random AIs to have their configure button clickable once the game has started, and this was due to the start_date not being pushed into the config.

But now that start_date is no longer in use since #10653, this workaround can be safely removed.
2024-01-21 18:49:08 +01:00
Patric Stout f35e257adc
Fix #9722: create vital windows as soon as local_company is set (#11858)
Many places use local_company to detect whether world generation is
done, and blindly assume all vital windows exists when local_company
is set.
2024-01-21 17:36:33 +00:00
Peter Nelson a9a0bfffc1
Change: Disable building rail infrastructure if train build limit is zero. (#11847)
This matches the behaviour of road, ship and aircraft infrastructure.
2024-01-21 16:51:23 +00:00
Peter Nelson 89474701bc
Codechange: Use templates to deduplicate goal widgets. (#11852) 2024-01-21 16:23:17 +00:00
Patric Stout fa8294ebe7
Remove: rdtsc and TIC/TOC based on CPU ticks (#11856)
Use TIC/TOC based on std::chrono instead. This information is also
easier to compare with others, as although it depends on CPU, it
means a bit more if "yours takes 4ms and mine takes 10ms".
2024-01-21 15:38:15 +00:00
Patric Stout fe035c306e
Codechange: prevent out-of-bound read (even if the result is never used) (#11853) 2024-01-21 14:25:00 +00:00
Peter Nelson 8797cc7ef2
Codechange: Replace GroupStatistics' num_engines with std::map. (#11849)
This removes manual memory management with calloc/free calls, and prevents potentially large arrays being allocated for each group.
2024-01-21 14:09:44 +00:00
Peter Nelson c0ab436077
Codechange: Store Colours in Colours type. (#11625)
This reduces casts, some magic numbers, and introduces a bit of type-safety.
2024-01-21 13:23:04 +00:00
Peter Nelson 0841978304
Codechange: Use vector and iterators to store old/new vehicles during autoreplace. (#11851)
This avoids malloc/free of 3 arrays along index counting, and the data for each part is kept together.
2024-01-21 09:21:22 +00:00
Rubidium 2d77f09a81 Codechange: use std::shared_ptr for vector of TCPConnecters 2024-01-20 23:03:44 +01:00
Patric Stout 71b8801b61
Fix bd85f61a: [Linux] don't include sys/random.h on older glibc systems (#11844) 2024-01-20 20:43:06 +00:00
Tyler Trahan fa479c4a7c
Cleanup: Describe modifier keys more consistently in tooltips (#11716) 2024-01-20 19:26:39 +00:00
Tyler Trahan 500870627d
Change: Rewrite a few main toolbar tooltips (#11717) 2024-01-20 13:49:34 -05:00
translators 4d79d86812 Update: Translations from eints
catalan: 18 changes by J0anJosep
2024-01-20 18:38:38 +00:00
Peter Nelson d6ccfdbbd9
Fix #11827: Make Layouter::GetCharPosition() aware of ligatures. (#11831)
When ligatures happen the precise individual character position is not known, so instead return the previous position (which is that of the ligature.)
2024-01-20 17:16:42 +00:00
Rubidium 086cbd0d72 Codechange: add constexpr to math functions where applicable 2024-01-20 17:30:36 +01:00
Rubidium dfe70181f1 Codechange: add constexpr to bitmath functions where applicable 2024-01-20 17:30:36 +01:00
Rubidium 4c51534b6a Remove: LeastCommonMultiple / GreatestCommonDivisor
Use std::lcm / std::gcd instead.
2024-01-20 16:45:21 +01:00
Rubidium 1403f24fa9 Codechange: replace LeastCommonMultiple with std::lcm 2024-01-20 16:45:21 +01:00
Patric Stout bd85f61a40 Change: use a stronger hash and actual random information to generate Uids 2024-01-20 14:23:03 +01:00
Patric Stout 37244bc8c5 Codechange: MacOS already has MIN/MAX macros defined
This is caused because we use PreCompile Headers, and one of them
includes a system headers which defines MIN/MAX.
2024-01-20 14:23:03 +01:00
Patric Stout 63a3d56b8a Add: monocypher 4.0.2
Monocypher will take care of all our encryption needs; as most
OSes and vcpkg doesn't have it available, we vendor it.
2024-01-20 14:23:03 +01:00
Rubidium 6b21368bc2 Codechange: replace FIND_FIRST_BIT/FindFirstBit2x64 with FindFirstBit 2024-01-19 21:10:39 +01:00
Rubidium 8faaedeff9 Codechange: replace hand written function to find first/last bit with C++ variant 2024-01-19 21:10:39 +01:00
Peter Nelson 903119115b
Fix 9602de4: FinaliseCargoArray did nothing. (#11839)
`CargoSpec::Iterate()` deliberately skips invalid cargo types, but `FinaliseCargoCarry()` is only interested in them.
2024-01-19 20:07:47 +00:00
translators db7697bcdf Update: Translations from eints
chinese (simplified): 22 changes by WenSimEHRP
romanian: 37 changes by bnegrut
2024-01-19 18:40:43 +00:00
Peter Nelson 9cf47af490
Change: Invalidate music volume when restarting music playback on Windows. (#11836) 2024-01-19 17:01:36 +00:00
Peter Nelson 6a2c37b4ed
Fix 09f585b: Crash if font name ends with comma or comma and whitespace on Linux. (#11838) 2024-01-19 08:03:32 +00:00
Rubidium 1c694e433d Codechange: use std::popcount instead of hand written loop 2024-01-19 06:48:55 +01:00
Peter Nelson ae575a7a5b Codechange: Store text run positions in vector of points.
This simplifies the interlaced vector of x/y positions.
2024-01-19 00:08:31 +00:00
Peter Nelson f7cc88f370 Codechange: Return vector references instead of pointer to first item. 2024-01-19 00:08:31 +00:00