Commit Graph

55 Commits

Author SHA1 Message Date
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
Simon J d7b9a99a0f
Entrance/exit construction state fixes in ride and maze construction (#13098)
* Fix #1324: track selection visible when placing entrance or exit

* Improve maze construction window UX in entrance/exit mode

- Arrows are disabled when entrance and exit are being placed
- Clicking a construction mode will disable the entrance and exit mode
- Previous state restored when leaving entrance/exit construction mode
- Fix entrance/exit buttons not changing when the mode switches after placing the first entrance/exit

Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-10-11 12:22:41 +01:00
Matt 091145037e
Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +03:00
Aaron van Geffen d27e14f45b
Compact, statically initialized syntax for event lists (#12973) 2020-09-28 20:36:15 +02:00
Tulio Leao 731a93dc39
Create WindowColour enum for widget definition calls (#12722)
* Make MakeWidget* functions take enum colour

* Make windows A-D use WindowColour enum

* Make windows E-G use WindowColour enum

* Make windows I-M use WindowColour enum

* Make windows N-P use WindowColour enum

* Make windows R-S use WindowColour enum

* Make windows T use WindowColour enum

* Make windows V-W use WindowColour enum
2020-08-28 23:31:31 -03:00
Aaron van Geffen 915dc5f07c Refactor MazeConstruction 2020-07-30 21:23:51 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
frutiemax 14a07359b3
Part of #11389: Use formatter class for Ride::FormatNameTo (#12041) 2020-06-24 21:02:08 -03:00
Gymnasiast f640446d58
Migrate 40 calls to set_format_arg() 2020-06-03 14:49:04 +02:00
Gymnasiast f8aeb70398
Apply review requests 2020-05-09 18:07:16 +02:00
Gymnasiast 9e4c664944
Replace defines with constexpr 2020-05-09 18:07:16 +02:00
Gymnasiast 96fe3d3b3c
Make WINDOW_SKELETON take a title, height and width 2020-05-09 18:07:16 +02:00
tassaron2 559ede5d14
Add compile option to move close box to the left 2020-05-09 18:07:16 +02:00
Tulio Leao 935cfe90fc
Use named casts on openrct2-ui/windows (#11136) 2020-04-18 13:32:48 +02:00
Gymnasiast edd31d9f16
Move flags to RideTypeDescriptors 2020-04-17 17:03:33 +02:00
Gymnasiast dcf4301559
Use constant for invalid direction 2020-03-05 18:27:36 +01:00
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03: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
Michael Steenbeek a2b9598341
Modify code using Location8 to use isNull()/setNull() (#10403) 2019-12-21 11:34:46 +01: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 afc14183e7 Use ScreenCoordsXY for tool_* functions 2019-10-29 19:02:58 -03: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
duncanspumpkin 5fe5f8e964 Refactor audio_play_sound_at_location to use CoordsXYZ 2019-08-19 20:04:58 +01:00
Matt cc6321048f
Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02: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 3f45976009 Fix openrct2ui errors 2019-07-29 19:18:16 +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
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin 7f586f50e1 Move all callees to the game action framework. Fix CoordXY bug 2019-03-02 07:24:41 +00:00
Nathaniel Ngo 300fd3a589 Fix for Issue#8725: refactoring _currentTrackBegin and _previousTrackPiece to use CoordsXYZ struct (#8759)
* Refactored _currentTrackBeginX, _currentTrackBeginY, _currentTrackBeginZ to use a CoordsXYZ struct

* Refactored _previousTracPieceX, _previousTrackPieceY, _previousTrackPieceZ to use a CoordsXYZ struct

* Refactored _currentTrackBegin and _previousTrackPiece in source files

* Fixed clang formatting
2019-02-24 09:15:31 +00:00
Ted John 9706dd8675 Pass Ride* instead of ride_id_t 2019-02-12 23:29:37 +00:00
Michael Steenbeek b4bef2fe7d
Merge pull request #8560 from richard-fine/directions
Begin cleanup of direction handling
2019-01-18 19:09:39 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Richard Fine e90e9dd73f Introduce many uses of direction_reverse
Change many of the places doing the ^2 trick to use direction_reverse instead, for improved readability.
2019-01-05 15:41:46 +00:00
Sijmen Schoon f3f4776afd Properly fix maze building when paused (#7852)
Also fixes two relevant bugs:
- The error message having no title
- Fixes the controls in the construction window activating when the initial placement fails because of e.g. the game being paused.
2018-08-04 14:30:13 +02:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format e558660860 clang-format UI windows 2018-07-23 16:00:14 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
jensj12 50e3f8b4f6 Cleanup of ride_demolish 2018-05-23 16:33:37 +02:00
Michał Janiszewski a2ef4bd699
Exclude pre-formatted blocks from clang-format (#7520)
[ci skip]
2018-05-16 20:41:29 +02:00
duncanspumpkin fcb66b7449 Start refactoring pathfinding to use tileCoords 2018-05-05 11:42:34 +01:00
ZehMatt e3708c0593 Split special direction to new parameter. 2018-03-05 00:17:34 +01:00
ZehMatt bdc1cf8adc Refactor GAME_COMMAND_MAZE_SET_TRACK to game action. 2018-03-05 00:17:34 +01:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
Aaron van Geffen ecc1cfed2a Rename WWT_DROPDOWN_BUTTON to WWT_BUTTON.
The previous name implied an exclusive association with dropdowns.
While used to display the dropdown triangle button, this is not an
exclusive use.
2018-01-08 00:01:32 +01:00
Ted John 83d1b6eb8f Refactor widget.c to C++ 2018-01-07 12:39:58 +01:00
Ted John f18595a1c1 Refactor viewport.c to C++ 2018-01-07 12:39:58 +01:00