From 3696ff7cd08bab5e095ddbb2a232ce162bbf414c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 1 Nov 2026 14:07:56 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Edit/UIEditCtrl.cpp, Source/UI/Dialogs/UIPasswordWnd.h Batch #9464 by secret: 0 byte-identical, 2 confirmed by peer review. - fn_13438 UIItemDropCntWnd::Show: logic confirmed by peer review - fn_13443 UIItemWnd::RefreshItems: logic confirmed by peer review Peer-reviewed-by: meitogi, Toshiro, seumadruga Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Dialogs/UIPasswordWnd.h | 1 + Source/UI/Edit/UIEditCtrl.cpp | 50 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/Source/UI/Dialogs/UIPasswordWnd.h b/Source/UI/Dialogs/UIPasswordWnd.h index 484b23f0..1c052390 100644 --- a/Source/UI/Dialogs/UIPasswordWnd.h +++ b/Source/UI/Dialogs/UIPasswordWnd.h @@ -16,6 +16,7 @@ public: /* 00B4 */ UIEditCtrl* m_edit; /* 00B8 */ std::uint32_t unknown_00B8; + void Show(int visible) override; void Paint() override; void Slot15(int width, int height) override; }; diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index f8eb2af0..7c8fcbc2 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -7152,6 +7152,22 @@ int UIMerchantItemPurchaseMSGWnd::SendMsg(UIWindow* sender, int message, std::in } // OFFSET: 0x00995170 +// FUNCTION: fn_13443 +void UIItemWnd::RefreshItems() { + this->items.clear(); + for (int i = 0; i < reinterpret_cast(&g_session)->GetList0Size(); ++i) { + ITEM_INFO item = g_session.GetInventoryItemAt(i); + if (item.unknown_0074[0] == 1) { + this->items.push_back(item); + } + } + + if (g_sortPrivateTab) { + this->items.sort(ItemTypeNameLess()); + } + this->Invalidate(); + this->UpdateScrollBar(); +} // OFFSET: 0x00995E10 // FUNCTION: fn_13466 @@ -8426,3 +8442,37 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->UpdateScrollBar(); return 0; } + +// OFFSET: 0x009948E0 +// FUNCTION: fn_13438 +void UIItemDropCntWnd::Show(int visible) { + this->geometry.visible = visible; + if (visible) { + CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); + char text[40]; + std::sprintf(text, "%d", gameMode->drag.quantity); + this->m_edit->SetText(text); + InputFocus focus{g_windowMgr.hoverWindow}; + focus.Set(this->m_edit); + this->m_edit->SelectAll(); + + const char* dragName = gameMode->DragItemName(); + std::string name; + if (dragName) { + ITEM_INFO item; + item.itemId = dragName; + item.unknown_0060 = 0; + item.identified = gameMode->drag.identified; + name = item.DisplayName(0); + } + + reinterpret_cast(this->unknown_00B8)->SetTextFittedCodePage(name.c_str()); + this->Invalidate(); + this->m_frameContext->snapping.Store(this); + } else { + if (this->m_edit == g_windowMgr.GetHoverWindow() && g_chatSuggestions) { + reinterpret_cast(g_chatSuggestions)->SendMsg(nullptr, 54, 0, 0, 0, 0); + } + g_windowMgr.RemoveSnapRectangle(this); + } +}