Commit Graph

66 Commits

Author SHA1 Message Date
Ted John c13bd04954 Refactor invalidate methods 2019-05-04 14:40:45 +00:00
Ted John 1d296242b4 Improve text colour 2019-05-04 14:09:15 +00:00
Ted John b4a2a94520 Fix build 2019-05-04 14:08:37 +00:00
Richard Fine 480f19c0c6 Add parens to fix operator precedence issue
I missed one... thankfully the CI did not.
2019-05-04 14:08:37 +00:00
Richard Fine 9bb68a7151 Pull window width into temporary variable
As suggested in review, it's a little easier to read this way.
2019-05-04 14:08:37 +00:00
Richard Fine b714f7b0e2 Use constexpr instead of const
For a static constant integer value, it's stylistically clearer to use constexpr instead of const. The resulting variable is implicitly const, but is also guaranteed to have a compile-time-computable value.
2019-05-04 14:08:37 +00:00
Richard Fine 97bcc53637 Eliminate itoa and use correct format specifiers
Use snprintf instead of _itoa as it's not available on all platforms. Also change the format specifies for unsigned variables to %u instead of %i, to be more correct...
2019-05-04 14:08:37 +00:00
Richard Fine 397b044588 Use safe_strcat instead of strcat_s
strcat_s is not available on all platforms, and we have a utility in the codebase that does basically the same thing already.
2019-05-04 14:08:37 +00:00
Richard Fine cfda3fb8f7 Use sizeof(buffer) instead of hardcoded size
Use sizeof(buffer) instead of repeating 4096 in a bunch of places. Also, 4096 was maybe a bit overkill, drop it down to 512 instead.
2019-05-04 14:08:37 +00:00
Richard Fine 8bf72ceadb More peep pathing info
Show more peep debug data in the Guest debug tab, mostly to help with understanding pathfinding behaviour.
2019-05-04 14:08:37 +00:00
Richard Fine 7300a38ce6 Show peep coordinates in debug tab
As a first debug stat to show, display a peep's current coordinates in the debug tab
2019-05-04 14:08:37 +00:00
Richard Fine 70c61d5ac6 Fix guest window width for debugging tab
Introduce a named constant for the width of a tab in the Guest window, and touch the places that set the window width to add it to the minimum window width when the debugging tab is enabled, so that the tab doesn't render off the side of the window.
2019-05-04 14:08:37 +00:00
Richard Fine 5ef07ab936 Formatting 2019-05-04 14:08:37 +00:00
Richard Fine fa63691d17 Disable guest debug tab when debug tools not turned on
Disable the debug tab in the guest window when the debugging tools are not turned on, causing it to be completely hidden from view.
2019-05-04 14:08:37 +00:00
Richard Fine c4a449f47d Add new debugging tab to the Guest window
Add a new tab to the Guest window which we can use to display debug information and tools for guests. At the moment it's blank and always visible; next step is to make it only show up when debugging tools are enabled.
2019-05-04 14:08:37 +00:00
Michael Steenbeek c8df801e66
Create ShopItemDescriptor 2019-04-26 20:25:11 +02:00
Florian Will 0d3f287447 Add changelog entry, minor code improvements 2019-04-15 19:11:30 +02:00
Florian Will eb6ea8e81d Fix #5893: Invalidate widget only if it's visible
Remove the widget_invalidate() call after changing a guest's
guest_heading_to_ride_id, because that call fails a debug assertion if
the guest window is open and the currently active tab is not the
"overview" tab. In Release builds (if assertion is disabled),
widget_invalidate() might access the widgets array out of bounds.

Instead, introduce a new flag PEEP_INVALIDATE_PEEP_ACTION for
window_invalidate_flags in the peep struct and set that flag. The guest
window update function then makes sure to invalidate the label if the
flag is set.

The flag could be used in other places to reduce libopenrct2 dependency
on window_*() calls (see #6808), but this commit only cares about cases
where the assertion would fail.
2019-04-15 14:26:33 +02:00
Matt 57283a4e2b Fix #8900: Implement GuestSetFlagsAction. 2019-03-17 22:17:04 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Ted John ca023f7c5e Fix #8829: invalid read in window_guest_open 2019-03-09 13:05:12 +00:00
Ted John cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Matt 862ef3018c Use gCurrentRealTimeTicks whenever appropriate. 2018-12-01 17:00:11 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Gymnasiast 45b8ca9421 Remove more strings, fix error 2018-08-12 15:56:47 +02:00
moTechPlz 8784dfbf41 Fix #7462: Guest window goes beyond the map edge on a spiral slide. (#7752) 2018-08-07 16:20:51 +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
Ted John 26666b1da9 Remove empty function: viewport_update_pointers 2018-06-15 23:15:52 +01: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
Ted John 86ca6be58b Fix #7674: Rides show up as random numbers in guest's ride list 2018-06-13 18:32:00 +01:00
Ted John dea935314e Add null check for showing guest's favourite ride 2018-06-13 18:27:32 +01:00
Hielke Morsink 8aa122f54e Use empty initializer lists in the openrct2ui project 2018-06-05 14:37:24 +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 fcf507e051
Spin off shop item stuff to separate files 2018-05-14 19:21:43 +02:00
Hielke Morsink 6e02d6af4c Make peep_has_food, has_item and has_drink member functions 2018-05-05 11:13:22 +01:00
duncanspumpkin 765500adfa Label offsets and functions
Actually save before commiting

Label more peep vars.

Remove unread var

Further refactoring

Fix mistake in map element type
2018-04-11 18:16:09 +01:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01: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 cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Michael Steenbeek 857e64590d Name some rct(1)_peep fields 2018-01-09 10:35:07 +01:00
Aaron van Geffen fad8494ccc Rename WWT_12 to WWT_LABEL_CENTRED.
This is used for centred textual labels.
2018-01-07 23:54:51 +01:00
Ted John 83d1b6eb8f Refactor widget.c to C++ 2018-01-07 12:39:58 +01:00
Ted John f18595a1c1 Refactor viewport.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