MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / WindowResizeGuiScenarioEditor

Function WindowResizeGuiScenarioEditor

src/openrct2/interface/Window.cpp:783–814  ·  view source on GitHub ↗

* rct2: 0x0066F0DD */

Source from the content-addressed store, hash-verified

781 * rct2: 0x0066F0DD
782 */
783 void WindowResizeGuiScenarioEditor(int32_t width, int32_t height)
784 {
785 auto* mainWind = WindowGetMain();
786 if (mainWind != nullptr)
787 {
788 Viewport* viewport = mainWind->viewport;
789 mainWind->width = width;
790 mainWind->height = height;
791 viewport->width = width;
792 viewport->height = height;
793 if (!mainWind->widgets.empty() && mainWind->widgets[WC_MAIN_WINDOW__0].type == WidgetType::viewport)
794 {
795 mainWind->widgets[WC_MAIN_WINDOW__0].right = width;
796 mainWind->widgets[WC_MAIN_WINDOW__0].bottom = height;
797 }
798 }
799
800 auto* windowMgr = Ui::GetWindowManager();
801
802 WindowBase* topWind = windowMgr->FindByClass(WindowClass::topToolbar);
803 if (topWind != nullptr)
804 {
805 topWind->width = std::max(640, width);
806 }
807
808 WindowBase* bottomWind = windowMgr->FindByClass(WindowClass::bottomToolbar);
809 if (bottomWind != nullptr)
810 {
811 bottomWind->windowPos.y = height - 32;
812 bottomWind->width = std::max(640, width);
813 }
814 }
815
816 /**
817 * Update zoom based volume attenuation for ride music and clear music list.

Callers 1

WindowResizeGuiFunction · 0.85

Calls 4

WindowGetMainFunction · 0.85
GetWindowManagerFunction · 0.85
emptyMethod · 0.45
FindByClassMethod · 0.45

Tested by

no test coverage detected