diff --git a/Source/Client/Input/ImeHelper.cpp b/Source/Client/Input/ImeHelper.cpp index b9d32c3f..095e8686 100644 --- a/Source/Client/Input/ImeHelper.cpp +++ b/Source/Client/Input/ImeHelper.cpp @@ -46,7 +46,7 @@ void HandleImeError(const int* error) { default: goto quit; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, 0); quit: NotifyImeHelper(); diff --git a/Source/Client/Mode/CLoginMode.h b/Source/Client/Mode/CLoginMode.h index afd704fa..14293a88 100644 --- a/Source/Client/Mode/CLoginMode.h +++ b/Source/Client/Mode/CLoginMode.h @@ -9,6 +9,7 @@ #include #include +class UIWindowMgr; class UIWindow; struct CharacterListPacket; @@ -17,7 +18,6 @@ struct CharacterResultPacket; struct CharacterDeletePacket; struct AcceptEnterPacket; struct MapStatePacket; -struct WindowDialogs; struct LoginErrorPacket; struct LoginErrorDetailPacket; struct CharacterPagePacket; @@ -137,16 +137,16 @@ public: void SubD911C0(const PasswordModePacket* packet); int GetMaxCharacterSlot(); void ReceiveCharacterSlots(const CharacterSlotsPacket* packet); - void ReceiveAcceptEnter(const AcceptEnterPacket* packet, WindowDialogs& dialogs); + void ReceiveAcceptEnter(const AcceptEnterPacket* packet); void SubD8EDC0(int); - void ReceiveCharacterResult(const CharacterResultPacket* packet, WindowDialogs& dialogs); + void ReceiveCharacterResult(const CharacterResultPacket* packet); void SubD8F560(int); void ReceiveCharacterPage(const CharacterPagePacket* packet); void ReceiveCharacterList(const CharacterListPacket* packet); - void ReceiveDeleteCharacter(const CharacterDeletePacket* packet, WindowDialogs& dialogs); - void ReceiveDeleteCancel(const CharacterDeletePacket* packet, WindowDialogs& dialogs); - void ReceiveDeleteReservation(const CharacterDeletePacket* packet, WindowDialogs& dialogs); - void ReceiveMapStates(const MapStatePacket* packet, WindowDialogs& dialogs); + void ReceiveDeleteCharacter(const CharacterDeletePacket* packet); + void ReceiveDeleteCancel(const CharacterDeletePacket* packet); + void ReceiveDeleteReservation(const CharacterDeletePacket* packet); + void ReceiveMapStates(const MapStatePacket* packet); void SubD91780(int); bool ShowNotice(int notice, bool append); void ReceiveRefuseLogin(const RefuseLoginPacket* packet); diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index 301585cb..b7c6283b 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -814,7 +814,7 @@ bool CGameMode::ConfirmDraggedItemUse() { this->unknown_05EC[0] = 0; } g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(657), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(657), 0, true, false, 0, "Message", 280, 120, 0); return true; } @@ -2586,7 +2586,7 @@ void CGameMode::ChangeZoneServer(std::string mapName, int x, int y, int ip, int this->unknown_0018 = GetRagConnection().Connect(*reinterpret_cast(g_zoneServerIp)); if (!this->unknown_0018) { GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 1, true, true, 0, "Message", 280, 120, 0) != 269) { + if (g_windowMgr.Confirm(LookupMessage(1), 1, true, true, 0, "Message", 280, 120, 0) != 269) { this->SendMsg(141, 0, 0, 0, 0); } return; @@ -4344,7 +4344,7 @@ int CGameMode::ProcessGroundClick(int result) { if (g_mouse.buttons[0] == 1) { shop->SetSuspended(0); shop->SetSelection(static_cast(column), static_cast(row)); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xB63), 2, true, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0xB63), 2, true, false, 0, "Message", 280, 120, 0) == 0xBB) { shop->SendShopRequest(); return -1; } diff --git a/Source/Client/Mode/GameModeHandlers.cpp b/Source/Client/Mode/GameModeHandlers.cpp index 834ed841..ed3d2c0e 100644 --- a/Source/Client/Mode/GameModeHandlers.cpp +++ b/Source/Client/Mode/GameModeHandlers.cpp @@ -524,10 +524,10 @@ bool g_playerMessage82Pending; void CGameMode::ReceivePartyBookingRegisterResult(const unsigned char* packet) { switch (*reinterpret_cast(packet + 2)) { case 2: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1828), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1828), 0, true, false, 0, "Message", 280, 120, 0); break; case 3: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1829), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1829), 0, true, false, 0, "Message", 280, 120, 0); [[fallthrough]]; case 0: case 1: @@ -541,7 +541,7 @@ void CGameMode::ReceivePartyBookingRegisterResult(const unsigned char* packet) { void CGameMode::ReceivePartyBookingUpdateResult(const unsigned char* packet) { const std::int16_t result = *reinterpret_cast(packet + 2); if (result != 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(result == 2 ? 1941 : 1826), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(result == 2 ? 1941 : 1826), 0, true, false, 0, "Message", 280, 120, 0); return; } @@ -575,7 +575,7 @@ void CGameMode::ReceivePartyBookingSearchResult(const unsigned char* packet) { } if (size == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1827), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1827), 0, true, false, 0, "Message", 280, 120, 0); g_session.m_partyBooking.m_lastPage = false; window->Invalidate(); return; @@ -1363,11 +1363,11 @@ void CGameMode::ReceiveRequestResult(const unsigned char* packet) { break; case 303: text = "- " + IntToString(303, 0) + " : " + LookupMessage(3940); - reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 0, false, false, 0, "Error", 280, 120, 0); + g_windowMgr.Confirm(text.c_str(), 0, false, false, 0, "Error", 280, 120, 0); break; case 304: text = "- " + IntToString(304, 0) + " : " + LookupMessage(3941); - reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 0, false, false, 0, "Error", 280, 120, 0); + g_windowMgr.Confirm(text.c_str(), 0, false, false, 0, "Error", 280, 120, 0); break; default: text = LookupMessage(57); @@ -1747,31 +1747,31 @@ void CGameMode::ReceiveRuneRewardPacket(const unsigned char* packet) { break; case 2: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4076)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4076), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4076), 0, true, false, 0, "Message", 280, 120, 0); break; case 3: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4077)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4077), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4077), 0, true, false, 0, "Message", 280, 120, 0); break; case 4: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4078)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4078), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4078), 0, true, false, 0, "Message", 280, 120, 0); break; case 5: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4079)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4079), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4079), 0, true, false, 0, "Message", 280, 120, 0); break; case 6: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4080)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4080), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4080), 0, true, false, 0, "Message", 280, 120, 0); break; case 7: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4081)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4081), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4081), 0, true, false, 0, "Message", 280, 120, 0); break; case 8: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4082)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4082), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4082), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -1948,7 +1948,7 @@ void CGameMode::ReceiveRodexMailDeleteResult(int mailId, int result) { message = 3866; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, false); + g_windowMgr.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, false); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(message)), 0x64FFFF, 0, 0, 0); } @@ -2008,48 +2008,48 @@ int CGameMode::HandleRuneResult(int result) { return 0; case 1: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF4)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFF4), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFF4), 0, true, false, 0, "Message", 280, 120, 0); break; case 2: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF5)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFF5), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFF5), 0, true, false, 0, "Message", 280, 120, 0); break; case 3: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF6)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFF6), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFF6), 0, true, false, 0, "Message", 280, 120, 0); break; case 4: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF7)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFF7), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFF7), 0, true, false, 0, "Message", 280, 120, 0); break; case 5: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF8)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFF8), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFF8), 0, true, false, 0, "Message", 280, 120, 0); break; case 6: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF9)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFF9), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFF9), 0, true, false, 0, "Message", 280, 120, 0); break; case 7: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFA)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFFA), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFFA), 0, true, false, 0, "Message", 280, 120, 0); break; case 8: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFB)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFFB), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFFB), 0, true, false, 0, "Message", 280, 120, 0); break; case 10: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFD)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFFC), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFFC), 0, true, false, 0, "Message", 280, 120, 0); break; case 11: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFD)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFFD), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFFD), 0, true, false, 0, "Message", 280, 120, 0); break; case 12: case 13: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFE)), 0xFF, 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xFFE), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xFFE), 0, true, false, 0, "Message", 280, 120, 0); break; default: return result; diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index 00d3a5f1..1ea33283 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -1346,7 +1346,7 @@ void CGameMode::ReceiveMessageBox(const unsigned char* data) { text = formatted; } - reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 0, true, false, 0, caption.c_str(), 280, 120, 0); + g_windowMgr.Confirm(text.c_str(), 0, true, false, 0, caption.c_str(), 280, 120, 0); } // OFFSET: 0x00D6E5F0 @@ -1355,7 +1355,7 @@ void CGameMode::NotifyCaptchaRegistered() { UIWindow* window = g_windowMgr.LookupWindow(284); if (window) { static_cast(window)->SetRegisterDisabled(0); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2880), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2880), 0, true, false, 0, "Message", 280, 120, 0); } } @@ -1564,13 +1564,13 @@ void CGameMode::ReceiveCharacterRenameResult(const unsigned char* packet) { PacketIdOnly request; request.id = 0xA48; GetRagConnection().Send(g_packetLengths.FixedLength(request.id), &request); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2836), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2836), 0, true, false, 0, "Message", 280, 120, 0); g_windowMgr.CloseWindow(281); break; } case 1: case 2: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1575), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1575), 0, true, false, 0, "Message", 280, 120, 0); break; } } @@ -1702,14 +1702,14 @@ void sub_D6E440() { void CGameMode::ReceiveMacroBlackListResult(int result) { switch (result) { case 0: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2869), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2869), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2870), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2870), 0, true, false, 0, "Message", 280, 120, 0); break; case 2: g_windowMgr.CloseWindow(359); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2871), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2871), 0, true, false, 0, "Message", 280, 120, 0); return; default: return; @@ -1724,14 +1724,14 @@ void CGameMode::ReceiveMacroBlackListResult(int result) { void CGameMode::ReceiveMacroDetectorResult(int result) { switch (result) { case 0: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2869), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2869), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2870), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2870), 0, true, false, 0, "Message", 280, 120, 0); break; case 2: g_windowMgr.CloseWindow(285); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2871), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2871), 0, true, false, 0, "Message", 280, 120, 0); return; default: return; @@ -1809,7 +1809,7 @@ void __stdcall sub_D1C050(const AchievementStatePacket* packet) { bool notify = true; if (packet->type == 2) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x9F5), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x9F5), 0, true, true, 0, "Message", 280, 120, 0); window = g_windowMgr.LookupWindow(0x21); } else { window = g_windowMgr.LookupWindow(0x21); @@ -2559,7 +2559,7 @@ void CGameMode::ReceiveExtraInventoryResult(const unsigned char* data) { const int nextSlots = g_session.unknown_7FBC + 110; const int slots = g_session.unknown_7FBC + 100; const char* name = FindItemDescription(packet->itemId).identifiedName; - const int answer = reinterpret_cast(&g_windowMgr)->Confirm( + const int answer = g_windowMgr.Confirm( FormatOwnedString(LookupMessage(3561), name, slots, nextSlots).c_str(), 2, false, false, 0, "Message", 280, 120, 0); if (answer == 187) { this->SendMsg(311, 0, 0, 0, 0); @@ -3960,8 +3960,7 @@ void CGameMode::ReceiveNotifyGroundSkill(const unsigned char* packet) { if (g_session.IsMonsterActor(actor) != 0) { int action; int loopType; - g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), *reinterpret_cast(packet + 2), &action, &loopType, - *reinterpret_cast(&g_windowMgr)); + g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), *reinterpret_cast(packet + 2), &action, &loopType); if (*reinterpret_cast(packet + 2) == 0x2C8) { actor->LaunchEffect(0x199, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -4927,7 +4926,7 @@ void CGameMode::ReceiveStovePurchaseResult(const unsigned char* data) { g_stoveMgr->unknown_0008 = 0; if (message.size() != 0) { - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } } diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index cc3b4d8a..f9aae184 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -2798,7 +2798,7 @@ void CGameMode::ReceiveUnknownD2D990(const unsigned char*) { if (g_windowMgr.unknown_03F8) { g_windowMgr.CloseWindow(137); GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1349), 0, true, true, 0, "Message", 280, 120, 0) != 269) { + if (g_windowMgr.Confirm(LookupMessage(1349), 0, true, true, 0, "Message", 280, 120, 0) != 269) { this->SendMsg(141, 0, 0, 0, 0); } } @@ -3334,7 +3334,7 @@ void CGameMode::ReceiveNotifySkill(const unsigned char* packet) { int action; int loopType; - g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), message.unknown_0000, &action, &loopType, *reinterpret_cast(&g_windowMgr)); + g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), message.unknown_0000, &action, &loopType); if (action != -1 && gameActor != nullptr) { gameActor->SetAction(action * 8 - 8, 1, loopType == 0); } @@ -3385,7 +3385,7 @@ void CGameMode::ReceiveActorSkillAction(const unsigned char* packet) { int action; int loopType; - g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), message.unknown_0000, &action, &loopType, *reinterpret_cast(&g_windowMgr)); + g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), message.unknown_0000, &action, &loopType); if (action != -1 && gameActor != nullptr) { gameActor->SetAction(action * 8 - 8, 1, loopType == 0); } @@ -3435,7 +3435,7 @@ void CGameMode::ReceiveActorSkillMessage(const unsigned char* packet) { int action; int loopType; - g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), message.unknown_0000, &action, &loopType, *reinterpret_cast(&g_windowMgr)); + g_session.GetMonsterSkillInfo(g_session.GetJobName(job, -1), message.unknown_0000, &action, &loopType); } // OFFSET: 0x00D25310 @@ -4455,7 +4455,7 @@ void CGameMode::ReceiveOpenStore(const unsigned char* packet) { return; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); this->SendMsg(270, 0, 0, 0, 0); } @@ -6462,7 +6462,7 @@ void CGameMode::ReceiveObjectsDisappear(int count, const std::uint32_t* aids) { void CGameMode::ReceiveWindow107List(const unsigned char* packet) { const std::int64_t count = (*reinterpret_cast(packet + 2) - 4) / sizeof(Window107Entry); if (count == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(424), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(424), 0, true, false, 0, "Message", 280, 120, 0); return; } @@ -6632,7 +6632,7 @@ void CGameMode::OpenBuyingStoreMake(unsigned char slotCount) { return; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); this->SendMsg(299, 0, 0, 0, 0); } @@ -6663,7 +6663,7 @@ void CGameMode::OpenVendingMake(unsigned char slotCount, int itemCount, const sh return; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); this->SendMsg(297, 0, 0, 0, 0); } @@ -6680,7 +6680,7 @@ void CGameMode::ReceiveAgitNotice(unsigned char agitId, int first, int second) { const char* agitName = nullptr; g_luaScript->Call("get_agit_name", "d>s", agitId, &agitName); sprintf_s(text, LookupMessage(3632), agitName, second, 100, first, 100); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, false, 0, "Message", 250, 130, 0); + g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 250, 130, 0); } #include "Contents/Actors/Item.h" @@ -7022,7 +7022,7 @@ void CGameMode::ReceiveBuyingStoreOpenResult(const unsigned char* packet) { static_cast(*reinterpret_cast(packet + 4) / 10 + g_session.m_weight) - static_cast(g_session.m_maxWeight) * 0.9f ) ); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); break; case 9: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); @@ -7758,7 +7758,7 @@ void CGameMode::ReceiveNotifyBan(const unsigned char* packet) { if (text.size() == 0) { text = LookupMessage(0x718); } - reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text.c_str(), 0, true, true, 0, "Message", 280, 120, 0); this->SendMsg(2, 0, 0, 0, 0); } @@ -9092,7 +9092,7 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { break; case 7: if (g_serviceOptions.Get(0x128) == 1) { - reinterpret_cast(&g_windowMgr)->AddMessageBox(LookupMessage(0x10F8), 0, true, 0, 0, LookupMessage(0xDF6), 0x118, 0x78, nullptr, false); + g_windowMgr.AddMessageBox(LookupMessage(0x10F8), 0, true, 0, 0, LookupMessage(0xDF6), 0x118, 0x78, nullptr, false); } break; } @@ -10376,7 +10376,7 @@ void CGameMode::ReceiveActorDisappear(const unsigned char* data) { this->SendMsg(148, action, 0, 0, 0); } if (g_serviceType == 4) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x2B7), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x2B7), 0, true, false, 0, "Message", 280, 120, 0); } else if (!g_windowMgr.CloseWindow(0x9B)) { g_windowMgr.EnsureWindow(0x9B); } @@ -11390,7 +11390,7 @@ void CGameMode::sub_D5B030( if (skillId != 0x3E && skillId != 0x39 && g_session.IsMonsterActor(source)) { int action = 0; int loopType = 0; - g_session.GetMonsterSkillInfo(g_session.GetJobName(source->GetEffectiveJob(-1), -1), skillId, &action, &loopType, *reinterpret_cast(&g_windowMgr)); + g_session.GetMonsterSkillInfo(g_session.GetJobName(source->GetEffectiveJob(-1), -1), skillId, &action, &loopType); if (action != -1) { source->SetAction(action * 8 - 8, 1, loopType == 0); if (skillId == 0xC1) { @@ -16754,7 +16754,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t } } else { int loopType; - g_session.GetMonsterSkillInfo(g_session.GetJobName(source->GetEffectiveJob(-1), -1), skillId, &action, &loopType, *reinterpret_cast(&g_windowMgr)); + g_session.GetMonsterSkillInfo(g_session.GetJobName(source->GetEffectiveJob(-1), -1), skillId, &action, &loopType); if (action != -1) { source->SetAction(action * 8 - 8, 1, loopType == 0); } diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index c24c01f8..d327d35f 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -399,11 +399,10 @@ void CLoginMode::SubD8D4F0(int) { // FUNCTION: fn_22266 void CLoginMode::SubD8D500(const char* packet) { UIWindow* window = g_windowMgr.window_03D4; - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); int message; switch (*reinterpret_cast(packet + 2)) { case 0: - dialogs.Confirm(LookupMessage(0x4BE), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x4BE), 0, true, false, 0, "Message", 280, 120, 0); if (window) { window->SendMsg(nullptr, 6, 0x160, 0, 0, 0); } @@ -412,7 +411,7 @@ void CLoginMode::SubD8D500(const char* packet) { message = 0x4C2; break; case 2: - if (dialogs.Confirm(LookupMessage(0x4C3), 0, true, true, 0, "Message", 280, 120, 0) != 0xB8) { + if (g_windowMgr.Confirm(LookupMessage(0x4C3), 0, true, true, 0, "Message", 280, 120, 0) != 0xB8) { return; } if (window) { @@ -440,7 +439,7 @@ void CLoginMode::SubD8D500(const char* packet) { case 9: message = 0x7ED; retry: - if (dialogs.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) != 0xB8) { + if (g_windowMgr.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) != 0xB8) { return; } if (window) { @@ -454,7 +453,7 @@ void CLoginMode::SubD8D500(const char* packet) { return; } - if (dialogs.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { + if (g_windowMgr.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { g_windowMgr.CloseWindow(0x80); } } @@ -655,7 +654,7 @@ void CLoginMode::ReceiveCharacterSlots(const CharacterSlotsPacket* packet) { // OFFSET: 0x00D8EAC0 // FUNCTION: fn_22275 -void CLoginMode::ReceiveAcceptEnter(const AcceptEnterPacket* packet, WindowDialogs& dialogs) { +void CLoginMode::ReceiveAcceptEnter(const AcceptEnterPacket* packet) { this->slotExtension = packet->extension; this->slotExtension.unknown_0001 = htonl(this->slotExtension.unknown_0001); this->slotExtension.unknown_0005 = htonl(this->slotExtension.unknown_0005); @@ -669,7 +668,7 @@ void CLoginMode::ReceiveAcceptEnter(const AcceptEnterPacket* packet, WindowDialo memset(text, 0, sizeof(text)); const int count = this->characterCount; StringFormat(text, sizeof(text), static_cast(-1), CharacterInfo2SizeErrorFormat{}().Text(), count, sizeof(CharacterInfo)); - dialogs.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); } g_session.unknown_59BC = this->characterCount; @@ -686,12 +685,12 @@ void CLoginMode::SubD8EDC0(int) { // OFFSET: 0x00D8EDD0 // FUNCTION: fn_22277 -void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet, WindowDialogs& dialogs) { +void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet) { UIWindow* window = g_windowMgr.window_03D4; int message; switch (packet->result) { case 0: - dialogs.Confirm(LookupMessage(1214), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1214), 0, true, false, 0, "Message", 280, 120, 0); if (window) { window->SendMsg(nullptr, 6, 352, 0, 0, 0); } @@ -703,12 +702,12 @@ void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet, Win message = 1219; break; case 3: - if (dialogs.Confirm(LookupMessage(1215), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { + if (g_windowMgr.Confirm(LookupMessage(1215), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { window->SendMsg(nullptr, 6, 351, 0, 0, 0); } return; case 4: - if (dialogs.Confirm(LookupMessage(1220), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { + if (g_windowMgr.Confirm(LookupMessage(1220), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { window->SendMsg(nullptr, 6, 351, 0, 0, 0); } return; @@ -725,7 +724,7 @@ void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet, Win return; } - if (dialogs.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { + if (g_windowMgr.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { window->SendMsg(nullptr, 6, 185, 0, 0, 0); } } @@ -743,7 +742,7 @@ void CLoginMode::ReceiveCharacterPage(const CharacterPagePacket* packet) { 0x6A, 0x6F, 0x7F, 0x8F, 0xB8, 0x21, 0x99}; thread_local EncryptedName format(source); StringFormat(text, sizeof(text), static_cast(-1), format.Text(), sizeof(CharacterInfo)); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); return; } @@ -756,7 +755,7 @@ void CLoginMode::ReceiveCharacterPage(const CharacterPagePacket* packet) { 0xAB}; thread_local EncryptedName format(source); StringFormat(text, sizeof(text), static_cast(-1), format.Text(), total, 68); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); return; } @@ -806,7 +805,7 @@ void CLoginMode::ReceiveCharacterList(const CharacterListPacket* packet) { // OFFSET: 0x00D8FA00 // FUNCTION: fn_22281 -void CLoginMode::ReceiveDeleteCharacter(const CharacterDeletePacket* packet, WindowDialogs& dialogs) { +void CLoginMode::ReceiveDeleteCharacter(const CharacterDeletePacket* packet) { std::string message; switch (packet->result) { case 0: @@ -842,7 +841,7 @@ void CLoginMode::ReceiveDeleteCharacter(const CharacterDeletePacket* packet, Win } if (!message.empty()) { - dialogs.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } if (this->characterDeleted != true) { this->pendingCursorType = 7; @@ -851,7 +850,7 @@ void CLoginMode::ReceiveDeleteCharacter(const CharacterDeletePacket* packet, Win // OFFSET: 0x00D8FC80 // FUNCTION: fn_22282 -void CLoginMode::ReceiveDeleteCancel(const CharacterDeletePacket* packet, WindowDialogs& dialogs) { +void CLoginMode::ReceiveDeleteCancel(const CharacterDeletePacket* packet) { std::string message; if (packet->result == 0) { message = LookupMessage(1816); @@ -870,13 +869,13 @@ void CLoginMode::ReceiveDeleteCancel(const CharacterDeletePacket* packet, Window } if (!message.empty()) { - dialogs.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } } // OFFSET: 0x00D8FE40 // FUNCTION: fn_22283 -void CLoginMode::ReceiveDeleteReservation(const CharacterDeletePacket* packet, WindowDialogs& dialogs) { +void CLoginMode::ReceiveDeleteReservation(const CharacterDeletePacket* packet) { std::string message; switch (packet->result) { case 0: @@ -916,13 +915,13 @@ void CLoginMode::ReceiveDeleteReservation(const CharacterDeletePacket* packet, W } if (!message.empty()) { - dialogs.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } } // OFFSET: 0x00D904B0 // FUNCTION: fn_22284 -void CLoginMode::ReceiveMapStates(const MapStatePacket* packet, WindowDialogs& dialogs) { +void CLoginMode::ReceiveMapStates(const MapStatePacket* packet) { const unsigned int count = (packet->length - 4) / sizeof(MapStateInfo); if ((packet->length - 4) % sizeof(MapStateInfo) != 0) { const std::uint8_t source[] = {0xD8, 0xE6, 0x32, 0x48, 0x72, 0x89, 0x4C, 0x11, 0x95, 0xC2, 0x20, 0x55, 0x40, 0x89, 0x4E, 0x0D, @@ -931,7 +930,7 @@ void CLoginMode::ReceiveMapStates(const MapStatePacket* packet, WindowDialogs& d thread_local EncryptedName format(source); char text[256]; sprintf(text, format.Text(), sizeof(MapStateInfo)); - dialogs.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; return; } @@ -948,7 +947,7 @@ void CLoginMode::ReceiveMapStates(const MapStatePacket* packet, WindowDialogs& d } if (this->mapStates.size() == 0) { - dialogs.Confirm(LookupMessage(1811), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1811), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; return; } @@ -1059,7 +1058,7 @@ void CLoginMode::SubD97780(int value) { case 5: if (static_cast(timeGetTime()) > this->otpStarted + 0x13880) { GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + if (g_windowMgr.Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { this->otpStarted = timeGetTime(); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; @@ -1069,7 +1068,7 @@ void CLoginMode::SubD97780(int value) { case 6: if (static_cast(timeGetTime()) > this->otpStarted + 0x3A98) { GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + if (g_windowMgr.Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { g_modeMgr.Quit(); } } @@ -1077,7 +1076,7 @@ void CLoginMode::SubD97780(int value) { case 12: if (static_cast(timeGetTime()) > this->otpStarted + 0x3A98) { GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + if (g_windowMgr.Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { this->otpStarted = timeGetTime(); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; @@ -1091,7 +1090,7 @@ void CLoginMode::SubD97780(int value) { if (this->unknown_6F74 == true && this->unknown_6F75 == true) { this->unknown_6F76 = true; if (!g_windowMgr.HasModalWindow()) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD16), 0, true, false, 0, "Message", 280, 120, 0) == 0xB8) { + if (g_windowMgr.Confirm(LookupMessage(0xD16), 0, true, false, 0, "Message", 280, 120, 0) == 0xB8) { this->unknown_6F75 = false; this->unknown_6F76 = false; this->unknown_6F74 = false; @@ -1105,7 +1104,7 @@ void CLoginMode::SubD97780(int value) { if (static_cast(timeGetTime()) > this->otpStarted + 0x13880) { GetRagConnection().Close(); if (this->unknown_6F74 == false) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD70), 0, true, false, 0, "Message", 280, 120, 0) == 0xB8) { + if (g_windowMgr.Confirm(LookupMessage(0xD70), 0, true, false, 0, "Message", 280, 120, 0) == 0xB8) { this->unknown_6F74 = false; this->otpStarted = timeGetTime(); this->pendingCursorType = 3; @@ -1345,7 +1344,7 @@ void CLoginMode::ReceiveRefuseLogin(const RefuseLoginPacket* packet) { const int result = packet->result; const std::uint8_t source[] = {0xBE, 0x24, 0x2B, 0xBC, 0x03, 0x2C, 0x05}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, result), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(FormatString(format.Text(), text, result), 0, true, false, 0, "Message", 280, 120, 0); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; } @@ -1429,7 +1428,7 @@ void CLoginMode::ReceiveLoginErrorDetail(const LoginErrorDetailPacket* packet) { const std::uint8_t detailSource[] = {0xAF, 0x02, 0x44, 0x98, 0xE8, 0x19}; thread_local EncryptedName detailFormat(detailSource); message += FormatOwnedString(detailFormat.Text(), packet->detail); - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 5, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 5, true, true, 0, "Message", 280, 120, 0); if (this->unknown_6F76 != true) { if (error == 500) { this->otpStarted = timeGetTime(); @@ -1505,7 +1504,7 @@ void CLoginMode::ReceiveLoginError(const LoginErrorPacket* packet) { caption = "Message"; protect = false; } - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 5, true, true, 0, caption, 280, 120, protect); + g_windowMgr.Confirm(message.c_str(), 5, true, true, 0, caption, 280, 120, protect); if (this->unknown_6F76 != true) { if (error == 500) { this->otpStarted = timeGetTime(); @@ -1686,12 +1685,12 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { case 5: g_windowMgr.CloseWindow(199); this->pendingCursorType = 7; - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); break; case 6: g_windowMgr.CloseWindow(199); this->pendingCursorType = 7; - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); break; case 7: g_passwordWndMode = 1; @@ -1702,9 +1701,9 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { if (packet->count != 0) { this->pendingCursorType = 7; std::string message = FormatOwnedString(LookupMessage(0x764), packet->count); - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD7E), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xD7E), 0, true, false, 0, "Message", 280, 120, 0); this->SendMsg(2, 0, 0, 0, 0); } break; @@ -1712,7 +1711,7 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { const char* text = LookupMessage(0xC81); const std::uint8_t source[] = {0xF2, 0xE6, 0x37, 0xBE, 0x35, 0x6C, 0x87}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, 9), 0, true, false, 0, "Message", + g_windowMgr.Confirm(FormatString(format.Text(), text, 9), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -1720,7 +1719,7 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { const char* text = LookupMessage(0xC81); const std::uint8_t source[] = {0xF0, 0x4A, 0x03, 0x6C, 0x83, 0x8E, 0x97}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, 10), 0, true, false, 0, "Message", + g_windowMgr.Confirm(FormatString(format.Text(), text, 10), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -1728,7 +1727,7 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { const char* text = LookupMessage(0xC81); const std::uint8_t source[] = {0x56, 0x9C, 0x93, 0xF4, 0xB1, 0xCA, 0xAB}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, 11), 0, true, false, 0, "Message", + g_windowMgr.Confirm(FormatString(format.Text(), text, 11), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -1769,12 +1768,12 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { case 5: g_windowMgr.CloseWindow(199); this->pendingCursorType = 7; - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); break; case 6: g_windowMgr.CloseWindow(199); this->pendingCursorType = 7; - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); break; case 7: g_passwordWndMode = 1; @@ -1787,9 +1786,9 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { this->pendingCursorType = 7; if (remaining > 0) { std::string message = FormatOwnedString(LookupMessage(0x764), remaining); - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x773), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x773), 0, true, false, 0, "Message", 280, 120, 0); this->SendMsg(2, 0, 0, 0, 0); } break; @@ -1798,7 +1797,7 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { const char* text = LookupMessage(0xC81); const std::uint8_t source[] = {0x16, 0x10, 0x7D, 0xD4, 0x4D, 0x1C, 0xD3}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, 9), 0, true, false, 0, "Message", + g_windowMgr.Confirm(FormatString(format.Text(), text, 9), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -1806,7 +1805,7 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { const char* text = LookupMessage(0xC81); const std::uint8_t source[] = {0x14, 0x8A, 0xFB, 0xDC, 0x79, 0x66, 0xCB}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, 10), 0, true, false, 0, "Message", + g_windowMgr.Confirm(FormatString(format.Text(), text, 10), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -1814,7 +1813,7 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { const char* text = LookupMessage(0xC81); const std::uint8_t source[] = {0xB2, 0xBA, 0xE1, 0xBE, 0xA9, 0x92, 0xB1}; thread_local EncryptedName format(source); - reinterpret_cast(&g_windowMgr)->Confirm(FormatString(format.Text(), text, 11), 0, true, false, 0, "Message", + g_windowMgr.Confirm(FormatString(format.Text(), text, 11), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -2058,7 +2057,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { case 1: if (g_serviceType == 0 && ++g_loginFailCount >= 3) { message = std::string(PasswordRetryExceededMessage{}().Text()); - if (reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { + if (g_windowMgr.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { if (g_hangameLogin == 1) { const std::uint8_t urlSource[] = {0x17, 0x67, 0xAB, 0xA1, 0xBF, 0x48, 0x56, 0x9A, 0x08, 0x64, 0xF1, 0xB9, 0xE4, 0x09, 0x1E, 0x8C, 0x12, 0x76, 0xF1, 0xB2, 0xEA, 0x0A, 0x79}; @@ -2154,7 +2153,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { 0x27, 0x7A, 0xFA, 0xB8, 0xF5, 0x59, 0xF6, 0x28, 0x47, 0x3F, 0x8D, 0xC6, 0xA3, 0xA0, 0x61, 0xF1}; thread_local EncryptedName text(textSource); message = std::string(text.Text()); - if (reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { + if (g_windowMgr.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { const std::uint8_t urlSource[] = {0x43, 0x6B, 0x9D, 0xDB, 0xFB, 0xD0, 0x02, 0x08, 0x5C, 0x68, 0xC7, 0xD9, 0xA0, 0x98, 0x43, 0x1E, 0x59, 0x70, 0x82, 0x85, 0xA2, 0x90, 0x03, 0x14, 0x59, 0x30, 0x9A, 0xCE, 0xB5, 0xB1, 0x48, 0x08, 0x7B, 0x48, 0xC6, 0xDB, 0xA0, 0x8C, 0x5E, 0x08, 0x44, 0x6D, 0x8D, 0xF4, 0xA2, 0x97, 0x4C, 0x11, @@ -2179,7 +2178,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { case 17: { const std::string text = FormatOwnedString(LookupMessage(0x564), argument); message = text; - if (reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 2, true, true, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(message.c_str(), 2, true, true, 0, "Message", 280, 120, 0) == 0xBB) { g_modeMgr.Quit(); } message.clear(); @@ -2220,7 +2219,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { message = LookupMessage(0x6FA); break; case 110: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x929), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { + if (g_windowMgr.Confirm(LookupMessage(0x929), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { const char* file = LookupMessage(0x92A); const std::uint8_t source[] = {0xFC, 0x05, 0xBA, 0x81, 0x4D}; thread_local EncryptedName operation(source); @@ -2258,7 +2257,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { } if (!message.empty()) { - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); if (code == 5 || code == 99) { this->SendMsg(2, 0, 0, 0, 0); } @@ -2459,7 +2458,6 @@ void CLoginMode::PollNetworkStatus() { return; } - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); while (GetRagConnection().ReadPacket(g_gameModePacketBuffer, nullptr, g_packetLengths)) { switch (GetRagConnection().GetPacketType(reinterpret_cast(g_gameModePacketBuffer))) { case 0x69: @@ -2484,31 +2482,31 @@ void CLoginMode::PollNetworkStatus() { break; } case 0x6B: - this->ReceiveAcceptEnter(reinterpret_cast(g_gameModePacketBuffer), dialogs); + this->ReceiveAcceptEnter(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x6C: GetRagConnection().Close(); switch (reinterpret_cast(g_gameModePacketBuffer)->result) { case 1: - dialogs.Confirm(LookupMessage(0xD0), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xD0), 0, true, true, 0, "Message", 280, 120, 0); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; break; case 0x6F: - dialogs.Confirm(LookupMessage(0x749), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x749), 0, true, false, 0, "Message", 280, 120, 0); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; break; case 0x76: - dialogs.Confirm(LookupMessage(0xEEA), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xEEA), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 6; break; case 0x77: - dialogs.Confirm(LookupMessage(0xB71), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xB71), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 6; break; default: - dialogs.Confirm(LookupMessage(9), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(9), 0, true, false, 0, "Message", 280, 120, 0); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; break; @@ -2539,7 +2537,7 @@ void CLoginMode::PollNetworkStatus() { message = 11; break; } - dialogs.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2575,7 +2573,7 @@ void CLoginMode::PollNetworkStatus() { message = 12; break; } - dialogs.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2586,7 +2584,7 @@ void CLoginMode::PollNetworkStatus() { this->Zc_Accept_Enter2(reinterpret_cast(g_gameModePacketBuffer)); return; case 0x74: - dialogs.Confirm(LookupMessage(9), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(9), 0, true, false, 0, "Message", 280, 120, 0); GetRagConnection().Close(); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; @@ -2598,7 +2596,7 @@ void CLoginMode::PollNetworkStatus() { this->ReceiveBillingInfo(g_gameModePacketBuffer); break; case 0x1BE: - if (dialogs.Confirm(LookupMessage(0x2B3), 2, true, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x2B3), 2, true, false, 0, "Message", 280, 120, 0) == 0xBB) { GameRoomReplyPacket reply; reply.id = 0x1BF; reply.permission = 1; @@ -2619,7 +2617,7 @@ void CLoginMode::PollNetworkStatus() { case 0x1F1: { const LoginMessagePacket* packet = reinterpret_cast(g_gameModePacketBuffer); const std::string message(packet->text, packet->length - offsetof(LoginMessagePacket, text)); - dialogs.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; break; @@ -2633,7 +2631,7 @@ void CLoginMode::PollNetworkStatus() { break; } case 0x23D: - dialogs.Confirm(LookupMessage(0x3FC), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x3FC), 0, true, false, 0, "Message", 280, 120, 0); break; case 0x28B: { const AcceptEnterNeoUnionPacket* packet = reinterpret_cast(g_gameModePacketBuffer); @@ -2655,14 +2653,14 @@ void CLoginMode::PollNetworkStatus() { if (packet->result != 0) { char text[300]; sprintf(text, LookupMessage(0x4BD), reinterpret_cast(&g_session.unknown_5913[5])); - if (dialogs.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { ChangeCharacterNamePacket request; request.id = 0x28F; request.gid = *reinterpret_cast(&g_session.unknown_5913[1]); GetRagConnection().Send(g_packetLengths.FixedLength(request.id), &request); break; } - } else if (dialogs.Confirm(LookupMessage(10), 0, true, true, 0, "Message", 280, 120, 0) != 0xB8) { + } else if (g_windowMgr.Confirm(LookupMessage(10), 0, true, true, 0, "Message", 280, 120, 0) != 0xB8) { break; } @@ -2672,27 +2670,27 @@ void CLoginMode::PollNetworkStatus() { break; } case 0x290: - this->ReceiveCharacterResult(reinterpret_cast(g_gameModePacketBuffer), dialogs); + this->ReceiveCharacterResult(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x2CA: switch (reinterpret_cast(g_gameModePacketBuffer)->result) { case 0: - dialogs.Confirm(LookupMessage(0x546), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x546), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: - dialogs.Confirm(LookupMessage(0x547), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x547), 0, true, false, 0, "Message", 280, 120, 0); break; case 2: - dialogs.Confirm(LookupMessage(0x548), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x548), 0, true, false, 0, "Message", 280, 120, 0); break; case 3: - dialogs.Confirm(LookupMessage(0x549), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x549), 0, true, false, 0, "Message", 280, 120, 0); break; case 4: - dialogs.Confirm(LookupMessage(0x54A), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x54A), 0, true, false, 0, "Message", 280, 120, 0); break; case 5: - dialogs.Confirm(LookupMessage(0x554), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x554), 0, true, false, 0, "Message", 280, 120, 0); break; } this->pendingCursorType = GetRagConnection().NativeSocket() != INVALID_SOCKET ? 7 : 3; @@ -2704,13 +2702,13 @@ void CLoginMode::PollNetworkStatus() { this->ReceiveCharacterList(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x828: - this->ReceiveDeleteReservation(reinterpret_cast(g_gameModePacketBuffer), dialogs); + this->ReceiveDeleteReservation(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x82A: - this->ReceiveDeleteCharacter(reinterpret_cast(g_gameModePacketBuffer), dialogs); + this->ReceiveDeleteCharacter(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x82C: - this->ReceiveDeleteCancel(reinterpret_cast(g_gameModePacketBuffer), dialogs); + this->ReceiveDeleteCancel(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x82D: this->ReceiveCharacterSlots(reinterpret_cast(g_gameModePacketBuffer)); @@ -2722,7 +2720,7 @@ void CLoginMode::PollNetworkStatus() { break; } case 0x840: - this->ReceiveMapStates(reinterpret_cast(g_gameModePacketBuffer), dialogs); + this->ReceiveMapStates(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x851: IgnoreRemovedPacket(g_gameModePacketBuffer); @@ -2736,26 +2734,26 @@ void CLoginMode::PollNetworkStatus() { switch (packet->result) { case 0: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x761), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x761), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x76A), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x76A), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 2: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 3: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 4: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x765), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x765), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2767,11 +2765,11 @@ void CLoginMode::PollNetworkStatus() { switch (packet->result) { case 0: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x762), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x762), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: g_windowMgr.CloseWindow(200); - dialogs.Confirm(LookupMessage(0x766), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x766), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2783,21 +2781,21 @@ void CLoginMode::PollNetworkStatus() { switch (packet->result) { case 0: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x763), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x763), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x767), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x767), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 2: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 3: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2809,13 +2807,13 @@ void CLoginMode::PollNetworkStatus() { switch (packet->result) { case 0: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x76D), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x76D), 0, true, false, 0, "Message", 280, 120, 0); static_cast(g_windowMgr.window_03D4)->EnableButtonById(0x1A2); g_passwordWndMode = 1; break; case 1: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x76E), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x76E), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2825,12 +2823,12 @@ void CLoginMode::PollNetworkStatus() { switch (reinterpret_cast(g_gameModePacketBuffer)->result) { case 0: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x76F), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x76F), 0, true, false, 0, "Message", 280, 120, 0); static_cast(g_windowMgr.window_03D4)->DisableButtonById(0x1A2); break; case 1: g_windowMgr.CloseWindow(199); - dialogs.Confirm(LookupMessage(0x770), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x770), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; } @@ -2838,7 +2836,7 @@ void CLoginMode::PollNetworkStatus() { case 0x8D5: case 0xB70: if (reinterpret_cast(g_gameModePacketBuffer)->result == 1) { - dialogs.Confirm(LookupMessage(0x7E1), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x7E1), 0, true, false, 0, "Message", 280, 120, 0); } break; case 0x8FD: @@ -2852,7 +2850,7 @@ void CLoginMode::PollNetworkStatus() { char text[0x400]; memset(text, 0, sizeof(text)); _snprintf(text, sizeof(text), LookupMessage(0x92C), when.tm_year + 1900, when.tm_mon + 1, when.tm_mday, when.tm_hour, when.tm_min, when.tm_sec); - dialogs.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); const std::uint64_t timestamp = static_cast(startTime) * 10000000; const std::int64_t interval = 3600000; CPartialShutDownSchedule* schedule = new CPartialShutDownSchedule(timestamp, interval, 1); @@ -2922,7 +2920,7 @@ void CLoginMode::PollNetworkStatus() { const char* text = LookupMessage(message); const std::uint8_t source[] = {0xC4, 0x08, 0xD1, 0xF2, 0xB1, 0x3A, 0x39}; thread_local EncryptedName format(source); - dialogs.Confirm(FormatString(format.Text(), text, code), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(FormatString(format.Text(), text, code), 0, true, false, 0, "Message", 280, 120, 0); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; break; @@ -3041,7 +3039,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, } case 1: GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2), 0, true, true, 0, "Message", 280, 120, 0) != 0x10D) { + if (g_windowMgr.Confirm(LookupMessage(2), 0, true, true, 0, "Message", 280, 120, 0) != 0x10D) { g_charServerAccountIdPending = 0; this->pendingCursorType = 3; } @@ -3126,7 +3124,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, ServerAddress2* servers = reinterpret_cast(this->serverList); if (servers[argument1].address.state == 3) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x2FC), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x2FC), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 6; return 0; } @@ -3360,7 +3358,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, } case 10021: GetRagConnection().Close(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { + if (g_windowMgr.Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { this->otpStarted = timeGetTime(); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; diff --git a/Source/Client/Mode/LoginModeNotices.cpp b/Source/Client/Mode/LoginModeNotices.cpp index 1bdfd61e..1fa9cb92 100644 --- a/Source/Client/Mode/LoginModeNotices.cpp +++ b/Source/Client/Mode/LoginModeNotices.cpp @@ -122,7 +122,7 @@ void CLoginMode::ReceiveBillingInfo(const unsigned char* data) { } this->otpStarted = timeGetTime() + 90000; - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 280, 120, 0); } // OFFSET: 0x00D9A9F0 @@ -155,7 +155,7 @@ void CLoginMode::ReceiveNotifyBan(const unsigned char* data) { break; case 6: strcpy(text, LookupMessage(438)); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, true, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(text, 2, true, true, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.Quit(); OpenAccountRegistration(); } @@ -248,7 +248,7 @@ void CLoginMode::ReceiveNotifyBan(const unsigned char* data) { thread_local EncryptedName format(source); char message[256]; sprintf(message, format.Text(), text, packet->errorCode); - reinterpret_cast(&g_windowMgr)->Confirm(message, 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message, 0, true, true, 0, "Message", 280, 120, 0); } if (g_loginModeFlag == true) { diff --git a/Source/Client/ReplayPacketRecorder.cpp b/Source/Client/ReplayPacketRecorder.cpp index 03699f6b..f9bc250c 100644 --- a/Source/Client/ReplayPacketRecorder.cpp +++ b/Source/Client/ReplayPacketRecorder.cpp @@ -4,6 +4,7 @@ #include "Client/Session.h" #include "Network/Packets/PacketLengths.h" #include "Network/Packets/PacketId.h" +#include "UI/Window/UIWindow.h" #include "UI/Window/WindowPolicy.h" #include @@ -77,8 +78,8 @@ bool ReplayPacketRecorder::Record(std::uint16_t bytes, const void* packet, int e // OFFSET: 0x00A82F00 // FUNCTION: fn_16999 -void WindowResponseRecorder::Record(int windowId, int response, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (this->mode != 2) { +void UIWindow::RecordResponse(int response, std::intptr_t b, std::intptr_t c, std::intptr_t d) { + if (Replay::Instance().state != 2) { return; } @@ -92,8 +93,8 @@ void WindowResponseRecorder::Record(int windowId, int response, std::intptr_t b, }; #pragma pack(pop) static_assert(sizeof(Response) == 26); - const Response packet{0x038408AEu, 26, windowId, response, {static_cast(b), static_cast(c), static_cast(d)}}; - this->packets.Record(sizeof(packet), &packet, 42, 0); + const Response packet{0x038408AEu, 26, this->geometry.id, response, {static_cast(b), static_cast(c), static_cast(d)}}; + reinterpret_cast(&Replay::Instance())->Record(sizeof(packet), &packet, 42, 0); } // OFFSET: 0x00B86AB0 diff --git a/Source/Client/ReplayPacketRecorder.h b/Source/Client/ReplayPacketRecorder.h index a3896bf9..197c014f 100644 --- a/Source/Client/ReplayPacketRecorder.h +++ b/Source/Client/ReplayPacketRecorder.h @@ -27,13 +27,6 @@ struct ReplayPacketRecorder { bool Record(std::uint16_t bytes, const void* packet, int event, std::uint32_t delay); }; -struct WindowResponseRecorder { - const int& mode; - ReplayPacketRecorder& packets; - - void Record(int windowId, int response, std::intptr_t b, std::intptr_t c, std::intptr_t d); -}; - struct WindowReplayRecorder { const int& windowId; const int* policy; diff --git a/Source/Client/Session.h b/Source/Client/Session.h index d77535e4..5a1f3be2 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -27,13 +27,13 @@ #include #include +class UIWindowMgr; class CActRes; class CGameActor; class CRenderObject; class LuaScript; struct JobNameInitialization; struct ActionFrame; -struct WindowDialogs; struct vector3d; struct EquipSlots { @@ -833,13 +833,13 @@ public: CSkillInfo HomunSkillAt(int index) const; CSkillInfo MercSkillAt(int index) const; int CountProhibitionLog(std::uint32_t aid); - void DeleteProhibitionLog(std::uint32_t aid, std::uint32_t minutes, WindowDialogs& dialogs); + void DeleteProhibitionLog(std::uint32_t aid, std::uint32_t minutes); void AddProhibitionLog(std::uint32_t aid, std::uint32_t minutes); void LoadProhibitionLog(); void ResetUnknown1050(); int ProcessEmotionShortcut(const char* text); int IsAdminSubMode(int subMode); - void GetMonsterSkillInfo(const char* monster, int skill, int* action, int* loopType, WindowDialogs& dialogs); + void GetMonsterSkillInfo(const char* monster, int skill, int* action, int* loopType); const char* DecodePlayerName() const; bool HasSkillEffect(std::uint32_t id) const; CSkillInfo LookupHomunSkill(std::uint32_t id) const; diff --git a/Source/Client/Stove/StoveMgr.cpp b/Source/Client/Stove/StoveMgr.cpp index c980ea98..a5580574 100644 --- a/Source/Client/Stove/StoveMgr.cpp +++ b/Source/Client/Stove/StoveMgr.cpp @@ -206,7 +206,7 @@ void ShutdownCallback::operator()(Stove::PCSDK::CallbackResult callbackResult, S MessageBoxA(hWnd, message.c_str(), caption, MB_OK); g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); } else if (g_alternateDoubleClickGate == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0); } else { UIBroadcastBalloon* balloonWindow = static_cast(g_modeMgr.GetGameMode())->EnsureBroadcastBalloon(); if (balloonWindow != nullptr) { @@ -687,7 +687,7 @@ void CStoveMgr::StartPurchase(const std::vector& items) { thread_local EncryptedName verbName(verbSource); const char* verb = verbName.Text(); ShellExecuteA(nullptr, verb, url, url, nullptr, SW_SHOWNORMAL); - if (reinterpret_cast(&g_windowMgr)->Confirm(PurchaseCheckingMessage()().Text(), 2, true, false, 0, "Message", 250, 170, 0) == 187) { + if (g_windowMgr.Confirm(PurchaseCheckingMessage()().Text(), 2, true, false, 0, "Message", 250, 170, 0) == 187) { IAP_ConfirmPurchase((static_cast(this->unknown_0014) << 32) | static_cast(this->unknown_0010), sub_63A9D0); g_stoveWaitingCallback = true; do { diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 918aae1a..3d262186 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -2513,8 +2513,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a box->Create(nullptr, text.c_str(), 2, true, nullptr, 280, 128, nullptr); box->m_keepOpen = 1; g_windowMgr.AddRendered(box); - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); - if (dialogs.RunModal(box) == 187) { + if (g_windowMgr.RunModal(box) == 187) { CashEmotionPurchasePacket packet; packet.id = 0xBEC; packet.packId = g_cashEmotionMgr->unknown_01C4; diff --git a/Source/Contents/Configuration/ServiceOptions.cpp b/Source/Contents/Configuration/ServiceOptions.cpp index 26216f6b..5aa45f3a 100644 --- a/Source/Contents/Configuration/ServiceOptions.cpp +++ b/Source/Contents/Configuration/ServiceOptions.cpp @@ -1124,7 +1124,7 @@ void ApplyServiceOptionAskOnDisable(int id, unsigned char value, bool notify, in } if (!value && - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x1104), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBC) { + g_windowMgr.Confirm(LookupMessage(0x1104), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBC) { g_serviceOptions.Set(0x128, 1); sub_AAB070(0x128); return; @@ -1297,7 +1297,7 @@ void ApplyServiceOptionWeatherFlag(int id, unsigned char value, bool notify, int // FUNCTION: fn_06364 void ApplyServiceOptionWindow27() { if (g_windowMgr.unknown_0304 != 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x24B), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x24B), 0, true, false, 0, "Message", 0x118, 0x78, 0); return; } diff --git a/Source/Contents/Emblems/EmblemUpload.cpp b/Source/Contents/Emblems/EmblemUpload.cpp index 7eb2add5..9352684e 100644 --- a/Source/Contents/Emblems/EmblemUpload.cpp +++ b/Source/Contents/Emblems/EmblemUpload.cpp @@ -45,7 +45,7 @@ void CEmblemDataMgr::CompleteUpload(AsyncDiagnostic diagnostic, std::string resp case 3: case 4: { const char* message = LookupMessage(3586); - reinterpret_cast(&g_windowMgr)->Confirm(message, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message, 0, true, false, 0, "Message", 280, 120, 0); break; } default: diff --git a/Source/Contents/EntryQueueMgr.cpp b/Source/Contents/EntryQueueMgr.cpp index fda55a4c..773490d3 100644 --- a/Source/Contents/EntryQueueMgr.cpp +++ b/Source/Contents/EntryQueueMgr.cpp @@ -171,7 +171,7 @@ void CEntryQueueMgr::OnApplyResult(const EntryQueueApplyResult* packet) { return; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(message), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(message), 0, false, false, 0, "Message", 0x118, 0x78, 0); } // OFFSET: 0x00BA2660 @@ -179,18 +179,18 @@ void CEntryQueueMgr::OnApplyResult(const EntryQueueApplyResult* packet) { void CEntryQueueMgr::OnCancelResult(const EntryQueueNotice* notice) { switch (notice->result) { case 1: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x83E), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x83E), 0, false, false, 0, "Message", 0x118, 0x78, 0); g_windowMgr.CloseWindow(209); this->ready = 0; break; case 3: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x83F), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x83F), 0, false, false, 0, "Message", 0x118, 0x78, 0); break; case 11: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x840), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x840), 0, false, false, 0, "Message", 0x118, 0x78, 0); break; case 14: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x841), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x841), 0, false, false, 0, "Message", 0x118, 0x78, 0); g_windowMgr.CloseWindow(209); this->ready = 0; break; @@ -266,9 +266,9 @@ void CEntryQueueMgr::OnReady(const EntryQueueReady* packet) { // FUNCTION: fn_19673 void CEntryQueueMgr::OnResultNotice(const EntryQueueNotice* notice) { if (notice->result == 3) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x83F), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x83F), 0, false, false, 0, "Message", 0x118, 0x78, 0); } else if (notice->result == 11) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x840), 0, false, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x840), 0, false, false, 0, "Message", 0x118, 0x78, 0); } } diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index b2350132..b50d0d80 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -1529,7 +1529,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (!g_messengerGroupCollapsed && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0xBF), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0xBF), 0, true, false, 0, "Message", 0x118, 0x78, 0); } } return 0; @@ -1567,11 +1567,11 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid) { if (this->mode == 0) { - if (reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0x164), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x164), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.gameMode->SendMsg(0xB0, member.accountId, member.characterId, 0, 0); } } else if (!(member.name == g_session.DecodePlayerName())) { - if (reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0x16B), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x16B), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.gameMode->SendMsg(0x3E, reinterpret_cast(member.name.c_str()), 0, 0, 0); } } @@ -1582,7 +1582,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (!g_messengerGroupCollapsed && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid && member.name == g_session.DecodePlayerName()) { - if (reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.gameMode->SendMsg(0x3D, 0, 0, 0, 0); } } @@ -1628,7 +1628,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; case 0x1BE: if (!g_messengerGroupCollapsed) { - if (reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.gameMode->SendMsg(0x3D, 0, 0, 0, 0); if (g_windowMgr.unknown_042C) { g_windowMgr.CloseWindow(0xD0); @@ -1648,7 +1648,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (g_session.unknown_5464) { g_windowMgr.EnsureWindow(0xD0); } else { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0x816), 4, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x816), 4, true, false, 0, "Message", 0x118, 0x78, 0); } } if (this->mode == 1) { @@ -1900,7 +1900,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } MessengerMember member = this->MemberAtIndex(this->selected); if (member.name.find(g_messengerNamelessTag, 0) != std::string::npos) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0xBE1), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0xBE1), 0, true, false, 0, "Message", 0x118, 0x78, 0); return 0; } if (!member.valid) { @@ -1938,7 +1938,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (this->selected != -1) { MessengerMember target = this->MemberAtIndex(this->selected); if (target.valid && !target.offline) { - if (reinterpret_cast(g_windowMgr).Confirm(LookupMessage(0x5FD), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x5FD), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.gameMode->SendMsg(0x104, target.accountId, 0, 0, 0); } } else { diff --git a/Source/Contents/MonsterXmlActions.cpp b/Source/Contents/MonsterXmlActions.cpp index 5c263b83..a5247978 100644 --- a/Source/Contents/MonsterXmlActions.cpp +++ b/Source/Contents/MonsterXmlActions.cpp @@ -29,7 +29,7 @@ int CSession::IsAdminSubMode(int subMode) { // OFFSET: 0x00E09B50 // FUNCTION: fn_23789 -void CSession::GetMonsterSkillInfo(const char* monster, int skill, int* action, int* loopType, WindowDialogs& dialogs) { +void CSession::GetMonsterSkillInfo(const char* monster, int skill, int* action, int* loopType) { *action = -1; char tableName[21]; @@ -66,8 +66,8 @@ void CSession::GetMonsterSkillInfo(const char* monster, int skill, int* action, if (this->IsAdminSubMode(1) && (!actionNode || !loopNode)) { *action = 0; *loopType = 0; - dialogs.Confirm("에러발생. 클라이언트 담당자 에게 에러 사실을 통보 하세요. 위치 - CPlayer :: GetMonsterSkillInfo", 0, true, false, 0, "Message", 280, 120, 0); - dialogs.Confirm("action 또는 loopType 이 존재하지 않음.", 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm("에러발생. 클라이언트 담당자 에게 에러 사실을 통보 하세요. 위치 - CPlayer :: GetMonsterSkillInfo", 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm("action 또는 loopType 이 존재하지 않음.", 0, true, false, 0, "Message", 280, 120, 0); return; } diff --git a/Source/Contents/NavigationCandidates.cpp b/Source/Contents/NavigationCandidates.cpp index 87a00538..106582a8 100644 --- a/Source/Contents/NavigationCandidates.cpp +++ b/Source/Contents/NavigationCandidates.cpp @@ -18,7 +18,7 @@ bool CNavigationManager::CollectStartLinks() { const std::string resolved = ResourceMgr::Instance().aliases.ResolveMapName(g_session.m_navigationPlayerMap); info = this->FindObject(resolved.c_str()); if (info == nullptr) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2293), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2293), 0, true, false, 0, "Message", 280, 120, 0); return false; } } diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index 55249b74..68be103d 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -9,6 +9,7 @@ #include #include +class UIWindowMgr; class CActRes; class CNaviInfo; class CNavi_Link; @@ -18,7 +19,6 @@ class CTexture; class GroundGeometry; class LuaScript; struct NavigationTarget; -struct WindowDialogs; struct NaviCell { /* 0000 */ int x; @@ -320,7 +320,7 @@ public: int RequestRoute(int cellX, int cellY); NaviCell* MapCellToView(NaviCell* out, const char* mapName, int cellX, int cellY, float size); std::string RouteText(); - __declspec(noinline) void ShowRouteResult(int result, int mode, WindowDialogs& dialogs); + __declspec(noinline) void ShowRouteResult(int result, int mode); void Reset(bool clearAll); void ClearRouteNodes(); void ClearNodePaths(); diff --git a/Source/Contents/NavigationRoute.cpp b/Source/Contents/NavigationRoute.cpp index 84dd7be3..97fc132e 100644 --- a/Source/Contents/NavigationRoute.cpp +++ b/Source/Contents/NavigationRoute.cpp @@ -270,13 +270,12 @@ void CNavigationManager::RequestPrivateAirship(std::string mapName, int itemId) } if (itemId == 0x1AFD) { - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); - UIPayConfirmWnd* window = new UIPayConfirmWnd(dialogs.dialog); + UIPayConfirmWnd* window = new UIPayConfirmWnd(); window->Configure(LookupMessage(0xFC1), 0x1AFD); window->SendMsg(nullptr, 0x9C, 1, 0, 0, 0); window->SetId(0x16B); g_windowMgr.AddRendered(window); - if (dialogs.RunModal(window) != 187) { + if (g_windowMgr.RunModal(window) != 187) { return; } } @@ -337,7 +336,7 @@ std::string CNavigationManager::RouteText() { // OFFSET: 0x00B98780 // FUNCTION: fn_19609 -void CNavigationManager::ShowRouteResult(int result, int mode, WindowDialogs& dialogs) { +void CNavigationManager::ShowRouteResult(int result, int mode) { std::string message; switch (result) { case -100: @@ -442,14 +441,14 @@ void CNavigationManager::ShowRouteResult(int result, int mode, WindowDialogs& di } if (mode == 0 || mode == 2) { - dialogs.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); if (mode == 4) { CNavi_Object* node = g_navigationManager.nodes.size() == 0 ? nullptr : g_navigationManager.nodes[0]; std::string text(LookupMessage(2321)); text += node->GetName(); text += " "; text += static_cast(node)->GetLinkedName(); - dialogs.Confirm(text.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } } } @@ -619,7 +618,7 @@ bool CNavigationManager::sub_B99030(std::string name, int type, unsigned char mo same = player == target; } if (!same) { - this->ShowRouteResult(-90, 1, *reinterpret_cast(&g_windowMgr)); + this->ShowRouteResult(-90, 1); return false; } } @@ -640,7 +639,7 @@ bool CNavigationManager::sub_B99030(std::string name, int type, unsigned char mo if (type == 2) { CNavi_Object* npc = info->FindNpcAt(x, y); if (!npc) { - this->ShowRouteResult(-94, 1, *reinterpret_cast(&g_windowMgr)); + this->ShowRouteResult(-94, 1); return false; } text += ' '; @@ -649,7 +648,7 @@ bool CNavigationManager::sub_B99030(std::string name, int type, unsigned char mo } else if (type == 3) { CNavi_Object* mob = info->FindMobByIndex(id); if (!mob) { - this->ShowRouteResult(-94, 1, *reinterpret_cast(&g_windowMgr)); + this->ShowRouteResult(-94, 1); return false; } text += ' '; @@ -673,7 +672,7 @@ bool CNavigationManager::sub_B99030(std::string name, int type, unsigned char mo } const int result = this->Navigate(x, y); - this->ShowRouteResult(result, 1, *reinterpret_cast(&g_windowMgr)); + this->ShowRouteResult(result, 1); if (result < 0) { return false; } @@ -2002,7 +2001,7 @@ void CNavigationManager::ResumeRoute() { this->LoadTargetPreview(); g_windowMgr.EnsureWindow(203); } else if (this->unknown_1258 == 2) { - this->ShowRouteResult(this->RouteFromPlayer(), 1, *reinterpret_cast(&g_windowMgr)); + this->ShowRouteResult(this->RouteFromPlayer(), 1); if (!this->unknown_1248) { g_windowMgr.EnsureWindow(203); } diff --git a/Source/Contents/Schedule/CheckGDISchedule.cpp b/Source/Contents/Schedule/CheckGDISchedule.cpp index 4e69113c..1099c976 100644 --- a/Source/Contents/Schedule/CheckGDISchedule.cpp +++ b/Source/Contents/Schedule/CheckGDISchedule.cpp @@ -53,9 +53,9 @@ perform_check: g_timeScheduler[13] = 1; if (roll == 2) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(857), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(857), 0, true, false, 0, "Message", 280, 120, 0); } else if (roll == 4) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(800), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(800), 0, true, false, 0, "Message", 280, 120, 0); } GetRagConnection().Close(); diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index 956d50a1..83f293f2 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -510,7 +510,7 @@ int CSession::CountProhibitionLog(std::uint32_t aid) { // OFFSET: 0x00E085A0 // FUNCTION: fn_23763 -void CSession::DeleteProhibitionLog(std::uint32_t aid, std::uint32_t minutes, WindowDialogs& dialogs) { +void CSession::DeleteProhibitionLog(std::uint32_t aid, std::uint32_t minutes) { const char* message; auto found = this->m_prohibitionLog.end(); for (auto entry = this->m_prohibitionLog.begin(); entry != this->m_prohibitionLog.end(); ++entry) { @@ -528,7 +528,7 @@ void CSession::DeleteProhibitionLog(std::uint32_t aid, std::uint32_t minutes, Wi message = "채팅 로그 삭제 성공"; } - dialogs.Confirm(message, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(message, 0, true, false, 0, "Message", 280, 120, 0); } // OFFSET: 0x00E08690 diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 089545b7..dc1863dd 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -734,7 +734,7 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum switch (argument1) { case 189: if (!g_session.IsNavigationAllowed()) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2767), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2767), 0, true, false, 0, "Message", 280, 120, 0); } else if (!g_windowMgr.CloseWindow(273)) { g_windowMgr.sub_A978D0(273); } @@ -949,24 +949,7 @@ int UINpcEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } if (message == 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 recorder{replay.state, packets}; - recorder.Record(this->geometry.id, static_cast(argument1), argument2, argument3, argument4); + this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); if (argument1 == 184 && this->edit->Length()) { static_cast(g_charViewMode)->SendMsg(99, this->unknown_00B8, std::atoi(this->edit->Text()), 0, 0); g_windowMgr.CloseWindow(56); @@ -999,24 +982,7 @@ int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return this->UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - 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 recorder{replay.state, packets}; - recorder.Record(this->geometry.id, static_cast(argument1), argument2, argument3, argument4); + this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); if (Replay::Instance().state == 7) { this->edit->SetText("임시"); } @@ -1371,24 +1337,7 @@ int UISpellListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen return this->m_scroll - previous; } 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 recorder{replay.state, packets}; - recorder.Record(this->geometry.id, static_cast(argument1), argument2, argument3, argument4); + this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); CMode* mode = static_cast(g_charViewMode); if (argument1 == 184) { const int selected = this->m_selected; @@ -2691,11 +2640,7 @@ int UICombinedCardItemCollectionWnd::SendMsg(UIWindow* sender, int message, std: int UIItemCompositionWnd::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: { - 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, this->m_selected, d); + this->RecordResponse(static_cast(a), b, this->m_selected, d); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(c); } @@ -2769,11 +2714,7 @@ int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a int UIItemIdentifyWnd::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: { - 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, this->m_selected, d); + this->RecordResponse(static_cast(a), b, this->m_selected, d); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(c); } @@ -3312,7 +3253,7 @@ void UISayDialogWnd::Resize(int width, int height) { // FUNCTION: fn_12325 int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { - this->m_acceptance->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { g_windowMgr.CloseWindow(110); static_cast(g_charViewMode)->SendMsg(173, this->identity, 1, 0, 0); @@ -3362,7 +3303,7 @@ int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // FUNCTION: fn_12326 int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { - this->m_acceptance->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { g_windowMgr.CloseWindow(105); g_windowMgr.EnsureWindow(110)->SendMsg(nullptr, 91, 184, b, 0, 0); @@ -3600,7 +3541,7 @@ struct SessionItemLists { int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { const int response = static_cast(a); - this->m_acceptance->recorder.Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (this->geometry.visible != 0) { if (response == 185) { @@ -4849,11 +4790,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: 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); + this->RecordResponse(static_cast(a), b, c, this->unknown_00C8); if (g_replayAnimationScaling != 0) { this->unknown_00C8 = static_cast(d); } @@ -4987,7 +4924,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: char text[24]; std::sprintf(text, "%s ", this->unknown_00C0->Text()); if (!g_session.IsNumberWithCommas(text)) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); return 0; } @@ -6421,7 +6358,7 @@ UIJoinGuildAcceptWnd::UIJoinGuildAcceptWnd(UIAcceptanceContext& acceptance) // FUNCTION: fn_12352 int UIJoinGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { - this->m_acceptance->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { g_windowMgr.CloseWindow(70); g_windowMgr.CloseWindow(214); @@ -6843,7 +6780,7 @@ int UIItemParamChangeDisplayWnd::SendMsg(UIWindow* sender, int message, std::int // FUNCTION: fn_12351 int UIJoinFriendAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { - this->m_acceptance->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); int accepted; if (a == 184) { g_windowMgr.CloseWindow(109); @@ -7099,7 +7036,7 @@ int UISkillNameChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a // FUNCTION: fn_12382 int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { - this->m_acceptance->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { CMode* mode = g_modeMgr.GetGameMode(); g_windowMgr.CloseWindow(119); @@ -7410,7 +7347,6 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in // FUNCTION: fn_12384 int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { CMode* mode = static_cast(g_charViewMode); - auto& dialogs = *reinterpret_cast(&g_windowMgr); if (message == 6) { switch (a) { @@ -7426,7 +7362,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ g_windowMgr.CloseWindow(115); break; } - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); this->unknown_00F4 = 0; this->unknown_00F8 = this->unknown_00FC; this->unknown_00EC = 0; @@ -7448,7 +7384,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->FillRegion(111, 79, 98, 14, 0xFFFFFF); break; } - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); this->unknown_00F4 = 1; this->unknown_00F8 = this->unknown_00FC; this->unknown_00EC = 0; @@ -7469,7 +7405,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->FillRegion(111, 118, 98, 14, 0xFFFFFF); break; } - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); this->unknown_00F8 = this->unknown_0100; this->unknown_00F4 = 2; this->unknown_00EC = 0; @@ -7494,7 +7430,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ mode->SendMsg(188, password, g_session.m_storePasswordMode, newPassword, 0); g_windowMgr.CloseWindow(115); } else { - dialogs.Confirm(LookupMessage(1016), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1016), 0, true, false, 0, "Message", 280, 120, 0); this->unknown_00F4 = 2; this->unknown_00F8 = this->unknown_0100; this->unknown_00EC = 0; @@ -7506,7 +7442,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } break; } - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); this->unknown_00F4 = 3; this->unknown_00F8 = this->unknown_0104; this->unknown_00EC = 0; @@ -7541,7 +7477,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 293: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7562,7 +7498,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 294: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7583,7 +7519,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 295: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7604,7 +7540,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 296: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7625,7 +7561,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 297: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7646,7 +7582,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 298: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7667,7 +7603,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 299: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7688,7 +7624,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 300: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7709,7 +7645,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 301: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -7730,7 +7666,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 302: if (++this->unknown_00EC > 8) { - dialogs.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; } switch (this->unknown_00F4) { @@ -8144,7 +8080,7 @@ int UIAutoMessageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (a == 184) { reinterpret_cast(g_session.unknown_56B8[4]) = this->m_edit->Text(); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(942)), 0x64FFFF, 0, 0, 0); - reinterpret_cast(g_windowMgr).RestoreInput(); + g_windowMgr.RestoreInput(); g_windowMgr.CloseWindow(116); } return 0; @@ -8287,7 +8223,7 @@ void UIExchangeWnd::Slot19() { char text[24]; std::sprintf(text, "%s", edit->Text()); if (!g_session.IsNumberWithCommas(text)) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); edit->SetText(this->m_moneyText.c_str()); g_windowMgr.SetFocus(edit); return; @@ -8295,7 +8231,7 @@ void UIExchangeWnd::Slot19() { std::int64_t money = _atoi64(text); if (money > 1000000000) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(2467), 2, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2467), 2, true, false, 0, "Message", 280, 120, 0); FormatGroupedInteger(1000000000, text, sizeof(text)); edit->SetText(text); money = 1000000000; @@ -8503,24 +8439,7 @@ UISpellListWnd::UISpellListWnd() : UIItemIdentifyWnd() { int UIPetEggListWnd::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: { - 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 recorder{replay.state, packets}; - recorder.Record(this->geometry.id, static_cast(argument1), argument2, this->m_selected, argument4); + this->RecordResponse(static_cast(argument1), argument2, this->m_selected, argument4); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(argument3); } @@ -8947,11 +8866,7 @@ void UInCashWnd::Slot26(int x, int y) { int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { 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->m_selected); + this->RecordResponse(static_cast(a), b, c, this->m_selected); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(d); this->Invalidate(); @@ -9086,11 +9001,7 @@ void UITipboxWnd::Slot19() { int UIChooseWarpWnd::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: { - 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, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { const int selected = this->m_list->selected; if (selected != -1) { @@ -9760,11 +9671,7 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in 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, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { const std::uint32_t tick = GetTickCount(); if (tick - *reinterpret_cast(&g_session.unknown_5490[0x04]) >= 300) { diff --git a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp index 6f0a8155..fba483e0 100644 --- a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp @@ -40,7 +40,7 @@ int UIExchangeAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (message == 6) { const int response = static_cast(a); - owner.recorder.Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (response == 184 || response == 185) { g_windowMgr.CloseWindow(32); diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp index 22e3df7b..c36b9b68 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp @@ -24,7 +24,7 @@ UIJoinPartyAcceptWnd::~UIJoinPartyAcceptWnd() = default; int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { const int response = static_cast(a); - this->m_acceptance->recorder.Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (response == 184 || response == 185) { g_windowMgr.CloseWindow(35); diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h index b0c17e09..1f6aada0 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.h @@ -5,12 +5,10 @@ #include "UI/Window/UIFrameWnd.h" class UITextViewer; -struct WindowResponseRecorder; struct NormalItemSlotWindow; struct UIAcceptanceContext { void* unknown_text; - WindowResponseRecorder& recorder; const int& screenWidth; const int& screenHeight; const int& service; diff --git a/Source/UI/Buttons/UIButton.cpp b/Source/UI/Buttons/UIButton.cpp index 03d54866..87dad481 100644 --- a/Source/UI/Buttons/UIButton.cpp +++ b/Source/UI/Buttons/UIButton.cpp @@ -171,7 +171,7 @@ void UIButton::Slot31(int x, int y) { int id = this->geometry.id; if (id == 185 && g_charViewMode && static_cast(g_charViewMode)->cursorType == 2) { const char* text = LookupMessage(17); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); } } else { diff --git a/Source/UI/Buttons/UITextureButton.cpp b/Source/UI/Buttons/UITextureButton.cpp index 36c06ff2..549a5be4 100644 --- a/Source/UI/Buttons/UITextureButton.cpp +++ b/Source/UI/Buttons/UITextureButton.cpp @@ -39,7 +39,7 @@ void UITextureButton::Slot31(int x, int y) { int id = this->geometry.id; if (id == 185 && g_charViewMode && static_cast(g_charViewMode)->cursorType == 2) { const char* text = LookupMessage(17); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); } } else { diff --git a/Source/UI/CashShop/UICashShopWnd.cpp b/Source/UI/CashShop/UICashShopWnd.cpp index 182f4cee..e860c8f2 100644 --- a/Source/UI/CashShop/UICashShopWnd.cpp +++ b/Source/UI/CashShop/UICashShopWnd.cpp @@ -796,7 +796,6 @@ void UICashShopWnd_Banner::CreateButtons() { // OFFSET: 0x007D17A0 // FUNCTION: fn_09558 int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); ClientItemLists& itemLists = reinterpret_cast(g_session); const SessionMessengerContext& lists = reinterpret_cast(g_session); switch (message) { @@ -850,7 +849,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (g_session.unknown_5912) { const int owned = lists.GetList0Size() + g_session.CountItems17F0() + g_session.CountItems2B50(); if (g_session.m_weight > g_session.m_maxWeight * 0.7f || cartItems.front().quantity + owned > g_session.unknown_7FBC + 100) { - dialogs.Confirm(LookupMessage(0xBCE), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0xBCE), 0, true, false, 0, "Message", 0x118, 0x78, 0); return 0; } @@ -861,7 +860,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument const int points = atoi(this->unknown_00F4->Text()); const int price = this->unknown_00F0; if (price < points) { - dialogs.Confirm(LookupMessage(0x744), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x744), 0, true, false, 0, "Message", 0x118, 0x78, 0); return 0; } @@ -874,11 +873,11 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument } if (this->unknown_00F0 > available) { - dialogs.Confirm(LookupMessage(0x4E6), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x4E6), 0, true, false, 0, "Message", 0x118, 0x78, 0); return 0; } - if (dialogs.Confirm(text, 2, true, true, 0, "Message", 0x118, 0x78, 0) != 0xBB) { + if (g_windowMgr.Confirm(text, 2, true, true, 0, "Message", 0x118, 0x78, 0) != 0xBB) { return 0; } @@ -950,7 +949,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument return 0; } - dialogs.Confirm(LookupMessage(0x42D), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x42D), 0, true, false, 0, "Message", 0x118, 0x78, 0); } return 0; } @@ -1046,7 +1045,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (product != this->m_items.end()) { const int stock = product->unknown_0078[3]; if (stock <= 0) { - dialogs.Confirm(LookupMessage(0xE50), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0xE50), 0, true, false, 0, "Message", 0x118, 0x78, 0); mode->SendMsg(0x12, 0, 0, 0, 0); mode->SendMsg(0x12, 0, 0, 0, 0); return 0; @@ -1141,7 +1140,6 @@ int UICashShopWnd_Banner::SendMsg(UIWindow* sender, int message, std::intptr_t a // OFFSET: 0x007D2CB0 // FUNCTION: fn_09560 int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); switch (message) { case 7: case 9: @@ -1192,7 +1190,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg const ITEM_INFO& item = *reinterpret_cast(argument1); int quantity = argument2; if (quantity == 0) { - dialogs.Confirm(LookupMessage(0xE50), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0xE50), 0, true, false, 0, "Message", 0x118, 0x78, 0); return -1; } @@ -1206,7 +1204,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg if (it == this->m_cartItems.end()) { if (g_session.unknown_5912 && !this->m_cartItems.empty()) { const int result = - dialogs.Confirm(FormatOwnedString(CashShopReplaceCartItemText()().Text(), item.unknown_0044.c_str()).c_str(), 2, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(FormatOwnedString(CashShopReplaceCartItemText()().Text(), item.unknown_0044.c_str()).c_str(), 2, true, false, 0, "Message", 0x118, 0x78, 0); if (result != 0xBB) { break; } @@ -1214,7 +1212,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg } if (this->m_cartItems.size() >= 8) { - dialogs.Confirm(FormatOwnedString(LookupMessage(0xCF0), 8).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(FormatOwnedString(LookupMessage(0xCF0), 8).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); return -1; } @@ -1222,7 +1220,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg const int limit = entry.unknown_0078[3]; if (limit != 0) { if (quantity > limit) { - dialogs.Confirm(FormatOwnedString(LookupMessage(0x9DC), limit).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(FormatOwnedString(LookupMessage(0x9DC), limit).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); } if (quantity > limit) { quantity = limit; @@ -1234,7 +1232,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg } else { const int limit = it->unknown_0078[3]; if (limit != 0 && it->quantity + quantity > limit) { - dialogs.Confirm(FormatOwnedString(LookupMessage(0x9DC), limit).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(FormatOwnedString(LookupMessage(0x9DC), limit).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); quantity = it->unknown_0078[3] - it->quantity; if (quantity == 0) { return -1; @@ -1243,7 +1241,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg const int total = it->quantity + quantity; if (total > 100) { - dialogs.Confirm(FormatOwnedString(LookupMessage(0x6A8), 100).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(FormatOwnedString(LookupMessage(0x6A8), 100).c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); it->quantity = 100; } else { it->quantity = total > 0 ? total : 1; diff --git a/Source/UI/Dialogs/UIEditctrlWnd.cpp b/Source/UI/Dialogs/UIEditctrlWnd.cpp index c6fed73d..3119b580 100644 --- a/Source/UI/Dialogs/UIEditctrlWnd.cpp +++ b/Source/UI/Dialogs/UIEditctrlWnd.cpp @@ -404,7 +404,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return 0; default: if (argument1 >= 601 && argument1 < 621) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2751), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(2751), 2, true, false, 0, "Message", 280, 120, 0) == 187) { this->memoButtons[argument1 - 601]->SetTooltip(""); this->memoButtons[argument1 - 601]->Move(-100, -100); diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index f2ae6ce4..4839570b 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -1776,7 +1776,7 @@ void UIItemWnd::Slot26(int x, int y) { case 1: case 2: if (item.GetItemId() == 12802 && - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2373), 2, false, false, 0, "Message", 280, 120, 0) == 188) { + g_windowMgr.Confirm(LookupMessage(2373), 2, false, false, 0, "Message", 280, 120, 0) == 188) { break; } mode->SendMsg(27, static_cast(item.unknown_0000[1]), 0, 0, 0); @@ -1826,8 +1826,8 @@ void UIItemWnd::Slot26(int x, int y) { break; case 18: if (*reinterpret_cast(&g_session.unknown_16F4[4]) >= 0) { - if (reinterpret_cast(&g_windowMgr) - ->Confirm(FormatOwnedString(LookupMessage(1226), item.DisplayName(0).c_str()).c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr + .Confirm(FormatOwnedString(LookupMessage(1226), item.DisplayName(0).c_str()).c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 187) { mode->SendMsg(27, static_cast(item.unknown_0000[1]), 0, 0, 0); } } @@ -1933,7 +1933,7 @@ void UIMerchantShopMakeWnd::Slot19() { char text[24]; std::sprintf(text, "%s ", edit->Text()); if (!g_session.IsNumberWithCommas(text)) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); edit->SetText(this->unknown_0170.c_str()); g_windowMgr.SetFocus(edit); return; @@ -1943,7 +1943,7 @@ void UIMerchantShopMakeWnd::Slot19() { if (price < 0) { price = 0; } else if (price > 1000000000) { - const int result = reinterpret_cast(g_windowMgr).Confirm(LookupMessage(2467), 2, true, false, 0, "Message", 280, 120, 0); + const int result = g_windowMgr.Confirm(LookupMessage(2467), 2, true, false, 0, "Message", 280, 120, 0); price = 1000000000; if (result == 187) { edit->SetText(_itoa(1000000000, text, 10)); @@ -2800,11 +2800,10 @@ int UIMerchantShopMakeWnd::CommitPrice(int next) { } UIEditCtrl* edit = this->priceEdits[this->editIndex]; - WindowDialogs& dialogs = reinterpret_cast(g_windowMgr); char text[24]; std::sprintf(text, "%s ", edit->Text()); if (!g_session.IsNumberWithCommas(text)) { - dialogs.Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(602), 0, true, false, 0, "Message", 280, 120, 0); edit->SetText("0"); g_windowMgr.SetFocus(edit); edit->SelectAll(); @@ -2815,7 +2814,7 @@ int UIMerchantShopMakeWnd::CommitPrice(int next) { if (price <= 0x7FFFFFFF && price < 0) { price = 0; } else if (price > 0x7FFFFFFF || price > 1000000000) { - if (dialogs.Confirm(LookupMessage(2467), 2, true, false, 0, "Message", 280, 120, 0) != 187) { + if (g_windowMgr.Confirm(LookupMessage(2467), 2, true, false, 0, "Message", 280, 120, 0) != 187) { edit->SetText("0"); g_windowMgr.SetFocus(edit); edit->SelectAll(); @@ -2845,7 +2844,7 @@ int UIMerchantShopMakeWnd::CommitPrice(int next) { } message += std::string(LookupMessage(2478)); - if (dialogs.Confirm(message.c_str(), 2, true, false, 0, "Message", 280, 120, 0) != 187) { + if (g_windowMgr.Confirm(message.c_str(), 2, true, false, 0, "Message", 280, 120, 0) != 187) { edit->SetText("0"); g_windowMgr.SetFocus(edit); edit->SelectAll(); @@ -4824,8 +4823,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: CMode* mode = g_modeMgr.gameMode; if (a == 184) { if (count > 0) { - WindowDialogs& dialogs = reinterpret_cast(g_windowMgr); - const int result = dialogs.Confirm(LookupMessage(1584), 2, true, false, 0, "Message", 280, 120, 0); + const int result = g_windowMgr.Confirm(LookupMessage(1584), 2, true, false, 0, "Message", 280, 120, 0); mode->SendMsg(result == 187 ? 266 : 267, this->unknown_00FC, 0, 0, 0); g_windowMgr.CloseWindow(160); g_windowMgr.CloseWindow(161); @@ -5053,24 +5051,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt return 0; } 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 recorder{replay.state, packets}; - recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); CMode* mode = static_cast(g_charViewMode); if (a == 184) { if (this->unknown_0108) { @@ -5081,7 +5062,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt } } if (sum > static_cast(g_windowMgr.unknown_0418)->unknown_0108) { - reinterpret_cast(g_windowMgr).Confirm(LookupMessage(1740), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1740), 0, true, false, 0, "Message", 280, 120, 0); return 0; } mode->SendMsg(273, this->unknown_00F8, this->unknown_0104, 0, 0); @@ -6646,24 +6627,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->Move(this->saved->x, this->saved->y); return 0; 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 recorder{replay.state, packets}; - recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 213) { if (g_replayAnimationScaling != 0) { this->checkBox->geometry.unknown_0030 = b; @@ -8720,7 +8684,7 @@ void UIItemShopWnd2::Paint() { int UIItemSellWnd::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: { - reinterpret_cast(this)->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { if (g_session.HasRequiredItems()) { diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp index 8c4fe821..9ce8b2ed 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp @@ -98,8 +98,8 @@ void UIEntryQueueListBox::Slot31(int x, int y) { // OFFSET: 0x00BA47A0 // FUNCTION: fn_19689 -UIEntryQueueRequestWnd::UIEntryQueueRequestWnd(UIEntryQueueContext& entryQueue) - : UIFrameWnd(0), m_entryQueue(&entryQueue), m_interval(1000), m_elapsed(0), m_delta(0), m_lastTick(0) { +UIEntryQueueRequestWnd::UIEntryQueueRequestWnd() + : UIFrameWnd(0), m_interval(1000), m_elapsed(0), m_delta(0), m_lastTick(0) { } // OFFSET: 0x00BA4870 @@ -205,7 +205,7 @@ void UIEntryQueueRequestWnd::Slot19() { int UIEntryQueueRequestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { const int response = static_cast(a); - this->m_entryQueue->recorder.Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (response == 0) { g_entryQueueMgr->SendAdmissionReply(1); @@ -225,8 +225,8 @@ int UIEntryQueueRequestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x00BA5560 // FUNCTION: fn_19696 -UIEntryQueueStandByWnd::UIEntryQueueStandByWnd(UIEntryQueueContext& entryQueue) - : UIFrameWnd(0), m_entryQueue(&entryQueue), m_waiting(0), m_ranking(0), m_viewer(nullptr), m_queueText(), m_waitingText(), +UIEntryQueueStandByWnd::UIEntryQueueStandByWnd() + : UIFrameWnd(0), m_waiting(0), m_ranking(0), m_viewer(nullptr), m_queueText(), m_waitingText(), m_rankingText() { } @@ -294,7 +294,7 @@ void UIEntryQueueStandByWnd::Slot19() { int UIEntryQueueStandByWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { const int response = static_cast(a); - this->m_entryQueue->recorder.Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (response == 0) { g_entryQueueMgr->SendCancel(); @@ -327,8 +327,8 @@ void UIEntryQueueStandByWnd::SetInfo(const char* queueName, int waiting, int ran // OFFSET: 0x00BA6000 // FUNCTION: fn_19704 -UIEntryQueueWnd::UIEntryQueueWnd(UIEntryQueueContext& entryQueue) - : UIFrameWnd(0), unknown_00BC(), m_labels(), m_values(), m_list(nullptr), saved(nullptr), m_entryQueue(&entryQueue), m_applyButtons(), m_helpButton(nullptr) { +UIEntryQueueWnd::UIEntryQueueWnd() + : UIFrameWnd(0), unknown_00BC(), m_labels(), m_values(), m_list(nullptr), saved(nullptr), m_applyButtons(), m_helpButton(nullptr) { } // OFFSET: 0x00BA6110 @@ -506,14 +506,14 @@ int UIEntryQueueWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std return 0; case 4: case 201: - this->m_entryQueue->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); g_windowMgr.CloseWindow(157); return 0; default: return 0; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(error), 0, false, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(error), 0, false, false, 0, "Message", 280, 120, 0); return 0; } @@ -611,7 +611,7 @@ bool UIEntryQueueWnd::ConfirmApply(const char* type) { char text[0x104]; std::memset(text, 0, sizeof(text)); sprintf_s(text, sizeof(text), "%s %s", info->displayName, type); - return reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 187; + return g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 187; } // OFFSET: 0x00BA7B90 diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.h b/Source/UI/EntryQueue/UIEntryQueueWnd.h index 6aa33084..126d253a 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.h +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.h @@ -14,12 +14,6 @@ class UIBitmapButton; class UIStaticText; struct EntryQueueInfo; class UITextViewer; -struct WindowResponseRecorder; - -struct UIEntryQueueContext { - void* unknown_text; - WindowResponseRecorder& recorder; -}; class UIEntryQueueHelpWnd : public UIFrameWnd { public: @@ -31,7 +25,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; protected: - UIEntryQueueContext* m_entryQueue; + void* unknown_entryQueue; public: /* 00B4 */ UITextViewer* m_viewer; @@ -51,7 +45,7 @@ public: class UIEntryQueueRequestWnd : public UIFrameWnd { public: - UIEntryQueueRequestWnd(UIEntryQueueContext& entryQueue); + UIEntryQueueRequestWnd(); ~UIEntryQueueRequestWnd() override; void Slot18() override; void Slot19() override; @@ -60,7 +54,7 @@ public: bool Create(); protected: - UIEntryQueueContext* m_entryQueue; + void* unknown_entryQueue; public: /* 00B4 */ UITextViewer* m_viewer; @@ -75,7 +69,7 @@ public: class UIEntryQueueStandByWnd : public UIFrameWnd { public: - UIEntryQueueStandByWnd(UIEntryQueueContext& entryQueue); + UIEntryQueueStandByWnd(); ~UIEntryQueueStandByWnd() override; void Slot18() override; void Slot19() override; @@ -85,7 +79,7 @@ public: void SetInfo(const char* queueName, int waiting, int ranking); protected: - UIEntryQueueContext* m_entryQueue; + void* unknown_entryQueue; public: /* 00B4 */ std::string m_queueName; @@ -101,7 +95,7 @@ public: class UIEntryQueueWnd : public UIFrameWnd { public: - UIEntryQueueWnd(UIEntryQueueContext& entryQueue); + UIEntryQueueWnd(); ~UIEntryQueueWnd() override; void Slot11() override; void Slot15(int width, int height) override; @@ -118,7 +112,7 @@ public: /* 0100 */ EntryQueueWndInfo* saved; protected: - UIEntryQueueContext* m_entryQueue; + void* unknown_entryQueue; void* unknown_listContext; UIBitmapButton* m_applyButtons[3]; UIBitmapButton* m_helpButton; diff --git a/Source/UI/Exchange/UIExchangeUI.cpp b/Source/UI/Exchange/UIExchangeUI.cpp index 736c93d5..c5a21321 100644 --- a/Source/UI/Exchange/UIExchangeUI.cpp +++ b/Source/UI/Exchange/UIExchangeUI.cpp @@ -258,7 +258,7 @@ void CUIExchangeUI::SubmitZeny() { this->lockButton->disabled = 1; this->lockButton->Invalidate(); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x25A), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x25A), 0, true, false, 0, "Message", 280, 120, 0); } } @@ -390,7 +390,7 @@ void CUIExchangeUI::Slot19() { } if (amount > 1000000000) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x9A3), 2, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x9A3), 2, true, false, 0, "Message", 280, 120, 0); FormatGroupedInteger(1000000000, text, sizeof(text)); this->zenyEdit->SetText(text); this->SetZeny(1000000000); @@ -403,7 +403,7 @@ void CUIExchangeUI::Slot19() { this->zenyEdit->SetCursor(this->zenyEdit->Length()); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x25A), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x25A), 0, true, false, 0, "Message", 280, 120, 0); this->zenyEdit->SetText(this->zenyText); } } diff --git a/Source/UI/GameSettings/GameSettingsUI.cpp b/Source/UI/GameSettings/GameSettingsUI.cpp index 20a9d79f..9d41d4f6 100644 --- a/Source/UI/GameSettings/GameSettingsUI.cpp +++ b/Source/UI/GameSettings/GameSettingsUI.cpp @@ -1847,7 +1847,7 @@ void CUIGameSettingsUI::sub_A3F0F0() { // FUNCTION: fn_45480 void CUIGameSettingsUI::OnApply() { const bool modified = this->m_graphicsPage->IsModified(); - if (reinterpret_cast(g_windowMgr).Confirm(LookupMessage(modified ? 3168 : 3167), 2, true, false, 0, "Message", 280, 120, 0) != 188) { + if (g_windowMgr.Confirm(LookupMessage(modified ? 3168 : 3167), 2, true, false, 0, "Message", 280, 120, 0) != 188) { this->m_graphicsPage->ApplySettings(); this->sub_A421E0(); } @@ -3749,7 +3749,7 @@ void CUIGameSettingsUI::sub_A43C70() { // OFFSET: 0x00A3F180 // FUNCTION: fn_15940 void CUIGameSettingsUI::ResetToDefaults() { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3166), 2, true, false, 0, "Message", 280, 120, 0) == 0xBC) { + if (g_windowMgr.Confirm(LookupMessage(3166), 2, true, false, 0, "Message", 280, 120, 0) == 0xBC) { return; } diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index 16f3c529..a1de7f52 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -39,7 +39,7 @@ void UIAgitMessageBox::Paint() { int UIAgitMessageBox::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { const int response = static_cast(a); - this->m_dialog->recorder.Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (response == 187) { g_modeMgr.GetGameMode()->SendMsg(315, this->m_agitId, 0, 0, 0); g_windowMgr.Schedule(this); diff --git a/Source/UI/Guild/UIAgitWnd.h b/Source/UI/Guild/UIAgitWnd.h index 037f33f6..68f0fee5 100644 --- a/Source/UI/Guild/UIAgitWnd.h +++ b/Source/UI/Guild/UIAgitWnd.h @@ -6,11 +6,6 @@ #include -struct WindowResponseRecorder; - -struct UIAgitMessageBoxContext { - WindowResponseRecorder& recorder; -}; class UIAgitMessageBox : public UIFrameWnd { public: @@ -21,7 +16,7 @@ public: void sub_956130(const char* text, int width, int height); /* 00B4 */ std::uint16_t m_agitId; - UIAgitMessageBoxContext* m_dialog; + void* unknown_dialog; }; class UIListBoxAgit : public UIListBox { diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index 2924efdb..bed5d9d8 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -2051,7 +2051,7 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s } else if (a1 == 277) { std::string body(this->m_bodyEdit->Text()); if (g_forbiddenWords.Contains(this->m_titleEdit->Text()) == true || g_forbiddenWords.Contains(body.c_str()) == true) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(14), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(14), 0, true, false, 0, "Message", 280, 120, 0); } else { if (g_guildInfo.unknown_00B4) { g_modeMgr.gameMode->SendMsg(118, g_guildInfo.m_guildId, reinterpret_cast(this->m_titleEdit->Text()), reinterpret_cast(body.c_str()), 0); @@ -2749,8 +2749,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target) == true) { const std::string text = FormatOwnedString(LookupMessage(2924), target.name.c_str(), target.name.c_str()); - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); - if (dialogs.Confirm(text.c_str(), 2, false, false, 0, "Message", 280, 120, 0) != 188) { + if (g_windowMgr.Confirm(text.c_str(), 2, false, false, 0, "Message", 280, 120, 0) != 188) { target.positionId = 0; target.positionName = g_guildInfo.m_positions[target.positionId]; this->unknown_0180[target.characterId].accountId = target.accountId; @@ -3094,7 +3093,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a EnumerateFileNames(this->unknown_00D8, directory, "*.gif"); const int count = static_cast(this->unknown_00D8.size()); if (count == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3037), 0, true, false, 0, "Caution", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3037), 0, true, false, 0, "Caution", 280, 120, 0); return 0; } @@ -3112,7 +3111,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } case 449: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2564), 0, false, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2564), 0, false, false, 0, "Message", 280, 120, 0); g_windowMgr.EnsureWindow(215); return 0; } @@ -3138,7 +3137,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a std::string path = FormatOwnedString("..\\..\\emblem\\%s", name.c_str()); CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(path.c_str()))); if (!bitmap) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3587), 0, true, false, 0, "Message", 280, 120, 0); return 0; } @@ -3146,16 +3145,16 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a CFile file; if (file.Open(FormatOwnedString("..\\emblem\\%s", name.c_str()).c_str(), 0, true, false) == true) { if (g_guildMgr->m_timeout < file.GetSize()) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3587), 0, true, false, 0, "Message", 280, 120, 0); } else { std::string uploadPath = FormatOwnedString("emblem\\%s", name.c_str()); if (!g_emblemDataMgr->Upload(this->m_guildId, uploadPath)) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3586), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3586), 0, true, false, 0, "Message", 280, 120, 0); } } } } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3587), 0, true, false, 0, "Message", 280, 120, 0); } } return 0; diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index 9ef0fac2..969b0718 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -378,7 +378,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } case 6: { - reinterpret_cast(this)->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { ITEM_INFO item = g_session.GetItem1720At(0); @@ -499,7 +499,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->Move(this->saved->x, this->saved->y); return 0; case 6: - reinterpret_cast(this)->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (a == 213) { if (g_replayAnimationScaling != 0) { this->checkBox->geometry.unknown_0030 = b; @@ -597,7 +597,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s int UIParaResultWnd::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: { - this->m_recorder->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { mode->SendMsg(292, 0, 0, 0, 0); diff --git a/Source/UI/Item/UIParaItemShopWnd.h b/Source/UI/Item/UIParaItemShopWnd.h index a786aa9b..a0bfb453 100644 --- a/Source/UI/Item/UIParaItemShopWnd.h +++ b/Source/UI/Item/UIParaItemShopWnd.h @@ -10,7 +10,6 @@ #include class UIStaticText; -struct WindowResponseRecorder; extern int g_pendingAid; extern int g_pendingGid; @@ -52,7 +51,7 @@ public: /* 0100 */ int unknown_0100; protected: - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index fe6bbd15..e701622f 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -188,7 +188,7 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std switch (message) { case 6: { const int response = static_cast(a); - this->m_recorder->Record(this->geometry.id, response, b, c, this->m_list->selected); + this->RecordResponse(response, b, c, this->m_list->selected); if (response == 184) { if (g_replayAnimationScaling) { @@ -305,21 +305,19 @@ int UIMakeTargetResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x0099F780 // FUNCTION: fn_13587 -UIItemRepairWnd::UIItemRepairWnd(WindowResponseRecorder& recorder) +UIItemRepairWnd::UIItemRepairWnd() : UIFrameWnd(0), itemIds(), indices(), entries() { } // OFFSET: 0x0099F850 // FUNCTION: fn_13588 -UIMakeTargetListWnd::UIMakeTargetListWnd(WindowResponseRecorder& recorder -) +UIMakeTargetListWnd::UIMakeTargetListWnd() : UIFrameWnd(0), itemIds() { } // OFFSET: 0x0099F8D0 // FUNCTION: fn_13589 -UIMakeTargetProcessWnd::UIMakeTargetProcessWnd(WindowResponseRecorder& recorder -) +UIMakeTargetProcessWnd::UIMakeTargetProcessWnd() : UIFrameWnd(0), materials() { } @@ -333,8 +331,7 @@ UIMakeTargetResultWnd::UIMakeTargetResultWnd() // OFFSET: 0x0099F9C0 // FUNCTION: fn_13591 -UIWeaponRefineWnd::UIWeaponRefineWnd(WindowResponseRecorder& recorder -) +UIWeaponRefineWnd::UIWeaponRefineWnd() : UIFrameWnd(0), itemIds(), indices() { } diff --git a/Source/UI/Items/UIItemRepairWnd.h b/Source/UI/Items/UIItemRepairWnd.h index ff3da1b9..e7683116 100644 --- a/Source/UI/Items/UIItemRepairWnd.h +++ b/Source/UI/Items/UIItemRepairWnd.h @@ -7,7 +7,6 @@ #include #include -struct WindowResponseRecorder; class UIListBox; #pragma pack(push, 1) @@ -22,7 +21,7 @@ static_assert(sizeof(UIItemRepairEntry) == 0x18); class UIItemRepairWnd : public UIFrameWnd { public: - UIItemRepairWnd(WindowResponseRecorder& recorder); + UIItemRepairWnd(); ~UIItemRepairWnd() override; void Slot15(int width, int height) override; void Paint() override; @@ -40,7 +39,7 @@ public: /* 00D0 */ std::list entries; protected: - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Items/UIMakeTargetListWnd.cpp b/Source/UI/Items/UIMakeTargetListWnd.cpp index 2a711f20..6b8b0f70 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.cpp +++ b/Source/UI/Items/UIMakeTargetListWnd.cpp @@ -54,7 +54,7 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, switch (message) { case 6: { const int response = static_cast(a); - this->m_recorder->Record(this->geometry.id, response, b, c, this->m_list->selected); + this->RecordResponse(response, b, c, this->m_list->selected); if (response == 184) { if (g_replayAnimationScaling) { diff --git a/Source/UI/Items/UIMakeTargetListWnd.h b/Source/UI/Items/UIMakeTargetListWnd.h index 3ca78869..5c536d53 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.h +++ b/Source/UI/Items/UIMakeTargetListWnd.h @@ -5,12 +5,11 @@ #include -struct WindowResponseRecorder; class UIListBox; class UIMakeTargetListWnd : public UIFrameWnd { public: - UIMakeTargetListWnd(WindowResponseRecorder& recorder); + UIMakeTargetListWnd(); std::vector BuildReplayRecords(); void Slot15(int width, int height) override; void Paint() override; @@ -26,7 +25,7 @@ public: /* 00B8 */ std::vector itemIds; protected: - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.cpp b/Source/UI/Items/UIMakeTargetProcessWnd.cpp index 7fbb7c6c..1dac5f0d 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.cpp +++ b/Source/UI/Items/UIMakeTargetProcessWnd.cpp @@ -178,7 +178,7 @@ int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t switch (message) { case 6: { const int response = static_cast(a); - this->m_recorder->Record(this->geometry.id, response, b, c, d); + this->RecordResponse(response, b, c, d); if (response == 184) { g_modeMgr.GetGameMode()->SendMsg(130, this->makeType, reinterpret_cast(this->materials), 0, 0); diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.h b/Source/UI/Items/UIMakeTargetProcessWnd.h index 1d933098..489cb36c 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.h +++ b/Source/UI/Items/UIMakeTargetProcessWnd.h @@ -6,11 +6,10 @@ #include -struct WindowResponseRecorder; class UIMakeTargetProcessWnd : public UIFrameWnd { public: - UIMakeTargetProcessWnd(WindowResponseRecorder& recorder); + UIMakeTargetProcessWnd(); void Paint() override; void Slot10(int x, int y, std::intptr_t value) override; void Slot15(int width, int height) override; @@ -24,7 +23,7 @@ public: protected: void* unknown_controls; - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Items/UIWeaponRefineWnd.cpp b/Source/UI/Items/UIWeaponRefineWnd.cpp index 157bd235..00cc619d 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.cpp +++ b/Source/UI/Items/UIWeaponRefineWnd.cpp @@ -55,7 +55,7 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s switch (message) { case 6: { const int response = static_cast(a); - this->m_recorder->Record(this->geometry.id, response, b, c, this->m_list->selected); + this->RecordResponse(response, b, c, this->m_list->selected); if (response == 184) { if (g_replayAnimationScaling) { diff --git a/Source/UI/Items/UIWeaponRefineWnd.h b/Source/UI/Items/UIWeaponRefineWnd.h index cfcb28a8..29b3353c 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.h +++ b/Source/UI/Items/UIWeaponRefineWnd.h @@ -5,12 +5,11 @@ #include -struct WindowResponseRecorder; class UIListBox; class UIWeaponRefineWnd : public UIFrameWnd { public: - UIWeaponRefineWnd(WindowResponseRecorder& recorder); + UIWeaponRefineWnd(); std::vector BuildReplayRecords(); void Slot15(int width, int height) override; void Paint() override; @@ -27,7 +26,7 @@ public: /* 00C4 */ std::vector indices; protected: - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index 9e75e17c..04f5daaa 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -1044,7 +1044,7 @@ int UITabControl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 const int width = this->TextWidth(text.c_str(), 0, 0, this->unknown_00E8, 0, 0); if ((this->tabPadding + width) * this->TabCount() >= this->parent->geometry.width - 90) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1577), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1577), 0, true, false, 0, "Message", 280, 120, 0); } else { this->labels[this->unknown_007C] = text; const int previousWidth = this->geometry.width; diff --git a/Source/UI/Menu/UIMenuIconWnd.cpp b/Source/UI/Menu/UIMenuIconWnd.cpp index d5364aa9..603f9329 100644 --- a/Source/UI/Menu/UIMenuIconWnd.cpp +++ b/Source/UI/Menu/UIMenuIconWnd.cpp @@ -421,7 +421,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (Replay::Instance().state == 1) { this->ToggleWindow(198); } else { - reinterpret_cast(&g_windowMgr)->Confirm("REC End please", 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm("REC End please", 0, true, false, 0, "Message", 280, 120, 0); } break; case 370: @@ -478,7 +478,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->ToggleWindow(10002); break; case 587: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4129), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(4129), 2, true, false, 0, "Message", 280, 120, 0) == 187) { ShellExecuteA(hWnd, "open", LookupMessage(4128), nullptr, nullptr, SW_SHOWNORMAL); } break; diff --git a/Source/UI/MiniPartyManager.cpp b/Source/UI/MiniPartyManager.cpp index 843d7a44..09c17f4b 100644 --- a/Source/UI/MiniPartyManager.cpp +++ b/Source/UI/MiniPartyManager.cpp @@ -129,7 +129,6 @@ void UIWindowMgr::RebuildMiniPartyWindows() { reinterpret_cast(g_session).ClearRecords0734(); - WindowDialogs& dialogs = *reinterpret_cast(this); for (const SessionRecord0734& record : records) { MessengerMember member = g_session.PartyByAccount(record.id); if (member.valid == 0) { diff --git a/Source/UI/Party/UIMiniPartyWnd.cpp b/Source/UI/Party/UIMiniPartyWnd.cpp index 573aab65..4966abbd 100644 --- a/Source/UI/Party/UIMiniPartyWnd.cpp +++ b/Source/UI/Party/UIMiniPartyWnd.cpp @@ -197,7 +197,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; case 233: if (!g_messengerGroupCollapsed && this->m_owner->GetMember().valid) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(191), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(191), 0, true, false, 0, "Message", 280, 120, 0); return 0; } break; @@ -223,7 +223,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case 235: if (!g_messengerGroupCollapsed && this->m_owner->GetMember().valid) { if (!(this->m_owner->GetMember().name == g_session.DecodePlayerName())) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(363), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(363), 2, false, false, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.gameMode->SendMsg(62, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); return 0; } @@ -233,7 +233,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case 236: if (!g_messengerGroupCollapsed) { if (this->m_owner->GetMember().valid && this->m_owner->GetMember().name == g_session.DecodePlayerName()) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(357), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(357), 2, false, false, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.gameMode->SendMsg(61, 0, 0, 0, 0); return 0; } @@ -287,7 +287,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg return 0; } if (this->m_entries.empty()) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3236), 0, false, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3236), 0, false, false, 0, "Message", 280, 120, 0); return 0; } switch (this->m_entries[argument1].value) { @@ -319,7 +319,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case 43: if (this->m_owner->m_cell != -1) { if (this->m_owner->GetMember().valid && this->m_owner->GetMember().offline == 0) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1533), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(1533), 2, false, false, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.gameMode->SendMsg(260, this->m_owner->GetMember().accountId, 0, 0, 0); return 0; } @@ -410,7 +410,7 @@ void UIMiniPartyWnd::Slot31(int x, int y) { this->m_cell = cell; g_session.SetRecord0734Value(this->m_member.accountId, cell); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3145), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3145), 0, true, false, 0, "Message", 280, 120, 0); } } } diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp index 65493be7..72258681 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp @@ -494,7 +494,7 @@ void CUIProbabilityTable::Search() { } if (found == list->data.end()) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x1012), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x1012), 0, true, false, 0, "Message", 280, 120, 0); } else { HighlightKeyword(found->name, keyword, g_probabilityHighlightBegin, g_probabilityHighlightEnd); diff --git a/Source/UI/Quest/UIOngoingQuestInfo.cpp b/Source/UI/Quest/UIOngoingQuestInfo.cpp index d8730459..baa8778d 100644 --- a/Source/UI/Quest/UIOngoingQuestInfo.cpp +++ b/Source/UI/Quest/UIOngoingQuestInfo.cpp @@ -423,7 +423,7 @@ void CUIScrollWindow::SetQuest(unsigned int id) { rewards->npcSprite->Show(1); } } else { - reinterpret_cast(&g_windowMgr)->Confirm(std::format("Not found Quest Info = %lu", id).c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(std::format("Not found Quest Info = %lu", id).c_str(), 0, true, false, 0, "Message", 280, 120, 0); } this->firstContents->UpdateHeight(); diff --git a/Source/UI/Quest/UIRecommendedQuestInfo.cpp b/Source/UI/Quest/UIRecommendedQuestInfo.cpp index 010a4113..3272aa7b 100644 --- a/Source/UI/Quest/UIRecommendedQuestInfo.cpp +++ b/Source/UI/Quest/UIRecommendedQuestInfo.cpp @@ -293,7 +293,7 @@ void CUIScrollWindow::SetQuest(unsigned int questId) { } } else { std::string text = std::format("Not found Quest Info = %lu", questId); - reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(text.c_str(), 0, true, false, 0, "Message", 0x118, 0x78, 0); } } diff --git a/Source/UI/Quest/UIRenewQuestUI.cpp b/Source/UI/Quest/UIRenewQuestUI.cpp index a4114108..93776f53 100644 --- a/Source/UI/Quest/UIRenewQuestUI.cpp +++ b/Source/UI/Quest/UIRenewQuestUI.cpp @@ -1045,7 +1045,7 @@ void CUIRenewQuestUI::sub_A66FF0(unsigned int questId) { } std::string text = std::format("Not found Quest Info = %lu", questId); - reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } // OFFSET: 0x00A59940 diff --git a/Source/UI/Quest/UIRenewQuestWnd.cpp b/Source/UI/Quest/UIRenewQuestWnd.cpp index e7829f01..3f4ec57c 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.cpp +++ b/Source/UI/Quest/UIRenewQuestWnd.cpp @@ -1193,7 +1193,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } } if (!found) { - reinterpret_cast(&g_windowMgr)->Confirm("not found quest info", 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm("not found quest info", 0, true, false, 0, "Message", 280, 120, 0); return 0; } } diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index 21b2e49e..fff90489 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -902,7 +902,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } if (selected.size() != 0) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xB26), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0xB26), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { for (int i = 0; i < 6; ++i) { this->checks[i]->SetChecked(0); this->checks[i]->m_message = 0; @@ -927,7 +927,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } if (selected.size() != 0) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xB26), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0xB26), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { for (int i = 0; i < 6; ++i) { this->checks[i]->SetChecked(0); this->checks[i]->m_message = 0; @@ -1096,7 +1096,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } const std::string text = FormatOwnedString(LookupMessage(0xE06), type.c_str()); - if (reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(text.c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { this->RequestAllMailActions(); } break; @@ -1113,7 +1113,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } if (selected.size() != 0 && - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xE09), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + g_windowMgr.Confirm(LookupMessage(0xE09), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { for (std::vector::iterator entry = selected.begin(); entry != selected.end(); ++entry) { RequestRodexMailAttachments(entry->first, entry->second); } @@ -1132,7 +1132,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } if (selected.size() != 0 && - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xE09), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + g_windowMgr.Confirm(LookupMessage(0xE09), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { for (std::vector::iterator id = selected.begin(); id != selected.end(); ++id) { RequestRodexMailAttachments(g_rodexMailStore->unknown_0010, *id); } @@ -1164,7 +1164,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } const std::string text = FormatOwnedString(LookupMessage(0xE0A), type.c_str()); - if (reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { + if (g_windowMgr.Confirm(text.c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 0xBB) { if (this->unknown_01D4 == 1) { for (std::vector::iterator entry = this->searchResults.begin(); entry != this->searchResults.end(); ++entry) { if (entry->first == 0) { @@ -1218,7 +1218,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume std::map::iterator mail = g_rodexMailStore->m_mails0.find(argument2); if (mail != g_rodexMailStore->m_mails0.end() && mail->second.unknown_0194 == 0) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF1B)), 0xFF, 0, 0, 0); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xF1B), 2, false, false, 0, "Message", 280, 120, 0) == 0xBC) { + if (g_windowMgr.Confirm(LookupMessage(0xF1B), 2, false, false, 0, "Message", 280, 120, 0) == 0xBC) { break; } } diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index 5889a531..0bd89381 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -1589,14 +1589,14 @@ int UIRuneSet_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argumen switch (argument1) { case 0x1FD: if (!this->m_runeSet) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4048), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4048), 0, true, false, 0, "Message", 280, 120, 0); } else if (!this->parent || this->parent->SendMsg(this, 0x6A, 100, 0, 0, 0) != 0) { g_runeSystemMgr->SendRequest(0xBD2, this->m_runeSet, -1); } break; case 0x23C: if (!this->m_runeSet) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4048), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4048), 0, true, false, 0, "Message", 280, 120, 0); } else if (!this->parent || this->parent->SendMsg(this, 0x6A, 100, 0, 0, 0) != 0) { g_runeSystemMgr->SendRequest(0xBD0, this->m_runeSet, -1); } @@ -1638,7 +1638,7 @@ int UIRuneSet_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argumen if (!this->m_runeSet->IsActive()) { this->m_tab->geometry.unknown_0030 = 0; this->m_tab->Invalidate(); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4047), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4047), 0, true, false, 0, "Message", 280, 120, 0); } this->Refresh(); break; @@ -1740,7 +1740,7 @@ int UIRune_Decom::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 if (static_cast(g_session.m_weight) > static_cast(g_session.m_maxWeight) * 0.7f || reinterpret_cast(&g_session)->GetList0Size() + g_session.CountItems17F0() + g_session.CountItems2B50() + 8 >= g_session.unknown_7FBC + 100) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4064), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4064), 0, true, false, 0, "Message", 280, 120, 0); } else { ITEM_INFO item = LookupClientItem(g_session.m_inventoryItems, this->m_itemId, 0); RuneDecomRequestPacket packet; @@ -2259,7 +2259,7 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } case 0x61: if (g_runeSystemMgr->GetCurrentRune(0, argument2)) { - reinterpret_cast(&g_windowMgr)->Confirm("보상을 지급 받으시겠습니까?", 2, false, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm("보상을 지급 받으시겠습니까?", 2, false, false, 0, "Message", 280, 120, 0); } break; case 0x69: @@ -2354,9 +2354,9 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->Invalidate(); } else if (argument1 == 0xC3) { if (g_runeSystemMgr->GetCurRuneSet()) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4052), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4052), 0, true, false, 0, "Message", 280, 120, 0); } else if (!argument2) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4041), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(4041), 0, true, false, 0, "Message", 280, 120, 0); } else { RuneData* rune = reinterpret_cast(argument2); RuneSetEquipPacket packet; @@ -2368,8 +2368,8 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } else if (argument1 == 0x158) { RuneSetData* runeSet = g_runeSystemMgr->GetCurRuneSet(); if (!runeSet) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4051), 0, true, false, 0, "Message", 280, 120, 0); - } else if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(4040), 2, true, false, 0, "Message", 280, 120, 0) != 0xBC) { + g_windowMgr.Confirm(LookupMessage(4051), 0, true, false, 0, "Message", 280, 120, 0); + } else if (g_windowMgr.Confirm(LookupMessage(4040), 2, true, false, 0, "Message", 280, 120, 0) != 0xBC) { RuneSetEquipPacket packet; packet.id = 0x0BD6; packet.tagId = static_cast(runeSet->GetTagId()); diff --git a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp index ba8d9855..c1a0651c 100644 --- a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp +++ b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp @@ -549,8 +549,8 @@ void CUISelectPackageItemBox::OnOk() { auto it = this->tabList->data.begin(); std::advance(it, index); - const int result = reinterpret_cast(&g_windowMgr) - ->Confirm(FormatOwnedString(LookupMessage(3975), it->name.c_str()).c_str(), 2, true, false, 0, "Message", 280, 120, 0); + const int result = g_windowMgr + .Confirm(FormatOwnedString(LookupMessage(3975), it->name.c_str()).c_str(), 2, true, false, 0, "Message", 280, 120, 0); if (result == 187) { g_modeMgr.GetGameMode()->SendMsg(325, this->sourceIndex, this->packageId, index, 0); } diff --git a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp index f04ebbb1..1c49ddfb 100644 --- a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp +++ b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp @@ -283,7 +283,7 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen case 18: if (*reinterpret_cast(&g_session.unknown_16F4[4]) >= 0) { const std::string text = FormatOwnedString(LookupMessage(0x4CA), item.DisplayName(0).c_str()); - if (reinterpret_cast(&g_windowMgr)->Confirm(text.c_str(), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(text.c_str(), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { mode->SendMsg(0x1B, item.unknown_0000[1], 0, 0, 0); } } diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index 53d70f32..352ac294 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -366,7 +366,7 @@ inline void UseShortcutSlot(const NormalItemSlot& slot) { case 0: case 1: case 2: - if (item.GetItemId() != 12802 || reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2373), 2, false, false, 0, "Message", 280, 120, 0) != 188) { + if (item.GetItemId() != 12802 || g_windowMgr.Confirm(LookupMessage(2373), 2, false, false, 0, "Message", 280, 120, 0) != 188) { use(); } @@ -389,7 +389,7 @@ inline void UseShortcutSlot(const NormalItemSlot& slot) { _snprintf_s(text, sizeof(text), _TRUNCATE, LookupMessage(1226), name.c_str()); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 187) { use(); } } @@ -1282,7 +1282,7 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } const int measured = this->TextWidth(text, 0, 0, 12, 0, 0); if (this->geometry.width - 0x32 <= measured + 10) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x629), 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(LookupMessage(0x629), 0, true, false, 0, "Message", 0x118, 0x78, 0); } this->m_edit->Move(-100, -100); this->m_edit->SetText(""); diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index 5161eb47..2e8e5e6d 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -171,7 +171,7 @@ void UIStylingShopButton::Slot31(int, int) { int id = this->geometry.id; if (id == 185 && g_charViewMode && static_cast(g_charViewMode)->cursorType == 2) { const char* text = LookupMessage(17); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); } } else { @@ -310,7 +310,7 @@ int UIBasicStylingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu this->m_display->unknown_0094 = i + 1; this->m_display->Invalidate(); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2834), 0, false, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2834), 0, false, false, 0, "Message", 280, 120, 0); } } else { this->m_paletteButtons[i]->SetState(0); @@ -402,7 +402,7 @@ int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } else { switch (argument1) { case 201: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2816), 2, false, false, 0, "Message", 280, 120, 0) != 188) { + if (g_windowMgr.Confirm(LookupMessage(2816), 2, false, false, 0, "Message", 280, 120, 0) != 188) { for (int i = 0; i < 2; ++i) { if (sender == this->unknown_0094[i]) { this->RemoveChild(this->m_slots[i], 1); @@ -1116,7 +1116,7 @@ int UIDisplayCharacter::SendMsg(UIWindow* sender, int message, std::intptr_t arg case 356: if (this->m_favoriteButton->m_argument == 0) { if (shop->AddToMyStyle() == true) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2819), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2819), 0, true, false, 0, "Message", 280, 120, 0); } else { this->m_favoriteButton->SetTooltip(LookupMessage(2817)); } @@ -1449,7 +1449,7 @@ int UIStylingShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum break; case 224: if (this->m_buyButton->Argument() == 0 && - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2818), 2, false, false, 0, "Message", 280, 120, 0) != 188) { + g_windowMgr.Confirm(LookupMessage(2818), 2, false, false, 0, "Message", 280, 120, 0) != 188) { for (std::map::iterator it = this->m_tabs.begin(); it != this->m_tabs.end(); ++it) { UIStylingshopTabParentWnd* tab = it->second; if (tab->geometry.visible == 0) { diff --git a/Source/UI/UIGradeEnchantWnd.cpp b/Source/UI/UIGradeEnchantWnd.cpp index 486ba6f1..9691d6be 100644 --- a/Source/UI/UIGradeEnchantWnd.cpp +++ b/Source/UI/UIGradeEnchantWnd.cpp @@ -332,7 +332,7 @@ void UIGradeEnchantWnd::Slot31(int x, int y) { if (this->selectedMaterial != row) { if (this->unknown_0114 > 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3831), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3831), 0, true, false, 0, "Message", 280, 120, 0); } this->selectedMaterial = row; @@ -495,7 +495,7 @@ int UIGradeEnchantWnd::SendMsg( const int quantity = LookupClientItem(g_session.m_inventoryItems, this->materials[this->selectedMaterial].itemId, 0).quantity; if (quantity >= this->materials[this->selectedMaterial].amount && g_session.m_zeny >= this->SelectedMaterialZeny()) { if (this->unknown_0110 != 0 || this->unknown_0114 != 0 || - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3823), 2, true, false, 0, "Message", 280, 120, 0) != 188) { + g_windowMgr.Confirm(LookupMessage(3823), 2, true, false, 0, "Message", 280, 120, 0) != 188) { this->unknown_0220 = 1; GradeEnchantRequestPacket packet; diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index 76945569..dd05ee00 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -769,8 +769,8 @@ int UIMacroReporterWnd::SendMsg( accounts.push_back(it->id); } } - const int result = reinterpret_cast(&g_windowMgr) - ->Confirm(FormatOwnedString(LookupMessage(2876), accounts.size()).c_str(), 2, false, false, 0, "Message", 280, 120, 0); + const int result = g_windowMgr + .Confirm(FormatOwnedString(LookupMessage(2876), accounts.size()).c_str(), 2, false, false, 0, "Message", 280, 120, 0); if (result != 188) { for (auto it = accounts.begin(); it != accounts.end(); ++it) { PACKET_CZ_MACRO_REPORT_ACCOUNT packet; diff --git a/Source/UI/Window/UIBasicInfoWnd.cpp b/Source/UI/Window/UIBasicInfoWnd.cpp index 791b6d3a..166829c1 100644 --- a/Source/UI/Window/UIBasicInfoWnd.cpp +++ b/Source/UI/Window/UIBasicInfoWnd.cpp @@ -280,7 +280,7 @@ int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen if (!g_windowMgr.unknown_02FC && !g_windowMgr.unknown_0304) { g_windowMgr.EnsureWindow(27); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); } } break; diff --git a/Source/UI/Window/UIChangeNameWnd.cpp b/Source/UI/Window/UIChangeNameWnd.cpp index 5cc25594..5a13bde7 100644 --- a/Source/UI/Window/UIChangeNameWnd.cpp +++ b/Source/UI/Window/UIChangeNameWnd.cpp @@ -101,26 +101,26 @@ int UIChangeNameWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intpt switch (a) { case 184: { if (g_navigationLinkParser->HasLink(this->m_edit->Text()) == true) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); this->m_edit->SetText(""); return 0; } std::string name(this->m_edit->Text()); if (name.find('\n', 0) != std::string::npos) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3334), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3334), 0, true, false, 0, "Message", 280, 120, 0); this->m_edit->SetText(""); return 0; } if (g_serviceType == 1 && !ValidateCharacterName(this->m_edit->Text())) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2018), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2018), 0, true, false, 0, "Message", 280, 120, 0); this->m_edit->SetText(""); return 0; } if (this->m_edit->Length() < 4) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(21), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(21), 0, true, false, 0, "Message", 280, 120, 0); return 0; } @@ -128,16 +128,16 @@ int UIChangeNameWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intpt const bool blank = g_session.IsBlankString(this->m_edit->Text()); if (!allowed || blank) { if (!allowed) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(20), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(20), 0, true, false, 0, "Message", 280, 120, 0); } if (blank) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(199), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(199), 0, true, false, 0, "Message", 280, 120, 0); } return 0; } if (this->m_edit->Length() >= 24 || !this->IsNameWithinLimit(this->m_edit->Text(), 24)) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(531), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(531), 0, true, false, 0, "Message", 280, 120, 0); this->m_edit->SetText(""); return 0; } @@ -162,7 +162,7 @@ int UIChangeNameWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intpt char text[300]; std::sprintf(text, LookupMessage(1213), this->m_info.name); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) == 187) { CharacterRenamePacket packet; packet.id = 0x8FC; packet.gid = this->m_character->gid; diff --git a/Source/UI/Window/UIEscOptionWnd.cpp b/Source/UI/Window/UIEscOptionWnd.cpp index d43b1aa5..a6053b29 100644 --- a/Source/UI/Window/UIEscOptionWnd.cpp +++ b/Source/UI/Window/UIEscOptionWnd.cpp @@ -96,7 +96,7 @@ int UIEscOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen const int id = static_cast(argument1); if (id > 0x173) { if (id == 0x174) { - const int result = reinterpret_cast(&g_windowMgr)->Confirm( + const int result = g_windowMgr.Confirm( LookupMessage(0x60C), 2, false, false, 0, "Message", 0x118, 0x78, 0 ); if (result != 0xBB) { diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 48d4e663..0d12e362 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -892,7 +892,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_windowMgr.sub_A978D0(30)->SendMsg(nullptr, 34, reinterpret_cast(&mode->unknown_03C8), 0, 0, 0); return 0; case 3: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(191), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(191), 0, true, false, 0, "Message", 280, 120, 0); return 0; case 11: this->SaveChatLog(); diff --git a/Source/UI/Window/UIHomunInfoWnd.h b/Source/UI/Window/UIHomunInfoWnd.h index 924415f7..07e272ff 100644 --- a/Source/UI/Window/UIHomunInfoWnd.h +++ b/Source/UI/Window/UIHomunInfoWnd.h @@ -12,7 +12,6 @@ class UIEditCtrl2; class UIINT64BarGraph; class UINormalMB; class ForbiddenWords; -struct WindowResponseRecorder; class UIHomunInfoWnd : public UIFrameWnd { public: @@ -34,7 +33,7 @@ public: protected: void* unknown_controls; - WindowResponseRecorder* m_recorder; + void* unknown_recorder; ForbiddenWords* m_forbiddenWords; }; diff --git a/Source/UI/Window/UIHotKeyWnd.cpp b/Source/UI/Window/UIHotKeyWnd.cpp index d20a46eb..9fa5c81a 100644 --- a/Source/UI/Window/UIHotKeyWnd.cpp +++ b/Source/UI/Window/UIHotKeyWnd.cpp @@ -721,7 +721,7 @@ int UIHotKeyWnd::CheckHotkeyConflict() { } StringFormat(message, sizeof(message), static_cast(-1), LookupMessage(0x5D1), info.description.c_str()); - if (reinterpret_cast(&g_windowMgr)->Confirm(message, 2, true, false, 0, "Message", 280, 120, 0) != 187) { + if (g_windowMgr.Confirm(message, 2, true, false, 0, "Message", 280, 120, 0) != 187) { return 1; } diff --git a/Source/UI/Window/UIJobListWnd.cpp b/Source/UI/Window/UIJobListWnd.cpp index a4fc49d7..6435ffd1 100644 --- a/Source/UI/Window/UIJobListWnd.cpp +++ b/Source/UI/Window/UIJobListWnd.cpp @@ -122,7 +122,7 @@ int UIJobListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } if (selected == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1767), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1767), 0, true, false, 0, "Message", 280, 120, 0); return 0; } diff --git a/Source/UI/Window/UIMerInfoWnd.h b/Source/UI/Window/UIMerInfoWnd.h index 2cf5d035..347a5d02 100644 --- a/Source/UI/Window/UIMerInfoWnd.h +++ b/Source/UI/Window/UIMerInfoWnd.h @@ -6,7 +6,6 @@ class UIBitmapButton; class UIBarGraphPlayer; -struct WindowResponseRecorder; class UIMerInfoWnd : public UIFrameWnd { public: @@ -25,7 +24,7 @@ public: protected: void* unknown_controls; - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index cf7de6fa..870791ba 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -237,8 +237,8 @@ UIMerInfoWnd::UIMerInfoWnd() : UIFrameWnd(0) { // OFFSET: 0x008A3FC0 // FUNCTION: fn_11663 -UIMessageBox::UIMessageBox(UIMessageBoxContext& dialog) - : UIFrameWnd(0), counting(0), protectedMessage(0), m_dialog(&dialog) { +UIMessageBox::UIMessageBox() + : UIFrameWnd(0), counting(0), protectedMessage(0) { } // OFFSET: 0x008A40B0 @@ -673,7 +673,7 @@ void UIMessageBox::Configure( this->SetSize(width, height); this->Slot15(width, height); this->Slot22(width, height); - this->Move((this->m_dialog->screenWidth - 640) / 2 + 185, (this->m_dialog->screenHeight - 480) / 2 + 180); + this->Move((g_renderer->viewport.width - 640) / 2 + 185, (g_renderer->viewport.height - 480) / 2 + 180); int inset = 0; if (icon) { @@ -735,7 +735,7 @@ void UIMessageBox::Slot19() { } if (timeGetTime() > this->deadline) { - this->m_dialog->response = 187; + g_windowMgr.unknown_0474 = 187; this->counting = 0; return; } @@ -756,12 +756,12 @@ void UIMessageBox::Slot19() { int UIMessageBox::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: - this->m_dialog->recorder.Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); if (this->modal != 0) { - this->m_dialog->response = static_cast(a); + g_windowMgr.unknown_0474 = static_cast(a); } else if (a == 184 || a == 187 || a == 188) { - this->m_dialog->retirement.Schedule(this); + g_windowMgr.Schedule(this); } return 0; @@ -937,7 +937,7 @@ int UIMerInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case 0: return 0; case 6: - this->m_recorder->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); switch (a) { case 184: @@ -956,7 +956,7 @@ int UIMerInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case 350: { CMode* mode = g_modeMgr.GetGameMode(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1370), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(1370), 2, false, false, 0, "Message", 280, 120, 0) == 187) { mode->SendMsg(186, 2, 0, 0, 0); g_windowMgr.CloseWindow(125); g_windowMgr.CloseWindow(126); @@ -2305,7 +2305,7 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); return 0; } case 423: @@ -2782,9 +2782,9 @@ int UISelectReplayDataWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } Replay::Instance().CloseFile(); - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1970), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1970), 0, true, true, 0, "Message", 280, 120, 0); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1969), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1969), 0, true, true, 0, "Message", 280, 120, 0); } } break; @@ -2795,7 +2795,7 @@ int UISelectReplayDataWnd::SendMsg(UIWindow* sender, int message, std::intptr_t static_cast(g_charViewMode)->SendMsg(10025, 0, 0, 0, 0); return 0; case 221: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; @@ -2938,7 +2938,7 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s static_cast(g_charViewMode)->SendMsg(10006, 0, 0, 0, 0); return 0; case 221: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; @@ -3250,9 +3250,9 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int g_windowMgr.CloseWindow(3); this->SaveLogin(); } else if (this->idEdit->Length() < 4) { - reinterpret_cast(&g_windowMgr)->Confirm(FormatOwnedString(LookupMessage(3029), 4).c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(FormatOwnedString(LookupMessage(3029), 4).c_str(), 0, true, false, 0, "Message", 280, 120, 0); } else { - reinterpret_cast(&g_windowMgr)->Confirm(FormatOwnedString(LookupMessage(3030), 6).c_str(), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(FormatOwnedString(LookupMessage(3030), 6).c_str(), 0, true, false, 0, "Message", 280, 120, 0); } break; } @@ -3262,7 +3262,7 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int break; case 221: this->SaveLogin(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { goto quit; } break; @@ -3299,7 +3299,7 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int ShellExecuteA(hWnd, verbName.Text(), url, nullptr, nullptr, SW_SHOWNORMAL); break; } - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3336), 2, true, false, 0, "Message", 280, 120, 0) != 187) { + if (g_windowMgr.Confirm(LookupMessage(3336), 2, true, false, 0, "Message", 280, 120, 0) != 187) { break; } } @@ -3330,7 +3330,7 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int const std::uint8_t source[] = {0x10, 0x9D, 0xBC, 0x33, 0xE2, 0x64, 0x01, 0x37, 0x04, 0x90, 0xB4, 0x32, 0xF8, 0x7D, 0x1B, 0x37, 0x06, 0x9F, 0xB6, 0x2E, 0xFE, 0x33, 0x09, 0x78, 0x10, 0x9D, 0xB3, 0x7C, 0x8D}; thread_local EncryptedName name(source); - reinterpret_cast(&g_windowMgr)->Confirm(name.Text(), 0, false, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(name.Text(), 0, false, false, 0, "Message", 280, 120, 0); goto quit; } } @@ -3352,7 +3352,7 @@ quit: int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (message == 6) { if (a == 185) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); g_windowMgr.Schedule(this); } @@ -3365,7 +3365,7 @@ int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: static_cast(g_charViewMode)->SendMsg(39, 0, 0, 0, 0); g_windowMgr.CloseWindow(180); } else { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3249), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(3249), 0, true, false, 0, "Message", 280, 120, 0); } } } else if (message == 60) { @@ -3552,20 +3552,20 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case 0: return 0; case 6: - this->m_recorder->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); switch (a) { case 184: { char* const name = reinterpret_cast(&g_session.unknown_5570[0x0C]); if (std::strlen(this->nameEdit->Text()) >= 24) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(938), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(938), 0, true, false, 0, "Message", 280, 120, 0); } else if (_mbsstr(reinterpret_cast(this->nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkOpening.c_str())) || _mbsstr(reinterpret_cast(this->nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkClosing.c_str()))) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); } else { char text[512]; std::sprintf(text, LookupMessage(2977), this->nameEdit->Text()); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { + if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { if (g_forbiddenWords.Contains(this->nameEdit->Text()) != true) { g_modeMgr.GetGameMode()->SendMsg(185, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); std::sprintf(name, this->nameEdit->Text()); @@ -3573,7 +3573,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2948), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2948), 0, true, false, 0, "Message", 280, 120, 0); } this->nameEdit->SetText(name); @@ -3605,7 +3605,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; case 291: { CMode* mode = g_modeMgr.GetGameMode(); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(955), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(955), 2, false, false, 0, "Message", 280, 120, 0) == 187) { mode->SendMsg(184, 2, 0, 0, 0); g_windowMgr.CloseWindow(113); g_windowMgr.CloseWindow(114); @@ -3761,20 +3761,20 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } case 6: if (a == 184 || a == 201) { - this->m_recorder->Record(this->geometry.id, static_cast(a), b, c, d); + this->RecordResponse(static_cast(a), b, c, d); } switch (a) { case 184: if (std::strlen(this->nameEdit->Text()) >= 24) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(682), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(682), 0, true, false, 0, "Message", 280, 120, 0); } else if (_mbsstr(reinterpret_cast(this->nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkOpening.c_str())) || _mbsstr(reinterpret_cast(this->nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkClosing.c_str()))) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); } else { char text[512]; std::sprintf(text, LookupMessage(2931), this->nameEdit->Text()); - if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { + if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { if (g_forbiddenWords.Contains(this->nameEdit->Text()) != true) { g_modeMgr.GetGameMode()->SendMsg(145, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); std::sprintf(g_session.unknown_1018, this->nameEdit->Text()); @@ -3782,7 +3782,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i return 0; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(2948), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(2948), 0, true, false, 0, "Message", 280, 120, 0); } this->nameEdit->SetText(g_session.unknown_1018); @@ -4135,7 +4135,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: error = 2812; } else { if (this->m_nameEdit->Length() < 4) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(21), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(21), 0, true, false, 0, "Message", 280, 120, 0); goto create; } @@ -4149,13 +4149,13 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: const bool blank = g_session.IsBlankString(this->m_nameEdit->Text()); if (control || !allowed || !valid || blank) { if (control || !allowed) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(20), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(20), 0, true, false, 0, "Message", 280, 120, 0); } if (!valid) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(190), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(190), 0, true, false, 0, "Message", 280, 120, 0); } if (blank) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(199), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(199), 0, true, false, 0, "Message", 280, 120, 0); } goto create; } @@ -4186,7 +4186,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: error = 531; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); this->m_nameEdit->SetText(""); return 0; diff --git a/Source/UI/Window/UIMessageBox.h b/Source/UI/Window/UIMessageBox.h index a121632d..ec154538 100644 --- a/Source/UI/Window/UIMessageBox.h +++ b/Source/UI/Window/UIMessageBox.h @@ -8,20 +8,10 @@ class UITextViewer; class UIWindowMgr; -struct WindowResponseRecorder; - -struct UIMessageBoxContext { - void* unknown_text; - UIWindowMgr& retirement; - WindowResponseRecorder& recorder; - int& response; - const int& screenWidth; - const int& screenHeight; -}; class UIMessageBox : public UIFrameWnd { public: - UIMessageBox(UIMessageBoxContext& dialog); + UIMessageBox(); ~UIMessageBox() override; void Slot18() override; void Slot19() override; @@ -43,7 +33,7 @@ public: /* 011C */ unsigned char protectedMessage; private: - UIMessageBoxContext* m_dialog; + void* unknown_dialog; void AddButton(const char* name, int id, int x, int y); void FormatCountdown(); }; diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index a6c028e1..a8692985 100644 --- a/Source/UI/Window/UINavigationWnd.cpp +++ b/Source/UI/Window/UINavigationWnd.cpp @@ -676,7 +676,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; case 6: if (argument1 != 0x150 && argument1 != 0x1B9) { - this->m_recorder->Record(this->geometry.id, static_cast(argument1), argument2, argument3, argument4); + this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); } switch (argument1) { @@ -696,7 +696,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } } } - g_navigationManager.ShowRouteResult(result, 1, *this->m_dialogs); + g_navigationManager.ShowRouteResult(result, 1); return 0; } case 0xBD: @@ -749,7 +749,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } case 0xC9: if (g_navigationMode == 2) { - const int response = this->m_dialogs->Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 280, 120, 0); + const int response = g_windowMgr.Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 280, 120, 0); if (response != 0xBB) { break; } @@ -813,7 +813,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume argument2 = this->m_routePanel->selected; } if (argument2 != -1) { - this->m_recorder->Record(this->geometry.id, static_cast(argument1), argument2, argument3, argument4); + this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); const int index = static_cast(argument2) - this->m_routePanel->LineOffset(); if (index >= 0 && g_navigationManager.SelectState(index)) { if (g_windowMgr.window_0428) { @@ -852,7 +852,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume argument2 = this->m_searchPanel->selected; } if (argument2 != -1) { - this->m_recorder->Record(this->geometry.id, 0x1B9, argument2, argument3, argument4); + this->RecordResponse(0x1B9, argument2, argument3, argument4); using SelectTargetFn = bool (CNavigationManager::*)(int); if ((g_navigationManager.*reinterpret_cast(&CNavigationManager::SelectTarget))( static_cast(argument2) - this->m_searchPanel->LineOffset())) { diff --git a/Source/UI/Window/UINavigationWnd.h b/Source/UI/Window/UINavigationWnd.h index 481ce86b..452ee407 100644 --- a/Source/UI/Window/UINavigationWnd.h +++ b/Source/UI/Window/UINavigationWnd.h @@ -6,6 +6,7 @@ #include #include +class UIWindowMgr; class CActRes; class CSprRes; struct NaviCell; @@ -17,8 +18,6 @@ class UIComboBoxDefWnd; class UIEditCtrl; class UIListBoxNavi; class UIResizer; -struct WindowDialogs; -struct WindowResponseRecorder; struct NavigationWndInfo { /* 0000 */ int x; @@ -91,8 +90,8 @@ protected: void* unknown_controls; void* unknown_listContext; - WindowResponseRecorder* m_recorder; - WindowDialogs* m_dialogs; + void* unknown_recorder; + void* unknown_dialogs; }; #endif diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index cee55cb6..f45626fe 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -556,7 +556,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum if (!hasControlCharacter && allowed == 1 && valid == 1 && blank == 0) { if (this->m_nameEdit->Length() >= 24) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x213), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x213), 0, true, false, 0, "Message", 280, 120, 0); this->m_nameEdit->SetText(""); return 0; } @@ -581,13 +581,13 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum g_windowMgr.Schedule(this); } else { if (hasControlCharacter || allowed == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x14), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x14), 0, true, false, 0, "Message", 280, 120, 0); } if (valid == 0) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xBE), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xBE), 0, true, false, 0, "Message", 280, 120, 0); } if (blank == 1) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(199), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(199), 0, true, false, 0, "Message", 280, 120, 0); } } @@ -606,7 +606,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum return 0; } - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(messageId), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(messageId), 0, true, false, 0, "Message", 280, 120, 0); return 0; } diff --git a/Source/UI/Window/UINewSelectCharWnd.cpp b/Source/UI/Window/UINewSelectCharWnd.cpp index 8af106f6..a91cf195 100644 --- a/Source/UI/Window/UINewSelectCharWnd.cpp +++ b/Source/UI/Window/UINewSelectCharWnd.cpp @@ -410,7 +410,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { char message[260]; std::memset(message, 0, sizeof(message)); std::sprintf(message, LookupMessage(0x974), index, 0x9C41); - reinterpret_cast(&g_windowMgr)->Confirm(message, 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(message, 0, true, false, 0, "Message", 0x118, 0x78, 0); static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); break; } @@ -638,7 +638,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg char text[260]; std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x337), blocked[index].expireDate); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, true, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 0x118, 0x78, 0); this->m_unknown118 = false; return 0; } @@ -661,10 +661,10 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg reinterpret_cast(&g_session.unknown_807C[8]), *g_asyncWorkMgr ); if (g_loginModeFlag == 1) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { static_cast(g_charViewMode)->SendMsg(0x271B, 0, 0, 0, 0); } - } else if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x11), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + } else if (g_windowMgr.Confirm(LookupMessage(0x11), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { static_cast(g_charViewMode)->SendMsg(2, 0, 0, 0, 0); g_windowMgr.Schedule(this); } @@ -742,14 +742,14 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg char text[260]; std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x337), blocked[index].expireDate); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, true, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(text, 0, true, true, 0, "Message", 0x118, 0x78, 0); return 0; } } - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x13), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x13), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { this->m_unknown118 = true; - if (reinterpret_cast(&g_windowMgr)->RunEmailAddress() == 0xB8) { + if (g_windowMgr.RunEmailAddress() == 0xB8) { static_cast(g_charViewMode)->SendMsg(0, 0x271A, 0, 0, 0); g_windowMgr.Schedule(this); } @@ -762,7 +762,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg char text[260]; std::memset(text, 0, sizeof(text)); static_cast(g_charViewMode)->SendMsg(0x2724, reinterpret_cast(text), 0, 0, 0); - reinterpret_cast(&g_windowMgr)->Confirm(text, 0, true, false, 0, "Message", 0x118, 0x78, 0); + g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 0x118, 0x78, 0); break; } case 0x13C: { @@ -965,7 +965,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; case 0x1B1: { const unsigned char selected = static_cast(g_selectedSlotIndex); - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x7E0), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x7E0), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { const CharacterInfo* info = reinterpret_cast(static_cast(g_charViewMode)->SendMsg(8, this->m_unknown138, 0, 0, 0)); if (info != nullptr) { CharacterMovePacket packet; diff --git a/Source/UI/Window/UINewSkillListWnd.cpp b/Source/UI/Window/UINewSkillListWnd.cpp index 06d6da18..d5cb1f0e 100644 --- a/Source/UI/Window/UINewSkillListWnd.cpp +++ b/Source/UI/Window/UINewSkillListWnd.cpp @@ -1342,7 +1342,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } break; case 271: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1377), 2, false, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(1377), 2, false, false, 0, "Message", 280, 120, 0) == 187) { this->sub_9AE730(); this->SendMsg(nullptr, 23, 0, 0, 0, 0); if (ChatWindow()) { diff --git a/Source/UI/Window/UIPayConfirmWnd.h b/Source/UI/Window/UIPayConfirmWnd.h index 10c66e0b..f877d66a 100644 --- a/Source/UI/Window/UIPayConfirmWnd.h +++ b/Source/UI/Window/UIPayConfirmWnd.h @@ -10,7 +10,7 @@ struct BitmapImage; class UIPayConfirmWnd : public UIMessageBox { public: // INLINED - UIPayConfirmWnd(UIMessageBoxContext& dialog) : UIMessageBox(dialog) { + UIPayConfirmWnd() : UIMessageBox() { } void Configure(const std::string& text, int itemId); diff --git a/Source/UI/Window/UIPetInfoWnd.h b/Source/UI/Window/UIPetInfoWnd.h index 70b5acf5..bcfc6bf4 100644 --- a/Source/UI/Window/UIPetInfoWnd.h +++ b/Source/UI/Window/UIPetInfoWnd.h @@ -13,7 +13,6 @@ class UINormalMB; class ForbiddenWords; class UINoneVisibleButton; class UIPetInfoBarGraph; -struct WindowResponseRecorder; class UIPetInfoWnd : public UIFrameWnd { public: @@ -38,7 +37,7 @@ public: protected: void* unknown_controls; - WindowResponseRecorder* m_recorder; + void* unknown_recorder; ForbiddenWords* m_forbiddenWords; }; diff --git a/Source/UI/Window/UIRodexContentsWnd.cpp b/Source/UI/Window/UIRodexContentsWnd.cpp index 31224664..574cd610 100644 --- a/Source/UI/Window/UIRodexContentsWnd.cpp +++ b/Source/UI/Window/UIRodexContentsWnd.cpp @@ -296,7 +296,7 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x164), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x164), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(g_rodexMailStore->currentMailId), g_rodexMailStore->unknown_0010, 0, 0); if (g_windowMgr.unknown_045C != 0) { g_windowMgr.CloseWindow(265); diff --git a/Source/UI/Window/UISeekPartyListWnd.cpp b/Source/UI/Window/UISeekPartyListWnd.cpp index 88693583..0d32412e 100644 --- a/Source/UI/Window/UISeekPartyListWnd.cpp +++ b/Source/UI/Window/UISeekPartyListWnd.cpp @@ -251,7 +251,6 @@ void UISeekPartyListWnd::Slot15(int width, int height) { // OFFSET: 0x009393E0 // FUNCTION: fn_12755 int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); switch (message) { case 6: @@ -282,7 +281,7 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg const short level = static_cast(std::atoi(text.c_str())); for (std::size_t i = 0; i < text.size(); ++i) { if (text[i] < '/' || text[i] > '9') { - dialogs.Confirm(LookupMessage(1770), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1770), 0, true, false, 0, "Message", 280, 120, 0); return 0; } } @@ -291,7 +290,7 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg char buffer[260]; std::memset(buffer, 0, sizeof(buffer)); StringFormat(buffer, sizeof(buffer), static_cast(-1), LookupMessage(2601), g_partyBookingLevelMax); - dialogs.Confirm(buffer, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(buffer, 0, true, false, 0, "Message", 280, 120, 0); return 0; } diff --git a/Source/UI/Window/UISeekPartyMBWnd.cpp b/Source/UI/Window/UISeekPartyMBWnd.cpp index 9259d421..d08f2c62 100644 --- a/Source/UI/Window/UISeekPartyMBWnd.cpp +++ b/Source/UI/Window/UISeekPartyMBWnd.cpp @@ -32,7 +32,6 @@ struct PACKET_CZ_PARTY_BOOKING_REQ_REGISTER { // OFFSET: 0x00939EE0 // FUNCTION: fn_12756 int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); switch (message) { case 6: @@ -56,7 +55,7 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } if (count == 0) { - dialogs.Confirm(LookupMessage(1768), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1768), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -64,14 +63,14 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st char text[100]; std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(1769), count); - dialogs.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); break; } std::string level(this->m_levelEdit->Text()); for (unsigned int i = 0; i < level.size(); ++i) { if (level[i] < '/' || level[i] > '9') { - dialogs.Confirm(LookupMessage(1770), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1770), 0, true, false, 0, "Message", 280, 120, 0); return 0; } } @@ -91,7 +90,7 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st char text[260]; std::memset(text, 0, sizeof(text)); StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(2601), maximum); - dialogs.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); } break; } diff --git a/Source/UI/Window/UISelCharForUServerWnd.cpp b/Source/UI/Window/UISelCharForUServerWnd.cpp index d7c96701..6f7bc6ba 100644 --- a/Source/UI/Window/UISelCharForUServerWnd.cpp +++ b/Source/UI/Window/UISelCharForUServerWnd.cpp @@ -141,9 +141,8 @@ int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - WindowDialogs& dialogs = *reinterpret_cast(&g_windowMgr); if (argument1 == 0xB8) { - if (dialogs.Confirm(LookupMessage(0x4BB), 2, false, false, 0, "Message", 280, 120, 0) != 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x4BB), 2, false, false, 0, "Message", 280, 120, 0) != 0xBB) { return 0; } @@ -173,11 +172,11 @@ int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } - dialogs.Confirm(LookupMessage(0x4C1), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x4C1), 0, true, true, 0, "Message", 280, 120, 0); } else if (argument1 == 0xD5) { this->m_checkedCount += sender->geometry.unknown_0030 != 0 ? 1 : -1; if (this->m_checkedCount > 9) { - dialogs.Confirm(LookupMessage(0x4BC), 0, true, true, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0x4BC), 0, true, true, 0, "Message", 280, 120, 0); static_cast(sender)->SetChecked(0); } } diff --git a/Source/UI/Window/UISerachStoreInfoWnd.cpp b/Source/UI/Window/UISerachStoreInfoWnd.cpp index f43323a0..b083dadd 100644 --- a/Source/UI/Window/UISerachStoreInfoWnd.cpp +++ b/Source/UI/Window/UISerachStoreInfoWnd.cpp @@ -344,13 +344,13 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->unknown_00F0 = LookupMessage(1798); break; case 3: - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1800), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1800), 0, true, false, 0, "Message", 280, 120, 0); return 0; case 4: g_session.unknown_5BE8 = -1; g_session.unknown_5BEC = -1; g_session.unknown_5BF0 = 0xFFFFFFFF; - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1797), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(1797), 0, true, false, 0, "Message", 280, 120, 0); return 0; } } @@ -421,7 +421,7 @@ void UISerachStoreInfoWnd::Slot26(int x, int y) { } if (reinterpret_cast(&g_session.unknown_5BE4)[1] != 0 && - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x6F9), 2, true, false, 0, "Message", 0x118, 0x78, 0) != 0xBB) { + g_windowMgr.Confirm(LookupMessage(0x6F9), 2, true, false, 0, "Message", 0x118, 0x78, 0) != 0xBB) { return; } diff --git a/Source/UI/Window/UIShowWarpWnd.cpp b/Source/UI/Window/UIShowWarpWnd.cpp index b1c6233c..3ec7c127 100644 --- a/Source/UI/Window/UIShowWarpWnd.cpp +++ b/Source/UI/Window/UIShowWarpWnd.cpp @@ -54,7 +54,7 @@ void UIShowWarpWnd::Paint() { 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); + this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); if (argument1 == 201) { g_windowMgr.CloseWindow(0x134); } @@ -83,6 +83,6 @@ int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // OFFSET: 0x009470C0 // FUNCTION: fn_12858 -UIShowWarpWnd::UIShowWarpWnd(WindowResponseRecorder& recorder) - : UIFrameWnd(0), m_recorder(&recorder) { +UIShowWarpWnd::UIShowWarpWnd() + : UIFrameWnd(0) { } diff --git a/Source/UI/Window/UIShowWarpWnd.h b/Source/UI/Window/UIShowWarpWnd.h index e23dcd0c..4d957e8b 100644 --- a/Source/UI/Window/UIShowWarpWnd.h +++ b/Source/UI/Window/UIShowWarpWnd.h @@ -3,12 +3,11 @@ #include "UI/Window/UIFrameWnd.h" -struct WindowResponseRecorder; class UIListBox; class UIShowWarpWnd : public UIFrameWnd { public: - UIShowWarpWnd(WindowResponseRecorder& recorder); + UIShowWarpWnd(); 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; @@ -18,7 +17,7 @@ public: protected: void* unknown_controls; void* unknown_listContext; - WindowResponseRecorder* m_recorder; + void* unknown_recorder; }; #endif diff --git a/Source/UI/Window/UIVideoWnd.cpp b/Source/UI/Window/UIVideoWnd.cpp index 2c4a151d..fdf951b9 100644 --- a/Source/UI/Window/UIVideoWnd.cpp +++ b/Source/UI/Window/UIVideoWnd.cpp @@ -108,7 +108,7 @@ int UIVideoWnd::SendMsg( } break; case 5: - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3142), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(3142), 2, true, false, 0, "Message", 280, 120, 0) == 187) { g_windowMgr.CloseWindow(304); } break; diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 966f32c8..3b3fce4b 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -2758,7 +2758,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } g_windowMgr.window_4F258 = window; - if (reinterpret_cast(&g_windowMgr)->RunModal(window) == 0xBC) { + if (g_windowMgr.RunModal(window) == 0xBC) { g_windowMgr.window_4F258 = nullptr; } } @@ -2809,7 +2809,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu break; case 0xC9: if (g_navigationMode == 2) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { + if (g_windowMgr.Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_navigationManager.SetViewMode(1); g_navigationTab = 0; g_navigationManager.ClearSavedTarget(); @@ -2949,7 +2949,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } } } - g_navigationManager.ShowRouteResult(result, 1, *reinterpret_cast(&g_windowMgr)); + g_navigationManager.ShowRouteResult(result, 1); this->RefreshLayout(); if (UIWindow* window = g_windowMgr.LookupWindow(0x13A)) { window->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); diff --git a/Source/UI/Window/UIWindow.h b/Source/UI/Window/UIWindow.h index 6f915c53..eeb2858d 100644 --- a/Source/UI/Window/UIWindow.h +++ b/Source/UI/Window/UIWindow.h @@ -31,7 +31,6 @@ struct ITEM_INFO; class UIItemTagButton; class UIWindow : public UIRPData { - friend struct WindowDialogs; friend class UIWindowMgr; friend class CUIDropDownBox; friend class CUIGameSettingsUI; @@ -177,6 +176,7 @@ public: std::list WrapText(std::string text, std::list* lines, int maxWidth, int family, int height, unsigned char bold); const char* TruncateText(const char* text, int maxBytes); const char* ClipTextToWidth(const char* text, int maxWidth, int family, int height, unsigned char bold); + void RecordResponse(int response, std::intptr_t b, std::intptr_t c, std::intptr_t d); int RecordEditTexts(WindowReplayRecorder& recorder); int RestoreEditTexts(const unsigned char* data); void DrawActionSprite( diff --git a/Source/UI/Window/UIWindowFactory.cpp b/Source/UI/Window/UIWindowFactory.cpp index 6bc95be4..8f86c118 100644 --- a/Source/UI/Window/UIWindowFactory.cpp +++ b/Source/UI/Window/UIWindowFactory.cpp @@ -13,7 +13,6 @@ #include struct LayoutWindowContexts { - UIEntryQueueContext& entryQueue; QuickSlotPainting& quickSlots; }; @@ -45,7 +44,7 @@ UIWindow* UIWindowMgr::CreateLayoutWindow(int id) { this->unknown_0404 = window; break; case 0x9D: - window = new UIEntryQueueWnd(contexts.entryQueue); + window = new UIEntryQueueWnd(); break; case 0x9F: window = new UIQuickSlotWnd(contexts.quickSlots); @@ -55,7 +54,7 @@ UIWindow* UIWindowMgr::CreateLayoutWindow(int id) { g_searchStoreInfoCreated = true; break; case 0xD1: - window = new UIEntryQueueStandByWnd(contexts.entryQueue); + window = new UIEntryQueueStandByWnd(); break; } diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index 112a162b..c13b9d62 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -1471,7 +1471,7 @@ void UIWindowMgr::SendEmotionHotkey(int index) { if (g_windowMgr.unknown_01DC != nullptr) { const bool linked = HasTextLinks(std::string(text)); if (linked) { - reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xE53), 0, true, false, 0, "Message", 280, 120, 0); + g_windowMgr.Confirm(LookupMessage(0xE53), 0, true, false, 0, "Message", 280, 120, 0); return; } } @@ -1967,7 +1967,7 @@ bool UIWindowMgr::sub_A8CA20() { bool handled = true; if (!this->modalWindows.empty() && this->modalWindows.back() != nullptr) { - reinterpret_cast(this)->Top()->SendMsg(nullptr, 0, 0, 0, 0, 0); + this->Top()->SendMsg(nullptr, 0, 0, 0, 0, 0); return true; } @@ -2263,7 +2263,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { } if (!this->hoverWindow) { - reinterpret_cast(this)->RestoreInput(); + this->RestoreInput(); return false; } @@ -2381,7 +2381,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { return false; } } else if (g_navigationMode == 2) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 280, 120, 0) == 187) { g_navigationTab = 0; g_navigationMinimized = false; g_navigationManager.Reset(true); @@ -2416,13 +2416,13 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { } if (this->LookupWindow(277) && g_loginModeFlag == 1) { - if (reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (g_windowMgr.Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.gameMode->SendMsg(10011, 0, 0, 0, 0); } return false; } - if (reinterpret_cast(this)->Confirm(LookupMessage(0x11), 2, true, false, 0, "Message", 280, 120, 0) == 187) { + if (this->Confirm(LookupMessage(0x11), 2, true, false, 0, "Message", 280, 120, 0) == 187) { GetRagConnection().Close(); g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); } @@ -3945,7 +3945,6 @@ void UIWindowMgr::ShowWaitDBSaveWindow() { return; } - WindowDialogs& dialogs = *reinterpret_cast(this); this->window_4F2AC = new UIWaitDBSaveWnd(); this->window_4F2AC->SetSize(g_renderer->viewport.width, g_renderer->viewport.height); this->window_4F2AC->Move(0, 0); diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index 4591bfce..a350b338 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -483,6 +483,14 @@ public: void Destroy(UIWindow* window); void ForgetWindowReferences(UIWindow* removed); void DeferDeletion(UIWindow* window); + UIWindow* Top() const; + void RestoreInput(); + int Confirm(const char* text, int type, bool defaultAccept, bool replace, int timeout, const char* caption, int width, int height, unsigned char protect); + void AddMessageBox( + const char* text, int type, bool defaultAccept, int unused, int timeout, const char* caption, int width, int height, const char* icon, bool track + ); + int RunModal(UIWindow* window); + int RunEmailAddress(); void DismissTransient(); void MoveTransient(int x, int y); void RetireTransientWindow(); diff --git a/Source/UI/Window/WindowDialogs.cpp b/Source/UI/Window/WindowDialogs.cpp index a50acf43..8aebf2a6 100644 --- a/Source/UI/Window/WindowDialogs.cpp +++ b/Source/UI/Window/WindowDialogs.cpp @@ -1,7 +1,12 @@ #include "Client/Application/ApplicationWindow.h" +#include "Client/Mode/CGameMode.h" +#include "Client/Mode/CLoginMode.h" +#include "Client/Mode/ModeMgr.h" +#include "Client/Session.h" #include "UI/Window/UIMessageBox.h" -#include "UI/Window/WindowDialogs.h" +#include "UI/Window/UINewSelectCharWnd.h" #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowDialogs.h" // GLOBAL: gl_24604 int g_dialogKeyboardEnabled; @@ -109,14 +114,14 @@ bool UIWindowMgr::ProcessDialogKey(int, int key) { // OFFSET: 0x00A91450 // FUNCTION: fn_17160 -UIWindow* WindowDialogs::Top() const { - return this->modal.empty() ? nullptr : this->modal.back(); +UIWindow* UIWindowMgr::Top() const { + return this->modalWindows.empty() ? nullptr : this->modalWindows.back(); } // OFFSET: 0x00A91120 // FUNCTION: fn_17155 -void WindowDialogs::RestoreInput() { - for (UIWindow* window : this->dialog.retirement.rendered) { +void UIWindowMgr::RestoreInput() { + for (UIWindow* window : this->rendered) { if (window->geometry.visible == 0) { continue; } @@ -126,14 +131,14 @@ void WindowDialogs::RestoreInput() { continue; } - if (this->input) { - this->input->Slot24(child->Slot06() == this->input); + if (this->hoverWindow) { + this->hoverWindow->Slot24(child->Slot06() == this->hoverWindow); } - this->input = child->Slot06(); + this->hoverWindow = child->Slot06(); - if (this->input) { - this->input->Slot23(); + if (this->hoverWindow) { + this->hoverWindow->Slot23(); } return; @@ -143,10 +148,11 @@ void WindowDialogs::RestoreInput() { // OFFSET: 0x00A901E0 // FUNCTION: fn_17153 -int WindowDialogs::Confirm( +int UIWindowMgr::Confirm( const char* text, int type, bool defaultAccept, bool replace, int timeout, const char* caption, int width, int height, unsigned char protect ) { - if (this->suppressed) { + CMode* gameMode = g_modeMgr.GetGameMode(); + if (gameMode && static_cast(gameMode)->unknown_0624[0] == 1) { return 185; } @@ -158,83 +164,81 @@ int WindowDialogs::Confirm( return 185; } - auto* box = new UIMessageBox(this->dialog); - this->latest = box; + auto* box = new UIMessageBox(); + this->window_4F16C = box; box->Configure(text, type, defaultAccept, timeout, caption, width, height, 1, nullptr); if (protect == 1) { box->SendMsg(nullptr, 157, 1, 0, 0, 0); } - this->dialog.retirement.rendered.push_front(box); + this->rendered.push_front(box); - if (this->capture) { - this->suspendedRoots.insert(this->capture->Root()); + if (this->inputWindow) { + this->persistentWindows.insert(this->inputWindow->Root()); } - this->capture = nullptr; + this->inputWindow = nullptr; - if (this->input) { - this->input->Slot24(0); + if (this->hoverWindow) { + this->hoverWindow->Slot24(0); } - this->input = nullptr; - this->alternateResult = 0; - this->modal.push_back(box); + this->hoverWindow = nullptr; + this->unknown_0474 = 0; + this->modalWindows.push_back(box); int response = 184; - if (this->immediate == 0) { - ModalFramePump* pump = this->mode; + if (g_modalImmediate == 0) { + CMode* pump = static_cast(g_charViewMode); for (;;) { - if (this->result != 0) { + if (this->activeWindowId != 0) { if (UIWindow* active = this->Top()) { active->Show(0); - this->dialog.retirement.Schedule(active); - this->modal.pop_back(); + this->Schedule(active); + this->modalWindows.pop_back(); } - response = this->result; + response = this->activeWindowId; - if (this->modal.empty()) { - this->result = 0; + if (this->modalWindows.empty()) { + this->activeWindowId = 0; } break; } - if (this->alternateResult != 0) { + if (this->unknown_0474 != 0) { if (UIWindow* active = this->Top()) { active->Show(0); - this->dialog.retirement.Schedule(active); - this->modal.pop_back(); + this->Schedule(active); + this->modalWindows.pop_back(); } - response = this->alternateResult; - this->alternateResult = 0; + response = this->unknown_0474; + this->unknown_0474 = 0; break; } if (pump) { - pump->Frame(); - pump = this->mode; + pump->Update(); + pump = static_cast(g_charViewMode); } - const auto option = this->frameOptions.find(20); + if (g_session.GetOption(20) > 0) { + this->activeWindowId = 0; + this->unknown_0474 = 0; - if (option != this->frameOptions.end() && option->second > 0) { - this->result = 0; - this->alternateResult = 0; - - while (!this->modal.empty()) { - this->dialog.retirement.Schedule(this->modal.back()); - this->modal.pop_back(); + while (!this->modalWindows.empty()) { + this->Schedule(this->modalWindows.back()); + this->modalWindows.pop_back(); } break; } - if (this->immediate != 0) { + if (g_modalImmediate != 0) { break; } } @@ -246,107 +250,105 @@ int WindowDialogs::Confirm( // OFFSET: 0x00AA20F0 // FUNCTION: fn_17211 -void WindowDialogs::AddMessageBox( +void UIWindowMgr::AddMessageBox( const char* text, int type, bool defaultAccept, int, int timeout, const char* caption, int width, int height, const char* icon, bool track ) { - std::vector& boxes = this->dialog.retirement.messageBoxes; + std::vector& boxes = this->messageBoxes; if (boxes.size() > 5) { MessageBoxA(hWnd, "Max MessageBox Count", "ERROR", 0); return; } - auto* box = new UIMessageBox(this->dialog); + auto* box = new UIMessageBox(); box->Configure(text, type, defaultAccept, timeout, caption, width, height, 0, icon); - this->dialog.retirement.rendered.push_back(box); + this->rendered.push_back(box); if (track) { boxes.push_back(box); } - this->capture = nullptr; + this->inputWindow = nullptr; - if (this->input) { - this->input->Slot24(0); + if (this->hoverWindow) { + this->hoverWindow->Slot24(0); } - this->input = nullptr; + this->hoverWindow = nullptr; } // OFFSET: 0x00AA2230 // FUNCTION: fn_17212 -int WindowDialogs::RunModal(UIWindow* window) { +int UIWindowMgr::RunModal(UIWindow* window) { if (!window) { return 185; } - if (this->capture) { - this->suspendedRoots.insert(this->capture->Root()); + if (this->inputWindow) { + this->persistentWindows.insert(this->inputWindow->Root()); } - this->capture = nullptr; + this->inputWindow = nullptr; - if (this->input) { - this->input->Slot24(0); + if (this->hoverWindow) { + this->hoverWindow->Slot24(0); } - this->input = nullptr; - this->alternateResult = 0; - this->modal.push_back(window); + this->hoverWindow = nullptr; + this->unknown_0474 = 0; + this->modalWindows.push_back(window); int response = 184; - if (this->immediate == 0) { - ModalFramePump* pump = this->mode; + if (g_modalImmediate == 0) { + CMode* pump = static_cast(g_charViewMode); for (;;) { - if (this->result != 0) { + if (this->activeWindowId != 0) { if (UIWindow* active = this->Top()) { active->Show(0); - this->dialog.retirement.Schedule(active); - this->modal.pop_back(); + this->Schedule(active); + this->modalWindows.pop_back(); } - response = this->result; + response = this->activeWindowId; - if (this->modal.empty()) { - this->result = 0; + if (this->modalWindows.empty()) { + this->activeWindowId = 0; } break; } - if (this->alternateResult != 0) { + if (this->unknown_0474 != 0) { if (UIWindow* active = this->Top()) { active->Show(0); - this->dialog.retirement.Schedule(active); - this->modal.pop_back(); + this->Schedule(active); + this->modalWindows.pop_back(); } - response = this->alternateResult; - this->alternateResult = 0; + response = this->unknown_0474; + this->unknown_0474 = 0; break; } if (pump) { - pump->Frame(); - pump = this->mode; + pump->Update(); + pump = static_cast(g_charViewMode); } - const auto option = this->frameOptions.find(20); + if (g_session.GetOption(20) > 0) { + this->activeWindowId = 0; + this->unknown_0474 = 0; - if (option != this->frameOptions.end() && option->second > 0) { - this->result = 0; - this->alternateResult = 0; - - while (!this->modal.empty()) { - this->dialog.retirement.Schedule(this->modal.back()); - this->modal.pop_back(); + while (!this->modalWindows.empty()) { + this->Schedule(this->modalWindows.back()); + this->modalWindows.pop_back(); } break; } - if (this->immediate != 0) { + if (g_modalImmediate != 0) { break; } } diff --git a/Source/UI/Window/WindowDialogs.h b/Source/UI/Window/WindowDialogs.h index 520e885c..006e9e56 100644 --- a/Source/UI/Window/WindowDialogs.h +++ b/Source/UI/Window/WindowDialogs.h @@ -1,46 +1,6 @@ #ifndef RAGNAROK_SOURCE_UI_WINDOW_WINDOWDIALOGS_H #define RAGNAROK_SOURCE_UI_WINDOW_WINDOWDIALOGS_H -#include -#include -#include - -class UIWindow; -class UIMessageBox; -struct UIMessageBoxContext; - -class ModalFramePump { -public: - virtual void Frame() = 0; - -protected: - ~ModalFramePump() = default; -}; - -struct WindowDialogs { - UIMessageBoxContext& dialog; - int& result; - std::set& suspendedRoots; - UIWindow*& capture; - UIWindow*& input; - std::deque& modal; - int& alternateResult; - UIMessageBox*& latest; - ModalFramePump*& mode; - const bool& suppressed; - const int& immediate; - const std::map& frameOptions; - - UIWindow* Top() const; - void RestoreInput(); - int Confirm(const char* text, int type, bool defaultAccept, bool replace, int timeout, const char* caption, int width, int height, unsigned char protect); - void AddMessageBox( - const char* text, int type, bool defaultAccept, int unused, int timeout, const char* caption, int width, int height, const char* icon, bool track - ); - int RunModal(UIWindow* window); - int RunEmailAddress(); -}; - extern int g_dialogKeyboardEnabled; extern int g_dialogKeyboardBlocked; diff --git a/Source/UI/Window/WindowMgrState.cpp b/Source/UI/Window/WindowMgrState.cpp index cbb08b0c..733d4419 100644 --- a/Source/UI/Window/WindowMgrState.cpp +++ b/Source/UI/Window/WindowMgrState.cpp @@ -1,33 +1,35 @@ -#include "UI/Window/UIWindowMgr.h" +#include "Client/Mode/CGameMode.h" +#include "Client/Mode/CLoginMode.h" +#include "Client/Mode/ModeDragState.h" +#include "Client/Mode/ModeMgr.h" +#include "Client/Registry.h" +#include "Client/ReplayPacketRecorder.h" +#include "Client/Session.h" +#include "Contents/Actors/Pc.h" +#include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Messenger/ClientMessenger.h" #include "Contents/Messenger/MessengerMember.h" -#include "UI/Party/UIMiniPartyWnd.h" -#include "UI/Window/WindowDialogs.h" -#include "Client/Registry.h" -#include "Client/Session.h" -#include "Contents/Configuration/ServiceConfiguration.h" -#include "UI/Dialogs/UIEmailAddressWnd.h" -#include "UI/Dialogs/UIMemorialDunWnd.h" -#include "UI/Window/UIMessageBox.h" -#include "UI/GameSettings/GameSettingsUI.h" -#include "UI/Navigation/UINavigationV4Wnd.h" -#include "UI/Window/UINavigationWnd.h" -#include "UI/Window/UIRoulletteWnd.h" -#include "UI/Window/UIWindow.h" -#include "UI/Window/MiniPartyWndAreaMgr.h" -#include "Render/Renderer.h" -#include "Client/Mode/ModeMgr.h" -#include "Client/Mode/CGameMode.h" +#include "Contents/UserData/NormalItemSlots.h" #include "Contents/World/World.h" -#include "Contents/Actors/Pc.h" #include "Render/DeviceContext/DCSurface.h" +#include "Render/Renderer.h" #include "Render/Textures/Surface.h" #include "Resource/Bitmap/BitmapResource.h" +#include "UI/Dialogs/UIEmailAddressWnd.h" +#include "UI/Dialogs/UIMemorialDunWnd.h" #include "UI/Edit/UIEditCtrl.h" +#include "UI/GameSettings/GameSettingsUI.h" +#include "UI/Navigation/UINavigationV4Wnd.h" +#include "UI/Party/UIMiniPartyWnd.h" +#include "UI/Window/MiniPartyWndAreaMgr.h" +#include "UI/Window/UIMessageBox.h" +#include "UI/Window/UINavigationWnd.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "UI/Window/UIRoulletteWnd.h" +#include "UI/Window/UIWindow.h" +#include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowDialogs.h" #include "UI/Window/WindowMouseHit.h" -#include "Client/ReplayPacketRecorder.h" -#include "Client/Mode/ModeDragState.h" -#include "Contents/UserData/NormalItemSlots.h" #include #include #include @@ -126,7 +128,6 @@ bool CGameActor::HasUnknown030CEntry() { // FUNCTION: fn_17175 void UIWindowMgr::RestoreMiniPartyWindows() { const int count = static_cast(g_session.unknown_0734.size()); - WindowDialogs& dialogs = *reinterpret_cast(this); for (int index = 0; index < count; ++index) { MessengerMember member = g_session.PartyAt(index); if (member.valid == 0) { @@ -1162,7 +1163,7 @@ void UIWindowMgr::CycleWindowVisibilityTwice() { // OFFSET: 0x00A8FDB0 // FUNCTION: fn_17151 -int WindowDialogs::RunEmailAddress() { +int UIWindowMgr::RunEmailAddress() { if (this->Top()) { return 185; } @@ -1170,69 +1171,67 @@ int WindowDialogs::RunEmailAddress() { auto* window = new UIEmailAddressWnd(); window->SetSize(280, 48); window->Move((g_renderer->viewport.width - 640) / 2 + 185, (g_renderer->viewport.height - 480) / 2 + 180); - this->dialog.retirement.rendered.push_front(window); + this->rendered.push_front(window); - if (this->capture) { - this->suspendedRoots.insert(this->capture->Root()); + if (this->inputWindow) { + this->persistentWindows.insert(this->inputWindow->Root()); } - this->capture = nullptr; - this->alternateResult = 0; - this->modal.push_back(window); + this->inputWindow = nullptr; + this->unknown_0474 = 0; + this->modalWindows.push_back(window); int response = 184; - if (this->immediate == 0) { - ModalFramePump* pump = this->mode; + if (g_modalImmediate == 0) { + CMode* pump = static_cast(g_charViewMode); for (;;) { - if (this->result != 0) { + if (this->activeWindowId != 0) { if (UIWindow* active = this->Top()) { active->Show(0); - this->dialog.retirement.Schedule(active); - this->modal.pop_back(); + this->Schedule(active); + this->modalWindows.pop_back(); } - response = this->result; + response = this->activeWindowId; - if (this->modal.empty()) { - this->result = 0; + if (this->modalWindows.empty()) { + this->activeWindowId = 0; } break; } - if (this->alternateResult != 0) { + if (this->unknown_0474 != 0) { if (UIWindow* active = this->Top()) { active->Show(0); - this->dialog.retirement.Schedule(active); - this->modal.pop_back(); + this->Schedule(active); + this->modalWindows.pop_back(); } - response = this->alternateResult; - this->alternateResult = 0; + response = this->unknown_0474; + this->unknown_0474 = 0; break; } if (pump) { - pump->Frame(); - pump = this->mode; + pump->Update(); + pump = static_cast(g_charViewMode); } - const auto option = this->frameOptions.find(20); + if (g_session.GetOption(20) > 0) { + this->activeWindowId = 0; + this->unknown_0474 = 0; - if (option != this->frameOptions.end() && option->second > 0) { - this->result = 0; - this->alternateResult = 0; - - while (!this->modal.empty()) { - this->dialog.retirement.Schedule(this->modal.back()); - this->modal.pop_back(); + while (!this->modalWindows.empty()) { + this->Schedule(this->modalWindows.back()); + this->modalWindows.pop_back(); } break; } - if (this->immediate != 0) { + if (g_modalImmediate != 0) { break; } }