Fix #5206, #5207: Do not draw all disabled tabs.

PR #5138 had the unintended side-effect of drawing all disabled tabs, stemming from the assumption that !widget_is_disabled would be identical to widget_is_enabled.

I have reverted commit 4b91d92 to follow the original logic more closely, adding an exception for disabled tabs made explicitly visible through a sprite.

The tab PR has been much more involved than I'd originally anticipated. Hopefully, a new widget system will eventually make these things easier.
This commit is contained in:
Aaron van Geffen 2017-02-11 12:45:22 +01:00 committed by Ted John
parent 5f3fc807af
commit 5feaab2f8e
1 changed files with 11 additions and 2 deletions

View File

@ -292,8 +292,17 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, sint32 widget
if (widget->image == -1)
return;
if (widget_is_enabled(w, widgetIndex) || widget->type == WWT_TAB || widget->type != WWT_TRNBTN)
{
// Draw widgets that aren't explicitly disabled.
if (!widget_is_disabled(w, widgetIndex)) {
widget_draw_image(dpi, w, widgetIndex);
return;
}
// Do not draw hidden tabs, unless given a sprite.
if (widget->type == WWT_TAB && widget->image != (0x20000000 | SPR_G2_TAB_DISABLED))
return;
if (widget->type != WWT_TRNBTN) {
widget_draw_image(dpi, w, widgetIndex);
return;
}