1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00

Refactor ride construction window (#17578)

This commit is contained in:
Nikolas Parshook
2022-07-26 10:17:25 -04:00
committed by GitHub
parent e63e682731
commit 628da77c0e
7 changed files with 2571 additions and 2689 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -846,8 +846,6 @@ money32 place_provisional_track_piece(
const CoordsXYZ& trackPos);
extern RideConstructionState _rideConstructionState2;
extern bool _stationConstructed;
extern bool _deferClose;
rct_window* window_get_listening();
rct_windowclass window_get_classification(rct_window* window);

View File

@@ -5879,6 +5879,11 @@ bool Ride::HasRecolourableShopItems() const
return false;
}
bool Ride::HasStation() const
{
return num_stations != 0;
}
std::vector<RideId> GetTracklessRides()
{
// Iterate map and build list of seen ride IDs

View File

@@ -389,6 +389,7 @@ public:
void SetLifecycleFlag(uint32_t flag, bool on);
bool HasRecolourableShopItems() const;
bool HasStation() const;
};
#pragma pack(push, 1)
@@ -1074,7 +1075,6 @@ uint32_t ride_customers_in_last_5_minutes(const Ride* ride);
Vehicle* ride_get_broken_vehicle(const Ride* ride);
void window_ride_construction_do_station_check();
void window_ride_construction_do_entrance_exit_check();
money16 ride_get_price(const Ride* ride);

View File

@@ -54,9 +54,6 @@ money16 gTotalRideValueForMoney;
money32 _currentTrackPrice;
uint16_t _numCurrentPossibleRideConfigurations;
uint16_t _numCurrentPossibleSpecialTrackPieces;
uint32_t _currentTrackCurve;
RideConstructionState _rideConstructionState;
RideId _currentRideIndex;

View File

@@ -39,9 +39,6 @@ extern bool gGotoStartPlacementMode;
extern money32 _currentTrackPrice;
extern uint16_t _numCurrentPossibleRideConfigurations;
extern uint16_t _numCurrentPossibleSpecialTrackPieces;
extern uint32_t _currentTrackCurve;
extern RideConstructionState _rideConstructionState;
extern RideId _currentRideIndex;

View File

@@ -34,11 +34,6 @@ bool gDisableErrorWindowSound = false;
RideConstructionState _rideConstructionState2;
// This variable is updated separately from ride->num_stations because the latter
// is unreliable if currently in station construction mode
bool _stationConstructed;
bool _deferClose;
/**
*
* rct2: 0x006CA162
@@ -410,23 +405,10 @@ void window_ride_construction_do_entrance_exit_check()
{
window_event_mouse_up_call(w, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE);
}
else
{
_deferClose = true;
}
}
}
}
void window_ride_construction_do_station_check()
{
auto ride = get_ride(_currentRideIndex);
if (ride != nullptr)
{
_stationConstructed = ride->num_stations != 0;
}
}
void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piecePos, int32_t type)
{
if (gGotoStartPlacementMode)