Should fix [#21039 ](https://github.com/OpenRCT2/OpenRCT2/issues/21039).
As it is explained in the issue, the outline and inset code would not respect the DPI bounds in the drawing process by accessing e.g. `*(dst + 1)` to draw an outline, in this case to the right.
#### Approach
I approached this issue by creating a function `GetPixel()` in `TTFSurface` that would return a value if the given x and y coordinates is a part of a TTF text, else 0.
In the for loop, iterating through the TTF text, the if condition
```
if (surface->GetPixel(xx + srcX_start + 1, yy + srcY_start)
|| surface->GetPixel(xx + srcX_start - 1, yy + srcY_start)
|| surface->GetPixel(xx + srcX_start, yy + srcY_start + 1)
|| surface->GetPixel(xx + srcX_start, yy + srcY_start - 1))
```
checks if the coordinates **(xx, yy)** is an outline of a text. the writing bounds. Adding `srcX_start`, which is 0 or `-skipX` if `skipX < 0`, when calling `GetPixel()`, would shift the pixel access to the correct position, where the text begins on the surface. The same is done for the Y axis. (Not having this would lead to the outlines/insets not moving with the text when the window with the TTF text moves)
* Added API for getAllPlugins
Added functionality to the Scripting API to allow Contexts to return a list of all registered plugins.
* Fixed naming conventions, returning list of authors
Changed function names to follow get/set convention. Removed unnecessary copies of shared pointers, now using auto instead. Changed the functionality to return an array of authors instead of a string.
* Added changelog entry
Also added myself to list of contributors
* Moved all functionality to ScPlugin
Created a ScPlugin class and moved the current getPlugins functionality there.
* Changed from method to property
Function names now match the get/set convention for properties. Also did some code cleanup.
* Update copyright
* Bump plugin version
---------
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
- Feature: [#21062] [Plugin] Add API for managing a guest's items.
- Improved: [#18632, #21306] Land ownership and construction rights are now shown on top of the water.
- Improved: [#20951] Activate OpenRCT2 window after using native file dialog on macOS.
- Improved: [#21184] The construction marker for rides, paths and large scenery is now shown on top of the water.
- Improved: [#21192] Tooltips will now follow the cursor.
- Improved: [#21227] Entrance style dropdown is now sorted alphabetically everywhere.
- Change: [#21200] Raise maximum lift speeds of the Reverser Coaster, Side Friction Coaster, and Virginia Reel for RCT1 parity.
- Change: [#21225] Raise maximum allowed misc entities to 1600.
- Fix: [#19494] RCT1 fence gate walls not imported properly if they were placed on slopes.
- Fix: [#20196] New scenarios start with an incorrect temperature.
- Fix: [#20255] Images from the last hovered-over coaster in the object selection are not freed.
- Fix: [#20616] Confirmation button in the track designer’s quit prompt has the wrong text.
- Fix: [#20628] Moving caret using Ctrl+left can move too far when using a multibyte grapheme.
- Fix: [#20631] IME window not positioned correctly.
- Fix: [#20845] Trying to save under a folder with no write permissions causes a crash.
- Fix: [#21054] “No entrance” style is selected by default in the track designer.
- Fix: [#21145] [Plugin] setInterval/setTimeout handle conflict.
- Fix: [#21157] [Plugin] Widgets do not redraw correctly when updating disabled or visibility state.
- Fix: [#21158] [Plugin] Potential crash using setInterval/setTimeout within the callback.
- Fix: [#21171] [Plugin] Crash creating entities with no more entity slots available.
- Fix: [#21178] Inca Lost City’s scenario description incorrectly states there are height restrictions.
- Fix: [#21179] Additional missing land/construction rights tiles in Inca Lost City & Renovation.
- Fix: [#21198] [Plugin] Setting brake or booster speeds on a tile element doesn’t work.
- Fix: [#21290] Sound keeps playing when paused from fast-forward mode.
- Fix: [#21291] Hungry guests heading to any flat ride do not count for warning threshold (original bug).
- Fix: [#21309] Africa - Oasis & Blackpool Pleasure Beach’s monorails are built outside the park’s land rights.
- Fix: [#21316] Isolated land for sale tile on Extreme Hawaiian Island.
In `PeepProblemWarningsUpdate()`, when determining the number of hungry guests that need help (in order to check whether the threshold for showing the warning about hungry guests is reached), guests that are heading towards any flat ride (checked using the `RIDE_TYPE_FLAG_FLAT_RIDE` on the ride the guest is heading to (if any)) are discarded.
For thirsty guests (and those needing to go to the toilet) on the other hand, the more specific `RIDE_TYPE_FLAG_SELLS_DRINKS` (or `RIDE_TYPE_FLAG_IS_TOILET`) is used. (So, a guest that becomes thirsty while on its way to the merry-go-round would count for the threshold here.)
This PR makes the function use the more specific `RIDE_TYPE_FLAG_SELLS_FOOD` for hungry guests, so it's consistent with the other cases.
* Add API for guest items in openrct2.d.ts
* Create GuestItem interfaces
* Set fields to readonly and add documentation
* Implement getting items array
* Implement checking if a guest has an item
* Implement removing items from guests
* Implement giving a guest an item
* Re-merge GuestItemType with FoodDrinkType
* Add more data validation for the EnumMaps
* Update versioning and changelog
* Add some errors to the give_item method
* Bump network version
* Update VoucherType to if/else
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
* Add static_assert to ScGuest.hpp
---------
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>