1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 14:44:28 +01:00

Change: Draw boolean toggle as a slider widget.

This improves usability as the slider position indicates the state instead of a red/green colour change.
This commit is contained in:
Peter Nelson
2025-04-20 20:36:28 +01:00
committed by Peter Nelson
parent e3858e81dc
commit e3d2d68bd4
7 changed files with 16 additions and 11 deletions

View File

@@ -301,7 +301,7 @@ struct NewGRFParametersWindow : public Window {
bool selected = (i == this->clicked_row);
if (par_info.type == PTYPE_BOOL) {
DrawBoolButton(buttons_left, ir.top + button_y_offset, current_value != 0, this->editable);
DrawBoolButton(buttons_left, ir.top + button_y_offset, COLOUR_YELLOW, COLOUR_MAUVE, current_value != 0, this->editable);
} else if (par_info.type == PTYPE_UINT_ENUM) {
if (par_info.complete_labels) {
DrawDropDownButton(buttons_left, ir.top + button_y_offset, COLOUR_YELLOW, this->clicked_row == i && this->clicked_dropdown, this->editable);