mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Add custom widget logic and network stats API
This commit is contained in:
@@ -632,8 +632,15 @@ void WindowDrawWidgets(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
// Check if widget is outside the draw region
|
||||
if (w->windowPos.x + widget->left < dpi->x + dpi->width && w->windowPos.x + widget->right >= dpi->x)
|
||||
{
|
||||
if (w->windowPos.y + widget->top < dpi->y + dpi->height && w->windowPos.y + widget->bottom >= dpi->y)
|
||||
WidgetDraw(dpi, w, widgetIndex);
|
||||
{
|
||||
if (w->IsLegacy())
|
||||
WidgetDraw(dpi, w, widgetIndex);
|
||||
else
|
||||
w->OnDrawWidget(widgetIndex, *dpi);
|
||||
}
|
||||
}
|
||||
}
|
||||
widgetIndex++;
|
||||
}
|
||||
@@ -681,6 +688,21 @@ void InvalidateAllWindowsAfterInput()
|
||||
});
|
||||
}
|
||||
|
||||
bool Window::IsLegacy()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Window::OnDraw(rct_drawpixelinfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(this, &dpi);
|
||||
}
|
||||
|
||||
void Window::OnDrawWidget(rct_widgetindex widgetIndex, rct_drawpixelinfo& dpi)
|
||||
{
|
||||
WidgetDraw(&dpi, this, widgetIndex);
|
||||
}
|
||||
|
||||
void Window::InvalidateWidget(rct_widgetindex widgetIndex)
|
||||
{
|
||||
widget_invalidate(this, widgetIndex);
|
||||
|
||||
Reference in New Issue
Block a user