From 47a630ce98c82f65e0a43662ec97d56229972bb8 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 19:47:12 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp, Source/UI/ProbabilityTable/UIProbabilityTable.h, ... Batch #6096 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_16206 CUIListBoxEx::RebindIndex: logic confirmed by peer review - fn_16207 CUIProbabilityTable::SendMsg: logic confirmed by peer review Peer-reviewed-by: alisonrag, Lumen, Snow Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). Adds to the build: Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp --- Source/UI/Lists/UIListBoxTemplate.h | 2 +- .../UI/ProbabilityTable/UIProbabilityTable.h | 7 ++-- .../UIProbabilityTableEvents.cpp | 32 +++++++++++++++++++ data/compile.json | 1 + 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp diff --git a/Source/UI/Lists/UIListBoxTemplate.h b/Source/UI/Lists/UIListBoxTemplate.h index 925146aa..814fcf32 100644 --- a/Source/UI/Lists/UIListBoxTemplate.h +++ b/Source/UI/Lists/UIListBoxTemplate.h @@ -270,7 +270,7 @@ public: this->items.clear(); this->selected = static_cast(-1); } - + bool RebindIndex(int index); void SelectItem(CUIListItem* item); bool SelectIndex(int index); diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.h b/Source/UI/ProbabilityTable/UIProbabilityTable.h index ef31c1a8..b06b24e0 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.h +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.h @@ -32,14 +32,17 @@ public: }; } - +class CUIEditBoxEx; class CUIProbabilityTable : public CUIFrameWnd { public: void Paint() override; virtual void Slot53(); - + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; void OnButtonClick(); void OnPrepareItem(ProbabilityTable::CUIItem* item, const ProbabilityTable::CItemData& data); + + /* 00D8 */ unsigned char unknown_00D8[0x08]; + /* 00E0 */ CUIEditBoxEx* m_searchEdit; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp b/Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp new file mode 100644 index 00000000..21e33cc2 --- /dev/null +++ b/Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp @@ -0,0 +1,32 @@ +#include "UI/ProbabilityTable/UIProbabilityTable.h" + +#include "UI/Edit/UIEditBoxEx.h" + +#include + +// OFFSET: 0x00A4E3B0 +// FUNCTION: fn_16206 +template <> +bool CUIListBoxEx::RebindIndex(int index) { + if (index != -1) { + for (ProbabilityTable::CUIItem* item : this->items) { + if (index == item->index) { + if (!this->binder) { + return false; + } + this->binder(item, *std::next(this->data.begin(), index)); + return true; + } + } + } + return false; +} + +// OFFSET: 0x00A4E490 +// FUNCTION: fn_16207 +int CUIProbabilityTable::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { + if (message == 177) { + this->m_searchEdit->SetFocus(); + } + return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); +} diff --git a/data/compile.json b/data/compile.json index fa44f615..d08a24ef 100644 --- a/data/compile.json +++ b/data/compile.json @@ -888,6 +888,7 @@ "Source/UI/Party/UIRequestJoinPartyWnd.cpp": 2, "Source/UI/PriceCommission.cpp": 2, "Source/UI/ProbabilityTable/UIProbabilityTable.cpp": 2, + "Source/UI/ProbabilityTable/UIProbabilityTableEvents.cpp": 2, "Source/UI/Quest/UIOngoingQuestInfo.cpp": 2, "Source/UI/Quest/UIQuestDisplay.cpp": 2, "Source/UI/Quest/UIRecommendedQuestInfo.cpp": 2,