From 554cb0a513600907412b299aa5edf0af7d19f06c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Mon, 2 Nov 2026 05:10:23 +0000 Subject: [PATCH] Decompile fn_14307 (CUIListBox::CreateItem) Batch #9873 by Montyla: 0 byte-identical, 1 confirmed by peer review. - fn_14307 CUIListBox::CreateItem: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, KWDev, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index 98ce6a40..1ab205a3 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -63,6 +63,7 @@ template void CUIListBox::UpdateScrollBar(); template void CUIListBox::UpdateScrollBar(); template <> __declspec(noinline) void CUIListBox::SelectItem(CUIListItem* item); template <> AdventureGuide::CUISubTab* CUIListBox::CreateItem(); +template <> AdventureGuide::CUITab* CUIListBox::CreateItem(); // OFFSET: 0x009C28B0 // OFFSET: 0x009C2980 @@ -2019,6 +2020,28 @@ AdventureGuide::CUISubTab* CUIListBox::CreateItem() { } // OFFSET: 0x009DB4B0 +// FUNCTION: fn_14307 +template <> +AdventureGuide::CUITab* CUIListBox::CreateItem() { + AdventureGuide::CUITab* item = new AdventureGuide::CUITab(*this->m_context); + item->SetSize(this->itemWidth, this->rowHeight); + item->Show(0); + CResPtr* images = reinterpret_cast*>(reinterpret_cast(this) + 0x80); + item->SetImageResources(images[0], images[1], images[2], images[3]); + item->onHover = [this](CUIListItem* listItem) { + for (AdventureGuide::CUITab* other : this->items) { + other->SetHighlighted(other == listItem); + } + }; + item->onPress = [this](CUIListItem* listItem) { + this->SelectItem(listItem); + }; + this->AddChild(item); + this->items.push_back(item); + this->UpdateScrollBar(); + this->Invalidate(); + return item; +} namespace AdventureGuide {