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 {