1
0
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:
Ted John
2021-01-31 23:23:22 +00:00
parent 82b1a5eb6d
commit 93f17f1175
14 changed files with 262 additions and 7 deletions

View File

@@ -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);