mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-28 17:24:47 +01:00
Introduce MakeTab wrapper function
The MakeTab function is only applied in two places, for the moment: the Cheats and Options windows.
This commit is contained in:
@@ -215,9 +215,21 @@ static void widget_tab_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind
|
||||
// Get the widget
|
||||
rct_widget* widget = &w->widgets[widgetIndex];
|
||||
|
||||
if (static_cast<int32_t>(widget->image) == -1)
|
||||
if (widget->type != WWT_TAB && static_cast<int32_t>(widget->image) == -1)
|
||||
return;
|
||||
|
||||
if (widget->type == WWT_TAB)
|
||||
{
|
||||
if (widget_is_disabled(w, widgetIndex))
|
||||
return;
|
||||
|
||||
if (widget->image != (IMAGE_TYPE_REMAP | SPR_TAB_LARGE))
|
||||
{
|
||||
// Set standard tab sprite to use.
|
||||
widget->image = IMAGE_TYPE_REMAP | SPR_TAB;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw widgets that aren't explicitly disabled.
|
||||
if (!widget_is_disabled(w, widgetIndex))
|
||||
{
|
||||
@@ -225,10 +237,6 @@ static void widget_tab_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not draw hidden tabs, unless given a sprite.
|
||||
if (widget->type == WWT_TAB && widget->image != (IMAGE_TYPE_REMAP | SPR_G2_TAB_DISABLED))
|
||||
return;
|
||||
|
||||
if (widget->type != WWT_TRNBTN)
|
||||
{
|
||||
widget_draw_image(dpi, w, widgetIndex);
|
||||
|
||||
Reference in New Issue
Block a user