mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-28 01:04:50 +01:00
Move WindowFind functions into WindowManager (#23517)
* Move WindowFind* functions into WindowManager * Update parameter documentation where applicable
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <openrct2/actions/LoadOrQuitAction.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/ui/UiContext.h>
|
||||
#include <openrct2/ui/WindowManager.h>
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
@@ -121,10 +122,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
WindowBase* windowToOpen = nullptr;
|
||||
|
||||
auto* windowMgr = GetContext()->GetUiContext()->GetWindowManager();
|
||||
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_START_NEW_GAME:
|
||||
windowToOpen = WindowFindByClass(WindowClass::ScenarioSelect);
|
||||
windowToOpen = windowMgr->FindByClass(WindowClass::ScenarioSelect);
|
||||
if (windowToOpen != nullptr)
|
||||
{
|
||||
WindowBringToFront(*windowToOpen);
|
||||
@@ -137,7 +140,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
break;
|
||||
case WIDX_CONTINUE_SAVED_GAME:
|
||||
windowToOpen = WindowFindByClass(WindowClass::Loadsave);
|
||||
windowToOpen = windowMgr->FindByClass(WindowClass::Loadsave);
|
||||
if (windowToOpen != nullptr)
|
||||
{
|
||||
WindowBringToFront(*windowToOpen);
|
||||
@@ -151,7 +154,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
break;
|
||||
case WIDX_MULTIPLAYER:
|
||||
windowToOpen = WindowFindByClass(WindowClass::ServerList);
|
||||
windowToOpen = windowMgr->FindByClass(WindowClass::ServerList);
|
||||
if (windowToOpen != nullptr)
|
||||
{
|
||||
WindowBringToFront(*windowToOpen);
|
||||
|
||||
Reference in New Issue
Block a user