* rct2: 0x0066B905 */
| 728 | * rct2: 0x0066B905 |
| 729 | */ |
| 730 | void WindowResizeGui(int32_t width, int32_t height) |
| 731 | { |
| 732 | WindowResizeGuiScenarioEditor(width, height); |
| 733 | if (isInEditorMode()) |
| 734 | return; |
| 735 | |
| 736 | auto* windowMgr = Ui::GetWindowManager(); |
| 737 | WindowBase* titleWind = windowMgr->FindByClass(WindowClass::titleMenu); |
| 738 | if (titleWind != nullptr) |
| 739 | { |
| 740 | titleWind->windowPos.x = (width - titleWind->width) / 2; |
| 741 | titleWind->windowPos.y = height - 182; |
| 742 | } |
| 743 | |
| 744 | WindowBase* versionWind = windowMgr->FindByClass(WindowClass::titleVersion); |
| 745 | if (versionWind != nullptr) |
| 746 | versionWind->windowPos.y = height - 30; |
| 747 | |
| 748 | WindowBase* exitWind = windowMgr->FindByClass(WindowClass::titleExit); |
| 749 | if (exitWind != nullptr) |
| 750 | { |
| 751 | exitWind->windowPos.x = width - 40; |
| 752 | exitWind->windowPos.y = height - 64; |
| 753 | } |
| 754 | |
| 755 | WindowBase* optionsWind = windowMgr->FindByClass(WindowClass::titleOptions); |
| 756 | if (optionsWind != nullptr) |
| 757 | { |
| 758 | optionsWind->windowPos.x = width - 80; |
| 759 | } |
| 760 | |
| 761 | // Keep options window centred after a resize |
| 762 | WindowBase* optionsWindow = windowMgr->FindByClass(WindowClass::options); |
| 763 | if (optionsWindow != nullptr) |
| 764 | { |
| 765 | optionsWindow->windowPos.x = (ContextGetWidth() - optionsWindow->width) / 2; |
| 766 | optionsWindow->windowPos.y = (ContextGetHeight() - optionsWindow->height) / 2; |
| 767 | } |
| 768 | |
| 769 | // Keep progress bar window centred after a resize |
| 770 | WindowBase* ProgressWindow = windowMgr->FindByClass(WindowClass::progressWindow); |
| 771 | if (ProgressWindow != nullptr) |
| 772 | { |
| 773 | ProgressWindow->windowPos.x = (ContextGetWidth() - ProgressWindow->width) / 2; |
| 774 | ProgressWindow->windowPos.y = (ContextGetHeight() - ProgressWindow->height) / 2; |
| 775 | } |
| 776 | |
| 777 | GfxInvalidateScreen(); |
| 778 | } |
| 779 | |
| 780 | /** |
| 781 | * rct2: 0x0066F0DD |
no test coverage detected