diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 58433311..aaddd313 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -3732,6 +3732,140 @@ void UInCashWnd::Slot11() { } } +// OFFSET: 0x00901520 +// FUNCTION: fn_12375 +int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { + if (g_windowMgr.unknown_0458) { + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); + return 0; + } + + UITagTextViewer* viewer = static_cast(this->m_viewer); + switch (message) { + case 6: { + Replay& replay = Replay::Instance(); + ReplayPacketRecorder packets{g_packetLengths, replay.baseFrame, replay.started, replay.frame, replay.header.key0, replay.header.key1, + replay.header.options.recordRestricted, replay.file, replay.fileOffset, replay.records, replay.cipherIndex, + replay.cipherBase, replay.cipherKey}; + WindowResponseRecorder{replay.state, packets}.Record(this->geometry.id, static_cast(a), b, c, this->unknown_00C8); + if (g_replayAnimationScaling != 0) { + this->unknown_00C8 = static_cast(d); + } + if (a == 218) { + const DWORD tick = GetTickCount(); + if (tick - *reinterpret_cast(&g_session.unknown_5490[0x04]) < 300) { + return 0; + } + *reinterpret_cast(&g_session.unknown_5490[0x04]) = tick; + static_cast(g_charViewMode)->SendMsg(this->unknown_00C8, this->unknown_00CC, 218, 0, 0); + this->unknown_00D4 = 1; + this->SendMsg(nullptr, 32, 0, 0, 0, 0); + } else if (a != 600) { + static_cast(g_charViewMode)->SendMsg(this->unknown_00C8, this->unknown_00CC, static_cast(a), 0, 0); + } + return 0; + } + case 18: + viewer->SendMsg(nullptr, 18, 0, 0, 0, 0); + return 0; + case 19: + viewer->SendMsg(nullptr, 19, 0, 0, 0, 0); + return 0; + case 25: + this->m_message0 = 218; + this->unknown_00C8 = 22; + this->SendMsg(nullptr, 85, 218, reinterpret_cast("btn_next"), 0, 0); + this->Invalidate(); + return 0; + case 26: + if (a != 0) { + if (this->unknown_00D4 != 0) { + viewer->Clear(); + this->unknown_00D4 = 0; + } + viewer->SendMsg(nullptr, 29, a, c, 1, 0); + } + this->unknown_00CC = static_cast(b); + return 0; + case 32: + this->m_message0 = 600; + this->SendMsg(nullptr, 86, 218, 0, 0, 0); + this->Invalidate(); + return 0; + case 34: + this->m_placement = reinterpret_cast(a); + static_cast(this->m_placement)->IsValid(); + this->Move(this->m_placement->x, this->m_placement->y); + return 0; + case 63: + this->m_message0 = 201; + this->unknown_00C8 = 89; + this->SendMsg(nullptr, 85, 218, reinterpret_cast("btn_close"), 0, 0); + this->Invalidate(); + return 0; + case 75: + viewer->Clear(); + return 0; + case 80: + this->unknown_00C8 = static_cast(a); + return 0; + case 85: { + const std::string prefix("유저인터페이스\\"); + UIBitmapButton* button = new UIBitmapButton(); + const char* name = reinterpret_cast(b); + button->SetBitmap((prefix + name + ".bmp").c_str(), 0, 0); + button->SetBitmap((prefix + name + "_a.bmp").c_str(), 1, 0); + button->SetBitmap((prefix + name + "_b.bmp").c_str(), 2, 0); + button->SetSize(button->BitmapWidth(), button->BitmapHeight()); + button->Move(this->ButtonX(button), this->geometry.height - 24); + button->SetId(static_cast(a)); + this->AddChild(button); + this->m_buttons.push_back(button); + return 0; + } + case 86: + for (auto it = this->m_buttons.begin(); it != this->m_buttons.end(); ++it) { + if ((*it)->geometry.id == a) { + (*it)->Move(-100, -100); + g_windowMgr.Schedule(*it); + this->m_buttons.erase(it); + break; + } + } + return 0; + case 123: { + const unsigned char* records = reinterpret_cast(a); + FramedMessageHeader header; + std::memcpy(&header, records, sizeof(header)); + if (header.type == 22500) { + unsigned int position = sizeof(header); + while (position < static_cast(b)) { + std::memcpy(&header, records + position, sizeof(header)); + position += sizeof(header); + if (header.type == 22501) { + break; + } + if (header.type == 22503) { + char text[260]; + std::memset(text, 0, sizeof(text)); + std::memcpy(text, records + position, header.length); + position += header.length; + this->SendMsg(nullptr, 26, reinterpret_cast(text), 0, 0, 0); + } else if (header.type == 22504) { + std::memcpy(&this->unknown_00D4, records + position, header.length); + position += header.length; + } else { + position += header.length; + } + } + } + return 0; + } + default: + return UIFrameWnd::SendMsg(sender, message, a, b, c, d); + } +} + // OFFSET: 0x008FB850 // FUNCTION: fn_12345 int UIGraffiStrboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { diff --git a/Source/UI/Dialogs/UISayDialogWnd.h b/Source/UI/Dialogs/UISayDialogWnd.h index 9d6fac7e..ac481a10 100644 --- a/Source/UI/Dialogs/UISayDialogWnd.h +++ b/Source/UI/Dialogs/UISayDialogWnd.h @@ -13,7 +13,7 @@ public: /* 00B4 */ UIWindow* m_viewer; /* 00B8 */ std::list m_buttons; /* 00C0 */ std::list unknown_00C0; - /* 00C8 */ unsigned char unknown_00C8[0x04]; + /* 00C8 */ int unknown_00C8; /* 00CC */ int unknown_00CC; /* 00D0 */ WindowPlacement* m_placement; /* 00D4 */ int unknown_00D4; @@ -24,6 +24,7 @@ public: void Slot19() override; void Paint() override; std::vector Slot44() override; + int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; int ButtonX(UIBitmapButton* button); }; diff --git a/Source/UI/Text/UITagTextViewer.h b/Source/UI/Text/UITagTextViewer.h index 8723abdd..3e831f45 100644 --- a/Source/UI/Text/UITagTextViewer.h +++ b/Source/UI/Text/UITagTextViewer.h @@ -51,7 +51,7 @@ public: 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; void SetAlign(unsigned char align); - void Clear(); + virtual void Clear(); void AddText(const std::string& text); void Layout();