1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Move WindowCreate and WindowFocusOrCreate into WindowManager (#23643)

* Move WindowBringToFront into WindowManager

* Move WindowCreate and WindowFocusOrCreate into WindowManager

* Cut back on Context/UiContext includes
This commit is contained in:
Aaron van Geffen
2025-01-19 10:58:28 +01:00
committed by GitHub
parent 66ede938f8
commit bed4d5bdca
113 changed files with 895 additions and 767 deletions

View File

@@ -10,7 +10,6 @@
#include <mutex>
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>
#include <openrct2/Diagnostic.h>
#include <openrct2/core/Console.hpp>
#include <openrct2/core/Http.h>
@@ -25,6 +24,7 @@
#include <openrct2/object/ObjectRepository.h>
#include <openrct2/platform/Platform.h>
#include <openrct2/ui/UiContext.h>
#include <openrct2/ui/WindowManager.h>
#include <openrct2/windows/Intent.h>
#include <sstream>
#include <string>
@@ -576,10 +576,11 @@ namespace OpenRCT2::Ui::Windows
WindowBase* ObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects)
{
// Check if window is already open
auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError);
auto* windowMgr = Ui::GetWindowManager();
auto* window = windowMgr->BringToFrontByClass(WindowClass::ObjectLoadError);
if (window == nullptr)
{
window = WindowCreate<ObjectLoadErrorWindow>(WindowClass::ObjectLoadError, WW, WH, 0);
window = windowMgr->Create<ObjectLoadErrorWindow>(WindowClass::ObjectLoadError, WW, WH, 0);
}
static_cast<ObjectLoadErrorWindow*>(window)->Initialise(path, numMissingObjects, missingObjects);