From 1bbbbbb406bc0e201932215f021594e3f5dec66d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 08:40:34 +0000 Subject: [PATCH] Decompile 5 functions in Source/UI/Window/UIControl.cpp Batch #12025 by Yommy: 0 byte-identical, 5 confirmed by peer review. - fn_14023 CUIListBoxEx::AddNewItem: logic confirmed by peer review - fn_14024 CUIListBoxEx::AddNewItem: logic confirmed by peer review - fn_14025 CUIListBoxEx::AddNewItem: logic confirmed by peer review - fn_14026 CUIListBoxEx::AddNewItem: logic confirmed by peer review - fn_14506 CUIResizer::Slot27: logic confirmed by peer review Peer-reviewed-by: KWDev, SapitoSucio, raiken Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/UIControl.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index 0f9e7945..5182f3bb 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -1728,12 +1728,12 @@ void CUIListBoxEx::AddNe this->items.clear(); this->selected = static_cast(-1); - if (this->rowHeight <= this->geometry.height) { + if (this->geometry.height >= this->rowHeight) { unsigned count = static_cast(this->geometry.height / this->rowHeight) + 1; - if (this->geometry.height % this->rowHeight > 1) { + if (this->geometry.height % this->rowHeight >= 2) { ++count; } - this->items.resize(count, nullptr); + this->items.resize(count); for (AdventureGuide::CUIItemInfo*& slot : this->items) { AdventureGuide::CUIItemInfo* item = new AdventureGuide::CUIItemInfo(); item->SetSize(this->itemWidth, this->rowHeight); @@ -1794,12 +1794,12 @@ void CUIListBoxEx: this->items.clear(); this->selected = static_cast(-1); - if (this->rowHeight <= this->geometry.height) { + if (this->geometry.height >= this->rowHeight) { unsigned count = static_cast(this->geometry.height / this->rowHeight) + 1; - if (this->geometry.height % this->rowHeight > 1) { + if (this->geometry.height % this->rowHeight >= 2) { ++count; } - this->items.resize(count, nullptr); + this->items.resize(count); for (AdventureGuide::CUIMonsterInfo*& slot : this->items) { AdventureGuide::CUIMonsterInfo* item = new AdventureGuide::CUIMonsterInfo(); item->SetSize(this->itemWidth, this->rowHeight); @@ -1860,12 +1860,12 @@ void CUIListBoxEx::Add this->items.clear(); this->selected = static_cast(-1); - if (this->rowHeight <= this->geometry.height) { + if (this->geometry.height >= this->rowHeight) { unsigned count = static_cast(this->geometry.height / this->rowHeight) + 1; - if (this->geometry.height % this->rowHeight > 1) { + if (this->geometry.height % this->rowHeight >= 2) { ++count; } - this->items.resize(count, nullptr); + this->items.resize(count); for (AdventureGuide::CUIQuestInfo*& slot : this->items) { AdventureGuide::CUIQuestInfo* item = new AdventureGuide::CUIQuestInfo(); item->SetSize(this->itemWidth, this->rowHeight); @@ -1926,12 +1926,12 @@ void CUIListBoxEx::AddNewItem this->items.clear(); this->selected = static_cast(-1); - if (this->rowHeight <= this->geometry.height) { + if (this->geometry.height >= this->rowHeight) { unsigned count = static_cast(this->geometry.height / this->rowHeight) + 1; - if (this->geometry.height % this->rowHeight > 1) { + if (this->geometry.height % this->rowHeight >= 2) { ++count; } - this->items.resize(count, nullptr); + this->items.resize(count); for (AdventureGuide::CUITabInfo*& slot : this->items) { AdventureGuide::CUITabInfo* item = new AdventureGuide::CUITabInfo(); item->SetSize(this->itemWidth, this->rowHeight); @@ -2547,10 +2547,12 @@ void CUIResizer::Slot27(int x, int y) { return; } - this->ToScreen(x, y); + int screenX = x; + int screenY = y; + this->ToScreen(screenX, screenY); - const int rows = static_cast(std::roundf(static_cast(y - this->startY) / static_cast(this->stepY)) * static_cast(this->stepY)); - int width = static_cast(std::roundf(static_cast(x - this->startX) / static_cast(this->stepX)) * static_cast(this->stepX)) + this->startWidth; + const int rows = static_cast(std::roundf(static_cast(screenY - this->startY) / static_cast(this->stepY)) * static_cast(this->stepY)); + int width = static_cast(std::roundf(static_cast(screenX - this->startX) / static_cast(this->stepX)) * static_cast(this->stepX)) + this->startWidth; if (width > this->maxWidth) { width = this->maxWidth; } else if (width < this->minWidth) {