From a55dd8b8e5890d9cb67220abcb067e603ec672fc Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 15:19:07 +0000 Subject: [PATCH 1/2] Decompile 4 functions in Source/UI/Window/WindowOrdering.cpp, Source/UI/Window/UIWindowMgr.h, ... Batch #1076 by ragnarok-clanker: 4 byte-identical, 0 confirmed by peer review. - fn_17185 UIWindowMgr::RefreshClanWnd: byte-identical - fn_17186 UIWindowMgr::RefreshGuildWindows: byte-identical - fn_17187 UIWindowMgr::RefreshRouletteWnd: byte-identical - fn_17188 UIWindowMgr::EnableRouletteWnd: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/UI/Window/UIRoulletteWnd.h | 18 +++++++++ Source/UI/Window/UIWindowMgr.h | 18 ++++++--- Source/UI/Window/WindowOrdering.cpp | 57 +++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 Source/UI/Window/UIRoulletteWnd.h diff --git a/Source/UI/Window/UIRoulletteWnd.h b/Source/UI/Window/UIRoulletteWnd.h new file mode 100644 index 0000000..8623ed0 --- /dev/null +++ b/Source/UI/Window/UIRoulletteWnd.h @@ -0,0 +1,18 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIROULLETTEWND_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIROULLETTEWND_H + +#include "UI/Window/UIFrameWnd.h" + +class UIRoulletteWnd : public UIFrameWnd { +public: + /* 00BC */ std::uint32_t unknown_00BC; + /* 00C0 */ std::uint32_t unknown_00C0; + /* 00C4 */ std::uint32_t unknown_00C4; + /* 00C8 */ unsigned char m_enabled; +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(UIRoulletteWnd, m_enabled) == 0xC8); +#endif + +#endif diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index a87157d..95b28be 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -39,6 +39,8 @@ struct WindowPolicyEntry { /* 0000 */ int actions[8]; }; +class UIRoulletteWnd; + class UIWindowMgr { public: /* 0004 */ int activeWindowId; @@ -232,11 +234,11 @@ public: /* 031C */ std::uint32_t unknown_031C; /* 0320 */ UIWindow* window_0320; /* 0324 */ UIWindow* window_0324; - /* 0328 */ std::uint32_t unknown_0328; + /* 0328 */ UIWindow* unknown_0328; /* 032C */ UIWindow* window_032C; - /* 0330 */ std::uint32_t unknown_0330; - /* 0334 */ std::uint32_t unknown_0334; - /* 0338 */ std::uint32_t unknown_0338; + /* 0330 */ UIWindow* unknown_0330; + /* 0334 */ UIWindow* unknown_0334; + /* 0338 */ UIWindow* unknown_0338; /* 033C */ std::uint32_t unknown_033C; /* 0340 */ std::uint32_t unknown_0340; /* 0344 */ std::uint32_t unknown_0344; @@ -313,7 +315,7 @@ public: /* 0458 */ std::uint32_t unknown_0458; /* 045C */ std::uint32_t unknown_045C; /* 0460 */ std::uint32_t unknown_0460; - /* 0464 */ std::uint32_t unknown_0464; + /* 0464 */ UIRoulletteWnd* unknown_0464; /* 0468 */ UIWindow* window_0468; /* 046C */ int unknown_046C; /* 0470 */ int unknown_0470; @@ -422,6 +424,12 @@ public: void Destroy(UIWindow* window); void DismissTransient(); void RegisterNamedWindow(std::string name, UIWindow* window); + void InvalidateAll(); + void RefreshClanWnd(); + void RefreshGuildWindows(); + void RefreshRouletteWnd(); + void EnableRouletteWnd(); + char UpdateSnapRectangles(); }; extern UIWindowMgr g_windowMgr; diff --git a/Source/UI/Window/WindowOrdering.cpp b/Source/UI/Window/WindowOrdering.cpp index 32ab1fd..dad6e1a 100644 --- a/Source/UI/Window/WindowOrdering.cpp +++ b/Source/UI/Window/WindowOrdering.cpp @@ -1,9 +1,66 @@ +#include "UI/Window/UIRoulletteWnd.h" +#include "Contents/Configuration/ServiceOptions.h" +#include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIWindow.h" #include "UI/Window/WindowManagerWindows.h" #include "UI/Window/WindowOrdering.h" #include +// OFFSET: 0x00A966E0 + +// OFFSET: 0x00A96710 +// FUNCTION: fn_17185 +void UIWindowMgr::RefreshClanWnd() { + if (this->window_0444) { + this->window_0444->SendMsg(nullptr, 60, 0, 0, 0, 0); + } +} + +// OFFSET: 0x00A96730 +// FUNCTION: fn_17186 +void UIWindowMgr::RefreshGuildWindows() { + if (this->window_0320) { + this->window_0320->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + if (this->window_0324) { + this->window_0324->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + if (this->unknown_0328) { + this->unknown_0328->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + if (this->window_032C) { + this->window_032C->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + if (this->unknown_0330) { + this->unknown_0330->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + if (this->unknown_0334) { + this->unknown_0334->SendMsg(nullptr, 60, 0, 0, 0, 0); + } + if (this->unknown_0338) { + this->unknown_0338->SendMsg(nullptr, 60, 0, 0, 0, 0); + } +} + +// OFFSET: 0x00A96810 +// FUNCTION: fn_17187 +void UIWindowMgr::RefreshRouletteWnd() { + if (this->unknown_0464) { + this->unknown_0464->SendMsg(nullptr, 60, 0, 0, 0, 0); + } +} + +// OFFSET: 0x00A96830 +// FUNCTION: fn_17188 +void UIWindowMgr::EnableRouletteWnd() { + if (this->unknown_0464) { + this->unknown_0464->m_enabled = 1; + } +} + +// OFFSET: 0x00A96850 + // OFFSET: 0x00A976C0 // FUNCTION: fn_17206 void WindowOrdering::Promote(UIWindow* window) { From 0c214b1e624276d9e4ad43cf3aac559961891de9 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 15:28:25 +0000 Subject: [PATCH 2/2] Decompile 2 functions in Source/UI/Window/WindowOrdering.cpp, Source/UI/Window/UIWindowMgr.h, ... Batch #1075 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_17184 UIWindowMgr::InvalidateAll: logic confirmed by peer review - fn_17189 UIWindowMgr::UpdateSnapRectangles: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/UI/Window/WindowOrdering.cpp | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Source/UI/Window/WindowOrdering.cpp b/Source/UI/Window/WindowOrdering.cpp index dad6e1a..f021aef 100644 --- a/Source/UI/Window/WindowOrdering.cpp +++ b/Source/UI/Window/WindowOrdering.cpp @@ -8,6 +8,12 @@ #include // OFFSET: 0x00A966E0 +// FUNCTION: fn_17184 +void UIWindowMgr::InvalidateAll() { + for (UIWindow* window : this->rendered) { + window->InvalidateChildren(); + } +} // OFFSET: 0x00A96710 // FUNCTION: fn_17185 @@ -60,6 +66,38 @@ void UIWindowMgr::EnableRouletteWnd() { } // OFFSET: 0x00A96850 +// FUNCTION: fn_17189 +char UIWindowMgr::UpdateSnapRectangles() { + this->snapRectangles.clear(); + + const ServiceOptions* options = reinterpret_cast(this); + if (options->Get(141) == 0) { + return 0; + } + + for (UIWindow* window : this->rendered) { + if (window->geometry.visible == 0) { + continue; + } + + bool excluded = false; + for (UIWindow* ex : this->snapExcluded) { + if (ex == window) { + excluded = true; + break; + } + } + if (excluded) { + continue; + } + + if (options->Get(141) != 0 && window) { + this->snapRectangles[window].Set(window->geometry.x, window->geometry.y, window->geometry.width, window->geometry.height); + } + } + + return 1; +} // OFFSET: 0x00A976C0 // FUNCTION: fn_17206