Commit Graph

252 Commits

Author SHA1 Message Date
Gymnasiast 4d9c278ebc
Unify calls to DrawTextBasic 2021-02-28 00:23:00 +01:00
Gymnasiast 2477933c51
Turn font sprite base into a strong enum 2021-02-28 00:23:00 +01:00
Michael Steenbeek 08f07e6135
Reduce usage of gCurrentFontSpriteBase (#14178) 2021-02-26 15:39:20 +01:00
Ted John 762b6ee816 Refactor viewport interaction flags and add plugin API 2021-02-18 18:10:29 +00:00
Matt 7d517caced
Move peep pickup test into Peep::CanBePickedUp 2021-02-09 00:31:29 +02:00
Dennis Devriendt 3073cca6aa
Close #13624: Refactor ViewportInteractionItem to use strong enum (#13657)
* Closes #13624: Refactor ViewportInteractionItem to use strong enum
2020-12-29 15:09:15 -03:00
Tulio Leao 00483df2f2 Close #13625: Refactor TOOL_IDX to use strong enum 2020-12-23 20:07:54 -03:00
Adam f09b14ef2b
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
Jamie Quigley 03a9ac9f56
Close #12387: Refactored PeepThoughtType to use strong enum. (#13541) 2020-12-07 19:48:36 +00:00
Łukasz Pękalski 4adf745237
Close #12403: Refactor FILTER_PALETTE_ID to use strong enum (#13273) 2020-12-05 15:13:59 -03:00
Łukasz Pękalski 3de233c796
Close #12395: Refactor PeepItem to use strong enum (#13311)
* refactor: integrated PEEP_ITEM into SHOP_ITEM

* refactor: converted merged enum to flag

Only former occurrences of PEEP_ITEM

* cleanUp: code cleaned after merging

* refactor: converted ShopItem to strong enum

code reformatting

* refactor: ShopItem enum items renamed

code formatted

* refactor: new getter and setter functions for Item...Flags

* refactor: replaced all occurrences of ItemStandardFlags

with appropriate getter and setter functions.
COMPARE_FIELD macro needs to be commented out or the flag has to stay public.

* refactor: all occurrences of ItemExtraFlags replaced

with proper function calls. COMPARE_FIELD macro issue not resolved.

* refactor: introduced new variable for unified item flags

* refactor: adapted accessor functions

accessor functions were modified to accommodate both standard and extra ShopItem flags

* refactor: ItemExtraFlags accessor functions are replaced

with general functions

* refactor: reverted to original uint32_t flag variables

* refactor: implemented suggested changes

* refactor: integrate additional comments

* refactor: incorporated requested changes

* refactor: incorporated requested changes

added static_cast<PeepThoughtType> in lines 1572 and 1590
2020-12-03 21:15:59 -03: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
pizza2004 2015acd4c0
Refactor UI/Interface Window to Title Case (#13367) 2020-11-04 04:52:23 +00:00
aw20368 c81bf7b501
Refactor variable names in window_guest_stats_bars_paint (#13214)
* Refactor variable names in window_guest_stats_bars_paint

Change the variables eax/ebp to timeInPark and barColor, respectively.

* Refactor guest stat UI calculations

Simplify guest stat calculations and move them to a new function NormalizeGuestStatValue.
2020-10-21 07:38:44 +01:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
aw20368 0c195d14b9
Close #8848 Refactor TimeInPark (#13146)
Split TimeInPark into a union: ParkEntryTime for guests, HireDate for staff
2020-10-12 21:36:38 -03:00
Vinicius Sa 80718f1774
Use helper function GetPeepAnimation
It's intended to retrieve a rct_peep_animation_entry from the global
array g_peep_animation_entries, given PeepSpriteType and
PeepActionSpriteType as parameters.
2020-10-07 17:34:25 -03:00
Vinicius Sa 4d28901cb0
Refactor PeepSpriteType to use strong enum
Issue: 12396
2020-10-07 17:34:21 -03:00
Duncan eb3f3edc1b
Use RemoveViewport helper function (#13104) 2020-10-06 10:27:56 +01:00
Vinicius Sa bd8c633ea3
Close #12394: Refactor PeepNauseaTolerance to use strong enum (#13106) 2020-10-05 22:13:44 -03:00
Vinicius Sa ca8fa55fdb
Use EnumValue to get the underlying value of an enum
Applied to objects of the enum class PeepActionSpriteType when they are
used as arrays subscripts.
2020-09-29 11:15:07 -03:00
Vinicius Sa f8dd0a57aa
Refactor PeepActionSpriteType to use strong enum 2020-09-29 11:15:04 -03:00
Łukasz Pękalski d1cd2e08b5
Close #12388, refactor PeepState to use strong enum (#12927)
* Close #12388, refactor:PeepState to use strong enum

* refactor: refactored file PlayTests.cpp

* refactor: change PEEP_STATE_ to PeepState:: and camel case after merging

chore: code reformatting
2020-09-28 15:51:49 -03:00
Aaron van Geffen d27e14f45b
Compact, statically initialized syntax for event lists (#12973) 2020-09-28 20:36:15 +02:00
Duncan 4ec10837a6
Remove Formatter::Common where not required (#12972)
* Remove Formatter::Common where not required

* Remove common from Guest window where possible
2020-09-27 21:09:08 -03:00
Matt 38e03ae45d
Use the Formatter for News items 2020-09-17 22:14:36 +03:00
Tulio Leao c2f42cd908 Fix #12901: Guest thoughts show up as guest actions or names 2020-09-10 21:18:42 -03:00
Tulio Leao 4afbbed9bd
Fix #12881: Guests' favourite rides not listed in the guest window 2020-09-10 19:11:17 +02:00
Gymnasiast d140dd72c6
Remove const void* overload from DrawTextEllipsised() 2020-09-10 18:13:13 +02:00
Gymnasiast b788a099b5
Replace gfx_draw_string_clipped() calls with DrawTextEllipsised 2020-09-10 18:13:13 +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
Michael Steenbeek 56c623e549
Merge pull request #12671 from AaronVanGeffen/refactor/tabs
MakeTab wrapper for standard tab widgets
2020-08-26 12:13:36 +02:00
ryan-bello cc2bb33892 changed enum STAFF_TYPE to strong enum StaffType, moved it to Peep.h 2020-08-17 22:59:02 -04:00
ryan-bello 54a33cbde8 renamed StaffType to AssignedStaffType 2020-08-17 20:16:09 -04:00
Aaron van Geffen be626d0b7c Refactor Editor*, Finances, Guest* to use MakeTab 2020-08-17 20:59:17 +02:00
Jonathan van Tuijl 4117965a4a Fix Z coordinate in guest debug tab 2020-08-11 03:37:34 +02:00
Jonathan van Tuijl dcdc782361 Increase minimum window size so pathfind history doesn’t spill out 2020-08-11 03:35:24 +02:00
Duncan 0809069e74
Fix #12577: Mistake made in refactor #12538 (#12579)
Loop called the peep window open only when nullptr. Added extra checks for nullptr on window open
2020-08-03 20:09:24 -03:00
Duncan 733bc5a981
Close #12518: Viewport Refactor (#12541)
* Remove viewport pointer from get_map_coordinates_from_pos

* Removed viewport from get_window

* Return a InteractionInfo from get_map_coord...

* Remove viewport_interaction_info struct

* Add Entity union to simplify code

* Name the enum used for viewport interaction

* Simplify functions further by returning the info struct

* Add default switches
2020-08-02 08:32:59 +01:00
Aaron van Geffen b34b573ad9
Refactor more widget definitions (#12354)
* Refactor Dropdown

* Refactor EditorMain

* Refactor EditorScenarioOptions

* Refactor InstallTrack

Increased window height to 460 (was 448); one line of text was overflowing.

* Refactor Guest

* Refactor LandRights

* Refactor LoadSave

* Refactor Main

* Refactor Map

* Add extra constants to EditorScenarioOptions
2020-07-27 19:54:22 -03:00
Duncan 8a378ad236
Remove uses of GET_PEEP macro and replace with GetEntity (#12467)
* Use TryGetEntity and GetEntity instead of macro

* Use GetEntity for ui guest window

* Remove final GET_PEEP macro uses

* Fix remaining issues
2020-07-26 17:42:02 +01:00
Matt fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
frutiemax 0e96674a46
Part of #12096: ScreenRect w/ gfx_fill_rect in libopenrct2ui (#12188) 2020-07-10 13:59:08 -03:00
Gymnasiast e8d6383f57
Clean up voucher arguments 2020-07-07 21:13:40 +02:00
frutiemax 4661262572
Fix #12085: Use ScreenCoordsXY on clip_drawpixelinfo (#12105) 2020-07-02 14:06:28 -03:00
Aaron van Geffen 2e153a7e95 Introduce widget::midX and widget::midY helper functions 2020-06-25 10:31:15 +02:00
Aaron van Geffen 681b8d7938
Introduce widget::width and widget::height helper functions (#12053) 2020-06-24 22:44:00 -03:00
frutiemax 14a07359b3
Part of #11389: Use formatter class for Ride::FormatNameTo (#12041) 2020-06-24 21:02:08 -03:00
TomasZilinek 9d965ccfb6
Part of #12017 - create gfx_draw_sprite overload (#12026)
* Part of #12017 - create gfx_draw_sprite overload

Part 1. Creates the overload and replaces about a half of the calls since there are too many for one PR.

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-06-23 18:32:34 -03:00
frutiemax 6e47385b90
Part of #11389 : in peep class, FormatTo* use Formatter class (#12035) 2020-06-23 14:52:08 +01:00
TomasZilinek 2264c5f7f1
Part of #11571 - Use gfx_draw_string_left with ScreenCoordsXY (#12008) 2020-06-20 11:56:36 -03:00
Duncan 33298d2bde
Fix peep pickup. Mistake made during refactor. (#11978)
PeepPickupAction assumed that all locations that are passed into the function would be valid locations or null locations. This is not the case when picking up as a dummy value is passed into the function. The caller was fixed by passing a null location as expected by PeepPickupAction.
2020-06-17 21:11:50 +01:00
duncanspumpkin 904e6c6987 Implement GetSprite and use it in a number of places
This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
2020-06-16 20:21:56 +01:00
Tulio Leao 13df05ce32 Part of #11564: Use ScreenCoordsXY instead of <x,y> 2020-06-14 12:51:06 -03:00
Tulio Leao 613cec3f7a Part of #11564: gfx_draw_string_centred_clipped with ScreenCoordsXY 2020-06-14 12:26:53 -03:00
Tulio Leao e54a3d89f2
Rename some Peep member variables to use TitleCase (#11931)
* Rename Peep::destination_tolerance to use TitleCase

* Rename Peep::destination_y to use TitleCase

* Rename Peep::destination_x to use TitleCase

* Rename Peep::trousers_colour to use Title Case

* Rename Peep::tshirt_colour to use TitleCase

* Rename Peep::no_of_rides to use Title Case

* Rename Peep::staff_type to use TitleCase

* Rename Peep::type to use TitleCase

* Rename Peep::sprite_type to use TitleCase

* Rename Peep::sub_state to use TitleCase

* Rename Peep::state to use TitleCase

* Rename Peep::outside_of_park to use TitleCase

* Rename Peep::next_flags to use TitleCase

* Rename Peep::name to use TitleCase

* Rename Peep::NoOfRides to GuestNoOfRides

* Rename Peep::Type to AssignedPeepType

* Rename Peep::GuestNoOfRides to GuestNumRides
2020-06-14 06:31:08 +01:00
Tulio Leao a993ad8408 Rename Peep::energy to Energy 2020-06-08 23:34:35 -03:00
Tulio Leao 92fbb9fc04 Rename Peep::happiness to Happiness 2020-06-08 23:30:27 -03:00
Tulio Leao e387539802 Rename Peep::nausea to Nausea 2020-06-08 23:25:37 -03:00
Tulio Leao 533695cbe6 Rename Peep::hunger to Hunger 2020-06-08 23:18:12 -03:00
Tulio Leao aad80d3390 Rename Peep::thirst to Thirst 2020-06-08 23:12:38 -03:00
Tulio Leao 3dd4adeb81 Rename Peep::toilet to Toilet 2020-06-08 23:10:18 -03:00
Tulio Leao 4f9227fd83 Rename Peep::intensity to Intensity 2020-06-08 22:55:07 -03:00
Tulio Leao f1337768f5 Rename Peep::nausea_tolerance to use TitleCase 2020-06-08 22:41:15 -03:00
Tulio Leao f732c2f1cd Rename Peep::window_invalidate_flags to use TitleCase 2020-06-08 22:25:54 -03:00
Tulio Leao 1c566eebcb Rename Peep::paid_on_drink to PaidOnDrink 2020-06-08 20:23:14 -03:00
Tulio Leao 1ee5653c8c Rename Peep::photo2_ride_ref to use TitleCase 2020-06-08 17:36:35 -03:00
Tulio Leao 397c1137db Rename Peep::photo3_ride_ref to use TitleCase 2020-06-08 17:36:35 -03:00
Tulio Leao df87daaa6e Rename Peep::photo4_ride_ref to use TitleCase 2020-06-08 17:36:35 -03:00
Tulio Leao 77af2326ff Rename Peep::cash_in_pocket to CashInPocket 2020-06-06 11:53:50 -03:00
Tulio Leao 0fc7bd1afd Rename Peep::cash_spent to CashSpent 2020-06-06 11:26:04 -03:00
Tulio Leao cf4b052cd4 Rename Peep::time_in_park to TimeInPark 2020-06-06 11:26:04 -03:00
Tulio Leao e08c1b44b2 Rename Peep::thoughts to Thoughts 2020-06-06 10:03:58 -03:00
Michael Steenbeek 4efd3dbfbf
Merge pull request #11866 from Gymnasiast/refactor/set_format_arg_be_gone
Move calls to set_format_arg to Formatter::Common()
2020-06-04 23:20:37 +02:00
Tulio Leao 7357eeca60
Rename Peep::photo1_ride_ref to Photo1RideRef 2020-06-04 19:16:11 +02:00
Tulio Leao a2a0fad886
Rename Peep::peep_flags to PeepFlags 2020-06-04 19:16:11 +02:00
Tulio Leao 53bff03a3f
Rename Peep::pathfind_goal to PathfindGoal 2020-06-04 19:16:11 +02:00
Tulio Leao cad809275e
Rename Peep::pathfind_history to PathfindHistory 2020-06-04 19:16:11 +02:00
Michael Steenbeek 0ba02dd91c
Fix suggestion 2020-06-04 12:41:03 +02:00
Michael Steenbeek f9417cc5de
Apply suggestion from code review
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-06-04 10:16:23 +02:00
Gymnasiast 66a71e009d
Create Rewind method on Formatter 2020-06-03 14:49:04 +02:00
Gymnasiast 02338ffc5c
Migrate 50 more calls to set_format_arg() 2020-06-03 14:49:04 +02:00
Gymnasiast f640446d58
Migrate 40 calls to set_format_arg() 2020-06-03 14:49:04 +02:00
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