From cb439d8c4711ed63d4aee6de868ea7eb91b451cb Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 07:34:32 +0000 Subject: [PATCH] Decompile 5 functions in Source/Contents/Messenger/MessengerMember.cpp, Source/UI/Gauges/UIPcGage.h Batch #5083 by Yommy: 0 byte-identical, 5 confirmed by peer review. - fn_07705 UIMessengerGroupWnd::MemberAtIndex: logic confirmed by peer review - fn_07708 UIMessengerGroupWnd::Slot26: logic confirmed by peer review - fn_07712 UIMessengerGroupWnd::Slot27: logic confirmed by peer review - fn_07714 UIMessengerGroupWnd::Slot35: logic confirmed by peer review - fn_11596 UIGage::SetColor: logic confirmed by peer review Peer-reviewed-by: youko, tayoba Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Messenger/MessengerMember.cpp | 114 ++++++++++++++++++ Source/UI/Gauges/UIPcGage.h | 1 + 2 files changed, 115 insertions(+) diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index 5c3eea75..920b03cf 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -9,6 +9,11 @@ #include "UI/Buttons/UIBitmapButton.h" #include "UI/Buttons/UICheckBox.h" #include "UI/Gauges/UIPcGage.h" +#include "UI/Lists/UIScrollBar.h" +#include "Client/Mode/CGameMode.h" +#include "Contents/Actors/Pc.h" +#include "Contents/Messenger/ClientMessenger.h" +#include "Contents/World/World.h" #include "UI/Window/UIFrameWnd.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/WindowManagerWindows.h" @@ -104,6 +109,59 @@ public: /* 0120 */ int unknown_0120; }; +class UIMessengerGroupWnd : public UIFrameWnd { +public: + void Slot26(int x, int y) override; + void Slot27(int x, int y) override; + void Slot35(int delta) override; + MessengerMember MemberAtIndex(int index); + void UpdateScroll(); + void LayoutButtons(); + void UpdateGauges(); + + // INLINED + UIWindow* CompanionWindow() const { + if (this->mode == 0) { + return reinterpret_cast(g_windowMgr.unknown_033C); + } + UIWindow* window = reinterpret_cast(g_windowMgr.unknown_042C); + if (g_windowMgr.unknown_030C) { + window = reinterpret_cast(g_windowMgr.unknown_030C); + } + return window; + } + + /* 00B4 */ MessengerGroupWndInfo* saved; + /* 00B8 */ UIScrollBar* scrollBar; + /* 00BC */ int unknown_00BC; + /* 00C0 */ int unknown_00C0; + /* 00C4 */ int unknown_00C4; + /* 00C8 */ UIWindow* buttons[11]; + /* 00F4 */ int unknown_00F4; + /* 00F8 */ int unknown_00F8; + /* 00FC */ std::list members; + /* 0104 */ int unknown_0104; + /* 0108 */ int unknown_0108; + /* 010C */ int unknown_010C; + /* 0110 */ int scrollable; + /* 0114 */ int scrollTop; + /* 0118 */ int columns; + /* 011C */ int visibleRows; + /* 0120 */ int selected; + /* 0124 */ int rowHeight; + /* 0128 */ UIPcGage* gauges[40]; + /* 01C8 */ UIJobIconButton* jobIcons[40]; + /* 0268 */ int iconIndex; + /* 026C */ std::vector iconPositions; + /* 0278 */ int unknown_0278; + /* 027C */ UIWindow* unknown_027C; + /* 0280 */ unsigned char hiddenButtons[11]; + /* 028C */ int mode; +}; + +// GLOBAL: gl_24961 +bool g_messengerGroupCollapsed; + #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(MiniPartyIconPosition) == 12); static_assert(sizeof(MessengerRecordHeader) == 6); @@ -571,3 +629,59 @@ void UIJobIconButton::Slot33(int x, int y) { window->Slot33(x + this->geometry.x, y + this->geometry.y); } } + +// OFFSET: 0x0073A540 +// FUNCTION: fn_07705 +MessengerMember UIMessengerGroupWnd::MemberAtIndex(int index) { + int position = 0; + for (auto it = this->members.begin(); it != this->members.end(); ++it, ++position) { + if (index == position) { + return *it; + } + } + return MessengerMember(0); +} + +// OFFSET: 0x0073CD30 +// FUNCTION: fn_07708 +void UIMessengerGroupWnd::Slot26(int, int) { + if (!g_messengerGroupCollapsed) { + this->SendMsg(nullptr, 6, 232, 0, 0, 0); + } +} + +// OFFSET: 0x0073D3F0 +// FUNCTION: fn_07712 +void UIMessengerGroupWnd::Slot27(int x, int y) { + UIFrameWnd::Slot27(x, y); + if (UIWindow* window = this->CompanionWindow()) { + x = 0; + y = 0; + this->ToScreen(x, y); + window->Move(x + 2 + this->geometry.width, y); + } +} + +// OFFSET: 0x0073D530 +// FUNCTION: fn_07714 +void UIMessengerGroupWnd::Slot35(int delta) { + if (this->scrollable) { + int step = this->visibleRows - 1; + if (step > 3) { + step = 3; + } + this->SendMsg(this->scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + } +} + +// OFFSET: 0x0073D580 + +// OFFSET: 0x0073D640 + +// OFFSET: 0x0073D800 + +// OFFSET: 0x0089CFD0 +// FUNCTION: fn_11596 +void UIGage::SetColor(std::uint32_t color) { + this->colors[0] = color; +} diff --git a/Source/UI/Gauges/UIPcGage.h b/Source/UI/Gauges/UIPcGage.h index e73b3213..c55bf00e 100644 --- a/Source/UI/Gauges/UIPcGage.h +++ b/Source/UI/Gauges/UIPcGage.h @@ -9,6 +9,7 @@ class UIGage : public UIWindow { public: UIGage(); + __declspec(noinline) void SetColor(std::uint32_t color); /* 0080 */ std::uint32_t colors[7]; };