Decompile 3 functions in Source/UI/Quest/UIOngoingQuestInfo.cpp, Source/UI/Quest/UIOngoingQuestInfo.h
Batch #5894 by Yommy: 0 byte-identical, 3 confirmed by peer review. - fn_16302 OngoingQuestInfo::CUIRewards::OnBindItem: logic confirmed by peer review - fn_16308 CUIOngoingQuestInfo::Slot16: logic confirmed by peer review - fn_16311 OngoingQuestInfo::CUIScrollWindow::Slot16: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, KWDev Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
a4f6673df8
commit
dd160e2b04
2 changed files with 104 additions and 5 deletions
|
|
@ -1,9 +1,23 @@
|
|||
#include "UI/Quest/UIOngoingQuestInfo.h"
|
||||
|
||||
#include "Client/Input/InputCharset.h"
|
||||
#include "Contents/Configuration/ServiceConfiguration.h"
|
||||
#include "Contents/Items/ItemDescription.h"
|
||||
#include "Contents/Items/ItemInfo.h"
|
||||
#include "Contents/Items/ItemNaming.h"
|
||||
#include "Contents/MessageTable.h"
|
||||
#include "Contents/PlayerNameDictionary.h"
|
||||
#include "Render/Renderer.h"
|
||||
#include "UI/Items/UIGameItem.h"
|
||||
#include "UI/Lists/UIVScrollBar.h"
|
||||
#include "UI/Text/UIStaticTextControl.h"
|
||||
#include "UI/Text/UITextViewerControl.h"
|
||||
#include "UI/Window/UIWindowMgr.h"
|
||||
#include "Utility/Text/FormatString.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
template <>
|
||||
void CUIListBoxEx<OngoingQuestInfo::CUIRewardItem, OngoingQuestInfo::CRewardItemData>::OnScroll(int position);
|
||||
|
|
@ -216,3 +230,56 @@ void CUIScrollWindow::OnScroll(int position) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
namespace OngoingQuestInfo {
|
||||
|
||||
// OFFSET: 0x00A55720
|
||||
// FUNCTION: fn_16302
|
||||
void CUIRewards::OnBindItem(CUIRewardItem* item, const CRewardItemData& data) {
|
||||
ITEM_INFO info;
|
||||
info.SetItemId(data.itemId);
|
||||
info.identified = 1;
|
||||
item->gameItem->SetItem(info);
|
||||
|
||||
ItemDescriptions descriptions{g_itemDescriptions};
|
||||
bool languagePrefix = false;
|
||||
WORD language = g_serverLanguage->language;
|
||||
ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language};
|
||||
std::string name = naming.DisplayName(info, 0);
|
||||
item->nameText->SetText(name.c_str(), name.size());
|
||||
std::string count = FormatOwnedString(LookupMessage(0xB6), data.count);
|
||||
item->countText->SetText(count.c_str(), count.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// OFFSET: 0x00A558B0
|
||||
// FUNCTION: fn_16308
|
||||
void CUIOngoingQuestInfo::Slot16() {
|
||||
const char* title = LookupMessage(0xD48);
|
||||
this->titleBar->SetTitle(title, std::strlen(title));
|
||||
UIWindow* window = g_windowMgr.LookupWindow(0x2718);
|
||||
if (window) {
|
||||
this->Move(window->geometry.x + window->geometry.width, window->geometry.y);
|
||||
} else {
|
||||
this->Move((g_renderer->viewport.width - this->geometry.width) / 2, (g_renderer->viewport.height - this->geometry.height) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
namespace OngoingQuestInfo {
|
||||
|
||||
// OFFSET: 0x00A55A90
|
||||
// FUNCTION: fn_16311
|
||||
void CUIScrollWindow::Slot16() {
|
||||
this->firstContents->EnableClip();
|
||||
this->secondContents->EnableClip();
|
||||
this->rewards->EnableClip();
|
||||
const char* first = LookupMessage(0xD49);
|
||||
this->firstContents->title->SetText(first, std::strlen(first));
|
||||
const char* second = LookupMessage(0xD4A);
|
||||
this->secondContents->title->SetText(second, std::strlen(second));
|
||||
const char* reward = LookupMessage(0xD4B);
|
||||
this->rewards->title->SetText(reward, std::strlen(reward));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,18 +5,27 @@
|
|||
#include "UI/Lists/UIListBoxTemplate.h"
|
||||
#include "UI/Window/UIControl.h"
|
||||
|
||||
class CUIStaticText;
|
||||
class CUITextViewer;
|
||||
class CUIGameItem;
|
||||
|
||||
class CUIOngoingQuestInfo : public CUIFrameWnd {
|
||||
public:
|
||||
void Slot16() override;
|
||||
void OnFirstAction();
|
||||
virtual void Slot53();
|
||||
void sub_A55B70();
|
||||
|
||||
/* 00D8 */ CUITitleBar* titleBar;
|
||||
};
|
||||
|
||||
namespace OngoingQuestInfo {
|
||||
|
||||
class CRewardItemData {};
|
||||
class CRewardItemData {
|
||||
public:
|
||||
/* 0000 */ int itemId;
|
||||
/* 0004 */ int count;
|
||||
};
|
||||
|
||||
class CUIContents : public CUIControl {
|
||||
public:
|
||||
|
|
@ -25,7 +34,12 @@ public:
|
|||
|
||||
void UpdateHeight();
|
||||
|
||||
/* 0084 */ unsigned char unknown_0084[0x04];
|
||||
// INLINED
|
||||
void EnableClip() {
|
||||
this->m_clip = 1;
|
||||
}
|
||||
|
||||
/* 0084 */ CUIStaticText* title;
|
||||
/* 0088 */ CUITextViewer* textViewer;
|
||||
};
|
||||
|
||||
|
|
@ -33,6 +47,11 @@ class CUIRewardItem : public CUIListItem {
|
|||
public:
|
||||
void Slot16() override;
|
||||
void Paint() override;
|
||||
|
||||
/* 00E8 */ unsigned char unknown_00E8[0x04];
|
||||
/* 00EC */ CUIGameItem* gameItem;
|
||||
/* 00F0 */ CUIStaticText* nameText;
|
||||
/* 00F4 */ CUIStaticText* countText;
|
||||
};
|
||||
|
||||
class CUIRewards : public CUIControl {
|
||||
|
|
@ -40,22 +59,34 @@ public:
|
|||
void Paint() override;
|
||||
|
||||
void OnPrepareItem(CUIRewardItem* item, const CRewardItemData& data);
|
||||
void OnBindItem(CUIRewardItem* item, const CRewardItemData& data);
|
||||
void UpdateHeight();
|
||||
|
||||
/* 0084 */ unsigned char unknown_0084[0x18];
|
||||
// INLINED
|
||||
void EnableClip() {
|
||||
this->m_clip = 1;
|
||||
}
|
||||
|
||||
/* 0084 */ CUIStaticText* title;
|
||||
/* 0088 */ unsigned char unknown_0088[0x14];
|
||||
/* 009C */ CUIListBoxEx<CUIRewardItem, CRewardItemData>* rewardList;
|
||||
/* 00A0 */ unsigned char unknown_00A0[0x04];
|
||||
};
|
||||
|
||||
class CUIScrollWindow : public CUIControl {
|
||||
public:
|
||||
void Slot16() override;
|
||||
void Paint() override;
|
||||
void Slot35(int value) override;
|
||||
|
||||
void OnScroll(int position);
|
||||
|
||||
/* 0084 */ unsigned char unknown_0084[0x10];
|
||||
/* 0084 */ unsigned char unknown_0084[0x04];
|
||||
/* 0088 */ CUIContents* secondContents;
|
||||
/* 008C */ unsigned char unknown_008C[0x04];
|
||||
/* 0090 */ CUIRewards* rewards;
|
||||
/* 0094 */ UIWindow* scrollBar;
|
||||
/* 0080 */ CUIContents* firstContents;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -63,7 +94,8 @@ public:
|
|||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(OngoingQuestInfo::CUIContents) == 0x8C);
|
||||
static_assert(sizeof(OngoingQuestInfo::CUIRewards) == 0xA4);
|
||||
static_assert(sizeof(OngoingQuestInfo::CUIScrollWindow) == 0x98);
|
||||
static_assert(sizeof(OngoingQuestInfo::CUIScrollWindow) == 0x9C);
|
||||
static_assert(offsetof(OngoingQuestInfo::CUIRewardItem, gameItem) == 0xEC);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue