Commit Graph

1700 Commits

Author SHA1 Message Date
Aaron van Geffen 503fbefbeb Harmonise date and time gaps / anchors.
Introduces the DATE_TIME_GAP constant.
2020-03-30 22:44:08 +02:00
Aaron van Geffen 56216fd026 Add an additional check for locales that do not use leading zeros for dates. 2020-03-30 22:42:58 +02:00
Aaron van Geffen 484956e006 Fix #10928: File browser's date column is too narrow. 2020-03-30 22:42:58 +02:00
Duncan 87b90f2304
Fix #11109. Incorrect drawing of staff list after refactor. (#11134)
Looks like I just completely forgot to implement the required changes to the drawing code. Drawing code now uses the new StaffList.
2020-03-29 22:00:28 +01:00
Duncan f64ea65d03
Rename SPRITE_LIST_TRAIN_HEAD to reduce car head confusion (#11105)
A single car on a coaster can comprise of multiple vehicles. One of those vehicles will be the car head vehicle. The train can comprise of multiple cars. Therefore not all vehicle->IsHead 's will be in SPRITE_LIST_TRAIN_HEAD. This rename makes that slightly more clear
2020-03-29 09:23:24 +01:00
Michael Steenbeek b5bcd0c2aa
Merge pull request #11122 from tupaschoal/reduce-c-casts
Reduce c-style cast
2020-03-28 22:47:14 +01:00
Aaron van Geffen a028bcbb64
Fix #11111: Finance graph hover values are glitchy with software renderer 2020-03-28 20:42:45 +01:00
Tulio Leao 2bb3a34274 Convert C-style pointer casts to named casts 2020-03-28 16:41:23 -03:00
Duncan 8920c36170
Fix #11107. Guestlist refresh issues after refactor (#11108)
Another little oversite on the guestlist preventing full functionality of the guestlist. Also fixed the map flashing
2020-03-28 16:21:01 +00:00
Duncan e7d0043756
Rework StaffList to use a vector (#11059)
* Rework StaffList to use a vector

This is a part of a reworking that removes the need for the peep list to be sorted by name/number order. Ultimately simplifying the sprite create code

* Remove unused variable setting
2020-03-28 12:12:53 +00:00
Duncan a33fbfa234
Fix guest list when in filtered mode. (#11102)
Mistake during refactor didn't consider that find_groups resets global vars.
2020-03-28 11:02:26 +01:00
Michael Steenbeek 47b6139546
Guard against null banners (#11078) 2020-03-27 13:04:45 +01:00
Michał Janiszewski 56e6ec2c23
Fix #11068: segfault when trying to clear empty list (#11069)
The report in #11068 was using track designs manager with "Boat hire"
ride, for which there were no designs and selecting "Clear" button on
the list accessed empty vector in `_filteredTrackIds`.
2020-03-26 23:49:10 +01:00
Michael Steenbeek cfb405f0ed
Use StationIndex in many more places (#10992) 2020-03-26 21:38:26 +01:00
Michael Steenbeek 81c6bb26e9
Prepare guest counters for more than 32767 guests (#10989) 2020-03-26 20:02:15 +01:00
Duncan 40160892a9
Rework GuestList to use a vector. (#11014)
* Rework GuestList to use a vector.

This is part of a chain of refactors that will be used to rework peep order in the sprite list

* Apply comments. Remove setting var_492 as no longer required
2020-03-26 07:23:30 +00:00
Michael Steenbeek 3f473ec3f0
Fix #6123: Cannot build some track designs with 4 stations (#11031) 2020-03-25 14:20:29 +01:00
Aaron van Geffen 302fe1cb2b
Merge pull request #10926 from IntelOrca/zoom-refactor
Zoom refactor
2020-03-24 23:28:32 +01:00
Tulio Leao 3e2533ac50
Fix #11001: Rides list does not use natural sorting (#11007) 2020-03-23 22:33:57 +01:00
Ted John d34dec9c27 Create ZoomLevel struct to add two new zoom levels 2020-03-23 15:54:03 +00:00
Michael Steenbeek 32e589efbe
Make _appropriateImageDropdownItemsPerRow a constexpr (#10990) 2020-03-21 15:22:18 +01:00
Gymnasiast ceec430ae1
Raise max size of dropdowns to 512 items 2020-03-20 21:48:27 +01:00
Gymnasiast 416dc22f35
Guard access to appriopriate image items per row 2020-03-20 21:48:27 +01:00
Michael Steenbeek c519512cfe
Create ObjectEntryIndex (#10980) 2020-03-20 19:28:39 +01:00
Ted John c89cecb2b5
Refactor the ride type to entry map (#10967)
Use C++ vectors and allow larger ride entry indices (> 256)
2020-03-20 18:07:31 +01:00
WantDiscussion 828eef7411
Introduced optional light effects for vehicles at night. (#10970) 2020-03-20 11:47:31 +01:00
Michael Steenbeek d86dce17e8
Prepare object indices for uint16_t (part 2) (#10966) 2020-03-18 21:27:53 +01:00
Michael Steenbeek ae6e53153b
Merge pull request #10922 from Gymnasiast/cleanup-scenery
Cleanup scenery
2020-03-18 18:44:27 +01:00
Gymnasiast 459a0318cf
Implement review requests 2020-03-18 16:22:08 +01:00
Aaron van Geffen 340f6522dd Increase the height of various price/loan/duration spinner widgets. 2020-03-16 23:46:33 +01:00
Aaron van Geffen f3765646c5 Increase height for button heights in text input window.
Also fixes the formatting for the widgets array.
2020-03-16 23:46:17 +01:00
Aaron van Geffen 8c0186d9a4 Make file window button captions fit in more languages.
The window is made 10px wider to accommodate button captions in languages like Japanese.
2020-03-16 22:56:04 +01:00
Aaron van Geffen fc70d6c851 Increase research dropdown heights. 2020-03-16 22:56:04 +01:00
Michael Steenbeek fd91c41a76
Name remaining ride type flags (#10947) 2020-03-16 22:52:06 +01:00
Michael Steenbeek 9fda7762e5
Fix #10942: Cut-away view is broken (#10945) 2020-03-16 21:47:38 +01:00
Gymnasiast 567e70bfb6
Pass ScenerySelection as const & 2020-03-15 13:28:20 +01:00
Gymnasiast 5ba5daca42
Make ScenerySelection implementation a bit cleaner 2020-03-15 13:19:26 +01:00
Gymnasiast 70e287b076
Clean up scenery handling 2020-03-15 12:15:12 +01:00
Michael Steenbeek 18ebe73dfa
Replace object_entry_get_type() with method (#10937) 2020-03-15 12:07:04 +01:00
Gymnasiast bdf681f440
Clean up many other coordinates 2020-03-13 12:03:43 +01:00
Michael Steenbeek 5d5284cc22
Merge pull request #10886 from Gymnasiast/refactor/more-big-coords
Refactor/more big coords
2020-03-12 15:39:53 +01:00
Aaron van Geffen dfe1c8dea8 Use COMMA32 instead of UINT16 for future-proofing; amend changelog. 2020-03-11 19:25:32 +01:00
Aaron van Geffen 64e2edd285 Add y-axis labels and guides to park guests chart. 2020-03-11 19:24:37 +01:00
Aaron van Geffen 7be46934ea Add y-axis labels and guides to park rating chart. 2020-03-11 19:24:36 +01:00
Aaron van Geffen 9c5f1248d5 Resize park rating and guests' tabs to accomodate y axis labels. 2020-03-11 19:24:36 +01:00
Michael Steenbeek e441019b04
Refactor rct_track_preview flags (#10906)
* Refactor rct_track_preview flags

* Zero-index rct_track_preview flags
2020-03-11 15:53:16 +00:00
Gymnasiast a0e14a66d9
Prepare guest window for more than 5 pages 2020-03-09 11:54:49 +01:00
Hielke Morsink 8737d3c2f0
Fix #10898: banner text has an offset in tile inspector window (#10900)
Interesting how this only gets reported now, it has been broken for 8 months already. It's likely a copy-paste error from 61d64ab8c5.
2020-03-08 23:02:55 +01:00
Gymnasiast 02c135e4fa
Clean up many staff functions 2020-03-07 23:07:47 +01:00
Gymnasiast 5f96a121ae
Apply ScreenCoordsXY to some functions 2020-03-07 22:25:42 +01:00
Gymnasiast 7759b54c2f
Make PeepPickupAction *actually* take a CoordsXYZ 2020-03-07 21:34:04 +01:00
Michael Steenbeek be13c1fc87
Refactor more TileCoords 2020-03-07 21:07:18 +01:00
Michael Steenbeek 4f86d0115c
Merge pull request #10866 from Gymnasiast/refactor/more-tile-element-prep
Refactor/more tile element prep
2020-03-06 09:25:32 +01:00
Gymnasiast dcf4301559
Use constant for invalid direction 2020-03-05 18:27:36 +01:00
Gymnasiast 33d2155529
Use define for some remapping instructions 2020-03-05 18:15:03 +01:00
Michael Steenbeek 0782692d58
Replace hardcoded scenery offsets (#10879) 2020-03-05 17:54:10 +01:00
Michael Steenbeek 8351a0477d
Merge pull request #10854 from tupaschoal/coords-3
Increase usage of ScreenCoordsXY on viewport functions and structs
2020-03-05 12:21:04 +01:00
Gymnasiast 8883f428ba Clean up window vars 2020-03-05 08:03:38 -03:00
Gymnasiast 57a40c0657
Extend PathElement 2020-03-04 21:57:42 +01:00
Daan de Heij 88fcba35ec
Fix #10662: Improve duck cheat tooltips
Co-authored-by: Thijs Versfelt <40113382+thversfelt@users.noreply.github.com>
2020-03-03 23:25:22 +01:00
Tulio Leao 724a6d4dcf Make rct_window use ScreenCoordsXY 2020-03-02 20:51:01 -03:00
Tulio Leao 09fad0ef7f Change rct_viewport to use ScreenCoordsXY 2020-03-02 20:50:58 -03:00
Tulio Leao 87f724d038 Use Coords objects for viewport_create() 2020-03-02 20:49:59 -03:00
Peter Ryszkiewicz e322519025
Added horizontal grid lines to finance charts (#10851)
Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-03-02 21:59:05 +01:00
Michael Steenbeek 88a3185715
Make draw_mini_preview_get_pixel_position() take const 2020-03-02 12:36:49 +01:00
Gymnasiast cded8313d7
Replace many occurrences of LocationXY16 2020-03-01 22:15:28 +01:00
Michael Steenbeek e3f5eb7275
Merge pull request #10847 from tupaschoal/const-ref-coords
Prefer const ref to send (Tile)CoordsXY(ZD) over
2020-03-01 14:38:39 +01:00
Michael Steenbeek d395d67b95
Merge pull request #10846 from tupaschoal/const-ref-screencoords
Prefer const ref to send ScreenCoordsXY over
2020-03-01 14:17:51 +01:00
Tulio Leao 2da96e8cfc Revert to copy instead of const-ref for functions that edit content 2020-03-01 09:57:03 -03:00
Tulio Leao 91c4735917 Revert to copy instead of const-ref for functions that edit content 2020-03-01 00:49:00 -03:00
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Tulio Leao 475eed0a56 Receive CoordsXY by const ref instead of copy 2020-02-29 01:16:19 -03:00
Michael Steenbeek 18f60fa987
Merge pull request #10821 from Gymnasiast/refactor/special-pieces-for-track
Refactor custom track piece handling
2020-02-23 21:29:12 +01:00
Aaron van Geffen 423ed90112
Fix #10815: Vertical alignment of scatter tool area size label. (#10823) 2020-02-23 10:57:38 +01:00
Gymnasiast 93926d5e5d
Move all the ride type-specific track categories to regular ones 2020-02-22 23:20:12 +01:00
Gymnasiast dc04c5ec95
Refactor custom track piece handling 2020-02-22 23:01:34 +01:00
Michael Steenbeek 86c7dbf1d5
Fix #7854: Cannot build custom Spiral RC; dummy entries in track designs list (#10814) 2020-02-22 19:06:57 +01:00
Michael Steenbeek e16a53df1d
Fix #10694: Lift hill speed of the Flying RC cannot be changed 2020-02-22 18:47:33 +01:00
Aaron van Geffen 9278ef7c61 Move ownership of scatter globals; delegate cleanup to close event. 2020-02-22 17:25:29 +01:00
Aaron van Geffen 5d9bcc083c Remove unused update event. 2020-02-22 17:25:29 +01:00
Aaron van Geffen aa6d6efe99 Refactor common parts of branched code.
Change shifts to COORDS_XY_STEP multiplication.
2020-02-22 17:25:29 +01:00
Aaron van Geffen 2528e94b48 Introduce low, medium, and high density buttons to the scatter tool.
Change window lay-out to more closely resemble others by introducing
density buttons, along with new sprites.

The amount of elements varies by density as follows:
* Low: number of elements equal to tool size
* Medium: twice as many elements as the tool size
* High: three times as many elements as the tool size.

Remove extraneous 'retry' clause.
2020-02-22 17:25:19 +01:00
Aaron van Geffen 642de8d11a Change gWindowSceneryScatterEnabled to bool, remove hack. 2020-02-22 17:20:46 +01:00
Aaron van Geffen cc9498e9a6 Revert changes to default scatter/cluster size. 2020-02-22 16:18:35 +01:00
Aaron van Geffen 6f029055a3 Make scatter window themeable; default to scenario window style. 2020-02-22 16:18:35 +01:00
Anton Scharnowski e6e48363de Introduce Scenery-Scatter Tool Window. 2020-02-22 16:18:19 +01:00
Tulio Leao 1ea9015315
Use CoordsXY(Z) in more places 2020-02-22 14:20:28 +01:00
Michael Steenbeek 08ca829ac2
Create RideTypeDescriptors (#10707) 2020-02-20 11:00:03 +01:00
Aaron van Geffen 947903fefb
Mountain tool overlay in land tool window (#10739) 2020-02-19 11:17:11 +01:00
Michael Steenbeek f41f878581
Replace some usages of LocationXY(Z)16 (#10699) 2020-02-18 22:42:38 +01:00
Gymnasiast 1e6efa6eb4
Extend BannerIndex to 16 bits 2020-02-15 10:37:34 +01:00
Michael Steenbeek a0fb955102
Merge pull request #10590 from tupaschoal/pr-9432
Fix #8064 Ride construction errors shown as (undefined string)
2020-02-14 11:31:43 +01:00
Tulio Leao 60e2546b2d Improve legibility of ride placement # attempt calculation 2020-02-13 23:10:33 -03:00
Michael Steenbeek dbb89b96fb
Clean up scenery window variables (#10697) 2020-02-13 21:24:37 +01:00
Duncan b8b539c16e
Modify next_x/y/z to become a CoordsXYZ (#10680)
* Modify next_x/y/z to become a CoordsXYZ

Should be further scope for refactoring from this.

* Make suggested changes

* Fix default construct issues
2020-02-11 22:01:14 +00:00
Tulio Leao d0b255d98b Start zAttemps from 0 2020-02-10 21:55:21 -03:00
Tulio Leao e79584fe24 Remove superflous if 2020-02-10 21:55:21 -03:00
Tulio Leao 6522b10dfa Make Z attempts crescent 2020-02-10 21:55:21 -03:00
Tulio Leao fabef9b050 Modify height search to also affect maze construction 2020-02-10 21:55:19 -03:00
aw20368 d2e5c29ce0 review changes (squash) 2020-02-10 21:54:41 -03:00
aw20368 c76378bc8b Fix #8064 Ride construction errors shown as (undefined string)
The search for height to build track ended at a half-height, leading to (undefined string) error. Changed to always end at whole height and search as high as possible.
2020-02-10 21:54:26 -03:00
Ted John be9cb19df5 Replace cURL with WinHttp implementation on Windows
This reduces the number of third party dependencies for Windows builds. WinHttp is quite a nice straight forward API so doesn't involve too much extra code.
2020-02-08 17:47:03 +00:00
Michael Steenbeek d16fbb0cd2
Change ride->overall_view to CoordsXY (#10673) 2020-02-08 17:19:59 +01:00
Gymnasiast 66dbb5e166
Refactor access to ResearchItem's rawValue 2020-01-26 15:17:37 +01:00
Gymnasiast e6c32230bc
Convert rawValue to uint32 2020-01-26 14:12:57 +01:00
Gymnasiast 63fddee603
Convert gResearchLast/NextItem to std::optional 2020-01-26 10:07:16 +01:00
Duncan 171e255981 Fix #10598. Mistake made when fixing #7784. (#10606) 2020-01-23 22:43:29 +01:00
Michael Steenbeek 3192bfb7c6
Move research functions to method; remove unused function (#10609) 2020-01-22 22:51:11 +01:00
Aaron van Geffen d1eb041958 Increase height of track save buttons. (#10604) 2020-01-22 13:30:33 +01:00
Aaron van Geffen acc6cffad3 Apply clang-format. 2020-01-22 11:41:34 +01:00
Michael Berk 914c07a711 Added Random Title Sequence 2020-01-22 11:41:34 +01:00
duncanspumpkin 272e4f29a3 Further minor refactors 2020-01-19 17:16:42 +00:00
duncanspumpkin a5ef8d6240 Rename rct_vehicle 2020-01-19 17:14:56 +00:00
duncanspumpkin 164acc85cc Rename sprites to newer style naming 2020-01-19 17:10:53 +00:00
Tulio Leao 893086440c Use CoordsXYZ on park_entrance_get_index() 2020-01-19 13:30:28 -03:00
Tulio Leao d34321fdaa Use CoordsXY on ride_entrance_exit_place_ghost() 2020-01-19 13:30:28 -03:00
Michael Steenbeek d798811c4a Make GetWaterHeight return big Z (#10579)
* Make GetWaterHeight return big Z

* Restore > 0 [ci skip]
2020-01-19 15:12:48 +00:00
Tulio Leao 89edde6a3c Use CoordsXY on footpath_bridge_get_info_from_pos() 2020-01-12 22:27:30 -03:00
Tulio Leao 201d13577e Use CoordsXY for footpath_get_coordinates_from_pos() 2020-01-12 22:20:29 -03:00
Michael Steenbeek d7f23bc5bf
Close #6898: Remove LOADMM and LOADRCT1 commands (#10546) 2020-01-12 14:26:33 +01:00
Michael Steenbeek c5297dfcdd
Fix #10550: Hovering the mouse cursor with path on a certain height level works weird (#10552) 2020-01-12 14:26:15 +01:00
Michael Steenbeek f05aeb1fcd
Fix #7784: Vehicle tab takes 1st car colour instead of tab_vehicle's colour (#10544) 2020-01-12 10:32:11 +01:00
Michael Steenbeek 0c9b1cec96
Correct max vehicles per ride value (#10504)
* Correct max vehicles per ride value

* Fix formatting

* Fix constant usage in TrackDesign.cpp
2020-01-04 18:10:33 +01:00
Tulio Leao c4a865384e Move Mac-only str handling functions to Platform (#10264) 2020-01-04 12:44:40 +01:00
Kevin Laframboise 13e946a239 Fix #10464: Incorrect error messages for track placement (#10494) 2020-01-02 08:11:24 +00:00
Duncan f4440b57b7
Merge pull request #10488 from Gymnasiast/refactor/map_get_footpath_element
Refactor map_get_footpath_element() and fix #10486
2020-01-02 07:45:15 +00:00
Gymnasiast 5c0a62c31a
Implement review requests 2020-01-01 23:03:41 +01:00
Michael Steenbeek 29922da871
Refactor calls to staff_is_patrol_area_set() 2019-12-31 10:10:40 +01:00
Gymnasiast 0d09a645fc
Refactor map_get_footpath_element() and fix #10486 2019-12-31 10:08:36 +01:00
Kevin Strehl 37110f386d Add Keyboard Shortcuts to the Tile Inspector (#10430) 2019-12-31 09:34:38 +01:00
Duncan c170926200 Refactor to prefer baseZ instead of height for big Z (#10478) 2019-12-31 09:33:27 +01:00
Duncan c74339fed9 Fix #10477. Fix upper max height limit being very low for large scenery
Mistake made while improving mouse control when zoomed out caused the upper limit for multi tile scenery to be limited by the sum of all clearance z values instead of the greatest clearance z value.
2019-12-31 09:15:46 +01:00
Duncan d486ac4d3b Reduce direct usage of LOCATION_NULL (#10480)
* Reduce direct usage of Location_Null

Ideally we want to refactor these out to use std::optional as much as possible but for now move to using the standard interfaces.

* Remove incorrect AND with LOCATION_NULL

In the original this was a simple comparison to check for negative. Unsure how it ended up as an AND with the negative bit.
2019-12-31 09:01:17 +01:00
Duncan 2c359736ee
Refactor to reduce usage of LocationXY8 and sLocationXY8 (#10479)
* Refactor to reduce LocationXY8 usage

* Further reduction of LocationXY usage and sLocationXY usage

* Reduce sLocationXY8 usage
2019-12-30 19:03:34 +00:00
Tulio Leao 06fb16ee88 Use CoordsXYZ for gMapSelectArrowPosition (#10442) 2019-12-30 16:51:35 +00:00
Michael Steenbeek 77494bbc73 Create definitions for some coords related stuff (#10456)
* Create definitions for some coords related stuff

* Use constexpr; add define for Z step
2019-12-30 15:03:51 +00:00
Michael Steenbeek bad5e326d1
Merge pull request #10103 from tupaschoal/compilation-warnings
Fix some compilation warnings
2019-12-28 23:09:14 +01:00
Tulio Leao 98110c0544 Make Map::map_invalidate*() use CoordsXY (#10437)
* Make Map::map_invalidate_element() use CoordsXY

* Make Map::map_invalidate_tile_full() use CoordsXY

* Make Map::map_invalidate_tile_zoom0() use CoordsXY

* Make Map::map_invalidate_tile_zoom1() use CoordsXY

* Make Map::map_invalidate_tile() use CoordsXY

* Use CoordsXYRangedZ for map invalidation

* Fix vehicle tile invalidation use Z instead of Y coord

* Fix BannerRemoveAction sending Z TileCoords to invalidate tile

* Fix wrong tile invalidation on peep_update_walking_break_scenery

* Prefer ToTileStart over bitwise and
2019-12-28 08:44:33 +00:00
Tulio Leao d4feed81e6 Fix C6031: return value ignored 2019-12-27 15:05:28 -03:00
Tulio Leao 28812760e7 Fix some compilation warnings 2019-12-27 15:05:27 -03:00
Michael Steenbeek d0744df22f
Merge pull request #10443 from tupaschoal/reduce-locationxy
Remove LocationXY usage on windows and actions
2019-12-27 15:58:26 +01:00
Michael Steenbeek 64f7cac6d6
Create getters for station height and start (#10453) 2019-12-27 15:57:40 +01:00
Michael Steenbeek 8ca0cf52a7
Replace more direct accesses to base/clearance Z with getter/setter (#10454) 2019-12-27 15:26:40 +01:00
Tulio Leao 109a90269c Prefer setNull/isNull on TopToolbar over LOCATION_NULL 2019-12-27 09:52:31 -03:00
Tulio Leao 15f873c018 Remove LocationXY usage on openrct2-ui\windows\ViewClipping.cpp 2019-12-27 09:52:27 -03:00
Tulio Leao 05ef277cbd Remove LocationXY usage on openrct2-ui\windows\TopToolbar.cpp 2019-12-27 09:22:51 -03:00
Tulio Leao 3c3e179e7f Remove LocationXY usage on openrct2-ui\windows\RideConstruction.cpp 2019-12-27 09:22:51 -03:00
ζeh Matt 518780c3e8
Merge pull request #10422 from ZehMatt/refactor/gCommandExpenditure
Refactor out gCommandExpenditureType
2019-12-25 01:49:46 +01:00
Gymnasiast 62fcbb07ca
Rename methods to GetBaseZ/GetClearanceZ 2019-12-23 20:08:37 +01:00
Gymnasiast 85ecb52e7c
Manually replace more Z occurrences 2019-12-23 20:05:26 +01:00
Gymnasiast 7d11858dbe
Create getter for GetBaseHeight()/GetClearanceHeight() 2019-12-23 20:05:24 +01:00
Tulio Leao a2c7ecc6e5 Make Map::map_get_first_element_at() use CoordsXY (#10413)
* Make Map::map_get_first_element_at() use CoordsXY

* Fix clang-format on ClearAction.hpp

* Prefer TileDIrectionDelta over hardcoded delta on RideConstruction

* Use named Direction constants

* Make Compat::map_get_first_element_at() use CoordsXY
2019-12-23 07:35:41 +00:00
Matt 52ee9c6896
Use enum class for ExpenditureType 2019-12-22 20:51:55 +01:00
Matt 79acb6a073
Move staff wage data to Staff.cpp/h 2019-12-22 20:51:55 +01:00
Duncan e61401e48c Fix #10410: Tile Inspector does not hightlight tile correctly
Mistake made when refactoring not passing the error up through the chain and silently working.
2019-12-22 13:59:24 +01:00
Tulio Leao 0416c2eaa3 Merge pull request #10427 from tupaschoal/fix-10426
Fix #10426: Deleting path moves preview in opposite direction
2019-12-22 12:45:23 +00:00
Tulio Leao 461095ab6c Fix #10417: Ride preview incorrectly centered 2019-12-22 01:48:28 -03:00
Michael Steenbeek 30b03d998c
Merge pull request #10409 from tupaschoal/coords-for-set-tile-elements
Make Map::map_set_tile_elements() use TileCoordsXY
2019-12-21 19:12:51 +01:00
Michael Steenbeek fb2f907414
Merge pull request #10363 from duncanspumpkin/refactor
Refactor to reduce LocationXY usage
2019-12-21 16:24:24 +01:00
Michael Steenbeek c2565bfe1c
Merge pull request #10407 from duncanspumpkin/refactor_stations
Fixing COORDS_NULL: Refactor stations
2019-12-21 16:13:48 +01:00
Michael Steenbeek ef4e494532
Merge pull request #10412 from Gymnasiast/refactor/lesslocationxy
Remove MakeXY16
2019-12-21 15:34:40 +01:00
Tulio Leao 5fcfc6af00 Rename map_set_tile_elements to singular 2019-12-21 10:28:52 -03:00
Tulio Leao d7efe4de90 Make Map::map_set_tile_elements() use TileCoordsXY 2019-12-21 10:28:33 -03:00
Duncan 228205a199 Fix crash in dev builds due to sign issues (#10405) 2019-12-21 14:08:57 +01:00
Gymnasiast dcc720c1ec
Remove MakeXY16() 2019-12-21 13:51:59 +01:00
duncanspumpkin 521e5db4c2 Make constant values more explicit.
Fix mistake in z coordinate conversion
2019-12-21 12:22:59 +00:00
duncanspumpkin f346e439fc Change type of map selection a and b 2019-12-21 12:18:34 +00:00
duncanspumpkin 1f80dee4df Refactor footpath.cpp to remove LocationXY and use CoordsXY 2019-12-21 12:18:34 +00:00
duncanspumpkin 6b72b0992d Removal of LocationXY and simplify 2019-12-21 12:18:34 +00:00
duncanspumpkin 45403ac2d3 Move station_starts to TileCoordsXY 2019-12-21 11:48:13 +00:00
Michael Steenbeek a2b9598341
Modify code using Location8 to use isNull()/setNull() (#10403) 2019-12-21 11:34:46 +01:00
Duncan 3be7d824ac
Merge pull request #10397 from duncanspumpkin/refactor_gcommand
Remove gCommandPosition. Use GameActionRes instead.
2019-12-19 20:48:20 +00:00
Tulio Leao 918624e090 Fix #10396: Function returning TileCoordsXYZD'z coord in a CoordsXYZD object (#10398) 2019-12-19 15:41:22 +01:00
Tulio Leao 7c75db2b2d Make map_get_surface_element_at only accept Coords objects 2019-12-18 23:46:50 -03:00
Duncan 099404b505
Merge pull request #10381 from tupaschoal/cursorsate-store-coords
Make CursorState store a ScreenCoordsXY object
2019-12-18 20:10:51 +00:00
Tulio Leao 8613edee4a Use ScreenCoordsXY::operator- to improve readability 2019-12-17 23:33:07 -03:00
Tulio Leao 972a8735e8 Fix arithmetic error in Scenery::window_scenery_update() 2019-12-17 23:32:34 -03:00
Tulio Leao 6b06b2c578 Use ScreenCoordsXY for Mouse Drag storage (#10380) 2019-12-17 18:38:20 +01:00
duncanspumpkin 2eab8c3784 Fix formatting and declaration 2019-12-15 08:23:21 +00:00
duncanspumpkin 63b8f83f4f Make suggested changes 2019-12-15 08:23:21 +00:00
duncanspumpkin 073e75a7bd Remove extra line break 2019-12-15 08:23:21 +00:00
duncanspumpkin d97bb88c41 Reduce desyncs by removing teh track before updating peep logic 2019-12-15 08:21:32 +00:00
duncanspumpkin cfb4bba721 Remove todo and clang format where required
Change array type to avoid additional code

Make CI's happier
2019-12-15 08:21:32 +00:00
duncanspumpkin d8b5060eb9 Remove dead game command code.
Refactor of z increment
2019-12-15 08:21:32 +00:00
duncanspumpkin fa3332f47a Fix ghost desync and rotation issue
Fix callback by reworking placement code
2019-12-15 08:21:32 +00:00
duncanspumpkin 83503f4c69 Serialise track design. Start work on making it work
Fix track designs issuing extra game actions
2019-12-15 08:21:32 +00:00
duncanspumpkin c781fcb72d Start moving track design into a game action
Make place track design work with game actions
2019-12-15 08:21:32 +00:00
Tulio Leao 2cd3add373 Make CursorState store a ScreenCoordsXY object 2019-12-14 23:30:55 -03:00
Tulio Leao af7b364946 Prefer map_is_location_valid over hardcoded map limits (#10373) 2019-12-14 22:50:34 +01:00
Abd Narane 1ace96ccc4 Add shortcuts for changing the scaling value. (#10341)
Fixes #10305
2019-12-13 17:31:23 +01:00
Duncan fed417da03
Merge pull request #10356 from duncanspumpkin/label_var
Change the label on known var to reflect use.
2019-12-11 18:14:07 +00:00
Duncan 90bde58852
Merge pull request #10329 from tupaschoal/coords-for-windows-rotate
Use CoordsXY on TopToolbar and TrackDesignPlace rotations
2019-12-11 08:44:06 +00:00
Tulio Leao 68e0519c5e Remove Map::map_offset_with_rotation() 2019-12-09 17:55:57 -03:00
Tulio Leao 01c62437b2 Remove Ride::ride_get_rotated_coords() 2019-12-09 16:52:47 -03:00
Tulio Leao accb4ea691 Use CoordsXY on TopToolbar and TrackDesignPlace rotations 2019-12-04 22:07:11 -03:00
Tulio Leao 6f0ebfea27 Use CoordsXY and ScreenCoordsXY for rotate in Ride*.* 2019-12-04 08:02:09 -03:00
Tulio Leao 1532ee2b23 Create CoordsXY::ToTileStart() and CoordsXY::ToTileCentre() 2019-11-30 16:47:23 +01:00
Tulio Leao 4537c061d9 Prefer std::optional over LOCATION_NULL on Viewport (#10297) 2019-11-29 17:17:01 +01:00
Tulio Leao 47935288d0 Remove raw coordinates overload of get_map_coordinates_from_pos 2019-11-25 17:45:02 -03:00
Duncan 966ba6b018
Merge pull request #10269 from duncanspumpkin/centre_2d
Refactor centre_2d_coordinates to use screenCoords.
2019-11-24 14:28:18 +00:00
Duncan 81566a5e90
Merge pull request #10276 from tupaschoal/viewport-inter
Use ScreenCoordsXY on viewport interactions
2019-11-24 14:27:58 +00:00
Tulio Leao 831050745c Fix #10275: Track element preview incorrect 2019-11-22 12:10:47 +01:00
Tulio Leao c91bdadb47 Use ScreenCoordsXY on viewport interactions 2019-11-21 17:53:28 -03:00
Tulio Leao 7f74e01669
Add braces to fix return on null Coords 2019-11-21 09:22:09 -03:00
Tulio Leao a9c2e1229a Propagate error upward with LOCATION_NULL 2019-11-21 08:00:06 -03:00
duncanspumpkin d4c15cd774 Refactor centre_2d_coordinates to use screenCoords. 2019-11-20 18:44:03 +00:00
Tulio Leao f94970b059 Use CoordsXY/ScreenCoordsXY for viewport*_with_z
Closes #10268
2019-11-19 18:33:40 -03:00
Duncan 463ef9d218
Merge pull request #10238 from duncanspumpkin/viewport_get_xy_z
Refactor screen_get_map_xy_with_z to use CoordsXY structs
2019-11-19 15:02:50 +00:00
Tulio Leao 7718d83b21 Simplify assignment in RideConstruction.cpp (#10266) 2019-11-19 16:01:22 +01:00
duncanspumpkin 1d6a923298 Refactor screen_get_map_xy_with_z to use CoordsXY structs 2019-11-19 11:20:58 +00:00
Duncan c04cb0b94b
Merge pull request #10254 from tupaschoal/coords-for-ride-construction
Coords for ride construction
2019-11-19 11:12:51 +00:00
Tulio Leao 2acdc577f7 Use Coords for windows/RideConstruction 2019-11-18 19:17:54 -03:00
Tulio Leao 9fa355cb8c Make window_event_list use Coords for moved and cursor (#10258) 2019-11-18 23:13:32 +01:00
Tulio Leao 72b4d93ad2 Avoid dereferencing map_get_surface_element_at nullptr on libopenrct2 2019-11-18 08:01:04 -03:00
Tulio Leao 93083780df Use ScreenCoordsXY for windows/Map (#10233)
* Use ScreenCoordsXY for windows/Footpath

- Refactor `place_park_entrance_get_map_position()` to receive `ScreenCoordsXY` and return `CoordsXYZD`
- Refactor `sub_68A15E()` to receive `ScreenCoordsXY` and return `CoordsXY`. Some of its usage are narrowing the result on purpose, as same variable is used for contexts where `int16_t` is still a hard requirement.

* Properly increment for big Z and use LOCATION_NULL
2019-11-14 23:09:27 +01:00
duncanspumpkin e4ee91f5ff Refactor get_map_coordiantes to enforce Coords struct 2019-11-14 20:28:54 +00:00
Duncan d6bb101f8d
Merge pull request #10237 from tupaschoal/screencoords-for-mouse-functions
Use ScreenCoordsXY for scroll_mouse* functions
2019-11-14 20:24:06 +00:00
Tulio Leao cc12dbf238
Fix tile_element_height to use mapCoords instead of screenCoords 2019-11-14 10:50:10 -03:00
Duncan a80566027a
Merge pull request #10236 from tupaschoal/coords-for-tile-inspector
Use more ScreenCoordsXY on windows/TileInspector.cpp
2019-11-14 12:52:00 +00:00
Duncan 38db42ac22
Merge pull request #10235 from tupaschoal/coords-for-landrights
Use ScreenCoordsXY on windows/LandRights.cpp
2019-11-14 12:43:17 +00:00
Duncan 3f7a4a9f42
Merge pull request #10229 from tupaschoal/refactor_ride_get_entrance_or_exit
Refactor ride_get_entrance_or_exit_position_from_screen_position()
2019-11-14 12:42:38 +00:00
Tulio Leao fe3d6f6faf Use ScreenCoordsXY for scroll_mouse* functions 2019-11-14 08:40:40 -03:00
Tulio Leao a5492acdec Use more ScreenCoordsXY on windows/TileInspector.cpp 2019-11-14 08:05:07 -03:00
Tulio Leao 5ca54758ae Use ScreenCoordsXY on windows/LandRights.cpp 2019-11-14 07:58:54 -03:00
Tulio Leao 7e65aeaea3 Fix issues in code review
Implement operator== and operator!= for CoordsXYZD
Set location to null before returning from ride_get_entrance_or_exit_position_from_screen_position
2019-11-13 18:46:02 -03:00
Tulio Leao 47387690f5 Improve coords assignments 2019-11-13 18:28:03 -03:00
Tulio Leao 054bc8e4ca Receive ScreenCoordsXY and return CoordsXY in Viewport 2019-11-13 18:27:59 -03:00
Duncan dde6ee93e0
Merge pull request #10220 from tupaschoal/coords-for-footpath
Use ScreenCoordsXY for windows/Footpath
2019-11-13 18:41:37 +00:00
Tulio Leao 5dfe373061 Refactor ride_get_entrance_or_exit_position_from_screen_position() 2019-11-13 09:41:58 -03:00
Tulio Leao 0fc6da2443 Use ScreenCoordsXY for MazeConstruction (#10222) 2019-11-13 11:54:55 +01:00
Tulio Leao 5e888747de Use mapCoords instead of ScreenCoords 2019-11-12 20:13:14 -03:00
Tulio Leao 3fa4b7b964 Fix clang-format 2019-11-12 00:27:59 -03:00
Tulio Leao 892c084cd8 Use ScreenCoordsXY for windows/Footpath 2019-11-11 23:10:51 -03:00
Tom Lankhorst 027c09553b Reformat code with clang-format 8.0. 2019-11-04 15:11:06 +01:00
Tulio Leao 9776a0843d Make Viewport::screen_to_map_pos() return coords (#10171)
* Make Viewport::screen_to_map_pos() return coords

* Fix clang-format

* Update src/openrct2-ui/windows/TileInspector.cpp

* Update src/openrct2-ui/windows/TileInspector.cpp

* Apply suggestions from code review
2019-11-02 08:04:46 +00:00
Duncan 219046af14
Merge pull request #10136 from tupaschoal/constexpr-for-openrct2ui-define
Use constexpr on openrct2-ui/*
2019-10-30 06:44:11 +00:00
Duncan 3362cbc366
Merge pull request #10131 from tupaschoal/screencoords-for-tool-functions
Use ScreenCoordsXY for tool_* functions
2019-10-30 06:29:07 +00:00
Tulio Leao afc14183e7 Use ScreenCoordsXY for tool_* functions 2019-10-29 19:02:58 -03:00
Tulio Leao d1cec43065 Use constexpr on openrct2-ui/* 2019-10-29 18:48:04 -03:00
Tulio Leao d9efd64fea Use ScreenCoordsXY for interface\Widget.h (#10123) 2019-10-29 17:41:19 +01:00
Hielke Morsink 78c550351d Properly fix usage of station index string (#10141)
This basically reverts the change in en-GB.txt from #10077 and fixes the usage of this string where it was broken.
2019-10-29 17:35:36 +01:00
Tulio Leao 5f916b79ae Use ScreenCoordsXY for MouseInput (#10120) 2019-10-20 19:10:30 +02:00
Matt 477347b6d4
Implement 'Remove Ducks' cheat 2019-10-20 00:21:18 +02:00
Matt 7fa41bb82d
Implement 'Create Ducks' cheat 2019-10-20 00:21:18 +02:00
Hielke Morsink 2e090493f2 Use white colour for labels in Tile Inspector (#10076)
The DARK_GREEN colour comes from the days of hardcoded numbers, where it was most likely copied from somewhere else.
2019-10-19 18:12:00 +02:00
Tulio Leao dbb66dd028 Remove duplicate functions (#10067)
* Reduce code duplication in src\openrct2\interface\Window.cpp

`window_resize_gui_scenario_editor` was a subset of `window_resize_gui`

* Reduce code duplication in src\openrct2\network\Twitch.cpp

Both `GetFollowers()` and `GetMessage()` were very similar

* Reduce code duplication in src/openrct2/world/SmallScenery.cpp

`map_place_non_scenery_clear_func` and `map_place_scenery_clear_func` did basically the same thing, with a single branch difference

* Reduce code duplication in src/openrct2-ui/windows/TopToolbar.cpp

Make `top_toolbar_tool_update_scenery_clear` call `top_toolbar_tool_update_land_paint` and then do the additional differing calculation it did.
2019-10-19 15:38:26 +02:00
Duncan 9ad15e398b
Merge pull request #10091 from tupaschoal/nullprt-deref-avoid-get_first_at
Avoid dereferencing invalid map_get_first_element_at return
2019-10-19 13:55:54 +02:00
Tulio Leao ce1f38da25 Use ScreenCoordsXY for window functions (#10086)
* Use ScreenCoordsXY for window_create function

* Use ScreenCoordsXY for window_find_from_point function

* Use ScreenCoordsXY for window_find_widget_from_point

* Use ScreenCoordsXY for ride_contruction_tool*

* Use ScreenCoordsXY for window_event_tool*

* Use ScreenCoordsXY for window_event_scroll_mouse*

* Use ScreenCoordsXY for remaining window_event*

* Use ScreenCoordsXY for window_(set|move)_position
2019-10-19 13:07:03 +02:00
Tulio Leao 35577f5b19 Avoid dereferencing invalid map_get_first_element_at return 2019-10-19 07:54:31 -03:00
Duncan c3e14328f1
Little Refactor (#10075)
* Correct the label for track elem 255.

* Catch last little change
2019-10-19 10:00:42 +02:00
Tulio Leao 2159fd282b Use ScreenCoordsXY for Window functions (#10083) 2019-10-18 17:44:26 +02:00
Denis Khabenkov 57a208d560 Fix #10064: Refactor TrackDesignEntranceElement (#10066)
* Fix #10064: Refactor TrackDesignEntranceElement
2019-10-10 18:23:29 +01:00
duncanspumpkin 213ba15ba5 Remove unused code and variables from function 2019-10-07 18:36:27 +01:00
duncanspumpkin f10e4dc6b9 Remove unused variables from function call 2019-10-07 18:33:51 +01:00
Michael Steenbeek a11762b11a
Remove old C functions that only call their equivalent
* Remove old C functions that only call their equivalent

* fix formatting
2019-09-22 14:12:49 +02:00
Ted John fc679c9105 Fix #9956: invalid-read in window_ride_main_open 2019-09-08 13:55:02 +01:00
Ted John 7b7d3ec5e3 Fix #9971: invalid-read in place_virtual_track 2019-09-08 13:45:56 +01:00
Michał Janiszewski 8637eb6c57
Rename some bits to allow unity builds of libopenrct2 (#9944)
* Rename some bits to allow unity builds of libopenrct2

Some names are clashing when doing a unity build, renaming them solves
the problem.
2019-08-29 23:03:56 +02:00
Gymnasiast f365bc3cb7
Create getters and setters for occupied quadrant 2019-08-27 21:12:48 +02:00
Gymnasiast ec5ba20992
Create dedicated method for SetLastForTile() 2019-08-25 16:13:02 +02:00
Gymnasiast 6e200459d3
Refactor some accessors to tile element type and flags fields 2019-08-24 22:42:47 +02:00
Michael Steenbeek e11f2d965a
Merge pull request #9437 from Gymnasiast/nog-eens-research
Move research to vectors
2019-08-24 10:45:58 +02:00
Michael Steenbeek 7270a86eb7
Fix #9924: Traffic light in Ride List shows incorrect status (#9931) 2019-08-24 10:45:39 +02:00
Ted John ae8c93ca2b
Fix research list UI / dragging 2019-08-23 22:41:50 +02:00
Gymnasiast abe721b308
Fix rebase errors and formatting 2019-08-23 22:41:50 +02:00
Gymnasiast 984fd5e58a
Make EditorInventionsList a bit less buggy 2019-08-23 22:41:50 +02:00
Gymnasiast 9de2819cef
Process feedback from code review 2019-08-23 22:41:50 +02:00
Gymnasiast 1265913bdb
Fix dragging crash and some bugs 2019-08-23 22:41:43 +02:00
Gymnasiast 5ce3d4b947
Use new iterator syntax in more places 2019-08-23 22:41:43 +02:00
Gymnasiast b1fb75e496
Move everything to research vectors 2019-08-23 22:41:43 +02:00
Gymnasiast c3fdb728d1
Rename rct_research_item to ResearchItem 2019-08-23 22:41:43 +02:00
Michael Steenbeek 4cf1d1eb69
Fix #9905: Ride type dropdown shows wrong text (#9923) 2019-08-22 23:46:15 +02:00
Duncan 2f8dccbba2
Merge pull request #9867 from duncanspumpkin/refactor_map
Refactor map
2019-08-20 18:22:24 +01:00
duncanspumpkin f39905bd2e Clang format 2019-08-19 20:04:59 +01:00
duncanspumpkin b77f15c4b7 Refactor map_get_highest_z to use CoordsXY 2019-08-19 20:04:59 +01:00
duncanspumpkin 5fe5f8e964 Refactor audio_play_sound_at_location to use CoordsXYZ 2019-08-19 20:04:58 +01:00
duncanspumpkin c6452095ca Refactor tile_element_height to use CoordsXY 2019-08-19 20:04:57 +01:00
duncanspumpkin 5333dc4295 Return a SurfaceElement from get_surface_element 2019-08-19 20:04:56 +01:00
Gymnasiast 4c684031bf
Remove game command remnant in Tile Inspector 2019-08-19 20:38:48 +02:00
Gymnasiast 255ce3f62b
Extend tile element size to 16 bytes 2019-08-18 14:03:36 +02:00
Ted John 634b254447 Print the URL of the object that it is downloading 2019-08-13 22:38:21 +01:00
Ted John 8f917a2590 Show the object download source when downloading object files 2019-08-13 18:32:32 +01:00
Ted John ec55eb6374 Fix #9863: Excitement/Intensity factors of cars overflow 2019-08-12 17:54:12 +01:00
Matt cc6321048f
Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02:00
Matt 2053ecb688
Refactor window_scroll_to_viewport to use rct_window::ScrollToViewport 2019-08-11 17:22:00 +02:00
duncanspumpkin af31404472 Use std::string and cleanup unused functions
Use CoordsXY for save pop scenery functions

Use CoordsXY for push save scenery functions

Further refactoring to use coordsxy and standard functions
2019-08-09 20:43:03 +01:00
duncanspumpkin e9b59064e0 Fix code and clang format. Delete dead code.
Use correct TD4 checksum for vanilla TD4's.

Simplified the code for version detection since checksum numbers do not match up to a version

Fix TD4 imports.

Oh yeah TD4 doesn't have scenery or entrances

Move track related structs to correct files
2019-08-09 20:43:02 +01:00
duncanspumpkin 54d6722bf2 Link everything together 2019-08-09 20:40:35 +01:00
duncanspumpkin af92dcba3e Creating t6 exporter 2019-08-09 20:39:54 +01:00
duncanspumpkin e3c63b762e Create new TrackDesign format 2019-08-09 20:39:53 +01:00
Ted John 60060480c2 Fix #9826: NRE in ride_construct 2019-08-09 18:29:34 +01:00
Ted John 9954f0b725
Add nullptr checks for more instances of get_ride (#9819) 2019-08-09 14:20:59 +01:00
Ted John 93789b9034
Add nullptr checks for get_ride in libopenrct2ui (#9795) 2019-08-09 08:06:25 +01:00
Ted John f7c86debe3 Fix #9767: NRE in window_tile_inspector_paint 2019-08-08 12:42:09 +01:00
Ted John 746d784b0e Fix placing track designs when ride 0 is not allocated 2019-08-07 21:25:28 +01:00
Ted John cd4eb86a7c
Merge pull request #9725 from IntelOrca/refactor/ride-manager
Refactor ride list
2019-08-07 21:03:17 +01:00
Matt aaeb64888f
Do not pause the game during save/load prompt in networked mode 2019-08-06 18:01:31 +02:00
0cufox0 b4e0df2e5f Fix review issues and formatting 2019-08-05 20:19:57 +01:00
0cufox0 8e33619b63 Refactor LargeSceneryRemoveAction 2019-08-05 20:18:01 +01:00
0cufox0 2311501de1 Refactor RideSetColourSchemeAction 2019-08-05 20:18:01 +01:00
0cufox0 5cd8541a1c Refactor smalSceneryRemoveAction 2019-08-05 20:17:57 +01:00
0cufox0 0320f195e3 refactor wallRemoveAction 2019-08-05 19:52:47 +01:00
Ted John f49447bed5 Fix compile errors 2019-08-04 17:47:16 +01:00
Ted John a863c7ae50 Remove rest of FOR_ALL_RIDES instances 2019-08-04 16:44:17 +01:00
Ted John e23638548a Reduce use of MAX_RIDES and RIDE_TYPE_NULL 2019-08-04 16:44:17 +01:00
Ted John 414b53b56d Remove ride classifications 2019-08-04 16:43:50 +01:00
Ted John a3fe00f0a3 Refactor ride list to a manager with iterator 2019-08-04 16:43:50 +01:00
Ted John 1a6e5b5548 Fix #9680: invalid-read in ride_entry_get_supported_track_pieces (#9681) 2019-08-03 19:55:24 +02:00
Ted John a5365b38b3 Fix #9502: Unhandled exception when object download fails (#9696) 2019-08-01 14:51:52 +02:00
Jim Armstrong 6458514361 Fix #9491: Access violation in window_ride_init_viewport 2019-08-01 11:11:59 +02:00
Ted John 26db91f023 Fix ride list, status 2019-07-31 19:50:06 +01:00
Ted John 7287b8cf1a Fix formatting 2019-07-29 20:40:25 +01:00
Ted John d28799ef18 Remove user strings 2019-07-29 20:01:37 +01:00
Ted John 40d49b93d3 Do not use user strings for peep names 2019-07-29 19:18:16 +01:00
Ted John 61d64ab8c5 Do not use user strings for banners 2019-07-29 19:18:16 +01:00
Ted John 749b07e83f Use local variable for format arguments 2019-07-29 19:18:16 +01:00
Ted John 772475848b Fix formatting 2019-07-29 19:18:16 +01:00
Ted John eb4c9acb08 Fix compile errors and ride entry null edge case 2019-07-29 19:18:16 +01:00
Ted John f8b08b334e Fix a few more bugs 2019-07-29 19:18:16 +01:00
Ted John 3f45976009 Fix openrct2ui errors 2019-07-29 19:18:16 +01:00
Ted John 3155c661fa Refactor format peep action 2019-07-29 19:18:16 +01:00
Ted John 6fff2079f9 Refactor ride name to dynamic args and std::string 2019-07-29 19:18:16 +01:00
Aaron van Geffen 5066ebebf9
Fix #9574: Text overflow in scenario objective window. 2019-07-29 15:16:36 +02:00
Michael Steenbeek 382935c50f
Merge pull request #9644 from IntelOrca/refactor/banners
Refactor banners
2019-07-27 10:59:57 +02:00
Ted John 0b4d989a67 Rename get_banner to GetBanner 2019-07-26 17:24:19 +01:00
Ted John 3bff25ab22 Use TileCoordsXY 2019-07-26 17:14:09 +01:00
Duncan 75e0757ee9
Merge pull request #9632 from ZehMatt/fix-9625
Fix #9625: Show correct cost in scenery selection
2019-07-26 07:12:57 +01:00
Ted John 5c07c53faf Refactor get banner 2019-07-25 22:21:19 +01:00
Ted John 85543bd1c8 Separate RCT2 and OpenRCT2 banner struct 2019-07-25 22:21:19 +01:00
Matt 98a17fe8d9
Refactor create_sprite and remove unnecessary move_sprite_to_list 2019-07-24 17:53:51 +02:00
Ted John 83b1d1f72e
Merge pull request #9629 from IntelOrca/fix/utf8-support-windows
Fix UTF-8 support on Windows
2019-07-23 22:15:56 +01:00
Ted John 7a2a5a7924 Fix #9626: Crash when navigating to price tab on park window (#9634)
The park name argument was being overwritten by the price argument in the argument buffer. Draw price text in paint event instead.
2019-07-23 21:47:53 +02:00
Matt 126226dbe3
Fix #9625: Show correct cost in scenery selection 2019-07-23 18:03:26 +02:00
Ted John a1d9e52046 Rename ToUtf16 to ToWideChar
This is more correct as wchar_t size can differ, for example Linux typically uses 32 bits for wchar_t where as Windows uses 16 bits.
2019-07-22 23:44:03 +01:00
Duncan ab5f5b20cd
Use enum class for RCT2_SOUND (#9618)
* Use enum class for RCT2_SOUND

* Fix formatting. Fix mistaken declaration.

* Change name of enum to SoundId

* Fix clang format
2019-07-22 19:02:45 +01:00
Hielke Morsink 2792ddfe80 Tile Inspector: Use correct names for up/down buttons
This little mistake has been around for years and is most likely caused
by reordering the buttons. They used to be side-to-side, but their names
were never changed, and since the order of tile elements is reversed I
never noticed it was wrong.
2019-07-21 11:34:50 +02:00
Ted John 5733d666b3 Do not store park name as a user string 2019-07-21 11:33:15 +02:00
Peter e7b051c32c
Update src/openrct2-ui/windows/TitleScenarioSelect.cpp
Co-Authored-By: Aaron van Geffen <aaron@aaronweb.net>
2019-06-21 19:01:14 -04:00
Spongeloaf 5777074a3e #9285 Add feature to remember scernario tab 2019-06-21 12:54:49 -04:00
duncanspumpkin b896f07687 Add PeepPickupAction
Move Guest and Staff pickup to the new game action. Rework the game
action so that only one game action is required for the two game
commands. Remove the final game command with a callback.
2019-06-20 19:34:02 +01:00
duncanspumpkin ecbff5d4f2 Refactor to use CoordsXY 2019-06-20 18:53:30 +01:00
duncanspumpkin 2a60268c05 Fix #9440. Set the tile coordinate correctly with spinner. 2019-06-20 18:52:40 +01:00
duncanspumpkin 96ec0123ca Refactor and clean up for CI's. 2019-06-11 18:43:23 +01:00
duncanspumpkin 3162d4dc75 Implement TileModifyAction
Further work moving game commands into the game action framework
2019-06-11 18:42:52 +01:00
Peter dd948f99c4 #9295 Refactor rct_vehcile->status to rct_vehicle::SetState() (#9329)
Fix #9295. Refactor rct_vehicle->status to rct_vehicle::SetState()

Created rct_vehicle::SetState() and refactored all assignments to
rct_vehcile->status. SetState also includes a call to
vehicle_invalidate_window(), so it cannot be forgotten.
2019-06-09 15:45:56 +01:00
Ted John 6f0298deb3 Refactor ride measurement storage 2019-06-09 11:55:41 +02:00
Rikard Falkeborn 7478e13e61 Add suffix constant to avoid shifting too many bits (#9389)
Since WIDX_SCENERY_BUILD_CLUSTER_BUTTON is 31, add suffix ULL to
avoid shifting 1 (which is an int and 4 bytes on most systems) 31 bits
which is technically undefined behaviour. This is already done in the
shift at line 463.

Detected by the help of cppcheck.
2019-06-09 11:35:42 +02:00
Hielke Morsink 5418eb6e34 Add transparency setting to options window 2019-06-09 11:03:01 +02:00
Duncan 993709c087
Merge pull request #9321 from aw20368/fix/8723-use-rotate_map_coordinates
Fix #8723 Use rotate_map_coordinates to rotate coordinate
2019-06-08 07:52:52 +01:00
aw20368 e0cf476398 Fix #8723 Use rotate_map_coordinates to rotate coordinate
Added Rotate to CoordsXY, TileCoordsXY and used them to replace redundant rotation code.
2019-06-06 08:21:40 -04:00
Aaron van Geffen f1ac847fce
Merge pull request #9222 from IntelOrca/implement/485-ghost-train-simulation
Implement #485: ghost train simulation
2019-06-04 20:24:16 +02:00
aw20368 02ef545f1b Fix #9314: Trying to delete ride piece while paused moves the selection (#9332)
Failed track removal was triggering a move to the next piece. Changed to move only upon successful removal.
2019-05-30 20:51:56 +02:00
Aaron van Geffen d1f48fab53 Add RCT1 traffic light sprites for ride simulate status. 2019-05-28 16:50:38 +01:00
Aaron van Geffen bab7711c5b Add new simulate icon. 2019-05-28 16:50:38 +01:00
Ted John 26185b9e72 Change simulate to toggle button 2019-05-28 16:50:38 +01:00
Ted John 5ef0730008 Remove simulate from ride window 2019-05-28 16:50:38 +01:00
Ted John 5289113c95 Add simulate button to ride construction window 2019-05-28 16:50:38 +01:00
Ted John 5f1f428bce Add and use Ride::SupportsStatus 2019-05-28 16:50:08 +01:00
Ted John fec6d660c6 Remove obsolete configs:
- no crashes
- test unfinished track
2019-05-28 16:50:08 +01:00
Ted John c4e18e570e Add and implement simulation mode for rides 2019-05-28 16:50:08 +01:00
nexgenration 46889b5381 Implement #9231: Add sprite_index to Guest Debug Tab 2019-05-27 22:39:03 +02:00
Ted John 7f2936b8fb Fix #7045: Theme window's colour pickers not drawn properly on OpenGL
Remove unnecessary transparent flag when drawing colour buttons.
2019-05-20 19:47:26 +01:00
Michael Steenbeek 1b11612e3c
Merge pull request #9259 from duncanspumpkin/scenario_set
Implement ScenarioSetSetting game action
2019-05-19 15:09:12 +02:00
nexgenration 6b232f7e53 Fix#9197: Peep insert new thought (#9230)
Improve the readability of the codebase by moving functions into the relevant structures.
- Change name of peep_insert_new_thought to InsertNewThought.
- Update InsertNewThought definition to Guest::InsertNewThought.
2019-05-18 09:47:25 +01:00
Michał Janiszewski bbcc69270d Ensure finances window's months don't overflow (#8686)
Some functions (e.g. window_finances_summary_scrollpaint) will try using
the returned index, which makes it overflow.
2019-05-15 21:09:01 +02:00
Greg Hennis 1fcedae3bc Fix #9258: Rename SPRITE_LIST_NULL to ..._FREE (#9260) 2019-05-15 19:07:01 +02:00
duncanspumpkin 3ac596faf1 Implement ScenarioSetSetting game action
Further work moving game commands into the game action framework to improve design.
2019-05-14 21:46:27 +01:00
Michael Steenbeek c9cbe391eb
Merge pull request #8427 from Mikroscopic/minimap-fix
Fix #8385: Ghost objects rendered in minimap
2019-05-14 22:38:26 +02:00
Michael Steenbeek abc13422ed
Fix #9132: System file browser cannot open SV4 files 2019-05-14 22:12:23 +02:00
duncanspumpkin 0b7d7027e1 Fix formatting 2019-05-14 21:58:55 +02:00
duncanspumpkin 1eb7f4d8c6 Implement Modify Group and Kick Player Actions.
Further work on the Game Actions porting
2019-05-14 21:58:55 +02:00
joshtucker132 4dc77bf121 Feature #8791: Improved tile element flag manipulation in Tile Inspector 2019-05-14 21:38:31 +02:00
duncanspumpkin b9a70d02a3 Make suggested changes
Implement suggestions

Fix formatting
2019-05-12 17:31:48 +01:00
duncanspumpkin e9e445837f Add landset/buyrights action 2019-05-12 17:29:19 +01:00
Ted John 1ac8d9058f Colour local servers as green 2019-05-12 01:05:11 +01:00
Ted John 3334d40da4 Explicitly use std::launch::async 2019-05-12 00:51:33 +01:00
Ted John 52afcb795f Fix windows build 2019-05-12 00:51:33 +01:00
Ted John 47f48721e8 Fix clang build 2019-05-12 00:51:33 +01:00
Ted John 4b0f2bbceb Fix disable network / disable http builds 2019-05-12 00:51:33 +01:00
Ted John 20f52a8cbe Refactor TcpSocket and UdpSocket 2019-05-12 00:51:33 +01:00
Ted John 51117432f0 Improve status messages and prevent duplicates 2019-05-12 00:51:33 +01:00
Ted John 3a400a2471 Refactor server list 2019-05-12 00:51:33 +01:00
Ted John 4437113805 Fix server list LAN address and port 2019-05-12 00:51:33 +01:00
Ted John 7a20874366 Fix Windows build 2019-05-12 00:51:33 +01:00
Ted John 123a8eacad Get the server list showing LAN servers 2019-05-12 00:51:33 +01:00
Ted John 694cb7eb3f Implement UDP socket and broadcasting 2019-05-12 00:50:13 +01:00
Hielke Morsink b51f6a4d90 Use case-insensitive compare for soring ride and vehicle types (#9229) 2019-05-11 12:06:29 +01:00
Filip Gawin 6833da77e3 Simplify boolean expresions 2019-05-10 22:00:38 +02:00
Ted John 710da039a4 Show ghost elements as white on mini-map
Also fixes refresh of map when using OpenGL drawing engine
2019-05-08 21:37:33 +01:00
Mikroscopic 80a9cf8670 Fix ghost objects rendering on minimap 2019-05-08 21:36:31 +01:00
Ted John 0d0479f9b1
Merge pull request #8558 from richard-fine/feature/peep-inspector
Peep debug tab
2019-05-06 20:29:29 +01:00
Ted John a22f0a53fb Use localised strings for guest debug tab 2019-05-04 21:48:02 +00:00
Ted John f50695fc9b Refactor guest window resize 2019-05-04 16:23:29 +00:00
Ted John a90a86562d Refactor guest widget lists 2019-05-04 15:01:51 +00:00
Ted John 7c2708746e Re-draw debug tab every tick 2019-05-04 14:53:25 +00:00
Ted John c13bd04954 Refactor invalidate methods 2019-05-04 14:40:45 +00:00
Ted John 1d296242b4 Improve text colour 2019-05-04 14:09:15 +00:00
Ted John b4a2a94520 Fix build 2019-05-04 14:08:37 +00:00
Richard Fine 480f19c0c6 Add parens to fix operator precedence issue
I missed one... thankfully the CI did not.
2019-05-04 14:08:37 +00:00
Richard Fine 9bb68a7151 Pull window width into temporary variable
As suggested in review, it's a little easier to read this way.
2019-05-04 14:08:37 +00:00
Richard Fine b714f7b0e2 Use constexpr instead of const
For a static constant integer value, it's stylistically clearer to use constexpr instead of const. The resulting variable is implicitly const, but is also guaranteed to have a compile-time-computable value.
2019-05-04 14:08:37 +00:00
Richard Fine 97bcc53637 Eliminate itoa and use correct format specifiers
Use snprintf instead of _itoa as it's not available on all platforms. Also change the format specifies for unsigned variables to %u instead of %i, to be more correct...
2019-05-04 14:08:37 +00:00
Richard Fine 397b044588 Use safe_strcat instead of strcat_s
strcat_s is not available on all platforms, and we have a utility in the codebase that does basically the same thing already.
2019-05-04 14:08:37 +00:00
Richard Fine cfda3fb8f7 Use sizeof(buffer) instead of hardcoded size
Use sizeof(buffer) instead of repeating 4096 in a bunch of places. Also, 4096 was maybe a bit overkill, drop it down to 512 instead.
2019-05-04 14:08:37 +00:00
Richard Fine 8bf72ceadb More peep pathing info
Show more peep debug data in the Guest debug tab, mostly to help with understanding pathfinding behaviour.
2019-05-04 14:08:37 +00:00
Richard Fine 7300a38ce6 Show peep coordinates in debug tab
As a first debug stat to show, display a peep's current coordinates in the debug tab
2019-05-04 14:08:37 +00:00
Richard Fine 70c61d5ac6 Fix guest window width for debugging tab
Introduce a named constant for the width of a tab in the Guest window, and touch the places that set the window width to add it to the minimum window width when the debugging tab is enabled, so that the tab doesn't render off the side of the window.
2019-05-04 14:08:37 +00:00
Richard Fine 5ef07ab936 Formatting 2019-05-04 14:08:37 +00:00
Richard Fine fa63691d17 Disable guest debug tab when debug tools not turned on
Disable the debug tab in the guest window when the debugging tools are not turned on, causing it to be completely hidden from view.
2019-05-04 14:08:37 +00:00
Richard Fine c4a449f47d Add new debugging tab to the Guest window
Add a new tab to the Guest window which we can use to display debug information and tools for guests. At the moment it's blank and always visible; next step is to make it only show up when debugging tools are enabled.
2019-05-04 14:08:37 +00:00
ζeh Matt cd8c67ddac
Implement SetCheatAction. (#8990)
* Implement SetCheatAction.

* Bump up network version
2019-05-04 15:28:38 +02:00
Hielke Morsink 5e9e7bcbe5 Fix: artifacts when changing ride type as client or using the in-game console (#9202) 2019-05-04 10:31:10 +00:00
Aaron van Geffen f1b9c71524
Merge pull request #8687 from Xkeeper0/f/multiplayer-plus
Multiplayer dropdown additions
2019-05-02 22:53:50 +02:00
Duncan a6c2aed26d
Merge pull request #9059 from duncanspumpkin/banner_ga
Implement Banner Place/Remove Actions
2019-05-02 21:32:51 +01:00
duncanspumpkin d14637e1ca Fix narrowing and formatting 2019-05-02 17:47:01 +01:00
duncanspumpkin f6b610c325 Implement Banner Place/Remove Actions 2019-05-02 17:47:01 +01:00
Aaron van Geffen 57040c392c Change multiplayer toolbar image to framed globe, with pressed state. 2019-05-02 12:32:45 +02:00
Ted John f842d8a693 Fix #5103: OpenGL: ride track preview not rendered 2019-05-02 00:07:43 +00:00
Xkeeper 4a34d2a6da Disable "Reconnect" if not desynced. 2019-05-02 00:30:30 +02:00
Xkeeper c075eec224 Update sync icons, new multiplayer toolbar button
The multiplayer toolbar button is the same globe used for the
multiplayer option on the title screen, since it seems like
a nicer (and better?) looking option than the two riders.

Also conflicts less with the new sync icons.
2019-05-02 00:30:30 +02:00
Xkeeper 8c4de40239 Add graphics for desync notice 2019-05-02 00:29:25 +02:00
Xkeeper bc8ecd8e67 Add "Reconnect" option under the multiplayer button 2019-05-02 00:26:37 +02:00
Xkeeper d614fb4035 add network indicators for desync/player count 2019-05-02 00:22:03 +02:00
Aaron van Geffen df42cfe1e1
Change map toolbar icon with current rotation (#9154) 2019-05-02 00:07:20 +02:00
Duncan 1e1d263dae
PlayerSetGroupAction (#9072)
* First pass at action.

* Version 2. Do all the work in Network.cpp

* Mark game command as complete

* Make requested changes

* Increment of network version
2019-05-01 16:54:12 +01:00
Michael Steenbeek c8df801e66
Create ShopItemDescriptor 2019-04-26 20:25:11 +02:00
Michael Steenbeek 57201c12db
Merge pull request #9128 from Broxzier/feature/6116-tile-inspector-colour-scheme
Expose colour scheme in the tile inspector (#6116)
2019-04-24 19:42:12 +02:00
boucks b052c4ac61 Fix #9054: remove gSceneryTileElement by returning it within GameActi… (#9127)
* Fix #9054: remove gSceneryTileElement by returning it within GameActionResult

* fixing Clang-format issues

* fixing clang-format

lets try this again...

* fixing clang-format

alright should be good this time

* fixing clang-format issues

using automatic clang-formatting

* initializing tileElement
2019-04-24 09:42:00 +01:00
Hielke Morsink ac7bc97736 Expose colour scheme in the tile inspector (#6116) 2019-04-22 15:49:09 +02:00
Hielke Morsink d8f1933a5b Show dash for station index for non-station elements 2019-04-22 15:25:29 +02:00
Duncan 46844e2218
Merge branch 'develop' into issue-9053 2019-04-21 19:50:20 +01:00
Michael Steenbeek 5a906b2378
Port more functions to Ride struct (#9119) 2019-04-20 22:22:39 +02:00
Michael Steenbeek 42a1a8704d
Use empty() for vectors; clean up bool comparisons (#9118) 2019-04-20 20:39:47 +02:00
Liam Parker 82c73e18c7 Fix #9067 - Prices rendering in unlimited money game state 2019-04-20 18:10:15 +02:00
Trevor Harkness 844a28f3f5 Fix formatting and added to contributors.md
Adjusted formatting for CI tests
2019-04-19 02:18:55 -04:00
Trevor Harkness 8cb50432de Fix #9053. Remove instances of gSceneryGroundFlags
Created subclass of GameActionResult in LargeSceneryPlaceAction and SmallSceneryPlaceAction. Removed references to global variable in other files.
2019-04-17 22:55:37 -04:00
Florian Will 0d3f287447 Add changelog entry, minor code improvements 2019-04-15 19:11:30 +02:00
Florian Will eb6ea8e81d Fix #5893: Invalidate widget only if it's visible
Remove the widget_invalidate() call after changing a guest's
guest_heading_to_ride_id, because that call fails a debug assertion if
the guest window is open and the currently active tab is not the
"overview" tab. In Release builds (if assertion is disabled),
widget_invalidate() might access the widgets array out of bounds.

Instead, introduce a new flag PEEP_INVALIDATE_PEEP_ACTION for
window_invalidate_flags in the peep struct and set that flag. The guest
window update function then makes sure to invalidate the label if the
flag is set.

The flag could be used in other places to reduce libopenrct2 dependency
on window_*() calls (see #6808), but this commit only cares about cases
where the assertion would fail.
2019-04-15 14:26:33 +02:00
duncanspumpkin d6522f0aee Fix formatting 2019-04-08 17:19:52 +01:00
duncanspumpkin baad532c17 Fix formatting 2019-04-07 14:55:08 +01:00
duncanspumpkin 00cbd75641 Return more useful error messages.
Fix clearance checks always being on for underground placement
2019-04-07 14:55:08 +01:00
duncanspumpkin d63919c0cc Implement LargeSceneryPlaceAction 2019-04-07 14:55:07 +01:00
duncanspumpkin 008ed86bca Make requested fixes 2019-04-07 12:02:04 +01:00
duncanspumpkin aa65e25c6b Implement banner set style action 2019-04-07 10:10:36 +01:00
duncanspumpkin 3593366e95 Implement banner set colour action 2019-04-07 09:22:39 +01:00
duncanspumpkin 5ab42488a9 Implement large scenery set colour action 2019-04-07 09:22:33 +01:00
duncanspumpkin 8ef5afe2ce Implement wall set colour action 2019-04-06 19:39:01 +01:00
duncanspumpkin 8fc1d70239 Implement small scenery set colour action 2019-04-06 19:39:00 +01:00
duncanspumpkin 787993c117 Fix #9062. Pass the correct flag for ghosts. 2019-04-06 18:16:24 +01:00
duncanspumpkin 356a0e5e91 Rework flags 2019-04-04 19:23:44 +01:00