mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 08:52:40 +01:00
Change: Add alternate_colour widget data for boolean button.
Allows boolean button to have different background and button colours.
This commit is contained in:
committed by
Peter Nelson
parent
7953a97cbb
commit
17e7dafa2a
@@ -3002,7 +3002,9 @@ void NWidgetLeaf::Draw(const Window *w)
|
||||
|
||||
case WWT_BOOLBTN: {
|
||||
Point pt = GetAlignedPosition(r, Dimension(SETTING_BUTTON_WIDTH, SETTING_BUTTON_HEIGHT), this->align);
|
||||
DrawBoolButton(pt.x, pt.y, this->colour, this->colour, clicked, !this->IsDisabled());
|
||||
Colours button_colour = this->widget_data.alternate_colour;
|
||||
if (button_colour == INVALID_COLOUR) button_colour = this->colour;
|
||||
DrawBoolButton(pt.x, pt.y, button_colour, this->colour, clicked, !this->IsDisabled());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user