From 3e4660e96e502f2000f2cd228920ca15ff2d72e1 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 21:12:50 +0000 Subject: [PATCH] Decompile fn_14321 (AdventureGuide::CUIItem::BindItem) Batch #8766 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_14321 AdventureGuide::CUIItem::BindItem: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, Lumen, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 24 ++++++++++++++++++- Source/UI/AdventureGuide/UIAdventureGuide.h | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index 5cc900b2..a62c496c 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -17,7 +17,7 @@ #include "UI/Window/UIWindowMgr.h" #include "Utility/Cipher/XorBytes.h" #include "Utility/Text/FormatString.h" - +#include "Contents/Items/ItemDescription.h" #include #include #include @@ -490,6 +490,28 @@ void CUIQuest::OnSelectQuest(CUIQuestInfo* item, const CQuestInfo&) { this->unknown_0088->Show(selected); } +// OFFSET: 0x009DC320 +// FUNCTION: fn_14321 +void CUIItem::BindItem(CUIItemInfo* item, const CItemData& data) { + ITEM_INFO info; + info.SetItemId(data.id); + item->location = this->location; + info.identified = 1; + item->itemId = data.id; + const ITEM_DESC& desc = FindItemDescription(std::atoi(info.itemId.c_str())); + const std::string image = "유저인터페이스\\collection\\" + std::string(desc.identifiedResource) + ".bmp"; + const std::string name(desc.identifiedName); + item->nameText->SetText(name.c_str(), name.size()); + item->image->SetImage(image); + reinterpret_cast(item)->SetStatusLines(data.first, data.second, data.third); + item->SetDescription(data.type, ItemDescriptions{g_itemDescriptions}.Description(info)); + reinterpret_cast(item->unknown_00F8)->Clear(); + for (const std::string& value : data.values) { + reinterpret_cast(item->unknown_00F8)->AddLine(value); + } + item->unknown_0108 = data.text; +} + // OFFSET: 0x009DC770 // FUNCTION: fn_14323 void __stdcall BindQuestInfo(CUIQuestInfo* owner, const CQuestInfo& data) { diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.h b/Source/UI/AdventureGuide/UIAdventureGuide.h index c5413d6b..fa1beaee 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.h +++ b/Source/UI/AdventureGuide/UIAdventureGuide.h @@ -94,7 +94,7 @@ public: void Slot16() override; void Paint() override; void Slot54(int type, int id) override; - + void BindItem(CUIItemInfo* item, const CItemData& data); void OnSelectItem(CUIItemInfo* item, const CItemData& data); /* 0084 */ UIWindow* unknown_0084;