Commit Graph

97 Commits

Author SHA1 Message Date
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
Hielke Morsink 9dd9b27db4
Make WIDGETS_END constexpr 2021-09-26 11:11:42 +02:00
ζeh Matt 516232e0a7
Change static casts to EnumValue 2021-09-10 19:10:15 +03:00
ZehMatt 3ad72baaae
Cast fixes 2021-09-10 19:10:12 +03:00
Duncan d2aca03ff6
Fix #15271. Use formatter to pass description args to text input (#15272)
* Fix #15271. Use formatter to pass description args to text input

Originally passed the variables via global vars which were not updated to 32bit during recent refactors. This removes the global and makes the interface cleaner and corrects the type

* Fix size of arguments
2021-08-24 19:12:05 +01:00
Ted John 5f853df1fd
Remove gS6Info 2021-08-02 20:38:02 +02:00
Gymnasiast 676ef7205e
Change all calls to DrawTextBasic to use Formatter 2021-08-01 15:14:43 +02:00
Ted John 58ae6bbd8a
Fix money64 issue in scenario options 2021-08-01 15:14:42 +02:00
Hielke Morsink e54dc7e466
Use consistent left-shift notation for widgets (#14956) 2021-06-26 14:23:15 +02:00
Tulio Leao bb8c275df6 Remove raw coords gfx_fill_rect_inset overload 2021-03-29 09:34:11 -03: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 2477933c51
Turn font sprite base into a strong enum 2021-02-28 00:23:00 +01: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
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
maksimdrachov 1815a094bb
Fix #13426: Typo in "repay loan" 2020-11-19 19:45:40 +01: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
evilclownattack 3e7ff12a72
Fix #13292: Impossible excitement rating requirements
Incorrect argument was used when drawing the minimum excitement rating in the Objective Selection window.
2020-10-28 23:55:29 +01:00
Gymnasiast eb2f40f35c
Fix typo in WC_EDITOR_OBJECTIVE_OPTIONS 2020-10-11 19:28:25 +02: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 ccde06ab0f
Explicitly pass formatter arguments to ShowError and family 2020-09-17 22:14:36 +03:00
Matt 2639349925
Move storage into Formatter class and refactor usage 2020-09-17 22:14:36 +03:00
Gymnasiast b788a099b5
Replace gfx_draw_string_clipped() calls with DrawTextEllipsised 2020-09-10 18:13:13 +02:00
Gymnasiast 6e22eade67
Create Objective struct and use it for global objective 2020-09-09 15:38:03 +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 be626d0b7c Refactor Editor*, Finances, Guest* to use MakeTab 2020-08-17 20:59:17 +02:00
Aaron van Geffen eda8e31055
Refactor widget defs in EditorObjectiveOptions window (#12672) 2020-08-13 23:07:19 -03:00
Michael Steenbeek 68ce06e833
Refactor objective handling in Scenario Editor
This moves some knowledge out of the window and into the main code and also cleans up the window a bit.

This also allows setting the "x guests by the end of year y" goal for no money scenarios, which was not the case previously.
2020-08-12 22:10:47 +02:00
Michael Steenbeek be0123decb
Fix #12611: Bad check for pay-per-ride ability 2020-08-10 18:56:06 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
frutiemax 0e96674a46
Part of #12096: ScreenRect w/ gfx_fill_rect in libopenrct2ui (#12188) 2020-07-10 13:59:08 -03: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
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
Sohil Adwani 310ff84b23
Part of #11562: gfx_draw_string_left_wrapped() overload
* gfx_draw_string_left_wrapped overload added


Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-18 22:52:49 -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
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