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

Function InputUpdateTooltip

src/openrct2-ui/input/MouseInput.cpp:1496–1535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1494 }
1495
1496 static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords)
1497 {
1498 if (gTooltipWidget.windowClassification == WindowClass::null)
1499 {
1500 if (gTooltipCursor == screenCoords)
1501 {
1502 if (gCurrentRealTimeTicks >= _tooltipNotShownTimeout && w != nullptr && widgetIndex != kWidgetIndexNull
1503 && widgetIsVisible(*w, widgetIndex))
1504 {
1505 gTooltipCloseTimeout = gCurrentRealTimeTicks + 8000;
1506 WindowTooltipOpen(w, widgetIndex, screenCoords);
1507 }
1508 }
1509 else
1510 {
1511 ResetTooltipNotShown();
1512 }
1513
1514 gTooltipCloseTimeout = gCurrentRealTimeTicks + 8000;
1515 gTooltipCursor = screenCoords;
1516 }
1517 else
1518 {
1519 gTooltipCursor = screenCoords;
1520 ResetTooltipNotShown();
1521
1522 if (w == nullptr || gTooltipWidget.windowClassification != w->classification
1523 || gTooltipWidget.windowNumber != w->number || gTooltipWidget.widgetIndex != widgetIndex
1524 || !widgetIsVisible(*w, widgetIndex))
1525 {
1526 WindowTooltipClose();
1527 }
1528
1529 if (gCurrentRealTimeTicks >= gTooltipCloseTimeout)
1530 {
1531 auto* windowMgr = GetWindowManager();
1532 windowMgr->CloseByClass(WindowClass::tooltip);
1533 }
1534 }
1535 }
1536
1537#pragma endregion
1538

Callers 2

InputWidgetOverFunction · 0.85
InputStateWidgetPressedFunction · 0.85

Calls 6

widgetIsVisibleFunction · 0.85
WindowTooltipOpenFunction · 0.85
ResetTooltipNotShownFunction · 0.85
WindowTooltipCloseFunction · 0.85
GetWindowManagerFunction · 0.85
CloseByClassMethod · 0.80

Tested by

no test coverage detected