From 2edca0dbf5808fcfe37d989c0215bc811dace4d1 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 17:24:03 +0000 Subject: [PATCH] Decompile fn_09842 (UIMacroReporterWnd::sub_7EF680) Batch #10794 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_09842 UIMacroReporterWnd::sub_7EF680: logic confirmed by peer review Peer-reviewed-by: Tanke, dori, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/UIMacroUserInfoWnd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index 8f9f5f44..847910e2 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -152,6 +152,7 @@ std::string UIMacroReporterWnd::sub_7EF680(int maxWidth, const char* text, int f std::string fitted(text); std::wstring wide(ATL::CA2WEX<128>(text, CP_THREAD_ACP)); + while (wide.size() > 1) { if (wide.size() >= 2) { const std::size_t size = wide.size(); @@ -159,15 +160,14 @@ std::string UIMacroReporterWnd::sub_7EF680(int maxWidth, const char* text, int f wide.resize(size - cut); } - fitted = ATL::CW2AEX<128>(wide.c_str(), CP_THREAD_ACP); - fitted += "..."; + fitted = std::string(ATL::CW2AEX<128>(wide.c_str(), CP_THREAD_ACP)) + "..."; + if (this->TextWidth(fitted.c_str(), 0, font, height, bold, 0) <= maxWidth) { return fitted; } } - fitted = ATL::CW2AEX<128>(wide.c_str(), CP_THREAD_ACP); - fitted += "..."; + fitted = std::string(ATL::CW2AEX<128>(wide.c_str(), CP_THREAD_ACP)) + "..."; return fitted; }