MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / DropdownIndexFromPoint

Function DropdownIndexFromPoint

src/openrct2-ui/windows/Dropdown.cpp:504–512  ·  view source on GitHub ↗

* New function based on 6e914e * returns -1 if index is invalid */

Source from the content-addressed store, hash-verified

502 * returns -1 if index is invalid
503 */
504 int32_t DropdownIndexFromPoint(const ScreenCoordsXY& loc, WindowBase* w)
505 {
506 if (w->classification == WindowClass::dropdown)
507 {
508 auto* ddWnd = static_cast<DropdownWindow*>(w);
509 return ddWnd->GetIndexFromPoint(loc);
510 }
511 return -1;
512 }
513
514 // Colour ordered for use in colour dropdown
515 static constexpr Colour kColoursDropdownOrder[] = {

Callers 1

InputStateWidgetPressedFunction · 0.85

Calls 1

GetIndexFromPointMethod · 0.80

Tested by

no test coverage detected