Commit Graph
942 Commits
Author SHA1 Message Date
Jonathan G RennisonandGitHub 712ca5e3ec 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-11-29 17:36:41 +00:00
TheDude-ghandrubidium42 75aee10e1e Add: [Script] ScriptTile::IsHouseTile 2025-11-26 20:44:50 +01:00
Peter NelsonandGitHub 98275ee5d3 Codechange: Use enum class for water-related enums. (#14804) 2025-11-19 20:35:11 +00:00
Peter NelsonandPeter Nelson c3451b5d97 Codechange: Replace color with colour. 2025-11-18 00:02:48 +00:00
Peter NelsonandPeter Nelson 2cd5a241c5 Codechange: Use enum class for RoadTileType. 2025-11-17 20:46:05 +00:00
Peter NelsonandGitHub 34bbae05db Codechange: Use enum/EnumBitSet for livery in use flags. (#14746)
Replaces magic numbers.
2025-11-01 14:25:24 +00:00
SamuXarickandGitHub 20fd2b5014 Codefix: Add missing 'this->' in ScriptList (#14747) 2025-10-31 11:38:49 +00:00
SamuXarickandGitHub 3f19240bbe Doc 313c6c4: [Script] GetAllRailTypes and GetRailType are from ScriptEngine (#14745) 2025-10-30 13:36:43 -04:00
SamuXarickandGitHub 3ebedecb4a Add: [Script] Auto-convert ObjectType bool to integer when setting values for items in lists via [] (#14308) 2025-10-29 21:18:00 +01:00
SamuXarickandGitHub e4b0e84a7c Doc 80666a0: Fix typo in game script changelog (#14714) 2025-10-24 21:19:47 +02:00
Peter NelsonandGitHub a617d009cc Codechange: Dereference with x-> instead of (*x). (#14700) 2025-10-05 15:47:33 +01:00
Peter NelsonandGitHub 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 NelsonandGitHub 68e37b7b50 Change: [Script] Decouple RAILTYPE_INVALID from internal presentation. (#14630)
RAILTYPE_INVALID is now -1, which matches ROADTYPE_INVALID.
2025-09-19 22:02:08 +01:00
Peter NelsonandGitHub 5f20a97b36 Fix 313c6c45aa: [Script] Return rail types as list instead of bitmask. (#14617)
This is more idiomatic for scripts, and avoids exposing internal representation.
2025-09-15 13:59:04 +01:00
Michael Lutz 313c6c45aa Add: [Script] Function to get all rail types of an rail engine. 2025-09-14 17:11:26 +02:00
Michael Lutz 3ac1a2f1e4 Codechange: Store the rail type of rail engines as a RailTypes bitmask. 2025-09-14 17:11:26 +02:00
Peter NelsonandGitHub 80541a7682 Fix c02ef3e456: [AI] Incorrect infrastructure cost for road/tram tiles. (#14596)
Infrastructure total count should be split between road and tram pieces.
2025-09-07 14:11:05 +01:00
Loïc GuillouxandGitHub 4b9afbe35b Codefix: [Script] Mention ScriptError::ERR_STATION_TOO_SPREAD_OUT in API doc (#14562) 2025-08-31 15:18:51 +00:00
Loïc GuillouxandGitHub 80666a0d51 Add: [Script] ScriptError::ERR_BRIDGE_TOO_LOW (#14560) 2025-08-31 14:04:02 +00:00
Rubidiumandrubidium42 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Loïc GuillouxandGitHub 995f30bff0 Codefix bd1a3fe0: Incorrect handling of squirrel stack (#14538) 2025-08-26 16:00:01 +02:00
Peter NelsonandGitHub bd57aee3a9 Add: Town cargo history graphs. (#14461) 2025-08-02 23:19:43 +01:00
Peter NelsonandGitHub 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
Peter NelsonandPeter Nelson 9ce2aca949 Codechange: Get/pass ScriptStorage by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter NelsonandPeter Nelson 55098a2f2e Codechange: Get/pass engine by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter NelsonandPeter Nelson 7ff0c67f77 Codechange: Get/pass script controller by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter NelsonandGitHub 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 NelsonandGitHub 5766ba51d7 Codefix: Clean up incorrect indentation for multi-line comments. (#14383) 2025-06-20 19:01:44 +01:00
Jonathan G RennisonandPeter Nelson 63f1c2aa3a Codechange: Use TypedIndexContainer for typed index containers
Instead of ReferenceThroughBaseContainer
2025-06-12 18:50:49 +01:00
SamuXarickandGitHub ac8b236885 Fix: [Script] Make ScriptOrder functions aware of road waypoints (#13419) 2025-06-08 16:49:36 -04:00
Peter NelsonandGitHub ecafbf884e Add: Allow separate expansion of town buildings and roads in scenario editor. (#14341) 2025-06-07 13:56:43 +00:00
glx22andLoïc Guilloux 938acbe6ef Add: [Script] Cloning ScriptList 2025-06-05 22:37:33 +02:00
glx22andLoïc Guilloux 7200e7f509 Add: [Script] Framework for cloning selected ScriptObject 2025-06-05 22:37:33 +02:00
glx22andLoïc Guilloux 31fbb17c5b Codechange: Replace ScriptObject::[SG]etAllowDoCommand with ScriptObject::DisableDoCommandScope 2025-06-05 01:39:40 +02:00
Loïc GuillouxandGitHub 2cd3c8db86 Codechange: [Script] Don't report multiple errors on valuator/filter failure (#14303) 2025-05-30 14:38:41 +02:00
Peter NelsonandGitHub 7c9393e822 Codechange: Remove terminator from airport tile lists. (#14306) 2025-05-27 20:23:59 +01:00
Loïc GuillouxandGitHub 5e765a2787 Codechange: [CMake] Use ".sq.hpp" instead of ".hpp.sq" for API exports (#14297) 2025-05-24 22:38:37 +02:00
Peter NelsonandGitHub b42abfbefc Fix 0455627d16: Incorrect script order position mapping. (#14294) 2025-05-23 19:55:22 +01:00
Peter NelsonandGitHub 0455627d16 Codechange: Move ownership of Orders to OrderList. (#13948)
Removes the orders pool, and orders are now stored directly in each OrderList.

Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
2025-05-23 10:36:28 +01:00
SamuXarickandGitHub 5fef32bde7 Change: [Script] Move GSStation::GetOwner to GSBaseStation::GetOwner (#13406)
* Add: [Script] GSBaseStation::GetOwner

Added method for Game Scripts to retrieve the owner of a basestation.

* Cleanup: [Script] Remove ScriptStation::GetOwner

Due to class inheritance, GSStation::GetOwner and GSWaypoint::GetOwner can both reach GetOwner defined at GSBaseStation.
2025-05-22 13:47:04 +02:00
Loïc GuillouxandGitHub 4b1b2a4310 Change: [Script] Don't allow scripts to instantiate ScriptEvent (#14276) 2025-05-20 15:37:05 +02:00
SamuXarickandGitHub ad3a34e9ef Add: [Script] ScriptVehicleList_Waypoint (#13456)
Creates a list of vehicles that have orders to a given waypoint.
2025-05-19 14:48:17 +02:00
Loïc GuillouxandGitHub 1b0fd0e6fd Fix b2c57123: [Script] Conversion from ScriptEvent to ScriptEventCompanyTown subclasses (#14274) 2025-05-18 15:40:47 +02:00
Loïc GuillouxandGitHub c16d5f3a8d Change: [Script] ScriptVehicleList_Station accepts an optional VehicleType parameter (#14260) 2025-05-13 16:41:23 +02:00
Rubidiumandrubidium42 ec79ceb2be Codechange: use std::string_view for sq_pushstring 2025-05-03 23:02:09 +02:00
Peter NelsonandGitHub bd1a3fe0b7 Change: Remove the limit of 20 parameters to a Script Text string. (#14193) 2025-05-03 18:33:29 +01:00
froschandGitHub 9ac9798d7f Codechange: Remove usages of stoi and stol. (#14196) 2025-05-03 17:46:30 +02:00
Rubidiumandrubidium42 278aee2c19 Codechange: use std::string_view for sq_getstring 2025-05-03 14:24:28 +02:00
Peter NelsonandPeter Nelson 341cdbc16b Codechange: Pass Script engine by reference. 2025-04-28 23:08:20 +01:00
Peter NelsonandPeter Nelson 72ca962b84 Codechange: Pass ScriptInstance by reference. 2025-04-28 23:08:20 +01:00