rodecomp/Source/Client/Browser/BrowserFactory.cpp
ragnarok-clanker 382604aae4 Decompile fn_17137 (SubA8C950)
Batch #7381 by gordaoprogramas: 1 byte-identical, 0 confirmed by peer review.

- fn_17137 SubA8C950: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-10-31 06:46:05 +00:00

33 lines
916 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"
namespace {
constexpr unsigned maximumBrowserCount = 5;
}
// OFFSET: 0x00A8C840
// FUNCTION: fn_17136
CWebBrowser* BrowserFactory::Create(int width, int height) {
if (this->registry.browsers.size() >= maximumBrowserCount) {
this->notifications.Refresh();
const char* message = LookupMessage(MessageId::MSI_FAILED_ADD_TAB);
this->notifications.Text(message, RGB(255, 0, 0), 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;
}
// OFFSET: 0x00A8C950
// FUNCTION: fn_17137
void __stdcall SubA8C950(int, int) {}