1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-19 22:02:57 +01:00

Fix #21207: Track List window gets positioned incorrectly

This commit is contained in:
Gymnasiast
2025-04-19 14:20:07 +02:00
parent e9e0dc7905
commit 8b6dda09cf
2 changed files with 4 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
- Change: [#24069] [Plugin] Plugins are now available in the scenario editor and track designer.
- Change: [#24135] Compress Emscripten js/wasm files.
- Change: [#24235] Small changes to RCT1 theme.
- Fix: [#21207] Track List window gets positioned incorrectly.
- Fix: [#21919] Non-recolourable cars still show colour picker.
- Fix: [#22182] [Plugin] Crash when using map.getAllEntities("car").
- Fix: [#22634] Asset packs with sound effect overrides are not loaded correctly at startup.

View File

@@ -756,19 +756,18 @@ namespace OpenRCT2::Ui::Windows
auto* windowMgr = Ui::GetWindowManager();
windowMgr->CloseConstructionWindows();
WindowFlags flags = 0;
ScreenCoordsXY screenPos{};
if (gLegacyScene == LegacyScene::trackDesignsManager)
{
int32_t screenWidth = ContextGetWidth();
int32_t screenHeight = ContextGetHeight();
screenPos = { screenWidth / 2 - 300, std::max(kTopToolbarHeight + 1, screenHeight / 2 - 200) };
flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN;
}
else
{
screenPos = { 0, kTopToolbarHeight + 2 };
}
return windowMgr->Create<TrackListWindow>(WindowClass::TrackDesignList, WW, WH, 0, item);
return windowMgr->Create<TrackListWindow>(WindowClass::TrackDesignList, screenPos, WW, WH, flags, item);
}
void WindowTrackDesignListReloadTracks()