Decompile 5 functions in Source/UI/Exchange/UIExchangeUI.cpp, Source/UI/Items/UIEquipmentPropertiesWnd.cpp, ...

Batch #17677 by eAthena: 5 byte-identical, 0 confirmed by peer review.

- fn_15200 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::OnScroll: byte-identical
- fn_15042 CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::OnScroll: byte-identical
- fn_16444 CUIListBoxEx<RenewQuestUI::CUIQuestItem,unsigned long>::OnScroll: byte-identical
- fn_16676 CUIListBoxEx<SelectPackageItemBox::CUIItemInfo,ITEM_INFO>::OnScroll: byte-identical
- fn_16677 CUIListBoxEx<SelectPackageItemBox::CUITabInfo,SelectPackageItemBox::CTabInfoData>::OnScroll: byte-identical

Merged automatically: every function is byte-identical to the original.
This commit is contained in:
ragnarok-clanker 2026-11-12 01:57:50 +00:00
commit b4be3a2a61
4 changed files with 66 additions and 63 deletions

View file

@ -149,20 +149,18 @@ void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::OnWheel(int value
// FUNCTION: fn_15200
template <>
void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::OnScroll(int position) {
auto it = this->items.begin();
if (it == this->items.end()) {
if (this->items.empty()) {
return;
}
if (this->data.size() == 0) {
for (; it != this->items.end(); ++it) {
ExchangeUI::CUIItem* item = *it;
for (auto* item : this->items) {
item->index = -1;
item->Show(0);
}
return;
}
const int first = (*it)->index;
const int first = this->items.front()->index;
unsigned int row = position / this->rowHeight;
if (first != -1) {
if (first < static_cast<int>(row)) {
@ -170,13 +168,14 @@ void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::OnScroll(int posi
std::rotate(this->items.begin(), this->items.begin() + (row - first), this->items.end());
}
} else if (first > static_cast<int>(row)) {
if (first - row < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - (first - row), this->items.end());
const unsigned int shift = first - row;
if (shift < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - shift, this->items.end());
}
}
}
it = this->items.begin();
auto it = this->items.begin();
for (int y = this->itemY - position % this->rowHeight; y < this->geometry.height; y += this->rowHeight, ++it, ++row) {
if (it == this->items.end() || row >= this->data.size()) {
break;
@ -197,8 +196,8 @@ void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::OnScroll(int posi
}
}
for (; it != this->items.end(); ++it) {
ExchangeUI::CUIItem* item = *it;
for (const auto end = this->items.end(); it != end; ++it) {
auto* const item = *it;
item->index = -1;
item->Show(0);
}

View file

@ -157,19 +157,18 @@ void CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine, std::s
// FUNCTION: fn_15042
template <>
void CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine, std::string>::OnScroll(int position) {
auto it = this->items.begin();
if (it == this->items.end()) {
if (this->items.empty()) {
return;
}
if (this->data.size() == 0) {
for (; it != this->items.end(); ++it) {
(*it)->index = -1;
(*it)->Show(0);
for (auto* item : this->items) {
item->index = -1;
item->Show(0);
}
return;
}
const int first = (*it)->index;
const int first = this->items.front()->index;
unsigned int row = position / this->rowHeight;
if (first != -1) {
if (first < static_cast<int>(row)) {
@ -177,13 +176,14 @@ void CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine, std::s
std::rotate(this->items.begin(), this->items.begin() + (row - first), this->items.end());
}
} else if (first > static_cast<int>(row)) {
if (first - row < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - (first - row), this->items.end());
const unsigned int shift = first - row;
if (shift < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - shift, this->items.end());
}
}
}
it = this->items.begin();
auto it = this->items.begin();
for (int y = this->itemY - position % this->rowHeight; y < this->geometry.height; y += this->rowHeight, ++it, ++row) {
if (it == this->items.end() || row >= this->data.size()) {
break;
@ -204,8 +204,8 @@ void CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine, std::s
}
}
for (auto end = this->items.end(); it != end; ++it) {
EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine* item = *it;
for (const auto end = this->items.end(); it != end; ++it) {
auto* const item = *it;
item->index = -1;
item->Show(0);
}

View file

@ -721,44 +721,45 @@ void CUIListBoxEx<RenewQuestUI::CUIQuestItem, unsigned long>::ClearItems() {
// FUNCTION: fn_16444
template <>
void CUIListBoxEx<RenewQuestUI::CUIQuestItem, unsigned long>::OnScroll(int position) {
auto it = this->items.begin();
if (it == this->items.end()) {
if (this->items.empty()) {
return;
}
if (this->data.size() == 0) {
for (; it != this->items.end(); ++it) {
RenewQuestUI::CUIQuestItem* item = *it;
for (auto* item : this->items) {
item->index = -1;
item->Show(0);
}
return;
}
const int first = (*it)->index;
int row = position / this->rowHeight;
const int first = this->items.front()->index;
unsigned int row = position / this->rowHeight;
if (first != -1) {
if (first < row) {
if (static_cast<unsigned int>(row - first) < this->items.size()) {
if (first < static_cast<int>(row)) {
if (row - first < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.begin() + (row - first), this->items.end());
}
} else if (first > row) {
if (static_cast<unsigned int>(first - row) < this->items.size()) {
std::rotate(this->items.begin(), this->items.end() - (first - row), this->items.end());
} else if (first > static_cast<int>(row)) {
const unsigned int shift = first - row;
if (shift < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - shift, this->items.end());
}
}
}
it = this->items.begin();
auto it = this->items.begin();
for (int y = this->itemY - position % this->rowHeight; y < this->geometry.height; y += this->rowHeight, ++it, ++row) {
if (it == this->items.end() || static_cast<unsigned int>(row) >= this->data.size()) {
if (it == this->items.end() || row >= this->data.size()) {
break;
}
RenewQuestUI::CUIQuestItem* item = *it;
if (item) {
if (this->rebind || row != item->index) {
if (this->rebind || row != static_cast<unsigned int>(item->index)) {
item->index = row;
if (this->binder) {
this->binder(item, *std::next(this->data.begin(), row));
auto node = this->data.begin();
std::advance(node, static_cast<int>(row));
this->binder(item, *node);
}
}
item->SetSelected(row == this->selected);
@ -767,9 +768,10 @@ void CUIListBoxEx<RenewQuestUI::CUIQuestItem, unsigned long>::OnScroll(int posit
}
}
for (; it != this->items.end(); ++it) {
(*it)->index = -1;
(*it)->Show(0);
for (const auto end = this->items.end(); it != end; ++it) {
auto* const item = *it;
item->index = -1;
item->Show(0);
}
}

View file

@ -366,19 +366,18 @@ void CUIListBoxEx<SelectPackageItemBox::CUITabInfo, SelectPackageItemBox::CTabIn
// FUNCTION: fn_16676
template <>
void CUIListBoxEx<SelectPackageItemBox::CUIItemInfo, ITEM_INFO>::OnScroll(int position) {
auto it = this->items.begin();
if (it == this->items.end()) {
if (this->items.empty()) {
return;
}
if (this->data.size() == 0) {
for (; it != this->items.end(); ++it) {
(*it)->index = -1;
(*it)->Show(0);
for (auto* item : this->items) {
item->index = -1;
item->Show(0);
}
return;
}
const int first = (*it)->index;
const int first = this->items.front()->index;
unsigned int row = position / this->rowHeight;
if (first != -1) {
if (first < static_cast<int>(row)) {
@ -386,13 +385,14 @@ void CUIListBoxEx<SelectPackageItemBox::CUIItemInfo, ITEM_INFO>::OnScroll(int po
std::rotate(this->items.begin(), this->items.begin() + (row - first), this->items.end());
}
} else if (first > static_cast<int>(row)) {
if (first - row < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - (first - row), this->items.end());
const unsigned int shift = first - row;
if (shift < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - shift, this->items.end());
}
}
}
it = this->items.begin();
auto it = this->items.begin();
for (int y = this->itemY - position % this->rowHeight; y < this->geometry.height; y += this->rowHeight, ++it, ++row) {
if (it == this->items.end() || row >= this->data.size()) {
break;
@ -413,9 +413,10 @@ void CUIListBoxEx<SelectPackageItemBox::CUIItemInfo, ITEM_INFO>::OnScroll(int po
}
}
for (; it != this->items.end(); ++it) {
(*it)->index = -1;
(*it)->Show(0);
for (const auto end = this->items.end(); it != end; ++it) {
auto* const item = *it;
item->index = -1;
item->Show(0);
}
}
@ -423,19 +424,18 @@ void CUIListBoxEx<SelectPackageItemBox::CUIItemInfo, ITEM_INFO>::OnScroll(int po
// FUNCTION: fn_16677
template <>
void CUIListBoxEx<SelectPackageItemBox::CUITabInfo, SelectPackageItemBox::CTabInfoData>::OnScroll(int position) {
auto it = this->items.begin();
if (it == this->items.end()) {
if (this->items.empty()) {
return;
}
if (this->data.size() == 0) {
for (; it != this->items.end(); ++it) {
(*it)->index = -1;
(*it)->Show(0);
for (auto* item : this->items) {
item->index = -1;
item->Show(0);
}
return;
}
const int first = (*it)->index;
const int first = this->items.front()->index;
unsigned int row = position / this->rowHeight;
if (first != -1) {
if (first < static_cast<int>(row)) {
@ -443,13 +443,14 @@ void CUIListBoxEx<SelectPackageItemBox::CUITabInfo, SelectPackageItemBox::CTabIn
std::rotate(this->items.begin(), this->items.begin() + (row - first), this->items.end());
}
} else if (first > static_cast<int>(row)) {
if (first - row < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - (first - row), this->items.end());
const unsigned int shift = first - row;
if (shift < static_cast<unsigned int>(this->items.size())) {
std::rotate(this->items.begin(), this->items.end() - shift, this->items.end());
}
}
}
it = this->items.begin();
auto it = this->items.begin();
for (int y = this->itemY - position % this->rowHeight; y < this->geometry.height; y += this->rowHeight, ++it, ++row) {
if (it == this->items.end() || row >= this->data.size()) {
break;
@ -470,9 +471,10 @@ void CUIListBoxEx<SelectPackageItemBox::CUITabInfo, SelectPackageItemBox::CTabIn
}
}
for (; it != this->items.end(); ++it) {
(*it)->index = -1;
(*it)->Show(0);
for (const auto end = this->items.end(); it != end; ++it) {
auto* const item = *it;
item->index = -1;
item->Show(0);
}
}