From 5a145c119dbfb40d4105a4030151c5185ad67b8a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 23:49:39 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Acceptance/UIChooseSellBuyWnd.cpp, Source/UI/Dialogs/UIMenuWnd.h, ... Batch #1908 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_12289 UIMenuWnd::Slot28: logic confirmed by peer review - fn_12309 UIEquipWnd::Slot35: logic confirmed by peer review Peer-reviewed-by: eAthena, Yommy Reviewed-by: ragnarok-clanker --- Source/Client/Session.h | 4 ++- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 32 +++++++++++++++++++++ Source/UI/Dialogs/UIMenuWnd.h | 11 +++++++ Source/UI/Items/UIEquipWnd.h | 5 +++- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/Source/Client/Session.h b/Source/Client/Session.h index edac7d9..9f0221c 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -194,7 +194,9 @@ public: /* 807C */ unsigned char unknown_807C[0x38]; /* 80B4 */ std::map m_nameToId; /* 80BC */ std::map m_shops; - /* 80C4 */ unsigned char unknown_80C4[0x58]; + /* 80C4 */ unsigned char unknown_80C4[4]; + /* 80C8 */ int unknown_80C8; + /* 80CC */ unsigned char unknown_80CC[0x50]; /* 811C */ std::vector m_cardItems; /* 8128 */ unsigned char unknown_8128[0x0C]; /* 8134 */ int unknown_8134; diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 348473f..ab650c1 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Application/ApplicationWindow.h" +#include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Client/Mode/ActiveGameMode.h" #include "Client/Mode/CGameMode.h" @@ -587,6 +588,29 @@ void UIMenuWnd::Slot27(int x, int y) { this->Slot28(x, y); } +// OFFSET: 0x008F4680 +// FUNCTION: fn_12289 +void UIMenuWnd::Slot28(int x, int y) { + const int previous = this->m_selected; + this->m_selected = this->ItemAt(x, y); + if (previous != this->m_selected) { + this->Invalidate(); + } +} + +// OFFSET: 0x008D99D0 +// FUNCTION: fn_12134 +int UIMenuWnd::ItemAt(int x, int y) { + if (x < 0 || x >= this->geometry.width || y < 0 || y >= this->geometry.height) { + return -1; + } + + int row = y / (this->m_itemHeight / 2); + const unsigned index = row < 0 ? 0 : row; + const unsigned last = static_cast(this->m_items.size()) - 1; + return index <= last ? index : last; +} + // OFFSET: 0x008F4D40 // FUNCTION: fn_12294 void UIEquipWnd::Slot19() { @@ -649,6 +673,14 @@ void UIExchangeWnd::Slot35(int delta) { this->SendMsg(this->m_scrollBar, 7, delta < 0 ? 1 : -1, 0, 0, 0); } +// OFFSET: 0x008F59C0 +// FUNCTION: fn_12309 +void UIEquipWnd::Slot35(int delta) { + if (g_session.unknown_80C8 > 4 && this->m_page == 3) { + this->SendMsg(this->m_scrollBar, 8, delta < 0 ? 1 : -1, 0, 0, 0); + } +} + // OFFSET: 0x008F5A50 // FUNCTION: fn_12311 void UIItemIdentifyWnd::Slot35(int delta) { diff --git a/Source/UI/Dialogs/UIMenuWnd.h b/Source/UI/Dialogs/UIMenuWnd.h index d6dfc08..11903ac 100644 --- a/Source/UI/Dialogs/UIMenuWnd.h +++ b/Source/UI/Dialogs/UIMenuWnd.h @@ -3,9 +3,20 @@ #include "UI/Window/UIFrameWnd.h" +#include +#include + class UIMenuWnd : public UIFrameWnd { public: + /* 00B4 */ int m_menuId; + /* 00B8 */ int m_selected; + /* 00BC */ int m_itemHeight; + /* 00C0 */ std::vector m_items; + void Slot27(int x, int y) override; + void Slot28(int x, int y) override; + + int ItemAt(int x, int y); }; #endif diff --git a/Source/UI/Items/UIEquipWnd.h b/Source/UI/Items/UIEquipWnd.h index 3b3b8bf..ed44540 100644 --- a/Source/UI/Items/UIEquipWnd.h +++ b/Source/UI/Items/UIEquipWnd.h @@ -7,13 +7,16 @@ class UIEquipWnd : public UIFrameWnd { public: /* 00B4 */ unsigned char unknown_00B4[0x3C]; /* 00F0 */ int m_page; - /* 00F4 */ unsigned char unknown_00F4[0x60]; + /* 00F4 */ unsigned char unknown_00F4[0x40]; + /* 0134 */ UIWindow* m_scrollBar; + /* 0138 */ unsigned char unknown_0138[0x1C]; /* 0154 */ int m_firstSlot; /* 0158 */ int m_hoverSlot; void Slot19() override; void Slot27(int x, int y) override; void Slot31(int x, int y) override; + void Slot35(int delta) override; }; #endif