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;