rodecomp/Source/Client/Browser/BrowserFactory.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

27 lines
791 B
C++

#include "Client/Browser/BrowserRegistry.h"
#include "Client/Browser/WebBrowser.h"
#include "Contents/MessageTable.h"
#include "Client/Browser/BrowserFactory.h"
#include "UI/Chat/ChatNotifications.h"
#include <new>
// OFFSET: 0x00A8C840
// FUNCTION: fn_17136
CWebBrowser* BrowserFactory::Create(int width, int height) {
if (this->registry.browsers.size() >= 5) {
this->notifications.Refresh();
const char* message = LookupMessage(1578, this->languagePrefix, this->serviceType, this->language);
this->notifications.Text(message, 255, nullptr, 0, false);
return nullptr;
}
auto* browser = new CWebBrowser(this->context);
if (browser->Create(width, height)) {
this->registry.browsers.emplace(browser->host, browser);
return browser;
}
return nullptr;
}