Commit Graph

174 Commits

Author SHA1 Message Date
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 503273793a
Remove gCurrentFontSpriteBase from some functions 2021-02-28 00:26:20 +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
Michael Steenbeek 406967c71f
Refactor object_entry_get_entry() to return Object 2021-01-03 23:01:52 +01:00
Michael Steenbeek 44d595835a
Fix #13653: Incorrect colours in Inventions List 2021-01-03 14:06:52 +01: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
Łukasz Pękalski fc4ad82ac1 resolve: integrated changes from comments 2020-11-11 16:08:39 +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 58f099a644
Merge pull request #13286 from tupaschoal/research-refactor
Small research releated refactor
2020-11-07 20:18:18 +01:00
Tulio Leao 7d96dc9958 Move category names and invention strings to ResearchItem class 2020-11-07 11:14:55 -03: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 a5607da09d
Refactor Widget to TitleCase (#13355) 2020-11-03 18:29:22 -03:00
pizza2004 1643c62939 Refactor UI/Input MouseInput to Title Case 2020-11-02 07:05:33 -07:00
Duncan cd39c30989
Tooltip 2 (#13159)
* Use ScreenCoords for tooltip

* Remove temporary variables

* Small refactor

* Fix #13151. Not passing tooltip arguments correctly for ride window

* Fix Server List window version tooltip

* Fix cheats tooltip event

* Add static to function decl

* Remove unreachable break statements in Ride.cpp

* Apply review suggestions

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-10-17 09:10:08 +01: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
Julia Pinheiro cba1d48226
Close #12408: Refactor CURSOR_ID to use strong enum 2020-10-11 18:01:14 +02:00
Duncan 2063aea5ef
Remove common format formatter where possible (#13034)
* Remove common format formatter where possible

Eventually should have it limited to tooltips, window titles and widget args

* Remove remaining paint functions using common

* Remove misuse of gCommonFormatArgs
2020-09-30 22:42:04 +01:00
Aaron van Geffen d27e14f45b
Compact, statically initialized syntax for event lists (#12973) 2020-09-28 20:36:15 +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
Aaron van Geffen 6602b51b8b Use MakeTab in EditorInventionsList, EditorObjectSelection, Scenery 2020-08-17 20:59:17 +02:00
Duncan 4a235e3bb6
Refactor ResearchItem Type to an enum class (#12346)
* Change type of ResearchItem.type to enum class

This is to prevent any future issues caused by confusion as to what the type is and further improves the codebase.

* Specifiy a size for the type

Also remove the static cast where not required

* Apply review comments
2020-07-22 14:25:05 +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
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
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
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 6fd83fd006
Make WW and WH static 2020-05-09 18:07:16 +02: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
Gymnasiast 73671bbeeb
Make ResearchItem use ObjectEntryIndex 2020-04-30 12:59:18 +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
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 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Gymnasiast e6c32230bc
Convert rawValue to uint32 2020-01-26 14:12:57 +01:00
Michael Steenbeek 3192bfb7c6
Move research functions to method; remove unused function (#10609) 2020-01-22 22:51:11 +01:00
Tulio Leao 9fa355cb8c Make window_event_list use Coords for moved and cursor (#10258) 2019-11-18 23:13:32 +01:00
Tulio Leao fe3d6f6faf Use ScreenCoordsXY for scroll_mouse* functions 2019-11-14 08:40:40 -03:00
Duncan 219046af14
Merge pull request #10136 from tupaschoal/constexpr-for-openrct2ui-define
Use constexpr on openrct2-ui/*
2019-10-30 06:44:11 +00:00
Tulio Leao d1cec43065 Use constexpr on openrct2-ui/* 2019-10-29 18:48:04 -03:00
Tulio Leao d9efd64fea Use ScreenCoordsXY for interface\Widget.h (#10123) 2019-10-29 17:41:19 +01:00
Tulio Leao 5f916b79ae Use ScreenCoordsXY for MouseInput (#10120) 2019-10-20 19:10:30 +02: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
Ted John ae8c93ca2b
Fix research list UI / dragging 2019-08-23 22:41:50 +02:00
Gymnasiast abe721b308
Fix rebase errors and formatting 2019-08-23 22:41:50 +02:00
Gymnasiast 984fd5e58a
Make EditorInventionsList a bit less buggy 2019-08-23 22:41:50 +02:00
Gymnasiast 9de2819cef
Process feedback from code review 2019-08-23 22:41:50 +02:00
Gymnasiast 1265913bdb
Fix dragging crash and some bugs 2019-08-23 22:41:43 +02:00
Gymnasiast 5ce3d4b947
Use new iterator syntax in more places 2019-08-23 22:41:43 +02:00
Gymnasiast b1fb75e496
Move everything to research vectors 2019-08-23 22:41:43 +02:00
Gymnasiast c3fdb728d1
Rename rct_research_item to ResearchItem 2019-08-23 22:41:43 +02:00
Matt cc6321048f
Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02:00
Ted John f49447bed5 Fix compile errors 2019-08-04 17:47:16 +01:00
Ted John a3fe00f0a3 Refactor ride list to a manager with iterator 2019-08-04 16:43:50 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Ted John cce979f96b
Remove logic for required objects (#8718)
This allows TARMAC to be removed when `remove_unused_objects` is called.
2019-02-19 11:55:43 +00:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Gymnasiast 45b8ca9421 Remove more strings, fix error 2018-08-12 15:56:47 +02:00
Hielke Morsink 25eea49983 Add trailing commas to some window source files 2018-07-23 16:00:23 +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
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
Hielke Morsink c3cff07b91 Disallow placing items in-between always researched items
This adds a loop that iterates down the list, until it reaches either a researched item or the end.
2018-06-15 00:34:30 +02:00
Hielke Morsink c437f438f1 Remove invalid cast 2018-06-15 00:34:30 +02:00
Hielke Morsink 30b9d3a338 Move always_researched checks and add comments 2018-06-15 00:34:30 +02:00
Chaosmeister 308ae4b357 Make always-researched research items unpickable. 2018-06-15 00:34:30 +02:00
Andy Ford 2ab3bd515d Fix #7673: Vehicle names cut in invention list (#7675)
* Fix #7673: Vehicle names cut in invention list

The string formatting was formatting based on the size of the
pointer to the buffer, not the buffer itself, this truncated all
vehicle names to 8 characters.

* Adjust Long Vehicle Names For Vertical Scrollbar

The ellipsis in long vehicle names were being cut off by
the scrollbar. Reduced the string formatting length by
vertical scrollbar size - 1. The extra 1 is for the fact
that the second column starts + 1 from the middlepoint of the box.
2018-06-13 21:44:25 +02:00
Aaron van Geffen e920871d67
Fix #7601: Always-researched items not rendered with inset. (#7638)
This re-introduces the use of buffers to work around colours not being set properly.

For clipping strings, we also now manually invoke `gfx_clip_string` instead of relying
on `gfx_draw_string_left_clipped` to do it for us. The latter resets the current font,
meaning it prevents the use of `MEDIUM_EXTRA_DARK` bases. This issue should be addressed
in a later commit.
2018-06-08 22:57:29 +02:00
Aaron van Geffen 1a2958df84 Make text painting adapt to scrollview width as well. 2018-05-27 00:45:50 +02:00
Aaron van Geffen 248585281c Fix #6221: Make invention list resizeable. 2018-05-27 00:37:45 +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 3d86ec2bc0 Remove dead code from research 2018-03-26 20:36:16 +02:00
Michael Steenbeek 919533d7c2 Show ride and vehicle names in research list 2018-03-21 22:04:10 +01:00
Ted John d22572d0b9 Remove rct_object_entry_extended 2018-02-12 12:48:41 +00:00
Ted John 4d8fe051e8 Remove most usages of object_entry_groups 2018-02-12 12:48:41 +00:00
Ted John d905dde070 Simplify selected object flags 2018-02-12 12:48:41 +00:00