Commit Graph

220 Commits

Author SHA1 Message Date
Hielke Morsink f03a13da82
Simplify object selection string filtering 2021-11-06 17:24:42 +01:00
Hielke Morsink 76b5479bbb
Fix undefined use of cctype functions 2021-11-06 16:27:54 +01:00
Steve Blythe b15dc66acb
Part of #12098: Use ScreenRect in gfx_filter_rect() (#15603) 2021-10-20 19:43:32 -03:00
Hielke Morsink 9dd20ec619
Improve array formatting
For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
2021-10-17 18:21:45 +02:00
Silent 3e64a227e5
Fix Object Selection not freeing the object when unhovering
Fixes a double-free on previews.
2021-10-09 21:48:43 +02:00
Hielke Morsink 6de1868ad8
Use (const) references to widgets where possible
Note: The change from `w->widgets[WIDX_ENTRY_PRICE]` to `entryPriceWidget` is intended.
2021-10-01 15:21:00 +02:00
Hielke Morsink 9dd9b27db4
Make WIDGETS_END constexpr 2021-09-26 11:11:42 +02:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Gymnasiast bdab3219cb
Modify object loading for JSON-only objects 2021-09-15 11:28:39 +02:00
Michael Steenbeek 6ffb03dde0
Add icon for path railings tab 2021-09-13 09:29:46 +02:00
Ted John 5f853df1fd
Remove gS6Info 2021-08-02 20:38:02 +02:00
Michael Steenbeek 1ea9bbbb1b
Fix formatting 2021-07-29 13:32:48 +02:00
Kane dbdca55645
Fix #14316: Closing the Track Designs Manager window causes broken state
When exiting the Track Design Manager window the user was placed into the scenario editor in a broken state.
User is now returned to the main menu when the window is closed.
2021-07-29 12:44:24 +02:00
Hielke Morsink e54dc7e466
Use consistent left-shift notation for widgets (#14956) 2021-06-26 14:23:15 +02:00
Gymnasiast b214a9fd97
Show what a stall sells in Object Selection 2021-05-27 19:54:44 +02:00
Gymnasiast 1d693f9751
Fix display of number of items in scenery group 2021-05-27 19:54:44 +02:00
Gymnasiast f2ac658935
Show tracks list of music styles in Object Selection 2021-05-27 19:53:52 +02:00
Michael Steenbeek 9ee3c81768
Merge pull request #14397 from Gymnasiast/refactor/hardcoded-terrain-constants
Remove hardcoded terrain style constants from RCT1 and MapGen
2021-03-31 20:18:12 +02:00
Tulio Leao bb8c275df6 Remove raw coords gfx_fill_rect_inset overload 2021-03-29 09:34:11 -03:00
Gymnasiast b3bbdcbfd5
Remove hardcoded terrain style constants from RCT1 and MapGen 2021-03-27 17:34:10 +01:00
Michael Steenbeek a5a63f839a
Allow passing ImageId into gfx_draw_sprite() 2021-03-23 11:58:09 +01:00
Gymnasiast 7fd049c22e
Remove last remnants of gCurrentFontSpriteBase 2021-02-28 00:26:53 +01:00
Gymnasiast c40701d997
Make gfx_draw_string() take a TextPaint argument 2021-02-28 00:26:20 +01:00
Gymnasiast 3e536e2711
Change gfx_draw_string_*_wrapped() to DrawTextWrapped() 2021-02-28 00:23:01 +01:00
Gymnasiast e2ebc9d43b
Replace gfx_draw_string_left() with DrawTextBasic() 2021-02-28 00:23:00 +01:00
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
Gymnasiast 44d0e77afb
Make all access to RTD table use the bounds checking function 2021-02-26 10:01:00 +01:00
Basssiiie 813b111710
Fix #11912: Update active palette on selection 2021-01-18 21:25:57 +01:00
Tulio Leao 221aa8cece Close #12453: Refactor RCT2_EDITOR_STEP to strong enum 2020-12-23 20:07:53 -03:00
Richard Qian 84d5fde6bb Remove the max limit of 4 rides from the Track Designer 2020-12-20 13:08:36 -06: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
Łukasz Pękalski 4adf745237
Close #12403: Refactor FILTER_PALETTE_ID to use strong enum (#13273) 2020-12-05 15:13:59 -03:00
Ted John 517e964975 Fix title screen and object manager text issues 2020-11-27 18:54:58 +00:00
ffrogman 7ed1804e61
Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum (#13453)
* Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum
2020-11-27 00:14:20 -03:00
Łukasz Pękalski fc4ad82ac1 resolve: integrated changes from comments 2020-11-11 16:08:39 +01:00
Łukasz Pękalski 7648feeba2 Close #12427: Refactor OBJECT_TYPE to use strong enum 2020-11-11 16:07:01 +01:00
Łukasz Pękalski 832fd69822 refactor: changed ObjectType enum to strong enum
code does not compile yet
2020-11-11 16:07:01 +01:00
Łukasz Pękalski 6e5105ab3b refactor: ObjectType to use strong enum
enum renaming complete
2020-11-11 16:07:01 +01:00
Michael Steenbeek d8a7219c86
Use new identifier for default objects 2020-11-07 20:28:01 +01:00
Michael Steenbeek 58f099a644
Merge pull request #13286 from tupaschoal/research-refactor
Small research releated refactor
2020-11-07 20:18:18 +01:00
Tulio Leao 19ab8f1211 Use ResearchCategory Enum for ResearchItem 2020-11-07 11:14:55 -03:00
pizza2004 2015acd4c0
Refactor UI/Interface Window to Title Case (#13367) 2020-11-04 04:52:23 +00:00
pizza2004 68bd035f12
Refactor Dropdown to TitleCase (#13352)
* Refactor Dropdown Namespace

* Refactor Dropdown to TitleCase
2020-11-03 08:16:06 +00:00
Haven Kim 8a4df108ba
Close #12428: Refactor OBJECT_SOURCE_GAME to use strong enum 2020-10-17 22:27:02 +02:00
Vinicius Sa 711dd00cde
Close #13000: Refactor ObjectFactory to use unique_ptr
Employs the smart pointer unique_ptr for safer memory management.

Classes involved:
 - ObjectRepository
 - ObjectManager
2020-10-14 21:56:48 +02:00
Duncan f28907a87d
Rework tooltip to be more logical (#13137) 2020-10-10 10:49:56 -03: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
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
Michael Steenbeek 4a79e9305f
Replace gfx_draw_string_right() with DrawTextBasic (#12966) 2020-09-18 21:39:00 -03:00
Matt ccde06ab0f
Explicitly pass formatter arguments to ShowError and family 2020-09-17 22:14:36 +03: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
Michael Steenbeek 55722a7ad4
Remove commented-out code (#12834) 2020-09-01 15:33:52 -03: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 6602b51b8b Use MakeTab in EditorInventionsList, EditorObjectSelection, Scenery 2020-08-17 20:59:17 +02:00
Tom Parsons c4ae579a84
Feature #11817: Show authors field in object selection (#12591)
* Feature #11817: Show authors field in object selection

- authors field in JSON shows as last line in bottom right on object selection
- authors field added to Object class
- ObjectFileIndex version bump as authors is serialised

* fix sign comparison warning

* Start object selection corner text higher to avoid overlap

* Use references to reduce unneccessary copies

* make GetAuthors const

* Clip drawing of authors string so it doesn't cross widgets

At max length the leftmost aligns exactly with description left

* Add a changelog message

* make SetAuthors use an rvalue reference

* remove unnecessary nullptr check
2020-08-09 06:23:28 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
Aaron van Geffen 79ae0786c0
Refactor more widgets definitions into new format
* About
* Editor Bottom Toolbar
* Editor Inventions List
* Editor Object Selection
* Error
* Finances
* Footpath
* Game Bottom Toolbar
* Guest List
* Network Status
* News
* News Options
* Player
* Research
* Staff List
* Title Options
* About window.

And fix MakeSpinnerWidgets declaration order.
2020-07-16 20:48:25 +02:00
frutiemax 0e96674a46
Part of #12096: ScreenRect w/ gfx_fill_rect in libopenrct2ui (#12188) 2020-07-10 13:59:08 -03: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
Michael Steenbeek a102892370
Merge pull request #11985 from AaronVanGeffen/windows/object-selection
Increase widget heights in object selection window
2020-06-24 23:09:10 +02: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
TomasZilinek 9efe43fa59
Fix #11562 - gfx_draw_string_left_wrapped overload (#12015)
I created the overload, replaced remaining calls with the new function and removed the old function.
2020-06-21 06:25:31 -03:00
TomasZilinek e93e32d139
Part of #11571: create gfx_draw_string_left() overload (#11984)
Replaces a third of all occurrences of the old function
2020-06-20 00:22:01 -03:00
Aaron van Geffen 0e9857899e Use widget height constants in object selection window
Replaces hardcoded integers with LIST_ROW_HEIGHT and SCROLLABLE_ROW_HEIGHT.
2020-06-19 08:42:14 +02:00
Aaron van Geffen 5cb7bf6216 Increase widget heights in object selection window
These changes accomodate CJK languages:
* Buttons from 11px to 13px.
* Text box from 11px to 13px.

Furthermore:
* Rename WIDX_FILTER_STRING_BUTTON constant to WIDX_FILTER_TEXT_BOX.
* Rename WINDOW_STAFF_LIST_WIDGET_IDX to WINDOW_EDITOR_OBJECT_SELECTION_WIDGET_IDX.
2020-06-19 08:42:10 +02:00
Gymnasiast 96678a14eb
Move ride naming to RTD
This also means that all unused ride types will now have the same name. I have made an exception for the 'arbitrary ride type change' dropdown only.
2020-06-16 22:52:48 +02: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 d6baec3f66 Reduce scope of ScreenCoordsXY variables 2020-06-11 18:26:16 -03:00
Tulio Leao 183ee1e595 Part of #11569: Use ScreenCoordsXY instead of <x,y> 2020-06-11 10:11:33 -03:00
Tulio Leao fab0ea131f Part of #11569: Use gfx_draw_string_right with ScreenCoordsXY 2020-06-11 10:11:20 -03:00
Gymnasiast f640446d58
Migrate 40 calls to set_format_arg() 2020-06-03 14:49:04 +02: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
Michael Steenbeek 620fb5e5c4
Migrate many set_format_arg calls to Formatter (#11744) 2020-05-13 21:29:39 -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
Michael Steenbeek 362ea7bbc0
Fix #11455: Object Selection window cuts off scenery names (#11639) 2020-05-05 18:19:30 +02:00
Tulio Leao d0704baab2 Make window_dropdown_show_text() use ScreenCoordsXY 2020-05-01 15:58:36 -03:00
Gymnasiast 6cdee9db93
Fix #7006: Use RTDs for determining ride category 2020-04-30 12:59:18 +02:00
WantDiscussion 37e9270c00
Close #6024: Closing object selection now advances to next step
In the scenario editor and track designer X button in object selector
will now close the object selector window and advance to the next stage
instead of closing the scenario editor and track editor entirely and
returning to the main menu.

Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
2020-04-24 17:19:06 +02:00
Michael Steenbeek e1e58423fc
Replace RideTypeHasRideGroups with flag (#11375) 2020-04-20 21:50:35 +02:00
Tulio Leao 4d679b7e3e
Fix #11361: rct_object_filters leak in EditorObjectSelection.cpp (#11364) 2020-04-19 16:28:01 -03:00
Michał Janiszewski 5bfc41f49e
openrct2-ui cast fixes (#11348) 2020-04-19 14:08:22 +02:00
Gymnasiast 5d3bf2be20
Move category to RTD; move RideTypeIsIndependent to a flag 2020-04-18 15:22:41 +02:00
Tulio Leao 935cfe90fc
Use named casts on openrct2-ui/windows (#11136) 2020-04-18 13:32:48 +02:00
Tulio Leao 2bb3a34274 Convert C-style pointer casts to named casts 2020-03-28 16:41:23 -03:00
Michael Steenbeek d86dce17e8
Prepare object indices for uint16_t (part 2) (#10966) 2020-03-18 21:27:53 +01:00
Michael Steenbeek 18ebe73dfa
Replace object_entry_get_type() with method (#10937) 2020-03-15 12:07: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