rodecomp/Source/UI/MiniPartyPlacement.cpp
ragnarok-clanker 2c9f3270f9 Decompile 2 functions in Source/UI/MiniPartyPlacement.cpp, Source/UI/MiniPartyPlacement.h
Batch #1206 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_07650 CMiniPartyWndSortArea::CMiniPartyWndSortArea: logic confirmed by peer review
- fn_07658 CMiniPartyWndSortArea::GetCells: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
Adds to the build: Source/UI/MiniPartyPlacement.cpp
2026-10-27 21:09:35 +00:00

28 lines
1 KiB
C++

#include "UI/MiniPartyPlacement.h"
#include "UI/MiniPartyGrid.h"
#include "UI/Window/UIWindowMgr.h"
// OFFSET: 0x00737680
// FUNCTION: fn_07650
CMiniPartyWndSortArea::CMiniPartyWndSortArea(const RECT& bounds) {
SetRect(&this->area, 0, 0, g_windowMgr.unknown_047C, g_windowMgr.unknown_0480);
this->columns = (this->area.right - this->area.left) / g_miniPartyCellWidth;
this->rows = (this->area.bottom - this->area.top) / g_miniPartyCellHeight;
const RECT target = bounds;
for (int index = 0; index < this->columns * this->rows; ++index) {
const int x = this->area.left + g_miniPartyCellWidth * (index / this->rows);
const int y = this->area.top + g_miniPartyCellHeight * (index % this->rows);
if (target.left <= x && x + g_miniPartyCellWidth <= target.right && target.top <= y && y + g_miniPartyCellHeight <= target.bottom) {
this->cells.push_back(index);
}
}
}
// OFFSET: 0x00737D40
// FUNCTION: fn_07658
std::list<int> CMiniPartyWndSortArea::GetCells() const {
return this->cells;
}