Commit Graph

1247 Commits

Author SHA1 Message Date
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
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
Peter Nelson ecafbf884e Add: Allow separate expansion of town buildings and roads in scenario editor. (#14341) 2025-06-07 13:56:43 +00:00
Loïc Guilloux 9339b8270c Fix: Wrong error message about script Save() returned value (#14334) 2025-06-06 19:01:50 +02:00
glx22 938acbe6ef Add: [Script] Cloning ScriptList 2025-06-05 22:37:33 +02:00
glx22 7200e7f509 Add: [Script] Framework for cloning selected ScriptObject 2025-06-05 22:37:33 +02:00
glx22 31fbb17c5b Codechange: Replace ScriptObject::[SG]etAllowDoCommand with ScriptObject::DisableDoCommandScope 2025-06-05 01:39:40 +02:00
Loïc Guilloux 2cd3c8db86 Codechange: [Script] Don't report multiple errors on valuator/filter failure (#14303) 2025-05-30 14:38:41 +02:00
Peter Nelson 7c9393e822 Codechange: Remove terminator from airport tile lists. (#14306) 2025-05-27 20:23:59 +01:00
Peter Nelson 984d864c72 Codechange: Add OnClick handler for dropdown items.
This allows each dropdown item to indicate if something different should happen depending on where in the item was clicked.
2025-05-25 09:13:05 +01:00
Loïc Guilloux 5e765a2787 Codechange: [CMake] Use ".sq.hpp" instead of ".hpp.sq" for API exports (#14297) 2025-05-24 22:38:37 +02:00
Peter Nelson b42abfbefc Fix 0455627d16: Incorrect script order position mapping. (#14294) 2025-05-23 19:55:22 +01:00
Peter Nelson 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
SamuXarick 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 Guilloux 4b1b2a4310 Change: [Script] Don't allow scripts to instantiate ScriptEvent (#14276) 2025-05-20 15:37:05 +02:00
frosch 2926179d02 Fix: Restore the behaviour when entering numbers in query windows: clamp integers out of range to the maximum valid value. 2025-05-20 12:57:30 +02:00
SamuXarick 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 Guilloux 1b0fd0e6fd Fix b2c57123: [Script] Conversion from ScriptEvent to ScriptEventCompanyTown subclasses (#14274) 2025-05-18 15:40:47 +02:00
Loïc Guilloux c16d5f3a8d Change: [Script] ScriptVehicleList_Station accepts an optional VehicleType parameter (#14260) 2025-05-13 16:41:23 +02:00
Peter Nelson d9247fa1a0 Change: Remove extra close buttons from some windows. (#14124)
All windows have an X button to close it, so remove the redundant close buttons.
2025-05-12 14:54:44 +01:00
Rubidium a48a5f0cc6 Codechange: replace memcpy with std::copy_n 2025-05-10 16:50:58 +02:00
Peter Nelson ac76212b80 Fix: Closing the Game Options window closes all textfile windows.
Record the parent window that opens a textfile window so only child windows are closed instead of all.
2025-05-04 19:36:46 +01:00
Rubidium 1f411f8a16 Codechange: use string_view for squirrel parameter checks 2025-05-04 16:59:06 +02:00
Rubidium d464961c41 Codechange: use std::string_view for SQ stack and function info 2025-05-03 23:02:09 +02:00
Rubidium 0bc773215e Codechange: use std::optional<std::string_view> to make the intent of function clearer 2025-05-03 23:02:09 +02:00
Rubidium ec79ceb2be Codechange: use std::string_view for sq_pushstring 2025-05-03 23:02:09 +02:00
Rubidium 3020e615a9 Codechange: use std::string_view for squirrel compilation 2025-05-03 23:02:09 +02:00
Peter Nelson bd1a3fe0b7 Change: Remove the limit of 20 parameters to a Script Text string. (#14193) 2025-05-03 18:33:29 +01:00