mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Make building new track inherit alternate colour scheme from previous piece
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
0.4.20 (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Improved: [#23677] Building new ride track now inherits the colour scheme from the previous piece.
|
||||
|
||||
0.4.19.1 (2025-02-03)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -253,6 +253,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
_currentTrackPrice = kMoney64Undefined;
|
||||
_currentBrakeSpeed = 8;
|
||||
_currentColourScheme = RideColourScheme::main;
|
||||
_currentSeatRotationAngle = 4;
|
||||
|
||||
_currentlySelectedTrack = currentRide->GetRideTypeDescriptor().StartTrackPiece;
|
||||
@@ -2690,7 +2691,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
tempTrackTileElement.AsTrack()->SetRideType(currentRide->type);
|
||||
tempTrackTileElement.AsTrack()->SetHasCableLift(false);
|
||||
tempTrackTileElement.AsTrack()->SetInverted(liftHillAndInvertedState.has(LiftHillAndInverted::inverted));
|
||||
tempTrackTileElement.AsTrack()->SetColourScheme(RideColourScheme::main);
|
||||
tempTrackTileElement.AsTrack()->SetColourScheme(_currentColourScheme);
|
||||
// Skipping seat rotation, should not be necessary for a temporary piece.
|
||||
tempTrackTileElement.AsTrack()->SetRideIndex(rideIndex);
|
||||
|
||||
@@ -3108,6 +3109,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
_selectedTrackType = tileElement->AsTrack()->GetTrackType();
|
||||
if (TrackTypeHasSpeedSetting(tileElement->AsTrack()->GetTrackType()))
|
||||
_currentBrakeSpeed = tileElement->AsTrack()->GetBrakeBoosterSpeed();
|
||||
_currentColourScheme = static_cast<RideColourScheme>(tileElement->AsTrack()->GetColourScheme());
|
||||
_currentSeatRotationAngle = tileElement->AsTrack()->GetSeatRotation();
|
||||
}
|
||||
}
|
||||
@@ -5046,6 +5048,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
properties = _currentSeatRotationAngle << 12;
|
||||
}
|
||||
|
||||
properties |= static_cast<uint8_t>(_currentColourScheme) << 8;
|
||||
|
||||
if (_trackType != nullptr)
|
||||
*_trackType = trackType;
|
||||
if (_trackDirection != nullptr)
|
||||
|
||||
@@ -77,6 +77,7 @@ TrackPitch _previousTrackPitchEnd;
|
||||
CoordsXYZ _previousTrackPiece;
|
||||
|
||||
uint8_t _currentBrakeSpeed;
|
||||
RideColourScheme _currentColourScheme;
|
||||
uint8_t _currentSeatRotationAngle;
|
||||
|
||||
CoordsXYZD _unkF440C5;
|
||||
@@ -441,7 +442,13 @@ std::optional<CoordsXYZ> GetTrackElementOriginAndApplyChanges(
|
||||
}
|
||||
if (flags & TRACK_ELEMENT_SET_COLOUR_SCHEME)
|
||||
{
|
||||
trackElement->SetColourScheme(static_cast<RideColourScheme>(extra_params & 0xFF));
|
||||
auto newScheme = static_cast<RideColourScheme>(extra_params & 0xFF);
|
||||
trackElement->SetColourScheme(newScheme);
|
||||
|
||||
if (_previousTrackPiece == retCoordsXYZ)
|
||||
{
|
||||
_currentColourScheme = newScheme;
|
||||
}
|
||||
}
|
||||
if (flags & TRACK_ELEMENT_SET_SEAT_ROTATION)
|
||||
{
|
||||
@@ -631,12 +638,23 @@ void RideConstructionSetDefaultNextPiece()
|
||||
_currentTrackRollEnd = bank;
|
||||
_previousTrackRollEnd = bank;
|
||||
|
||||
const auto& trackElement = tileElement->AsTrack();
|
||||
|
||||
// Set track slope and lift hill
|
||||
_currentTrackPitchEnd = slope;
|
||||
_previousTrackPitchEnd = slope;
|
||||
_currentTrackHasLiftHill = tileElement->AsTrack()->HasChain()
|
||||
_currentTrackHasLiftHill = trackElement->HasChain()
|
||||
&& ((slope != TrackPitch::Down25 && slope != TrackPitch::Down60)
|
||||
|| GetGameState().Cheats.enableChainLiftOnAllTrack);
|
||||
|
||||
if (TrackTypeHasSpeedSetting(trackElement->GetTrackType()))
|
||||
_currentBrakeSpeed = trackElement->GetBrakeBoosterSpeed();
|
||||
_currentColourScheme = static_cast<RideColourScheme>(trackElement->GetColourScheme());
|
||||
_currentSeatRotationAngle = trackElement->GetSeatRotation();
|
||||
|
||||
_previousTrackPiece.x = trackBeginEnd.begin_x;
|
||||
_previousTrackPiece.y = trackBeginEnd.begin_y;
|
||||
_previousTrackPiece.z = trackElement->GetBaseZ();
|
||||
break;
|
||||
}
|
||||
case RideConstructionState::Back:
|
||||
@@ -679,13 +697,24 @@ void RideConstructionSetDefaultNextPiece()
|
||||
_currentTrackRollEnd = bank;
|
||||
_previousTrackRollEnd = bank;
|
||||
|
||||
const auto& trackElement = tileElement->AsTrack();
|
||||
|
||||
// Set track slope and lift hill
|
||||
_currentTrackPitchEnd = slope;
|
||||
_previousTrackPitchEnd = slope;
|
||||
if (!GetGameState().Cheats.enableChainLiftOnAllTrack)
|
||||
{
|
||||
_currentTrackHasLiftHill = tileElement->AsTrack()->HasChain();
|
||||
_currentTrackHasLiftHill = trackElement->HasChain();
|
||||
}
|
||||
|
||||
if (TrackTypeHasSpeedSetting(trackElement->GetTrackType()))
|
||||
_currentBrakeSpeed = trackElement->GetBrakeBoosterSpeed();
|
||||
_currentColourScheme = static_cast<RideColourScheme>(trackElement->GetColourScheme());
|
||||
_currentSeatRotationAngle = trackElement->GetSeatRotation();
|
||||
|
||||
_previousTrackPiece.x = xyElement.x;
|
||||
_previousTrackPiece.y = xyElement.y;
|
||||
_previousTrackPiece.z = trackElement->GetBaseZ();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "../core/FlagHolder.hpp"
|
||||
#include "../core/Money.hpp"
|
||||
#include "../world/Location.hpp"
|
||||
#include "RideColour.h"
|
||||
#include "Station.h"
|
||||
#include "Track.h"
|
||||
|
||||
@@ -79,6 +80,7 @@ extern TrackPitch _previousTrackPitchEnd;
|
||||
extern CoordsXYZ _previousTrackPiece;
|
||||
|
||||
extern uint8_t _currentBrakeSpeed;
|
||||
extern RideColourScheme _currentColourScheme;
|
||||
extern uint8_t _currentSeatRotationAngle;
|
||||
|
||||
extern CoordsXYZD _unkF440C5;
|
||||
|
||||
Reference in New Issue
Block a user