1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 10:52:41 +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

@@ -375,7 +375,7 @@ struct ScriptSettingsWindow : public Window {
bool editable = this->IsEditableItem(config_item);
if (config_item.flags.Test(ScriptConfigFlag::Boolean)) {
DrawBoolButton(br.left, y + button_y_offset, current_value != 0, editable);
DrawBoolButton(br.left, y + button_y_offset, COLOUR_YELLOW, COLOUR_MAUVE, current_value != 0, editable);
} else {
int i = static_cast<int>(std::distance(std::begin(this->visible_settings), it));
if (config_item.complete_labels) {