Commit Graph

6058 Commits

Author SHA1 Message Date
Gymnasiast 15b5d97795
Refactor shop items 2020-05-11 19:16:23 +02:00
Michael Steenbeek d7637cd70f
Replace many C-style casts (#11720) 2020-05-11 14:32:56 +02:00
Michael Steenbeek a261b4ce33
Remove commented out code (#11721) 2020-05-11 13:54:15 +02:00
relic-automaton 3e39e2d0db
[Plugin] Add a script hook for ride ratings calculation (#11698)
The hook is called after ride rating calculation is complete and allows
scripts to override the ratings.
2020-05-10 23:26:10 -03:00
Ted John 35e039c65d
Call tick and day plugin hook at the end of the update routine (#11713) 2020-05-10 23:24:15 -03:00
Ted John e182791a6b
Merge pull request #11685 from IntelOrca/plugin/listview-widget
[Plugin] Implement the list view widget
2020-05-10 22:36:44 +01:00
hdpoliveira 46d856a723
Extract function news_item_first_open_queue_slot (#11594) 2020-05-10 23:19:56 +02:00
Tulio Leao ed84c2dab0
Fix #11705: Drawing tooltips out of box (#11707) 2020-05-10 15:22:47 -03:00
Ted John b96fdee531
Add plugin API to remove entities (#11702) 2020-05-10 14:07:27 -03:00
Ted John 5288caec02
[Plugin] Add support for SetCheatAction and cheat retrieval (#11700)
* Add cheats interface API

* Add plugin support for SetCheatAction

* Remove ctx from ScCheats
2020-05-10 13:02:10 -03:00
TomasZilinek 9fde6a74c3
Close #11561: Use ScreenCoordsXY in gfx_draw_string()
* Fix #11572 create gfx_draw_string() overload

created the overload and changed all calls of the old function to the new (using const ScreenCoordsXY&)

...
2020-05-10 09:49:15 -03:00
Michael Steenbeek 783494df68
Use rotated calls in GhostTrain.cpp (#11691) 2020-05-10 12:49:02 +02:00
frutiemax c447cde63c
Close #11561: Use ScreenCoordsXY in gfx_draw_string_centred_wrapped()
* Add gfx_draw_string_centred_wrapped overload using ScreenCoordsXY

* Update calls to gfx_draw_string_centred_wrapped

* Remove old signature of gfx_draw_string_centred_wrapped

* Meaningful coordinate variable names and constructor calls
2020-05-10 01:00:26 -03:00
Michael Steenbeek fa91b4091f
Name tunnel constants (#11694) 2020-05-09 23:54:47 +02:00
Ted John 5e7cf3bf96 Fix rebase 2020-05-09 17:24:15 +01:00
Ted John c4f6dbe1ca Allow items and columns get / set 2020-05-09 17:24:15 +01:00
Ted John 4701dd3b9b Add get / set highlighted cell / selected cell 2020-05-09 17:24:15 +01:00
Ted John 5e427413a6 Refactor list view so we can access it from ScWidget 2020-05-09 17:24:15 +01:00
Ted John 096de3ccc8 Implement list view 2020-05-09 17:24:15 +01:00
Hummel95 aac55d2cc0
Fix #10876: Peeps spawns can stack and are not removable (#11155) 2020-05-09 16:17:08 +02:00
Ted John be9f3e1f66
[Plugin] Ensure modified entities and tile elements are invalidated (#11682) 2020-05-09 16:13:56 +02:00
Tulio Leao 16c5960e99
Merge pull request #11635 from IntelOrca/plugin/ride-game-actions
[Plugin] Add named parameters for ride related game actions
2020-05-09 10:46:41 -03:00
Ted John e7a028b3b8 Add TODO for Visit track design 2020-05-09 14:31:27 +01:00
Ted John 6db16ffcad
Implement showTextInput plugin API (#11678) 2020-05-09 14:18:50 +01:00
Ted John 45d32bec68
[Plugin] Add API for taking captures and giant captures of the park 2020-05-09 13:55:24 +02:00
Michael Steenbeek 3d3dbde642
Merge pull request #11668 from IntelOrca/plugin/peep-stats
[Plugin] Add more stats to Peep interface
2020-05-09 13:53:36 +02:00
Ted John 7b8ffdb865 Refactor peep.intensity into new strict struct 2020-05-09 12:37:51 +01:00
Ted John fa0dd4e0d6 Add more peep stats for plugins 2020-05-09 12:37:51 +01:00
hdpoliveira 650af7d943
Part of #9473: Create Vehicle::TryReconnectBoatToTrack() (#11619)
Converted from loc_6DA9F9
2020-05-09 13:32:22 +02:00
Michael Steenbeek 3ceecb33f0
Fix #11676: Spiral Roller Coaster has regular lift hill available (#11681) 2020-05-09 13:23:55 +02:00
Tulio Leao 373776f3db
Address review comments on #11598 2020-05-09 12:35:36 +02:00
Ted John 49e062ae5d
Merge pull request #11665 from IntelOrca/plugin/more-object-fields
[Plugin] Split object identifier and add more ride object fields
2020-05-08 20:45:30 +01:00
Ted John 0ebdd93e00 Fix #11667: Memory dumps being generated every time the game is closed 2020-05-08 15:55:19 +01:00
Ted John 59ab39178f Add most fields from RideObject struct 2020-05-08 15:28:48 +01:00
Ted John 21f55eaeeb Handle no object for context.getObject correctly 2020-05-08 15:28:48 +01:00
Ted John 46d69126ea Split identifier and legacyIdentifier on Object 2020-05-08 15:28:48 +01:00
Aryaman Singh 3417c10a61
Part of #11569: gfx_draw_string_right() w/ ScreenCoordsXY (#11654)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-07 22:27:53 -03:00
Michael Steenbeek 8660bbe9d7
Fix #1013: negative length in Ride window (#11651) 2020-05-06 11:32:10 +02:00
Tulio Leao 5271e06abf
Merge pull request #11621 from Gymnasiast/feature/7648-bis
Add drawing code for more APVC, Water Coaster and B&M pieces
2020-05-05 23:14:53 -03:00
Michael Steenbeek d10f9ebf2a
Use named flags in calls to sub_6C683D() (#11650) 2020-05-05 23:11:38 -03:00
Ted John ec7b52d555 Add action and args to GameActionResult 2020-05-05 18:00:56 +01:00
Ted John 6c8d199831 Add parameter visitors to ride related actions 2020-05-05 18:00:56 +01:00
Michael Steenbeek 4f6f3feeb2
Merge pull request #11601 from Broxzier/bugfix/corrupt-elem-type-typescript
Add missing "openrct2_corrupt" element type
2020-05-05 18:53:08 +02:00
Michael Steenbeek 097b90a3db
Fix #11640: Object shows with blank description (#11641) 2020-05-05 18:49:58 +02:00
Michael Steenbeek 4c01a308f3
Fix #11644: Powered launch with blocks not available (#11646) 2020-05-05 18:18:42 +02:00
Gymnasiast cab9fdbe9c
Fix parameter name to apply_non_stop_block_brake() 2020-05-05 17:46:46 +02:00
blackhand1001 7fab48e2eb
Create constant for BLOCK_BRAKE_BASE_SPEED 2020-05-05 17:35:34 +02:00
Michael Steenbeek f3c0476673
Create constants for both tile element limits (#11645) 2020-05-05 15:40:33 +02:00
Hielke Morsink b39c673456 Introduce constant MAX_ELEMENT_HEIGHT 2020-05-05 11:35:42 +02:00
Fred-1044276 b03fbc086d
Fix #11450: Can't open rides, even with "Enable all track pieces" 2020-05-05 11:16:24 +02:00
Tulio Leao b1b103b961
Add missing 'y' in "TrainReadyToDepart" (#11636) 2020-05-04 22:39:14 -03:00
hdpoliveira bb07d84314
Implement Train class with iterators (#11486) 2020-05-04 19:43:25 -03:00
Michael Steenbeek d3448a7a40
Convert STR_NONE and STR_VIEWPORT to constexpr, remove C cast (#11629) 2020-05-04 19:41:25 -03:00
Hielke Morsink f88951eb33 Add isHidden field to plug-in TileElements
With this field, plug-in creators are encouraged to use `isHidden` rather than spawning corrupt elements to hide other tile elements, and their scripts won't need updating when `isHidden` becomes a real field that does not alter anything other than the element itself.
2020-05-05 00:16:09 +02:00
Michael Steenbeek ff46481453
Merge pull request #11628 from Gymnasiast/fix/11624
Fix #11624 and clean up loc_6B4F6B()
2020-05-04 23:27:46 +02:00
Michael Steenbeek dfc2512dd5
Merge pull request #11631 from Gymnasiast/refactor/regs2
Remove usage of regs.(e)bp
2020-05-04 23:26:41 +02:00
Michael Steenbeek 2911d01185
Remove usage of regs.eax from UpdateTrackMotion() (#11630) 2020-05-04 23:22:17 +02:00
Gymnasiast 4ad38f14fc
Replace regs.(e)bp in vehicle_update_track_motion_mini_golf() 2020-05-04 18:46:35 +02:00
Gymnasiast 09955a0114
Remove regs.bp from UpdateTrackMotionForwards/Backwards 2020-05-04 18:46:35 +02:00
Gymnasiast f88e1c03a0
Fix #11624: Crash when testing ride with a ghost end-of-station 2020-05-04 17:46:12 +02:00
Gymnasiast 50c750e176
Clean up GetOriginElement() 2020-05-04 17:10:57 +02:00
Gymnasiast 923701e16b
Clean up metal supports in Junior RC drawing 2020-05-04 14:59:29 +02:00
Gymnasiast 3dc0ab3ea6
Water Coaster: allow drawing downward water slopes 2020-05-04 12:47:38 +02:00
Gymnasiast a5f6725ef3
Extend 'Show all Track pieces' for B&M 2020-05-04 12:35:12 +02:00
Gymnasiast 4d76e8c619
Add booster drawing support to the APVC 2020-05-04 12:30:03 +02:00
Michael Steenbeek b5fed0d592
Fix #11548: Operating mode cheat does not allow changing modes (#11610) 2020-05-03 12:04:46 -03:00
Tulio Leao 282c7ff6d6
Merge pull request #11598 from tupaschoal/more-coordz-2
Favour CoordsXYZ for ride related functions
2020-05-03 10:20:55 -03:00
Ted John 2c153477a6
Add network.currentPlayer plugin API (#11607) 2020-05-03 13:53:36 +01:00
Hielke Morsink e5b1508694 Rename openrct2_corrupt to openrct2_corrupt_deprecated 2020-05-03 13:47:48 +02:00
Hielke Morsink ec0a734511
Fix: Silent replay record message gets overwritten (#11600) 2020-05-02 11:40:21 -03:00
Tulio Leao a808ded45a Favour usage of CoordsXY objects instead of individual variables 2020-05-02 11:07:18 -03:00
Tulio Leao 1872152df9 Make window_ride_construction_update_state() use CoordsXYZ* 2020-05-02 11:07:18 -03:00
Tulio Leao 02a5c10a58 Make place_provisional_track_piece() use CoordsXYZ 2020-05-02 11:07:18 -03:00
Tulio Leao 7c82daec25 Use CoordsXYZD in window_ride_construction_mouseup_demolish_next_piece() 2020-05-02 11:07:18 -03:00
Tulio Leao 28b3ac1693 Make track_block_get_previous() use CoordsXYE 2020-05-02 11:07:18 -03:00
Tulio Leao d58f3ec0b6 Make track_block_get_previous_from_zero() use CoordsXYZ 2020-05-02 11:07:17 -03:00
Tulio Leao 6203a5a20d Make track_block_get_next_from_zero() use CoordsXYZ 2020-05-02 11:07:15 -03:00
Tulio Leao 1f7ef019fc
Merge pull request #11580 from IntelOrca/plugin/custom-tool
[Plugin] Implement custom tool API
2020-05-02 08:28:59 -03:00
Ted John e3016cdc03
Fix plugin game action hook player and result (#11587)
- Player was not being attached to the game action event args.
- OpenRCT2 was looking for error on the event args object rather than the result sub object.
2020-05-02 11:45:05 +01:00
Ted John e5b05747d3 Apply code review refactors 2020-05-02 11:38:33 +01:00
Duncan 32eb7071a1
Fix #11550: Use std::nullopt instead of empty brace (#11595)
This is technically a gcc bug from the looks of it but since std::nullopt is slightly easier to read I've gone through the codebase and used that over empty braces. In addition noticed a mistake on the scripting viewport get widgetIndex function where it would return an incorrect widgetIndex.
2020-05-02 10:09:12 +02:00
hdpoliveira d78638c17a
Part of #9473: Create Vehicle::TrainReadToDepart (#11593)
Converted from train_ready_to_depart
2020-05-02 00:41:11 -03:00
hdpoliveira 3b099f52d0 Part of #9473: Create Vehicle::SimulateCrash
Converted from vehicle_simulate_crash
2020-05-02 00:00:09 -03:00
hdpoliveira 0fdc6531dc Part of #9473: Create Vehicle::CrashOnLand
Converted from vehicle_crash_on_land
2020-05-02 00:00:09 -03:00
hdpoliveira 7c291c330e Part of #9473: Create Vehicle::CrashOnWater
Converted from vehicle_crash_on_water
2020-05-02 00:00:08 -03:00
hdpoliveira efbdbee3fa Part of #9473: Create Vehicle::CloseRestraints
Converted from vehicle_close_restraints
2020-05-01 23:29:31 -03:00
hdpoliveira f129fb55af Part of #9473: Create Vehicle::OpenRestraints()
Converted from vehicle_open_restraints
2020-05-01 23:29:31 -03:00
hdpoliveira bfe5366dbe Part of #9473: Create Vehicle::UpdateVelocity
Converted from update_velocity
2020-05-01 22:04:17 -03:00
hdpoliveira 48045950c1 Part of #9473: Create Vehicle::CheckAndApplyBlockSectionStopSite
Converted from check_and_apply_block_section_stop_site
2020-05-01 22:04:17 -03:00
hdpoliveira dd8633499a Part of #9473: Create Vehicle::UpdateTrackMotionUpStopCheck
Converted from vehicle_update_track_motion_up_stop_check
2020-05-01 22:04:17 -03:00
hdpoliveira 55aae04ff5 Part of #9473: Create Vehicle::Claxon
Converted from vehicle_claxon
2020-05-01 22:04:17 -03:00
hdpoliveira 24ec443ff5
Vehicle update 9473 05 (#11586)
* Part of #9473: Create Vehicle::CanDepartSynchronised

Converted from vehicle_can_depart_synchronised

* Part of #9473: Create Vehicle::ReverseReverserCar

Converted from vehicle_reverse_reverser_car

* Part of #9473: Create Vehicle::UpdateReverserCarBogies

Converted from vehicle_update_reverser_car_bogies

* Part of #9473: Create Vehicle::UpdateHandleWaterSplash

Converted from vehicle_update_handle_water_splash
2020-05-01 21:50:40 -03:00
hdpoliveira 4649b573f4 Part of #9473: Create Vehicle::GetGForces
Converted from vehicle_get_g_forces
2020-05-01 19:49:03 -03:00
hdpoliveira acc6b9f878 Part of #9473: Create Vehicle::SetMapToolbar
Converted from vehicle_set_map_toolbar
2020-05-01 19:49:02 -03:00
hdpoliveira e8c95e6e3a Part of #9473: Create Vehicle::IsUsedInPairs
Converted from vehicle_is_used_in_pairs
2020-05-01 19:49:01 -03:00
Tulio Leao 21beb2368e
Merge pull request #11579 from hdpoliveira/vehicle_update_9473_03
Vehicle update 9473 03
2020-05-01 19:09:45 -03:00
Tulio Leao b5749ac8f6
Merge pull request #11578 from tupaschoal/more-coordz-1
Keep scouring openrct2-ui to reduce individual {x, y} usage
2020-05-01 18:57:38 -03:00
Tulio Leao 4589560a15 Make sub_6C683D() use CoordsXYZ on parameter and return 2020-05-01 18:06:26 -03:00
hdpoliveira 4d7ad5f92b Part of #9473: Create Vehicle::NumPeepsUntilTrainTail
Converted from vehicle_get_total_num_peeps
2020-05-01 17:24:55 -03:00
hdpoliveira 421fc5bc59 Part of #9473: Create Vehicle::InvalidateWindow
Converted from vehicle_invalidate_window
2020-05-01 17:24:54 -03:00
hdpoliveira 49be02dbfd Part of #9473: Create Vehicle::UpdateTestFinish
Converted from vehicle_update_test_finish
2020-05-01 17:24:53 -03:00
hdpoliveira 28c861ee7e Part of #9473: Create Vehicle::TestReset
Converted from vehicle_test_reset
2020-05-01 17:24:53 -03:00
Gymnasiast cc65564521
Use (RCT12)ObjectEntryIndex in more places 2020-05-01 22:06:13 +02:00
tylerleamon 30e6b475a9
Fix #5451: Guests scream on every descent, no matter how small 2020-05-01 22:05:52 +02:00
Ted John 65a9c7a1b1
Implement expenditureType on GameActionResult plugin API (#11514)
* Implement expenditureType on GameActionResult plugin API

* Update src/openrct2/scripting/ScriptEngine.cpp

Co-Authored-By: Michael Steenbeek <m.o.steenbeek@gmail.com>

* Improve formatting of ExpenditureTypes

* Apply code review comments

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-05-01 17:50:11 +01:00
Tulio Leao 9960e4b563
Merge pull request #11552 from IntelOrca/plugin/window-tabs
[Plugin] Implement custom window tabs
2020-05-01 13:49:31 -03:00
Michael Steenbeek fc860e8b6e
Merge pull request #11521 from Gymnasiast/refactor/oein3
Make ResearchItem use ObjectEntryIndex
2020-05-01 13:28:21 +02:00
Michael Steenbeek 7895a6911e
Bump network version 2020-05-01 13:28:11 +02:00
hdpoliveira 83d88c0939 Use const& in DodgemsCarWouldCollideAt 2020-04-30 21:03:05 -03:00
hdpoliveira 864a40e22c Use const& in wouldCollideWithDodgemsTrackEdge 2020-04-30 20:56:48 -03:00
hdpoliveira 4389670939 Improve names in UpdateDodgemsCollision 2020-04-30 20:53:18 -03:00
hdpoliveira 53f6bd8340 Part of #9473: Create Vehicle::PeepEasterEggHereWeAre
Converted from vehicle_peep_easteregg_here_we_are
2020-04-30 20:53:17 -03:00
hdpoliveira d69cc1c877 Part of #9473: Create Vehicle::TrainHead and Vehicle::TrainTail
Converted from vehicle_get_head and vehicle_get_tail
2020-04-30 20:53:17 -03:00
hdpoliveira 90cd90e738 Part of #9473: Create Vehicle::Entry
Converted from vehicle_get_vehicle_entry
2020-04-30 20:53:15 -03:00
hdpoliveira c88695a29c Part of #9473: Create Vehicle::UpdateDodgemsCollision
Converted from vehicle_update_dodgems_collision
2020-04-30 20:53:15 -03:00
Ted John 98249c777d Implement string tooltips for plugins 2020-05-01 00:06:58 +01:00
Ted John 4501173c0d Implement custom window tabs 2020-04-30 23:42:28 +01:00
Ted John 8798811561
Fix #11526: Plugin: Crash when using sprite type in park.postMessage (#11533) 2020-04-30 19:51:47 +02:00
Michael Steenbeek 948c393bc1
Fix #8110: Use a single name for the title sequences directory (#11545) 2020-04-30 18:50:26 +02:00
Michael Steenbeek 76f41285b4
Merge pull request #11511 from IntelOrca/plugin/improve-network-apis
Improve network plugin APIs
2020-04-30 18:50:05 +02:00
Ted John 3d2a534d3b Fix formatting 2020-04-30 17:12:02 +01:00
Michael Steenbeek 29fcdb5392
Fix Steam RCT1 detection (#11543) 2020-04-30 14:49:04 +02:00
Gymnasiast bafb63df55
Add missing RIDE_TYPE_NULL check 2020-04-30 13:58:48 +02:00
Gymnasiast ba66751d35
Bump network version 2020-04-30 12:59:34 +02:00
Gymnasiast 6cdee9db93
Fix #7006: Use RTDs for determining ride category 2020-04-30 12:59:18 +02:00
Gymnasiast 505ac0f1a0
Remove unused function 2020-04-30 12:59:18 +02:00
Gymnasiast 7bda0c5fd9
Create constructor for ResearchItem 2020-04-30 12:59:18 +02:00
Gymnasiast 73671bbeeb
Make ResearchItem use ObjectEntryIndex 2020-04-30 12:59:18 +02:00
Ted John bbe7ff0d80
Refactor game action binding for plugins (#11528)
* Refactor game action binding for plugins

Adds parameter visiting for game actions to reduce code needed for binding game actions to JavaScript objects

* Apply suggestions from code review

Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-04-30 06:56:57 -03:00
Ted John ee8a1a86c1 Add comments and null check 2020-04-30 02:18:32 +01:00
Ted John 7897df140d
Update src/openrct2/network/Network.cpp
Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>
2020-04-30 02:14:33 +01:00
Ted John f642597098 Replace loop with std::find_if 2020-04-30 01:54:12 +01:00
Ted John 297fe537b6 Implement network.sendMessage(msg, players) 2020-04-28 22:02:14 +01:00
Ted John d0154d08e9 Implement network join / leave hooks 2020-04-28 19:33:30 +01:00
Ted John 1f39ac014a Run network.chat hook for server chat messages 2020-04-28 17:31:12 +01:00
Duncan 96222ebace
Merge pull request #11509 from duncanspumpkin/entity_cleanup
Entity cleanup
2020-04-28 10:44:28 +01:00
duncanspumpkin fed148648c Use IsPeep in more places 2020-04-28 07:57:47 +01:00
Gymnasiast a1cbaf9a46
Use OBJECT_ENTRY_INDEX_NULL in more places 2020-04-28 08:38:37 +02:00
Gymnasiast 99626e4fbb
Convert RCT12 research marker defines to constexpr 2020-04-28 08:38:16 +02:00
Gymnasiast 38748fc869
Create conversion functions for entry indices 2020-04-28 08:38:04 +02:00
duncanspumpkin 63549dee57 Ensure move_sprite_to_list only used in sprite.cpp
After an entity is created it should never need to call this function. This will be important in later changes when the lists are changed to vectors
2020-04-28 07:27:05 +01:00
Ted John 2c731273c1
Fix #11494: Old console commands don't work at headless console since plugin system (#11508) 2020-04-27 23:02:38 +02:00
Ted John ecce4da6e8 Add ipAddress and publicHashKey properties to player API 2020-04-27 20:50:56 +01:00
duncanspumpkin 5b07a76f05 Use sprite_identifier when identifying entitys
The linked list index is only meant to be used for accessing the linked lists. Using the wrong variable is unlikely to cause issues for this exact case but it makes things cleaner.
2020-04-27 18:47:51 +01:00
Ted John 7b9fa972b6 Add addGroup, removeGroup, groups, players API 2020-04-27 18:39:42 +01:00
Ted John 06bbf5ddda
Implement SmallSceneryObject for getObject plugin API (#11489) 2020-04-27 18:41:49 +02:00
Michael Steenbeek 2e50cd44ba
Refactor ride_list_item to RideSelection (#11505) 2020-04-27 16:26:35 +02:00
Duncan 3c89d5ec12
Fix #11490. Crash with error message titles (#11502)
Error message titles for rides are composed from the ride name string id and therefore require passing the error message args.
2020-04-27 15:22:33 +02:00
Michael Steenbeek bcabc1d807
Merge pull request #11457 from Gymnasiast/refactor/rtd-forever
More RTD + cleanup
2020-04-27 15:11:54 +02:00
Ted John f9909e76f2
Merge pull request #11320 from IntelOrca/epic/plug-in-4
Implement THE PLUGIN SYSTEM!
2020-04-26 22:50:30 +01:00
hdpoliveira b696c0829a Replace 8 by COORDS_Z_STEP 2020-04-26 16:13:01 -03:00
hdpoliveira 3b70b43449 snake_case to camelCase 2020-04-26 16:13:01 -03:00
hdpoliveira cd02e28b31 Part of #9473: Create Vehicle::UpdateMeasurements
Converted from vehicle_update_measurements
2020-04-26 16:13:00 -03:00
Ted John 3c02861c63 Increment network version 2020-04-26 16:01:40 +01:00
Ted John c0aa5bdcc8 Create plugin directory automatically 2020-04-26 14:52:57 +01:00
Breno Rodrigues Guimarães 305b4d4957
Fix #11469: Clear memory but dont increment buffer position (#11472)
Fix a regression from #11412 that did:

set_format_arg(0, rct_string_id, ...)
set_format_arg(4, uint32_t, 0)

ride->FormatNameTo(gCommonFormatArgs + 2)

Notice it continues from byte 2, and not 8.
So the `set_format_arg(4, uint32_t... )` was just
for clearing memory, not for adding a new argument
2020-04-26 10:48:35 -03:00
Ted John 7041b0793e Fix tile type literals 2020-04-26 14:42:13 +01:00
Ted John 51ed760409 Fix FileWatcher header file 2020-04-26 14:35:09 +01:00
Ted John 2d43ac5936 Try using int32_t instead of size_t 2020-04-26 14:35:09 +01:00
Ted John 2c4cf49fb1 Add more const 2020-04-26 14:35:08 +01:00
Ted John a6eeb8c7c4 Add const to ticksElapsed_get 2020-04-26 14:35:08 +01:00
Ted John c67962577a Rename __ENABLE_SCRIPTING__ to ENABLE_SCRIPTING 2020-04-26 14:35:08 +01:00
Ted John 4ebd8da630 Revert change to RemoveCustomGameActions 2020-04-26 14:35:08 +01:00
Ted John ad75cb0754 Update src/openrct2/scripting/ScriptEngine.cpp
Co-Authored-By: Breno Rodrigues Guimarães <brenorg@gmail.com>
2020-04-26 14:35:08 +01:00
Ted John 4e1fa6a944 Update src/openrct2/scripting/ScriptEngine.h
Co-Authored-By: Breno Rodrigues Guimarães <brenorg@gmail.com>
2020-04-26 14:35:08 +01:00
Ted John 3fe49ca2a3 Apply suggestions from code review
Co-Authored-By: Michał Janiszewski <janisozaur@users.noreply.github.com>
Co-Authored-By: Aaron van Geffen <aaron@aaronweb.net>
Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>
2020-04-26 14:35:08 +01:00
Ted John 127dd1543e Disable FileWatcher for macOS 2020-04-26 14:35:08 +01:00
Ted John c1ab8b0b31 Apply suggestions from code review
Co-Authored-By: Breno Rodrigues Guimarães <brenorg@gmail.com>
2020-04-26 14:35:07 +01:00
Ted John 6cbea2fd37 Change baseZ / clearanceZ to baseHeight / clearanceHeight 2020-04-26 14:35:07 +01:00
Ted John 2f525e0539 Apply more code review comments 2020-04-26 14:35:07 +01:00
Ted John d480fb8daa Apply suggestions from code review
Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>
Co-Authored-By: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-04-26 14:35:07 +01:00
Ted John d9cbdf29ad Ensure all paths return a value regardless of duk_error 2020-04-26 14:35:07 +01:00
Ted John ea632a8eed Rename thing to entity 2020-04-26 14:35:07 +01:00
Ted John 62d15e44db Fix mingw build 2020-04-26 14:35:07 +01:00
Ted John e1c08defc8 Remove use of std::variant 2020-04-26 14:35:07 +01:00
Ted John 3c424be180 Use correct thing type for getThing 2020-04-26 14:35:06 +01:00
Ted John f12f439309 Fix errors after rebase 2020-04-26 14:35:06 +01:00
Ted John b9f3886ca8 Implement more footpath APIs 2020-04-26 14:35:06 +01:00
Ted John b7b1920a79 Fix build 2020-04-26 14:35:06 +01:00
Ted John 098e6839e2 Fix build after rebase 2020-04-26 14:35:06 +01:00
Ted John 76ebef10e3 Add APIs for getting info about loaded objects 2020-04-26 14:35:06 +01:00
Ted John 7a62d55c5f Clean up and remove unused APIs 2020-04-26 14:35:06 +01:00
Ted John ea8890aaaa Improve shared storage read / write 2020-04-26 14:35:06 +01:00
Ted John 0c71886941 Implement shared storage 2020-04-26 14:35:06 +01:00
Ted John 61da82c711 Add random number generator 2020-04-26 14:35:05 +01:00
Ted John fa997006ba Allow console.log to take variable args 2020-04-26 14:35:05 +01:00
Ted John a16cacff3a Add special properties for ride action 2020-04-26 14:35:05 +01:00
Ted John efcf9fd22a Implement hooking game actions 2020-04-26 14:35:05 +01:00
Ted John 49b155d178 Fix Linux build 2020-04-26 14:35:05 +01:00
Ted John 83fe0cf5c5 Implement strings for GameAction errors 2020-04-26 14:35:05 +01:00
Ted John 2ad37db817 Implement registering game actions 2020-04-26 14:35:05 +01:00
Ted John 4e4379e6ef Start work on custom game actions 2020-04-26 14:35:05 +01:00
Ted John 07ed0f5c0e Implement query and execute of game actions 2020-04-26 14:35:05 +01:00
Ted John f8394953aa Get thing inhertiance working 2020-04-26 14:35:05 +01:00
Ted John 971c6e201d Improve some of the map APIs 2020-04-26 14:35:05 +01:00
Ted John 4e12c9541e Implement more tile element APIs 2020-04-26 14:35:05 +01:00
Ted John 82639bae1b Implement more tile element APIs 2020-04-26 14:35:04 +01:00
Ted John 63b10166ac Add more surface element APIs 2020-04-26 14:35:04 +01:00
Ted John 4d5e7f19ca Implement surface style API and improve plugin calling 2020-04-26 14:35:04 +01:00
Ted John 32d72471b8 Add more tile APIs 2020-04-26 14:35:04 +01:00
Ted John a4be43eaa9 Fix clients starting remote scripts 2020-04-26 14:35:04 +01:00
Ted John 7628289eb3 Implement reverse of string processing 2020-04-26 14:35:04 +01:00
Ted John 4d221341da Improve string handling and allow window update 2020-04-26 14:35:04 +01:00
Ted John 00293d20e8 Fix compile 2020-04-26 14:35:04 +01:00
Ted John e6ca727b4b Improve dumping of expressions 2020-04-26 14:35:04 +01:00
Ted John dfd45651dc Improve stringify of expressions 2020-04-26 14:35:04 +01:00
Ted John 177c1a16a7 Always allow game state to be mutated in single player 2020-04-26 14:35:03 +01:00
Ted John 2890faee0a Change plugin type to just local and remote 2020-04-26 14:35:03 +01:00
Ted John e6341f0a42 Get scripting compiling on clang 2020-04-26 14:35:03 +01:00
Ted John bac91cd563 Allow scripting to be compile-disabled 2020-04-26 14:35:03 +01:00
Ted John 34078124cd Fix formatting 2020-04-26 14:35:03 +01:00
Ted John a5c8ff920f Add game mutable protection 2020-04-26 14:35:03 +01:00
Ted John dc64d3541d Transfer server-client scripts over network 2020-04-26 14:35:03 +01:00
Ted John 639faa2085 Fix GCC issues 2020-04-26 14:35:03 +01:00
Ted John facd557355 Fix formatting 2020-04-26 14:35:02 +01:00
Ted John 412c838a07 Fix warnings 2020-04-26 14:35:02 +01:00
Ted John 057155e5ab Use a function to register plugin rather than return value 2020-04-26 14:35:02 +01:00
Ted John d8b0b24c43 Implement date API 2020-04-26 14:35:02 +01:00
Ted John e0f66fe3cd Implement viewport widgets 2020-04-26 14:35:02 +01:00
Ted John da98ef63d3 Implement checkboxes and disabling widgets 2020-04-26 14:35:02 +01:00
Ted John d7d880dc23 Restart plugins when starting new game from a game 2020-04-26 14:35:02 +01:00
Ted John 0ec4475d62 Implement tile x, y coordinates 2020-04-26 14:35:02 +01:00
Ted John 560be19cdf Implement Ride and RideObject API 2020-04-26 14:35:02 +01:00
Ted John ab5bfffde0 Fix tile element scripting 2020-04-26 14:35:01 +01:00
Ted John 4b95a3a9d0 Implement custom menu items 2020-04-26 14:35:01 +01:00
Ted John c8fbc2e529 Improve chat subscription 2020-04-26 14:35:01 +01:00
Ted John 0e8c627324 Add config option for hot reload and refactor 2020-04-26 14:35:01 +01:00
Ted John 3ac22476c6 Implement basic send message 2020-04-26 14:35:01 +01:00
Ted John 3f58a0d9f8 Implement network mode 2020-04-26 14:35:01 +01:00
Ted John e6915e8799 Do not load plugins on title screen 2020-04-26 14:35:01 +01:00
Ted John 2e62078c30 Exclude node_modules directory 2020-04-26 14:35:01 +01:00
Ted John 4109b2c55a Fix build errors 2020-04-26 14:35:01 +01:00
Ted John 098348d3c3 Add hooking for chat message 2020-04-26 14:35:01 +01:00
Ted John 082eaf7c9c Add more network API 2020-04-26 14:35:00 +01:00
Ted John 5d78a1f2bf Add initial network API 2020-04-26 14:35:00 +01:00
Ted John 5bd58118b5 Get the plugin branch building again 2020-04-26 14:35:00 +01:00
Hielke Morsink d7123834df Expose more footpath and footpath-adition properties 2020-04-26 14:35:00 +01:00
Hielke Morsink 9b2ed0d641 Expose properties for path scenery 2020-04-26 14:35:00 +01:00
Hielke Morsink bec9c4da65 Expose surface element properties 2020-04-26 14:35:00 +01:00
Hielke Morsink e8bdb95f13 format new files
Since many of the changes were made before the clang-format changes went live, the new source files used a different format still. This PR applies the new style to all the new source files.
2020-04-26 14:35:00 +01:00
Hielke Morsink c37d7d859e Use C++ types 2020-04-26 14:35:00 +01:00
Hielke Morsink c064614280 Use new copyright/license notice 2020-04-26 14:35:00 +01:00
Hielke Morsink d6b4064794 Use variant argument type for console.log 2020-04-26 14:35:00 +01:00
Hielke Morsink 34b5aab6c0 Add new tile element classes for each type
This introduces some template code  to get around the problem of properties not being available for child-elements. I've tried to make clear what it's for by adding a comment.

So far only the Track element has an extra property (rideIndex), but it's fairly easy to add new ones.
2020-04-26 14:35:00 +01:00
Ted John 24eafb0a86 Do not crash if plugins directory is missing 2020-04-26 14:35:00 +01:00
Ted John 5ba96a34ac Fix FileWatcher for Windows 2020-04-26 14:35:00 +01:00
Ted John 26eb91016e Remove old hot reload code 2020-04-26 14:35:00 +01:00
Ted John 1fd33dd86a Use new FileWatcher class 2020-04-26 14:35:00 +01:00
Ted John 834cfad502 Create new FileWatcher class 2020-04-26 14:34:59 +01:00
Ted John 7047dec1d9 Get custom drop downs working
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2020-04-26 14:34:59 +01:00