Commit Graph

6984 Commits

Author SHA1 Message Date
Ted John eebababa90 Use variant instead of any 2020-11-27 18:54:56 +00:00
Ted John 644f7f07b3 Implement legacy format string 2020-11-27 18:54:56 +00:00
Ted John 6294188e93 Implement multi-level formatting for template FormatString 2020-11-27 18:54:56 +00:00
Ted John 6c23da4965 Implement multi-level formatting for any implementation 2020-11-27 18:54:56 +00:00
Ted John 43842bb668 Refactor some formatting code 2020-11-27 18:54:56 +00:00
Ted John 0e0c581258 Implement for format token types 2020-11-27 18:54:56 +00:00
Ted John b07bc6b0ab Add FmtString class 2020-11-27 18:54:56 +00:00
Ted John 8cb3103cc7 Add a dynamic format string function 2020-11-27 18:54:55 +00:00
Ted John 14377be487 Create new templated format string 2020-11-27 18:54:55 +00:00
ffrogman 7ed1804e61
Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum (#13453)
* Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum
2020-11-27 00:14:20 -03:00
Nick 67f5ce62b3
Plugins - return result from StaffHireAction (#13459)
* Added some scripting glue to StaffHireNewAction

* Update src/openrct2/scripting/ScriptEngine.cpp

Co-authored-by: Ted John <ted@brambles.org>

* Update plugin api version

Co-authored-by: Ted John <ted@brambles.org>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-11-26 16:37:07 -03:00
Duncan b5101d085d
Add further plugin visitors for actions (#13458)
* Add further plugin visitors for actions

* Update PLUGIN_API_VERSION

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-11-26 16:13:10 -03:00
Florian Probst 923b5f990d
Close #12438: Refactor RIDE_COMPONENT_TYPE to use strong enum (#13456)
* Part of #12438  Changed RIDE_COMPONENT_TYPE to enum class

(1/3)

Changed the enum RIDE_COMPONENT_TYPE to be enum class in RideData.h.
Shortened the enumerators.
And fixed

I split the changes I did into 3 commits because the enum is used in a total of 85 different files where I just replace the single line where they occur.

The changes in those 85 files are analogous to my change in line 328 in RideData.h in this commit.

* Part of #12438  changed all RIDE_COMPONENT_TYPE enumerators appearances

(2/3)

Changed every appearance of the old RIDE_COMPONENT_TYPE enumerators to the changed enumerators from last commit.

* Part of #12438

(3/3)

Used EnumValue() wherever a field or variable of the type RideComponentType was used as an index.

Havent checked if anything from these 3 commits on this branch got codestyle issues

* Part of #12438

used clang-format

* Closes #12438  Added Accessor function for RideComponentName

Added Accessor function GetRideComponentName to RideData.
to replace the use RideComponentNames[EnumValue(RideComponentType type)]

* Close #12438 moving GetRideComponentName to RideData Headerfile

Moved GetRideComponentName to RideData Headerfile since thats where it should be.
2020-11-26 15:23:47 -03:00
ffrogman 1f0764be28
Fix #13427: Newly created Go-Karts show "Race won by <blank>" (#13457)
* Fix #13427. Show # of people for newly created Go-Karts

* Add changelog entry

* Reorder changelog entry
2020-11-26 18:04:35 +00:00
Duncan 9451578cad
Fix #13454. Use File class so that utf8 paths understood (#13455) 2020-11-25 13:37:07 +00:00
Michael Steenbeek b595370648
Fix #13257: Rides w/ exactly the minimum objective length not counted (#13446) 2020-11-23 19:22:16 -03:00
Richard Fine 6c4df9c54d
Fix #13409: Peeps sometimes stray too far from the path centre (#13415)
* Fix #13409: Clamp peep distances from path centers

The debunch-peeps improvement did not account for the fact that peeps may change direction when they are only at the very edge of a tile - it's not entirely clear to me why this happens, but it does. The previous code would push these peeps back towards the center line over time, but the new behaviour allows them to keep walking along these very edge-y lines, which means they sometimes appear to be walking on the wrong sides of benches, railings, etc.

To fix the problem, do not simply keep the target coordinate constant for the direction the peep is moving in, but clamp it, so that peeps in these outlier positions will get pulled back to a more acceptable position within one tile. Peeps who are already debunched within the reasonable center area of the path are unaffected.

* Update replays for change

* Add changelog entry

* Fix broken hashes

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-11-22 21:06:43 +00:00
Ghlen Nagels 8c55d1ea9f
Close #12446: Refactor WEATHER to use strong enum (#13434) 2020-11-22 17:34:30 +00:00
Ted John 3d1c1b7e65
Fix writing of objects.idx (#13438)
Use WriteString instead of WriteValue for std::string.
2020-11-22 16:35:02 +00:00
maksimdrachov 1815a094bb
Fix #13426: Typo in "repay loan" 2020-11-19 19:45:40 +01:00
Michael Steenbeek 23871de19f
Remove built-in explode guests cheat 2020-11-16 22:07:52 +01:00
rpstester e2de490259
Refactor goto loc_6D7A97 (#13298)
* Refactor GoTo loc_6D7A97
2020-11-16 08:14:53 -03:00
Michael Steenbeek 8b27f7cdf8
Implement ToUpper for WinNT 5.1 (#13422) 2020-11-16 08:12:28 -03:00
adam-bloom d79308ef40
Fix #12895: Prevent Mechanics from fixing just fixed rides (#13389)
* Fix #12895: only update ride mechanic status when advancing state

* add changelog message

* Change changelog wording

* Bump network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-13 20:13:13 -03:00
Michael Steenbeek 1f55720bb5
Remove obsolete object fixes
These fixes have since been incorporated into JSON objects.
2020-11-13 10:44:28 +01:00
rpstester dcc5e0b0f9
Close #12337: Remove goto from DecideAndBuyItem (#13063) 2020-11-11 23:17:00 -03:00
Łukasz Pękalski fc4ad82ac1 resolve: integrated changes from comments 2020-11-11 16:08:39 +01:00
Łukasz Pękalski 7648feeba2 Close #12427: Refactor OBJECT_TYPE to use strong enum 2020-11-11 16:07:01 +01:00
Łukasz Pękalski dc93cacbee bugHunt: correcting code to compile
code does not compile yet
2020-11-11 16:07:01 +01:00
Łukasz Pękalski 832fd69822 refactor: changed ObjectType enum to strong enum
code does not compile yet
2020-11-11 16:07:01 +01:00
Łukasz Pękalski 6e5105ab3b refactor: ObjectType to use strong enum
enum renaming complete
2020-11-11 16:07:01 +01:00
Michael Steenbeek 1ab3f4b250
Introduce constant for max sequences (#13405) 2020-11-10 21:24:02 -03:00
Gymnasiast 75de0790bc
Improve message when asking for a game_path with no filepicker available 2020-11-08 14:32:58 +01:00
Gymnasiast d963438c4f
Check if platform has a file picker 2020-11-08 14:06:42 +01:00
Michael Steenbeek d8a7219c86
Use new identifier for default objects 2020-11-07 20:28:01 +01:00
Michael Steenbeek 58f099a644
Merge pull request #13286 from tupaschoal/research-refactor
Small research releated refactor
2020-11-07 20:18:18 +01:00
Tulio Leao b8f56fd980
Merge pull request #13312 from Gymnasiast/refactor/ride-id-it
Use ride_id_t in more places
2020-11-07 13:03:29 -03:00
Tulio Leao 6790bfe106 Use array for selecting research category strings 2020-11-07 11:40:15 -03:00
duncanspumpkin b89e0240ca Fix AddAsParent overload 2020-11-07 14:15:26 +00:00
duncanspumpkin ae87d81fe8 Adjust names further 2020-11-07 14:15:26 +00:00
duncanspumpkin 6882ddaf12 Clang format the relevant files 2020-11-07 14:15:25 +00:00
duncanspumpkin f6d2db48dc Name 98196C 2020-11-07 14:15:25 +00:00
duncanspumpkin a6a95bd28e Add overload for function 2020-11-07 14:15:25 +00:00
duncanspumpkin 99d4e8a10b Simplify functions further 2020-11-07 14:15:25 +00:00
duncanspumpkin 533a845b0f Name further functions 2020-11-07 14:15:25 +00:00
duncanspumpkin d6669be939 Rename main paint add image functions 2020-11-07 14:15:24 +00:00
duncanspumpkin 6abeeae4b7 Create helper function for calculating position hash 2020-11-07 14:15:24 +00:00
duncanspumpkin 4adcde42f6 Refactor to add allocators to paint session 2020-11-07 14:15:24 +00:00
Tulio Leao 8a35f27cfc Add converter from RideCategory to ResearchCategory 2020-11-07 11:14:55 -03:00
Tulio Leao 7d96dc9958 Move category names and invention strings to ResearchItem class 2020-11-07 11:14:55 -03:00
Tulio Leao 19ab8f1211 Use ResearchCategory Enum for ResearchItem 2020-11-07 11:14:55 -03:00
Gymnasiast 7ef8082185
Bump network version 2020-11-07 13:49:15 +01:00
Gymnasiast 802285fd92
Autoconvert ride id between RCT2 and OpenRCT2 2020-11-07 13:49:15 +01:00
Hielke Morsink f0c1ea1d37
Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
Gymnasiast 2846663533
Use ride_id_t for remaining peep ride fields 2020-11-07 12:58:32 +01:00
Gymnasiast a3aef90637
Replace loose usages of 0xFF 2020-11-07 12:58:32 +01:00
Gymnasiast d58a8d1184
Change tile_element_get_ride_index() to method 2020-11-07 12:58:32 +01:00
Michael Steenbeek 92a5f1aa24
Merge pull request #13310 from ju-pinheiro/sprite-identifier-strong-enum
Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum
2020-11-06 16:55:01 +01:00
Michael Steenbeek 3c1aaa97d7
Merge pull request #13379 from Gymnasiast/json-id-in-repo
Allow object lookup using new JSON id
2020-11-06 14:48:56 +01:00
Gymnasiast 880a267252
Implement @ZehMatt's suggestions 2020-11-06 14:33:16 +01:00
Gymnasiast ce15e20c94
Use plain std::string_view instead of const & 2020-11-06 11:40:52 +01:00
Sadret 4ff412dfe1
Close #13359: Make GameAction flags optional in plugin API. (#13381) 2020-11-06 09:40:15 +00:00
Gymnasiast 53aef4e549
Replace old edge style names in Tables.cpp 2020-11-05 21:36:28 +01:00
Gymnasiast 6df36127b4
Replace calls to LoadObjectLegacy() with new IDs 2020-11-05 21:33:13 +01:00
Gymnasiast bafafa6805
Create functions to load objects by JSON id 2020-11-05 21:24:43 +01:00
Gymnasiast 656cdda399
Add JSON identifier to object repository 2020-11-05 20:56:58 +01:00
Manuel Vögele 4a6db953f7
Convert a register to a variable 2020-11-05 17:43:51 +01:00
Sadret 2f4b1b9e3f
Close #13376: Open custom window at specified tab 2020-11-05 17:43:23 +01:00
Michael Steenbeek eea57f2bfe
Create calls for min/max cars per train 2020-11-05 17:42:02 +01:00
Manuel Vögele 69b07904c1
Make TileElement conversion preserve the const qualifier
Additionally this commit fixes some constness issues revealed by this change
2020-11-04 19:15:44 +01:00
Sadret 0b99943a3f
Fix address comments in TileElement.h 2020-11-04 17:41:38 +01:00
Manuel Vögele ef51cfb29c
Refactor loc_6DDF9C (#13369)
* Move ride_create_vehicles into Ride

* Refactor loc_6DDF9C
2020-11-04 15:58:24 +00:00
Duncan 88b73d8716
Refactor add 3d light follow on from #13281 (#13333)
Close #12406

Co-authored-by: rpstester <32249806+rpstester@users.noreply.github.com>

Co-authored-by: rpstester <32249806+rpstester@users.noreply.github.com>
2020-11-04 11:24:56 +00:00
Manuel Vögele 96ff1894ee
Remove unnecessary parameter from Ride::Open (#13368)
Ride::Open is only ever called with RIDE_STATUS_OPEN,
so the parameter is redundant.
2020-11-04 11:24:32 +00:00
pizza2004 2015acd4c0
Refactor UI/Interface Window to Title Case (#13367) 2020-11-04 04:52:23 +00:00
Manuel Vögele b40ea0169d
Rename sub_6B5952 to ChainQueues (#13357)
Also remove unreachable call to it
2020-11-03 22:43:26 -03:00
Richard Fine 438b197b80
Debunch peeps (#12917)
* Stop guests from being forced to the center line of a path over time

Change the way we apply randomness to peep destinations when moving from one tile to the next, to allow peeps that are moving along a straight path to maintain their perpendicular offset relative to the path direction, instead of being (eventually) forced back to the center line.

* Update test expectations

The changes to guest movement mean that the number of steps taken for these expected paths are now slightly different to before.
2020-11-03 22:30:36 -03:00
Tulio Leao faf10568bb
Rename VEHICLE_UPDATE_FLAG_1 to COLLISION_DISABLED (#13363)
Rename VEHICLE_UPDATE_FLAG_1
2020-11-03 19:23:22 -03:00
Łukasz Pękalski 88a6a085e4
Close #12455: Refactor MOUSE_STATE to use strong enum (#13361)
* Close #12455: Refactor MOUSE_STATE to use strong enum

refactor: MouseState to strong enum

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-11-03 18:41:19 -03:00
pizza2004 a5607da09d
Refactor Widget to TitleCase (#13355) 2020-11-03 18:29:22 -03:00
Manuel Vögele 47419b8ba1 Rename vehicle_unset_update_flag_b1 and move it into Vehicle 2020-11-03 21:36:26 +01:00
Manuel Vögele 6517757df7 Rename VEHICLE_UPDATE_FLAG_1 2020-11-03 20:08:10 +01:00
Manuel Vögele 1b55914c96
Rename ride_set_block_points to RideOpenBlockBrakes (#13360) 2020-11-03 17:24:54 +00:00
Manuel Vögele 15dc5e004e
Rename VEHICLE_UPDATE_MOTION_TRACK_FLAG_10 (#13362) 2020-11-03 17:24:18 +00:00
Sadret c602db27fd
Close #13057: Make GameAction flags accessible by plugins. (#13359) 2020-11-03 15:43:43 +00:00
pizza2004 b0fd5f93d7
Refactor UI/Interface misc to TitleCase (#13354)
* Refactor LandTool to Namespace

* Refactor Theme to TitleCase

* Refactor ViewportInteraction to TitleCase
2020-11-03 10:59:00 +00:00
Sadret c2d309af38
Close #13346: Change FootpathScenery to FootpathAddition (#13350) 2020-11-03 08:17:29 +00:00
pizza2004 68bd035f12
Refactor Dropdown to TitleCase (#13352)
* Refactor Dropdown Namespace

* Refactor Dropdown to TitleCase
2020-11-03 08:16:06 +00:00
Michael Steenbeek 1aff58b23e
Use TrackElement in vehicle_create_trains() and friends (#13338) 2020-11-02 23:56:12 -03:00
Manuel Vögele fac1b1f81e
Refactor loc_6B51C0 2020-11-02 23:05:47 +01:00
pizza2004 1643c62939 Refactor UI/Input MouseInput to Title Case 2020-11-02 07:05:33 -07:00
Michael Steenbeek 4ea6f8099f
Merge pull request #13319 from manuelVo/rename-ride_is_valid
Rename ride_is_valid_for_test/open and update return type
2020-11-01 20:49:55 +01:00
Aaron van Geffen cea5fab238 Release v0.3.2
- Feature: [#12110] Add Hybrid Coaster (Rocky Mountain Construction I-Box) track type.
- Feature: [#12999] .sea (RCT Classic) scenarios are now listed in the “New Scenario” dialog.
- Feature: [#13000] objective_options command for console.
- Feature: [#13096] Add Esperanto translation.
- Feature: [#13164] Add 'Objective options' to Cheats menu.
- Change: [#9568] Change lift sounds of Reverser Roller Coaster and Compact Inverted Coaster to better fitting ones.
- Change: [#13160] The lay-out of the Park Cheats tab has been improved.
- Fix: [#1324] Last track piece map selection still visible when placing ride entrance or exit (original bug).
- Fix: [#3200] Close Construction window upon selecting vehicle page.
- Fix: [#4022] Fix Mac cursor offset on launch
- Fix: [#4041] Garbled park option on scenario editor with custom theme.
- Fix: [#4865] Offer an option to disable inhibiting the monitor power.
- Fix: [#5178] Lighting effects cannot be disabled in software mode
- Fix: [#5904] Empty errors on tile inspector base height change.
- Fix: [#6086] Cannot install existing track design with another name.
- Fix: [#6614, #8623] Colours are distorted when using OpenGL with Intel integrated graphics drivers.
- Fix: [#7443] Construction arrows pulse at irregular intervals.
- Fix: [#7518] Water isn't cut down by view clipping tool.
- Fix: [#7748] Tooltips would not timeout for normal UI elements.
- Fix: [#8015] RCT2 files are not found when put into the OpenRCT2 folder.
- Fix: [#8957] Error title missing when building with insufficient funds
- Fix: [#10186] Placing multiple saved rides ignores design name (original bug).
- Fix: [#12368] Desync due to ghost station pieces affecting changing ride settings.
- Fix: [#12940] Windows cause issues with snow drawing.
- Fix: [#13019] Simulated trains sometimes open construction window when they crash.
- Fix: [#13021] Mowed grass and weeds don't show up in extra zoom levels.
- Fix: [#13024] Console cursor does not correctly render at current cursor position.
- Fix: [#13029] Not all Junior Roller Coaster pieces are shown when "Show all track pieces" cheat is enabled.
- Fix: [#13044] Rides in RCT1 saves all have "0 customers per hour".
- Fix: [#13074] Entrance and exit ghosts for mazes not being removed.
- Fix: [#13083] Dialog for renaming conflicting track design crops text out.
- Fix: [#13097] Missing direction arrow for stations
- Fix: [#13098] UI buttons for entrance and exit don't toggle according to them being built.
- Fix: [#13098] Maze can still be constructed while placing entrance and exit (original bug).
- Fix: [#13118] Closing construction window resets ride viewport.
- Fix: [#13129] Missing error message when waiting for train to leave station on the ride measurements graph.
- Fix: [#13138] Fix logical sorting of list windows.
- Fix: [#13158] Cursors are drawn incorrectly in text input fields.
- Fix: [#13222] Vehicle collision causes negative number of passengers (original bug).
- Fix: [#13226, #7280] No error is shown when attempting to load a corrupted save.
- Fix: [#13266] Plugin API: Deleting key of sharedStorage not working.
- Fix: [#13278] Desync caused by ghost tiles changing the ride mode.
- Fix: [#13289] Litter and vomit sometimes not loading with RCT1 saved game or scenario
- Fix: [#13292] Impossible excitement rating requirements with finish building 5 coasters goal
- Improved: [#13023] Made add_news_item console command last argument, assoc, optional.
- Improved: [#13098] Improvements to the maze construction window user interface
- Improved: [#13125] Selecting the RCT2 files now uses localised dialogs.
2020-11-01 20:00:01 +01:00
Duncan dcabc8451e
Fix #13250: Crash when opening parks with new ride types (#13256)
This only happens when a new ride type is added and the park is opened in the older version of the game where the ride type does not exist.

Reworked so that invalid rides are not loadable. Force reload of title if current scenario is corrupted.
2020-11-01 14:49:43 +01:00
Aaron van Geffen 89cc45908f Replace Backtrace token for v0.3.2 2020-11-01 10:18:49 +01:00
Manuel Vögele 1f7d73a741
Fix #13306: Restore entrance/exit for prebuilt ride design ghosts (#13309)
This fixes a regression introduced in c440dac
2020-10-31 12:27:38 +00:00
evilclownattack 3277153e87
Fix #13289: Litter and vomit sometimes not loading with RCT1 saves (#13322)
Issue was actually caused by loading RCT1 saves from certain rotations, and fixed by reseting sprite quadrants when loading. Wasn't an issue with RCT2 saves as litter screen coordinates are set directly from the save, rather than calculated based on rotation and sprite width/height.
2020-10-31 11:32:32 +00:00
Manuel Vögele d0e5a5ab6e Move ride_open and ride_test into Ride 2020-10-28 18:13:37 +01:00
Manuel Vögele eaa340dd92 Rename ride_is_valid_for_test/open and update return type 2020-10-28 15:31:24 +01:00
Michael Steenbeek 6b4e942a58
Fix #13297: Missing null check in tile_element_get_banner_index() (#13313) 2020-10-27 22:49:06 -03:00