From 50e69cccaeb7cbf59cf2ca59c1126cdd5867d252 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 20:46:43 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Quest/UIRecommendedQuestInfo.cpp, Source/UI/Quest/UIRecommendedQuestInfo.h, ... Batch #8745 by youko: 0 byte-identical, 2 confirmed by peer review. - fn_16351 CUIRecommendedQuestInfo::SetQuest: logic confirmed by peer review - fn_16616 RenewQuestUI::CUIQuestList::OnSelectItem: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, System4z, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Quest/UIRecommendedQuestInfo.cpp | 20 ++++++++++++++++ Source/UI/Quest/UIRecommendedQuestInfo.h | 2 ++ Source/UI/Quest/UIRenewQuestUI.cpp | 28 ++++++++++++++++++++++ Source/UI/Quest/UIRenewQuestUI.h | 1 + 4 files changed, 51 insertions(+) diff --git a/Source/UI/Quest/UIRecommendedQuestInfo.cpp b/Source/UI/Quest/UIRecommendedQuestInfo.cpp index 88a69891..4a2fafac 100644 --- a/Source/UI/Quest/UIRecommendedQuestInfo.cpp +++ b/Source/UI/Quest/UIRecommendedQuestInfo.cpp @@ -1,12 +1,16 @@ #include "UI/Quest/UIRecommendedQuestInfo.h" #include "Contents/MessageTable.h" +#include "Contents/RenewQuestMgr.h" #include "Render/Renderer.h" #include "UI/Quest/UIRenewQuestWnd.h" #include "UI/Text/UIStaticTextControl.h" #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowDialogs.h" +#include #include +#include // OFFSET: 0x00A568E0 // FUNCTION: fn_16321 @@ -246,3 +250,19 @@ CUIRecommendedQuestInfo::CUIRecommendedQuestInfo() CUIFrameWnd* CreateRecommendedQuestInfo() { return new CUIRecommendedQuestInfo(); } + +// OFFSET: 0x00A58E00 +// FUNCTION: fn_16351 +void CUIRecommendedQuestInfo::SetQuest(unsigned int questId) { + const auto found = g_renewQuestMgr->m_recommendedQuests.find(questId); + if (found != g_renewQuestMgr->m_recommendedQuests.end()) { + this->titleText->SetText(found->second.m_title.c_str(), found->second.m_title.size()); + this->scrollWindow->SetQuest(questId); + } +} + +namespace RecommendedQuestInfo { + +// OFFSET: 0x00A58E80 + +} diff --git a/Source/UI/Quest/UIRecommendedQuestInfo.h b/Source/UI/Quest/UIRecommendedQuestInfo.h index a2a87ee0..b232e321 100644 --- a/Source/UI/Quest/UIRecommendedQuestInfo.h +++ b/Source/UI/Quest/UIRecommendedQuestInfo.h @@ -22,6 +22,7 @@ public: void OnFirstAction(); void OnClose(); virtual void Slot53(); + void SetQuest(unsigned int questId); /* 00D8 */ CUITitleBar* titleBar; /* 00DC */ CUIStaticImage* background; @@ -48,6 +49,7 @@ public: __declspec(noinline) explicit CUIScrollWindow(UIWindowContext& context); void Slot15(int width, int height) override; void Slot16() override; + void SetQuest(unsigned int questId); /* 0084 */ CUIStaticImage* background; /* 0088 */ CUIStaticImage* topImage; diff --git a/Source/UI/Quest/UIRenewQuestUI.cpp b/Source/UI/Quest/UIRenewQuestUI.cpp index a5abc96f..a8f2f9f1 100644 --- a/Source/UI/Quest/UIRenewQuestUI.cpp +++ b/Source/UI/Quest/UIRenewQuestUI.cpp @@ -10,6 +10,8 @@ #include "Resource/TextureNames.h" #include "UI/Buttons/UIRadioButton.h" #include "UI/Edit/UIEditBoxEx.h" +#include "UI/Quest/UIOngoingQuestInfo.h" +#include "UI/Quest/UIRecommendedQuestInfo.h" #include "UI/Text/UIStaticTextControl.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/WindowDialogs.h" @@ -1128,6 +1130,32 @@ void CUITab::SetOnChange(std::function handler) { this->onChange = handler; } +// OFFSET: 0x00A664C0 +// FUNCTION: fn_16616 +void RenewQuestUI::CUIQuestList::OnSelectItem(CUIQuestItem* item, const unsigned long& questId) { + if (item->questId == 0) { + return; + } + + if (item->questType == 2) { + if (CUIRecommendedQuestInfo* info = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(0x271a)))) { + info->SetQuest(item->questId); + if (UIWindow* other = g_windowMgr.LookupWindow(0x2719)) { + info->Move(other->geometry.x, other->geometry.y); + g_windowMgr.CloseWindow(0x2719); + } + } + } else { + if (CUIOngoingQuestInfo* info = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(0x2719)))) { + info->SetQuest(item->questId); + if (UIWindow* other = g_windowMgr.LookupWindow(0x271a)) { + info->Move(other->geometry.x, other->geometry.y); + g_windowMgr.CloseWindow(0x271a); + } + } + } +} + // OFFSET: 0x00A665C0 // FUNCTION: fn_16617 void RenewQuestUI::CUIQuestList::BindItem(CUIQuestItem* item, const unsigned long& questId) { diff --git a/Source/UI/Quest/UIRenewQuestUI.h b/Source/UI/Quest/UIRenewQuestUI.h index 39008881..86cdf6a3 100644 --- a/Source/UI/Quest/UIRenewQuestUI.h +++ b/Source/UI/Quest/UIRenewQuestUI.h @@ -50,6 +50,7 @@ public: void Paint() override; void Slot16() override; + void OnSelectItem(CUIQuestItem* item, const unsigned long& questId); void BindItem(CUIQuestItem* item, const unsigned long& questId); /* 0080 */ CUIListBoxEx* list;