Commit Graph
59 Commits
Author SHA1 Message Date
Harry Hopkinson 6c5c2079ce Remove openrct2/scripting includes 2026-08-07 23:54:10 +01:00
mgiannopoulos24 d85835a0a0 Rename Staff entity members (#26603)
* Rename Staff entity member fields

* Rename Staff entity methods for consistency

* Remove unused EntertainerCostume enum class
2026-05-28 12:28:45 +02:00
Marino Rottier 66e1411d84 Rename EntityBase and EntitySpriteData members (#26520)
* Rename EntitySpriteData members to camelCase

* Rename EntityBase members to camelCase
2026-05-17 11:21:59 +00:00
Michał Janiszewski 8d9aec1090 Fix #26304: Use common prototypes for JS entities (#26321)
Previously JS entities would create prototypes on each allocation in
`Sc*::New`. This change creates a single global protype for each entity
class which then gets copied upon entity allocation in JS realm.

Running test with "Live Ride Measurements" plugin on a park shared for
performance testing I get following results:

|                 | OpenRCT2::Scripting::HookEngine::Call | OpenRCT2::Scripting::ScMap::getAllEntities |
|-----------------|---------------------------------------|--------------------------------------------|
| duktape         | 68ms                                  | 10ms                                       |
| quickjs current | 318ms                                 | 126ms                                      |
| quickjs + fix   | 22ms                                  | 942µs                                      |

Previously each call to `getAllEntities` would result in 1382 calls to
`JS_SetPropertyFunctionList`, each costing 90.5µs.

Park used: https://files.catbox.moe/z6j2g4.park
2026-04-05 09:22:47 +02:00
Michael Bernardi 421530c3ea Use class prototypes for all script types. 2026-04-01 02:19:01 +11:00
16cd1c07ff Swap Duktape for quickjs-ng
Co-authored-by: Basssiiie <Basssiiie@users.noreply.github.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-04-01 02:18:36 +11:00
Michał Janiszewski c9609ac64d Return empty strings instead of nullptr 2026-02-08 21:40:14 +01:00
Michael Steenbeek 343c7a70d7 Change colour to a strong enum (#25873) 2026-01-28 10:06:45 +01:00
matheusvb3 bba937a03d Remove more redundant namespace qualifiers (#25828) 2026-01-16 08:38:20 +01:00
Aaron van Geffen 1b844d9e52 Rework object header includes (#25742)
* Remove EntityList.h includes in a few places

* Remove Object.h dependency from Footpath.h

* Remove Object.h dependency from Editor headers

* Remove Object.h dependency from NetworkBase.h

* Move RideFilters struct to RideTypes.h

* Move ObjectSourceGame enum to its own header

* Remove Object.h dependency from ObjectManager.h

* Remove Object.h dependency from ObjectRepository.h

* Remove Object.h dependency from ObjectTypes.h

* Add missing copyright header to ObjectEntryManager.cpp

* Add missing copyright header to SurfaceData.h
2026-01-05 19:31:34 +01:00
Aaron van Geffen 40aaf97c07 Update copyright years to 2026 (#25741) 2026-01-05 13:42:59 +00:00
Michael Steenbeek 4fe983bac4 MapRange: do not inherit from RectRange 2025-10-08 20:38:44 -03:00
Gymnasiast cce7975115 Rename members of RCT12PeepAnimationGroup 2025-10-07 20:00:21 +02:00
Gymnasiast 18a25688e3 Rename members of StaffType 2025-10-05 14:47:16 +02:00
Gymnasiast d97512f498 Rename members of PeepAnimationGroup 2025-10-05 14:46:12 +02:00
Gymnasiast f1d74507a0 Rename members of PeepAnimationType 2025-10-05 14:46:12 +02:00
Gymnasiast 0cb04754fb Rename members of PeepActionType 2025-10-05 14:46:12 +02:00
Gymnasiast aa84394e7b Rename fields of PeepAnimation 2025-10-05 01:27:23 +02:00
Gymnasiast ee67a827c0 Rename members of AnimationPeepType 2025-10-05 01:10:06 +02:00
matheusvb3 2ad4d4be72 Add isEntertainer method to Staff class, small cleanup 2025-09-15 23:00:13 +02:00
Aaron van Geffen 12ab9195b6 Rework EntityRegistry into class 2025-08-31 14:29:36 +02:00
Aaron van Geffen 5b8fedd5b2 Rework Map.h includes (remove transitive header includes) 2025-09-04 22:16:53 +02:00
Aaron van Geffen bbd67e8dfb Move EntityList and EntityRegistry into OpenRCT2 namespace (#25039) 2025-08-26 23:05:49 +02:00
Garv Changrani b47506dd90 Close #24665: Don't return empty strings with quotes for std::string 2025-07-02 13:33:54 +02:00
Basssiiie cae36aa010 Fix missing invalidation on various plugin api setters for entities (#24310) 2025-04-30 20:59:17 +00:00
Aaron van Geffen 90143b2e38 Address review comments 2025-01-09 12:34:45 +01:00
Aaron van Geffen 2f0af0a005 Expose getCostumeStrings to scripts 2024-12-11 19:06:47 +01:00
Aaron van Geffen 44a9f530f7 Separate RCT12PeepAnimationGroup further from PeepAnimationGroup 2024-12-09 19:43:05 +01:00
Aaron van Geffen dbc394cb67 Scripting: list and use available costumes dynamically 2024-12-08 12:34:13 +01:00
Aaron van Geffen 7e3fe58067 Use peep animation objects for guest and staff sprites 2024-12-05 13:37:39 +01:00
Aaron van Geffen fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00
Aaron van Geffen ec14a6dca8 Move invalidation out of Peep::UpdateSpriteBoundingBox 2024-12-17 21:05:38 +01:00
Aaron van Geffen c034d2c921 Introduce PeepAnimation compilation unit (#23383)
* Move StaffType enum into Staff.h

* Introduce PeepAnimation compilation unit
2024-12-12 00:23:42 +01:00
Aaron van Geffen f65ef67260 Rename PeepAnimationType::None to PeepAnimationType::Walking (#23317) 2024-12-04 16:09:17 +00:00
Aaron van Geffen 3685d1a24b clang-format: change IndentPPDirectives to BeforeHash (#23287) 2024-11-29 12:04:56 +09:00
Aaron van Geffen 584f6b8661 Rename Peep::SpriteType to AnimationGroup 2024-09-22 16:54:33 +02:00
Aaron van Geffen 6d27369ea6 Rename PeepSpriteType to PeepAnimationGroup 2024-09-22 16:42:27 +02:00
Aaron van Geffen 58f33ca325 Rename PeepAnimationType::Ui to Hanging 2024-09-22 16:21:32 +02:00
Aaron van Geffen 48a71461bf Rename PeepAnimationType::StaffCheckboard to StaffCheckBoard 2024-09-22 16:18:41 +02:00
Aaron van Geffen b70aaea31e Rename ActionSpriteImageOffset to AnimationImageIdOffset 2024-09-22 16:13:49 +02:00
Aaron van Geffen 24b36915ef Rename ActionFrame to AnimationFrameNum 2024-09-22 16:12:04 +02:00
Aaron van Geffen ee7bb61bb0 Rename WalkingFrameNum to WalkingAnimationFrameNum 2024-09-22 16:10:04 +02:00
Aaron van Geffen 2edf8b472a Rename (Next)ActionSpriteType to (Next)AnimationType 2024-09-22 16:08:58 +02:00
Aaron van Geffen 435cf14d49 Rename PeepActionSpriteType to PeepAnimationType 2024-09-22 16:07:35 +02:00
mrmbernardi 9ed5c63857 Rename Location.hpp constants (#22385) 2024-07-26 10:23:25 +02:00
Arnold Zhou a749698566 [Plugin API] Feat: Expose staff statistics (#22184) 2024-07-24 20:10:34 -03:00
Aaron van Geffen 04fa09e8df Allow mechanics to be assigned the drowning animation (#22071) 2024-05-20 22:36:33 +02:00
Aaron van Geffen 893392d987 Scripting: allow precise and safe control of peep animations 2024-05-05 21:09:41 +00:00
Aaron van Geffen 831c7651bb Scripting: tailor costume assignment to each staff type
In order to transition staff costumes to objects, we must further disentangle staff from regular peeps. This has many advantages, such as making custom entertainers or even handymen costumes. However, this means putting some restrictions on what costumes can be assigned to staff in the mean while.

We are aware of plug-ins allowing staff to be decorated like normal peeps, though, e.g. using @Manticore-007's Peep Editor. Splitting staff from peeps will mean breaking such functionality. We can do our very best to reverting 'invalid' staff to their normal outfits instead of them outright disappearing. However, in the mean time, we should disallow peep costumes from being assigned to staff to prevent further disappointment down the line.

Once we get to actually adding custom staff costumes, I plan to add a new plug-in API to get available costumes for a particular staff type. This would apply to entertainers, but also other staff types. This should make it easier for plug-in authors to tap into custom costumes in the future.
2024-05-05 22:41:52 +02:00
Aaron van Geffen 17920b6039 Script: when changing staff type, reset state to walking
Reset state to walking to prevent invalid actions from carrying over
2024-05-01 23:10:25 +02:00