From 49a4e87e276173bb4813ea49d7c8f82c0822ab94 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 22:45:26 +0000 Subject: [PATCH] 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. --- Source/UI/Text/PixelTextWrapping.cpp | 9 +++------ Source/UI/Window/UIWindow.h | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/UI/Text/PixelTextWrapping.cpp b/Source/UI/Text/PixelTextWrapping.cpp index f20f9fef..6b7b59fd 100644 --- a/Source/UI/Text/PixelTextWrapping.cpp +++ b/Source/UI/Text/PixelTextWrapping.cpp @@ -1,6 +1,7 @@ #include "Render/Text/TextContext.h" #include "UI/Text/PixelTextWrapping.h" #include "UI/Window/UIWindow.h" +#include "Network/TextEncoding.h" #include #include @@ -145,14 +146,10 @@ void WrapPixelText( void UIWindow::sub_8932D0(int* kind, std::vector* lines, const std::string& text) { const char* characters = text.c_str(); if (*kind != 3) { - reinterpret_cast*, int)>(0x00A82310)( - this, characters, lines, this->geometry.width - 16 - ); + WrapPixelText(*this->geometry.surface, static_cast(g_textCodePage), characters, *lines, this->geometry.width - 16); return; } std::vector wrapped; - reinterpret_cast*, std::vector*, int)>(0x00A81FD0)( - this, characters, lines, &wrapped, this->geometry.width - 24 - ); + this->WrapTextWithBreaks(characters, lines, &wrapped, this->geometry.width - 24); } diff --git a/Source/UI/Window/UIWindow.h b/Source/UI/Window/UIWindow.h index 49393cc1..d5671ccf 100644 --- a/Source/UI/Window/UIWindow.h +++ b/Source/UI/Window/UIWindow.h @@ -177,6 +177,7 @@ public: void FlushPrimitives(RenderQueues& queues, bool depthAlpha, float depthStart, float depthEnd); void FillSurface(std::uint32_t color, const tagRECT* rectangle); void sub_8932D0(int* kind, std::vector* lines, const std::string& text); + void WrapTextWithBreaks(const char* text, std::vector* lines, std::vector* breaks, int width); int DrawItemNameSegments( int x, int y, int width, const std::vector& breaks, const char* text, const char* highlight, std::uint32_t highlightColor, std::uint32_t color, int unused, int lineHeight