From 60f8e2a65569c1b1426f4d64149ee14efcee0926 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 00:00:00 +0000 Subject: [PATCH] Decompile fn_12325 (UIBabyAcceptWnd2::SendMsg) Batch #1929 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_12325 UIBabyAcceptWnd2::SendMsg: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 50 +++++++++++++++++++++ Source/UI/Acceptance/UIJoinPartyAcceptWnd.h | 5 +++ 2 files changed, 55 insertions(+) diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index f89ff72..b8cb578 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -848,6 +848,56 @@ void UISayDialogWnd::Resize(int width, int height) { } } +// OFFSET: 0x008F6AC0 +// FUNCTION: fn_12325 +int UIBabyAcceptWnd2::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(110); + this->m_context->mode->SendModeMessage(173, this->identity, 1, 0, 0); + } else if (a == 185) { + this->m_frameContext->windows.CloseWindow(110); + this->m_context->mode->SendModeMessage(173, this->identity, 0, 0, 0); + } + return 0; + } + + if (message == 91) { + this->identity = static_cast(a); + const std::string text = this->m_acceptance->text.buttons.services.MessageText(2965); + 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 == 0x542E) { + unsigned offset = 6; + bool scanning = true; + while (scanning && offset < length) { + std::int32_t size; + std::memcpy(&tag, packet + offset, sizeof(tag)); + std::memcpy(&size, packet + offset + 2, sizeof(size)); + offset += 6; + if (tag != 0x542F) { + offset += size; + } + if (tag == 0x542F) { + scanning = false; + } + } + } + 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 35bb492..252dc68 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h @@ -61,6 +61,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 UIBabyAcceptWnd2 : 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);