Decompile 2 functions in Source/UI/Items/UISwapEquipmentWnd.cpp, Source/UI/Items/UISwapEquipmentWnd.h

Batch #5241 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_10392 UISwapEquipmentWnd::ItemAtPoint: logic confirmed by peer review
- fn_10393 UISwapEquipmentWnd::GetSlotItem: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, meitogi, OvoKore
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-30 09:43:36 +00:00
commit fb3ac692eb
2 changed files with 41 additions and 0 deletions

View file

@ -85,6 +85,44 @@ void UISwapEquipmentWnd::SetSlotValue(int index, int value) {
}
}
// OFFSET: 0x00830400
// FUNCTION: fn_10392
ITEM_INFO UISwapEquipmentWnd::ItemAtPoint(int x, int y) {
int slot = -1;
if (y <= this->geometry.height && y >= 22 && y <= 151) {
if ((x >= 6 && x < 106) || (x >= 170 && x < this->geometry.width - 6)) {
const int row = (y - 22) / 26;
if (x >= 170) {
slot = row == 0 ? 9 : row + 3;
} else {
slot = row == 0 ? 8 : row - 1;
}
}
if (x > 112 && x < 170 && y >= 28 && y <= 52) {
slot = 15;
}
}
return this->GetSlotItem(slot);
}
// OFFSET: 0x008304F0
// FUNCTION: fn_10393
ITEM_INFO UISwapEquipmentWnd::GetSlotItem(int slot) {
if (slot == -1) {
return ITEM_INFO(0);
}
if (this->unknown_00BC == 2) {
ITEM_INFO item = g_session.GetItem6B68(slot);
return item.unknown_0000[1] > 0 ? item : ITEM_INFO(0);
}
ITEM_INFO item = g_session.GetItem61B8(slot);
return item.unknown_0000[1] > 0 ? item : ITEM_INFO(0);
}
// OFFSET: 0x00830760
// OFFSET: 0x00830970

View file

@ -6,6 +6,7 @@
#include <cstdint>
struct ITEM_INFO;
struct UIButtonContext;
extern unsigned long g_swapEquipmentTick;
@ -22,6 +23,8 @@ class UISwapEquipmentWnd : public UIFrameWnd {
public:
void Slot10(int x, int y, std::intptr_t value) override;
void Slot15(int width, int height) override;
ITEM_INFO ItemAtPoint(int x, int y);
__declspec(noinline) ITEM_INFO GetSlotItem(int slot);
void SetSlotValue(int index, int value);
protected: