Commit Graph

1305 Commits

Author SHA1 Message Date
Rubidium b9069ca358 Doc: not much is going to change in the 15.0 script APIs 2025-12-21 02:03:50 +05:00
Charles Pigott f883ea3521 Fix #14863: [Script] Improve documentation for GetAPIVersion (#14877) 2025-12-08 22:30:48 +05:00
Cyprian Klimaszewski add6521abd Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-08 22:26:18 +05:00
Peter Nelson 2557cf2098 Codechange: Remove unnecessary 'core' includes. (#14867) 2025-12-08 22:24:32 +05:00
Peter Nelson eab0f70eb5 Codechange: Make order load/unload flags value types. (#14861)
Order Load and Unload flags have complex logic to ensure that invalid combinations aren't used. In fact, apart from FullLoad and FullLoadAny, all mixed combinations are invalid.

Simplify logic by removing the use of bit values and treat each option as a value.
2025-12-08 22:24:28 +05:00
Peter Nelson ab20a16ed2 Codechange: Use enum class and EnumBitSet for various order flags. (#14783) 2025-12-08 22:09:16 +05:00
Jonathan G Rennison 0985242864 Codechange: [Script] Use std::optional for script list next iteration item (#14753)
Avoids false positive updates in Remove when iterating the final item
and leftover values being returned when IsEnd is true
2025-12-08 21:33:43 +05:00
TheDude-gh 429b6820a7 Add: [Script] ScriptTile::IsHouseTile 2025-12-08 21:31:38 +05:00
Peter Nelson f0d0bf4447 Codechange: Use enum class for water-related enums. (#14804) 2025-12-08 21:09:43 +05:00
Peter Nelson 90001dabfa Codechange: Replace color with colour. 2025-12-08 20:43:11 +05:00
Peter Nelson fab1c5f7e9 Codechange: Use enum class for RoadTileType. 2025-12-08 20:42:01 +05:00
Peter Nelson c2d92433c6 Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
2025-12-08 20:20:01 +05:00
Peter Nelson 49dd74ea89 Codechange: Use enum/EnumBitSet for livery in use flags. (#14746)
Replaces magic numbers.
2025-12-08 20:02:19 +05:00
SamuXarick 0282d58b7c Codefix: Add missing 'this->' in ScriptList (#14747) 2025-12-08 20:02:11 +05:00
SamuXarick 240864586a Doc 313c6c4: [Script] GetAllRailTypes and GetRailType are from ScriptEngine (#14745) 2025-12-08 20:02:08 +05:00
SamuXarick 1b82431545 Add: [Script] Auto-convert ObjectType bool to integer when setting values for items in lists via [] (#14308) 2025-12-08 20:02:06 +05:00
SamuXarick c925246bfb Doc 80666a0: Fix typo in game script changelog (#14714) 2025-12-08 19:57:11 +05:00
Peter Nelson 4a555528fd Codechange: Dereference with x-> instead of (*x). (#14700) 2025-12-08 18:46:14 +05:00
Peter Nelson 2aaff2dc08 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-12-08 18:46:12 +05:00
Peter Nelson 10651bb638 Change: [Script] Decouple RAILTYPE_INVALID from internal presentation. (#14630)
RAILTYPE_INVALID is now -1, which matches ROADTYPE_INVALID.
2025-12-08 15:52:47 +05:00
Peter Nelson f0f207fdf8 Fix 313c6c45aa: [Script] Return rail types as list instead of bitmask. (#14617)
This is more idiomatic for scripts, and avoids exposing internal representation.
2025-12-08 15:47:31 +05:00
Michael Lutz e211ab56ef Add: [Script] Function to get all rail types of an rail engine. 2025-12-08 15:44:14 +05:00
Michael Lutz 4bcb58cf52 Codechange: Store the rail type of rail engines as a RailTypes bitmask. 2025-12-08 15:42:35 +05:00
Peter Nelson 7e46955467 Fix c02ef3e456: [AI] Incorrect infrastructure cost for road/tram tiles. (#14596)
Infrastructure total count should be split between road and tram pieces.
2025-12-08 15:36:08 +05:00
dP 8404c2a7cc Merge remote-tracking branch 'upstream/master' 2025-09-28 02:33:49 +05:00
Loïc Guilloux 4b9afbe35b Codefix: [Script] Mention ScriptError::ERR_STATION_TOO_SPREAD_OUT in API doc (#14562) 2025-08-31 15:18:51 +00:00
Loïc Guilloux 80666a0d51 Add: [Script] ScriptError::ERR_BRIDGE_TOO_LOW (#14560) 2025-08-31 14:04:02 +00:00
Rubidium 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Loïc Guilloux 995f30bff0 Codefix bd1a3fe0: Incorrect handling of squirrel stack (#14538) 2025-08-26 16:00:01 +02:00
Peter Nelson bd57aee3a9 Add: Town cargo history graphs. (#14461) 2025-08-02 23:19:43 +01:00
Peter Nelson 7bb4940ebd Codechange: Use unique_ptr for all pointers in script instance. (#14339)
Removes manual memory management with new/delete.
2025-07-19 09:29:30 +01:00
Loïc Guilloux 1b01a0636c Fix #14362, 4b677e8256: Don't crash old scripts doing silly instantiation (#14394) 2025-07-17 13:30:33 +02:00
Peter Nelson 9ce2aca949 Codechange: Get/pass ScriptStorage by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter Nelson 55098a2f2e Codechange: Get/pass engine by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter Nelson 7ff0c67f77 Codechange: Get/pass script controller by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter Nelson a6143eea21 Codechange: Include more relevant headers for script_storage. (#14437) 2025-07-14 07:49:50 +01:00
Peter Nelson 1d38cbafcb Codechange: Use unique_ptr for ScriptInfo instances.
Replaces raw pointers, slightly.
2025-07-14 00:10:14 +01:00
Peter Nelson 992d58d799 Codechange: Pass ScriptInfo by reference to IsSameScript. 2025-07-14 00:10:14 +01:00
Peter Nelson 8f34b7a821 Codechange: Keep Squirrel engine in unique_ptr. 2025-07-14 00:10:14 +01:00
Peter Nelson a46a3a97f3 Change: New company face definition system and UI. (#14319)
Bits used by company faces are now defined by a variable system instead of being hardcoded, allowing future expansion.

The four face types covering gender and skin colour are now separate face styles with their own definitions.
2025-06-24 07:59:49 +01:00
Peter Nelson 5766ba51d7 Codefix: Clean up incorrect indentation for multi-line comments. (#14383) 2025-06-20 19:01:44 +01:00
Peter Nelson e4cf6ca0ba Fix: Mis-sized widgets due to missing widget fill. (#14370)
In most places where we calculate and set widget resize step we neglect
to set widget fill step to match. Initial widget sizing uses fill step
instead of resize step, which means the initial size may not be a
multiple of the resize step as intended. In particular this will cause
WWT_MATRIX to be misrendered.

Whether or not this matters depends on the widget type being resized and
the window layout, however for consistency always set fill step to the
same as resize step when calculating.
2025-06-17 17:40:11 +01:00
dP f0f93c68ca Merge remote-tracking branch 'upstream/master' 2025-06-14 17:01:17 +05:00
glx22 8e3acbfa84 Codechange: Deduplicate DefSQClass::DefSQ[Static]Method() 2025-06-14 12:41:39 +02:00
glx22 90e21bc713 Codechange: Remove useless SQConstruct parameters 2025-06-14 12:41:39 +02:00
glx22 ccffbb4142 Codechange: Remove manual param count for constructors too 2025-06-14 12:41:39 +02:00
Jonathan G Rennison 63f1c2aa3a Codechange: Use TypedIndexContainer for typed index containers
Instead of ReferenceThroughBaseContainer
2025-06-12 18:50:49 +01:00
Peter Nelson 28cc0079f2 Codechange: Create ScriptAllocator with make_unique instead of new. (#14340) 2025-06-11 23:28:08 +01:00
SamuXarick ac8b236885 Fix: [Script] Make ScriptOrder functions aware of road waypoints (#13419) 2025-06-08 16:49:36 -04:00
SamuXarick 484f18f987 Codechange: Code style changes to AI/GS GUI files (#13665) 2025-06-08 16:48:36 -04:00