Decompile fn_12608 (UISerachStoreInfoWnd::ItemAt)
Batch #8647 by youko: 0 byte-identical, 1 confirmed by peer review. - fn_12608 UISerachStoreInfoWnd::ItemAt: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, eAthena, gordaoprogramas Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
b4241e653f
commit
eddf7e34b4
2 changed files with 33 additions and 1 deletions
|
|
@ -40,6 +40,13 @@ struct SearchStoreQueryPacket {
|
|||
|
||||
static_assert(offsetof(SearchStoreQueryPacket, ids) == 0xF);
|
||||
|
||||
struct SearchStoreResult {
|
||||
/* 0000 */ unsigned char unknown_0000[0x60];
|
||||
/* 0060 */ ITEM_INFO item;
|
||||
};
|
||||
|
||||
static_assert(sizeof(SearchStoreResult) == sizeof(SessionEntry5BD4));
|
||||
|
||||
// OFFSET: 0x009121F0
|
||||
// FUNCTION: fn_12527
|
||||
UISerachStoreInfoWnd::UISerachStoreInfoWnd()
|
||||
|
|
@ -48,6 +55,31 @@ UISerachStoreInfoWnd::UISerachStoreInfoWnd()
|
|||
this->unknown_00F0.clear();
|
||||
}
|
||||
|
||||
// OFFSET: 0x0091BBC0
|
||||
// FUNCTION: fn_12608
|
||||
ITEM_INFO UISerachStoreInfoWnd::ItemAt(int x, int y) {
|
||||
ITEM_INFO item(0);
|
||||
this->unknown_00E0 = -1;
|
||||
if (g_session.unknown_5BD4.empty()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
if (x > 5 && x < this->geometry.width - 10 && y > 100 && y < (this->unknown_00E8 + 10) * 10) {
|
||||
const int row = (y - 100) / this->unknown_00E8;
|
||||
this->unknown_00E0 = row;
|
||||
const unsigned int index = row + (this->unknown_00DC - 1) * 10;
|
||||
if (index >= g_session.unknown_5BD4.size()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
std::vector<SessionEntry5BD4>::iterator it = g_session.unknown_5BD4.begin() + index;
|
||||
if (it != g_session.unknown_5BD4.end()) {
|
||||
item = reinterpret_cast<const SearchStoreResult&>(*it).item;
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
// OFFSET: 0x009296E0
|
||||
// FUNCTION: fn_12653
|
||||
void UISerachStoreInfoWnd::Slot15(int width, int height) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public:
|
|||
void Paint() override;
|
||||
void Slot32(int x, int y) override;
|
||||
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
|
||||
ITEM_INFO ItemAt(int x, int y);
|
||||
__declspec(noinline) ITEM_INFO ItemAt(int x, int y);
|
||||
|
||||
protected:
|
||||
/* 00B4 */ UIRadioBtn* m_radios[2];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue