1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Grey-out tree parameters when tree placement is unchecked

This commit is contained in:
Aaron van Geffen
2024-09-22 11:16:50 +02:00
parent 0be51dd565
commit daba4310d1

View File

@@ -619,6 +619,7 @@ namespace OpenRCT2::Ui::Windows
{
case WIDX_FORESTS_PLACE_TREES:
_settings.trees ^= true;
Invalidate();
break;
case WIDX_TREE_LAND_RATIO:
@@ -732,6 +733,16 @@ namespace OpenRCT2::Ui::Windows
pressed_widgets |= 1uLL << WIDX_FORESTS_PLACE_TREES;
SetPressedTab();
SetWidgetDisabled(WIDX_TREE_LAND_RATIO, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_LAND_RATIO_UP, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_LAND_RATIO_DOWN, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_ALTITUDE_MIN, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_ALTITUDE_MIN_UP, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_ALTITUDE_MIN_DOWN, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_ALTITUDE_MAX, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_ALTITUDE_MAX_UP, !_settings.trees);
SetWidgetDisabled(WIDX_TREE_ALTITUDE_MAX_DOWN, !_settings.trees);
}
void ForestsDraw(DrawPixelInfo& dpi)
@@ -739,7 +750,10 @@ namespace OpenRCT2::Ui::Windows
DrawWidgets(dpi);
DrawTabImages(dpi);
const auto textColour = colours[1];
const auto enabledColour = colours[1];
const auto disabledColour = enabledColour.withFlag(ColourFlag::inset, true);
const auto textColour = _settings.trees ? enabledColour : disabledColour;
// Tree to land ratio, label and value
DrawTextBasic(