1
0
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:
Peter Nelson
2025-04-21 17:08:10 +01:00
committed by Peter Nelson
parent 7953a97cbb
commit 17e7dafa2a
2 changed files with 15 additions and 1 deletions

View File

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