diff --git a/Source/Contents/RodexMailStore.h b/Source/Contents/RodexMailStore.h index 1dfa724b..70dd07ca 100644 --- a/Source/Contents/RodexMailStore.h +++ b/Source/Contents/RodexMailStore.h @@ -48,7 +48,7 @@ public: /* 0004 */ int unknown_0004; /* 0008 */ int unknown_0008; /* 000C */ int unknown_000C; - /* 0010 */ bool unknown_0010; + /* 0010 */ unsigned char unknown_0010; /* 0014 */ int unknown_0014; /* 0018 */ int unknown_0018; /* 001C */ bool unknown_001C; diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index ee3d86fd..2a266468 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -360,7 +360,7 @@ bool RodexMailEntryLess::operator()(const RodexMailEntry& left, const RodexMailE // OFFSET: 0x008054D0 // FUNCTION: fn_10043 -bool RequestRodexMailAction(int type, std::uint64_t mailId) { +bool __stdcall RequestRodexMailAction(int type, std::uint64_t mailId) { std::map* mails = RodexMailsOfType(type); if (mails == nullptr) { return false; @@ -372,5 +372,57 @@ bool RequestRodexMailAction(int type, std::uint64_t mailId) { } g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(mailId), type, 0, 0); + if (g_windowMgr.unknown_045C != 0) { + g_windowMgr.CloseWindow(265); + } return true; } + +// OFFSET: 0x00805570 +// FUNCTION: fn_10044 +void UIRodexInboxWnd::RequestAllMailActions() { + int requested = 0; + int skipped = 0; + if (this->unknown_01D4 == 1) { + for (std::vector::iterator entry = this->searchResults.begin(); entry != this->searchResults.end(); ++entry) { + std::map* mails = RodexMailsOfType(entry->first); + if (mails == nullptr) { + continue; + } + + std::map::iterator mail = mails->find(entry->second); + if (mail == mails->end()) { + continue; + } + + if ((mail->second.unknown_0001 & 6) == 0) { + g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(entry->second), entry->first, 0, 0); + ++requested; + } else { + ++skipped; + } + } + } else { + int type = g_rodexMailStore->unknown_0010; + std::map* mails = RodexMailsOfType(type); + if (mails == nullptr) { + return; + } + + for (std::map::iterator mail = mails->begin(); mail != mails->end(); ++mail) { + if ((mail->second.unknown_0001 & 6) == 0) { + g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(mail->first), type, 0, 0); + ++requested; + } else { + ++skipped; + } + } + } + + if (requested > 0 && g_windowMgr.unknown_045C != 0) { + g_windowMgr.CloseWindow(265); + } + if (skipped > 0) { + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); + } +} diff --git a/Source/UI/Rodex/UIRodexInboxWnd.h b/Source/UI/Rodex/UIRodexInboxWnd.h index 1be9411b..745f480f 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.h +++ b/Source/UI/Rodex/UIRodexInboxWnd.h @@ -56,6 +56,7 @@ public: void SearchBySender(std::string keyword); void SearchByTitle(std::string keyword); void InitializeMailActions(); + void RequestAllMailActions(); /* 012C */ unsigned char unknown_012C[0x4]; /* 0130 */ int unknown_0130;