diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index 73200c2e..e3d1a4a3 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -1158,6 +1158,40 @@ int UIWindowMgr::LoadReplayReserved(const std::vector& data) { return static_cast(offset); } +// OFFSET: 0x00AA8D10 +// FUNCTION: fn_17249 +int UIWindowMgr::LoadReplayWindows(const std::vector& data) { + if (data.empty()) { + return -1; + } + + ReplaySettingHeader header; + std::vector payload; + unsigned offset = 6; + header.Read(data.data()); + if (header.tag != 20000) { + offset = static_cast(-1); + } else { + while (offset < data.size()) { + header.Read(data.data() + offset); + offset += 6; + if (header.tag == 20001) { + break; + } + if (static_cast(header.tag - 20100) <= 399) { + UIWindow* window = this->EnsureWindow(header.tag - 20100); + if (window && header.size > 0) { + payload.resize(header.size); + std::memcpy(payload.data(), data.data() + offset, header.size); + offset += header.size; + window->SendMsg(nullptr, 123, reinterpret_cast(payload.data()), payload.size(), 0, 0); + } + } + } + } + return static_cast(offset); +} + // OFFSET: 0x00AA8F50 // FUNCTION: fn_17252 void UIWindowMgr::BroadcastMessage21() { diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index dbb3cd7f..4f152924 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -544,6 +544,7 @@ public: void ApplyReplayOptions(const ReplayOptions& options); int LoadReplaySettings(const std::vector& data); int LoadReplayReserved(const std::vector& data); + int LoadReplayWindows(const std::vector& data); void BroadcastMessage21(); bool HasModalWindow(); int TranslateHotkey(int key, int keyData);