Commit Graph

208 Commits

Author SHA1 Message Date
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
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Gymnasiast 66dbb5e166
Refactor access to ResearchItem's rawValue 2020-01-26 15:17:37 +01:00
Tulio Leao 2cd3add373 Make CursorState store a ScreenCoordsXY object 2019-12-14 23:30:55 -03:00
Tulio Leao fe3d6f6faf Use ScreenCoordsXY for scroll_mouse* functions 2019-11-14 08:40:40 -03:00
Matt cc6321048f
Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02:00
Duncan ab5f5b20cd
Use enum class for RCT2_SOUND (#9618)
* Use enum class for RCT2_SOUND

* Fix formatting. Fix mistaken declaration.

* Change name of enum to SoundId

* Fix clang format
2019-07-22 19:02:45 +01:00
Filip Gawin 6833da77e3 Simplify boolean expresions 2019-05-10 22:00:38 +02:00
Michael Steenbeek 42a1a8704d
Use empty() for vectors; clean up bool comparisons (#9118) 2019-04-20 20:39:47 +02:00
Michael Steenbeek c841ee31e7
Remove more remains of scenario description from Object Selection window 2019-03-25 17:21:53 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin b60d97ef55 Use enum values for the savePromptMode 2019-02-22 09:08:04 +00:00
duncanspumpkin eadef45ffd Add LoadOrQuiteAction 2019-02-22 09:00:38 +00:00
Michał Janiszewski 8a70b29f64
Fix GCC's warning regarding enum vs non-enum values being compared (#8551) 2019-01-04 21:29:44 +01:00
Ted John fa3374c827 Fix #8484: Object selection doesn't work
Revert change to _filter_object_counts from d145ae6922
2018-12-22 11:18:17 +00:00
Michael Steenbeek e2a91e55e5
Fix compile error in EditorObjectSelection.cpp 2018-12-16 17:10:45 +01:00
Michael Steenbeek d145ae6922
Fix #8450: Track designer window has drawing problems and crashes 2018-12-16 10:02:40 +01:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Ted John 76d761c299 Fix #8414: Rides tab in object selection window is broken
Widgets were still being created for disabled object types which were placed at same position as ride tab.
2018-12-10 19:50:12 +00:00
Ted John 9dc860b526 Fix compile errors 2018-12-10 00:26:12 +00:00
Ted John 4b77d76303 Hide new object tabs until we have new save format 2018-12-09 23:30:40 +00:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
Michael Steenbeek 5cd4057c76
Remove remnants of STEX support 2018-08-29 23:29:45 +02:00
Gymnasiast 45b8ca9421 Remove more strings, fix error 2018-08-12 15:56:47 +02:00
Gymnasiast 0ba233efa4 Fix formatting 2018-07-31 22:27:00 +02:00
Gymnasiast edaebd5163 Protect against Sources being null 2018-07-30 22:01:04 +02:00
Gymnasiast b257619418 Use vector for source games 2018-07-30 21:41:12 +02:00
Michael Steenbeek 2a64ec7aff Use sourceGame parameter in JSON files instead of originalId 2018-07-30 21:39:27 +02:00
Michael Steenbeek 71bd110526 Fix filtering 2018-07-30 21:33:31 +02:00
Ted John ec0d35bac7 Add new source field to ORI struct 2018-07-30 21:32:07 +02:00
Michael Steenbeek 5ce76e1603 Attempt at showing secondary source game 2018-07-30 21:28:55 +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
Aaron van Geffen 35242f4815 Improve scrolling behaviour in object selection window (#7607) 2018-06-03 14:46:17 +02:00
Michał Janiszewski a2ef4bd699
Exclude pre-formatted blocks from clang-format (#7520)
[ci skip]
2018-05-16 20:41:29 +02:00
Ted John 6f00e6aafe Make ObjectRepositoryItem C++ 2018-05-15 00:36:35 +01:00
Ted John f8271e93b0 Refactor code base to allow easy addition of new object types 2018-05-15 00:32:36 +01:00
Ted John 124fb0df90 Fix out of bounds error in window_editor_object_selection_scroll_mouseover 2018-04-09 17:46:43 +01:00
Ted John 63e9275b60 Protect against unknown ride types 2018-03-30 16:58:12 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01: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
Gymnasiast f003366d22 Remove STEX selection from Object Selection window 2018-02-09 13:47:15 +01:00
Gymnasiast b1ab852fb7 Add object_entry_get_type() 2018-02-09 13:47:15 +01:00
Ted John 522e113929 Fix wrong highlighted tab in object selection window 2018-02-04 12:34:41 +00:00
Michael Steenbeek b4018d398c
Add more object source filters 2018-01-31 13:07:20 +01:00
Gymnasiast 6bd0b2baea Show ride group name in Object Selection 2018-01-29 20:09:05 +01:00
Gymnasiast e8b2a3df0d Slight research refactor 2018-01-29 12:52:12 +01:00
Ted John 02d783a993 Fix build 2018-01-21 12:41:42 +00:00
Ted John 7f8b795842 Refactor memory handling in EditorObjectSelection.cpp 2018-01-21 11:17:41 +00: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 d2de1a4a95 Abstract access to gResearchedRide{Types,Entries} 2018-01-10 15:31:47 +01:00
Michael Steenbeek 0ae5d7d476 Remove research_remove_non_separate_vehicle_types()
This removes more usages of the SEPARATE_RIDE flag.
2018-01-09 21:35:10 +01:00
Aaron van Geffen ecc1cfed2a Rename WWT_DROPDOWN_BUTTON to WWT_BUTTON.
The previous name implied an exclusive association with dropdowns.
While used to display the dropdown triangle button, this is not an
exclusive use.
2018-01-08 00:01:32 +01:00
Aaron van Geffen 9a2d3b226c Rename WWT_13 to WWT_TABLE_HEADER.
This is used for left-aligned header buttons for data tables.
2018-01-07 23:54:51 +01:00
Ted John 83d1b6eb8f Refactor widget.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
Michael Steenbeek 31bf792538 Refactor research - spike 1
This involves refactoring gResearchedRideTypes and gResearchedRideEntries
and the functions involved.

Also renames some functions in order to better express what they do.
2018-01-04 17:44:51 +01:00
Michał Janiszewski 33a94fe1bb Use C++ headers in C++ code 2018-01-04 07:36:54 +01:00
Michael Steenbeek 347ff702d0 Refactor objects 2018-01-03 10:16:51 +01:00
Marijn van der Werf 1e946fc0fe Move Dropdown to UI project 2017-12-16 15:47:38 +02:00
Ted John 31e112cf3b Use std::string for objects 2017-12-14 14:38:14 +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 e3c52360db Remove most usages of separate flag
This removes most usages of the separate flag, instead relying on ride groups to do its job.
Research is more complicated and will follow in another commit.
2017-12-08 10:28:29 +01:00
Marijn van der Werf 2d776de772 Extract functions from EditorObjectSelection 2017-12-07 17:52:03 +01:00
Marijn van der Werf 862ab26cc1 Move object selection window to UI module 2017-12-07 17:52:03 +01:00
Renamed from src/openrct2/windows/EditorObjectSelection.cpp (Browse further)