From af4a47d544ed5e469a587198b7d4aa98679f8ef7 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 15:40:25 +0000 Subject: [PATCH] Decompile 6 functions in Source/UI/AdventureGuide/UIAdventureGuide.cpp, Source/UI/Lists/UIListBoxTemplate.h Batch #5764 by Yommy: 0 byte-identical, 6 confirmed by peer review. - fn_13993 CUIListBox::Slot15: logic confirmed by peer review - fn_13994 CUIListBox::Slot15: logic confirmed by peer review - fn_13995 CUIListBoxEx::Slot15: logic confirmed by peer review - fn_13996 CUIListBoxEx::Slot15: logic confirmed by peer review - fn_13997 CUIListBoxEx::Slot15: logic confirmed by peer review - fn_13998 CUIListBoxEx::Slot15: logic confirmed by peer review Peer-reviewed-by: willerthal, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 45 +++++++++++++++++++ Source/UI/Lists/UIListBoxTemplate.h | 5 ++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index 86e3ec73..41e5ebf6 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -16,6 +16,51 @@ template void CUIListBoxEx::UpdateScrollBar(); template void CUIListBox::UpdateScrollBar(); +// OFFSET: 0x009C28B0 +// OFFSET: 0x009C2980 +// FUNCTION: fn_13993 +// FUNCTION: fn_13994 +template void CUIListBox::Slot15(int width, int height) { + this->scrollBar = new CUIVScrollBar(*this->m_context); + this->scrollBar->Show(0); + this->scrollBar->SetOnChange([this](int position) { + int y = 0; + for (T* item : this->items) { + if (position <= item->geometry.height + y && y < this->geometry.height + position) { + item->Show(1); + item->Move(this->itemX, this->itemY - position + y); + } else { + item->Show(0); + } + y += item->geometry.height; + } + }); + this->AddChild(this->scrollBar); +} + +template void CUIListBox::Slot15(int, int); +template void CUIListBox::Slot15(int, int); + +// OFFSET: 0x009C2A50 +// OFFSET: 0x009C2B20 +// OFFSET: 0x009C2BF0 +// OFFSET: 0x009C2CC0 +// FUNCTION: fn_13995 +// FUNCTION: fn_13996 +// FUNCTION: fn_13997 +// FUNCTION: fn_13998 +template void CUIListBoxEx::Slot15(int width, int height) { + this->scrollBar = new CUIVScrollBar(*this->m_context); + this->scrollBar->Show(0); + this->scrollBar->SetOnChange([this](int position) { this->OnScroll(position); }); + this->AddChild(this->scrollBar); +} + +template void CUIListBoxEx::Slot15(int, int); +template void CUIListBoxEx::Slot15(int, int); +template void CUIListBoxEx::Slot15(int, int); +template void CUIListBoxEx::Slot15(int, int); + // OFFSET: 0x009C12B0 // FUNCTION: fn_13987 template <> diff --git a/Source/UI/Lists/UIListBoxTemplate.h b/Source/UI/Lists/UIListBoxTemplate.h index b55a8542..91e91a4b 100644 --- a/Source/UI/Lists/UIListBoxTemplate.h +++ b/Source/UI/Lists/UIListBoxTemplate.h @@ -150,6 +150,7 @@ struct Contents { template class CUIListBox : public CUIControl { public: + void Slot15(int width, int height) override; // OFFSET: 0x009D23B0 // OFFSET: 0x009D23C0 // FUNCTION: fn_14011 @@ -204,7 +205,9 @@ public: /* 0084 */ unsigned char unknown_0084[0x2C]; /* 00B0 */ CUIVScrollBar* scrollBar; - /* 00B4 */ unsigned char unknown_00B4[0x10]; + /* 00B4 */ unsigned char unknown_00B4[0x08]; + /* 00BC */ int itemX; + /* 00C0 */ int itemY; /* 00C4 */ std::list items; /* 00CC */ T* selected; /* 00D0 */ unsigned char locked;