forked from rosebudai/OpenRCT2-Web
Simplify two ride window event functions (#26764)
* ColourUpdate: drop unnecessary call to onPrepareDraw * MusicUpdate: move invalidation to MusicOnPrepareDraw
This commit is contained in:
1 parent
7393fbc661
commit
eee5ebdafd
1 file changed
+8
-13
@@ -4601,7 +4601,6 @@ namespace OpenRCT2::Ui::Windows
|
||||
void ColourUpdate()
|
||||
{
|
||||
currentFrame++;
|
||||
onPrepareDraw();
|
||||
invalidateWidget(WIDX_TAB_5);
|
||||
invalidateWidget(WIDX_VEHICLE_PREVIEW);
|
||||
}
|
||||
@@ -5334,19 +5333,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
void MusicUpdate()
|
||||
{
|
||||
currentFrame++;
|
||||
onPrepareDraw();
|
||||
invalidateWidget(WIDX_TAB_6);
|
||||
|
||||
if (auto ride = GetRide(rideId); ride != nullptr && ride->windowInvalidateFlags.has(RideInvalidateFlag::music))
|
||||
{
|
||||
ride->windowInvalidateFlags.unset(RideInvalidateFlag::music);
|
||||
invalidate();
|
||||
onResize();
|
||||
onPrepareDraw();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
widgetScrollUpdateThumbs(*this, WIDX_MUSIC_DATA);
|
||||
}
|
||||
|
||||
ScreenSize MusicScrollGetSize(int32_t scrollIndex)
|
||||
@@ -5393,6 +5380,14 @@ namespace OpenRCT2::Ui::Windows
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
if (ride->windowInvalidateFlags.has(RideInvalidateFlag::music))
|
||||
{
|
||||
ride->windowInvalidateFlags.unset(RideInvalidateFlag::music);
|
||||
invalidate();
|
||||
onResize();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
// Align music dropdown
|
||||
widgets[WIDX_MUSIC].right = width - 8;
|
||||
widgets[WIDX_MUSIC_DROPDOWN].right = width - 9;
|
||||
|
||||
Reference in new issue
Block a user