mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 14:54:30 +01:00
Simplify tab drawing logic.
This commit is contained in:
@@ -289,22 +289,11 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, sint32 widget
|
|||||||
// Get the widget
|
// Get the widget
|
||||||
rct_widget *widget = &w->widgets[widgetIndex];
|
rct_widget *widget = &w->widgets[widgetIndex];
|
||||||
|
|
||||||
//
|
|
||||||
if (widget->image == -1)
|
if (widget->image == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Draw outline.
|
if (widget_is_enabled(w, widgetIndex) || widget->type == WWT_TAB || widget->type != WWT_TRNBTN)
|
||||||
widget_draw_image(dpi, w, widgetIndex);
|
{
|
||||||
|
|
||||||
// Check if tab is disabled
|
|
||||||
if (!widget_is_disabled(w, widgetIndex))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// ??? Seems superfluous, as this function is only used to draw tabs.
|
|
||||||
if (widget->type == WWT_TAB)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (widget->type != WWT_TRNBTN) {
|
|
||||||
widget_draw_image(dpi, w, widgetIndex);
|
widget_draw_image(dpi, w, widgetIndex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user