diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index f15a26c0..19a900b3 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -331,6 +331,7 @@ public: std::vector WriteTarget(NavigationTarget target); std::vector WriteObject(CNavi_Object* object); std::vector WriteReplayState(); + std::vector WriteStates(); CNavi_Link* ReadObject(const char* record); NavigationTarget ReadTarget(const char* data, int size); CNavi_Object* ReadTargetObject(const char* record); diff --git a/Source/Contents/NavigationRoute.cpp b/Source/Contents/NavigationRoute.cpp index 1d4c9bce..f28406ba 100644 --- a/Source/Contents/NavigationRoute.cpp +++ b/Source/Contents/NavigationRoute.cpp @@ -598,6 +598,39 @@ float CNavigationManager::FitToSquare(int* offsetX, int* offsetY, int width, int return scale; } +// OFFSET: 0x00B9C0D0 +// FUNCTION: fn_19619 +std::vector CNavigationManager::WriteStates() { + std::vector buffer; + if (this->states.empty()) { + return buffer; + } + + buffer.resize(4, 0); + std::size_t offset = 4; + *reinterpret_cast(buffer.data()) = static_cast(this->states.size()); + for (auto it = this->states.begin(); it != this->states.end(); ++it) { + CNaviInfo* info = static_cast(it->object); + if (info == nullptr) { + continue; + } + buffer.resize(it->name.size() + 0x24 + offset, 0); + *reinterpret_cast(buffer.data() + offset) = it->type; + offset += 4; + std::memcpy(buffer.data() + offset, info->GetName(), info->GetNameLength()); + *reinterpret_cast(buffer.data() + offset + 0x14) = it->x; + *reinterpret_cast(buffer.data() + offset + 0x18) = it->y; + const int length = static_cast(it->name.size()); + *reinterpret_cast(buffer.data() + offset + 0x1C) = length; + offset += 0x20; + if (length > 0) { + std::memcpy(buffer.data() + offset, it->name.c_str(), length); + offset += length; + } + } + return buffer; +} + // OFFSET: 0x00B888F0 // FUNCTION: fn_19378 NaviCell* CNaviData::GetCell(NaviCell* out) { diff --git a/Source/UI/Buttons/UITextButton.h b/Source/UI/Buttons/UITextButton.h index 67bae13f..2b083a62 100644 --- a/Source/UI/Buttons/UITextButton.h +++ b/Source/UI/Buttons/UITextButton.h @@ -15,6 +15,7 @@ class UITextButton : public UIButton { friend class UIMessageBox; friend class UIEditCtrl3; friend class UIAchTracingWnd; + friend class UIAchSummaryWnd; public: friend void OpenTextButtonLink(UITextButton* button); diff --git a/Source/UI/Quest/UIRecommendedQuestInfo.cpp b/Source/UI/Quest/UIRecommendedQuestInfo.cpp index 51ecaac5..40038e1e 100644 --- a/Source/UI/Quest/UIRecommendedQuestInfo.cpp +++ b/Source/UI/Quest/UIRecommendedQuestInfo.cpp @@ -1,5 +1,12 @@ #include "UI/Quest/UIRecommendedQuestInfo.h" +#include "Contents/MessageTable.h" +#include "Render/Renderer.h" +#include "UI/Quest/UIRenewQuestWnd.h" +#include "UI/Window/UIWindowMgr.h" + +#include + // OFFSET: 0x00A568E0 // FUNCTION: fn_16321 void CUIRecommendedQuestInfo::Slot53() { @@ -16,6 +23,19 @@ void CUIRecommendedQuestInfo::Slot53() { void CUIRecommendedQuestInfo::OnFirstAction() { } +// OFFSET: 0x00A58BE0 +// FUNCTION: fn_16349 +void CUIRecommendedQuestInfo::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 RecommendedQuestInfo { // OFFSET: 0x00A58BC0 @@ -57,4 +77,61 @@ void CUIQuestInfo::Slot15(int width, int height) { this->AddChild(this->textViewer); } +// OFFSET: 0x00A57EF0 +// FUNCTION: fn_16324 +void CUIScrollWindow::Slot15(int width, int height) { + this->background = new CUIStaticImage(*this->m_context); + this->background->SetSize(336, 318); + this->background->Move(3, 2); + this->background->SetImage(std::string()); + this->AddChild(this->background); + + this->topImage = new CUIStaticImage(*this->m_context); + this->topImage->SetSize(324, 138); + this->topImage->Move(9, 8); + this->topImage->SetImage("유저인터페이스\\Renew_QuestUI\\bg_quest01.png"); + this->AddChild(this->topImage); + + this->bottomImage = new CUIStaticImage(*this->m_context); + this->bottomImage->SetSize(208, 92); + this->bottomImage->Move(9, 221); + this->bottomImage->SetImage("유저인터페이스\\Renew_QuestUI\\bg_quest02.png"); + this->AddChild(this->bottomImage); + + for (int count = 3; count != 0; --count) { + CUIQuestInfo* info = new CUIQuestInfo(*this->m_context); + info->SetSize(300, 150); + this->AddChild(info); + this->questInfos.push_back(info); + } + + this->questInfos[0]->Resize(306, 120); + this->questInfos[0]->Move(18, 17); + this->questInfos[0]->textViewer->Resize(306, 120); + this->questInfos[0]->textViewer->SetScrollBarSize(7, 120); + + this->questInfos[1]->Resize(213, 60); + this->questInfos[1]->Move(16, 153); + this->questInfos[1]->textViewer->Resize(213, 60); + this->questInfos[1]->textViewer->SetTextOffset(0, 6); + this->questInfos[1]->textViewer->SetBold(true); + this->questInfos[1]->textViewer->SetTextColor(0x2A2A2A); + this->questInfos[1]->textViewer->SetOutline(true, 0xFFFFFF); + this->questInfos[1]->textViewer->SetScrollBarSize(7, 60); + + this->questInfos[2]->Resize(182, 76); + this->questInfos[2]->Move(22, 229); + this->questInfos[2]->textViewer->Resize(182, 76); + this->questInfos[2]->textViewer->SetScrollBarSize(7, 76); +} + +// OFFSET: 0x00A58C70 +// FUNCTION: fn_16350 +void CUIScrollWindow::Slot16() { + this->npcSprite = new UINpcSprWnd(*this->m_context); + this->npcSprite->SetSize(75, 145); + this->npcSprite->Show(0); + this->AddChild(this->npcSprite); +} + } diff --git a/Source/UI/Quest/UIRecommendedQuestInfo.h b/Source/UI/Quest/UIRecommendedQuestInfo.h index 100979e1..e3b09241 100644 --- a/Source/UI/Quest/UIRecommendedQuestInfo.h +++ b/Source/UI/Quest/UIRecommendedQuestInfo.h @@ -5,16 +5,26 @@ #include "UI/Text/UITextViewerControl.h" #include "UI/Window/UIControl.h" +#include + +class UINpcSprWnd; + class CUIRecommendedQuestInfo : public CUIFrameWnd { public: + void Slot16() override; void OnFirstAction(); virtual void Slot53(); + + /* 00D8 */ CUITitleBar* titleBar; }; namespace RecommendedQuestInfo { class CUIQuestInfo : public CUIControl { public: + __declspec(noinline) explicit CUIQuestInfo(UIWindowContext& context) : CUIControl(context), textViewer(nullptr) { + } + void Slot15(int width, int height) override; void Slot16() override; void Paint() override; @@ -22,6 +32,18 @@ public: /* 0084 */ CUITextViewer* textViewer; }; +class CUIScrollWindow : public CUIControl { +public: + void Slot15(int width, int height) override; + void Slot16() override; + + /* 0084 */ CUIStaticImage* background; + /* 0088 */ CUIStaticImage* topImage; + /* 008C */ CUIStaticImage* bottomImage; + /* 0090 */ std::vector questInfos; + /* 009C */ UINpcSprWnd* npcSprite; +}; + } #endif diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index e4035528..b6dc9e8a 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -1013,3 +1013,5 @@ void UIToolTipBitmapWnd::Slot28(int x, int y) { reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); } } + +// OFFSET: 0x007B50C0 diff --git a/Source/UI/Text/UIAchWnd.h b/Source/UI/Text/UIAchWnd.h index dcc9722a..b6b6cad3 100644 --- a/Source/UI/Text/UIAchWnd.h +++ b/Source/UI/Text/UIAchWnd.h @@ -37,6 +37,11 @@ public: class UICustomGageBar : public UIWindow { public: + __declspec(noinline) explicit UICustomGageBar(UIWindowContext& windows) + : UIWindow(windows, 0), value(-1), maximum(-1), text(), barColor(0xCE7B52), backgroundColor(0xFFFFFF), outerBorderColor(0xEFE7E7), + innerBorderColor(0xADADAD) { + } + /* 007C */ int value; /* 0080 */ int maximum; /* 0084 */ std::string text; @@ -235,6 +240,7 @@ public: /* 0098 */ UIWindow* buttons[2]; void Show(int visible) override; + void Slot15(int width, int height) override; void Paint() override; int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;