Decompile 2 functions in Source/UI/Window/UIHotKeyWnd.cpp, Source/UI/Window/UIHotKeyWnd.h, ...

Batch #8292 by pedrao: 0 byte-identical, 2 confirmed by peer review.

- fn_12609 UIHotKeyWnd::RowFromPoint: logic confirmed by peer review
- fn_12693 UIHotKeyWnd::Slot25: logic confirmed by peer review

Peer-reviewed-by: eAthena, System4z
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-31 16:17:04 +00:00
commit 5f2aa63bb7
3 changed files with 124 additions and 0 deletions

View file

@ -1,9 +1,12 @@
#include "UI/Window/UIHotKeyWnd.h"
#include "Client/Session.h"
#include "Contents/MessageTable.h"
#include "Script/LuaScript.h"
#include "UI/Buttons/UIButton.h"
#include "UI/Text/UIBalloonText.h"
#include "UI/Window/UIWindowMgr.h"
#include "UI/Window/WindowOrdering.h"
#include "Utility/Text/FormatString.h"
#include <cstring>
@ -57,3 +60,121 @@ void UIHotKeyWnd::SaveHotkeys() {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(message), 0xFFFF, 1, 0, 0);
}
}
// OFFSET: 0x0091BD80
// FUNCTION: fn_12609
int UIHotKeyWnd::RowFromPoint(int x, int y) {
if (x < this->unknown_00C8 || x > this->geometry.width - this->unknown_00C8) {
return -1;
}
if (y < this->unknown_00C4 + this->unknown_00BC + this->unknown_00CC) {
return -1;
}
if (y > (this->geometry.height - this->unknown_00C0) - this->unknown_00CC) {
return -1;
}
int row = (((y - this->unknown_00BC) - this->unknown_00C4) - this->unknown_00CC) / this->unknown_00D0;
if (x > this->geometry.width / 2) {
row += this->m_rowsPerPage;
}
int count = 0;
if (g_session.m_hotkeyScript->Call("GetOriginalHotKeyListSize", "d>d", this->m_tab + 1, &count) && this->m_tab == 1) {
int hidden = 0;
for (int index = 30; index < count; ++index) {
switch (index) {
case 30:
case 33:
case 34:
case 36:
case 43:
case 45:
case 53:
case 58:
case 62:
case 64:
case 65:
case 66:
case 67:
++hidden;
break;
default:
break;
}
}
count -= hidden;
}
if (row < count) {
return row;
}
return -1;
}
// OFFSET: 0x00930B80
// FUNCTION: fn_12693
void UIHotKeyWnd::Slot25(int x, int y) {
if (y < this->unknown_00BC) {
UIFrameWnd::Slot25(x, y);
}
const int previous = this->m_selectedRow;
this->m_selectedRow = this->RowFromPoint(x, y);
int count = 0;
if (g_session.m_hotkeyScript->Call("GetOriginalHotKeyListSize", "d>d", this->m_tab + 1, &count) && this->m_tab == 1) {
int hidden = 0;
for (int index = 30; index < count; ++index) {
switch (index) {
case 30:
case 33:
case 34:
case 36:
case 43:
case 45:
case 53:
case 58:
case 62:
case 64:
case 65:
case 66:
case 67:
++hidden;
break;
default:
break;
}
}
count -= hidden;
}
if (this->m_selectedRow + (this->m_page * 9 - 9) * 4 < count) {
if (this->m_selectedRow < 0) {
this->m_balloon->Show(0);
} else {
int screenX = 0;
int screenY = 0;
this->ToScreen(screenX, screenY);
const char* text = LookupMessage(0x5CE);
this->m_balloon->SetText(text, 0x3C);
this->m_balloon->m_textColor = 0xFFFFFF;
this->m_balloon->m_outlineColor = 0;
this->m_balloon->Move(
(this->geometry.width - this->m_balloon->geometry.width) / 2 + screenX,
(this->m_selectedRow % this->m_rowsPerPage - 1) * this->unknown_00D0 + this->unknown_00CC + this->unknown_00C4 + screenY + this->unknown_00BC
);
this->m_balloon->Show(1);
reinterpret_cast<WindowOrdering&>(g_windowMgr).Promote(this->m_balloon);
}
if (previous == this->m_selectedRow) {
return;
}
}
this->Invalidate();
}