1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00
Commit Graph

341 Commits

Author SHA1 Message Date
ZehMatt
5e3913965d Add scripting API to create entities 2021-08-07 22:05:14 +03:00
ZehMatt
c1d97b845e Small cleanup in ScMap.hpp 2021-08-07 22:05:14 +03:00
Michael Steenbeek
e3c918ba5b Merge pull request #15174 from ZehMatt/scripting/deperecate-peep
Deprecate peep in scripting
2021-08-07 20:45:48 +02:00
ZehMatt
900f9c9190 Apply code review 2021-08-07 20:33:43 +03:00
ZehMatt
aa2b7d9972 Deprecate peeps property in scripting for Car entity 2021-08-05 17:16:42 +03:00
ZehMatt
a7bef5442b Allow plugins to target a specific API version 2021-08-05 17:16:42 +03:00
ZehMatt
af102e391e Return correct entity type, API breaking change 2021-08-05 17:16:42 +03:00
ZehMatt
8f23670df8 Bump up scripting version 2021-08-05 17:16:42 +03:00
ZehMatt
78cff6e293 Implement getter for "guest" and "staff" types in getAllEntities 2021-08-05 17:16:42 +03:00
Ted John
5f853df1fd Remove gS6Info 2021-08-02 20:38:02 +02:00
Gymnasiast
277317b6f1 Bump network and plug-in API version 2021-08-01 15:15:33 +02:00
Ted John
70d9c1438e Change most things and formatting to money64 2021-08-01 15:14:42 +02:00
andrewpratt64
62d66ca9d0 Add hook for vehicle crashes to plugin api (#15084)
* Add initial implementation of "vehicle.crash" hook for the scripting api

The hook will fire whenever a vehicle crashes, i.e. an individual car
explodes and it's status becomes "Crashed!"

* Update contributors.md

Add name to contributors list under the "Additional implementation (OpenRCT2)" section.

- If the added line needs to be changed or removed entirely let me know

- I added this based off of the Github wiki: "If it's the first time you're contributing with the project, make sure to update the contributors.md file by appending your name at the end of the respective list."

* Move hook code into function

* Rename hook function

Renamed function, "FireVehicleCrashHook" to "InvokeVehicleCrashHook"

* Wrap InvokeVehicleCrashHook in #ifdef

Move the #ifdef from inside the function body to the outside

* Update changelog and api version

- Added entry to changelog
- Increment API version

* Fix whitespace

Replace tab character with four spaces

* Update src/openrct2/scripting/HookEngine.cpp

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2021-07-30 09:03:15 -03:00
ZehMatt
d9f9e7542a Use EnumMap for HookEngine lookups 2021-07-29 17:07:49 +03:00
ZehMatt
f44687b6b2 Use EnumMap for lookup tables in scripting 2021-07-29 17:07:48 +03:00
ζeh Matt
54d70ec52d Fix undefined behavior returning nullptr on std::string (#14952) 2021-06-26 01:29:46 -03:00
Jamie Quigley
4f6d0a00fd Refactor RIDE_STATUS to use strong enum (#14840)
* Refactor RIDE_STATUS to use strong enum

* Change platform-specific code to match RIDE_STATUS refactor

* Re-added check for valid RideStatus value

* Fixed errors in "g2" build target

* Use EnumValue instead of static_cast<uint8_t>

* Revert rct{1,2}.h to use uint8_t.

* Fix formatting

* Reverted from constexpr variable to additional enum variant

* Fix formatting
2021-06-10 07:09:58 +01:00
Duncan
12c5484f44 Refactor SmallSceneryEntry (#14815) 2021-06-03 22:14:41 -03:00
Duncan
7253b92cfd Use correct function call for WallPlaceAction plugin visitor (#14806)
* Use correct function call for WallPlaceAction plugin visitor

* Increment plugin version

* Update changelog
2021-06-02 21:30:49 +01:00
Michael Steenbeek
31848b195e Close #14765: Rename gCheatsFastLiftHill 2021-05-29 18:41:16 +02:00
Duncan
39fcc5d078 Split up Sprite header (#14764)
* Remove fields from rct_sprite union

* more header fun

* Fix guest include
2021-05-29 06:01:32 +01:00
Silent
94da3cf422 Fix #13445: Make FileScanner::ScanDirectory return a unique_ptr
Also fixes a resource leak in TitleSequence::GetSaves.
2021-05-20 19:22:36 +02:00
Ryan
d309a7c871 Add climate information to Park API (#14636) 2021-05-16 21:06:36 -03:00
ZxBiohazardZx
36b2742c19 Change Vehicle Rotation namings in accordance with OpenRCT2 Codestyle (#14616)
* Code Refactor: Rename vehicle_sprite_type to Pitch 

In some of the issues the vehicle_sprite_type is used to check for properties in regards to the pitch of the vehicle.Similarly bank_rotation is used to provide information on the Roll property. This is not in alignment with the https://github.com/OpenRCT2/OpenRCT2/wiki/Coding-Style and makes it harder to refactor other elements of the codebase and makes for undesired nested logics.

This PR also includes the change from rename bank_rotation to Roll in alignment with the OpenRCT2 Coding Style


Related to PullRequest #11956

* Apply formatting

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-05-12 12:38:46 +01:00
Ryan
8a282fa31c Add more properties to Park API (#14620)
* Add more properties to Park API

* Add new feature to changelog
2021-05-11 12:46:15 +01:00
Ryan
eb9ed63b0e Fix some actions for plugins (#14607)
* Fix some actions for plugins

If an action doesn't have an AcceptParameters method, the paramaters passed in executeAction will be ignored and the action will fail.

* Change plugin parameter names

* Increment plugin API version
2021-05-09 22:04:03 +01:00
Basssiiie
6c65105261 Add getter for current plugin api version (#14538) 2021-04-27 21:08:56 -03:00
Hielke Morsink
7525f5d5da Fix #14493: isHidden broken for elements with baseheight > 32 (#14499) 2021-04-19 19:44:11 +02:00
Duncan
b65f12f1cf Use correct null value (#14421)
* Use correct null value

* Increment network version
2021-04-02 13:13:33 +01:00
Duncan
177b5e1b08 Add plugin hook for guest generation (#14107)
* Add plugin hook for guest generation

* Update api version and add ts entry
2021-03-26 05:49:24 +00:00
Duncan
0a47d2157a Use more specific types where appropriate (#14388)
It takes marginally more time to get a Peep than a Guest/Staff so may as well go straight to the correct type
2021-03-25 08:44:25 +00:00
Duncan
977d05ba29 Entity type5: Remove peep assigned type (#14380)
* Remove users of AssignedPeepType

* Remove AssignedPeepType

Field no longer required due to changes to EntityType

* Move enum to the RCT12 header

* Increment network version

* Update replays
2021-03-24 08:54:05 +00:00
Duncan
df7a284822 Entity type 2: Remove sprite_identifier (#14334)
* Start changing the underlying type

* Further work

* Complete refactor

* Further cleanup

* Remove pointless check

* Increment network and plugin versions

* Add defaults

* Further defaults

* Fix test paint

* Update replays
2021-03-17 08:04:41 +00:00
Duncan
6ec379cd0e Split Entity Lists by Entity type (#14326)
* Make initial changes to add entity type

* Make further corrections

* Revert header changes

* Fix mistakes
2021-03-16 11:18:06 +00:00
Duncan
5474194905 Implement train view and remove linked_list_index (#13956)
* Make train manager view

* Remove linked list index field

* Remove merge mistake

* Fix further rebase errors

* Rename and add comments

* Update replays

* Fix Xcode project

* Increment network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-15 08:13:00 +00:00
Felix
9ec30e6869 Increase API version and update changelog 2021-03-06 23:51:02 +01:00
Felix
f30a2d417a Fix formatting 2021-03-06 23:36:38 +01:00
Felix
78785fffbe Add plugin API for vehicle g-forces 2021-03-06 23:25:26 +01:00
Ted John
49b677780f Merge pull request #14171 from IntelOrca/plugin/custom-widget
* Add API for getting network traffic statistics.
* Add API for creating custom widgets.
* Add API for drawing graphics for custom widgets.
* Add click event to spinners and allow them to be held down.
2021-02-27 01:31:00 +00:00
Michał Janiszewski
ac6e4fc0d6 Move SPRITE_INDEX_NULL, MAX_SPRITES to their new homes 2021-02-25 10:56:27 +01:00
Michał Janiszewski
67b61478cf Reduce inclusion of EntityList.h 2021-02-25 10:56:27 +01:00
Ted John
c7d9eba9db Increment plugin API version 2021-02-24 22:56:29 +00:00
Ted John
c2183989a5 Allow spinners to be clicked and held 2021-02-24 22:37:31 +00:00
Ted John
c1b0df5de6 Improve graphics plugin API 2021-02-24 22:37:31 +00:00
Ted John
93f17f1175 Add custom widget logic and network stats API 2021-02-24 22:37:31 +00:00
Cory Sanin
57c950958b Feature: Add option for taking transparent screenshots 2021-02-22 22:48:51 +01:00
ζeh Matt
c9ca066e94 Merge pull request #14024 from ZehMatt/refactor/coords-peep-destination
Use CoordsXY for for some types
2021-02-21 15:33:52 +02:00
Duncan
2b26e423e4 Remove AsGuest and AsStaff duplicated functions 2021-02-21 13:23:31 +01:00
Matt
965041b437 Remove direct access to DirectionX and DirectionY 2021-02-21 09:52:33 +02:00
Ted John
f7bbaed7f5 Increment plugin API version 2021-02-18 18:10:29 +00:00