From 5d04bb83a766777fc2ba18e8ff0ffbfd5cda6537 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 00:10:46 +0000 Subject: [PATCH] Decompile fn_12326 (UIBabyAcceptWnd::SendMsg) Batch #1958 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_12326 UIBabyAcceptWnd::SendMsg: logic confirmed by peer review Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 58 +++++++++++++++++++++ Source/UI/Acceptance/UIJoinPartyAcceptWnd.h | 5 ++ 2 files changed, 63 insertions(+) diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index fe27235..3cd7177 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -985,6 +985,64 @@ int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, st return 0; } +// OFFSET: 0x008F6D00 +// FUNCTION: fn_12326 +int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { + if (message == 6) { + this->m_acceptance->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + if (a == 184) { + this->m_frameContext->windows.CloseWindow(105); + this->m_frameContext->windows.EnsureWindow(110)->SendMsg(nullptr, 91, 184, b, 0, 0); + } else if (a == 185) { + this->m_frameContext->windows.CloseWindow(105); + this->m_context->mode->SendModeMessage(173, this->identity, 0, 0, 0); + } + return 0; + } + + if (message == 91) { + this->identity = static_cast(a); + std::string text = "("; + text += reinterpret_cast(b); + text += ")"; + text += this->m_acceptance->text.buttons.services.MessageText(794); + this->viewer->Clear(); + this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + return 0; + } + + if (message != 123) { + return UIFrameWnd::SendMsg(sender, message, a, b, c, d); + } + + const auto* packet = reinterpret_cast(a); + const unsigned length = static_cast(b); + std::int16_t tag; + std::memcpy(&tag, packet, sizeof(tag)); + if (tag == 0x53FC) { + unsigned offset = 6; + while (offset < length) { + std::uint32_t size; + std::memcpy(&tag, packet + offset, sizeof(tag)); + std::memcpy(&size, packet + offset + 2, sizeof(size)); + offset += 6; + if (tag == 0x53FD) { + break; + } + if (tag == 0x53FE) { + char name[260]; + std::memset(name, 0, sizeof(name)); + std::memcpy(name, packet + offset, size); + offset += size; + this->SendMsg(nullptr, 91, 0, reinterpret_cast(name), 0, 0); + } else { + offset += size; + } + } + } + return 0; +} + // OFFSET: 0x008F8860 // FUNCTION: fn_12332 int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h index 252dc68..36863db 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h @@ -66,6 +66,11 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; }; +class UIBabyAcceptWnd : public UIExchangeAcceptWnd { +public: + int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; +}; + #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(UIChooseSellBuyWnd) == 200); static_assert(sizeof(UIExchangeAcceptWnd) == 204);