diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index d3e210749f..dbf7a39bc3 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -486,6 +486,17 @@ static void WindowRideConstructionResize(rct_window* w) | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP); } } + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) && !gCheatsEnableAllDrawableTrackPieces) + { + // Disable lift hill toggle and banking if current track piece is uphill + if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_25 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_60 + || _currentTrackSlopeEnd == TRACK_SLOPE_UP_25 || _currentTrackSlopeEnd == TRACK_SLOPE_UP_60) + disabledWidgets |= 1ULL << WIDX_CHAIN_LIFT | (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + // Disable upward slope if current track piece is not flat + if ((_previousTrackSlopeEnd != TRACK_SLOPE_NONE || _previousTrackBankEnd != TRACK_BANK_NONE) + && !(_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED)) + disabledWidgets |= (1ULL << WIDX_SLOPE_UP); + } if (_rideConstructionState == RideConstructionState::State0) { disabledWidgets |= (1ULL << WIDX_CONSTRUCT) | (1ULL << WIDX_DEMOLISH) | (1ULL << WIDX_PREVIOUS_SECTION) @@ -857,7 +868,9 @@ static void WindowRideConstructionResize(rct_window* w) { // Enable helix disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN_STEEP); - disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP_STEEP); + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + || gCheatsEnableAllDrawableTrackPieces) + disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP_STEEP); } } if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) @@ -866,7 +879,9 @@ static void WindowRideConstructionResize(rct_window* w) { if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL || _currentTrackCurve == TRACK_CURVE_RIGHT_SMALL) { - if (_currentTrackSlopeEnd == TRACK_SLOPE_NONE && _previousTrackBankEnd != TRACK_BANK_NONE) + if (_currentTrackSlopeEnd == TRACK_SLOPE_NONE && _previousTrackBankEnd != TRACK_BANK_NONE + && (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + || gCheatsEnableAllDrawableTrackPieces)) { disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP); } @@ -2641,6 +2656,13 @@ static void WindowRideConstructionUpdateWidgets(rct_window* w) window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::FlatBtn; } + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + && (_currentTrackSlopeEnd == TRACK_SLOPE_UP_25 || _currentTrackSlopeEnd == TRACK_SLOPE_UP_60) + && !gCheatsEnableAllDrawableTrackPieces) + { + _currentTrackLiftHill |= CONSTRUCTION_LIFT_HILL_SELECTED; + } + int32_t x; if ((IsTrackEnabled(TRACK_LIFT_HILL) && (_currentTrackCurve & RideConstructionSpecialPieceSelected) == 0) || (gCheatsEnableChainLiftOnAllTrack && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))) diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 8436b8cad5..9eca3ac433 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -274,6 +274,7 @@ enum ride_type_flags : uint64_t RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS = (1ULL << 49), RIDE_TYPE_FLAG_IS_SUSPENDED = (1ULL << 50), RIDE_TYPE_FLAG_HAS_LANDSCAPE_DOORS = (1ULL << 51), + RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT = (1ULL << 52), }; // Set on ride types that have a main colour, additional colour and support colour.