Commit Graph

269 Commits

Author SHA1 Message Date
Tulio Leao e18abc7e3d Rename NoOf... to AmountOf... on Peep 2020-05-31 09:13:56 -03:00
Tulio Leao a987a9ee5e Rename Peep::paid_to_enter to PaidToEnter 2020-05-30 20:35:06 -03:00
Tulio Leao 3f091d33e2 Rename Peep::paid_on_rides to PaidOnRides 2020-05-30 20:35:05 -03:00
Tulio Leao 414cff9b91 Rename Peep::paid_on_food to PaidOnFood 2020-05-30 20:35:05 -03:00
Tulio Leao c2f7efa328 Rename Peep::paid_on_souvenirs to PaidOnSouvenirs 2020-05-30 20:35:05 -03:00
Tulio Leao a729ac1589 Rename Peep::no_of_food to NoOfFood 2020-05-30 20:35:04 -03:00
Tulio Leao bc7ea40c4b Rename Peep::no_of_drinks to NoOfDrinks 2020-05-30 20:35:04 -03:00
Tulio Leao 625f7859a4 Rename Peep::no_of_souvenirs to NoOfSouvenirs 2020-05-30 20:35:04 -03:00
Tulio Leao fd71b1b009 Rename Peep::voucher_type to VoucherType 2020-05-30 20:35:04 -03:00
Tulio Leao bf228abf55 Rename Peep::voucher_arguments to VoucherArguments 2020-05-30 20:35:03 -03:00
Sohil Adwani d2565af867
Part of #11562: gfx_draw_string_left_wrapped() overload (#11784) 2020-05-19 21:57:11 -03:00
TusharSariya 2cf95adc4b
Fix #11565: gfx_draw_string_left_clipped to use ScreenCoordsXY (#11765)
* Issue #11565, created overload for gfx_draw_string_left_clipped

Co-authored-by: Tushar <tushar.97@hotmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-17 19:30:58 -03:00
Tulio Leao 128c1993c1 Rename Peep::balloon_colour to BalloonColour 2020-05-13 23:16:43 -03:00
Tulio Leao 6c57f33dc9 Rename Peep::umbrella_colour to UmbrellaColour 2020-05-13 23:14:45 -03:00
Tulio Leao 222f8df6cb Rename Peep::hat_colour to HatColour 2020-05-13 23:11:28 -03:00
Tulio Leao 3b632fcf95 Rename Peep::favourite_ride to FavouriteRide 2020-05-13 23:06:40 -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
Gymnasiast f8aeb70398
Apply review requests 2020-05-09 18:07:16 +02:00
Gymnasiast 43556d2dec
Remove ifdefs for LEFT_CLOSEBOX - for now 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
Ted John 7b8ffdb865 Refactor peep.intensity into new strict struct 2020-05-09 12:37:51 +01:00
Ted John d34dec9c27 Create ZoomLevel struct to add two new zoom levels 2020-03-23 15:54:03 +00:00
Gymnasiast 7759b54c2f
Make PeepPickupAction *actually* take a CoordsXYZ 2020-03-07 21:34:04 +01:00
Gymnasiast 8883f428ba Clean up window vars 2020-03-05 08:03:38 -03:00
Tulio Leao 724a6d4dcf Make rct_window use ScreenCoordsXY 2020-03-02 20:51:01 -03:00
Tulio Leao 87f724d038 Use Coords objects for viewport_create() 2020-03-02 20:49:59 -03:00
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03: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 201d13577e Use CoordsXY for footpath_get_coordinates_from_pos() 2020-01-12 22:20:29 -03:00
Tulio Leao 47935288d0 Remove raw coordinates overload of get_map_coordinates_from_pos 2019-11-25 17:45:02 -03:00
Tulio Leao fe3d6f6faf Use ScreenCoordsXY for scroll_mouse* functions 2019-11-14 08:40:40 -03:00
Tulio Leao 5e888747de Use mapCoords instead of ScreenCoords 2019-11-12 20:13:14 -03:00
Tulio Leao 892c084cd8 Use ScreenCoordsXY for windows/Footpath 2019-11-11 23:10:51 -03:00
Tulio Leao afc14183e7 Use ScreenCoordsXY for tool_* functions 2019-10-29 19:02:58 -03: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
Ted John 93789b9034
Add nullptr checks for get_ride in libopenrct2ui (#9795) 2019-08-09 08:06:25 +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 40d49b93d3 Do not use user strings for peep names 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
Ted John 5733d666b3 Do not store park name as a user string 2019-07-21 11:33:15 +02: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
nexgenration 46889b5381 Implement #9231: Add sprite_index to Guest Debug Tab 2019-05-27 22:39:03 +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
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
Michael Steenbeek c8df801e66
Create ShopItemDescriptor 2019-04-26 20:25:11 +02: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
Matt 57283a4e2b Fix #8900: Implement GuestSetFlagsAction. 2019-03-17 22:17:04 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Ted John ca023f7c5e Fix #8829: invalid read in window_guest_open 2019-03-09 13:05:12 +00:00
Ted John cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Matt 862ef3018c Use gCurrentRealTimeTicks whenever appropriate. 2018-12-01 17:00:11 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Gymnasiast 45b8ca9421 Remove more strings, fix error 2018-08-12 15:56:47 +02:00
moTechPlz 8784dfbf41 Fix #7462: Guest window goes beyond the map edge on a spiral slide. (#7752) 2018-08-07 16:20:51 +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 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +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
Ted John 26666b1da9 Remove empty function: viewport_update_pointers 2018-06-15 23:15:52 +01: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
Ted John 86ca6be58b Fix #7674: Rides show up as random numbers in guest's ride list 2018-06-13 18:32:00 +01:00
Ted John dea935314e Add null check for showing guest's favourite ride 2018-06-13 18:27:32 +01:00
Hielke Morsink 8aa122f54e Use empty initializer lists in the openrct2ui project 2018-06-05 14:37:24 +02:00
Michał Janiszewski a2ef4bd699
Exclude pre-formatted blocks from clang-format (#7520)
[ci skip]
2018-05-16 20:41:29 +02:00
Michael Steenbeek fcf507e051
Spin off shop item stuff to separate files 2018-05-14 19:21:43 +02:00
Hielke Morsink 6e02d6af4c Make peep_has_food, has_item and has_drink member functions 2018-05-05 11:13:22 +01:00
duncanspumpkin 765500adfa Label offsets and functions
Actually save before commiting

Label more peep vars.

Remove unread var

Further refactoring

Fix mistake in map element type
2018-04-11 18:16:09 +01:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Michael Steenbeek 857e64590d Name some rct(1)_peep fields 2018-01-09 10:35:07 +01:00
Aaron van Geffen fad8494ccc Rename WWT_12 to WWT_LABEL_CENTRED.
This is used for centred textual labels.
2018-01-07 23:54:51 +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
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Richard Jenkins 9bb7b66157 Fix #6948 & #6949: Removing or trying to build a ride freezes game 2018-01-06 13:49:29 +00:00
Aaron van Geffen da519c9b32 Add extra padding to label text in guest window. 2018-01-03 10:09:21 +01:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Marijn van der Werf de6b3b4ebf Sort includes in Guest.cpp 2017-11-03 01:54:37 +01:00
Marijn van der Werf 61255e25a7 Move Ride window to UI module 2017-11-03 01:54:37 +01:00
Christian F. Coors 06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Michael Steenbeek af845beb61 Replace mapElement with tileElement 2017-10-31 19:59:06 +01:00
Michael Steenbeek ce8d9cc71b Rename map_element to tile_element 2017-10-31 19:59:06 +01:00
blackhand1001 e4caeb7ef9 Use constants for energy bars in Peep window 2017-10-24 09:19:17 +02:00
Duncan d224f1219e Reintroduce error titles to game actions. Small refactor. (#6462)
* Reintroduce error title to game actions. Small refactor.

Removed setting error titles in any calling functions.
Refactored place park entrance result to conform with other game actions.

* Remove unread variable (fixing Travis)
2017-10-18 19:57:36 +01:00
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +02:00
Michał Janiszewski ab3835719a Compile peep and staff logic as C++ 2017-10-13 10:06:36 +02:00
Michael Steenbeek 42d6a10952 Compile management as C++ 2017-10-11 21:38:26 +02:00
Marijn van der Werf eef3bd9af5 Move staff and guest windows 2017-10-07 22:24:14 +02:00
Renamed from src/openrct2/windows/Guest.cpp (Browse further)