diff --git a/Source/UI/Window/UIShowWarpWnd.cpp b/Source/UI/Window/UIShowWarpWnd.cpp index 28942b5d..770b9439 100644 --- a/Source/UI/Window/UIShowWarpWnd.cpp +++ b/Source/UI/Window/UIShowWarpWnd.cpp @@ -1,6 +1,10 @@ #include "UI/Window/UIShowWarpWnd.h" #include "UI/Buttons/UIBitmapButton.h" +#include "Client/ReplayPacketRecorder.h" +#include "Client/Session.h" +#include "Contents/MessageTable.h" #include "UI/Lists/UIListBox.h" +#include "UI/Window/UIWindowMgr.h" #include #include @@ -12,3 +16,35 @@ void UIShowWarpWnd::Paint() { this->DrawBorder(0, 0, 0, 0); } + +// OFFSET: 0x00951210 +// FUNCTION: fn_12949 +int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { + switch (message) { + case 6: + this->m_recorder->Record(this->geometry.id, static_cast(argument1), argument2, argument3, argument4); + if (argument1 == 201) { + g_windowMgr.CloseWindow(0x134); + } + return 0; + case 0x12: + this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); + return 0; + case 0x13: + this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); + return 0; + case 0x22: { + const char* name = reinterpret_cast(argument1); + if (std::string(name) == "Random") { + this->m_list->AddLine(LookupMessage(0xD4)); + } else if (std::string(name) == "cancel") { + this->m_list->AddLine(LookupMessage(0xDA)); + } else { + this->m_list->AddLine(g_session.GetMapDisplayName(g_session.GatName2RswName(name))); + } + return 0; + } + default: + return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); + } +} diff --git a/Source/UI/Window/UIShowWarpWnd.h b/Source/UI/Window/UIShowWarpWnd.h index 18905982..990e27c0 100644 --- a/Source/UI/Window/UIShowWarpWnd.h +++ b/Source/UI/Window/UIShowWarpWnd.h @@ -4,6 +4,7 @@ #include "UI/Window/UIFrameWnd.h" struct UIButtonContext; +struct WindowResponseRecorder; struct UIListBoxContext; class UIListBox; @@ -11,12 +12,14 @@ class UIShowWarpWnd : public UIFrameWnd { public: 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; /* 00B4 */ UIListBox* m_list; protected: UIButtonContext* m_controls; UIListBoxContext* m_listContext; + WindowResponseRecorder* m_recorder; }; #endif