rodecomp/Source/Client/Browser/BrowserFactory.cpp
ragnarok-clanker ff7e623705 Confirm fn_17136 (UIWindowMgr::CreateBrowser)
Batch #17115 by eAthena: 1 byte-identical, 0 confirmed by peer review.

- fn_17136 UIWindowMgr::CreateBrowser: byte-identical (already on main)

Merged automatically: every function is byte-identical to the original.
2026-11-11 13:54:41 +00:00

36 lines
1.2 KiB
C++

#include "UI/Window/UIEnums.h"
#include "Client/Application/ApplicationWindow.h"
#include "Client/Application/Launcher.h"
#include "Client/Browser/WebBrowser.h"
#include "Contents/Tables/MessageTable.h"
#include "Resource/MSGSTRINGID.h"
#include "UI/Window/UIWindowMgr.h"
#include <new>
extern template std::pair<std::map<HWND, CWebBrowser*>::iterator, bool> std::map<HWND, CWebBrowser*>::insert<std::pair<HWND, CWebBrowser*>>(std::pair<HWND, CWebBrowser*>&&);
namespace {
constexpr unsigned maximumBrowserCount = 5;
}
// OFFSET: 0x00A8C840
// FUNCTION: fn_17136
CWebBrowser* UIWindowMgr::CreateBrowser(int width, int height) {
if (this->browsers.size() < maximumBrowserCount) {
CWebBrowser* browser = new CWebBrowser();
if (browser && browser->Create(hWnd, g_instance, width, height)) {
this->browsers.insert(std::make_pair(browser->host, browser));
return browser;
}
} else {
g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0);
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(LookupMessage(MSI_FAILED_ADD_TAB)), RGB(255, 0, 0), 0, 0, 0);
}
return nullptr;
}
// OFFSET: 0x00A8C950
// FUNCTION: fn_17137
void __stdcall SubA8C950(int, int) {}