diff --git a/Source/UI/Quest/UIRenewQuestWnd.cpp b/Source/UI/Quest/UIRenewQuestWnd.cpp index 6030f468..8a577896 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.cpp +++ b/Source/UI/Quest/UIRenewQuestWnd.cpp @@ -21,6 +21,7 @@ #include "UI/Buttons/UICheckBox.h" #include "UI/Text/UIStaticText.h" #include "UI/UIStaticBitmap.h" +#include "UI/Window/UIWindowMgr.h" #include "Utility/Text/FormatString.h" #include @@ -209,6 +210,21 @@ void UIOngoingQuestScrollWnd::RefreshHuntTexts() { this->Invalidate(); } +// OFFSET: 0x007FA100 +// FUNCTION: fn_09947 +int UIOngoingQuestScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, + std::intptr_t argument3, std::intptr_t argument4) { + if (message == 6) { + if (argument1 == 0xC9) { + g_windowMgr.CloseWindow(0x142); + } + } else if (message == 0x17) { + this->RefreshHuntTexts(); + } + + return UIScrollWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); +} + // OFFSET: 0x007FAF70 // FUNCTION: fn_09949 UIRecommededQuestScrollWnd::UIRecommededQuestScrollWnd(UIWindowContext& windows, int width, int height) @@ -247,6 +263,17 @@ void UIRecommededQuestScrollWnd::Slot35(int delta) { } } +// OFFSET: 0x007FB140 +// FUNCTION: fn_09955 +int UIRecommededQuestScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, + std::intptr_t argument3, std::intptr_t argument4) { + if (message == 6 && argument1 == 0xC9) { + g_windowMgr.CloseWindow(0x142); + } + + return UIScrollWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); +} + // OFFSET: 0x007FB6C0 // FUNCTION: fn_09959 void UIRenewDetailQuestInfoWnd::Slot15(int, int) { @@ -312,6 +339,31 @@ void UIRenewDetailQuestInfoWnd::Slot25(int x, int y) { } } +// OFFSET: 0x007FBAF0 +// FUNCTION: fn_09962 +int UIRenewDetailQuestInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, + std::intptr_t argument3, std::intptr_t argument4) { + if (message == 6) { + if (argument1 == 0xC9) { + g_windowMgr.CloseWindow(0x142); + } + + return 0; + } + + if (message != 0x17) { + return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); + } + + if (this->m_recommended == 0) { + this->m_ongoingWnd->SendMsg(this, 0x17, 0, 0, 0, 0); + } else { + this->m_recommendedWnd->SendMsg(this, 0x17, 0, 0, 0, 0); + } + + return 0; +} + // OFFSET: 0x007FBFD0 // OFFSET: 0x007FC870 diff --git a/Source/UI/Quest/UIRenewQuestWnd.h b/Source/UI/Quest/UIRenewQuestWnd.h index d3c85f34..686a1678 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.h +++ b/Source/UI/Quest/UIRenewQuestWnd.h @@ -49,6 +49,9 @@ public: void Paint() override; void Slot35(int delta) override; + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, + std::intptr_t argument4) override; + void RefreshHuntTexts(); /* 00B0 */ std::vector m_huntTexts; @@ -63,6 +66,9 @@ public: void Paint() override; void Slot35(int delta) override; + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, + std::intptr_t argument4) override; + /* 00B0 */ int unknown_00B0; /* 00B4 */ int unknown_00B4; }; @@ -73,6 +79,9 @@ public: void Paint() override; void Slot25(int x, int y) override; + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, + std::intptr_t argument4) override; + /* 00B4 */ UIOngoingQuestScrollWnd* m_ongoingWnd; /* 00B8 */ UIRecommededQuestScrollWnd* m_recommendedWnd; /* 00BC */ UIBitmapButton* m_closeButton;