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).
This commit is contained in:
ragnarok-clanker 2026-10-31 20:46:43 +00:00
commit 50e69cccae
4 changed files with 51 additions and 0 deletions

View file

@ -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 <algorithm>
#include <cstring>
#include <format>
// 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
}

View file

@ -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;

View file

@ -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<void(CUITabButton*)> 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<CUIRecommendedQuestInfo*>(static_cast<UIFrameWnd*>(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<CUIOngoingQuestInfo*>(static_cast<UIFrameWnd*>(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) {

View file

@ -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<CUIQuestItem, unsigned long>* list;