From 2f05dc917975d9776b092ddedb0b402cbe6b4ec9 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 20 May 2024 19:26:42 +0200 Subject: [PATCH] Draw vehicle halfway for indeterminate progress --- src/openrct2-ui/windows/ProgressWindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index 96de0ae963..083eed4748 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -147,12 +147,14 @@ namespace OpenRCT2::Ui::Windows GfxDrawSprite(clipDPI, variant.track, trackCoords); GfxDrawSprite(clipDPI, variant.track, trackCoords + ScreenCoordsXY(256, 0)); - if (_totalCount == 0) - return; - - // Draw vehicle to indicate progress + // Figure out where to position the vehicle to indicate progress auto* vehicle = GfxGetG1Element(variant.vehicle); - auto position = (-vehicle->width + 2) + (frame_no % width); + int32_t position; + if (_totalCount > 0) + position = (-vehicle->width + 2) + width * _currentProgress / _totalCount; + else + position = (vehicle->width + width) / 2; + GfxDrawSprite(clipDPI, variant.vehicle, ScreenCoordsXY(position, widget.bottom + 1)); }