Maintenance: Replace raw calls in UIWindow::sub_8932D0: 0x00A82310 -> WrapPixelText (fn_16993, ported free function in this unit) wit

Batch #8897 by ragnarok-clanker: forced by an admin (1 lower score(s), 1 changed function(s)); checked with 388 compiled unit(s), including every includer of Source/UI/Window/UIWindow.h.
This commit is contained in:
ragnarok-clanker 2026-10-31 22:45:26 +00:00
commit 49a4e87e27
2 changed files with 4 additions and 6 deletions

View file

@ -1,6 +1,7 @@
#include "Render/Text/TextContext.h"
#include "UI/Text/PixelTextWrapping.h"
#include "UI/Window/UIWindow.h"
#include "Network/TextEncoding.h"
#include <cstring>
#include <mbstring.h>
@ -145,14 +146,10 @@ void WrapPixelText(
void UIWindow::sub_8932D0(int* kind, std::vector<std::string>* lines, const std::string& text) {
const char* characters = text.c_str();
if (*kind != 3) {
reinterpret_cast<void(__thiscall*)(UIWindow*, const char*, std::vector<std::string>*, int)>(0x00A82310)(
this, characters, lines, this->geometry.width - 16
);
WrapPixelText(*this->geometry.surface, static_cast<unsigned short>(g_textCodePage), characters, *lines, this->geometry.width - 16);
return;
}
std::vector<int> wrapped;
reinterpret_cast<void(__thiscall*)(UIWindow*, const char*, std::vector<std::string>*, std::vector<int>*, int)>(0x00A81FD0)(
this, characters, lines, &wrapped, this->geometry.width - 24
);
this->WrapTextWithBreaks(characters, lines, &wrapped, this->geometry.width - 24);
}