#include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" #include "Client/Mode/ModeEvents.h" #include "Client/Session.h" #include "Render/DeviceContext/DeviceContext.h" #include "Render/Text/TextContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" #include "UI/Text/TextWrapping.h" #include "UI/Buttons/UIBasicButton.h" #include "UI/Buttons/UIBitmapButton.h" #include "UI/Buttons/UICheckBox.h" #include "UI/Party/UIRequestJoinPartyMgr.h" #include "UI/Party/UIRequestJoinPartyWnd.h" #include "UI/Text/UIStaticText.h" #include "UI/Text/UITextViewer.h" #include "UI/Window/UINewSelectCharWnd.h" #include // OFFSET: 0x007BB030 // FUNCTION: fn_09280 UIRequestJoinPartyWnd::UIRequestJoinPartyWnd() : UIFrameWnd(0) { } UIRequestJoinPartyWnd::~UIRequestJoinPartyWnd() = default; // OFFSET: 0x007BEFD0 // FUNCTION: fn_09301 void UIRequestJoinPartyWnd::Slot15(int, int) { this->icon = new UIBitmapButton(); this->icon->SetSize(25, 25); for (int state = 0; state < 3; ++state) { this->icon->SetBitmap("유저인터페이스\\renewalparty\\icon_jobs_4046.bmp", state, 0); } this->icon->Move(12, 29); this->AddChild(this->icon); this->levelText = new UIStaticText(); this->levelText->SetSize(25, 14); this->levelText->Move(16, 56); this->levelText->SetText("1", 0); this->levelText->SetColor(0, 0, 0); this->AddChild(this->levelText); const int ids[] = {541, 542}; const int positions[][2] = {{122, 136}, {169, 136}}; const std::string labels[] = {LookupMessage(3489), LookupMessage(3490)}; for (int index = 0; index < 2; ++index) { auto* button = new UIBasicButton(); button->Configure(this->TextWidth(labels[index].c_str(), 0, 0, 12, 0, 0) + 10, labels[index].c_str()); button->Move(positions[index][0], positions[index][1]); button->SetId(ids[index]); this->AddChild(button); } this->m_message0 = 541; this->details = new UITextViewer(); this->details->Configure(43, 20, 167, 60, 0); this->details->backgroundColor = 0xFFFFFFFFu; this->details->Invalidate(); this->AddChild(this->details); this->block = new UICheckBox(); this->block->SetSize(24, 47); this->block->SetImages("유저인터페이스\\uiadventureragency\\btn_block_on.bmp", "유저인터페이스\\uiadventureragency\\btn_block_off.bmp", ""); this->block->Move(7, 81); this->block->SetChecked(0); this->block->SetId(213); this->AddChild(this->block); std::vector unused; WrapPlainText(LookupMessage(3518), unused, 30); this->blockText = new UITextViewer(); this->blockText->Configure(31, 81, 182, 47, 0); this->blockText->backgroundColor = 0xFFD7C6BCu; this->blockText->Invalidate(); this->AddChild(this->blockText); this->blockText->lineHeight = 15; this->blockText->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3518)), 30, 0, 0); this->AddBigCloseButton("", 0); } // OFFSET: 0x007BFC20 // FUNCTION: fn_09306 void UIRequestJoinPartyWnd::Paint() { this->DrawBitmap(0, 0, reinterpret_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\UIadventurerAgency\\bg_agency_admit.bmp"))), false); this->DrawTitleBar(true, LookupMessage(3505), 0); } // OFFSET: 0x007C1770 // FUNCTION: fn_09315 int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case 6: switch (a) { case 201: this->SendMsg(nullptr, 6, 542, 0, 0, 0); break; case 541: g_modeMgr.gameMode->SendMsg(264, this->characterId, 1, reinterpret_cast(&this->accountId), 0); g_requestJoinPartyMgr->Advance(); this->block->SetChecked(0); break; case 542: if (this->block->geometry.unknown_0030 != 0) { g_requestJoinPartyMgr->Block(this->accountId); } g_modeMgr.gameMode->SendMsg(264, this->characterId, 0, reinterpret_cast(&this->accountId), 0); g_requestJoinPartyMgr->Advance(); this->block->SetChecked(0); break; } return 0; case 56: { const auto& request = *reinterpret_cast(a); this->characterId = request.characterId; this->level = request.job; this->job = request.level; this->accountId = request.accountId; char path[500] = {}; _snprintf_s(path, sizeof(path), _TRUNCATE, "유저인터페이스\\renewalparty\\icon_jobs_%lu.bmp", this->job); for (int state = 0; state < 3; ++state) { this->icon->SetBitmap(path, state, 0); } const std::string jobName = g_session.GetJobName(this->job, -1); this->icon->SetTooltip(jobName.c_str()); char level[5] = {}; _snprintf_s(level, sizeof(level), _TRUNCATE, "%d", this->level); this->levelText->SetText(level, 0); const int width = this->TextWidth(level, 0, 0, 12, 0, 0); this->levelText->Move(25 - width / 2, 56); this->details->Clear(); char messageText[1024] = {}; _snprintf_s(messageText, sizeof(messageText), _TRUNCATE, LookupMessage(3378), request.name); this->details->SendMsg(nullptr, 29, reinterpret_cast(messageText), 0, 0, 1); this->details->Move(43, static_cast(this->details->lines.size()) - 3u >= 1u ? 30 : 20); this->Invalidate(); return 0; } default: return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d); } }