1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 15:54:31 +01:00

Close #20157: Hide FPS Counter if top toolbar is hidden

This commit is contained in:
Harry Hopkinson
2024-05-04 23:16:23 +01:00
committed by GitHub
parent cd528665e6
commit bbc5a109ef
2 changed files with 15 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
- Improved: [#21855] Add a separator between “Load Game” and “Save Game”, to avoid accidental overwriting.
- Change: [#21715] [Plugin] Remove access to the internal `owner` property. Note: `ownership` is still accessible.
- Change: [#21855] Cheats menu dropdown no longer requires dragging.
- Change: [#21866] Hide the FPS Counter when the top toolbar/widgets have been toggled off.
- Fix: [#866] Boat Hire boats get stuck entering track (original bug).
- Fix: [#10701] No reason specified when placing door over unsuitable track.
- Fix: [#18723, #21870] Attempting to demolish a flat ride in pause mode allows you to place multiple copies.

View File

@@ -103,8 +103,22 @@ void Painter::PaintReplayNotice(DrawPixelInfo& dpi, const char* text)
GfxSetDirtyBlocks({ screenCoords, screenCoords + ScreenCoordsXY{ stringWidth, 16 } });
}
static bool ShouldShowFPS()
{
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO && !TitleShouldHideVersionInfo())
return true;
if (!WindowFindByClass(WindowClass::TopToolbar))
return false;
return true;
}
void Painter::PaintFPS(DrawPixelInfo& dpi)
{
if (!ShouldShowFPS())
return;
ScreenCoordsXY screenCoords(_uiContext->GetWidth() / 2, 2);
MeasureFPS();