From 4082610527da9fecf9e7175454a80ea650b65e9b Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 1 Nov 2026 00:09:59 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/AdventureGuide/UIAdventureGuide.cpp, Source/UI/AdventureGuide/UIAdventureGuide.h Batch #9056 by youko: 0 byte-identical, 2 confirmed by peer review. - fn_14306 CUIListBox::CreateItem: logic confirmed by peer review - fn_14309 AdventureGuide::CUIItem::RequestNavigation: logic confirmed by peer review Peer-reviewed-by: pedrao, dori, doczeira Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 56 +++++++++++++++++++ Source/UI/AdventureGuide/UIAdventureGuide.h | 4 ++ 2 files changed, 60 insertions(+) diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index 52def3a5..6d1c3fe8 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -17,6 +17,7 @@ #include "UI/Window/UIWindowMgr.h" #include "Utility/Cipher/XorBytes.h" #include "Utility/Text/FormatString.h" +#include "Utility/Text/StringUtil.h" #include "Contents/Items/ItemDescription.h" #include #include @@ -61,6 +62,7 @@ template void CUIListBoxEx::UpdateScrollBar(); template void CUIListBox::UpdateScrollBar(); template <> __declspec(noinline) void CUIListBox::SelectItem(CUIListItem* item); +template <> AdventureGuide::CUISubTab* CUIListBox::CreateItem(); // OFFSET: 0x009C28B0 // OFFSET: 0x009C2980 @@ -1990,3 +1992,57 @@ CUIAdventureGuide::CUIAdventureGuide() CUIAdventureGuide* CreateAdventureGuide() { return new CUIAdventureGuide(); } + +// OFFSET: 0x009DB280 +// FUNCTION: fn_14306 +template <> +AdventureGuide::CUISubTab* CUIListBox::CreateItem() { + AdventureGuide::CUISubTab* item = new AdventureGuide::CUISubTab(*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::CUISubTab* 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 { + +// OFFSET: 0x009DB720 +// FUNCTION: fn_14309 +void CUIItem::RequestNavigation() { + std::string name; + int x = -1; + int y = -1; + std::vector parts = Split(this->unknown_008C, ","); + if (parts.size() > 2) { + name = parts[0]; + x = std::atoi(parts[1].c_str()); + y = std::atoi(parts[2].c_str()); + } + + if (x != -1 && y != -1) { + g_navigationManager.sub_B99030(name, 0, 5, false, x, y, 1002); + } else { + g_navigationManager.sub_B99030(name, 1, 5, false, -1, -1, 1002); + } +} + +// OFFSET: 0x009DB8F0 + +// OFFSET: 0x009DBB80 + +// OFFSET: 0x009DBCB0 + +} diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.h b/Source/UI/AdventureGuide/UIAdventureGuide.h index fa1beaee..d588ee14 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.h +++ b/Source/UI/AdventureGuide/UIAdventureGuide.h @@ -96,6 +96,8 @@ public: void Slot54(int type, int id) override; void BindItem(CUIItemInfo* item, const CItemData& data); void OnSelectItem(CUIItemInfo* item, const CItemData& data); + void RequestNavigation(); + void SearchNavigation(); /* 0084 */ UIWindow* unknown_0084; /* 0088 */ UIWindow* unknown_0088; @@ -135,6 +137,8 @@ public: void Slot54(int type, int id) override; void OnSelectQuest(CUIQuestInfo* item, const CQuestInfo& data); + void RequestNavigation(); + void SearchNavigation(); /* 0084 */ UIWindow* unknown_0084; /* 0088 */ UIWindow* unknown_0088;