rodecomp/Source/UI/Window/UINewSkillListWndHitTest.cpp
ragnarok-clanker 6861ef653b Decompile fn_13804 (UINewSkillListWnd::SkillIndexAt)
Batch #7433 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_13804 UINewSkillListWnd::SkillIndexAt: logic confirmed by peer review

Peer-reviewed-by: meitogi, gordaoprogramas, aDw
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/UI/Window/UINewSkillListWndHitTest.cpp
2026-10-31 07:13:29 +00:00

27 lines
558 B
C++

#include "UI/Window/UINewSkillListWnd.h"
#include "UI/Window/WindowMouseHit.h"
// OFFSET: 0x009B0240
// FUNCTION: fn_13804
int UINewSkillListWnd::SkillIndexAt(int x, int y) {
if (!this->IsSkillArea(x, y)) {
return -1;
}
int column = 0;
int row;
if (g_mouseRefreshGate != 0) {
row = (y - 34) / 32;
} else {
column = (x - 76) / 68;
row = (y - 44) / 56;
if (x > column * 68 + 100) {
return -1;
}
if (y > row * 56 + 58) {
return -1;
}
}
return (this->m_firstRow + row) * this->m_columns + column;
}